From 39d8ec3aa1ef5d37164db1a81ea7532e02ab9036 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Hern=C3=A1ndez=20Serrano?= Date: Fri, 28 Apr 2023 10:53:17 +0200 Subject: [PATCH] typings reverted tio support older TS 4 versions --- dist/bundle.esm.js | 640 ++++++++++-------- dist/bundle.esm.min.js | 8 +- dist/bundle.iife.js | 22 +- dist/bundle.umd.js | 22 +- dist/index.browser.esm.js | 4 +- dist/index.d.ts | 362 +++++++--- dist/index.node.cjs | 4 +- dist/index.node.esm.js | 4 +- docs/API.md | 66 +- .../ConflictResolution.ConflictResolver.md | 10 +- docs/classes/EthersIoAgentDest.md | 14 +- docs/classes/EthersIoAgentOrig.md | 22 +- docs/classes/I3mServerWalletAgentDest.md | 18 +- docs/classes/I3mServerWalletAgentOrig.md | 24 +- docs/classes/I3mWalletAgentDest.md | 18 +- docs/classes/I3mWalletAgentOrig.md | 24 +- ...nRepudiationProtocol.NonRepudiationDest.md | 30 +- ...nRepudiationProtocol.NonRepudiationOrig.md | 24 +- docs/classes/NrError.md | 6 +- docs/classes/Signers.EthersIoAgentDest.md | 14 +- docs/classes/Signers.EthersIoAgentOrig.md | 22 +- .../Signers.I3mServerWalletAgentDest.md | 18 +- .../Signers.I3mServerWalletAgentOrig.md | 24 +- docs/classes/Signers.I3mWalletAgentDest.md | 18 +- docs/classes/Signers.I3mWalletAgentOrig.md | 24 +- docs/interfaces/Algs.md | 6 +- docs/interfaces/Block.md | 12 +- .../ConflictResolutionRequestPayload.md | 10 +- docs/interfaces/ContractConfig.md | 4 +- docs/interfaces/DataExchange.md | 2 +- docs/interfaces/DecodedProof.md | 6 +- docs/interfaces/DisputeRequestPayload.md | 14 +- docs/interfaces/DisputeResolutionPayload.md | 14 +- docs/interfaces/DltConfig.md | 6 +- docs/interfaces/JWK.md | 2 +- docs/interfaces/JwkPair.md | 4 +- docs/interfaces/NrProofPayload.md | 8 +- docs/interfaces/NrpDltAgentDest.md | 4 +- docs/interfaces/NrpDltAgentOrig.md | 8 +- docs/interfaces/OrigBlock.md | 12 +- docs/interfaces/PoOPayload.md | 8 +- docs/interfaces/PoPPayload.md | 14 +- docs/interfaces/PoRPayload.md | 10 +- docs/interfaces/ProofPayload.md | 6 +- docs/interfaces/ResolutionPayload.md | 14 +- docs/interfaces/Signers.NrpDltAgentDest.md | 4 +- docs/interfaces/Signers.NrpDltAgentOrig.md | 8 +- docs/interfaces/StoredProof.md | 4 +- docs/interfaces/TimestampVerifyOptions.md | 8 +- docs/interfaces/VerificationRequestPayload.md | 12 +- .../VerificationResolutionPayload.md | 14 +- docs/modules/ConflictResolution.md | 10 +- src/ts/types.ts | 3 +- 53 files changed, 978 insertions(+), 691 deletions(-) diff --git a/dist/bundle.esm.js b/dist/bundle.esm.js index c90dfc3..c2cce8e 100644 --- a/dist/bundle.esm.js +++ b/dist/bundle.esm.js @@ -1,8 +1,138 @@ -function e(e,r=!1,t=!0){let n="";n=(e=>{const r=[];for(let t=0;te.charCodeAt(0))));return r?(new TextDecoder).decode(n):n}} +const base64Encode = (bytes) => { + const CHUNK_SIZE = 0x8000; + const arr = []; + for (let i = 0; i < bytes.length; i += CHUNK_SIZE) { + arr.push(String.fromCharCode.apply(null, bytes.subarray(i, i + CHUNK_SIZE))); + } + return btoa(arr.join('')); +}; +const base64Decode = (encoded) => { + return new Uint8Array(atob(encoded) + .split('') + .map((c) => c.charCodeAt(0))); +}; + +function encode$4(input, urlsafe = false, padding = true) { + let base64 = ''; + { + const bytes = (typeof input === 'string') + ? (new TextEncoder()).encode(input) + : new Uint8Array(input); + base64 = base64Encode(bytes); + } + if (urlsafe) + base64 = base64ToBase64url(base64); + if (!padding) + base64 = removeBase64Padding(base64); + return base64; +} +function decode$5(base64, stringOutput = false) { + { + let urlsafe = false; + if (/^[0-9a-zA-Z_-]+={0,2}$/.test(base64)) { + urlsafe = true; + } + else if (!/^[0-9a-zA-Z+/]*={0,2}$/.test(base64)) { + throw new Error('Not a valid base64 input'); + } + if (urlsafe) + base64 = base64urlToBase64(base64); + const bytes = base64Decode(base64); + return stringOutput + ? (new TextDecoder()).decode(bytes) + : bytes; + } +} +function base64ToBase64url(base64) { + return base64.replace(/\+/g, '-').replace(/\//g, '_'); +} +function base64urlToBase64(base64url) { + return base64url.replace(/-/g, '+').replace(/_/g, '/').replace(/=/g, ''); +} +function removeBase64Padding(str) { + return str.replace(/=/g, ''); +} -function n$1(e,n=!1,t){const r=e.match(/^(0x)?([\da-fA-F]+)$/);if(null==r)throw new RangeError("input must be a hexadecimal string, e.g. '0x124fe3a' or '0214f1b2'");let o=r[2];if(void 0!==t){if(t{o+=a[e>>4]+a[15&e];})),n$1(o,t,r)}}function l(e,t=!1){let r=n$1(e);return r=n$1(e,!1,Math.ceil(r.length/2)),Uint8Array.from(r.match(/[\da-fA-F]{2}/g).map((e=>parseInt(e,16)))).buffer} +function parseHex$1(a, prefix0x = false, byteLength) { + const hexMatch = a.match(/^(0x)?([\da-fA-F]+)$/); + if (hexMatch == null) { + throw new RangeError('input must be a hexadecimal string, e.g. \'0x124fe3a\' or \'0214f1b2\''); + } + let hex = hexMatch[2]; + if (byteLength !== undefined) { + if (byteLength < hex.length / 2) { + throw new RangeError(`expected byte length ${byteLength} < input hex byte length ${Math.ceil(hex.length / 2)}`); + } + hex = hex.padStart(byteLength * 2, '0'); + } + return (prefix0x) ? '0x' + hex : hex; +} +function bufToHex(buf, prefix0x = false, byteLength) { + { + let s = ''; + const h = '0123456789abcdef'; + if (ArrayBuffer.isView(buf)) + buf = new Uint8Array(buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength)); + else + buf = new Uint8Array(buf); + buf.forEach((v) => { + s += h[v >> 4] + h[v & 15]; + }); + return parseHex$1(s, prefix0x, byteLength); + } +} +function hexToBuf(hexStr, returnArrayBuffer = false) { + let hex = parseHex$1(hexStr); + hex = parseHex$1(hexStr, false, Math.ceil(hex.length / 2)); + { + return Uint8Array.from(hex.match(/[\da-fA-F]{2}/g).map((h) => { + return parseInt(h, 16); + })).buffer; + } +} -function g(n,t=!1){if(n<1)throw new RangeError("byteLength MUST be > 0");return new Promise((function(e,r){{const r=new Uint8Array(n);if(n<=65536)self.crypto.getRandomValues(r);else for(let t=0;t 0");{const e=new Uint8Array(n);if(n<=65536)self.crypto.getRandomValues(e);else for(let t=0;t 0'); + return new Promise(function (resolve, reject) { + { + const buf = new Uint8Array(byteLength); + if (byteLength <= 65536) { + self.crypto.getRandomValues(buf); + } + else { + for (let i = 0; i < Math.ceil(byteLength / 65536); i++) { + const begin = i * 65536; + const end = ((begin + 65535) < byteLength) ? begin + 65535 : byteLength - 1; + self.crypto.getRandomValues(buf.subarray(begin, end)); + } + } + if (forceLength) + buf[0] = buf[0] | 128; + resolve(buf); + } + }); +} +function randBytesSync(byteLength, forceLength = false) { + if (byteLength < 1) + throw new RangeError('byteLength MUST be > 0'); + { + const buf = new Uint8Array(byteLength); + if (byteLength <= 65536) { + self.crypto.getRandomValues(buf); + } + else { + for (let i = 0; i < Math.ceil(byteLength / 65536); i++) { + const begin = i * 65536; + const end = ((begin + 65535) < byteLength) ? begin + 65535 : byteLength - 1; + self.crypto.getRandomValues(buf.subarray(begin, end)); + } + } + if (forceLength) + buf[0] = buf[0] | 128; + return buf; + } +} var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; @@ -118,14 +248,12 @@ var bn$1 = {exports: {}}; var _nodeResolve_empty = {}; var _nodeResolve_empty$1 = /*#__PURE__*/Object.freeze({ - __proto__: null, - default: _nodeResolve_empty + __proto__: null, + default: _nodeResolve_empty }); var require$$0$1 = /*@__PURE__*/getAugmentedNamespace(_nodeResolve_empty$1); -bn$1.exports; - (function (module) { (function (module, exports) { @@ -3770,13 +3898,13 @@ var utils$m = {}; var brorand = {exports: {}}; -var r$3; +var r$2; brorand.exports = function rand(len) { - if (!r$3) - r$3 = new Rand(null); + if (!r$2) + r$2 = new Rand(null); - return r$3.generate(len); + return r$2.generate(len); }; function Rand(rand) { @@ -6853,7 +6981,7 @@ RIPEMD160.prototype._update = function update(msg, start) { for (var j = 0; j < 80; j++) { var T = sum32( rotl32( - sum32_4(A, f(j, B, C, D), msg[r$2[j] + start], K(j)), + sum32_4(A, f(j, B, C, D), msg[r$1[j] + start], K(j)), s[j]), E); A = E; @@ -6926,7 +7054,7 @@ function Kh(j) { return 0x00000000; } -var r$2 = [ +var r$1 = [ 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, @@ -8997,10 +9125,10 @@ async function generateKeys(alg, privateKey, base64) { if (privateKey !== undefined) { if (typeof privateKey === 'string') { if (base64 === true) { - privKeyBuf = r$4(privateKey); + privKeyBuf = decode$5(privateKey); } else { - privKeyBuf = new Uint8Array(l(privateKey)); + privKeyBuf = new Uint8Array(hexToBuf(privateKey)); } } else { @@ -9008,7 +9136,7 @@ async function generateKeys(alg, privateKey, base64) { } } else { - privKeyBuf = new Uint8Array(await g(keyLength)); + privKeyBuf = new Uint8Array(await randBytes(keyLength)); } const ec = new Ec('p' + namedCurve.substring(namedCurve.length - 3)); const ecPriv = ec.keyFromPrivate(privKeyBuf); @@ -9016,9 +9144,9 @@ async function generateKeys(alg, privateKey, base64) { const xHex = ecPub.getX().toString('hex').padStart(keyLength * 2, '0'); const yHex = ecPub.getY().toString('hex').padStart(keyLength * 2, '0'); const dHex = ecPriv.getPrivate('hex').padStart(keyLength * 2, '0'); - const x = e(l(xHex), true, false); - const y = e(l(yHex), true, false); - const d = e(l(dHex), true, false); + const x = encode$4(hexToBuf(xHex), true, false); + const y = encode$4(hexToBuf(yHex), true, false); + const d = encode$4(hexToBuf(dHex), true, false); const privateJwk = { kty: 'EC', crv: namedCurve, x, y, d, alg }; const publicJwk = { ...privateJwk }; delete publicJwk.d; @@ -9585,7 +9713,7 @@ const isDisjoint = (...headers) => { function isObjectLike(value) { return typeof value === 'object' && value !== null; } -function isObject$1(input) { +function isObject$2(input) { if (!isObjectLike(input) || Object.prototype.toString.call(input) !== '[object Object]') { return false; } @@ -9949,7 +10077,7 @@ var asKeyObject = parse$1; async function importJWK(jwk, alg, octAsKeyObject) { var _a; - if (!isObject$1(jwk)) { + if (!isObject$2(jwk)) { throw new TypeError('JWK must be an object'); } alg || (alg = jwk.alg); @@ -10103,7 +10231,7 @@ async function decryptKeyManagement(alg, key, encryptedKey, joseHeader, options) case 'ECDH-ES+A128KW': case 'ECDH-ES+A192KW': case 'ECDH-ES+A256KW': { - if (!isObject$1(joseHeader.epk)) + if (!isObject$2(joseHeader.epk)) throw new JWEInvalid(`JOSE Header "epk" (Ephemeral Public Key) missing or invalid`); if (!ecdhAllowed(key)) throw new JOSENotSupported('ECDH with the provided key is not allowed or not supported by your javascript runtime'); @@ -10222,7 +10350,7 @@ const validateAlgorithms = (option, algorithms) => { async function flattenedDecrypt(jwe, key, options) { var _a; - if (!isObject$1(jwe)) { + if (!isObject$2(jwe)) { throw new JWEInvalid('Flattened JWE must be an object'); } if (jwe.protected === undefined && jwe.header === undefined && jwe.unprotected === undefined) { @@ -10246,10 +10374,10 @@ async function flattenedDecrypt(jwe, key, options) { if (jwe.aad !== undefined && typeof jwe.aad !== 'string') { throw new JWEInvalid('JWE AAD incorrect type'); } - if (jwe.header !== undefined && !isObject$1(jwe.header)) { + if (jwe.header !== undefined && !isObject$2(jwe.header)) { throw new JWEInvalid('JWE Shared Unprotected Header incorrect type'); } - if (jwe.unprotected !== undefined && !isObject$1(jwe.unprotected)) { + if (jwe.unprotected !== undefined && !isObject$2(jwe.unprotected)) { throw new JWEInvalid('JWE Per-Recipient Unprotected Header incorrect type'); } let parsedProt; @@ -10694,7 +10822,7 @@ const verify = async (alg, key, signature, data) => { async function flattenedVerify(jws, key, options) { var _a; - if (!isObject$1(jws)) { + if (!isObject$2(jws)) { throw new JWSInvalid('Flattened JWS must be an object'); } if (jws.protected === undefined && jws.header === undefined) { @@ -10709,7 +10837,7 @@ async function flattenedVerify(jws, key, options) { if (typeof jws.signature !== 'string') { throw new JWSInvalid('JWS Signature missing or incorrect type'); } - if (jws.header !== undefined && !isObject$1(jws.header)) { + if (jws.header !== undefined && !isObject$2(jws.header)) { throw new JWSInvalid('JWS Unprotected Header incorrect type'); } let parsedProt = {}; @@ -10808,10 +10936,10 @@ async function compactVerify(jws, key, options) { } async function generalVerify(jws, key, options) { - if (!isObject$1(jws)) { + if (!isObject$2(jws)) { throw new JWSInvalid('General JWS must be an object'); } - if (!Array.isArray(jws.signatures) || !jws.signatures.every(isObject$1)) { + if (!Array.isArray(jws.signatures) || !jws.signatures.every(isObject$2)) { throw new JWSInvalid('JWS Signatures missing or incorrect type'); } for (const signature of jws.signatures) { @@ -10899,29 +11027,18 @@ var jwtPayload = (protectedHeader, encodedPayload, options = {}) => { } catch (_a) { } - if (!isObject$1(payload)) { + if (!isObject$2(payload)) { throw new JWTInvalid('JWT Claims Set must be a top-level JSON object'); } - const { requiredClaims = [], issuer, subject, audience, maxTokenAge } = options; - if (maxTokenAge !== undefined) - requiredClaims.push('iat'); - if (audience !== undefined) - requiredClaims.push('aud'); - if (subject !== undefined) - requiredClaims.push('sub'); - if (issuer !== undefined) - requiredClaims.push('iss'); - for (const claim of new Set(requiredClaims.reverse())) { - if (!(claim in payload)) { - throw new JWTClaimValidationFailed(`missing required "${claim}" claim`, claim, 'missing'); - } - } + const { issuer } = options; if (issuer && !(Array.isArray(issuer) ? issuer : [issuer]).includes(payload.iss)) { throw new JWTClaimValidationFailed('unexpected "iss" claim value', 'iss', 'check_failed'); } + const { subject } = options; if (subject && payload.sub !== subject) { throw new JWTClaimValidationFailed('unexpected "sub" claim value', 'sub', 'check_failed'); } + const { audience } = options; if (audience && !checkAudiencePresence(payload.aud, typeof audience === 'string' ? [audience] : audience)) { throw new JWTClaimValidationFailed('unexpected "aud" claim value', 'aud', 'check_failed'); @@ -10942,7 +11059,7 @@ var jwtPayload = (protectedHeader, encodedPayload, options = {}) => { } const { currentDate } = options; const now = epoch(currentDate || new Date()); - if ((payload.iat !== undefined || maxTokenAge) && typeof payload.iat !== 'number') { + if ((payload.iat !== undefined || options.maxTokenAge) && typeof payload.iat !== 'number') { throw new JWTClaimValidationFailed('"iat" claim must be a number', 'iat', 'invalid'); } if (payload.nbf !== undefined) { @@ -10961,9 +11078,9 @@ var jwtPayload = (protectedHeader, encodedPayload, options = {}) => { throw new JWTExpired('"exp" claim timestamp check failed', 'exp', 'check_failed'); } } - if (maxTokenAge) { + if (options.maxTokenAge) { const age = now - payload.iat; - const max = typeof maxTokenAge === 'number' ? maxTokenAge : secs(maxTokenAge); + const max = typeof options.maxTokenAge === 'number' ? options.maxTokenAge : secs(options.maxTokenAge); if (age - tolerance > max) { throw new JWTExpired('"iat" claim timestamp check failed (too far in the past)', 'iat', 'check_failed'); } @@ -11181,7 +11298,7 @@ class GeneralSign { class ProduceJWT { constructor(payload) { - if (!isObject$1(payload)) { + if (!isObject$2(payload)) { throw new TypeError('JWT Claims Set MUST be an object'); } this._payload = payload; @@ -11272,7 +11389,7 @@ function decodeProtectedHeader(token) { throw new Error(); } const result = JSON.parse(decoder.decode(decode$3(protectedB64u))); - if (!isObject$1(result)) { + if (!isObject$2(result)) { throw new Error(); } return result; @@ -11404,8 +11521,8 @@ async function jwsDecode(jws, publicJwk) { let header; let payload; try { - header = JSON.parse(r$4(match[1], true)); - payload = JSON.parse(r$4(match[2], true)); + header = JSON.parse(decode$5(match[1], true)); + payload = JSON.parse(decode$5(match[2], true)); } catch (error) { throw new NrError(error, ['invalid format', 'not a compact jws']); @@ -11445,14 +11562,14 @@ async function oneTimeSecret(encAlg, secret, base64) { if (secret !== undefined) { if (typeof secret === 'string') { if (base64 === true) { - key = r$4(secret); + key = decode$5(secret); } else { - const parsedSecret = n$1(secret, false); - if (parsedSecret !== n$1(secret, false, secretLength)) { + const parsedSecret = parseHex$1(secret, false); + if (parsedSecret !== parseHex$1(secret, false, secretLength)) { throw new NrError(new RangeError(`Expected hex length ${secretLength * 2} does not meet provided one ${parsedSecret.length / 2}`), ['invalid key']); } - key = new Uint8Array(l(secret)); + key = new Uint8Array(hexToBuf(secret)); } } else { @@ -11472,7 +11589,7 @@ async function oneTimeSecret(encAlg, secret, base64) { } const jwk = await exportJWK(key); jwk.alg = encAlg; - return { jwk: jwk, hex: g$1(r$4(jwk.k), false, secretLength) }; + return { jwk: jwk, hex: bufToHex(decode$5(jwk.k), false, secretLength) }; } async function verifyKeyPair(pubJWK, privJWK) { @@ -11482,7 +11599,7 @@ async function verifyKeyPair(pubJWK, privJWK) { const pubKey = await importJwk(pubJWK); const privKey = await importJwk(privJWK); try { - const nonce = await g(16); + const nonce = await randBytes(16); const jws = await new GeneralSign(nonce) .addSignature(privKey) .setProtectedHeader({ alg: privJWK.alg }) @@ -11494,7 +11611,30 @@ async function verifyKeyPair(pubJWK, privJWK) { } } -function r$1(r){return null!=r&&"object"==typeof r&&!Array.isArray(r)}function n(t){return r$1(t)||Array.isArray(t)?Array.isArray(t)?t.map((t=>Array.isArray(t)||r$1(t)?n(t):t)):Object.keys(t).sort().map((r=>[r,n(t[r])])):t}function t(r){return JSON.stringify(n(r))} +function isObject$1(val) { + return (val != null) && (typeof val === 'object') && !(Array.isArray(val)); +} +function objectToArraySortedByKey(obj) { + if (!isObject$1(obj) && !Array.isArray(obj)) { + return obj; + } + if (Array.isArray(obj)) { + return obj.map((item) => { + if (Array.isArray(item) || isObject$1(item)) { + return objectToArraySortedByKey(item); + } + return item; + }); + } + return Object.keys(obj) + .sort() + .map((key) => { + return [key, objectToArraySortedByKey(obj[key])]; + }); +} +function hashable (obj) { + return JSON.stringify(objectToArraySortedByKey(obj)); +} function checkTimestamp(timestamp, notBefore, notAfter, tolerance = 2000) { if (timestamp < notBefore - tolerance) { @@ -11526,7 +11666,7 @@ function jsonSort(obj) { function parseHex(a, prefix0x = false, byteLength) { try { - return n$1(a, prefix0x, byteLength); + return parseHex$1(a, prefix0x, byteLength); } catch (error) { throw new NrError(error, ['invalid format']); @@ -11565,8 +11705,6 @@ async function sha(input, algorithm) { var bn = {exports: {}}; -bn.exports; - (function (module) { (function (module, exports) { @@ -15273,10 +15411,10 @@ Logger.errors = ErrorCode; Logger.levels = LogLevel; var lib_esm$k = /*#__PURE__*/Object.freeze({ - __proto__: null, - get ErrorCode () { return ErrorCode; }, - get LogLevel () { return LogLevel; }, - Logger: Logger + __proto__: null, + get ErrorCode () { return ErrorCode; }, + get LogLevel () { return LogLevel; }, + Logger: Logger }); const version$n = "bytes/5.7.0"; @@ -15688,23 +15826,23 @@ function joinSignature(signature) { } var lib_esm$j = /*#__PURE__*/Object.freeze({ - __proto__: null, - arrayify: arrayify, - concat: concat, - hexConcat: hexConcat, - hexDataLength: hexDataLength, - hexDataSlice: hexDataSlice, - hexStripZeros: hexStripZeros, - hexValue: hexValue, - hexZeroPad: hexZeroPad, - hexlify: hexlify, - isBytes: isBytes, - isBytesLike: isBytesLike, - isHexString: isHexString, - joinSignature: joinSignature, - splitSignature: splitSignature, - stripZeros: stripZeros, - zeroPad: zeroPad + __proto__: null, + arrayify: arrayify, + concat: concat, + hexConcat: hexConcat, + hexDataLength: hexDataLength, + hexDataSlice: hexDataSlice, + hexStripZeros: hexStripZeros, + hexValue: hexValue, + hexZeroPad: hexZeroPad, + hexlify: hexlify, + isBytes: isBytes, + isBytesLike: isBytesLike, + isHexString: isHexString, + joinSignature: joinSignature, + splitSignature: splitSignature, + stripZeros: stripZeros, + zeroPad: zeroPad }); const version$m = "bignumber/5.7.0"; @@ -16482,14 +16620,14 @@ class Description { } var lib_esm$i = /*#__PURE__*/Object.freeze({ - __proto__: null, - Description: Description, - checkProperties: checkProperties, - deepCopy: deepCopy, - defineReadOnly: defineReadOnly, - getStatic: getStatic, - resolveProperties: resolveProperties, - shallowCopy: shallowCopy + __proto__: null, + Description: Description, + checkProperties: checkProperties, + deepCopy: deepCopy, + defineReadOnly: defineReadOnly, + getStatic: getStatic, + resolveProperties: resolveProperties, + shallowCopy: shallowCopy }); const version$k = "abi/5.7.0"; @@ -18146,8 +18284,8 @@ function keccak256$1(data) { } var lib_esm$h = /*#__PURE__*/Object.freeze({ - __proto__: null, - keccak256: keccak256$1 + __proto__: null, + keccak256: keccak256$1 }); const version$j = "rlp/5.7.0"; @@ -18268,9 +18406,9 @@ function decode$2(data) { } var lib_esm$g = /*#__PURE__*/Object.freeze({ - __proto__: null, - decode: decode$2, - encode: encode$2 + __proto__: null, + decode: decode$2, + encode: encode$2 }); const version$i = "address/5.7.0"; @@ -18402,12 +18540,12 @@ function getCreate2Address(from, salt, initCodeHash) { } var lib_esm$f = /*#__PURE__*/Object.freeze({ - __proto__: null, - getAddress: getAddress, - getContractAddress: getContractAddress, - getCreate2Address: getCreate2Address, - getIcapAddress: getIcapAddress, - isAddress: isAddress + __proto__: null, + getAddress: getAddress, + getContractAddress: getContractAddress, + getCreate2Address: getCreate2Address, + getIcapAddress: getIcapAddress, + isAddress: isAddress }); class AddressCoder extends Coder { @@ -19234,17 +19372,17 @@ function nameprep(value) { } var lib_esm$e = /*#__PURE__*/Object.freeze({ - __proto__: null, - get UnicodeNormalizationForm () { return UnicodeNormalizationForm; }, - Utf8ErrorFuncs: Utf8ErrorFuncs, - get Utf8ErrorReason () { return Utf8ErrorReason; }, - _toEscapedUtf8String: _toEscapedUtf8String, - formatBytes32String: formatBytes32String, - nameprep: nameprep, - parseBytes32String: parseBytes32String, - toUtf8Bytes: toUtf8Bytes, - toUtf8CodePoints: toUtf8CodePoints, - toUtf8String: toUtf8String + __proto__: null, + get UnicodeNormalizationForm () { return UnicodeNormalizationForm; }, + Utf8ErrorFuncs: Utf8ErrorFuncs, + get Utf8ErrorReason () { return Utf8ErrorReason; }, + _toEscapedUtf8String: _toEscapedUtf8String, + formatBytes32String: formatBytes32String, + nameprep: nameprep, + parseBytes32String: parseBytes32String, + toUtf8Bytes: toUtf8Bytes, + toUtf8CodePoints: toUtf8CodePoints, + toUtf8String: toUtf8String }); class StringCoder extends DynamicBytesCoder { @@ -19419,9 +19557,9 @@ function encode$1(data) { } var lib_esm$d = /*#__PURE__*/Object.freeze({ - __proto__: null, - decode: decode$1, - encode: encode$1 + __proto__: null, + decode: decode$1, + encode: encode$1 }); /** @@ -20357,15 +20495,15 @@ class TypedDataEncoder { } var lib_esm$c = /*#__PURE__*/Object.freeze({ - __proto__: null, - _TypedDataEncoder: TypedDataEncoder, - dnsEncode: dnsEncode, - ensNormalize: ensNormalize, - hashMessage: hashMessage, - id: id$3, - isValidName: isValidName, - messagePrefix: messagePrefix, - namehash: namehash + __proto__: null, + _TypedDataEncoder: TypedDataEncoder, + dnsEncode: dnsEncode, + ensNormalize: ensNormalize, + hashMessage: hashMessage, + id: id$3, + isValidName: isValidName, + messagePrefix: messagePrefix, + namehash: namehash }); const logger$j = new Logger(version$k); @@ -20966,21 +21104,21 @@ class Interface { } var lib_esm$b = /*#__PURE__*/Object.freeze({ - __proto__: null, - AbiCoder: AbiCoder, - ConstructorFragment: ConstructorFragment, - ErrorFragment: ErrorFragment, - EventFragment: EventFragment, - FormatTypes: FormatTypes, - Fragment: Fragment, - FunctionFragment: FunctionFragment, - Indexed: Indexed, - Interface: Interface, - LogDescription: LogDescription, - ParamType: ParamType, - TransactionDescription: TransactionDescription, - checkResultErrors: checkResultErrors, - defaultAbiCoder: defaultAbiCoder + __proto__: null, + AbiCoder: AbiCoder, + ConstructorFragment: ConstructorFragment, + ErrorFragment: ErrorFragment, + EventFragment: EventFragment, + FormatTypes: FormatTypes, + Fragment: Fragment, + FunctionFragment: FunctionFragment, + Indexed: Indexed, + Interface: Interface, + LogDescription: LogDescription, + ParamType: ParamType, + TransactionDescription: TransactionDescription, + checkResultErrors: checkResultErrors, + defaultAbiCoder: defaultAbiCoder }); const version$f = "abstract-provider/5.7.0"; @@ -23849,10 +23987,10 @@ function computePublicKey(key, compressed) { } var lib_esm$a = /*#__PURE__*/Object.freeze({ - __proto__: null, - SigningKey: SigningKey, - computePublicKey: computePublicKey, - recoverPublicKey: recoverPublicKey + __proto__: null, + SigningKey: SigningKey, + computePublicKey: computePublicKey, + recoverPublicKey: recoverPublicKey }); const version$c = "transactions/5.7.0"; @@ -24227,13 +24365,13 @@ function parse(rawTransaction) { } var lib_esm$9 = /*#__PURE__*/Object.freeze({ - __proto__: null, - get TransactionTypes () { return TransactionTypes; }, - accessListify: accessListify, - computeAddress: computeAddress, - parse: parse, - recoverAddress: recoverAddress, - serialize: serialize + __proto__: null, + get TransactionTypes () { return TransactionTypes; }, + accessListify: accessListify, + computeAddress: computeAddress, + parse: parse, + recoverAddress: recoverAddress, + serialize: serialize }); const version$b = "contracts/5.7.0"; @@ -25235,10 +25373,10 @@ const Base58 = new BaseX("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuv //console.log(Base58.encode(Base58.decode("Qmd2V777o5XvJbYMeMb8k2nU5f8d3ciUQ5YpYuWhzv8iDj"))) var lib_esm$8 = /*#__PURE__*/Object.freeze({ - __proto__: null, - Base32: Base32, - Base58: Base58, - BaseX: BaseX + __proto__: null, + Base32: Base32, + Base58: Base58, + BaseX: BaseX }); var SupportedAlgorithm; @@ -25270,12 +25408,12 @@ function computeHmac(algorithm, key, data) { } var lib_esm$7 = /*#__PURE__*/Object.freeze({ - __proto__: null, - get SupportedAlgorithm () { return SupportedAlgorithm; }, - computeHmac: computeHmac, - ripemd160: ripemd160, - sha256: sha256$1, - sha512: sha512 + __proto__: null, + get SupportedAlgorithm () { return SupportedAlgorithm; }, + computeHmac: computeHmac, + ripemd160: ripemd160, + sha256: sha256$1, + sha512: sha512 }); function pbkdf2$1(password, salt, iterations, keylen, hashAlgorithm) { @@ -25707,14 +25845,14 @@ function getAccountPath(index) { } var lib_esm$6 = /*#__PURE__*/Object.freeze({ - __proto__: null, - HDNode: HDNode, - defaultPath: defaultPath, - entropyToMnemonic: entropyToMnemonic, - getAccountPath: getAccountPath, - isValidMnemonic: isValidMnemonic, - mnemonicToEntropy: mnemonicToEntropy, - mnemonicToSeed: mnemonicToSeed + __proto__: null, + HDNode: HDNode, + defaultPath: defaultPath, + entropyToMnemonic: entropyToMnemonic, + getAccountPath: getAccountPath, + isValidMnemonic: isValidMnemonic, + mnemonicToEntropy: mnemonicToEntropy, + mnemonicToSeed: mnemonicToSeed }); const version$7 = "random/5.7.0"; @@ -25768,9 +25906,9 @@ function shuffled(array) { } var lib_esm$5 = /*#__PURE__*/Object.freeze({ - __proto__: null, - randomBytes: randomBytes, - shuffled: shuffled + __proto__: null, + randomBytes: randomBytes, + shuffled: shuffled }); var aesJs = {exports: {}}; @@ -27523,16 +27661,16 @@ function decryptJsonWalletSync(json, password) { } var lib_esm$4 = /*#__PURE__*/Object.freeze({ - __proto__: null, - decryptCrowdsale: decrypt$1, - decryptJsonWallet: decryptJsonWallet, - decryptJsonWalletSync: decryptJsonWalletSync, - decryptKeystore: decrypt, - decryptKeystoreSync: decryptSync, - encryptKeystore: encrypt, - getJsonWalletAddress: getJsonWalletAddress, - isCrowdsaleWallet: isCrowdsaleWallet, - isKeystoreWallet: isKeystoreWallet + __proto__: null, + decryptCrowdsale: decrypt$1, + decryptJsonWallet: decryptJsonWallet, + decryptJsonWalletSync: decryptJsonWalletSync, + decryptKeystore: decrypt, + decryptKeystoreSync: decryptSync, + encryptKeystore: encrypt, + getJsonWalletAddress: getJsonWalletAddress, + isCrowdsaleWallet: isCrowdsaleWallet, + isKeystoreWallet: isKeystoreWallet }); const version$5 = "wallet/5.7.0"; @@ -27699,10 +27837,10 @@ function verifyTypedData(domain, types, value, signature) { } var lib_esm$3 = /*#__PURE__*/Object.freeze({ - __proto__: null, - Wallet: Wallet, - verifyMessage: verifyMessage, - verifyTypedData: verifyTypedData + __proto__: null, + Wallet: Wallet, + verifyMessage: verifyMessage, + verifyTypedData: verifyTypedData }); const version$4 = "networks/5.7.1"; @@ -28415,10 +28553,10 @@ function poll(func, options) { } var lib_esm$2 = /*#__PURE__*/Object.freeze({ - __proto__: null, - _fetchData: _fetchData, - fetchJson: fetchJson, - poll: poll + __proto__: null, + _fetchData: _fetchData, + fetchJson: fetchJson, + poll: poll }); var ALPHABET = 'qpzry9x8gf2tvdw0s3jn54khce6mua7l'; @@ -31755,10 +31893,10 @@ function sha256(types, values) { } var lib_esm$1 = /*#__PURE__*/Object.freeze({ - __proto__: null, - keccak256: keccak256, - pack: pack, - sha256: sha256 + __proto__: null, + keccak256: keccak256, + pack: pack, + sha256: sha256 }); const version = "units/5.7.0"; @@ -31844,12 +31982,12 @@ function parseEther(ether) { } var lib_esm = /*#__PURE__*/Object.freeze({ - __proto__: null, - commify: commify, - formatEther: formatEther, - formatUnits: formatUnits, - parseEther: parseEther, - parseUnits: parseUnits + __proto__: null, + commify: commify, + formatEther: formatEther, + formatUnits: formatUnits, + parseEther: parseEther, + parseUnits: parseUnits }); function parseAddress(a) { @@ -31879,7 +32017,7 @@ function getDltAddress(didOrKeyInHex) { } async function exchangeId(exchange) { - return e(await sha(t(exchange), 'SHA-256'), true, false); + return encode$4(await sha(hashable(exchange), 'SHA-256'), true, false); } async function createProof(payload, privateJwk) { @@ -31921,7 +32059,7 @@ async function verifyProof(proof, expectedPayloadClaims, options) { } const payload = verification.payload; const issuer = payload.exchange[payload.iss]; - if (t(publicJwk) !== t(JSON.parse(issuer))) { + if (hashable(publicJwk) !== hashable(JSON.parse(issuer))) { throw new Error(`The proof is issued by ${issuer} instead of ${JSON.stringify(publicJwk)}`); } const expectedClaimsDict = expectedPayloadClaims; @@ -31933,7 +32071,7 @@ async function verifyProof(proof, expectedPayloadClaims, options) { const dataExchange = payload.exchange; checkDataExchange(dataExchange, expectedDataExchange); } - else if (expectedClaimsDict[key] !== '' && t(expectedClaimsDict[key]) !== t(payload[key])) { + else if (expectedClaimsDict[key] !== '' && hashable(expectedClaimsDict[key]) !== hashable(payload[key])) { throw new Error(`Proof's ${key}: ${JSON.stringify(payload[key], undefined, 2)} does not meet provided value ${JSON.stringify(expectedClaimsDict[key], undefined, 2)}`); } } @@ -31947,7 +32085,7 @@ function checkDataExchange(dataExchange, expectedDataExchange) { } } for (const key in expectedDataExchange) { - if (expectedDataExchange[key] !== '' && t(expectedDataExchange[key]) !== t(dataExchange[key])) { + if (expectedDataExchange[key] !== '' && hashable(expectedDataExchange[key]) !== hashable(dataExchange[key])) { throw new Error(`dataExchange's ${key}: ${JSON.stringify(dataExchange[key], undefined, 2)} does not meet expected value ${JSON.stringify(expectedDataExchange[key], undefined, 2)}`); } } @@ -32061,7 +32199,7 @@ async function checkDecryption(disputeRequest, wallet) { } throw error; } - const cipherblockDgst = e(await sha(drPayload.cipherblock, porPayload.exchange.hashAlg), true, false); + const cipherblockDgst = encode$4(await sha(drPayload.cipherblock, porPayload.exchange.hashAlg), true, false); if (cipherblockDgst !== porPayload.exchange.cipherblockDgst) { throw new NrError(new Error('cipherblock does not meet the committed (and already accepted) one'), ['invalid dispute request']); } @@ -32189,13 +32327,13 @@ async function verifyResolution(resolution, pubJwk) { } var index$2 = /*#__PURE__*/Object.freeze({ - __proto__: null, - ConflictResolver: ConflictResolver, - checkCompleteness: checkCompleteness, - checkDecryption: checkDecryption, - generateVerificationRequest: generateVerificationRequest, - verifyPor: verifyPor, - verifyResolution: verifyResolution + __proto__: null, + ConflictResolver: ConflictResolver, + checkCompleteness: checkCompleteness, + checkDecryption: checkDecryption, + generateVerificationRequest: generateVerificationRequest, + verifyPor: verifyPor, + verifyResolution: verifyResolution }); var address = "0x8d407A1722633bDD1dcf221474be7a44C05d7c2F"; @@ -32399,7 +32537,7 @@ const defaultDltConfig = { async function getSecretFromLedger(contract, signerAddress, exchangeId, timeout, secretLength) { let secretBn = BigNumber.from(0); let timestampBn = BigNumber.from(0); - const exchangeIdHex = parseHex(g$1(r$4(exchangeId)), true); + const exchangeIdHex = parseHex(bufToHex(decode$5(exchangeId)), true); let counter = 0; do { try { @@ -32422,7 +32560,7 @@ async function getSecretFromLedger(contract, signerAddress, exchangeId, timeout, } async function secretUnisgnedTransaction(secretHex, exchangeId, agent) { const secret = BigNumber.from(parseHex(secretHex, true)); - const exchangeIdHex = parseHex(g$1(r$4(exchangeId)), true); + const exchangeIdHex = parseHex(bufToHex(decode$5(exchangeId)), true); const unsignedTx = await agent.contract.populateTransaction.setRegistry(exchangeIdHex, secret, { gasLimit: agent.dltConfig.gasLimit }); unsignedTx.nonce = await agent.nextNonce(); unsignedTx.gasLimit = unsignedTx.gasLimit?._hex; @@ -32733,10 +32871,10 @@ class EthersIoAgentOrig extends EthersIoAgent { this.count = -1; let privKey; if (privateKey === undefined) { - privKey = m(32); + privKey = randBytesSync(32); } else { - privKey = (typeof privateKey === 'string') ? new Uint8Array(l(privateKey)) : privateKey; + privKey = (typeof privateKey === 'string') ? new Uint8Array(hexToBuf(privateKey)) : privateKey; } const signingKey = new utils.SigningKey(privKey); this.signer = new Wallet(signingKey, this.provider); @@ -32830,13 +32968,13 @@ class I3mServerWalletAgentOrig extends I3mServerWalletAgent { } var index$1 = /*#__PURE__*/Object.freeze({ - __proto__: null, - EthersIoAgentDest: EthersIoAgentDest, - EthersIoAgentOrig: EthersIoAgentOrig, - I3mServerWalletAgentDest: I3mServerWalletAgentDest, - I3mServerWalletAgentOrig: I3mServerWalletAgentOrig, - I3mWalletAgentDest: I3mWalletAgentDest, - I3mWalletAgentOrig: I3mWalletAgentOrig + __proto__: null, + EthersIoAgentDest: EthersIoAgentDest, + EthersIoAgentOrig: EthersIoAgentOrig, + I3mServerWalletAgentDest: I3mServerWalletAgentDest, + I3mServerWalletAgentOrig: I3mServerWalletAgentOrig, + I3mWalletAgentDest: I3mWalletAgentDest, + I3mWalletAgentOrig: I3mWalletAgentOrig }); var openapi = "3.0.3"; @@ -35348,23 +35486,8 @@ var paths = { example: "i3m" }, rpcUrl: { - oneOf: [ - { - type: "string", - example: "http://95.211.3.250:8545" - }, - { - type: "array", - items: { - type: "string" - }, - uniqueItems: true, - example: [ - "http://95.211.3.249:8545", - "http://95.211.3.250:8545" - ] - } - ] + type: "string", + example: "http://95.211.3.250:8545" } }, additionalProperties: true @@ -38094,23 +38217,8 @@ var components = { example: "i3m" }, rpcUrl: { - oneOf: [ - { - type: "string", - example: "http://95.211.3.250:8545" - }, - { - type: "array", - items: { - type: "string" - }, - uniqueItems: true, - example: [ - "http://95.211.3.249:8545", - "http://95.211.3.250:8545" - ] - } - ] + type: "string", + example: "http://95.211.3.250:8545" } }, additionalProperties: true @@ -65570,7 +65678,7 @@ async function validateDataSharingAgreementSchema(agreement) { }); } } - if (t(clonedAgreement) !== t(agreement)) { + if (hashable(clonedAgreement) !== hashable(agreement)) { errors.push(new NrError('Additional claims beyond the schema are not supported', ['invalid format'])); } } @@ -65705,7 +65813,7 @@ class NonRepudiationDest { } async verifyPoO(poo, cipherblock, options) { await this.initialized; - const cipherblockDgst = e(await sha(cipherblock, this.agreement.hashAlg), true, false); + const cipherblockDgst = encode$4(await sha(cipherblock, this.agreement.hashAlg), true, false); const { payload } = await jwsDecode(poo); const dataExchangePreview = { ...this.agreement, @@ -65776,7 +65884,7 @@ class NonRepudiationDest { const verified = await verifyProof(pop, expectedPayloadClaims, opts); const secret = JSON.parse(verified.payload.secret); this.block.secret = { - hex: g$1(r$4(secret.k)), + hex: bufToHex(decode$5(secret.k)), jwk: secret }; this.block.pop = { @@ -65815,7 +65923,7 @@ class NonRepudiationDest { throw new Error('No cipherblock to decrypt'); } const decryptedBlock = (await jweDecrypt(this.block.jwe, this.block.secret.jwk)).plaintext; - const decryptedDgst = e(await sha(decryptedBlock, this.agreement.hashAlg), true, false); + const decryptedDgst = encode$4(await sha(decryptedBlock, this.agreement.hashAlg), true, false); if (decryptedDgst !== this.exchange.blockCommitment) { throw new Error('Decrypted block does not meet the committed one'); } @@ -65895,9 +66003,9 @@ class NonRepudiationOrig { secret, jwe: await jweEncrypt(this.block.raw, secret.jwk, this.agreement.encAlg) }; - const cipherblockDgst = e(await sha(this.block.jwe, this.agreement.hashAlg), true, false); - const blockCommitment = e(await sha(this.block.raw, this.agreement.hashAlg), true, false); - const secretCommitment = e(await sha(new Uint8Array(l(this.block.secret.hex)), this.agreement.hashAlg), true, false); + const cipherblockDgst = encode$4(await sha(this.block.jwe, this.agreement.hashAlg), true, false); + const blockCommitment = encode$4(await sha(this.block.raw, this.agreement.hashAlg), true, false); + const secretCommitment = encode$4(await sha(new Uint8Array(hexToBuf(this.block.secret.hex)), this.agreement.hashAlg), true, false); const dataExchangePreview = { ...this.agreement, cipherblockDgst, @@ -65983,9 +66091,9 @@ class NonRepudiationOrig { } var index = /*#__PURE__*/Object.freeze({ - __proto__: null, - NonRepudiationDest: NonRepudiationDest, - NonRepudiationOrig: NonRepudiationOrig + __proto__: null, + NonRepudiationDest: NonRepudiationDest, + NonRepudiationOrig: NonRepudiationOrig }); export { index$2 as ConflictResolution, ENC_ALGS, EthersIoAgentDest, EthersIoAgentOrig, HASH_ALGS, I3mServerWalletAgentDest, I3mServerWalletAgentOrig, I3mWalletAgentDest, I3mWalletAgentOrig, KEY_AGREEMENT_ALGS, index as NonRepudiationProtocol, NrError, SIGNING_ALGS, index$1 as Signers, checkTimestamp, createProof, defaultDltConfig, exchangeId, generateKeys, getDltAddress, importJwk, jsonSort, jweDecrypt, jweEncrypt, jwsDecode, oneTimeSecret, parseAddress, parseHex, parseJwk, sha, validateDataExchange, validateDataExchangeAgreement, validateDataSharingAgreementSchema, verifyKeyPair, verifyProof }; diff --git a/dist/bundle.esm.min.js b/dist/bundle.esm.min.js index bb07032..b2ed328 100644 --- a/dist/bundle.esm.min.js +++ b/dist/bundle.esm.min.js @@ -1,4 +1,4 @@ -function e(e,t=!1,r=!0){let n="";return n=(e=>{const t=[];for(let r=0;re.charCodeAt(0))));return t?(new TextDecoder).decode(n):n}}function r(e,t=!1,r){const n=e.match(/^(0x)?([\da-fA-F]+)$/);if(null==n)throw new RangeError("input must be a hexadecimal string, e.g. '0x124fe3a' or '0214f1b2'");let i=n[2];if(void 0!==r){if(r{i+=o[e>>4]+o[15&e]})),r(i,t,n)}}function i(e,t=!1){let n=r(e);return n=r(e,!1,Math.ceil(n.length/2)),Uint8Array.from(n.match(/[\da-fA-F]{2}/g).map((e=>parseInt(e,16)))).buffer}function o(e,t=!1){if(e<1)throw new RangeError("byteLength MUST be > 0");return new Promise((function(r,n){{const n=new Uint8Array(e);if(e<=65536)self.crypto.getRandomValues(n);else for(let t=0;t=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function s(e,t,r){var n=a(e,r);return r-1>=t&&(n|=a(e,r-1)<<4),n}function c(e,t,r,n){for(var i=0,o=Math.min(e.length,r),a=t;a=49?s-49+10:s>=17?s-17+10:s}return i}i.isBN=function(e){return e instanceof i||null!==e&&"object"==typeof e&&e.constructor.wordSize===i.wordSize&&Array.isArray(e.words)},i.max=function(e,t){return e.cmp(t)>0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,n){if("number"==typeof e)return this._initNumber(e,t,n);if("object"==typeof e)return this._initArray(e,t,n);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)a=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===n)for(i=0,o=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this.strip()},i.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n=t;n-=2)i=s(e,t,n)<=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(n=(e.length-t)%2==0?t+1:t;n=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this.strip()},i.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,a=o%n,s=Math.min(o,o-a)+r,u=0,f=r;f1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?""};var u=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],f=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function l(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],a=i*o,s=67108863&a,c=a/67108864|0;r.words[0]=s;for(var u=1;u>>26,d=67108863&c,l=Math.min(u,t.length-1),h=Math.max(0,u-e.length+1);h<=l;h++){var p=u-h|0;f+=(a=(i=0|e.words[p])*(o=0|t.words[h])+d)/67108864|0,d=67108863&a}r.words[u]=0|d,c=0|f}return 0!==c?r.words[u]=0|c:r.length--,r.strip()}i.prototype.toString=function(e,t){var n;if(t=0|t||1,16===(e=e||10)||"hex"===e){n="";for(var i=0,o=0,a=0;a>>24-i&16777215)||a!==this.length-1?u[6-c.length]+c+n:c+n,(i+=2)>=26&&(i-=26,a--)}for(0!==o&&(n=o.toString(16)+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(e===(0|e)&&e>=2&&e<=36){var l=f[e],h=d[e];n="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(h).toString(e);n=(p=p.idivn(h)).isZero()?m+n:u[l-m.length]+m+n}for(this.isZero()&&(n="0"+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},i.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&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(e,t){return r(void 0!==o),this.toArrayLike(o,e,t)},i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},i.prototype.toArrayLike=function(e,t,n){var i=this.byteLength(),o=n||Math.max(1,i);r(i<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0"),this.strip();var a,s,c="le"===t,u=new e(o),f=this.clone();if(c){for(s=0;!f.isZero();s++)a=f.andln(255),f.iushrn(8),u[s]=a;for(;s=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){r("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),n>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-n),this.strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){r("number"==typeof e&&e>=0);var n=e/26|0,i=e%26;return this._expand(n+1),this.words[n]=t?this.words[n]|1<e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},i.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,a=0;a>26,this.words[a]=67108863&t;for(;0!==o&&a>26,this.words[a]=67108863&t;if(0===o&&a>>13,h=0|a[1],p=8191&h,m=h>>>13,g=0|a[2],y=8191&g,b=g>>>13,v=0|a[3],w=8191&v,A=v>>>13,_=0|a[4],E=8191&_,S=_>>>13,P=0|a[5],x=8191&P,k=P>>>13,M=0|a[6],C=8191&M,I=M>>>13,R=0|a[7],N=8191&R,O=R>>>13,T=0|a[8],j=8191&T,$=T>>>13,D=0|a[9],B=8191&D,F=D>>>13,z=0|s[0],U=8191&z,L=z>>>13,q=0|s[1],H=8191&q,K=q>>>13,J=0|s[2],W=8191&J,G=J>>>13,V=0|s[3],Z=8191&V,X=V>>>13,Q=0|s[4],Y=8191&Q,ee=Q>>>13,te=0|s[5],re=8191&te,ne=te>>>13,ie=0|s[6],oe=8191&ie,ae=ie>>>13,se=0|s[7],ce=8191&se,ue=se>>>13,fe=0|s[8],de=8191&fe,le=fe>>>13,he=0|s[9],pe=8191&he,me=he>>>13;r.negative=e.negative^t.negative,r.length=19;var ge=(u+(n=Math.imul(d,U))|0)+((8191&(i=(i=Math.imul(d,L))+Math.imul(l,U)|0))<<13)|0;u=((o=Math.imul(l,L))+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(p,U),i=(i=Math.imul(p,L))+Math.imul(m,U)|0,o=Math.imul(m,L);var ye=(u+(n=n+Math.imul(d,H)|0)|0)+((8191&(i=(i=i+Math.imul(d,K)|0)+Math.imul(l,H)|0))<<13)|0;u=((o=o+Math.imul(l,K)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(y,U),i=(i=Math.imul(y,L))+Math.imul(b,U)|0,o=Math.imul(b,L),n=n+Math.imul(p,H)|0,i=(i=i+Math.imul(p,K)|0)+Math.imul(m,H)|0,o=o+Math.imul(m,K)|0;var be=(u+(n=n+Math.imul(d,W)|0)|0)+((8191&(i=(i=i+Math.imul(d,G)|0)+Math.imul(l,W)|0))<<13)|0;u=((o=o+Math.imul(l,G)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(w,U),i=(i=Math.imul(w,L))+Math.imul(A,U)|0,o=Math.imul(A,L),n=n+Math.imul(y,H)|0,i=(i=i+Math.imul(y,K)|0)+Math.imul(b,H)|0,o=o+Math.imul(b,K)|0,n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(m,W)|0,o=o+Math.imul(m,G)|0;var ve=(u+(n=n+Math.imul(d,Z)|0)|0)+((8191&(i=(i=i+Math.imul(d,X)|0)+Math.imul(l,Z)|0))<<13)|0;u=((o=o+Math.imul(l,X)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(E,U),i=(i=Math.imul(E,L))+Math.imul(S,U)|0,o=Math.imul(S,L),n=n+Math.imul(w,H)|0,i=(i=i+Math.imul(w,K)|0)+Math.imul(A,H)|0,o=o+Math.imul(A,K)|0,n=n+Math.imul(y,W)|0,i=(i=i+Math.imul(y,G)|0)+Math.imul(b,W)|0,o=o+Math.imul(b,G)|0,n=n+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,X)|0;var we=(u+(n=n+Math.imul(d,Y)|0)|0)+((8191&(i=(i=i+Math.imul(d,ee)|0)+Math.imul(l,Y)|0))<<13)|0;u=((o=o+Math.imul(l,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(x,U),i=(i=Math.imul(x,L))+Math.imul(k,U)|0,o=Math.imul(k,L),n=n+Math.imul(E,H)|0,i=(i=i+Math.imul(E,K)|0)+Math.imul(S,H)|0,o=o+Math.imul(S,K)|0,n=n+Math.imul(w,W)|0,i=(i=i+Math.imul(w,G)|0)+Math.imul(A,W)|0,o=o+Math.imul(A,G)|0,n=n+Math.imul(y,Z)|0,i=(i=i+Math.imul(y,X)|0)+Math.imul(b,Z)|0,o=o+Math.imul(b,X)|0,n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(m,Y)|0,o=o+Math.imul(m,ee)|0;var Ae=(u+(n=n+Math.imul(d,re)|0)|0)+((8191&(i=(i=i+Math.imul(d,ne)|0)+Math.imul(l,re)|0))<<13)|0;u=((o=o+Math.imul(l,ne)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(C,U),i=(i=Math.imul(C,L))+Math.imul(I,U)|0,o=Math.imul(I,L),n=n+Math.imul(x,H)|0,i=(i=i+Math.imul(x,K)|0)+Math.imul(k,H)|0,o=o+Math.imul(k,K)|0,n=n+Math.imul(E,W)|0,i=(i=i+Math.imul(E,G)|0)+Math.imul(S,W)|0,o=o+Math.imul(S,G)|0,n=n+Math.imul(w,Z)|0,i=(i=i+Math.imul(w,X)|0)+Math.imul(A,Z)|0,o=o+Math.imul(A,X)|0,n=n+Math.imul(y,Y)|0,i=(i=i+Math.imul(y,ee)|0)+Math.imul(b,Y)|0,o=o+Math.imul(b,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(m,re)|0,o=o+Math.imul(m,ne)|0;var _e=(u+(n=n+Math.imul(d,oe)|0)|0)+((8191&(i=(i=i+Math.imul(d,ae)|0)+Math.imul(l,oe)|0))<<13)|0;u=((o=o+Math.imul(l,ae)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(N,U),i=(i=Math.imul(N,L))+Math.imul(O,U)|0,o=Math.imul(O,L),n=n+Math.imul(C,H)|0,i=(i=i+Math.imul(C,K)|0)+Math.imul(I,H)|0,o=o+Math.imul(I,K)|0,n=n+Math.imul(x,W)|0,i=(i=i+Math.imul(x,G)|0)+Math.imul(k,W)|0,o=o+Math.imul(k,G)|0,n=n+Math.imul(E,Z)|0,i=(i=i+Math.imul(E,X)|0)+Math.imul(S,Z)|0,o=o+Math.imul(S,X)|0,n=n+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(A,Y)|0,o=o+Math.imul(A,ee)|0,n=n+Math.imul(y,re)|0,i=(i=i+Math.imul(y,ne)|0)+Math.imul(b,re)|0,o=o+Math.imul(b,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,ae)|0)+Math.imul(m,oe)|0,o=o+Math.imul(m,ae)|0;var Ee=(u+(n=n+Math.imul(d,ce)|0)|0)+((8191&(i=(i=i+Math.imul(d,ue)|0)+Math.imul(l,ce)|0))<<13)|0;u=((o=o+Math.imul(l,ue)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(j,U),i=(i=Math.imul(j,L))+Math.imul($,U)|0,o=Math.imul($,L),n=n+Math.imul(N,H)|0,i=(i=i+Math.imul(N,K)|0)+Math.imul(O,H)|0,o=o+Math.imul(O,K)|0,n=n+Math.imul(C,W)|0,i=(i=i+Math.imul(C,G)|0)+Math.imul(I,W)|0,o=o+Math.imul(I,G)|0,n=n+Math.imul(x,Z)|0,i=(i=i+Math.imul(x,X)|0)+Math.imul(k,Z)|0,o=o+Math.imul(k,X)|0,n=n+Math.imul(E,Y)|0,i=(i=i+Math.imul(E,ee)|0)+Math.imul(S,Y)|0,o=o+Math.imul(S,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(A,re)|0,o=o+Math.imul(A,ne)|0,n=n+Math.imul(y,oe)|0,i=(i=i+Math.imul(y,ae)|0)+Math.imul(b,oe)|0,o=o+Math.imul(b,ae)|0,n=n+Math.imul(p,ce)|0,i=(i=i+Math.imul(p,ue)|0)+Math.imul(m,ce)|0,o=o+Math.imul(m,ue)|0;var Se=(u+(n=n+Math.imul(d,de)|0)|0)+((8191&(i=(i=i+Math.imul(d,le)|0)+Math.imul(l,de)|0))<<13)|0;u=((o=o+Math.imul(l,le)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(B,U),i=(i=Math.imul(B,L))+Math.imul(F,U)|0,o=Math.imul(F,L),n=n+Math.imul(j,H)|0,i=(i=i+Math.imul(j,K)|0)+Math.imul($,H)|0,o=o+Math.imul($,K)|0,n=n+Math.imul(N,W)|0,i=(i=i+Math.imul(N,G)|0)+Math.imul(O,W)|0,o=o+Math.imul(O,G)|0,n=n+Math.imul(C,Z)|0,i=(i=i+Math.imul(C,X)|0)+Math.imul(I,Z)|0,o=o+Math.imul(I,X)|0,n=n+Math.imul(x,Y)|0,i=(i=i+Math.imul(x,ee)|0)+Math.imul(k,Y)|0,o=o+Math.imul(k,ee)|0,n=n+Math.imul(E,re)|0,i=(i=i+Math.imul(E,ne)|0)+Math.imul(S,re)|0,o=o+Math.imul(S,ne)|0,n=n+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,ae)|0)+Math.imul(A,oe)|0,o=o+Math.imul(A,ae)|0,n=n+Math.imul(y,ce)|0,i=(i=i+Math.imul(y,ue)|0)+Math.imul(b,ce)|0,o=o+Math.imul(b,ue)|0,n=n+Math.imul(p,de)|0,i=(i=i+Math.imul(p,le)|0)+Math.imul(m,de)|0,o=o+Math.imul(m,le)|0;var Pe=(u+(n=n+Math.imul(d,pe)|0)|0)+((8191&(i=(i=i+Math.imul(d,me)|0)+Math.imul(l,pe)|0))<<13)|0;u=((o=o+Math.imul(l,me)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(B,H),i=(i=Math.imul(B,K))+Math.imul(F,H)|0,o=Math.imul(F,K),n=n+Math.imul(j,W)|0,i=(i=i+Math.imul(j,G)|0)+Math.imul($,W)|0,o=o+Math.imul($,G)|0,n=n+Math.imul(N,Z)|0,i=(i=i+Math.imul(N,X)|0)+Math.imul(O,Z)|0,o=o+Math.imul(O,X)|0,n=n+Math.imul(C,Y)|0,i=(i=i+Math.imul(C,ee)|0)+Math.imul(I,Y)|0,o=o+Math.imul(I,ee)|0,n=n+Math.imul(x,re)|0,i=(i=i+Math.imul(x,ne)|0)+Math.imul(k,re)|0,o=o+Math.imul(k,ne)|0,n=n+Math.imul(E,oe)|0,i=(i=i+Math.imul(E,ae)|0)+Math.imul(S,oe)|0,o=o+Math.imul(S,ae)|0,n=n+Math.imul(w,ce)|0,i=(i=i+Math.imul(w,ue)|0)+Math.imul(A,ce)|0,o=o+Math.imul(A,ue)|0,n=n+Math.imul(y,de)|0,i=(i=i+Math.imul(y,le)|0)+Math.imul(b,de)|0,o=o+Math.imul(b,le)|0;var xe=(u+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,me)|0)+Math.imul(m,pe)|0))<<13)|0;u=((o=o+Math.imul(m,me)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(B,W),i=(i=Math.imul(B,G))+Math.imul(F,W)|0,o=Math.imul(F,G),n=n+Math.imul(j,Z)|0,i=(i=i+Math.imul(j,X)|0)+Math.imul($,Z)|0,o=o+Math.imul($,X)|0,n=n+Math.imul(N,Y)|0,i=(i=i+Math.imul(N,ee)|0)+Math.imul(O,Y)|0,o=o+Math.imul(O,ee)|0,n=n+Math.imul(C,re)|0,i=(i=i+Math.imul(C,ne)|0)+Math.imul(I,re)|0,o=o+Math.imul(I,ne)|0,n=n+Math.imul(x,oe)|0,i=(i=i+Math.imul(x,ae)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,ae)|0,n=n+Math.imul(E,ce)|0,i=(i=i+Math.imul(E,ue)|0)+Math.imul(S,ce)|0,o=o+Math.imul(S,ue)|0,n=n+Math.imul(w,de)|0,i=(i=i+Math.imul(w,le)|0)+Math.imul(A,de)|0,o=o+Math.imul(A,le)|0;var ke=(u+(n=n+Math.imul(y,pe)|0)|0)+((8191&(i=(i=i+Math.imul(y,me)|0)+Math.imul(b,pe)|0))<<13)|0;u=((o=o+Math.imul(b,me)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(B,Z),i=(i=Math.imul(B,X))+Math.imul(F,Z)|0,o=Math.imul(F,X),n=n+Math.imul(j,Y)|0,i=(i=i+Math.imul(j,ee)|0)+Math.imul($,Y)|0,o=o+Math.imul($,ee)|0,n=n+Math.imul(N,re)|0,i=(i=i+Math.imul(N,ne)|0)+Math.imul(O,re)|0,o=o+Math.imul(O,ne)|0,n=n+Math.imul(C,oe)|0,i=(i=i+Math.imul(C,ae)|0)+Math.imul(I,oe)|0,o=o+Math.imul(I,ae)|0,n=n+Math.imul(x,ce)|0,i=(i=i+Math.imul(x,ue)|0)+Math.imul(k,ce)|0,o=o+Math.imul(k,ue)|0,n=n+Math.imul(E,de)|0,i=(i=i+Math.imul(E,le)|0)+Math.imul(S,de)|0,o=o+Math.imul(S,le)|0;var Me=(u+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,me)|0)+Math.imul(A,pe)|0))<<13)|0;u=((o=o+Math.imul(A,me)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(B,Y),i=(i=Math.imul(B,ee))+Math.imul(F,Y)|0,o=Math.imul(F,ee),n=n+Math.imul(j,re)|0,i=(i=i+Math.imul(j,ne)|0)+Math.imul($,re)|0,o=o+Math.imul($,ne)|0,n=n+Math.imul(N,oe)|0,i=(i=i+Math.imul(N,ae)|0)+Math.imul(O,oe)|0,o=o+Math.imul(O,ae)|0,n=n+Math.imul(C,ce)|0,i=(i=i+Math.imul(C,ue)|0)+Math.imul(I,ce)|0,o=o+Math.imul(I,ue)|0,n=n+Math.imul(x,de)|0,i=(i=i+Math.imul(x,le)|0)+Math.imul(k,de)|0,o=o+Math.imul(k,le)|0;var Ce=(u+(n=n+Math.imul(E,pe)|0)|0)+((8191&(i=(i=i+Math.imul(E,me)|0)+Math.imul(S,pe)|0))<<13)|0;u=((o=o+Math.imul(S,me)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(B,re),i=(i=Math.imul(B,ne))+Math.imul(F,re)|0,o=Math.imul(F,ne),n=n+Math.imul(j,oe)|0,i=(i=i+Math.imul(j,ae)|0)+Math.imul($,oe)|0,o=o+Math.imul($,ae)|0,n=n+Math.imul(N,ce)|0,i=(i=i+Math.imul(N,ue)|0)+Math.imul(O,ce)|0,o=o+Math.imul(O,ue)|0,n=n+Math.imul(C,de)|0,i=(i=i+Math.imul(C,le)|0)+Math.imul(I,de)|0,o=o+Math.imul(I,le)|0;var Ie=(u+(n=n+Math.imul(x,pe)|0)|0)+((8191&(i=(i=i+Math.imul(x,me)|0)+Math.imul(k,pe)|0))<<13)|0;u=((o=o+Math.imul(k,me)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(B,oe),i=(i=Math.imul(B,ae))+Math.imul(F,oe)|0,o=Math.imul(F,ae),n=n+Math.imul(j,ce)|0,i=(i=i+Math.imul(j,ue)|0)+Math.imul($,ce)|0,o=o+Math.imul($,ue)|0,n=n+Math.imul(N,de)|0,i=(i=i+Math.imul(N,le)|0)+Math.imul(O,de)|0,o=o+Math.imul(O,le)|0;var Re=(u+(n=n+Math.imul(C,pe)|0)|0)+((8191&(i=(i=i+Math.imul(C,me)|0)+Math.imul(I,pe)|0))<<13)|0;u=((o=o+Math.imul(I,me)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(B,ce),i=(i=Math.imul(B,ue))+Math.imul(F,ce)|0,o=Math.imul(F,ue),n=n+Math.imul(j,de)|0,i=(i=i+Math.imul(j,le)|0)+Math.imul($,de)|0,o=o+Math.imul($,le)|0;var Ne=(u+(n=n+Math.imul(N,pe)|0)|0)+((8191&(i=(i=i+Math.imul(N,me)|0)+Math.imul(O,pe)|0))<<13)|0;u=((o=o+Math.imul(O,me)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,n=Math.imul(B,de),i=(i=Math.imul(B,le))+Math.imul(F,de)|0,o=Math.imul(F,le);var Oe=(u+(n=n+Math.imul(j,pe)|0)|0)+((8191&(i=(i=i+Math.imul(j,me)|0)+Math.imul($,pe)|0))<<13)|0;u=((o=o+Math.imul($,me)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863;var Te=(u+(n=Math.imul(B,pe))|0)+((8191&(i=(i=Math.imul(B,me))+Math.imul(F,pe)|0))<<13)|0;return u=((o=Math.imul(F,me))+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,c[0]=ge,c[1]=ye,c[2]=be,c[3]=ve,c[4]=we,c[5]=Ae,c[6]=_e,c[7]=Ee,c[8]=Se,c[9]=Pe,c[10]=xe,c[11]=ke,c[12]=Me,c[13]=Ce,c[14]=Ie,c[15]=Re,c[16]=Ne,c[17]=Oe,c[18]=Te,0!==u&&(c[19]=u,r.length++),r};function m(e,t,r){return(new g).mulp(e,t,r)}function g(e,t){this.x=e,this.y=t}Math.imul||(p=l),i.prototype.mulTo=function(e,t){var r,n=this.length+e.length;return r=10===this.length&&10===e.length?p(this,e,t):n<63?l(this,e,t):n<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,a&=67108863}r.words[o]=s,n=a,a=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,e,t):m(this,e,t),r},g.prototype.makeRBT=function(e){for(var t=new Array(e),r=i.prototype._countBits(e)-1,n=0;n>=1;return n},g.prototype.permute=function(e,t,r,n,i,o){for(var a=0;a>>=1)i++;return 1<>>=13,n[2*a+1]=8191&o,o>>>=13;for(a=2*t;a>=26,t+=i/67108864|0,t+=o>>>26,this.words[n]=67108863&o}return 0!==t&&(this.words[n]=t,this.length++),this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>i}return t}(e);if(0===t.length)return new i(1);for(var r=this,n=0;n=0);var t,n=e%26,i=(e-n)/26,o=67108863>>>26-n<<26-n;if(0!==n){var a=0;for(t=0;t>>26-n}a&&(this.words[t]=a,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var o=e%26,a=Math.min((e-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,u=0;u=0&&(0!==f||u>=i);u--){var d=0|this.words[u];this.words[u]=f<<26-o|d>>>o,f=d&s}return c&&0!==f&&(c.words[c.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(e,t,n){return r(0===this.negative),this.iushrn(e,t,n)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){r("number"==typeof e&&e>=0);var t=e%26,n=(e-t)/26,i=1<=0);var t=e%26,n=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==t&&n++,this.length=Math.min(n,this.length),0!==t){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},i.prototype.isubn=function(e){if(r("number"==typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(c/67108864|0),this.words[i+n]=67108863&o}for(;i>26,this.words[i+n]=67108863&o;if(0===s)return this.strip();for(r(-1===s),s=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},i.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),o=e,a=0|o.words[o.length-1];0!=(r=26-this._countBits(a))&&(o=o.ushln(r),n.iushln(r),a=0|o.words[o.length-1]);var s,c=n.length-o.length;if("mod"!==t){(s=new i(null)).length=c+1,s.words=new Array(s.length);for(var u=0;u=0;d--){var l=67108864*(0|n.words[o.length+d])+(0|n.words[o.length+d-1]);for(l=Math.min(l/a|0,67108863),n._ishlnsubmul(o,l,d);0!==n.negative;)l--,n.negative=0,n._ishlnsubmul(o,1,d),n.isZero()||(n.negative^=1);s&&(s.words[d]=l)}return s&&s.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},i.prototype.divmod=function(e,t,n){return r(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(o=s.div.neg()),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.iadd(e)),{div:o,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(o=s.div.neg()),{div:o,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modn(e.words[0]))}:this._wordDiv(e,t);var o,a,s},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modn=function(e){r(e<=67108863);for(var t=(1<<26)%e,n=0,i=this.length-1;i>=0;i--)n=(t*n+(0|this.words[i]))%e;return n},i.prototype.idivn=function(e){r(e<=67108863);for(var t=0,n=this.length-1;n>=0;n--){var i=(0|this.words[n])+67108864*t;this.words[n]=i/e|0,t=i%e}return this.strip()},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o=new i(1),a=new i(0),s=new i(0),c=new i(1),u=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++u;for(var f=n.clone(),d=t.clone();!t.isZero();){for(var l=0,h=1;0==(t.words[0]&h)&&l<26;++l,h<<=1);if(l>0)for(t.iushrn(l);l-- >0;)(o.isOdd()||a.isOdd())&&(o.iadd(f),a.isub(d)),o.iushrn(1),a.iushrn(1);for(var p=0,m=1;0==(n.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(n.iushrn(p);p-- >0;)(s.isOdd()||c.isOdd())&&(s.iadd(f),c.isub(d)),s.iushrn(1),c.iushrn(1);t.cmp(n)>=0?(t.isub(n),o.isub(s),a.isub(c)):(n.isub(t),s.isub(o),c.isub(a))}return{a:s,b:c,gcd:n.iushln(u)}},i.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o,a=new i(1),s=new i(0),c=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(var u=0,f=1;0==(t.words[0]&f)&&u<26;++u,f<<=1);if(u>0)for(t.iushrn(u);u-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);for(var d=0,l=1;0==(n.words[0]&l)&&d<26;++d,l<<=1);if(d>0)for(n.iushrn(d);d-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);t.cmp(n)>=0?(t.isub(n),a.isub(s)):(n.isub(t),s.isub(a))}return(o=0===t.cmpn(1)?a:s).cmpn(0)<0&&o.iadd(e),o},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return 0==(1&this.words[0])},i.prototype.isOdd=function(){return 1==(1&this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){r("number"==typeof e);var t=e%26,n=(e-t)/26,i=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this.strip(),this.length>1)t=1;else{n&&(e=-e),r(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){ni&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new E(e)},i.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var y={k256:null,p224:null,p192:null,p25519:null};function b(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){b.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){b.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function A(){b.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){b.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function E(e){if("string"==typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function S(e){E.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(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)}b.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},b.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},b.prototype.split=function(e,t){e.iushrn(this.n,0,t)},b.prototype.imulK=function(e){return e.imul(this.k)},n(v,b),v.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i>>22,o=a}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},v.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(y[e])return y[e];var t;if("k256"===e)t=new v;else if("p224"===e)t=new w;else if("p192"===e)t=new A;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new _}return y[e]=t,t},E.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},E.prototype._verify2=function(e,t){r(0==(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},E.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},E.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},E.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},E.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},E.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},E.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},E.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},E.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},E.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},E.prototype.isqr=function(e){return this.imul(e,e.clone())},E.prototype.sqr=function(e){return this.mul(e,e)},E.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2==1),3===t){var n=this.m.add(new i(1)).iushrn(2);return this.pow(e,n)}for(var o=this.m.subn(1),a=0;!o.isZero()&&0===o.andln(1);)a++,o.iushrn(1);r(!o.isZero());var s=new i(1).toRed(this),c=s.redNeg(),u=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new i(2*f*f).toRed(this);0!==this.pow(f,u).cmp(c);)f.redIAdd(c);for(var d=this.pow(f,o),l=this.pow(e,o.addn(1).iushrn(1)),h=this.pow(e,o),p=a;0!==h.cmp(s);){for(var m=h,g=0;0!==m.cmp(s);g++)m=m.redSqr();r(g=0;n--){for(var u=t.words[n],f=c-1;f>=0;f--){var d=u>>f&1;o!==r[0]&&(o=this.sqr(o)),0!==d||0!==a?(a<<=1,a|=d,(4==++s||0===n&&0===f)&&(o=this.mul(o,r[a]),s=0,a=0)):s=0}c=26}return o},E.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},E.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new S(e)},n(S,E),S.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},S.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},S.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},S.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(n).iushrn(this.shift),a=o;return o.cmp(this.m)>=0?a=o.isub(this.m):o.cmpn(0)<0&&(a=o.iadd(this.m)),a._forceRed(this)},S.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(l,a);var p=l.exports,m=g;function g(e,t){if(!e)throw new Error(t||"Assertion failed")}g.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)};var y={};!function(e){var t=y;function r(e){return 1===e.length?"0"+e:e}function n(e){for(var t="",n=0;n>8,a=255&i;o?r.push(o,a):r.push(a)}return r},t.zero2=r,t.toHex=n,t.encode=function(e,t){return"hex"===t?n(e):e}}(),function(e){var t=d,r=p,n=m,i=y;t.assert=n,t.toArray=i.toArray,t.zero2=i.zero2,t.toHex=i.toHex,t.encode=i.encode,t.getNAF=function(e,t,r){var n=new Array(Math.max(e.bitLength(),r)+1);n.fill(0);for(var i=1<(i>>1)-1?(i>>1)-c:c,o.isubn(s)):s=0,n[a]=s,o.iushrn(1)}return n},t.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n,i=0,o=0;e.cmpn(-i)>0||t.cmpn(-o)>0;){var a,s,c=e.andln(3)+i&3,u=t.andln(3)+o&3;3===c&&(c=-1),3===u&&(u=-1),a=0==(1&c)?0:3!==(n=e.andln(7)+i&7)&&5!==n||2!==u?c:-c,r[0].push(a),s=0==(1&u)?0:3!==(n=t.andln(7)+o&7)&&5!==n||2!==c?u:-u,r[1].push(s),2*i===a+1&&(i=1-i),2*o===s+1&&(o=1-o),e.iushrn(1),t.iushrn(1)}return r},t.cachedProperty=function(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},t.parseBytes=function(e){return"string"==typeof e?t.toArray(e,"hex"):e},t.intFromLE=function(e){return new r(e,"hex","le")}}();var b,v={exports:{}};function w(e){this.rand=e}if(v.exports=function(e){return b||(b=new w(null)),b.generate(e)},v.exports.Rand=w,w.prototype.generate=function(e){return this._rand(e)},w.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),r=0;r0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var I=C;function R(e,t){this.curve=e,this.type=t,this.precomputed=null}C.prototype.point=function(){throw new Error("Not implemented")},C.prototype.validate=function(){throw new Error("Not implemented")},C.prototype._fixedNafMul=function(e,t){M(e.precomputed);var r=e._getDoubles(),n=x(t,1,this._bitLength),i=(1<=o;c--)a=(a<<1)+n[c];s.push(a)}for(var u=this.jpoint(null,null,null),f=this.jpoint(null,null,null),d=i;d>0;d--){for(o=0;o=0;s--){for(var c=0;s>=0&&0===o[s];s--)c++;if(s>=0&&c++,a=a.dblp(c),s<0)break;var u=o[s];M(0!==u),a="affine"===e.type?u>0?a.mixedAdd(i[u-1>>1]):a.mixedAdd(i[-u-1>>1].neg()):u>0?a.add(i[u-1>>1]):a.add(i[-u-1>>1].neg())}return"affine"===e.type?a.toP():a},C.prototype._wnafMulAdd=function(e,t,r,n,i){var o,a,s,c=this._wnafT1,u=this._wnafT2,f=this._wnafT3,d=0;for(o=0;o=1;o-=2){var h=o-1,p=o;if(1===c[h]&&1===c[p]){var m=[t[h],null,null,t[p]];0===t[h].y.cmp(t[p].y)?(m[1]=t[h].add(t[p]),m[2]=t[h].toJ().mixedAdd(t[p].neg())):0===t[h].y.cmp(t[p].y.redNeg())?(m[1]=t[h].toJ().mixedAdd(t[p]),m[2]=t[h].add(t[p].neg())):(m[1]=t[h].toJ().mixedAdd(t[p]),m[2]=t[h].toJ().mixedAdd(t[p].neg()));var g=[-3,-1,-5,-7,0,7,5,1,3],y=k(r[h],r[p]);for(d=Math.max(y[0].length,d),f[h]=new Array(d),f[p]=new Array(d),a=0;a=0;o--){for(var _=0;o>=0;){var E=!0;for(a=0;a=0&&_++,w=w.dblp(_),o<0)break;for(a=0;a0?s=u[a][S-1>>1]:S<0&&(s=u[a][-S-1>>1].neg()),w="affine"===s.type?w.mixedAdd(s):w.add(s))}}for(o=0;o=Math.ceil((e.bitLength()+1)/t.step)},R.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i=0&&(o=t,a=r),n.negative&&(n=n.neg(),i=i.neg()),o.negative&&(o=o.neg(),a=a.neg()),[{a:n,b:i},{a:o,b:a}]},B.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],i=n.b.mul(e).divRound(this.n),o=r.b.neg().mul(e).divRound(this.n),a=i.mul(r.a),s=o.mul(n.a),c=i.mul(r.b),u=o.mul(n.b);return{k1:e.sub(a).sub(s),k2:c.add(u).neg()}},B.prototype.pointFromX=function(e,t){(e=new T(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var i=n.fromRed().isOdd();return(t&&!i||!t&&i)&&(n=n.redNeg()),this.point(e,n)},B.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},B.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o":""},z.prototype.isInfinity=function(){return this.inf},z.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},z.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),a=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)},z.prototype.getX=function(){return this.x.fromRed()},z.prototype.getY=function(){return this.y.fromRed()},z.prototype.mul=function(e){return e=new T(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)},z.prototype.mulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},z.prototype.jmulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},z.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))},z.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,n=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return t},z.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},j(U,$.BasePoint),B.prototype.jpoint=function(e,t,r){return new U(this,e,t,r)},U.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},U.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},U.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),i=e.x.redMul(r),o=this.y.redMul(t.redMul(e.z)),a=e.y.redMul(r.redMul(this.z)),s=n.redSub(i),c=o.redSub(a);if(0===s.cmpn(0))return 0!==c.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=s.redSqr(),f=u.redMul(s),d=n.redMul(u),l=c.redSqr().redIAdd(f).redISub(d).redISub(d),h=c.redMul(d.redISub(l)).redISub(o.redMul(f)),p=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(l,h,p)},U.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),i=this.y,o=e.y.redMul(t).redMul(this.z),a=r.redSub(n),s=i.redSub(o);if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=a.redSqr(),u=c.redMul(a),f=r.redMul(c),d=s.redSqr().redIAdd(u).redISub(f).redISub(f),l=s.redMul(f.redISub(d)).redISub(i.redMul(u)),h=this.z.redMul(a);return this.curve.jpoint(d,l,h)},U.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var r=this;for(t=0;t=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},U.prototype.inspect=function(){return this.isInfinity()?"":""},U.prototype.isInfinity=function(){return 0===this.z.cmpn(0)};var L=p,q=O,H=I,K=d;function J(e){H.call(this,"mont",e),this.a=new L(e.a,16).toRed(this.red),this.b=new L(e.b,16).toRed(this.red),this.i4=new L(4).toRed(this.red).redInvm(),this.two=new L(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}q(J,H);var W=J;function G(e,t,r){H.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new L(t,16),this.z=new L(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}J.prototype.validate=function(e){var t=e.normalize().x,r=t.redSqr(),n=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t);return 0===n.redSqrt().redSqr().cmp(n)},q(G,H.BasePoint),J.prototype.decodePoint=function(e,t){return this.point(K.toArray(e,t),1)},J.prototype.point=function(e,t){return new G(this,e,t)},J.prototype.pointFromJSON=function(e){return G.fromJSON(this,e)},G.prototype.precompute=function(){},G.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},G.fromJSON=function(e,t){return new G(e,t[0],t[1]||e.one)},G.prototype.inspect=function(){return this.isInfinity()?"":""},G.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},G.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),r=e.redSub(t),n=e.redMul(t),i=r.redMul(t.redAdd(this.curve.a24.redMul(r)));return this.curve.point(n,i)},G.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},G.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=e.x.redAdd(e.z),o=e.x.redSub(e.z).redMul(r),a=i.redMul(n),s=t.z.redMul(o.redAdd(a).redSqr()),c=t.x.redMul(o.redISub(a).redSqr());return this.curve.point(s,c)},G.prototype.mul=function(e){for(var t=e.clone(),r=this,n=this.curve.point(null,null),i=[];0!==t.cmpn(0);t.iushrn(1))i.push(t.andln(1));for(var o=i.length-1;o>=0;o--)0===i[o]?(r=r.diffAdd(n,this),n=n.dbl()):(n=r.diffAdd(n,this),r=r.dbl());return n},G.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},G.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},G.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},G.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},G.prototype.getX=function(){return this.normalize(),this.x.fromRed()};var V=p,Z=O,X=I,Q=d.assert;function Y(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,X.call(this,"edwards",e),this.a=new V(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new V(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new V(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),Q(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}Z(Y,X);var ee=Y;function te(e,t,r,n,i){X.BasePoint.call(this,e,"projective"),null===t&&null===r&&null===n?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new V(t,16),this.y=new V(r,16),this.z=n?new V(n,16):this.curve.one,this.t=i&&new V(i,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}Y.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},Y.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},Y.prototype.jpoint=function(e,t,r,n){return this.point(e,t,r,n)},Y.prototype.pointFromX=function(e,t){(e=new V(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=this.c2.redSub(this.a.redMul(r)),i=this.one.redSub(this.c2.redMul(this.d).redMul(r)),o=n.redMul(i.redInvm()),a=o.redSqrt();if(0!==a.redSqr().redSub(o).cmp(this.zero))throw new Error("invalid point");var s=a.fromRed().isOdd();return(t&&!s||!t&&s)&&(a=a.redNeg()),this.point(e,a)},Y.prototype.pointFromY=function(e,t){(e=new V(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=r.redSub(this.c2),i=r.redMul(this.d).redMul(this.c2).redSub(this.a),o=n.redMul(i.redInvm());if(0===o.cmp(this.zero)){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var a=o.redSqrt();if(0!==a.redSqr().redSub(o).cmp(this.zero))throw new Error("invalid point");return a.fromRed().isOdd()!==t&&(a=a.redNeg()),this.point(a,e)},Y.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),r=e.y.redSqr(),n=t.redMul(this.a).redAdd(r),i=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(r)));return 0===n.cmp(i)},Z(te,X.BasePoint),Y.prototype.pointFromJSON=function(e){return te.fromJSON(this,e)},Y.prototype.point=function(e,t,r,n){return new te(this,e,t,r,n)},te.fromJSON=function(e,t){return new te(e,t[0],t[1],t[2])},te.prototype.inspect=function(){return this.isInfinity()?"":""},te.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},te.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(e),i=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),o=n.redAdd(t),a=o.redSub(r),s=n.redSub(t),c=i.redMul(a),u=o.redMul(s),f=i.redMul(s),d=a.redMul(o);return this.curve.point(c,u,d,f)},te.prototype._projDbl=function(){var e,t,r,n,i,o,a=this.x.redAdd(this.y).redSqr(),s=this.x.redSqr(),c=this.y.redSqr();if(this.curve.twisted){var u=(n=this.curve._mulA(s)).redAdd(c);this.zOne?(e=a.redSub(s).redSub(c).redMul(u.redSub(this.curve.two)),t=u.redMul(n.redSub(c)),r=u.redSqr().redSub(u).redSub(u)):(i=this.z.redSqr(),o=u.redSub(i).redISub(i),e=a.redSub(s).redISub(c).redMul(o),t=u.redMul(n.redSub(c)),r=u.redMul(o))}else n=s.redAdd(c),i=this.curve._mulC(this.z).redSqr(),o=n.redSub(i).redSub(i),e=this.curve._mulC(a.redISub(n)).redMul(o),t=this.curve._mulC(n).redMul(s.redISub(c)),r=n.redMul(o);return this.curve.point(e,t,r)},te.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},te.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),n=this.t.redMul(this.curve.dd).redMul(e.t),i=this.z.redMul(e.z.redAdd(e.z)),o=r.redSub(t),a=i.redSub(n),s=i.redAdd(n),c=r.redAdd(t),u=o.redMul(a),f=s.redMul(c),d=o.redMul(c),l=a.redMul(s);return this.curve.point(u,f,l,d)},te.prototype._projAdd=function(e){var t,r,n=this.z.redMul(e.z),i=n.redSqr(),o=this.x.redMul(e.x),a=this.y.redMul(e.y),s=this.curve.d.redMul(o).redMul(a),c=i.redSub(s),u=i.redAdd(s),f=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(o).redISub(a),d=n.redMul(c).redMul(f);return this.curve.twisted?(t=n.redMul(u).redMul(a.redSub(this.curve._mulA(o))),r=c.redMul(u)):(t=n.redMul(u).redMul(a.redSub(o)),r=this.curve._mulC(c).redMul(u)),this.curve.point(d,t,r)},te.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},te.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},te.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},te.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},te.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},te.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},te.prototype.getX=function(){return this.normalize(),this.x.fromRed()},te.prototype.getY=function(){return this.normalize(),this.y.fromRed()},te.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},te.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var r=e.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(n),0===this.x.cmp(t))return!0}},te.prototype.toP=te.prototype.normalize,te.prototype.mixedAdd=te.prototype.add,function(e){var t=e;t.base=I,t.short=F,t.mont=W,t.edwards=ee}(E);var re={},ne={},ie={},oe=m,ae=O;function se(e,t){return 55296==(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1)))}function ce(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function ue(e){return 1===e.length?"0"+e:e}function fe(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}ie.inherits=ae,ie.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),i=0;i>6|192,r[n++]=63&o|128):se(e,i)?(o=65536+((1023&o)<<10)+(1023&e.charCodeAt(++i)),r[n++]=o>>18|240,r[n++]=o>>12&63|128,r[n++]=o>>6&63|128,r[n++]=63&o|128):(r[n++]=o>>12|224,r[n++]=o>>6&63|128,r[n++]=63&o|128)}else for(i=0;i>>0}return o},ie.split32=function(e,t){for(var r=new Array(4*e.length),n=0,i=0;n>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}return r},ie.rotr32=function(e,t){return e>>>t|e<<32-t},ie.rotl32=function(e,t){return e<>>32-t},ie.sum32=function(e,t){return e+t>>>0},ie.sum32_3=function(e,t,r){return e+t+r>>>0},ie.sum32_4=function(e,t,r,n){return e+t+r+n>>>0},ie.sum32_5=function(e,t,r,n,i){return e+t+r+n+i>>>0},ie.sum64=function(e,t,r,n){var i=e[t],o=n+e[t+1]>>>0,a=(o>>0,e[t+1]=o},ie.sum64_hi=function(e,t,r,n){return(t+n>>>0>>0},ie.sum64_lo=function(e,t,r,n){return t+n>>>0},ie.sum64_4_hi=function(e,t,r,n,i,o,a,s){var c=0,u=t;return c+=(u=u+n>>>0)>>0)>>0)>>0},ie.sum64_4_lo=function(e,t,r,n,i,o,a,s){return t+n+o+s>>>0},ie.sum64_5_hi=function(e,t,r,n,i,o,a,s,c,u){var f=0,d=t;return f+=(d=d+n>>>0)>>0)>>0)>>0)>>0},ie.sum64_5_lo=function(e,t,r,n,i,o,a,s,c,u){return t+n+o+s+u>>>0},ie.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},ie.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},ie.shr64_hi=function(e,t,r){return e>>>r},ie.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0};var de={},le=ie,he=m;function pe(){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}de.BlockHash=pe,pe.prototype.update=function(e,t){if(e=le.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=le.join32(e,0,e.length-r,this.endian);for(var n=0;n>>24&255,n[i++]=e>>>16&255,n[i++]=e>>>8&255,n[i++]=255&e}else for(n[i++]=255&e,n[i++]=e>>>8&255,n[i++]=e>>>16&255,n[i++]=e>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;o>>3},ge.g1_256=function(e){return ye(e,17)^ye(e,19)^e>>>10};var Ae=ie,_e=de,Ee=ge,Se=Ae.rotl32,Pe=Ae.sum32,xe=Ae.sum32_5,ke=Ee.ft_1,Me=_e.BlockHash,Ce=[1518500249,1859775393,2400959708,3395469782];function Ie(){if(!(this instanceof Ie))return new Ie;Me.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}Ae.inherits(Ie,Me);var Re=Ie;Ie.blockSize=512,Ie.outSize=160,Ie.hmacStrength=80,Ie.padLength=64,Ie.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;nthis.blockSize&&(e=(new this.Hash).update(e).digest()),Zt(e.length<=this.blockSize);for(var t=e.length;t=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}var ar=or;or.prototype._init=function(e,t,r){var n=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},or.prototype.generate=function(e,t,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(n=r,r=t,t=null),r&&(r=nr.toArray(r,n||"hex"),this._update(r));for(var i=[];i.length"};var dr=p,lr=d,hr=lr.assert;function pr(e,t){if(e instanceof pr)return e;this._importDER(e,t)||(hr(e.r&&e.s,"Signature without r or s"),this.r=new dr(e.r,16),this.s=new dr(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}var mr=pr;function gr(){this.place=0}function yr(e,t){var r=e[t.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var i=0,o=0,a=t.place;o>>=0;return!(i<=127)&&(t.place=a,i)}function br(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}pr.prototype._importDER=function(e,t){e=lr.toArray(e,t);var r=new gr;if(48!==e[r.place++])return!1;var n=yr(e,r);if(!1===n)return!1;if(n+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var i=yr(e,r);if(!1===i)return!1;var o=e.slice(r.place,i+r.place);if(r.place+=i,2!==e[r.place++])return!1;var a=yr(e,r);if(!1===a)return!1;if(e.length!==a+r.place)return!1;var s=e.slice(r.place,a+r.place);if(0===o[0]){if(!(128&o[1]))return!1;o=o.slice(1)}if(0===s[0]){if(!(128&s[1]))return!1;s=s.slice(1)}return this.r=new dr(o),this.s=new dr(s),this.recoveryParam=null,!0},pr.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=br(t),r=br(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];vr(n,t.length),(n=n.concat(t)).push(2),vr(n,r.length);var i=n.concat(r),o=[48];return vr(o,i.length),o=o.concat(i),lr.encode(o,e)};var wr=p,Ar=ar,_r=re,Er=_,Sr=d.assert,Pr=fr,xr=mr;function kr(e){if(!(this instanceof kr))return new kr(e);"string"==typeof e&&(Sr(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}var Mr=kr;kr.prototype.keyPair=function(e){return new Pr(this,e)},kr.prototype.keyFromPrivate=function(e,t){return Pr.fromPrivate(this,e,t)},kr.prototype.keyFromPublic=function(e,t){return Pr.fromPublic(this,e,t)},kr.prototype.genKeyPair=function(e){e||(e={});for(var t=new Ar({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||Er(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),n=this.n.sub(new wr(2));;){var i=new wr(t.generate(r));if(!(i.cmp(n)>0))return i.iaddn(1),this.keyFromPrivate(i)}},kr.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},kr.prototype.sign=function(e,t,r,n){"object"==typeof r&&(n=r,r=null),n||(n={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new wr(e,16));for(var i=this.n.byteLength(),o=t.getPrivate().toArray("be",i),a=e.toArray("be",i),s=new Ar({hash:this.hash,entropy:o,nonce:a,pers:n.pers,persEnc:n.persEnc||"utf8"}),c=this.n.sub(new wr(1)),u=0;;u++){var f=n.k?n.k(u):new wr(s.generate(this.n.byteLength()));if(!((f=this._truncateToN(f,!0)).cmpn(1)<=0||f.cmp(c)>=0)){var d=this.g.mul(f);if(!d.isInfinity()){var l=d.getX(),h=l.umod(this.n);if(0!==h.cmpn(0)){var p=f.invm(this.n).mul(h.mul(t.getPrivate()).iadd(e));if(0!==(p=p.umod(this.n)).cmpn(0)){var m=(d.getY().isOdd()?1:0)|(0!==l.cmp(h)?2:0);return n.canonical&&p.cmp(this.nh)>0&&(p=this.n.sub(p),m^=1),new xr({r:h,s:p,recoveryParam:m})}}}}}},kr.prototype.verify=function(e,t,r,n){e=this._truncateToN(new wr(e,16)),r=this.keyFromPublic(r,n);var i=(t=new xr(t,"hex")).r,o=t.s;if(i.cmpn(1)<0||i.cmp(this.n)>=0)return!1;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var a,s=o.invm(this.n),c=s.mul(e).umod(this.n),u=s.mul(i).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(c,r.getPublic(),u)).isInfinity()&&a.eqXToP(i):!(a=this.g.mulAdd(c,r.getPublic(),u)).isInfinity()&&0===a.getX().umod(this.n).cmp(i)},kr.prototype.recoverPubKey=function(e,t,r,n){Sr((3&r)===r,"The recovery param is more than two bits"),t=new xr(t,n);var i=this.n,o=new wr(e),a=t.r,s=t.s,c=1&r,u=r>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&u)throw new Error("Unable to find sencond key candinate");a=u?this.curve.pointFromX(a.add(this.curve.n),c):this.curve.pointFromX(a,c);var f=t.r.invm(i),d=i.sub(o).mul(f).umod(i),l=s.mul(f).umod(i);return this.g.mulAdd(d,a,l)},kr.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new xr(t,n)).recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(e,t,i)}catch(e){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")};var Cr=d,Ir=Cr.assert,Rr=Cr.parseBytes,Nr=Cr.cachedProperty;function Or(e,t){this.eddsa=e,this._secret=Rr(t.secret),e.isPoint(t.pub)?this._pub=t.pub:this._pubBytes=Rr(t.pub)}Or.fromPublic=function(e,t){return t instanceof Or?t:new Or(e,{pub:t})},Or.fromSecret=function(e,t){return t instanceof Or?t:new Or(e,{secret:t})},Or.prototype.secret=function(){return this._secret},Nr(Or,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),Nr(Or,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),Nr(Or,"privBytes",(function(){var e=this.eddsa,t=this.hash(),r=e.encodingLength-1,n=t.slice(0,e.encodingLength);return n[0]&=248,n[r]&=127,n[r]|=64,n})),Nr(Or,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),Nr(Or,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),Nr(Or,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),Or.prototype.sign=function(e){return Ir(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},Or.prototype.verify=function(e,t){return this.eddsa.verify(e,t,this)},Or.prototype.getSecret=function(e){return Ir(this._secret,"KeyPair is public only"),Cr.encode(this.secret(),e)},Or.prototype.getPublic=function(e){return Cr.encode(this.pubBytes(),e)};var Tr=Or,jr=p,$r=d,Dr=$r.assert,Br=$r.cachedProperty,Fr=$r.parseBytes;function zr(e,t){this.eddsa=e,"object"!=typeof t&&(t=Fr(t)),Array.isArray(t)&&(t={R:t.slice(0,e.encodingLength),S:t.slice(e.encodingLength)}),Dr(t.R&&t.S,"Signature without R or S"),e.isPoint(t.R)&&(this._R=t.R),t.S instanceof jr&&(this._S=t.S),this._Rencoded=Array.isArray(t.R)?t.R:t.Rencoded,this._Sencoded=Array.isArray(t.S)?t.S:t.Sencoded}Br(zr,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),Br(zr,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),Br(zr,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),Br(zr,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),zr.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},zr.prototype.toHex=function(){return $r.encode(this.toBytes(),"hex").toUpperCase()};var Ur=zr,Lr=ne,qr=re,Hr=d,Kr=Hr.assert,Jr=Hr.parseBytes,Wr=Tr,Gr=Ur;function Vr(e){if(Kr("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof Vr))return new Vr(e);e=qr[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=Lr.sha512}var Zr=Vr;Vr.prototype.sign=function(e,t){e=Jr(e);var r=this.keyFromSecret(t),n=this.hashInt(r.messagePrefix(),e),i=this.g.mul(n),o=this.encodePoint(i),a=this.hashInt(o,r.pubBytes(),e).mul(r.priv()),s=n.add(a).umod(this.curve.n);return this.makeSignature({R:i,S:s,Rencoded:o})},Vr.prototype.verify=function(e,t,r){e=Jr(e),t=this.makeSignature(t);var n=this.keyFromPublic(r),i=this.hashInt(t.Rencoded(),n.pubBytes(),e),o=this.g.mul(t.S());return t.R().add(n.pub().mul(i)).eq(o)},Vr.prototype.hashInt=function(){for(var e=this.hash(),t=0;te instanceof CryptoKey,cn=async(e,t)=>{const r=`SHA-${e.slice(-3)}`;return new Uint8Array(await an.subtle.digest(r,t))},un=new TextEncoder,fn=new TextDecoder,dn=2**32;function ln(...e){const t=e.reduce(((e,{length:t})=>e+t),0),r=new Uint8Array(t);let n=0;return e.forEach((e=>{r.set(e,n),n+=e.length})),r}function hn(e,t,r){if(t<0||t>=dn)throw new RangeError(`value must be >= 0 and <= ${dn-1}. Received ${t}`);e.set([t>>>24,t>>>16,t>>>8,255&t],r)}function pn(e){const t=Math.floor(e/dn),r=e%dn,n=new Uint8Array(8);return hn(n,t,0),hn(n,r,4),n}function mn(e){const t=new Uint8Array(4);return hn(t,e),t}function gn(e){return ln(mn(e.length),e)}const yn=e=>(e=>{let t=e;"string"==typeof t&&(t=un.encode(t));const r=[];for(let e=0;e{let t=e;t instanceof Uint8Array&&(t=fn.decode(t)),t=t.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"");try{return(e=>{const t=atob(e),r=new Uint8Array(t.length);for(let e=0;eCn(new Uint8Array(In(e)>>3));const Nn=(e,t)=>{if(t.length<<3!==In(e))throw new Pn("Invalid Initialization Vector length")},On=(e,t)=>{const r=e.byteLength<<3;if(r!==t)throw new Pn(`Invalid Content Encryption Key length. Expected ${t} bits, got ${r} bits`)};function Tn(){return"undefined"!=typeof WebSocketPair||"undefined"!=typeof navigator&&"Cloudflare-Workers"===navigator.userAgent||"undefined"!=typeof EdgeRuntime&&"vercel"===EdgeRuntime}function jn(e,t="algorithm.name"){return new TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`)}function $n(e,t){return e.name===t}function Dn(e){return parseInt(e.name.slice(4),10)}function Bn(e,t){if(t.length&&!t.some((t=>e.usages.includes(t)))){let e="CryptoKey does not support this operation, its usages must include ";if(t.length>2){const r=t.pop();e+=`one of ${t.join(", ")}, or ${r}.`}else 2===t.length?e+=`one of ${t[0]} or ${t[1]}.`:e+=`${t[0]}.`;throw new TypeError(e)}}function Fn(e,t,...r){switch(t){case"HS256":case"HS384":case"HS512":{if(!$n(e.algorithm,"HMAC"))throw jn("HMAC");const r=parseInt(t.slice(2),10);if(Dn(e.algorithm.hash)!==r)throw jn(`SHA-${r}`,"algorithm.hash");break}case"RS256":case"RS384":case"RS512":{if(!$n(e.algorithm,"RSASSA-PKCS1-v1_5"))throw jn("RSASSA-PKCS1-v1_5");const r=parseInt(t.slice(2),10);if(Dn(e.algorithm.hash)!==r)throw jn(`SHA-${r}`,"algorithm.hash");break}case"PS256":case"PS384":case"PS512":{if(!$n(e.algorithm,"RSA-PSS"))throw jn("RSA-PSS");const r=parseInt(t.slice(2),10);if(Dn(e.algorithm.hash)!==r)throw jn(`SHA-${r}`,"algorithm.hash");break}case"EdDSA":if("Ed25519"!==e.algorithm.name&&"Ed448"!==e.algorithm.name){if(Tn()){if($n(e.algorithm,"NODE-ED25519"))break;throw jn("Ed25519, Ed448, or NODE-ED25519")}throw jn("Ed25519 or Ed448")}break;case"ES256":case"ES384":case"ES512":{if(!$n(e.algorithm,"ECDSA"))throw jn("ECDSA");const r=function(e){switch(e){case"ES256":return"P-256";case"ES384":return"P-384";case"ES512":return"P-521";default:throw new Error("unreachable")}}(t);if(e.algorithm.namedCurve!==r)throw jn(r,"algorithm.namedCurve");break}default:throw new TypeError("CryptoKey does not support this operation")}Bn(e,r)}function zn(e,t,...r){switch(t){case"A128GCM":case"A192GCM":case"A256GCM":{if(!$n(e.algorithm,"AES-GCM"))throw jn("AES-GCM");const r=parseInt(t.slice(1,4),10);if(e.algorithm.length!==r)throw jn(r,"algorithm.length");break}case"A128KW":case"A192KW":case"A256KW":{if(!$n(e.algorithm,"AES-KW"))throw jn("AES-KW");const r=parseInt(t.slice(1,4),10);if(e.algorithm.length!==r)throw jn(r,"algorithm.length");break}case"ECDH":switch(e.algorithm.name){case"ECDH":case"X25519":case"X448":break;default:throw jn("ECDH, X25519, or X448")}break;case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":if(!$n(e.algorithm,"PBKDF2"))throw jn("PBKDF2");break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":{if(!$n(e.algorithm,"RSA-OAEP"))throw jn("RSA-OAEP");const r=parseInt(t.slice(9),10)||1;if(Dn(e.algorithm.hash)!==r)throw jn(`SHA-${r}`,"algorithm.hash");break}default:throw new TypeError("CryptoKey does not support this operation")}Bn(e,r)}function Un(e,t,...r){if(r.length>2){const t=r.pop();e+=`one of type ${r.join(", ")}, or ${t}.`}else 2===r.length?e+=`one of type ${r[0]} or ${r[1]}.`:e+=`of type ${r[0]}.`;return null==t?e+=` Received ${t}`:"function"==typeof t&&t.name?e+=` Received function ${t.name}`:"object"==typeof t&&null!=t&&t.constructor&&t.constructor.name&&(e+=` Received an instance of ${t.constructor.name}`),e}var Ln=(e,...t)=>Un("Key must be ",e,...t);function qn(e,t,...r){return Un(`Key for the ${e} algorithm must be `,t,...r)}var Hn=e=>sn(e);const Kn=["CryptoKey"];async function Jn(e,t,r,n,i,o){if(!(t instanceof Uint8Array))throw new TypeError(Ln(t,"Uint8Array"));const a=parseInt(e.slice(1,4),10),s=await an.subtle.importKey("raw",t.subarray(a>>3),"AES-CBC",!1,["decrypt"]),c=await an.subtle.importKey("raw",t.subarray(0,a>>3),{hash:"SHA-"+(a<<1),name:"HMAC"},!1,["sign"]),u=ln(o,n,r,pn(o.length<<3)),f=new Uint8Array((await an.subtle.sign("HMAC",c,u)).slice(0,a>>3));let d,l;try{d=((e,t)=>{if(!(e instanceof Uint8Array))throw new TypeError("First argument must be a buffer");if(!(t instanceof Uint8Array))throw new TypeError("Second argument must be a buffer");if(e.length!==t.length)throw new TypeError("Input buffers must have the same length");const r=e.length;let n=0,i=-1;for(;++i{if(!(sn(t)||t instanceof Uint8Array))throw new TypeError(Ln(t,...Kn,"Uint8Array"));switch(Nn(e,n),e){case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return t instanceof Uint8Array&&On(t,parseInt(e.slice(-3),10)),Jn(e,t,r,n,i,o);case"A128GCM":case"A192GCM":case"A256GCM":return t instanceof Uint8Array&&On(t,parseInt(e.slice(1,4),10)),async function(e,t,r,n,i,o){let a;t instanceof Uint8Array?a=await an.subtle.importKey("raw",t,"AES-GCM",!1,["decrypt"]):(zn(t,e,"decrypt"),a=t);try{return new Uint8Array(await an.subtle.decrypt({additionalData:o,iv:n,name:"AES-GCM",tagLength:128},a,ln(r,i)))}catch(e){throw new Sn}}(e,t,r,n,i,o);default:throw new En("Unsupported JWE Content Encryption Algorithm")}},Gn=async()=>{throw new En('JWE "zip" (Compression Algorithm) Header Parameter is not supported by your javascript runtime. You need to use the `inflateRaw` decrypt option to provide Inflate Raw implementation.')},Vn=async()=>{throw new En('JWE "zip" (Compression Algorithm) Header Parameter is not supported by your javascript runtime. You need to use the `deflateRaw` encrypt option to provide Deflate Raw implementation.')},Zn=(...e)=>{const t=e.filter(Boolean);if(0===t.length||1===t.length)return!0;let r;for(const e of t){const t=Object.keys(e);if(r&&0!==r.size)for(const e of t){if(r.has(e))return!1;r.add(e)}else r=new Set(t)}return!0};function Xn(e){if("object"!=typeof(t=e)||null===t||"[object Object]"!==Object.prototype.toString.call(e))return!1;var t;if(null===Object.getPrototypeOf(e))return!0;let r=e;for(;null!==Object.getPrototypeOf(r);)r=Object.getPrototypeOf(r);return Object.getPrototypeOf(e)===r}const Qn=[{hash:"SHA-256",name:"HMAC"},!0,["sign"]];function Yn(e,t){if(e.algorithm.length!==parseInt(t.slice(1,4),10))throw new TypeError(`Invalid key size for alg: ${t}`)}function ei(e,t,r){if(sn(e))return zn(e,t,r),e;if(e instanceof Uint8Array)return an.subtle.importKey("raw",e,"AES-KW",!0,[r]);throw new TypeError(Ln(e,...Kn,"Uint8Array"))}const ti=async(e,t,r)=>{const n=await ei(t,e,"wrapKey");Yn(n,e);const i=await an.subtle.importKey("raw",r,...Qn);return new Uint8Array(await an.subtle.wrapKey("raw",i,n,"AES-KW"))},ri=async(e,t,r)=>{const n=await ei(t,e,"unwrapKey");Yn(n,e);const i=await an.subtle.unwrapKey("raw",r,n,"AES-KW",...Qn);return new Uint8Array(await an.subtle.exportKey("raw",i))};async function ni(e,t,r,n,i=new Uint8Array(0),o=new Uint8Array(0)){if(!sn(e))throw new TypeError(Ln(e,...Kn));if(zn(e,"ECDH"),!sn(t))throw new TypeError(Ln(t,...Kn));zn(t,"ECDH","deriveBits");const a=ln(gn(un.encode(r)),gn(i),gn(o),mn(n));let s;s="X25519"===e.algorithm.name?256:"X448"===e.algorithm.name?448:Math.ceil(parseInt(e.algorithm.namedCurve.substr(-3),10)/8)<<3;return async function(e,t,r){const n=Math.ceil((t>>3)/32),i=new Uint8Array(32*n);for(let t=0;t>3)}(new Uint8Array(await an.subtle.deriveBits({name:e.algorithm.name,public:e},t,s)),n,a)}function ii(e){if(!sn(e))throw new TypeError(Ln(e,...Kn));return["P-256","P-384","P-521"].includes(e.algorithm.namedCurve)||"X25519"===e.algorithm.name||"X448"===e.algorithm.name}async function oi(e,t,r,n){!function(e){if(!(e instanceof Uint8Array)||e.length<8)throw new Pn("PBES2 Salt Input must be 8 or more octets")}(e);const i=function(e,t){return ln(un.encode(e),new Uint8Array([0]),t)}(t,e),o=parseInt(t.slice(13,16),10),a={hash:`SHA-${t.slice(8,11)}`,iterations:r,name:"PBKDF2",salt:i},s={length:o,name:"AES-KW"},c=await function(e,t){if(e instanceof Uint8Array)return an.subtle.importKey("raw",e,"PBKDF2",!1,["deriveBits"]);if(sn(e))return zn(e,t,"deriveBits","deriveKey"),e;throw new TypeError(Ln(e,...Kn,"Uint8Array"))}(n,t);if(c.usages.includes("deriveBits"))return new Uint8Array(await an.subtle.deriveBits(a,c,o));if(c.usages.includes("deriveKey"))return an.subtle.deriveKey(a,c,s,!1,["wrapKey","unwrapKey"]);throw new TypeError('PBKDF2 key "usages" must include "deriveBits" or "deriveKey"')}const ai=async(e,t,r,n,i)=>{const o=await oi(i,e,n,t);return ri(e.slice(-6),o,r)};function si(e){switch(e){case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":return"RSA-OAEP";default:throw new En(`alg ${e} is not supported either by JOSE or your javascript runtime`)}}var ci=(e,t)=>{if(e.startsWith("RS")||e.startsWith("PS")){const{modulusLength:r}=t.algorithm;if("number"!=typeof r||r<2048)throw new TypeError(`${e} requires key modulusLength to be 2048 bits or larger`)}};const ui=async(e,t,r)=>{if(!sn(t))throw new TypeError(Ln(t,...Kn));if(zn(t,e,"decrypt","unwrapKey"),ci(e,t),t.usages.includes("decrypt"))return new Uint8Array(await an.subtle.decrypt(si(e),t,r));if(t.usages.includes("unwrapKey")){const n=await an.subtle.unwrapKey("raw",r,t,si(e),...Qn);return new Uint8Array(await an.subtle.exportKey("raw",n))}throw new TypeError('RSA-OAEP key "usages" must include "decrypt" or "unwrapKey" for this operation')};function fi(e){switch(e){case"A128GCM":return 128;case"A192GCM":return 192;case"A256GCM":case"A128CBC-HS256":return 256;case"A192CBC-HS384":return 384;case"A256CBC-HS512":return 512;default:throw new En(`Unsupported JWE Algorithm: ${e}`)}}var di=e=>Cn(new Uint8Array(fi(e)>>3));var li=async e=>{var t,r;if(!e.alg)throw new TypeError('"alg" argument is required when "jwk.alg" is not present');const{algorithm:n,keyUsages:i}=function(e){let t,r;switch(e.kty){case"oct":switch(e.alg){case"HS256":case"HS384":case"HS512":t={name:"HMAC",hash:`SHA-${e.alg.slice(-3)}`},r=["sign","verify"];break;case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":throw new En(`${e.alg} keys cannot be imported as CryptoKey instances`);case"A128GCM":case"A192GCM":case"A256GCM":case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":t={name:"AES-GCM"},r=["encrypt","decrypt"];break;case"A128KW":case"A192KW":case"A256KW":t={name:"AES-KW"},r=["wrapKey","unwrapKey"];break;case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":t={name:"PBKDF2"},r=["deriveBits"];break;default:throw new En('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"RSA":switch(e.alg){case"PS256":case"PS384":case"PS512":t={name:"RSA-PSS",hash:`SHA-${e.alg.slice(-3)}`},r=e.d?["sign"]:["verify"];break;case"RS256":case"RS384":case"RS512":t={name:"RSASSA-PKCS1-v1_5",hash:`SHA-${e.alg.slice(-3)}`},r=e.d?["sign"]:["verify"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":t={name:"RSA-OAEP",hash:`SHA-${parseInt(e.alg.slice(-3),10)||1}`},r=e.d?["decrypt","unwrapKey"]:["encrypt","wrapKey"];break;default:throw new En('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"EC":switch(e.alg){case"ES256":t={name:"ECDSA",namedCurve:"P-256"},r=e.d?["sign"]:["verify"];break;case"ES384":t={name:"ECDSA",namedCurve:"P-384"},r=e.d?["sign"]:["verify"];break;case"ES512":t={name:"ECDSA",namedCurve:"P-521"},r=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":t={name:"ECDH",namedCurve:e.crv},r=e.d?["deriveBits"]:[];break;default:throw new En('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"OKP":switch(e.alg){case"EdDSA":t={name:e.crv},r=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":t={name:e.crv},r=e.d?["deriveBits"]:[];break;default:throw new En('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;default:throw new En('Invalid or unsupported JWK "kty" (Key Type) Parameter value')}return{algorithm:t,keyUsages:r}}(e),o=[n,null!==(t=e.ext)&&void 0!==t&&t,null!==(r=e.key_ops)&&void 0!==r?r:i];if("PBKDF2"===n.name)return an.subtle.importKey("raw",bn(e.k),...o);const a={...e};delete a.alg,delete a.use;try{return await an.subtle.importKey("jwk",a,...o)}catch(e){if("Ed25519"===n.name&&"NotSupportedError"===(null==e?void 0:e.name)&&Tn())return o[0]={name:"NODE-ED25519",namedCurve:"NODE-ED25519"},await an.subtle.importKey("jwk",a,...o);throw e}};async function hi(e,t,r){var n;if(!Xn(e))throw new TypeError("JWK must be an object");switch(t||(t=e.alg),e.kty){case"oct":if("string"!=typeof e.k||!e.k)throw new TypeError('missing "k" (Key Value) Parameter value');return null!=r||(r=!0!==e.ext),r?li({...e,alg:t,ext:null!==(n=e.ext)&&void 0!==n&&n}):bn(e.k);case"RSA":if(void 0!==e.oth)throw new En('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');case"EC":case"OKP":return li({...e,alg:t});default:throw new En('Unsupported "kty" (Key Type) Parameter value')}}const pi=(e,t,r)=>{e.startsWith("HS")||"dir"===e||e.startsWith("PBES2")||/^A\d{3}(?:GCM)?KW$/.test(e)?((e,t)=>{if(!(t instanceof Uint8Array)){if(!Hn(t))throw new TypeError(qn(e,t,...Kn,"Uint8Array"));if("secret"!==t.type)throw new TypeError(`${Kn.join(" or ")} instances for symmetric algorithms must be of type "secret"`)}})(e,t):((e,t,r)=>{if(!Hn(t))throw new TypeError(qn(e,t,...Kn));if("secret"===t.type)throw new TypeError(`${Kn.join(" or ")} instances for asymmetric algorithms must not be of type "secret"`);if("sign"===r&&"public"===t.type)throw new TypeError(`${Kn.join(" or ")} instances for asymmetric algorithm signing must be of type "private"`);if("decrypt"===r&&"public"===t.type)throw new TypeError(`${Kn.join(" or ")} instances for asymmetric algorithm decryption must be of type "private"`);if(t.algorithm&&"verify"===r&&"private"===t.type)throw new TypeError(`${Kn.join(" or ")} instances for asymmetric algorithm verifying must be of type "public"`);if(t.algorithm&&"encrypt"===r&&"private"===t.type)throw new TypeError(`${Kn.join(" or ")} instances for asymmetric algorithm encryption must be of type "public"`)})(e,t,r)};const mi=async(e,t,r,n,i)=>{if(!(sn(r)||r instanceof Uint8Array))throw new TypeError(Ln(r,...Kn,"Uint8Array"));switch(Nn(e,n),e){case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return r instanceof Uint8Array&&On(r,parseInt(e.slice(-3),10)),async function(e,t,r,n,i){if(!(r instanceof Uint8Array))throw new TypeError(Ln(r,"Uint8Array"));const o=parseInt(e.slice(1,4),10),a=await an.subtle.importKey("raw",r.subarray(o>>3),"AES-CBC",!1,["encrypt"]),s=await an.subtle.importKey("raw",r.subarray(0,o>>3),{hash:"SHA-"+(o<<1),name:"HMAC"},!1,["sign"]),c=new Uint8Array(await an.subtle.encrypt({iv:n,name:"AES-CBC"},a,t)),u=ln(i,n,c,pn(i.length<<3));return{ciphertext:c,tag:new Uint8Array((await an.subtle.sign("HMAC",s,u)).slice(0,o>>3))}}(e,t,r,n,i);case"A128GCM":case"A192GCM":case"A256GCM":return r instanceof Uint8Array&&On(r,parseInt(e.slice(1,4),10)),async function(e,t,r,n,i){let o;r instanceof Uint8Array?o=await an.subtle.importKey("raw",r,"AES-GCM",!1,["encrypt"]):(zn(r,e,"encrypt"),o=r);const a=new Uint8Array(await an.subtle.encrypt({additionalData:i,iv:n,name:"AES-GCM",tagLength:128},o,t)),s=a.slice(-16);return{ciphertext:a.slice(0,-16),tag:s}}(e,t,r,n,i);default:throw new En("Unsupported JWE Content Encryption Algorithm")}};async function gi(e,t,r,n,i){switch(pi(e,t,"decrypt"),e){case"dir":if(void 0!==r)throw new Pn("Encountered unexpected JWE Encrypted Key");return t;case"ECDH-ES":if(void 0!==r)throw new Pn("Encountered unexpected JWE Encrypted Key");case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{if(!Xn(n.epk))throw new Pn('JOSE Header "epk" (Ephemeral Public Key) missing or invalid');if(!ii(t))throw new En("ECDH with the provided key is not allowed or not supported by your javascript runtime");const i=await hi(n.epk,e);let o,a;if(void 0!==n.apu){if("string"!=typeof n.apu)throw new Pn('JOSE Header "apu" (Agreement PartyUInfo) invalid');o=bn(n.apu)}if(void 0!==n.apv){if("string"!=typeof n.apv)throw new Pn('JOSE Header "apv" (Agreement PartyVInfo) invalid');a=bn(n.apv)}const s=await ni(i,t,"ECDH-ES"===e?n.enc:e,"ECDH-ES"===e?fi(n.enc):parseInt(e.slice(-5,-2),10),o,a);if("ECDH-ES"===e)return s;if(void 0===r)throw new Pn("JWE Encrypted Key missing");return ri(e.slice(-6),s,r)}case"RSA1_5":case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":if(void 0===r)throw new Pn("JWE Encrypted Key missing");return ui(e,t,r);case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":{if(void 0===r)throw new Pn("JWE Encrypted Key missing");if("number"!=typeof n.p2c)throw new Pn('JOSE Header "p2c" (PBES2 Count) missing or invalid');const o=(null==i?void 0:i.maxPBES2Count)||1e4;if(n.p2c>o)throw new Pn('JOSE Header "p2c" (PBES2 Count) out is of acceptable bounds');if("string"!=typeof n.p2s)throw new Pn('JOSE Header "p2s" (PBES2 Salt) missing or invalid');return ai(e,t,r,n.p2c,bn(n.p2s))}case"A128KW":case"A192KW":case"A256KW":if(void 0===r)throw new Pn("JWE Encrypted Key missing");return ri(e,t,r);case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":if(void 0===r)throw new Pn("JWE Encrypted Key missing");if("string"!=typeof n.iv)throw new Pn('JOSE Header "iv" (Initialization Vector) missing or invalid');if("string"!=typeof n.tag)throw new Pn('JOSE Header "tag" (Authentication Tag) missing or invalid');return async function(e,t,r,n,i){const o=e.slice(0,7);return Wn(o,t,r,n,i,new Uint8Array(0))}(e,t,r,bn(n.iv),bn(n.tag));default:throw new En('Invalid or unsupported "alg" (JWE Algorithm) header value')}}function yi(e,t,r,n,i){if(void 0!==i.crit&&void 0===n.crit)throw new e('"crit" (Critical) Header Parameter MUST be integrity protected');if(!n||void 0===n.crit)return new Set;if(!Array.isArray(n.crit)||0===n.crit.length||n.crit.some((e=>"string"!=typeof e||0===e.length)))throw new e('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');let o;o=void 0!==r?new Map([...Object.entries(r),...t.entries()]):t;for(const t of n.crit){if(!o.has(t))throw new En(`Extension Header Parameter "${t}" is not recognized`);if(void 0===i[t])throw new e(`Extension Header Parameter "${t}" is missing`);if(o.get(t)&&void 0===n[t])throw new e(`Extension Header Parameter "${t}" MUST be integrity protected`)}return new Set(n.crit)}const bi=(e,t)=>{if(void 0!==t&&(!Array.isArray(t)||t.some((e=>"string"!=typeof e))))throw new TypeError(`"${e}" option must be an array of strings`);if(t)return new Set(t)};async function vi(e,t,r){if(e instanceof Uint8Array&&(e=fn.decode(e)),"string"!=typeof e)throw new Pn("Compact JWE must be a string or Uint8Array");const{0:n,1:i,2:o,3:a,4:s,length:c}=e.split(".");if(5!==c)throw new Pn("Invalid Compact JWE");const u=await async function(e,t,r){var n;if(!Xn(e))throw new Pn("Flattened JWE must be an object");if(void 0===e.protected&&void 0===e.header&&void 0===e.unprotected)throw new Pn("JOSE Header missing");if("string"!=typeof e.iv)throw new Pn("JWE Initialization Vector missing or incorrect type");if("string"!=typeof e.ciphertext)throw new Pn("JWE Ciphertext missing or incorrect type");if("string"!=typeof e.tag)throw new Pn("JWE Authentication Tag missing or incorrect type");if(void 0!==e.protected&&"string"!=typeof e.protected)throw new Pn("JWE Protected Header incorrect type");if(void 0!==e.encrypted_key&&"string"!=typeof e.encrypted_key)throw new Pn("JWE Encrypted Key incorrect type");if(void 0!==e.aad&&"string"!=typeof e.aad)throw new Pn("JWE AAD incorrect type");if(void 0!==e.header&&!Xn(e.header))throw new Pn("JWE Shared Unprotected Header incorrect type");if(void 0!==e.unprotected&&!Xn(e.unprotected))throw new Pn("JWE Per-Recipient Unprotected Header incorrect type");let i;if(e.protected)try{const t=bn(e.protected);i=JSON.parse(fn.decode(t))}catch(e){throw new Pn("JWE Protected Header is invalid")}if(!Zn(i,e.header,e.unprotected))throw new Pn("JWE Protected, JWE Unprotected Header, and JWE Per-Recipient Unprotected Header Parameter names must be disjoint");const o={...i,...e.header,...e.unprotected};if(yi(Pn,new Map,null==r?void 0:r.crit,i,o),void 0!==o.zip){if(!i||!i.zip)throw new Pn('JWE "zip" (Compression Algorithm) Header MUST be integrity protected');if("DEF"!==o.zip)throw new En('Unsupported JWE "zip" (Compression Algorithm) Header Parameter value')}const{alg:a,enc:s}=o;if("string"!=typeof a||!a)throw new Pn("missing JWE Algorithm (alg) in JWE Header");if("string"!=typeof s||!s)throw new Pn("missing JWE Encryption Algorithm (enc) in JWE Header");const c=r&&bi("keyManagementAlgorithms",r.keyManagementAlgorithms),u=r&&bi("contentEncryptionAlgorithms",r.contentEncryptionAlgorithms);if(c&&!c.has(a))throw new _n('"alg" (Algorithm) Header Parameter not allowed');if(u&&!u.has(s))throw new _n('"enc" (Encryption Algorithm) Header Parameter not allowed');let f;void 0!==e.encrypted_key&&(f=bn(e.encrypted_key));let d,l=!1;"function"==typeof t&&(t=await t(i,e),l=!0);try{d=await gi(a,t,f,o,r)}catch(e){if(e instanceof TypeError||e instanceof Pn||e instanceof En)throw e;d=di(s)}const h=bn(e.iv),p=bn(e.tag),m=un.encode(null!==(n=e.protected)&&void 0!==n?n:"");let g;g=void 0!==e.aad?ln(m,un.encode("."),un.encode(e.aad)):m;let y=await Wn(s,d,bn(e.ciphertext),h,p,g);"DEF"===o.zip&&(y=await((null==r?void 0:r.inflateRaw)||Gn)(y));const b={plaintext:y};return void 0!==e.protected&&(b.protectedHeader=i),void 0!==e.aad&&(b.additionalAuthenticatedData=bn(e.aad)),void 0!==e.unprotected&&(b.sharedUnprotectedHeader=e.unprotected),void 0!==e.header&&(b.unprotectedHeader=e.header),l?{...b,key:t}:b}({ciphertext:a,iv:o||void 0,protected:n||void 0,tag:s||void 0,encrypted_key:i||void 0},t,r),f={plaintext:u.plaintext,protectedHeader:u.protectedHeader};return"function"==typeof t?{...f,key:u.key}:f}var wi=async e=>{if(e instanceof Uint8Array)return{kty:"oct",k:yn(e)};if(!sn(e))throw new TypeError(Ln(e,...Kn,"Uint8Array"));if(!e.extractable)throw new TypeError("non-extractable CryptoKey cannot be exported as a JWK");const{ext:t,key_ops:r,alg:n,use:i,...o}=await an.subtle.exportKey("jwk",e);return o};async function Ai(e){return wi(e)}async function _i(e,t,r,n,i={}){let o,a,s;switch(pi(e,r,"encrypt"),e){case"dir":s=r;break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{if(!ii(r))throw new En("ECDH with the provided key is not allowed or not supported by your javascript runtime");const{apu:c,apv:u}=i;let{epk:f}=i;f||(f=(await async function(e){if(!sn(e))throw new TypeError(Ln(e,...Kn));return an.subtle.generateKey(e.algorithm,!0,["deriveBits"])}(r)).privateKey);const{x:d,y:l,crv:h,kty:p}=await Ai(f),m=await ni(r,f,"ECDH-ES"===e?t:e,"ECDH-ES"===e?fi(t):parseInt(e.slice(-5,-2),10),c,u);if(a={epk:{x:d,crv:h,kty:p}},"EC"===p&&(a.epk.y=l),c&&(a.apu=yn(c)),u&&(a.apv=yn(u)),"ECDH-ES"===e){s=m;break}s=n||di(t);const g=e.slice(-6);o=await ti(g,m,s);break}case"RSA1_5":case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":s=n||di(t),o=await(async(e,t,r)=>{if(!sn(t))throw new TypeError(Ln(t,...Kn));if(zn(t,e,"encrypt","wrapKey"),ci(e,t),t.usages.includes("encrypt"))return new Uint8Array(await an.subtle.encrypt(si(e),t,r));if(t.usages.includes("wrapKey")){const n=await an.subtle.importKey("raw",r,...Qn);return new Uint8Array(await an.subtle.wrapKey("raw",n,t,si(e)))}throw new TypeError('RSA-OAEP key "usages" must include "encrypt" or "wrapKey" for this operation')})(e,r,s);break;case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":{s=n||di(t);const{p2c:c,p2s:u}=i;({encryptedKey:o,...a}=await(async(e,t,r,n=2048,i=Cn(new Uint8Array(16)))=>{const o=await oi(i,e,n,t);return{encryptedKey:await ti(e.slice(-6),o,r),p2c:n,p2s:yn(i)}})(e,r,s,c,u));break}case"A128KW":case"A192KW":case"A256KW":s=n||di(t),o=await ti(e,r,s);break;case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":{s=n||di(t);const{iv:c}=i;({encryptedKey:o,...a}=await async function(e,t,r,n){const i=e.slice(0,7);n||(n=Rn(i));const{ciphertext:o,tag:a}=await mi(i,r,t,n,new Uint8Array(0));return{encryptedKey:o,iv:yn(n),tag:yn(a)}}(e,r,s,c));break}default:throw new En('Invalid or unsupported "alg" (JWE Algorithm) header value')}return{cek:s,encryptedKey:o,parameters:a}}const Ei=Symbol();class Si{constructor(e){if(!(e instanceof Uint8Array))throw new TypeError("plaintext must be an instance of Uint8Array");this._plaintext=e}setKeyManagementParameters(e){if(this._keyManagementParameters)throw new TypeError("setKeyManagementParameters can only be called once");return this._keyManagementParameters=e,this}setProtectedHeader(e){if(this._protectedHeader)throw new TypeError("setProtectedHeader can only be called once");return this._protectedHeader=e,this}setSharedUnprotectedHeader(e){if(this._sharedUnprotectedHeader)throw new TypeError("setSharedUnprotectedHeader can only be called once");return this._sharedUnprotectedHeader=e,this}setUnprotectedHeader(e){if(this._unprotectedHeader)throw new TypeError("setUnprotectedHeader can only be called once");return this._unprotectedHeader=e,this}setAdditionalAuthenticatedData(e){return this._aad=e,this}setContentEncryptionKey(e){if(this._cek)throw new TypeError("setContentEncryptionKey can only be called once");return this._cek=e,this}setInitializationVector(e){if(this._iv)throw new TypeError("setInitializationVector can only be called once");return this._iv=e,this}async encrypt(e,t){if(!this._protectedHeader&&!this._unprotectedHeader&&!this._sharedUnprotectedHeader)throw new Pn("either setProtectedHeader, setUnprotectedHeader, or sharedUnprotectedHeader must be called before #encrypt()");if(!Zn(this._protectedHeader,this._unprotectedHeader,this._sharedUnprotectedHeader))throw new Pn("JWE Protected, JWE Shared Unprotected and JWE Per-Recipient Header Parameter names must be disjoint");const r={...this._protectedHeader,...this._unprotectedHeader,...this._sharedUnprotectedHeader};if(yi(Pn,new Map,null==t?void 0:t.crit,this._protectedHeader,r),void 0!==r.zip){if(!this._protectedHeader||!this._protectedHeader.zip)throw new Pn('JWE "zip" (Compression Algorithm) Header MUST be integrity protected');if("DEF"!==r.zip)throw new En('Unsupported JWE "zip" (Compression Algorithm) Header Parameter value')}const{alg:n,enc:i}=r;if("string"!=typeof n||!n)throw new Pn('JWE "alg" (Algorithm) Header Parameter missing or invalid');if("string"!=typeof i||!i)throw new Pn('JWE "enc" (Encryption Algorithm) Header Parameter missing or invalid');let o,a,s,c,u,f,d;if("dir"===n){if(this._cek)throw new TypeError("setContentEncryptionKey cannot be called when using Direct Encryption")}else if("ECDH-ES"===n&&this._cek)throw new TypeError("setContentEncryptionKey cannot be called when using Direct Key Agreement");{let r;({cek:a,encryptedKey:o,parameters:r}=await _i(n,i,e,this._cek,this._keyManagementParameters)),r&&(t&&Ei in t?this._unprotectedHeader?this._unprotectedHeader={...this._unprotectedHeader,...r}:this.setUnprotectedHeader(r):this._protectedHeader?this._protectedHeader={...this._protectedHeader,...r}:this.setProtectedHeader(r))}if(this._iv||(this._iv=Rn(i)),c=this._protectedHeader?un.encode(yn(JSON.stringify(this._protectedHeader))):un.encode(""),this._aad?(u=yn(this._aad),s=ln(c,un.encode("."),un.encode(u))):s=c,"DEF"===r.zip){const e=await((null==t?void 0:t.deflateRaw)||Vn)(this._plaintext);({ciphertext:f,tag:d}=await mi(i,e,a,this._iv,s))}else({ciphertext:f,tag:d}=await mi(i,this._plaintext,a,this._iv,s));const l={ciphertext:yn(f),iv:yn(this._iv),tag:yn(d)};return o&&(l.encrypted_key=yn(o)),u&&(l.aad=u),this._protectedHeader&&(l.protected=fn.decode(c)),this._sharedUnprotectedHeader&&(l.unprotected=this._sharedUnprotectedHeader),this._unprotectedHeader&&(l.header=this._unprotectedHeader),l}}function Pi(e,t){const r=`SHA-${e.slice(-3)}`;switch(e){case"HS256":case"HS384":case"HS512":return{hash:r,name:"HMAC"};case"PS256":case"PS384":case"PS512":return{hash:r,name:"RSA-PSS",saltLength:e.slice(-3)>>3};case"RS256":case"RS384":case"RS512":return{hash:r,name:"RSASSA-PKCS1-v1_5"};case"ES256":case"ES384":case"ES512":return{hash:r,name:"ECDSA",namedCurve:t.namedCurve};case"EdDSA":return Tn()&&"NODE-ED25519"===t.name?{name:"NODE-ED25519",namedCurve:"NODE-ED25519"}:{name:t.name};default:throw new En(`alg ${e} is not supported either by JOSE or your javascript runtime`)}}function xi(e,t,r){if(sn(t))return Fn(t,e,r),t;if(t instanceof Uint8Array){if(!e.startsWith("HS"))throw new TypeError(Ln(t,...Kn));return an.subtle.importKey("raw",t,{hash:`SHA-${e.slice(-3)}`,name:"HMAC"},!1,[r])}throw new TypeError(Ln(t,...Kn,"Uint8Array"))}const ki=async(e,t,r,n)=>{const i=await xi(e,t,"verify");ci(e,i);const o=Pi(e,i.algorithm);try{return await an.subtle.verify(o,i,r,n)}catch(e){return!1}};async function Mi(e,t,r){var n;if(!Xn(e))throw new xn("Flattened JWS must be an object");if(void 0===e.protected&&void 0===e.header)throw new xn('Flattened JWS must have either of the "protected" or "header" members');if(void 0!==e.protected&&"string"!=typeof e.protected)throw new xn("JWS Protected Header incorrect type");if(void 0===e.payload)throw new xn("JWS Payload missing");if("string"!=typeof e.signature)throw new xn("JWS Signature missing or incorrect type");if(void 0!==e.header&&!Xn(e.header))throw new xn("JWS Unprotected Header incorrect type");let i={};if(e.protected)try{const t=bn(e.protected);i=JSON.parse(fn.decode(t))}catch(e){throw new xn("JWS Protected Header is invalid")}if(!Zn(i,e.header))throw new xn("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");const o={...i,...e.header};let a=!0;if(yi(xn,new Map([["b64",!0]]),null==r?void 0:r.crit,i,o).has("b64")&&(a=i.b64,"boolean"!=typeof a))throw new xn('The "b64" (base64url-encode payload) Header Parameter must be a boolean');const{alg:s}=o;if("string"!=typeof s||!s)throw new xn('JWS "alg" (Algorithm) Header Parameter missing or invalid');const c=r&&bi("algorithms",r.algorithms);if(c&&!c.has(s))throw new _n('"alg" (Algorithm) Header Parameter not allowed');if(a){if("string"!=typeof e.payload)throw new xn("JWS Payload must be a string")}else if("string"!=typeof e.payload&&!(e.payload instanceof Uint8Array))throw new xn("JWS Payload must be a string or an Uint8Array instance");let u=!1;"function"==typeof t&&(t=await t(i,e),u=!0),pi(s,t,"verify");const f=ln(un.encode(null!==(n=e.protected)&&void 0!==n?n:""),un.encode("."),"string"==typeof e.payload?un.encode(e.payload):e.payload),d=bn(e.signature);if(!await ki(s,t,d,f))throw new Mn;let l;l=a?bn(e.payload):"string"==typeof e.payload?un.encode(e.payload):e.payload;const h={payload:l};return void 0!==e.protected&&(h.protectedHeader=i),void 0!==e.header&&(h.unprotectedHeader=e.header),u?{...h,key:t}:h}var Ci=e=>Math.floor(e.getTime()/1e3);const Ii=86400,Ri=/^(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)$/i;var Ni=e=>{const t=Ri.exec(e);if(!t)throw new TypeError("Invalid time period format");const r=parseFloat(t[1]);switch(t[2].toLowerCase()){case"sec":case"secs":case"second":case"seconds":case"s":return Math.round(r);case"minute":case"minutes":case"min":case"mins":case"m":return Math.round(60*r);case"hour":case"hours":case"hr":case"hrs":case"h":return Math.round(3600*r);case"day":case"days":case"d":return Math.round(r*Ii);case"week":case"weeks":case"w":return Math.round(604800*r);default:return Math.round(31557600*r)}};const Oi=e=>e.toLowerCase().replace(/^application\//,"");var Ti=(e,t,r={})=>{const{typ:n}=r;if(n&&("string"!=typeof e.typ||Oi(e.typ)!==Oi(n)))throw new wn('unexpected "typ" JWT header value',"typ","check_failed");let i;try{i=JSON.parse(fn.decode(t))}catch(e){}if(!Xn(i))throw new kn("JWT Claims Set must be a top-level JSON object");const{requiredClaims:o=[],issuer:a,subject:s,audience:c,maxTokenAge:u}=r;void 0!==u&&o.push("iat"),void 0!==c&&o.push("aud"),void 0!==s&&o.push("sub"),void 0!==a&&o.push("iss");for(const e of new Set(o.reverse()))if(!(e in i))throw new wn(`missing required "${e}" claim`,e,"missing");if(a&&!(Array.isArray(a)?a:[a]).includes(i.iss))throw new wn('unexpected "iss" claim value',"iss","check_failed");if(s&&i.sub!==s)throw new wn('unexpected "sub" claim value',"sub","check_failed");if(c&&(f=i.aud,d="string"==typeof c?[c]:c,!("string"==typeof f?d.includes(f):Array.isArray(f)&&d.some(Set.prototype.has.bind(new Set(f))))))throw new wn('unexpected "aud" claim value',"aud","check_failed");var f,d;let l;switch(typeof r.clockTolerance){case"string":l=Ni(r.clockTolerance);break;case"number":l=r.clockTolerance;break;case"undefined":l=0;break;default:throw new TypeError("Invalid clockTolerance option type")}const{currentDate:h}=r,p=Ci(h||new Date);if((void 0!==i.iat||u)&&"number"!=typeof i.iat)throw new wn('"iat" claim must be a number',"iat","invalid");if(void 0!==i.nbf){if("number"!=typeof i.nbf)throw new wn('"nbf" claim must be a number',"nbf","invalid");if(i.nbf>p+l)throw new wn('"nbf" claim timestamp check failed',"nbf","check_failed")}if(void 0!==i.exp){if("number"!=typeof i.exp)throw new wn('"exp" claim must be a number',"exp","invalid");if(i.exp<=p-l)throw new An('"exp" claim timestamp check failed',"exp","check_failed")}if(u){const e=p-i.iat;if(e-l>("number"==typeof u?u:Ni(u)))throw new An('"iat" claim timestamp check failed (too far in the past)',"iat","check_failed");if(e<0-l)throw new wn('"iat" claim timestamp check failed (it should be in the past)',"iat","check_failed")}return i};async function ji(e,t,r){var n;const i=await async function(e,t,r){if(e instanceof Uint8Array&&(e=fn.decode(e)),"string"!=typeof e)throw new xn("Compact JWS must be a string or Uint8Array");const{0:n,1:i,2:o,length:a}=e.split(".");if(3!==a)throw new xn("Invalid Compact JWS");const s=await Mi({payload:i,protected:n,signature:o},t,r),c={payload:s.payload,protectedHeader:s.protectedHeader};return"function"==typeof t?{...c,key:s.key}:c}(e,t,r);if((null===(n=i.protectedHeader.crit)||void 0===n?void 0:n.includes("b64"))&&!1===i.protectedHeader.b64)throw new kn("JWTs MUST NOT use unencoded payload");const o={payload:Ti(i.protectedHeader,i.payload,r),protectedHeader:i.protectedHeader};return"function"==typeof t?{...o,key:i.key}:o}class $i{constructor(e){this._flattened=new Si(e)}setContentEncryptionKey(e){return this._flattened.setContentEncryptionKey(e),this}setInitializationVector(e){return this._flattened.setInitializationVector(e),this}setProtectedHeader(e){return this._flattened.setProtectedHeader(e),this}setKeyManagementParameters(e){return this._flattened.setKeyManagementParameters(e),this}async encrypt(e,t){const r=await this._flattened.encrypt(e,t);return[r.protected,r.encrypted_key,r.iv,r.ciphertext,r.tag].join(".")}}class Di{constructor(e){if(!(e instanceof Uint8Array))throw new TypeError("payload must be an instance of Uint8Array");this._payload=e}setProtectedHeader(e){if(this._protectedHeader)throw new TypeError("setProtectedHeader can only be called once");return this._protectedHeader=e,this}setUnprotectedHeader(e){if(this._unprotectedHeader)throw new TypeError("setUnprotectedHeader can only be called once");return this._unprotectedHeader=e,this}async sign(e,t){if(!this._protectedHeader&&!this._unprotectedHeader)throw new xn("either setProtectedHeader or setUnprotectedHeader must be called before #sign()");if(!Zn(this._protectedHeader,this._unprotectedHeader))throw new xn("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");const r={...this._protectedHeader,...this._unprotectedHeader};let n=!0;if(yi(xn,new Map([["b64",!0]]),null==t?void 0:t.crit,this._protectedHeader,r).has("b64")&&(n=this._protectedHeader.b64,"boolean"!=typeof n))throw new xn('The "b64" (base64url-encode payload) Header Parameter must be a boolean');const{alg:i}=r;if("string"!=typeof i||!i)throw new xn('JWS "alg" (Algorithm) Header Parameter missing or invalid');pi(i,e,"sign");let o,a=this._payload;n&&(a=un.encode(yn(a))),o=this._protectedHeader?un.encode(yn(JSON.stringify(this._protectedHeader))):un.encode("");const s=ln(o,un.encode("."),a),c=await(async(e,t,r)=>{const n=await xi(e,t,"sign");ci(e,n);const i=await an.subtle.sign(Pi(e,n.algorithm),n,r);return new Uint8Array(i)})(i,e,s),u={signature:yn(c),payload:""};return n&&(u.payload=fn.decode(a)),this._unprotectedHeader&&(u.header=this._unprotectedHeader),this._protectedHeader&&(u.protected=fn.decode(o)),u}}class Bi{constructor(e){this._flattened=new Di(e)}setProtectedHeader(e){return this._flattened.setProtectedHeader(e),this}async sign(e,t){const r=await this._flattened.sign(e,t);if(void 0===r.payload)throw new TypeError("use the flattened module for creating JWS with b64: false");return`${r.protected}.${r.payload}.${r.signature}`}}class Fi{constructor(e,t,r){this.parent=e,this.key=t,this.options=r}setProtectedHeader(e){if(this.protectedHeader)throw new TypeError("setProtectedHeader can only be called once");return this.protectedHeader=e,this}setUnprotectedHeader(e){if(this.unprotectedHeader)throw new TypeError("setUnprotectedHeader can only be called once");return this.unprotectedHeader=e,this}addSignature(...e){return this.parent.addSignature(...e)}sign(...e){return this.parent.sign(...e)}done(){return this.parent}}class zi{constructor(e){this._signatures=[],this._payload=e}addSignature(e,t){const r=new Fi(this,e,t);return this._signatures.push(r),r}async sign(){if(!this._signatures.length)throw new xn("at least one signature must be added");const e={signatures:[],payload:""};for(let t=0;t>3));case"A128KW":case"A192KW":case"A256KW":n=parseInt(e.slice(1,4),10),i={name:"AES-KW",length:n},o=["wrapKey","unwrapKey"];break;case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":case"A128GCM":case"A192GCM":case"A256GCM":n=parseInt(e.slice(1,4),10),i={name:"AES-GCM",length:n},o=["encrypt","decrypt"];break;default:throw new En('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}return an.subtle.generateKey(i,null!==(r=null==t?void 0:t.extractable)&&void 0!==r&&r,o)}(e,t)}async function Ki(e,t){const r=void 0===t?e.alg:t,n=en.concat(Yr).concat(tn);if(!n.includes(r))throw new rn("invalid alg. Must be one of: "+n.join(","),["invalid algorithm"]);try{const r=await hi(e,t);if(null==r)throw new rn(new Error("failed importing keys"),["invalid key"]);return r}catch(e){throw new rn(e,["invalid key"])}}async function Ji(e,t,r){let n,i;const o={...t};if(en.includes(t.alg))n="dir",i=void 0!==r?r:t.alg;else{if(!Yr.concat(tn).includes(t.alg))throw new rn(`Not a valid symmetric or assymetric alg: ${t.alg}`,["encryption failed","invalid key","invalid algorithm"]);if(void 0===r)throw new rn("An encryption algorith encAlg for content encryption should be provided. Allowed values are: "+en.join(","),["encryption failed"]);i=r,n="ECDH-ES",o.alg=n}const a=await Ki(o);let s;try{return s=await new $i(e).setProtectedHeader({alg:n,enc:i,kid:t.kid}).encrypt(a),s}catch(e){throw new rn(e,["encryption failed"])}}async function Wi(e,t){try{const r={...t},{alg:n,enc:i}=function(e){let t;if("string"==typeof e){const r=e.split(".");3!==r.length&&5!==r.length||([t]=r)}else if("object"==typeof e&&e){if(!("protected"in e))throw new TypeError("Token does not contain a Protected Header");t=e.protected}try{if("string"!=typeof t||!t)throw new Error;const e=JSON.parse(fn.decode(qi(t)));if(!Xn(e))throw new Error;return e}catch(e){throw new TypeError("Invalid Token or Protected Header formatting")}}(e);if(void 0===n||void 0===i)throw new rn("missing enc or alg in jwe header",["invalid format"]);"ECDH-ES"===n&&(r.alg=n);const o=await Ki(r);return await vi(e,o,{contentEncryptionAlgorithms:[i]})}catch(e){throw new rn(e,["decryption failed"])}}async function Gi(e,r){const n=e.match(/^([a-zA-Z0-9_-]+)\.{1,2}([a-zA-Z0-9_-]+)\.([a-zA-Z0-9_-]+)$/);if(null===n)throw new rn(new Error(`${e} is not a JWS`),["not a compact jws"]);let i,o;try{i=JSON.parse(t(n[1],!0)),o=JSON.parse(t(n[2],!0))}catch(e){throw new rn(e,["invalid format","not a compact jws"])}if(void 0!==r){const t="function"==typeof r?await r(i,o):r,n=await Ki(t);try{const r=await ji(e,n);return{header:r.protectedHeader,payload:r.payload,signer:t}}catch(e){throw new rn(e,["jws verification failed"])}}return{header:i,payload:o}}function Vi(e){if(en.concat(Qr).concat(Yr).includes(e))return Number(e.match(/\d{3}/)[0])/8;throw new rn("unsupported algorithm",["invalid algorithm"])}async function Zi(e,o,a){let s;if(!en.includes(e))throw new rn(new Error(`Invalid encAlg '${e}'. Supported values are: ${en.toString()}`),["invalid algorithm"]);const c=Vi(e);if(void 0!==o){if("string"==typeof o)if(!0===a)s=t(o);else{const e=r(o,!1);if(e!==r(o,!1,c))throw new rn(new RangeError(`Expected hex length ${2*c} does not meet provided one ${e.length/2}`),["invalid key"]);s=new Uint8Array(i(o))}else s=o;if(s.length!==c)throw new rn(new RangeError(`Expected secret length ${c} does not meet provided one ${s.length}`),["invalid key"])}else try{s=await Hi(e,{extractable:!0})}catch(e){throw new rn(e,["unexpected error"])}const u=await Ai(s);return u.alg=e,{jwk:u,hex:n(t(u.k),!1,c)}}async function Xi(e,t){if(void 0===e.alg||void 0===t.alg||e.alg!==t.alg)throw new Error("alg no present in either pubJwk or privJwk, or pubJWK.alg != privJWK.alg");const r=await Ki(e),n=await Ki(t);try{const e=await o(16),i=await new zi(e).addSignature(n).setProtectedHeader({alg:t.alg}).sign();await async function(e,t,r){if(!Xn(e))throw new xn("General JWS must be an object");if(!Array.isArray(e.signatures)||!e.signatures.every(Xn))throw new xn("JWS Signatures missing or incorrect type");for(const n of e.signatures)try{return await Mi({header:n.header,payload:e.payload,protected:n.protected,signature:n.signature},t,r)}catch(e){}throw new Mn}(i,r)}catch(e){throw new rn(e,["unexpected error"])}}function Qi(e){return null!=e&&"object"==typeof e&&!Array.isArray(e)}function Yi(e){return Qi(e)||Array.isArray(e)?Array.isArray(e)?e.map((e=>Array.isArray(e)||Qi(e)?Yi(e):e)):Object.keys(e).sort().map((t=>[t,Yi(e[t])])):e}function eo(e){return JSON.stringify(Yi(e))}function to(e,t,r,n=2e3){if(er+n)throw new rn(new Error(`timestamp ${new Date(e).toTimeString()} after 'notAfter' ${new Date(r).toTimeString()} with tolerance of ${n/1e3}s`),["invalid timestamp"])}function ro(e){return Array.isArray(e)?e.sort().map(ro):(t=e,"[object Object]"===Object.prototype.toString.call(t)?Object.keys(e).sort().reduce((function(t,r){return t[r]=ro(e[r]),t}),{}):e);var t}function no(e,t=!1,n){try{return r(e,t,n)}catch(e){throw new rn(e,["invalid format"])}}async function io(e,t){try{await Ki(e,e.alg);const r=ro(e);return t?JSON.stringify(r):r}catch(e){throw new rn(e,["invalid key"])}}async function oo(e,t){const r=Qr;if(!r.includes(t))throw new rn(new RangeError(`Valid hash algorith values are any of ${JSON.stringify(r)}`),["invalid algorithm"]);const n=new TextEncoder,i="string"==typeof e?n.encode(e).buffer:e;try{let e;return e=new Uint8Array(await crypto.subtle.digest(t,i)),e}catch(e){throw new rn(e,["unexpected error"])}}var ao={exports:{}};!function(e,t){function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function n(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function i(e,t,r){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var o;"object"==typeof e?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:h.Buffer}catch(e){}function a(e,t){var n=e.charCodeAt(t);return n>=48&&n<=57?n-48:n>=65&&n<=70?n-55:n>=97&&n<=102?n-87:void r(!1,"Invalid character in "+e)}function s(e,t,r){var n=a(e,r);return r-1>=t&&(n|=a(e,r-1)<<4),n}function c(e,t,n,i){for(var o=0,a=0,s=Math.min(e.length,n),c=t;c=49?u-49+10:u>=17?u-17+10:u,r(u>=0&&a0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,n){if("number"==typeof e)return this._initNumber(e,t,n);if("object"==typeof e)return this._initArray(e,t,n);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)a=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===n)for(i=0,o=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this._strip()},i.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n=t;n-=2)i=s(e,t,n)<=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(n=(e.length-t)%2==0?t+1:t;n=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this._strip()},i.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,a=o%n,s=Math.min(o,o-a)+r,u=0,f=r;f1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=f}catch(e){i.prototype.inspect=f}else i.prototype.inspect=f;function f(){return(this.red?""}var d=["","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"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],p=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function m(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],a=i*o,s=67108863&a,c=a/67108864|0;r.words[0]=s;for(var u=1;u>>26,d=67108863&c,l=Math.min(u,t.length-1),h=Math.max(0,u-e.length+1);h<=l;h++){var p=u-h|0;f+=(a=(i=0|e.words[p])*(o=0|t.words[h])+d)/67108864|0,d=67108863&a}r.words[u]=0|d,c=0|f}return 0!==c?r.words[u]=0|c:r.length--,r._strip()}i.prototype.toString=function(e,t){var n;if(t=0|t||1,16===(e=e||10)||"hex"===e){n="";for(var i=0,o=0,a=0;a>>24-i&16777215,(i+=2)>=26&&(i-=26,a--),n=0!==o||a!==this.length-1?d[6-c.length]+c+n:c+n}for(0!==o&&(n=o.toString(16)+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(e===(0|e)&&e>=2&&e<=36){var u=l[e],f=p[e];n="";var h=this.clone();for(h.negative=0;!h.isZero();){var m=h.modrn(f).toString(e);n=(h=h.idivn(f)).isZero()?m+n:d[u-m.length]+m+n}for(this.isZero()&&(n="0"+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},i.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&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16,2)},o&&(i.prototype.toBuffer=function(e,t){return this.toArrayLike(o,e,t)}),i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},i.prototype.toArrayLike=function(e,t,n){this._strip();var i=this.byteLength(),o=n||Math.max(1,i);r(i<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0");var a=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,o);return this["_toArrayLike"+("le"===t?"LE":"BE")](a,i),a},i.prototype._toArrayLikeLE=function(e,t){for(var r=0,n=0,i=0,o=0;i>8&255),r>16&255),6===o?(r>24&255),n=0,o=0):(n=a>>>24,o+=2)}if(r=0&&(e[r--]=a>>8&255),r>=0&&(e[r--]=a>>16&255),6===o?(r>=0&&(e[r--]=a>>24&255),n=0,o=0):(n=a>>>24,o+=2)}if(r>=0)for(e[r--]=n;r>=0;)e[r--]=0},Math.clz32?i.prototype._countBits=function(e){return 32-Math.clz32(e)}:i.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){r("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),n>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-n),this._strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){r("number"==typeof e&&e>=0);var n=e/26|0,i=e%26;return this._expand(n+1),this.words[n]=t?this.words[n]|1<e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},i.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,a=0;a>26,this.words[a]=67108863&t;for(;0!==o&&a>26,this.words[a]=67108863&t;if(0===o&&a>>13,h=0|a[1],p=8191&h,m=h>>>13,g=0|a[2],y=8191&g,b=g>>>13,v=0|a[3],w=8191&v,A=v>>>13,_=0|a[4],E=8191&_,S=_>>>13,P=0|a[5],x=8191&P,k=P>>>13,M=0|a[6],C=8191&M,I=M>>>13,R=0|a[7],N=8191&R,O=R>>>13,T=0|a[8],j=8191&T,$=T>>>13,D=0|a[9],B=8191&D,F=D>>>13,z=0|s[0],U=8191&z,L=z>>>13,q=0|s[1],H=8191&q,K=q>>>13,J=0|s[2],W=8191&J,G=J>>>13,V=0|s[3],Z=8191&V,X=V>>>13,Q=0|s[4],Y=8191&Q,ee=Q>>>13,te=0|s[5],re=8191&te,ne=te>>>13,ie=0|s[6],oe=8191&ie,ae=ie>>>13,se=0|s[7],ce=8191&se,ue=se>>>13,fe=0|s[8],de=8191&fe,le=fe>>>13,he=0|s[9],pe=8191&he,me=he>>>13;r.negative=e.negative^t.negative,r.length=19;var ge=(u+(n=Math.imul(d,U))|0)+((8191&(i=(i=Math.imul(d,L))+Math.imul(l,U)|0))<<13)|0;u=((o=Math.imul(l,L))+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(p,U),i=(i=Math.imul(p,L))+Math.imul(m,U)|0,o=Math.imul(m,L);var ye=(u+(n=n+Math.imul(d,H)|0)|0)+((8191&(i=(i=i+Math.imul(d,K)|0)+Math.imul(l,H)|0))<<13)|0;u=((o=o+Math.imul(l,K)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(y,U),i=(i=Math.imul(y,L))+Math.imul(b,U)|0,o=Math.imul(b,L),n=n+Math.imul(p,H)|0,i=(i=i+Math.imul(p,K)|0)+Math.imul(m,H)|0,o=o+Math.imul(m,K)|0;var be=(u+(n=n+Math.imul(d,W)|0)|0)+((8191&(i=(i=i+Math.imul(d,G)|0)+Math.imul(l,W)|0))<<13)|0;u=((o=o+Math.imul(l,G)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(w,U),i=(i=Math.imul(w,L))+Math.imul(A,U)|0,o=Math.imul(A,L),n=n+Math.imul(y,H)|0,i=(i=i+Math.imul(y,K)|0)+Math.imul(b,H)|0,o=o+Math.imul(b,K)|0,n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(m,W)|0,o=o+Math.imul(m,G)|0;var ve=(u+(n=n+Math.imul(d,Z)|0)|0)+((8191&(i=(i=i+Math.imul(d,X)|0)+Math.imul(l,Z)|0))<<13)|0;u=((o=o+Math.imul(l,X)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(E,U),i=(i=Math.imul(E,L))+Math.imul(S,U)|0,o=Math.imul(S,L),n=n+Math.imul(w,H)|0,i=(i=i+Math.imul(w,K)|0)+Math.imul(A,H)|0,o=o+Math.imul(A,K)|0,n=n+Math.imul(y,W)|0,i=(i=i+Math.imul(y,G)|0)+Math.imul(b,W)|0,o=o+Math.imul(b,G)|0,n=n+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,X)|0;var we=(u+(n=n+Math.imul(d,Y)|0)|0)+((8191&(i=(i=i+Math.imul(d,ee)|0)+Math.imul(l,Y)|0))<<13)|0;u=((o=o+Math.imul(l,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(x,U),i=(i=Math.imul(x,L))+Math.imul(k,U)|0,o=Math.imul(k,L),n=n+Math.imul(E,H)|0,i=(i=i+Math.imul(E,K)|0)+Math.imul(S,H)|0,o=o+Math.imul(S,K)|0,n=n+Math.imul(w,W)|0,i=(i=i+Math.imul(w,G)|0)+Math.imul(A,W)|0,o=o+Math.imul(A,G)|0,n=n+Math.imul(y,Z)|0,i=(i=i+Math.imul(y,X)|0)+Math.imul(b,Z)|0,o=o+Math.imul(b,X)|0,n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(m,Y)|0,o=o+Math.imul(m,ee)|0;var Ae=(u+(n=n+Math.imul(d,re)|0)|0)+((8191&(i=(i=i+Math.imul(d,ne)|0)+Math.imul(l,re)|0))<<13)|0;u=((o=o+Math.imul(l,ne)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(C,U),i=(i=Math.imul(C,L))+Math.imul(I,U)|0,o=Math.imul(I,L),n=n+Math.imul(x,H)|0,i=(i=i+Math.imul(x,K)|0)+Math.imul(k,H)|0,o=o+Math.imul(k,K)|0,n=n+Math.imul(E,W)|0,i=(i=i+Math.imul(E,G)|0)+Math.imul(S,W)|0,o=o+Math.imul(S,G)|0,n=n+Math.imul(w,Z)|0,i=(i=i+Math.imul(w,X)|0)+Math.imul(A,Z)|0,o=o+Math.imul(A,X)|0,n=n+Math.imul(y,Y)|0,i=(i=i+Math.imul(y,ee)|0)+Math.imul(b,Y)|0,o=o+Math.imul(b,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(m,re)|0,o=o+Math.imul(m,ne)|0;var _e=(u+(n=n+Math.imul(d,oe)|0)|0)+((8191&(i=(i=i+Math.imul(d,ae)|0)+Math.imul(l,oe)|0))<<13)|0;u=((o=o+Math.imul(l,ae)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(N,U),i=(i=Math.imul(N,L))+Math.imul(O,U)|0,o=Math.imul(O,L),n=n+Math.imul(C,H)|0,i=(i=i+Math.imul(C,K)|0)+Math.imul(I,H)|0,o=o+Math.imul(I,K)|0,n=n+Math.imul(x,W)|0,i=(i=i+Math.imul(x,G)|0)+Math.imul(k,W)|0,o=o+Math.imul(k,G)|0,n=n+Math.imul(E,Z)|0,i=(i=i+Math.imul(E,X)|0)+Math.imul(S,Z)|0,o=o+Math.imul(S,X)|0,n=n+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(A,Y)|0,o=o+Math.imul(A,ee)|0,n=n+Math.imul(y,re)|0,i=(i=i+Math.imul(y,ne)|0)+Math.imul(b,re)|0,o=o+Math.imul(b,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,ae)|0)+Math.imul(m,oe)|0,o=o+Math.imul(m,ae)|0;var Ee=(u+(n=n+Math.imul(d,ce)|0)|0)+((8191&(i=(i=i+Math.imul(d,ue)|0)+Math.imul(l,ce)|0))<<13)|0;u=((o=o+Math.imul(l,ue)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(j,U),i=(i=Math.imul(j,L))+Math.imul($,U)|0,o=Math.imul($,L),n=n+Math.imul(N,H)|0,i=(i=i+Math.imul(N,K)|0)+Math.imul(O,H)|0,o=o+Math.imul(O,K)|0,n=n+Math.imul(C,W)|0,i=(i=i+Math.imul(C,G)|0)+Math.imul(I,W)|0,o=o+Math.imul(I,G)|0,n=n+Math.imul(x,Z)|0,i=(i=i+Math.imul(x,X)|0)+Math.imul(k,Z)|0,o=o+Math.imul(k,X)|0,n=n+Math.imul(E,Y)|0,i=(i=i+Math.imul(E,ee)|0)+Math.imul(S,Y)|0,o=o+Math.imul(S,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(A,re)|0,o=o+Math.imul(A,ne)|0,n=n+Math.imul(y,oe)|0,i=(i=i+Math.imul(y,ae)|0)+Math.imul(b,oe)|0,o=o+Math.imul(b,ae)|0,n=n+Math.imul(p,ce)|0,i=(i=i+Math.imul(p,ue)|0)+Math.imul(m,ce)|0,o=o+Math.imul(m,ue)|0;var Se=(u+(n=n+Math.imul(d,de)|0)|0)+((8191&(i=(i=i+Math.imul(d,le)|0)+Math.imul(l,de)|0))<<13)|0;u=((o=o+Math.imul(l,le)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(B,U),i=(i=Math.imul(B,L))+Math.imul(F,U)|0,o=Math.imul(F,L),n=n+Math.imul(j,H)|0,i=(i=i+Math.imul(j,K)|0)+Math.imul($,H)|0,o=o+Math.imul($,K)|0,n=n+Math.imul(N,W)|0,i=(i=i+Math.imul(N,G)|0)+Math.imul(O,W)|0,o=o+Math.imul(O,G)|0,n=n+Math.imul(C,Z)|0,i=(i=i+Math.imul(C,X)|0)+Math.imul(I,Z)|0,o=o+Math.imul(I,X)|0,n=n+Math.imul(x,Y)|0,i=(i=i+Math.imul(x,ee)|0)+Math.imul(k,Y)|0,o=o+Math.imul(k,ee)|0,n=n+Math.imul(E,re)|0,i=(i=i+Math.imul(E,ne)|0)+Math.imul(S,re)|0,o=o+Math.imul(S,ne)|0,n=n+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,ae)|0)+Math.imul(A,oe)|0,o=o+Math.imul(A,ae)|0,n=n+Math.imul(y,ce)|0,i=(i=i+Math.imul(y,ue)|0)+Math.imul(b,ce)|0,o=o+Math.imul(b,ue)|0,n=n+Math.imul(p,de)|0,i=(i=i+Math.imul(p,le)|0)+Math.imul(m,de)|0,o=o+Math.imul(m,le)|0;var Pe=(u+(n=n+Math.imul(d,pe)|0)|0)+((8191&(i=(i=i+Math.imul(d,me)|0)+Math.imul(l,pe)|0))<<13)|0;u=((o=o+Math.imul(l,me)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(B,H),i=(i=Math.imul(B,K))+Math.imul(F,H)|0,o=Math.imul(F,K),n=n+Math.imul(j,W)|0,i=(i=i+Math.imul(j,G)|0)+Math.imul($,W)|0,o=o+Math.imul($,G)|0,n=n+Math.imul(N,Z)|0,i=(i=i+Math.imul(N,X)|0)+Math.imul(O,Z)|0,o=o+Math.imul(O,X)|0,n=n+Math.imul(C,Y)|0,i=(i=i+Math.imul(C,ee)|0)+Math.imul(I,Y)|0,o=o+Math.imul(I,ee)|0,n=n+Math.imul(x,re)|0,i=(i=i+Math.imul(x,ne)|0)+Math.imul(k,re)|0,o=o+Math.imul(k,ne)|0,n=n+Math.imul(E,oe)|0,i=(i=i+Math.imul(E,ae)|0)+Math.imul(S,oe)|0,o=o+Math.imul(S,ae)|0,n=n+Math.imul(w,ce)|0,i=(i=i+Math.imul(w,ue)|0)+Math.imul(A,ce)|0,o=o+Math.imul(A,ue)|0,n=n+Math.imul(y,de)|0,i=(i=i+Math.imul(y,le)|0)+Math.imul(b,de)|0,o=o+Math.imul(b,le)|0;var xe=(u+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,me)|0)+Math.imul(m,pe)|0))<<13)|0;u=((o=o+Math.imul(m,me)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(B,W),i=(i=Math.imul(B,G))+Math.imul(F,W)|0,o=Math.imul(F,G),n=n+Math.imul(j,Z)|0,i=(i=i+Math.imul(j,X)|0)+Math.imul($,Z)|0,o=o+Math.imul($,X)|0,n=n+Math.imul(N,Y)|0,i=(i=i+Math.imul(N,ee)|0)+Math.imul(O,Y)|0,o=o+Math.imul(O,ee)|0,n=n+Math.imul(C,re)|0,i=(i=i+Math.imul(C,ne)|0)+Math.imul(I,re)|0,o=o+Math.imul(I,ne)|0,n=n+Math.imul(x,oe)|0,i=(i=i+Math.imul(x,ae)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,ae)|0,n=n+Math.imul(E,ce)|0,i=(i=i+Math.imul(E,ue)|0)+Math.imul(S,ce)|0,o=o+Math.imul(S,ue)|0,n=n+Math.imul(w,de)|0,i=(i=i+Math.imul(w,le)|0)+Math.imul(A,de)|0,o=o+Math.imul(A,le)|0;var ke=(u+(n=n+Math.imul(y,pe)|0)|0)+((8191&(i=(i=i+Math.imul(y,me)|0)+Math.imul(b,pe)|0))<<13)|0;u=((o=o+Math.imul(b,me)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(B,Z),i=(i=Math.imul(B,X))+Math.imul(F,Z)|0,o=Math.imul(F,X),n=n+Math.imul(j,Y)|0,i=(i=i+Math.imul(j,ee)|0)+Math.imul($,Y)|0,o=o+Math.imul($,ee)|0,n=n+Math.imul(N,re)|0,i=(i=i+Math.imul(N,ne)|0)+Math.imul(O,re)|0,o=o+Math.imul(O,ne)|0,n=n+Math.imul(C,oe)|0,i=(i=i+Math.imul(C,ae)|0)+Math.imul(I,oe)|0,o=o+Math.imul(I,ae)|0,n=n+Math.imul(x,ce)|0,i=(i=i+Math.imul(x,ue)|0)+Math.imul(k,ce)|0,o=o+Math.imul(k,ue)|0,n=n+Math.imul(E,de)|0,i=(i=i+Math.imul(E,le)|0)+Math.imul(S,de)|0,o=o+Math.imul(S,le)|0;var Me=(u+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,me)|0)+Math.imul(A,pe)|0))<<13)|0;u=((o=o+Math.imul(A,me)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(B,Y),i=(i=Math.imul(B,ee))+Math.imul(F,Y)|0,o=Math.imul(F,ee),n=n+Math.imul(j,re)|0,i=(i=i+Math.imul(j,ne)|0)+Math.imul($,re)|0,o=o+Math.imul($,ne)|0,n=n+Math.imul(N,oe)|0,i=(i=i+Math.imul(N,ae)|0)+Math.imul(O,oe)|0,o=o+Math.imul(O,ae)|0,n=n+Math.imul(C,ce)|0,i=(i=i+Math.imul(C,ue)|0)+Math.imul(I,ce)|0,o=o+Math.imul(I,ue)|0,n=n+Math.imul(x,de)|0,i=(i=i+Math.imul(x,le)|0)+Math.imul(k,de)|0,o=o+Math.imul(k,le)|0;var Ce=(u+(n=n+Math.imul(E,pe)|0)|0)+((8191&(i=(i=i+Math.imul(E,me)|0)+Math.imul(S,pe)|0))<<13)|0;u=((o=o+Math.imul(S,me)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(B,re),i=(i=Math.imul(B,ne))+Math.imul(F,re)|0,o=Math.imul(F,ne),n=n+Math.imul(j,oe)|0,i=(i=i+Math.imul(j,ae)|0)+Math.imul($,oe)|0,o=o+Math.imul($,ae)|0,n=n+Math.imul(N,ce)|0,i=(i=i+Math.imul(N,ue)|0)+Math.imul(O,ce)|0,o=o+Math.imul(O,ue)|0,n=n+Math.imul(C,de)|0,i=(i=i+Math.imul(C,le)|0)+Math.imul(I,de)|0,o=o+Math.imul(I,le)|0;var Ie=(u+(n=n+Math.imul(x,pe)|0)|0)+((8191&(i=(i=i+Math.imul(x,me)|0)+Math.imul(k,pe)|0))<<13)|0;u=((o=o+Math.imul(k,me)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(B,oe),i=(i=Math.imul(B,ae))+Math.imul(F,oe)|0,o=Math.imul(F,ae),n=n+Math.imul(j,ce)|0,i=(i=i+Math.imul(j,ue)|0)+Math.imul($,ce)|0,o=o+Math.imul($,ue)|0,n=n+Math.imul(N,de)|0,i=(i=i+Math.imul(N,le)|0)+Math.imul(O,de)|0,o=o+Math.imul(O,le)|0;var Re=(u+(n=n+Math.imul(C,pe)|0)|0)+((8191&(i=(i=i+Math.imul(C,me)|0)+Math.imul(I,pe)|0))<<13)|0;u=((o=o+Math.imul(I,me)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(B,ce),i=(i=Math.imul(B,ue))+Math.imul(F,ce)|0,o=Math.imul(F,ue),n=n+Math.imul(j,de)|0,i=(i=i+Math.imul(j,le)|0)+Math.imul($,de)|0,o=o+Math.imul($,le)|0;var Ne=(u+(n=n+Math.imul(N,pe)|0)|0)+((8191&(i=(i=i+Math.imul(N,me)|0)+Math.imul(O,pe)|0))<<13)|0;u=((o=o+Math.imul(O,me)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,n=Math.imul(B,de),i=(i=Math.imul(B,le))+Math.imul(F,de)|0,o=Math.imul(F,le);var Oe=(u+(n=n+Math.imul(j,pe)|0)|0)+((8191&(i=(i=i+Math.imul(j,me)|0)+Math.imul($,pe)|0))<<13)|0;u=((o=o+Math.imul($,me)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863;var Te=(u+(n=Math.imul(B,pe))|0)+((8191&(i=(i=Math.imul(B,me))+Math.imul(F,pe)|0))<<13)|0;return u=((o=Math.imul(F,me))+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,c[0]=ge,c[1]=ye,c[2]=be,c[3]=ve,c[4]=we,c[5]=Ae,c[6]=_e,c[7]=Ee,c[8]=Se,c[9]=Pe,c[10]=xe,c[11]=ke,c[12]=Me,c[13]=Ce,c[14]=Ie,c[15]=Re,c[16]=Ne,c[17]=Oe,c[18]=Te,0!==u&&(c[19]=u,r.length++),r};function y(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,a&=67108863}r.words[o]=s,n=a,a=i}return 0!==n?r.words[o]=n:r.length--,r._strip()}function b(e,t,r){return y(e,t,r)}Math.imul||(g=m),i.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?g(this,e,t):r<63?m(this,e,t):r<1024?y(this,e,t):b(this,e,t)},i.prototype.mul=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},i.prototype.mulf=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),b(this,e,t)},i.prototype.imul=function(e){return this.clone().mulTo(e,this)},i.prototype.imuln=function(e){var t=e<0;t&&(e=-e),r("number"==typeof e),r(e<67108864);for(var n=0,i=0;i>=26,n+=o/67108864|0,n+=a>>>26,this.words[i]=67108863&a}return 0!==n&&(this.words[i]=n,this.length++),t?this.ineg():this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>i&1}return t}(e);if(0===t.length)return new i(1);for(var r=this,n=0;n=0);var t,n=e%26,i=(e-n)/26,o=67108863>>>26-n<<26-n;if(0!==n){var a=0;for(t=0;t>>26-n}a&&(this.words[t]=a,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var o=e%26,a=Math.min((e-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,u=0;u=0&&(0!==f||u>=i);u--){var d=0|this.words[u];this.words[u]=f<<26-o|d>>>o,f=d&s}return c&&0!==f&&(c.words[c.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(e,t,n){return r(0===this.negative),this.iushrn(e,t,n)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){r("number"==typeof e&&e>=0);var t=e%26,n=(e-t)/26,i=1<=0);var t=e%26,n=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==t&&n++,this.length=Math.min(n,this.length),0!==t){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},i.prototype.isubn=function(e){if(r("number"==typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(c/67108864|0),this.words[i+n]=67108863&o}for(;i>26,this.words[i+n]=67108863&o;if(0===s)return this._strip();for(r(-1===s),s=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},i.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),o=e,a=0|o.words[o.length-1];0!=(r=26-this._countBits(a))&&(o=o.ushln(r),n.iushln(r),a=0|o.words[o.length-1]);var s,c=n.length-o.length;if("mod"!==t){(s=new i(null)).length=c+1,s.words=new Array(s.length);for(var u=0;u=0;d--){var l=67108864*(0|n.words[o.length+d])+(0|n.words[o.length+d-1]);for(l=Math.min(l/a|0,67108863),n._ishlnsubmul(o,l,d);0!==n.negative;)l--,n.negative=0,n._ishlnsubmul(o,1,d),n.isZero()||(n.negative^=1);s&&(s.words[d]=l)}return s&&s._strip(),n._strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},i.prototype.divmod=function(e,t,n){return r(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(o=s.div.neg()),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.iadd(e)),{div:o,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(o=s.div.neg()),{div:o,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modrn(e.words[0]))}:this._wordDiv(e,t);var o,a,s},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modrn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var n=(1<<26)%e,i=0,o=this.length-1;o>=0;o--)i=(n*i+(0|this.words[o]))%e;return t?-i:i},i.prototype.modn=function(e){return this.modrn(e)},i.prototype.idivn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var n=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*n;this.words[i]=o/e|0,n=o%e}return this._strip(),t?this.ineg():this},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o=new i(1),a=new i(0),s=new i(0),c=new i(1),u=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++u;for(var f=n.clone(),d=t.clone();!t.isZero();){for(var l=0,h=1;0==(t.words[0]&h)&&l<26;++l,h<<=1);if(l>0)for(t.iushrn(l);l-- >0;)(o.isOdd()||a.isOdd())&&(o.iadd(f),a.isub(d)),o.iushrn(1),a.iushrn(1);for(var p=0,m=1;0==(n.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(n.iushrn(p);p-- >0;)(s.isOdd()||c.isOdd())&&(s.iadd(f),c.isub(d)),s.iushrn(1),c.iushrn(1);t.cmp(n)>=0?(t.isub(n),o.isub(s),a.isub(c)):(n.isub(t),s.isub(o),c.isub(a))}return{a:s,b:c,gcd:n.iushln(u)}},i.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o,a=new i(1),s=new i(0),c=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(var u=0,f=1;0==(t.words[0]&f)&&u<26;++u,f<<=1);if(u>0)for(t.iushrn(u);u-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);for(var d=0,l=1;0==(n.words[0]&l)&&d<26;++d,l<<=1);if(d>0)for(n.iushrn(d);d-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);t.cmp(n)>=0?(t.isub(n),a.isub(s)):(n.isub(t),s.isub(a))}return(o=0===t.cmpn(1)?a:s).cmpn(0)<0&&o.iadd(e),o},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return 0==(1&this.words[0])},i.prototype.isOdd=function(){return 1==(1&this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){r("number"==typeof e);var t=e%26,n=(e-t)/26,i=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this._strip(),this.length>1)t=1;else{n&&(e=-e),r(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){ni&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new P(e)},i.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var v={k256:null,p224:null,p192:null,p25519:null};function w(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function A(){w.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function _(){w.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function E(){w.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function S(){w.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function P(e){if("string"==typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function x(e){P.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}w.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},w.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},w.prototype.split=function(e,t){e.iushrn(this.n,0,t)},w.prototype.imulK=function(e){return e.imul(this.k)},n(A,w),A.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i>>22,o=a}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},A.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(v[e])return v[e];var t;if("k256"===e)t=new A;else if("p224"===e)t=new _;else if("p192"===e)t=new E;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new S}return v[e]=t,t},P.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},P.prototype._verify2=function(e,t){r(0==(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},P.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(u(e,e.umod(this.m)._forceRed(this)),e)},P.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},P.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},P.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},P.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},P.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},P.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},P.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},P.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},P.prototype.isqr=function(e){return this.imul(e,e.clone())},P.prototype.sqr=function(e){return this.mul(e,e)},P.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2==1),3===t){var n=this.m.add(new i(1)).iushrn(2);return this.pow(e,n)}for(var o=this.m.subn(1),a=0;!o.isZero()&&0===o.andln(1);)a++,o.iushrn(1);r(!o.isZero());var s=new i(1).toRed(this),c=s.redNeg(),u=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new i(2*f*f).toRed(this);0!==this.pow(f,u).cmp(c);)f.redIAdd(c);for(var d=this.pow(f,o),l=this.pow(e,o.addn(1).iushrn(1)),h=this.pow(e,o),p=a;0!==h.cmp(s);){for(var m=h,g=0;0!==m.cmp(s);g++)m=m.redSqr();r(g=0;n--){for(var u=t.words[n],f=c-1;f>=0;f--){var d=u>>f&1;o!==r[0]&&(o=this.sqr(o)),0!==d||0!==a?(a<<=1,a|=d,(4==++s||0===n&&0===f)&&(o=this.mul(o,r[a]),s=0,a=0)):s=0}c=26}return o},P.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},P.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new x(e)},n(x,P),x.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},x.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},x.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},x.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(n).iushrn(this.shift),a=o;return o.cmp(this.m)>=0?a=o.isub(this.m):o.cmpn(0)<0&&(a=o.iadd(this.m)),a._forceRed(this)},x.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(ao,a);var so=s(ao.exports);let co=!1,uo=!1;const fo={debug:1,default:2,info:2,warning:3,error:4,off:5};let lo=fo.default,ho=null;const po=function(){try{const e=[];if(["NFD","NFC","NFKD","NFKC"].forEach((t=>{try{if("test"!=="test".normalize(t))throw new Error("bad normalize")}catch(r){e.push(t)}})),e.length)throw new Error("missing "+e.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(e){return e.message}return null}();var mo,go;!function(e){e.DEBUG="DEBUG",e.INFO="INFO",e.WARNING="WARNING",e.ERROR="ERROR",e.OFF="OFF"}(mo||(mo={})),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"}(go||(go={}));const yo="0123456789abcdef";class bo{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,t){const r=e.toLowerCase();null==fo[r]&&this.throwArgumentError("invalid log level name","logLevel",e),lo>fo[r]||console.log.apply(console,t)}debug(...e){this._log(bo.levels.DEBUG,e)}info(...e){this._log(bo.levels.INFO,e)}warn(...e){this._log(bo.levels.WARNING,e)}makeError(e,t,r){if(uo)return this.makeError("censored error",t,{});t||(t=bo.errors.UNKNOWN_ERROR),r||(r={});const n=[];Object.keys(r).forEach((e=>{const t=r[e];try{if(t instanceof Uint8Array){let r="";for(let e=0;e>4],r+=yo[15&t[e]];n.push(e+"=Uint8Array(0x"+r+")")}else n.push(e+"="+JSON.stringify(t))}catch(t){n.push(e+"="+JSON.stringify(r[e].toString()))}})),n.push(`code=${t}`),n.push(`version=${this.version}`);const i=e;let o="";switch(t){case go.NUMERIC_FAULT:{o="NUMERIC_FAULT";const t=e;switch(t){case"overflow":case"underflow":case"division-by-zero":o+="-"+t;break;case"negative-power":case"negative-width":o+="-unsupported";break;case"unbound-bitwise-result":o+="-unbound-result"}break}case go.CALL_EXCEPTION:case go.INSUFFICIENT_FUNDS:case go.MISSING_NEW:case go.NONCE_EXPIRED:case go.REPLACEMENT_UNDERPRICED:case go.TRANSACTION_REPLACED:case go.UNPREDICTABLE_GAS_LIMIT:o=t}o&&(e+=" [ See: https://links.ethers.org/v5-errors-"+o+" ]"),n.length&&(e+=" ("+n.join(", ")+")");const a=new Error(e);return a.reason=i,a.code=t,Object.keys(r).forEach((function(e){a[e]=r[e]})),a}throwError(e,t,r){throw this.makeError(e,t,r)}throwArgumentError(e,t,r){return this.throwError(e,bo.errors.INVALID_ARGUMENT,{argument:t,value:r})}assert(e,t,r,n){e||this.throwError(t,r,n)}assertArgument(e,t,r,n){e||this.throwArgumentError(t,r,n)}checkNormalize(e){po&&this.throwError("platform missing String.prototype.normalize",bo.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:po})}checkSafeUint53(e,t){"number"==typeof e&&(null==t&&(t="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(t,bo.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(t,bo.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,t,r){r=r?": "+r:"",et&&this.throwError("too many arguments"+r,bo.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:t})}checkNew(e,t){e!==Object&&null!=e||this.throwError("missing new",bo.errors.MISSING_NEW,{name:t.name})}checkAbstract(e,t){e===t?this.throwError("cannot instantiate abstract class "+JSON.stringify(t.name)+" directly; use a sub-class",bo.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):e!==Object&&null!=e||this.throwError("missing new",bo.errors.MISSING_NEW,{name:t.name})}static globalLogger(){return ho||(ho=new bo("logger/5.7.0")),ho}static setCensorship(e,t){if(!e&&t&&this.globalLogger().throwError("cannot permanently disable censorship",bo.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),co){if(!e)return;this.globalLogger().throwError("error censorship permanent",bo.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}uo=!!e,co=!!t}static setLogLevel(e){const t=fo[e.toLowerCase()];null!=t?lo=t:bo.globalLogger().warn("invalid log level - "+e)}static from(e){return new bo(e)}}bo.errors=go,bo.levels=mo;var vo=Object.freeze({__proto__:null,get ErrorCode(){return go},get LogLevel(){return mo},Logger:bo});const wo=new bo("bytes/5.7.0");function Ao(e){return!!e.toHexString}function _o(e){return e.slice||(e.slice=function(){const t=Array.prototype.slice.call(arguments);return _o(new Uint8Array(Array.prototype.slice.apply(e,t)))}),e}function Eo(e){return Io(e)&&!(e.length%2)||Po(e)}function So(e){return"number"==typeof e&&e==e&&e%1==0}function Po(e){if(null==e)return!1;if(e.constructor===Uint8Array)return!0;if("string"==typeof e)return!1;if(!So(e.length)||e.length<0)return!1;for(let t=0;t=256)return!1}return!0}function xo(e,t){if(t||(t={}),"number"==typeof e){wo.checkSafeUint53(e,"invalid arrayify value");const t=[];for(;e;)t.unshift(255&e),e=parseInt(String(e/256));return 0===t.length&&t.push(0),_o(new Uint8Array(t))}if(t.allowMissingPrefix&&"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),Ao(e)&&(e=e.toHexString()),Io(e)){let r=e.substring(2);r.length%2&&("left"===t.hexPad?r="0"+r:"right"===t.hexPad?r+="0":wo.throwArgumentError("hex data is odd-length","value",e));const n=[];for(let e=0;exo(e))),r=t.reduce(((e,t)=>e+t.length),0),n=new Uint8Array(r);return t.reduce(((e,t)=>(n.set(t,e),e+t.length)),0),_o(n)}function Mo(e){let t=xo(e);if(0===t.length)return t;let r=0;for(;rt&&wo.throwArgumentError("value out of range","value",arguments[0]);const r=new Uint8Array(t);return r.set(e,t-e.length),_o(r)}function Io(e,t){return!("string"!=typeof e||!e.match(/^0x[0-9A-Fa-f]*$/))&&(!t||e.length===2+2*t)}const Ro="0123456789abcdef";function No(e,t){if(t||(t={}),"number"==typeof e){wo.checkSafeUint53(e,"invalid hexlify value");let t="";for(;e;)t=Ro[15&e]+t,e=Math.floor(e/16);return t.length?(t.length%2&&(t="0"+t),"0x"+t):"0x00"}if("bigint"==typeof e)return(e=e.toString(16)).length%2?"0x0"+e:"0x"+e;if(t.allowMissingPrefix&&"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),Ao(e))return e.toHexString();if(Io(e))return e.length%2&&("left"===t.hexPad?e="0x0"+e.substring(2):"right"===t.hexPad?e+="0":wo.throwArgumentError("hex data is odd-length","value",e)),e.toLowerCase();if(Po(e)){let t="0x";for(let r=0;r>4]+Ro[15&n]}return t}return wo.throwArgumentError("invalid hexlify value","value",e)}function Oo(e){if("string"!=typeof e)e=No(e);else if(!Io(e)||e.length%2)return null;return(e.length-2)/2}function To(e,t,r){return"string"!=typeof e?e=No(e):(!Io(e)||e.length%2)&&wo.throwArgumentError("invalid hexData","value",e),t=2+2*t,null!=r?"0x"+e.substring(t,2+2*r):"0x"+e.substring(t)}function jo(e){let t="0x";return e.forEach((e=>{t+=No(e).substring(2)})),t}function $o(e){const t=Do(No(e,{hexPad:"left"}));return"0x"===t?"0x0":t}function Do(e){"string"!=typeof e&&(e=No(e)),Io(e)||wo.throwArgumentError("invalid hex string","value",e),e=e.substring(2);let t=0;for(;t2*t+2&&wo.throwArgumentError("value out of range","value",arguments[1]);e.length<2*t+2;)e="0x0"+e.substring(2);return e}function Fo(e){const t={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(Eo(e)){let r=xo(e);64===r.length?(t.v=27+(r[32]>>7),r[32]&=127,t.r=No(r.slice(0,32)),t.s=No(r.slice(32,64))):65===r.length?(t.r=No(r.slice(0,32)),t.s=No(r.slice(32,64)),t.v=r[64]):wo.throwArgumentError("invalid signature string","signature",e),t.v<27&&(0===t.v||1===t.v?t.v+=27:wo.throwArgumentError("signature invalid v byte","signature",e)),t.recoveryParam=1-t.v%2,t.recoveryParam&&(r[32]|=128),t._vs=No(r.slice(32,64))}else{if(t.r=e.r,t.s=e.s,t.v=e.v,t.recoveryParam=e.recoveryParam,t._vs=e._vs,null!=t._vs){const r=Co(xo(t._vs),32);t._vs=No(r);const n=r[0]>=128?1:0;null==t.recoveryParam?t.recoveryParam=n:t.recoveryParam!==n&&wo.throwArgumentError("signature recoveryParam mismatch _vs","signature",e),r[0]&=127;const i=No(r);null==t.s?t.s=i:t.s!==i&&wo.throwArgumentError("signature v mismatch _vs","signature",e)}if(null==t.recoveryParam)null==t.v?wo.throwArgumentError("signature missing v and recoveryParam","signature",e):0===t.v||1===t.v?t.recoveryParam=t.v:t.recoveryParam=1-t.v%2;else if(null==t.v)t.v=27+t.recoveryParam;else{const r=0===t.v||1===t.v?t.v:1-t.v%2;t.recoveryParam!==r&&wo.throwArgumentError("signature recoveryParam mismatch v","signature",e)}null!=t.r&&Io(t.r)?t.r=Bo(t.r,32):wo.throwArgumentError("signature missing or invalid r","signature",e),null!=t.s&&Io(t.s)?t.s=Bo(t.s,32):wo.throwArgumentError("signature missing or invalid s","signature",e);const r=xo(t.s);r[0]>=128&&wo.throwArgumentError("signature s out of range","signature",e),t.recoveryParam&&(r[0]|=128);const n=No(r);t._vs&&(Io(t._vs)||wo.throwArgumentError("signature invalid _vs","signature",e),t._vs=Bo(t._vs,32)),null==t._vs?t._vs=n:t._vs!==n&&wo.throwArgumentError("signature _vs mismatch v and s","signature",e)}return t.yParityAndS=t._vs,t.compact=t.r+t.yParityAndS.substring(2),t}function zo(e){return No(ko([(e=Fo(e)).r,e.s,e.recoveryParam?"0x1c":"0x1b"]))}var Uo=Object.freeze({__proto__:null,arrayify:xo,concat:ko,hexConcat:jo,hexDataLength:Oo,hexDataSlice:To,hexStripZeros:Do,hexValue:$o,hexZeroPad:Bo,hexlify:No,isBytes:Po,isBytesLike:Eo,isHexString:Io,joinSignature:zo,splitSignature:Fo,stripZeros:Mo,zeroPad:Co});const Lo="bignumber/5.7.0";var qo=so.BN;const Ho=new bo(Lo),Ko={},Jo=9007199254740991;let Wo=!1;class Go{constructor(e,t){e!==Ko&&Ho.throwError("cannot call constructor directly; use BigNumber.from",bo.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=t,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return Zo(Xo(this).fromTwos(e))}toTwos(e){return Zo(Xo(this).toTwos(e))}abs(){return"-"===this._hex[0]?Go.from(this._hex.substring(1)):this}add(e){return Zo(Xo(this).add(Xo(e)))}sub(e){return Zo(Xo(this).sub(Xo(e)))}div(e){return Go.from(e).isZero()&&Qo("division-by-zero","div"),Zo(Xo(this).div(Xo(e)))}mul(e){return Zo(Xo(this).mul(Xo(e)))}mod(e){const t=Xo(e);return t.isNeg()&&Qo("division-by-zero","mod"),Zo(Xo(this).umod(t))}pow(e){const t=Xo(e);return t.isNeg()&&Qo("negative-power","pow"),Zo(Xo(this).pow(t))}and(e){const t=Xo(e);return(this.isNegative()||t.isNeg())&&Qo("unbound-bitwise-result","and"),Zo(Xo(this).and(t))}or(e){const t=Xo(e);return(this.isNegative()||t.isNeg())&&Qo("unbound-bitwise-result","or"),Zo(Xo(this).or(t))}xor(e){const t=Xo(e);return(this.isNegative()||t.isNeg())&&Qo("unbound-bitwise-result","xor"),Zo(Xo(this).xor(t))}mask(e){return(this.isNegative()||e<0)&&Qo("negative-width","mask"),Zo(Xo(this).maskn(e))}shl(e){return(this.isNegative()||e<0)&&Qo("negative-width","shl"),Zo(Xo(this).shln(e))}shr(e){return(this.isNegative()||e<0)&&Qo("negative-width","shr"),Zo(Xo(this).shrn(e))}eq(e){return Xo(this).eq(Xo(e))}lt(e){return Xo(this).lt(Xo(e))}lte(e){return Xo(this).lte(Xo(e))}gt(e){return Xo(this).gt(Xo(e))}gte(e){return Xo(this).gte(Xo(e))}isNegative(){return"-"===this._hex[0]}isZero(){return Xo(this).isZero()}toNumber(){try{return Xo(this).toNumber()}catch(e){Qo("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch(e){}return Ho.throwError("this platform does not support BigInt",bo.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(10===arguments[0]?Wo||(Wo=!0,Ho.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?Ho.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",bo.errors.UNEXPECTED_ARGUMENT,{}):Ho.throwError("BigNumber.toString does not accept parameters",bo.errors.UNEXPECTED_ARGUMENT,{})),Xo(this).toString(10)}toHexString(){return this._hex}toJSON(e){return{type:"BigNumber",hex:this.toHexString()}}static from(e){if(e instanceof Go)return e;if("string"==typeof e)return e.match(/^-?0x[0-9a-f]+$/i)?new Go(Ko,Vo(e)):e.match(/^-?[0-9]+$/)?new Go(Ko,Vo(new qo(e))):Ho.throwArgumentError("invalid BigNumber string","value",e);if("number"==typeof e)return e%1&&Qo("underflow","BigNumber.from",e),(e>=Jo||e<=-Jo)&&Qo("overflow","BigNumber.from",e),Go.from(String(e));const t=e;if("bigint"==typeof t)return Go.from(t.toString());if(Po(t))return Go.from(No(t));if(t)if(t.toHexString){const e=t.toHexString();if("string"==typeof e)return Go.from(e)}else{let e=t._hex;if(null==e&&"BigNumber"===t.type&&(e=t.hex),"string"==typeof e&&(Io(e)||"-"===e[0]&&Io(e.substring(1))))return Go.from(e)}return Ho.throwArgumentError("invalid BigNumber value","value",e)}static isBigNumber(e){return!(!e||!e._isBigNumber)}}function Vo(e){if("string"!=typeof e)return Vo(e.toString(16));if("-"===e[0])return"-"===(e=e.substring(1))[0]&&Ho.throwArgumentError("invalid hex","value",e),"0x00"===(e=Vo(e))?e:"-"+e;if("0x"!==e.substring(0,2)&&(e="0x"+e),"0x"===e)return"0x00";for(e.length%2&&(e="0x0"+e.substring(2));e.length>4&&"0x00"===e.substring(0,4);)e="0x"+e.substring(4);return e}function Zo(e){return Go.from(Vo(e))}function Xo(e){const t=Go.from(e).toHexString();return"-"===t[0]?new qo("-"+t.substring(3),16):new qo(t.substring(2),16)}function Qo(e,t,r){const n={fault:e,operation:t};return null!=r&&(n.value=r),Ho.throwError(e,bo.errors.NUMERIC_FAULT,n)}const Yo=new bo(Lo),ea={},ta=Go.from(0),ra=Go.from(-1);function na(e,t,r,n){const i={fault:t,operation:r};return void 0!==n&&(i.value=n),Yo.throwError(e,bo.errors.NUMERIC_FAULT,i)}let ia="0";for(;ia.length<256;)ia+=ia;function oa(e){if("number"!=typeof e)try{e=Go.from(e).toNumber()}catch(e){}return"number"==typeof e&&e>=0&&e<=256&&!(e%1)?"1"+ia.substring(0,e):Yo.throwArgumentError("invalid decimal size","decimals",e)}function aa(e,t){null==t&&(t=0);const r=oa(t),n=(e=Go.from(e)).lt(ta);n&&(e=e.mul(ra));let i=e.mod(r).toString();for(;i.length2&&Yo.throwArgumentError("too many decimal points","value",e);let o=i[0],a=i[1];for(o||(o="0"),a||(a="0");"0"===a[a.length-1];)a=a.substring(0,a.length-1);for(a.length>r.length-1&&na("fractional component exceeds decimals","underflow","parseFixed"),""===a&&(a="0");a.lengthnull==e[t]?n:(typeof e[t]!==r&&Yo.throwArgumentError("invalid fixed format ("+t+" not "+r+")","format."+t,e[t]),e[t]);t=i("signed","boolean",t),r=i("width","number",r),n=i("decimals","number",n)}return r%8&&Yo.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",r),n>80&&Yo.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",n),new ca(ea,t,r,n)}}class ua{constructor(e,t,r,n){e!==ea&&Yo.throwError("cannot use FixedNumber constructor; use FixedNumber.from",bo.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=n,this._hex=t,this._value=r,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(e){this.format.name!==e.format.name&&Yo.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",e)}addUnsafe(e){this._checkFormat(e);const t=sa(this._value,this.format.decimals),r=sa(e._value,e.format.decimals);return ua.fromValue(t.add(r),this.format.decimals,this.format)}subUnsafe(e){this._checkFormat(e);const t=sa(this._value,this.format.decimals),r=sa(e._value,e.format.decimals);return ua.fromValue(t.sub(r),this.format.decimals,this.format)}mulUnsafe(e){this._checkFormat(e);const t=sa(this._value,this.format.decimals),r=sa(e._value,e.format.decimals);return ua.fromValue(t.mul(r).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(e){this._checkFormat(e);const t=sa(this._value,this.format.decimals),r=sa(e._value,e.format.decimals);return ua.fromValue(t.mul(this.format._multiplier).div(r),this.format.decimals,this.format)}floor(){const e=this.toString().split(".");1===e.length&&e.push("0");let t=ua.from(e[0],this.format);const r=!e[1].match(/^(0*)$/);return this.isNegative()&&r&&(t=t.subUnsafe(fa.toFormat(t.format))),t}ceiling(){const e=this.toString().split(".");1===e.length&&e.push("0");let t=ua.from(e[0],this.format);const r=!e[1].match(/^(0*)$/);return!this.isNegative()&&r&&(t=t.addUnsafe(fa.toFormat(t.format))),t}round(e){null==e&&(e=0);const t=this.toString().split(".");if(1===t.length&&t.push("0"),(e<0||e>80||e%1)&&Yo.throwArgumentError("invalid decimal count","decimals",e),t[1].length<=e)return this;const r=ua.from("1"+ia.substring(0,e),this.format),n=da.toFormat(this.format);return this.mulUnsafe(r).addUnsafe(n).floor().divUnsafe(r)}isZero(){return"0.0"===this._value||"0"===this._value}isNegative(){return"-"===this._value[0]}toString(){return this._value}toHexString(e){if(null==e)return this._hex;e%8&&Yo.throwArgumentError("invalid byte width","width",e);return Bo(Go.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString(),e/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return ua.fromString(this._value,e)}static fromValue(e,t,r){return null!=r||null==t||function(e){return null!=e&&(Go.isBigNumber(e)||"number"==typeof e&&e%1==0||"string"==typeof e&&!!e.match(/^-?[0-9]+$/)||Io(e)||"bigint"==typeof e||Po(e))}(t)||(r=t,t=null),null==t&&(t=0),null==r&&(r="fixed"),ua.fromString(aa(e,t),ca.from(r))}static fromString(e,t){null==t&&(t="fixed");const r=ca.from(t),n=sa(e,r.decimals);!r.signed&&n.lt(ta)&&na("unsigned value cannot be negative","overflow","value",e);let i=null;r.signed?i=n.toTwos(r.width).toHexString():(i=n.toHexString(),i=Bo(i,r.width/8));const o=aa(n,r.decimals);return new ua(ea,i,o,r)}static fromBytes(e,t){null==t&&(t="fixed");const r=ca.from(t);if(xo(e).length>r.width/8)throw new Error("overflow");let n=Go.from(e);r.signed&&(n=n.fromTwos(r.width));const i=n.toTwos((r.signed?0:1)+r.width).toHexString(),o=aa(n,r.decimals);return new ua(ea,i,o,r)}static from(e,t){if("string"==typeof e)return ua.fromString(e,t);if(Po(e))return ua.fromBytes(e,t);try{return ua.fromValue(e,0,t)}catch(e){if(e.code!==bo.errors.INVALID_ARGUMENT)throw e}return Yo.throwArgumentError("invalid FixedNumber value","value",e)}static isFixedNumber(e){return!(!e||!e._isFixedNumber)}}const fa=ua.from(1),da=ua.from("0.5");var la=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))};const ha=new bo("properties/5.7.0");function pa(e,t,r){Object.defineProperty(e,t,{enumerable:!0,value:r,writable:!1})}function ma(e,t){for(let r=0;r<32;r++){if(e[t])return e[t];if(!e.prototype||"object"!=typeof e.prototype)break;e=Object.getPrototypeOf(e.prototype).constructor}return null}function ga(e){return la(this,void 0,void 0,(function*(){const t=Object.keys(e).map((t=>{const r=e[t];return Promise.resolve(r).then((e=>({key:t,value:e})))}));return(yield Promise.all(t)).reduce(((e,t)=>(e[t.key]=t.value,e)),{})}))}function ya(e,t){e&&"object"==typeof e||ha.throwArgumentError("invalid object","object",e),Object.keys(e).forEach((r=>{t[r]||ha.throwArgumentError("invalid object key - "+r,"transaction:"+r,e)}))}function ba(e){const t={};for(const r in e)t[r]=e[r];return t}const va={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function wa(e){if(null==e||va[typeof e])return!0;if(Array.isArray(e)||"object"==typeof e){if(!Object.isFrozen(e))return!1;const t=Object.keys(e);for(let r=0;r_a(e))));if("object"==typeof e){const t={};for(const r in e){const n=e[r];void 0!==n&&pa(t,r,_a(n))}return t}return ha.throwArgumentError("Cannot deepCopy "+typeof e,"object",e)}function _a(e){return Aa(e)}class Ea{constructor(e){for(const t in e)this[t]=_a(e[t])}}var Sa=Object.freeze({__proto__:null,Description:Ea,checkProperties:ya,deepCopy:_a,defineReadOnly:pa,getStatic:ma,resolveProperties:ga,shallowCopy:ba});const Pa="abi/5.7.0",xa=new bo(Pa),ka={};let Ma={calldata:!0,memory:!0,storage:!0},Ca={calldata:!0,memory:!0};function Ia(e,t){if("bytes"===e||"string"===e){if(Ma[t])return!0}else if("address"===e){if("payable"===t)return!0}else if((e.indexOf("[")>=0||"tuple"===e)&&Ca[t])return!0;return(Ma[t]||"payable"===t)&&xa.throwArgumentError("invalid modifier","name",t),!1}function Ra(e,t){for(let r in t)pa(e,r,t[r])}const Na=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),Oa=new RegExp(/^(.*)\[([0-9]*)\]$/);class Ta{constructor(e,t){e!==ka&&xa.throwError("use fromString",bo.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),Ra(this,t);let r=this.type.match(Oa);Ra(this,r?{arrayLength:parseInt(r[2]||"-1"),arrayChildren:Ta.fromObject({type:r[1],components:this.components}),baseType:"array"}:{arrayLength:null,arrayChildren:null,baseType:null!=this.components?"tuple":this.type}),this._isParamType=!0,Object.freeze(this)}format(e){if(e||(e=Na.sighash),Na[e]||xa.throwArgumentError("invalid format type","format",e),e===Na.json){let t={type:"tuple"===this.baseType?"tuple":this.type,name:this.name||void 0};return"boolean"==typeof this.indexed&&(t.indexed=this.indexed),this.components&&(t.components=this.components.map((t=>JSON.parse(t.format(e))))),JSON.stringify(t)}let t="";return"array"===this.baseType?(t+=this.arrayChildren.format(e),t+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):"tuple"===this.baseType?(e!==Na.sighash&&(t+=this.type),t+="("+this.components.map((t=>t.format(e))).join(e===Na.full?", ":",")+")"):t+=this.type,e!==Na.sighash&&(!0===this.indexed&&(t+=" indexed"),e===Na.full&&this.name&&(t+=" "+this.name)),t}static from(e,t){return"string"==typeof e?Ta.fromString(e,t):Ta.fromObject(e)}static fromObject(e){return Ta.isParamType(e)?e:new Ta(ka,{name:e.name||null,type:Ka(e.type),indexed:null==e.indexed?null:!!e.indexed,components:e.components?e.components.map(Ta.fromObject):null})}static fromString(e,t){return r=function(e,t){let r=e;function n(t){xa.throwArgumentError(`unexpected character at position ${t}`,"param",e)}function i(e){let r={type:"",name:"",parent:e,state:{allowType:!0}};return t&&(r.indexed=!1),r}e=e.replace(/\s/g," ");let o={type:"",name:"",state:{allowType:!0}},a=o;for(let r=0;rTa.fromString(e,t)))}class $a{constructor(e,t){e!==ka&&xa.throwError("use a static from method",bo.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),Ra(this,t),this._isFragment=!0,Object.freeze(this)}static from(e){return $a.isFragment(e)?e:"string"==typeof e?$a.fromString(e):$a.fromObject(e)}static fromObject(e){if($a.isFragment(e))return e;switch(e.type){case"function":return La.fromObject(e);case"event":return Da.fromObject(e);case"constructor":return Ua.fromObject(e);case"error":return Ha.fromObject(e);case"fallback":case"receive":return null}return xa.throwArgumentError("invalid fragment object","value",e)}static fromString(e){return"event"===(e=(e=(e=e.replace(/\s/g," ")).replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," ")).trim()).split(" ")[0]?Da.fromString(e.substring(5).trim()):"function"===e.split(" ")[0]?La.fromString(e.substring(8).trim()):"constructor"===e.split("(")[0].trim()?Ua.fromString(e.trim()):"error"===e.split(" ")[0]?Ha.fromString(e.substring(5).trim()):xa.throwArgumentError("unsupported fragment","value",e)}static isFragment(e){return!(!e||!e._isFragment)}}class Da extends $a{format(e){if(e||(e=Na.sighash),Na[e]||xa.throwArgumentError("invalid format type","format",e),e===Na.json)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==Na.sighash&&(t+="event "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===Na.full?", ":",")+") ",e!==Na.sighash&&this.anonymous&&(t+="anonymous "),t.trim()}static from(e){return"string"==typeof e?Da.fromString(e):Da.fromObject(e)}static fromObject(e){if(Da.isEventFragment(e))return e;"event"!==e.type&&xa.throwArgumentError("invalid event object","value",e);const t={name:Wa(e.name),anonymous:e.anonymous,inputs:e.inputs?e.inputs.map(Ta.fromObject):[],type:"event"};return new Da(ka,t)}static fromString(e){let t=e.match(Ga);t||xa.throwArgumentError("invalid event string","value",e);let r=!1;return t[3].split(" ").forEach((e=>{switch(e.trim()){case"anonymous":r=!0;break;case"":break;default:xa.warn("unknown modifier: "+e)}})),Da.fromObject({name:t[1].trim(),anonymous:r,inputs:ja(t[2],!0),type:"event"})}static isEventFragment(e){return e&&e._isFragment&&"event"===e.type}}function Ba(e,t){t.gas=null;let r=e.split("@");return 1!==r.length?(r.length>2&&xa.throwArgumentError("invalid human-readable ABI signature","value",e),r[1].match(/^[0-9]+$/)||xa.throwArgumentError("invalid human-readable ABI signature gas","value",e),t.gas=Go.from(r[1]),r[0]):e}function Fa(e,t){t.constant=!1,t.payable=!1,t.stateMutability="nonpayable",e.split(" ").forEach((e=>{switch(e.trim()){case"constant":t.constant=!0;break;case"payable":t.payable=!0,t.stateMutability="payable";break;case"nonpayable":t.payable=!1,t.stateMutability="nonpayable";break;case"pure":t.constant=!0,t.stateMutability="pure";break;case"view":t.constant=!0,t.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+e)}}))}function za(e){let t={constant:!1,payable:!0,stateMutability:"payable"};return null!=e.stateMutability?(t.stateMutability=e.stateMutability,t.constant="view"===t.stateMutability||"pure"===t.stateMutability,null!=e.constant&&!!e.constant!==t.constant&&xa.throwArgumentError("cannot have constant function with mutability "+t.stateMutability,"value",e),t.payable="payable"===t.stateMutability,null!=e.payable&&!!e.payable!==t.payable&&xa.throwArgumentError("cannot have payable function with mutability "+t.stateMutability,"value",e)):null!=e.payable?(t.payable=!!e.payable,null!=e.constant||t.payable||"constructor"===e.type||xa.throwArgumentError("unable to determine stateMutability","value",e),t.constant=!!e.constant,t.constant?t.stateMutability="view":t.stateMutability=t.payable?"payable":"nonpayable",t.payable&&t.constant&&xa.throwArgumentError("cannot have constant payable function","value",e)):null!=e.constant?(t.constant=!!e.constant,t.payable=!t.constant,t.stateMutability=t.constant?"view":"payable"):"constructor"!==e.type&&xa.throwArgumentError("unable to determine stateMutability","value",e),t}class Ua extends $a{format(e){if(e||(e=Na.sighash),Na[e]||xa.throwArgumentError("invalid format type","format",e),e===Na.json)return JSON.stringify({type:"constructor",stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});e===Na.sighash&&xa.throwError("cannot format a constructor for sighash",bo.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});let t="constructor("+this.inputs.map((t=>t.format(e))).join(e===Na.full?", ":",")+") ";return this.stateMutability&&"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "),t.trim()}static from(e){return"string"==typeof e?Ua.fromString(e):Ua.fromObject(e)}static fromObject(e){if(Ua.isConstructorFragment(e))return e;"constructor"!==e.type&&xa.throwArgumentError("invalid constructor object","value",e);let t=za(e);t.constant&&xa.throwArgumentError("constructor cannot be constant","value",e);const r={name:null,type:e.type,inputs:e.inputs?e.inputs.map(Ta.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?Go.from(e.gas):null};return new Ua(ka,r)}static fromString(e){let t={type:"constructor"},r=(e=Ba(e,t)).match(Ga);return r&&"constructor"===r[1].trim()||xa.throwArgumentError("invalid constructor string","value",e),t.inputs=ja(r[2].trim(),!1),Fa(r[3].trim(),t),Ua.fromObject(t)}static isConstructorFragment(e){return e&&e._isFragment&&"constructor"===e.type}}class La extends Ua{format(e){if(e||(e=Na.sighash),Na[e]||xa.throwArgumentError("invalid format type","format",e),e===Na.json)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((t=>JSON.parse(t.format(e)))),outputs:this.outputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==Na.sighash&&(t+="function "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===Na.full?", ":",")+") ",e!==Na.sighash&&(this.stateMutability?"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "):this.constant&&(t+="view "),this.outputs&&this.outputs.length&&(t+="returns ("+this.outputs.map((t=>t.format(e))).join(", ")+") "),null!=this.gas&&(t+="@"+this.gas.toString()+" ")),t.trim()}static from(e){return"string"==typeof e?La.fromString(e):La.fromObject(e)}static fromObject(e){if(La.isFunctionFragment(e))return e;"function"!==e.type&&xa.throwArgumentError("invalid function object","value",e);let t=za(e);const r={type:e.type,name:Wa(e.name),constant:t.constant,inputs:e.inputs?e.inputs.map(Ta.fromObject):[],outputs:e.outputs?e.outputs.map(Ta.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?Go.from(e.gas):null};return new La(ka,r)}static fromString(e){let t={type:"function"},r=(e=Ba(e,t)).split(" returns ");r.length>2&&xa.throwArgumentError("invalid function string","value",e);let n=r[0].match(Ga);if(n||xa.throwArgumentError("invalid function signature","value",e),t.name=n[1].trim(),t.name&&Wa(t.name),t.inputs=ja(n[2],!1),Fa(n[3].trim(),t),r.length>1){let n=r[1].match(Ga);""==n[1].trim()&&""==n[3].trim()||xa.throwArgumentError("unexpected tokens","value",e),t.outputs=ja(n[2],!1)}else t.outputs=[];return La.fromObject(t)}static isFunctionFragment(e){return e&&e._isFragment&&"function"===e.type}}function qa(e){const t=e.format();return"Error(string)"!==t&&"Panic(uint256)"!==t||xa.throwArgumentError(`cannot specify user defined ${t} error`,"fragment",e),e}class Ha extends $a{format(e){if(e||(e=Na.sighash),Na[e]||xa.throwArgumentError("invalid format type","format",e),e===Na.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==Na.sighash&&(t+="error "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===Na.full?", ":",")+") ",t.trim()}static from(e){return"string"==typeof e?Ha.fromString(e):Ha.fromObject(e)}static fromObject(e){if(Ha.isErrorFragment(e))return e;"error"!==e.type&&xa.throwArgumentError("invalid error object","value",e);const t={type:e.type,name:Wa(e.name),inputs:e.inputs?e.inputs.map(Ta.fromObject):[]};return qa(new Ha(ka,t))}static fromString(e){let t={type:"error"},r=e.match(Ga);return r||xa.throwArgumentError("invalid error signature","value",e),t.name=r[1].trim(),t.name&&Wa(t.name),t.inputs=ja(r[2],!1),qa(Ha.fromObject(t))}static isErrorFragment(e){return e&&e._isFragment&&"error"===e.type}}function Ka(e){return e.match(/^uint($|[^1-9])/)?e="uint256"+e.substring(4):e.match(/^int($|[^1-9])/)&&(e="int256"+e.substring(3)),e}const Ja=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function Wa(e){return e&&e.match(Ja)||xa.throwArgumentError(`invalid identifier "${e}"`,"value",e),e}const Ga=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$");const Va=new bo(Pa);function Za(e){const t=[],r=function(e,n){if(Array.isArray(n))for(let i in n){const o=e.slice();o.push(i);try{r(o,n[i])}catch(e){t.push({path:o,error:e})}}};return r([],e),t}class Xa{constructor(e,t,r,n){this.name=e,this.type=t,this.localName=r,this.dynamic=n}_throwError(e,t){Va.throwArgumentError(e,this.localName,t)}}class Qa{constructor(e){pa(this,"wordSize",e||32),this._data=[],this._dataLength=0,this._padding=new Uint8Array(e)}get data(){return jo(this._data)}get length(){return this._dataLength}_writeData(e){return this._data.push(e),this._dataLength+=e.length,e.length}appendWriter(e){return this._writeData(ko(e._data))}writeBytes(e){let t=xo(e);const r=t.length%this.wordSize;return r&&(t=ko([t,this._padding.slice(r)])),this._writeData(t)}_getValue(e){let t=xo(Go.from(e));return t.length>this.wordSize&&Va.throwError("value out-of-bounds",bo.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:t.length}),t.length%this.wordSize&&(t=ko([this._padding.slice(t.length%this.wordSize),t])),t}writeValue(e){return this._writeData(this._getValue(e))}writeUpdatableValue(){const e=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,t=>{this._data[e]=this._getValue(t)}}}class Ya{constructor(e,t,r,n){pa(this,"_data",xo(e)),pa(this,"wordSize",t||32),pa(this,"_coerceFunc",r),pa(this,"allowLoose",n),this._offset=0}get data(){return No(this._data)}get consumed(){return this._offset}static coerce(e,t){let r=e.match("^u?int([0-9]+)$");return r&&parseInt(r[1])<=48&&(t=t.toNumber()),t}coerce(e,t){return this._coerceFunc?this._coerceFunc(e,t):Ya.coerce(e,t)}_peekBytes(e,t,r){let n=Math.ceil(t/this.wordSize)*this.wordSize;return this._offset+n>this._data.length&&(this.allowLoose&&r&&this._offset+t<=this._data.length?n=t:Va.throwError("data out-of-bounds",bo.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+n})),this._data.slice(this._offset,this._offset+n)}subReader(e){return new Ya(this._data.slice(this._offset+e),this.wordSize,this._coerceFunc,this.allowLoose)}readBytes(e,t){let r=this._peekBytes(0,e,!!t);return this._offset+=r.length,r.slice(0,e)}readValue(){return Go.from(this.readBytes(this.wordSize))}}var es,ts={exports:{}}; +const e=e=>{const t=[];for(let r=0;rnew Uint8Array(atob(e).split("").map((e=>e.charCodeAt(0))));function r(t,r=!1,n=!0){let i="";{const r="string"==typeof t?(new TextEncoder).encode(t):new Uint8Array(t);i=e(r)}return r&&(i=function(e){return e.replace(/\+/g,"-").replace(/\//g,"_")}(i)),n||(i=i.replace(/=/g,"")),i}function n(e,r=!1){{let n=!1;if(/^[0-9a-zA-Z_-]+={0,2}$/.test(e))n=!0;else if(!/^[0-9a-zA-Z+/]*={0,2}$/.test(e))throw new Error("Not a valid base64 input");n&&(e=e.replace(/-/g,"+").replace(/_/g,"/").replace(/=/g,""));const i=t(e);return r?(new TextDecoder).decode(i):i}}function i(e,t=!1,r){const n=e.match(/^(0x)?([\da-fA-F]+)$/);if(null==n)throw new RangeError("input must be a hexadecimal string, e.g. '0x124fe3a' or '0214f1b2'");let i=n[2];if(void 0!==r){if(r{n+=o[e>>4]+o[15&e]})),i(n,t,r)}}function a(e,t=!1){let r=i(e);return r=i(e,!1,Math.ceil(r.length/2)),Uint8Array.from(r.match(/[\da-fA-F]{2}/g).map((e=>parseInt(e,16)))).buffer}function s(e,t=!1){if(e<1)throw new RangeError("byteLength MUST be > 0");return new Promise((function(r,n){{const n=new Uint8Array(e);if(e<=65536)self.crypto.getRandomValues(n);else for(let t=0;t=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function s(e,t,r){var n=a(e,r);return r-1>=t&&(n|=a(e,r-1)<<4),n}function c(e,t,r,n){for(var i=0,o=Math.min(e.length,r),a=t;a=49?s-49+10:s>=17?s-17+10:s}return i}i.isBN=function(e){return e instanceof i||null!==e&&"object"==typeof e&&e.constructor.wordSize===i.wordSize&&Array.isArray(e.words)},i.max=function(e,t){return e.cmp(t)>0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,n){if("number"==typeof e)return this._initNumber(e,t,n);if("object"==typeof e)return this._initArray(e,t,n);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)a=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===n)for(i=0,o=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this.strip()},i.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n=t;n-=2)i=s(e,t,n)<=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(n=(e.length-t)%2==0?t+1:t;n=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this.strip()},i.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,a=o%n,s=Math.min(o,o-a)+r,u=0,f=r;f1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?""};var u=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],f=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function l(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],a=i*o,s=67108863&a,c=a/67108864|0;r.words[0]=s;for(var u=1;u>>26,d=67108863&c,l=Math.min(u,t.length-1),h=Math.max(0,u-e.length+1);h<=l;h++){var p=u-h|0;f+=(a=(i=0|e.words[p])*(o=0|t.words[h])+d)/67108864|0,d=67108863&a}r.words[u]=0|d,c=0|f}return 0!==c?r.words[u]=0|c:r.length--,r.strip()}i.prototype.toString=function(e,t){var n;if(t=0|t||1,16===(e=e||10)||"hex"===e){n="";for(var i=0,o=0,a=0;a>>24-i&16777215)||a!==this.length-1?u[6-c.length]+c+n:c+n,(i+=2)>=26&&(i-=26,a--)}for(0!==o&&(n=o.toString(16)+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(e===(0|e)&&e>=2&&e<=36){var l=f[e],h=d[e];n="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(h).toString(e);n=(p=p.idivn(h)).isZero()?m+n:u[l-m.length]+m+n}for(this.isZero()&&(n="0"+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},i.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&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(e,t){return r(void 0!==o),this.toArrayLike(o,e,t)},i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},i.prototype.toArrayLike=function(e,t,n){var i=this.byteLength(),o=n||Math.max(1,i);r(i<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0"),this.strip();var a,s,c="le"===t,u=new e(o),f=this.clone();if(c){for(s=0;!f.isZero();s++)a=f.andln(255),f.iushrn(8),u[s]=a;for(;s=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){r("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),n>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-n),this.strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){r("number"==typeof e&&e>=0);var n=e/26|0,i=e%26;return this._expand(n+1),this.words[n]=t?this.words[n]|1<e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},i.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,a=0;a>26,this.words[a]=67108863&t;for(;0!==o&&a>26,this.words[a]=67108863&t;if(0===o&&a>>13,h=0|a[1],p=8191&h,m=h>>>13,g=0|a[2],y=8191&g,b=g>>>13,v=0|a[3],w=8191&v,A=v>>>13,_=0|a[4],E=8191&_,S=_>>>13,P=0|a[5],x=8191&P,k=P>>>13,M=0|a[6],C=8191&M,I=M>>>13,R=0|a[7],N=8191&R,O=R>>>13,T=0|a[8],j=8191&T,$=T>>>13,D=0|a[9],B=8191&D,F=D>>>13,z=0|s[0],U=8191&z,L=z>>>13,q=0|s[1],H=8191&q,K=q>>>13,J=0|s[2],W=8191&J,G=J>>>13,V=0|s[3],Z=8191&V,X=V>>>13,Q=0|s[4],Y=8191&Q,ee=Q>>>13,te=0|s[5],re=8191&te,ne=te>>>13,ie=0|s[6],oe=8191&ie,ae=ie>>>13,se=0|s[7],ce=8191&se,ue=se>>>13,fe=0|s[8],de=8191&fe,le=fe>>>13,he=0|s[9],pe=8191&he,me=he>>>13;r.negative=e.negative^t.negative,r.length=19;var ge=(u+(n=Math.imul(d,U))|0)+((8191&(i=(i=Math.imul(d,L))+Math.imul(l,U)|0))<<13)|0;u=((o=Math.imul(l,L))+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(p,U),i=(i=Math.imul(p,L))+Math.imul(m,U)|0,o=Math.imul(m,L);var ye=(u+(n=n+Math.imul(d,H)|0)|0)+((8191&(i=(i=i+Math.imul(d,K)|0)+Math.imul(l,H)|0))<<13)|0;u=((o=o+Math.imul(l,K)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(y,U),i=(i=Math.imul(y,L))+Math.imul(b,U)|0,o=Math.imul(b,L),n=n+Math.imul(p,H)|0,i=(i=i+Math.imul(p,K)|0)+Math.imul(m,H)|0,o=o+Math.imul(m,K)|0;var be=(u+(n=n+Math.imul(d,W)|0)|0)+((8191&(i=(i=i+Math.imul(d,G)|0)+Math.imul(l,W)|0))<<13)|0;u=((o=o+Math.imul(l,G)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(w,U),i=(i=Math.imul(w,L))+Math.imul(A,U)|0,o=Math.imul(A,L),n=n+Math.imul(y,H)|0,i=(i=i+Math.imul(y,K)|0)+Math.imul(b,H)|0,o=o+Math.imul(b,K)|0,n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(m,W)|0,o=o+Math.imul(m,G)|0;var ve=(u+(n=n+Math.imul(d,Z)|0)|0)+((8191&(i=(i=i+Math.imul(d,X)|0)+Math.imul(l,Z)|0))<<13)|0;u=((o=o+Math.imul(l,X)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(E,U),i=(i=Math.imul(E,L))+Math.imul(S,U)|0,o=Math.imul(S,L),n=n+Math.imul(w,H)|0,i=(i=i+Math.imul(w,K)|0)+Math.imul(A,H)|0,o=o+Math.imul(A,K)|0,n=n+Math.imul(y,W)|0,i=(i=i+Math.imul(y,G)|0)+Math.imul(b,W)|0,o=o+Math.imul(b,G)|0,n=n+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,X)|0;var we=(u+(n=n+Math.imul(d,Y)|0)|0)+((8191&(i=(i=i+Math.imul(d,ee)|0)+Math.imul(l,Y)|0))<<13)|0;u=((o=o+Math.imul(l,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(x,U),i=(i=Math.imul(x,L))+Math.imul(k,U)|0,o=Math.imul(k,L),n=n+Math.imul(E,H)|0,i=(i=i+Math.imul(E,K)|0)+Math.imul(S,H)|0,o=o+Math.imul(S,K)|0,n=n+Math.imul(w,W)|0,i=(i=i+Math.imul(w,G)|0)+Math.imul(A,W)|0,o=o+Math.imul(A,G)|0,n=n+Math.imul(y,Z)|0,i=(i=i+Math.imul(y,X)|0)+Math.imul(b,Z)|0,o=o+Math.imul(b,X)|0,n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(m,Y)|0,o=o+Math.imul(m,ee)|0;var Ae=(u+(n=n+Math.imul(d,re)|0)|0)+((8191&(i=(i=i+Math.imul(d,ne)|0)+Math.imul(l,re)|0))<<13)|0;u=((o=o+Math.imul(l,ne)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(C,U),i=(i=Math.imul(C,L))+Math.imul(I,U)|0,o=Math.imul(I,L),n=n+Math.imul(x,H)|0,i=(i=i+Math.imul(x,K)|0)+Math.imul(k,H)|0,o=o+Math.imul(k,K)|0,n=n+Math.imul(E,W)|0,i=(i=i+Math.imul(E,G)|0)+Math.imul(S,W)|0,o=o+Math.imul(S,G)|0,n=n+Math.imul(w,Z)|0,i=(i=i+Math.imul(w,X)|0)+Math.imul(A,Z)|0,o=o+Math.imul(A,X)|0,n=n+Math.imul(y,Y)|0,i=(i=i+Math.imul(y,ee)|0)+Math.imul(b,Y)|0,o=o+Math.imul(b,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(m,re)|0,o=o+Math.imul(m,ne)|0;var _e=(u+(n=n+Math.imul(d,oe)|0)|0)+((8191&(i=(i=i+Math.imul(d,ae)|0)+Math.imul(l,oe)|0))<<13)|0;u=((o=o+Math.imul(l,ae)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(N,U),i=(i=Math.imul(N,L))+Math.imul(O,U)|0,o=Math.imul(O,L),n=n+Math.imul(C,H)|0,i=(i=i+Math.imul(C,K)|0)+Math.imul(I,H)|0,o=o+Math.imul(I,K)|0,n=n+Math.imul(x,W)|0,i=(i=i+Math.imul(x,G)|0)+Math.imul(k,W)|0,o=o+Math.imul(k,G)|0,n=n+Math.imul(E,Z)|0,i=(i=i+Math.imul(E,X)|0)+Math.imul(S,Z)|0,o=o+Math.imul(S,X)|0,n=n+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(A,Y)|0,o=o+Math.imul(A,ee)|0,n=n+Math.imul(y,re)|0,i=(i=i+Math.imul(y,ne)|0)+Math.imul(b,re)|0,o=o+Math.imul(b,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,ae)|0)+Math.imul(m,oe)|0,o=o+Math.imul(m,ae)|0;var Ee=(u+(n=n+Math.imul(d,ce)|0)|0)+((8191&(i=(i=i+Math.imul(d,ue)|0)+Math.imul(l,ce)|0))<<13)|0;u=((o=o+Math.imul(l,ue)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(j,U),i=(i=Math.imul(j,L))+Math.imul($,U)|0,o=Math.imul($,L),n=n+Math.imul(N,H)|0,i=(i=i+Math.imul(N,K)|0)+Math.imul(O,H)|0,o=o+Math.imul(O,K)|0,n=n+Math.imul(C,W)|0,i=(i=i+Math.imul(C,G)|0)+Math.imul(I,W)|0,o=o+Math.imul(I,G)|0,n=n+Math.imul(x,Z)|0,i=(i=i+Math.imul(x,X)|0)+Math.imul(k,Z)|0,o=o+Math.imul(k,X)|0,n=n+Math.imul(E,Y)|0,i=(i=i+Math.imul(E,ee)|0)+Math.imul(S,Y)|0,o=o+Math.imul(S,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(A,re)|0,o=o+Math.imul(A,ne)|0,n=n+Math.imul(y,oe)|0,i=(i=i+Math.imul(y,ae)|0)+Math.imul(b,oe)|0,o=o+Math.imul(b,ae)|0,n=n+Math.imul(p,ce)|0,i=(i=i+Math.imul(p,ue)|0)+Math.imul(m,ce)|0,o=o+Math.imul(m,ue)|0;var Se=(u+(n=n+Math.imul(d,de)|0)|0)+((8191&(i=(i=i+Math.imul(d,le)|0)+Math.imul(l,de)|0))<<13)|0;u=((o=o+Math.imul(l,le)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(B,U),i=(i=Math.imul(B,L))+Math.imul(F,U)|0,o=Math.imul(F,L),n=n+Math.imul(j,H)|0,i=(i=i+Math.imul(j,K)|0)+Math.imul($,H)|0,o=o+Math.imul($,K)|0,n=n+Math.imul(N,W)|0,i=(i=i+Math.imul(N,G)|0)+Math.imul(O,W)|0,o=o+Math.imul(O,G)|0,n=n+Math.imul(C,Z)|0,i=(i=i+Math.imul(C,X)|0)+Math.imul(I,Z)|0,o=o+Math.imul(I,X)|0,n=n+Math.imul(x,Y)|0,i=(i=i+Math.imul(x,ee)|0)+Math.imul(k,Y)|0,o=o+Math.imul(k,ee)|0,n=n+Math.imul(E,re)|0,i=(i=i+Math.imul(E,ne)|0)+Math.imul(S,re)|0,o=o+Math.imul(S,ne)|0,n=n+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,ae)|0)+Math.imul(A,oe)|0,o=o+Math.imul(A,ae)|0,n=n+Math.imul(y,ce)|0,i=(i=i+Math.imul(y,ue)|0)+Math.imul(b,ce)|0,o=o+Math.imul(b,ue)|0,n=n+Math.imul(p,de)|0,i=(i=i+Math.imul(p,le)|0)+Math.imul(m,de)|0,o=o+Math.imul(m,le)|0;var Pe=(u+(n=n+Math.imul(d,pe)|0)|0)+((8191&(i=(i=i+Math.imul(d,me)|0)+Math.imul(l,pe)|0))<<13)|0;u=((o=o+Math.imul(l,me)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(B,H),i=(i=Math.imul(B,K))+Math.imul(F,H)|0,o=Math.imul(F,K),n=n+Math.imul(j,W)|0,i=(i=i+Math.imul(j,G)|0)+Math.imul($,W)|0,o=o+Math.imul($,G)|0,n=n+Math.imul(N,Z)|0,i=(i=i+Math.imul(N,X)|0)+Math.imul(O,Z)|0,o=o+Math.imul(O,X)|0,n=n+Math.imul(C,Y)|0,i=(i=i+Math.imul(C,ee)|0)+Math.imul(I,Y)|0,o=o+Math.imul(I,ee)|0,n=n+Math.imul(x,re)|0,i=(i=i+Math.imul(x,ne)|0)+Math.imul(k,re)|0,o=o+Math.imul(k,ne)|0,n=n+Math.imul(E,oe)|0,i=(i=i+Math.imul(E,ae)|0)+Math.imul(S,oe)|0,o=o+Math.imul(S,ae)|0,n=n+Math.imul(w,ce)|0,i=(i=i+Math.imul(w,ue)|0)+Math.imul(A,ce)|0,o=o+Math.imul(A,ue)|0,n=n+Math.imul(y,de)|0,i=(i=i+Math.imul(y,le)|0)+Math.imul(b,de)|0,o=o+Math.imul(b,le)|0;var xe=(u+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,me)|0)+Math.imul(m,pe)|0))<<13)|0;u=((o=o+Math.imul(m,me)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(B,W),i=(i=Math.imul(B,G))+Math.imul(F,W)|0,o=Math.imul(F,G),n=n+Math.imul(j,Z)|0,i=(i=i+Math.imul(j,X)|0)+Math.imul($,Z)|0,o=o+Math.imul($,X)|0,n=n+Math.imul(N,Y)|0,i=(i=i+Math.imul(N,ee)|0)+Math.imul(O,Y)|0,o=o+Math.imul(O,ee)|0,n=n+Math.imul(C,re)|0,i=(i=i+Math.imul(C,ne)|0)+Math.imul(I,re)|0,o=o+Math.imul(I,ne)|0,n=n+Math.imul(x,oe)|0,i=(i=i+Math.imul(x,ae)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,ae)|0,n=n+Math.imul(E,ce)|0,i=(i=i+Math.imul(E,ue)|0)+Math.imul(S,ce)|0,o=o+Math.imul(S,ue)|0,n=n+Math.imul(w,de)|0,i=(i=i+Math.imul(w,le)|0)+Math.imul(A,de)|0,o=o+Math.imul(A,le)|0;var ke=(u+(n=n+Math.imul(y,pe)|0)|0)+((8191&(i=(i=i+Math.imul(y,me)|0)+Math.imul(b,pe)|0))<<13)|0;u=((o=o+Math.imul(b,me)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(B,Z),i=(i=Math.imul(B,X))+Math.imul(F,Z)|0,o=Math.imul(F,X),n=n+Math.imul(j,Y)|0,i=(i=i+Math.imul(j,ee)|0)+Math.imul($,Y)|0,o=o+Math.imul($,ee)|0,n=n+Math.imul(N,re)|0,i=(i=i+Math.imul(N,ne)|0)+Math.imul(O,re)|0,o=o+Math.imul(O,ne)|0,n=n+Math.imul(C,oe)|0,i=(i=i+Math.imul(C,ae)|0)+Math.imul(I,oe)|0,o=o+Math.imul(I,ae)|0,n=n+Math.imul(x,ce)|0,i=(i=i+Math.imul(x,ue)|0)+Math.imul(k,ce)|0,o=o+Math.imul(k,ue)|0,n=n+Math.imul(E,de)|0,i=(i=i+Math.imul(E,le)|0)+Math.imul(S,de)|0,o=o+Math.imul(S,le)|0;var Me=(u+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,me)|0)+Math.imul(A,pe)|0))<<13)|0;u=((o=o+Math.imul(A,me)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(B,Y),i=(i=Math.imul(B,ee))+Math.imul(F,Y)|0,o=Math.imul(F,ee),n=n+Math.imul(j,re)|0,i=(i=i+Math.imul(j,ne)|0)+Math.imul($,re)|0,o=o+Math.imul($,ne)|0,n=n+Math.imul(N,oe)|0,i=(i=i+Math.imul(N,ae)|0)+Math.imul(O,oe)|0,o=o+Math.imul(O,ae)|0,n=n+Math.imul(C,ce)|0,i=(i=i+Math.imul(C,ue)|0)+Math.imul(I,ce)|0,o=o+Math.imul(I,ue)|0,n=n+Math.imul(x,de)|0,i=(i=i+Math.imul(x,le)|0)+Math.imul(k,de)|0,o=o+Math.imul(k,le)|0;var Ce=(u+(n=n+Math.imul(E,pe)|0)|0)+((8191&(i=(i=i+Math.imul(E,me)|0)+Math.imul(S,pe)|0))<<13)|0;u=((o=o+Math.imul(S,me)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(B,re),i=(i=Math.imul(B,ne))+Math.imul(F,re)|0,o=Math.imul(F,ne),n=n+Math.imul(j,oe)|0,i=(i=i+Math.imul(j,ae)|0)+Math.imul($,oe)|0,o=o+Math.imul($,ae)|0,n=n+Math.imul(N,ce)|0,i=(i=i+Math.imul(N,ue)|0)+Math.imul(O,ce)|0,o=o+Math.imul(O,ue)|0,n=n+Math.imul(C,de)|0,i=(i=i+Math.imul(C,le)|0)+Math.imul(I,de)|0,o=o+Math.imul(I,le)|0;var Ie=(u+(n=n+Math.imul(x,pe)|0)|0)+((8191&(i=(i=i+Math.imul(x,me)|0)+Math.imul(k,pe)|0))<<13)|0;u=((o=o+Math.imul(k,me)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(B,oe),i=(i=Math.imul(B,ae))+Math.imul(F,oe)|0,o=Math.imul(F,ae),n=n+Math.imul(j,ce)|0,i=(i=i+Math.imul(j,ue)|0)+Math.imul($,ce)|0,o=o+Math.imul($,ue)|0,n=n+Math.imul(N,de)|0,i=(i=i+Math.imul(N,le)|0)+Math.imul(O,de)|0,o=o+Math.imul(O,le)|0;var Re=(u+(n=n+Math.imul(C,pe)|0)|0)+((8191&(i=(i=i+Math.imul(C,me)|0)+Math.imul(I,pe)|0))<<13)|0;u=((o=o+Math.imul(I,me)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(B,ce),i=(i=Math.imul(B,ue))+Math.imul(F,ce)|0,o=Math.imul(F,ue),n=n+Math.imul(j,de)|0,i=(i=i+Math.imul(j,le)|0)+Math.imul($,de)|0,o=o+Math.imul($,le)|0;var Ne=(u+(n=n+Math.imul(N,pe)|0)|0)+((8191&(i=(i=i+Math.imul(N,me)|0)+Math.imul(O,pe)|0))<<13)|0;u=((o=o+Math.imul(O,me)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,n=Math.imul(B,de),i=(i=Math.imul(B,le))+Math.imul(F,de)|0,o=Math.imul(F,le);var Oe=(u+(n=n+Math.imul(j,pe)|0)|0)+((8191&(i=(i=i+Math.imul(j,me)|0)+Math.imul($,pe)|0))<<13)|0;u=((o=o+Math.imul($,me)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863;var Te=(u+(n=Math.imul(B,pe))|0)+((8191&(i=(i=Math.imul(B,me))+Math.imul(F,pe)|0))<<13)|0;return u=((o=Math.imul(F,me))+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,c[0]=ge,c[1]=ye,c[2]=be,c[3]=ve,c[4]=we,c[5]=Ae,c[6]=_e,c[7]=Ee,c[8]=Se,c[9]=Pe,c[10]=xe,c[11]=ke,c[12]=Me,c[13]=Ce,c[14]=Ie,c[15]=Re,c[16]=Ne,c[17]=Oe,c[18]=Te,0!==u&&(c[19]=u,r.length++),r};function p(e,t,r){return(new g).mulp(e,t,r)}function g(e,t){this.x=e,this.y=t}Math.imul||(h=l),i.prototype.mulTo=function(e,t){var r,n=this.length+e.length;return r=10===this.length&&10===e.length?h(this,e,t):n<63?l(this,e,t):n<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,a&=67108863}r.words[o]=s,n=a,a=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,e,t):p(this,e,t),r},g.prototype.makeRBT=function(e){for(var t=new Array(e),r=i.prototype._countBits(e)-1,n=0;n>=1;return n},g.prototype.permute=function(e,t,r,n,i,o){for(var a=0;a>>=1)i++;return 1<>>=13,n[2*a+1]=8191&o,o>>>=13;for(a=2*t;a>=26,t+=i/67108864|0,t+=o>>>26,this.words[n]=67108863&o}return 0!==t&&(this.words[n]=t,this.length++),this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>i}return t}(e);if(0===t.length)return new i(1);for(var r=this,n=0;n=0);var t,n=e%26,i=(e-n)/26,o=67108863>>>26-n<<26-n;if(0!==n){var a=0;for(t=0;t>>26-n}a&&(this.words[t]=a,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var o=e%26,a=Math.min((e-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,u=0;u=0&&(0!==f||u>=i);u--){var d=0|this.words[u];this.words[u]=f<<26-o|d>>>o,f=d&s}return c&&0!==f&&(c.words[c.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(e,t,n){return r(0===this.negative),this.iushrn(e,t,n)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){r("number"==typeof e&&e>=0);var t=e%26,n=(e-t)/26,i=1<=0);var t=e%26,n=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==t&&n++,this.length=Math.min(n,this.length),0!==t){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},i.prototype.isubn=function(e){if(r("number"==typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(c/67108864|0),this.words[i+n]=67108863&o}for(;i>26,this.words[i+n]=67108863&o;if(0===s)return this.strip();for(r(-1===s),s=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},i.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),o=e,a=0|o.words[o.length-1];0!=(r=26-this._countBits(a))&&(o=o.ushln(r),n.iushln(r),a=0|o.words[o.length-1]);var s,c=n.length-o.length;if("mod"!==t){(s=new i(null)).length=c+1,s.words=new Array(s.length);for(var u=0;u=0;d--){var l=67108864*(0|n.words[o.length+d])+(0|n.words[o.length+d-1]);for(l=Math.min(l/a|0,67108863),n._ishlnsubmul(o,l,d);0!==n.negative;)l--,n.negative=0,n._ishlnsubmul(o,1,d),n.isZero()||(n.negative^=1);s&&(s.words[d]=l)}return s&&s.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},i.prototype.divmod=function(e,t,n){return r(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(o=s.div.neg()),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.iadd(e)),{div:o,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(o=s.div.neg()),{div:o,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modn(e.words[0]))}:this._wordDiv(e,t);var o,a,s},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modn=function(e){r(e<=67108863);for(var t=(1<<26)%e,n=0,i=this.length-1;i>=0;i--)n=(t*n+(0|this.words[i]))%e;return n},i.prototype.idivn=function(e){r(e<=67108863);for(var t=0,n=this.length-1;n>=0;n--){var i=(0|this.words[n])+67108864*t;this.words[n]=i/e|0,t=i%e}return this.strip()},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o=new i(1),a=new i(0),s=new i(0),c=new i(1),u=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++u;for(var f=n.clone(),d=t.clone();!t.isZero();){for(var l=0,h=1;0==(t.words[0]&h)&&l<26;++l,h<<=1);if(l>0)for(t.iushrn(l);l-- >0;)(o.isOdd()||a.isOdd())&&(o.iadd(f),a.isub(d)),o.iushrn(1),a.iushrn(1);for(var p=0,m=1;0==(n.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(n.iushrn(p);p-- >0;)(s.isOdd()||c.isOdd())&&(s.iadd(f),c.isub(d)),s.iushrn(1),c.iushrn(1);t.cmp(n)>=0?(t.isub(n),o.isub(s),a.isub(c)):(n.isub(t),s.isub(o),c.isub(a))}return{a:s,b:c,gcd:n.iushln(u)}},i.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o,a=new i(1),s=new i(0),c=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(var u=0,f=1;0==(t.words[0]&f)&&u<26;++u,f<<=1);if(u>0)for(t.iushrn(u);u-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);for(var d=0,l=1;0==(n.words[0]&l)&&d<26;++d,l<<=1);if(d>0)for(n.iushrn(d);d-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);t.cmp(n)>=0?(t.isub(n),a.isub(s)):(n.isub(t),s.isub(a))}return(o=0===t.cmpn(1)?a:s).cmpn(0)<0&&o.iadd(e),o},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return 0==(1&this.words[0])},i.prototype.isOdd=function(){return 1==(1&this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){r("number"==typeof e);var t=e%26,n=(e-t)/26,i=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this.strip(),this.length>1)t=1;else{n&&(e=-e),r(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){ni&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new E(e)},i.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var y={k256:null,p224:null,p192:null,p25519:null};function b(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){b.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){b.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function A(){b.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){b.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function E(e){if("string"==typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function S(e){E.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(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)}b.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},b.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},b.prototype.split=function(e,t){e.iushrn(this.n,0,t)},b.prototype.imulK=function(e){return e.imul(this.k)},n(v,b),v.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i>>22,o=a}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},v.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(y[e])return y[e];var t;if("k256"===e)t=new v;else if("p224"===e)t=new w;else if("p192"===e)t=new A;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new _}return y[e]=t,t},E.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},E.prototype._verify2=function(e,t){r(0==(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},E.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},E.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},E.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},E.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},E.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},E.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},E.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},E.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},E.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},E.prototype.isqr=function(e){return this.imul(e,e.clone())},E.prototype.sqr=function(e){return this.mul(e,e)},E.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2==1),3===t){var n=this.m.add(new i(1)).iushrn(2);return this.pow(e,n)}for(var o=this.m.subn(1),a=0;!o.isZero()&&0===o.andln(1);)a++,o.iushrn(1);r(!o.isZero());var s=new i(1).toRed(this),c=s.redNeg(),u=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new i(2*f*f).toRed(this);0!==this.pow(f,u).cmp(c);)f.redIAdd(c);for(var d=this.pow(f,o),l=this.pow(e,o.addn(1).iushrn(1)),h=this.pow(e,o),p=a;0!==h.cmp(s);){for(var m=h,g=0;0!==m.cmp(s);g++)m=m.redSqr();r(g=0;n--){for(var u=t.words[n],f=c-1;f>=0;f--){var d=u>>f&1;o!==r[0]&&(o=this.sqr(o)),0!==d||0!==a?(a<<=1,a|=d,(4==++s||0===n&&0===f)&&(o=this.mul(o,r[a]),s=0,a=0)):s=0}c=26}return o},E.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},E.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new S(e)},n(S,E),S.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},S.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},S.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},S.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(n).iushrn(this.shift),a=o;return o.cmp(this.m)>=0?a=o.isub(this.m):o.cmpn(0)<0&&(a=o.iadd(this.m)),a._forceRed(this)},S.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(p,c);var g=p.exports,y=b;function b(e,t){if(!e)throw new Error(t||"Assertion failed")}b.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)};var v={};!function(e){var t=v;function r(e){return 1===e.length?"0"+e:e}function n(e){for(var t="",n=0;n>8,a=255&i;o?r.push(o,a):r.push(a)}return r},t.zero2=r,t.toHex=n,t.encode=function(e,t){return"hex"===t?n(e):e}}(),function(e){var t=h,r=g,n=y,i=v;t.assert=n,t.toArray=i.toArray,t.zero2=i.zero2,t.toHex=i.toHex,t.encode=i.encode,t.getNAF=function(e,t,r){var n=new Array(Math.max(e.bitLength(),r)+1);n.fill(0);for(var i=1<(i>>1)-1?(i>>1)-c:c,o.isubn(s)):s=0,n[a]=s,o.iushrn(1)}return n},t.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n,i=0,o=0;e.cmpn(-i)>0||t.cmpn(-o)>0;){var a,s,c=e.andln(3)+i&3,u=t.andln(3)+o&3;3===c&&(c=-1),3===u&&(u=-1),a=0==(1&c)?0:3!==(n=e.andln(7)+i&7)&&5!==n||2!==u?c:-c,r[0].push(a),s=0==(1&u)?0:3!==(n=t.andln(7)+o&7)&&5!==n||2!==c?u:-u,r[1].push(s),2*i===a+1&&(i=1-i),2*o===s+1&&(o=1-o),e.iushrn(1),t.iushrn(1)}return r},t.cachedProperty=function(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},t.parseBytes=function(e){return"string"==typeof e?t.toArray(e,"hex"):e},t.intFromLE=function(e){return new r(e,"hex","le")}}();var w,A={exports:{}};function _(e){this.rand=e}if(A.exports=function(e){return w||(w=new _(null)),w.generate(e)},A.exports.Rand=_,_.prototype.generate=function(e){return this._rand(e)},_.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),r=0;r0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var N=R;function O(e,t){this.curve=e,this.type=t,this.precomputed=null}R.prototype.point=function(){throw new Error("Not implemented")},R.prototype.validate=function(){throw new Error("Not implemented")},R.prototype._fixedNafMul=function(e,t){I(e.precomputed);var r=e._getDoubles(),n=M(t,1,this._bitLength),i=(1<=o;c--)a=(a<<1)+n[c];s.push(a)}for(var u=this.jpoint(null,null,null),f=this.jpoint(null,null,null),d=i;d>0;d--){for(o=0;o=0;s--){for(var c=0;s>=0&&0===o[s];s--)c++;if(s>=0&&c++,a=a.dblp(c),s<0)break;var u=o[s];I(0!==u),a="affine"===e.type?u>0?a.mixedAdd(i[u-1>>1]):a.mixedAdd(i[-u-1>>1].neg()):u>0?a.add(i[u-1>>1]):a.add(i[-u-1>>1].neg())}return"affine"===e.type?a.toP():a},R.prototype._wnafMulAdd=function(e,t,r,n,i){var o,a,s,c=this._wnafT1,u=this._wnafT2,f=this._wnafT3,d=0;for(o=0;o=1;o-=2){var h=o-1,p=o;if(1===c[h]&&1===c[p]){var m=[t[h],null,null,t[p]];0===t[h].y.cmp(t[p].y)?(m[1]=t[h].add(t[p]),m[2]=t[h].toJ().mixedAdd(t[p].neg())):0===t[h].y.cmp(t[p].y.redNeg())?(m[1]=t[h].toJ().mixedAdd(t[p]),m[2]=t[h].add(t[p].neg())):(m[1]=t[h].toJ().mixedAdd(t[p]),m[2]=t[h].toJ().mixedAdd(t[p].neg()));var g=[-3,-1,-5,-7,0,7,5,1,3],y=C(r[h],r[p]);for(d=Math.max(y[0].length,d),f[h]=new Array(d),f[p]=new Array(d),a=0;a=0;o--){for(var _=0;o>=0;){var E=!0;for(a=0;a=0&&_++,w=w.dblp(_),o<0)break;for(a=0;a0?s=u[a][S-1>>1]:S<0&&(s=u[a][-S-1>>1].neg()),w="affine"===s.type?w.mixedAdd(s):w.add(s))}}for(o=0;o=Math.ceil((e.bitLength()+1)/t.step)},O.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i=0&&(o=t,a=r),n.negative&&(n=n.neg(),i=i.neg()),o.negative&&(o=o.neg(),a=a.neg()),[{a:n,b:i},{a:o,b:a}]},z.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],i=n.b.mul(e).divRound(this.n),o=r.b.neg().mul(e).divRound(this.n),a=i.mul(r.a),s=o.mul(n.a),c=i.mul(r.b),u=o.mul(n.b);return{k1:e.sub(a).sub(s),k2:c.add(u).neg()}},z.prototype.pointFromX=function(e,t){(e=new $(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var i=n.fromRed().isOdd();return(t&&!i||!t&&i)&&(n=n.redNeg()),this.point(e,n)},z.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},z.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o":""},L.prototype.isInfinity=function(){return this.inf},L.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},L.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),a=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)},L.prototype.getX=function(){return this.x.fromRed()},L.prototype.getY=function(){return this.y.fromRed()},L.prototype.mul=function(e){return e=new $(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)},L.prototype.mulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},L.prototype.jmulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},L.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))},L.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,n=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return t},L.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},D(q,B.BasePoint),z.prototype.jpoint=function(e,t,r){return new q(this,e,t,r)},q.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},q.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},q.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),i=e.x.redMul(r),o=this.y.redMul(t.redMul(e.z)),a=e.y.redMul(r.redMul(this.z)),s=n.redSub(i),c=o.redSub(a);if(0===s.cmpn(0))return 0!==c.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=s.redSqr(),f=u.redMul(s),d=n.redMul(u),l=c.redSqr().redIAdd(f).redISub(d).redISub(d),h=c.redMul(d.redISub(l)).redISub(o.redMul(f)),p=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(l,h,p)},q.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),i=this.y,o=e.y.redMul(t).redMul(this.z),a=r.redSub(n),s=i.redSub(o);if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=a.redSqr(),u=c.redMul(a),f=r.redMul(c),d=s.redSqr().redIAdd(u).redISub(f).redISub(f),l=s.redMul(f.redISub(d)).redISub(i.redMul(u)),h=this.z.redMul(a);return this.curve.jpoint(d,l,h)},q.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var r=this;for(t=0;t=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},q.prototype.inspect=function(){return this.isInfinity()?"":""},q.prototype.isInfinity=function(){return 0===this.z.cmpn(0)};var H=g,K=j,J=N,W=h;function G(e){J.call(this,"mont",e),this.a=new H(e.a,16).toRed(this.red),this.b=new H(e.b,16).toRed(this.red),this.i4=new H(4).toRed(this.red).redInvm(),this.two=new H(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}K(G,J);var V=G;function Z(e,t,r){J.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new H(t,16),this.z=new H(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}G.prototype.validate=function(e){var t=e.normalize().x,r=t.redSqr(),n=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t);return 0===n.redSqrt().redSqr().cmp(n)},K(Z,J.BasePoint),G.prototype.decodePoint=function(e,t){return this.point(W.toArray(e,t),1)},G.prototype.point=function(e,t){return new Z(this,e,t)},G.prototype.pointFromJSON=function(e){return Z.fromJSON(this,e)},Z.prototype.precompute=function(){},Z.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},Z.fromJSON=function(e,t){return new Z(e,t[0],t[1]||e.one)},Z.prototype.inspect=function(){return this.isInfinity()?"":""},Z.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},Z.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),r=e.redSub(t),n=e.redMul(t),i=r.redMul(t.redAdd(this.curve.a24.redMul(r)));return this.curve.point(n,i)},Z.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},Z.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=e.x.redAdd(e.z),o=e.x.redSub(e.z).redMul(r),a=i.redMul(n),s=t.z.redMul(o.redAdd(a).redSqr()),c=t.x.redMul(o.redISub(a).redSqr());return this.curve.point(s,c)},Z.prototype.mul=function(e){for(var t=e.clone(),r=this,n=this.curve.point(null,null),i=[];0!==t.cmpn(0);t.iushrn(1))i.push(t.andln(1));for(var o=i.length-1;o>=0;o--)0===i[o]?(r=r.diffAdd(n,this),n=n.dbl()):(n=r.diffAdd(n,this),r=r.dbl());return n},Z.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},Z.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},Z.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},Z.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},Z.prototype.getX=function(){return this.normalize(),this.x.fromRed()};var X=g,Q=j,Y=N,ee=h.assert;function te(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,Y.call(this,"edwards",e),this.a=new X(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new X(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new X(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),ee(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}Q(te,Y);var re=te;function ne(e,t,r,n,i){Y.BasePoint.call(this,e,"projective"),null===t&&null===r&&null===n?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new X(t,16),this.y=new X(r,16),this.z=n?new X(n,16):this.curve.one,this.t=i&&new X(i,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}te.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},te.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},te.prototype.jpoint=function(e,t,r,n){return this.point(e,t,r,n)},te.prototype.pointFromX=function(e,t){(e=new X(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=this.c2.redSub(this.a.redMul(r)),i=this.one.redSub(this.c2.redMul(this.d).redMul(r)),o=n.redMul(i.redInvm()),a=o.redSqrt();if(0!==a.redSqr().redSub(o).cmp(this.zero))throw new Error("invalid point");var s=a.fromRed().isOdd();return(t&&!s||!t&&s)&&(a=a.redNeg()),this.point(e,a)},te.prototype.pointFromY=function(e,t){(e=new X(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=r.redSub(this.c2),i=r.redMul(this.d).redMul(this.c2).redSub(this.a),o=n.redMul(i.redInvm());if(0===o.cmp(this.zero)){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var a=o.redSqrt();if(0!==a.redSqr().redSub(o).cmp(this.zero))throw new Error("invalid point");return a.fromRed().isOdd()!==t&&(a=a.redNeg()),this.point(a,e)},te.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),r=e.y.redSqr(),n=t.redMul(this.a).redAdd(r),i=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(r)));return 0===n.cmp(i)},Q(ne,Y.BasePoint),te.prototype.pointFromJSON=function(e){return ne.fromJSON(this,e)},te.prototype.point=function(e,t,r,n){return new ne(this,e,t,r,n)},ne.fromJSON=function(e,t){return new ne(e,t[0],t[1],t[2])},ne.prototype.inspect=function(){return this.isInfinity()?"":""},ne.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},ne.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(e),i=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),o=n.redAdd(t),a=o.redSub(r),s=n.redSub(t),c=i.redMul(a),u=o.redMul(s),f=i.redMul(s),d=a.redMul(o);return this.curve.point(c,u,d,f)},ne.prototype._projDbl=function(){var e,t,r,n,i,o,a=this.x.redAdd(this.y).redSqr(),s=this.x.redSqr(),c=this.y.redSqr();if(this.curve.twisted){var u=(n=this.curve._mulA(s)).redAdd(c);this.zOne?(e=a.redSub(s).redSub(c).redMul(u.redSub(this.curve.two)),t=u.redMul(n.redSub(c)),r=u.redSqr().redSub(u).redSub(u)):(i=this.z.redSqr(),o=u.redSub(i).redISub(i),e=a.redSub(s).redISub(c).redMul(o),t=u.redMul(n.redSub(c)),r=u.redMul(o))}else n=s.redAdd(c),i=this.curve._mulC(this.z).redSqr(),o=n.redSub(i).redSub(i),e=this.curve._mulC(a.redISub(n)).redMul(o),t=this.curve._mulC(n).redMul(s.redISub(c)),r=n.redMul(o);return this.curve.point(e,t,r)},ne.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},ne.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),n=this.t.redMul(this.curve.dd).redMul(e.t),i=this.z.redMul(e.z.redAdd(e.z)),o=r.redSub(t),a=i.redSub(n),s=i.redAdd(n),c=r.redAdd(t),u=o.redMul(a),f=s.redMul(c),d=o.redMul(c),l=a.redMul(s);return this.curve.point(u,f,l,d)},ne.prototype._projAdd=function(e){var t,r,n=this.z.redMul(e.z),i=n.redSqr(),o=this.x.redMul(e.x),a=this.y.redMul(e.y),s=this.curve.d.redMul(o).redMul(a),c=i.redSub(s),u=i.redAdd(s),f=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(o).redISub(a),d=n.redMul(c).redMul(f);return this.curve.twisted?(t=n.redMul(u).redMul(a.redSub(this.curve._mulA(o))),r=c.redMul(u)):(t=n.redMul(u).redMul(a.redSub(o)),r=this.curve._mulC(c).redMul(u)),this.curve.point(d,t,r)},ne.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},ne.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},ne.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},ne.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},ne.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},ne.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},ne.prototype.getX=function(){return this.normalize(),this.x.fromRed()},ne.prototype.getY=function(){return this.normalize(),this.y.fromRed()},ne.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},ne.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var r=e.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(n),0===this.x.cmp(t))return!0}},ne.prototype.toP=ne.prototype.normalize,ne.prototype.mixedAdd=ne.prototype.add,function(e){var t=e;t.base=N,t.short=U,t.mont=V,t.edwards=re}(P);var ie={},oe={},ae={},se=y,ce=j;function ue(e,t){return 55296==(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1)))}function fe(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function de(e){return 1===e.length?"0"+e:e}function le(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}ae.inherits=ce,ae.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),i=0;i>6|192,r[n++]=63&o|128):ue(e,i)?(o=65536+((1023&o)<<10)+(1023&e.charCodeAt(++i)),r[n++]=o>>18|240,r[n++]=o>>12&63|128,r[n++]=o>>6&63|128,r[n++]=63&o|128):(r[n++]=o>>12|224,r[n++]=o>>6&63|128,r[n++]=63&o|128)}else for(i=0;i>>0}return o},ae.split32=function(e,t){for(var r=new Array(4*e.length),n=0,i=0;n>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}return r},ae.rotr32=function(e,t){return e>>>t|e<<32-t},ae.rotl32=function(e,t){return e<>>32-t},ae.sum32=function(e,t){return e+t>>>0},ae.sum32_3=function(e,t,r){return e+t+r>>>0},ae.sum32_4=function(e,t,r,n){return e+t+r+n>>>0},ae.sum32_5=function(e,t,r,n,i){return e+t+r+n+i>>>0},ae.sum64=function(e,t,r,n){var i=e[t],o=n+e[t+1]>>>0,a=(o>>0,e[t+1]=o},ae.sum64_hi=function(e,t,r,n){return(t+n>>>0>>0},ae.sum64_lo=function(e,t,r,n){return t+n>>>0},ae.sum64_4_hi=function(e,t,r,n,i,o,a,s){var c=0,u=t;return c+=(u=u+n>>>0)>>0)>>0)>>0},ae.sum64_4_lo=function(e,t,r,n,i,o,a,s){return t+n+o+s>>>0},ae.sum64_5_hi=function(e,t,r,n,i,o,a,s,c,u){var f=0,d=t;return f+=(d=d+n>>>0)>>0)>>0)>>0)>>0},ae.sum64_5_lo=function(e,t,r,n,i,o,a,s,c,u){return t+n+o+s+u>>>0},ae.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},ae.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},ae.shr64_hi=function(e,t,r){return e>>>r},ae.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0};var he={},pe=ae,me=y;function ge(){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}he.BlockHash=ge,ge.prototype.update=function(e,t){if(e=pe.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=pe.join32(e,0,e.length-r,this.endian);for(var n=0;n>>24&255,n[i++]=e>>>16&255,n[i++]=e>>>8&255,n[i++]=255&e}else for(n[i++]=255&e,n[i++]=e>>>8&255,n[i++]=e>>>16&255,n[i++]=e>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;o>>3},be.g1_256=function(e){return ve(e,17)^ve(e,19)^e>>>10};var Ee=ae,Se=he,Pe=be,xe=Ee.rotl32,ke=Ee.sum32,Me=Ee.sum32_5,Ce=Pe.ft_1,Ie=Se.BlockHash,Re=[1518500249,1859775393,2400959708,3395469782];function Ne(){if(!(this instanceof Ne))return new Ne;Ie.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}Ee.inherits(Ne,Ie);var Oe=Ne;Ne.blockSize=512,Ne.outSize=160,Ne.hmacStrength=80,Ne.padLength=64,Ne.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;nthis.blockSize&&(e=(new this.Hash).update(e).digest()),Qt(e.length<=this.blockSize);for(var t=e.length;t=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}var cr=sr;sr.prototype._init=function(e,t,r){var n=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},sr.prototype.generate=function(e,t,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(n=r,r=t,t=null),r&&(r=or.toArray(r,n||"hex"),this._update(r));for(var i=[];i.length"};var hr=g,pr=h,mr=pr.assert;function gr(e,t){if(e instanceof gr)return e;this._importDER(e,t)||(mr(e.r&&e.s,"Signature without r or s"),this.r=new hr(e.r,16),this.s=new hr(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}var yr=gr;function br(){this.place=0}function vr(e,t){var r=e[t.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var i=0,o=0,a=t.place;o>>=0;return!(i<=127)&&(t.place=a,i)}function wr(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}gr.prototype._importDER=function(e,t){e=pr.toArray(e,t);var r=new br;if(48!==e[r.place++])return!1;var n=vr(e,r);if(!1===n)return!1;if(n+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var i=vr(e,r);if(!1===i)return!1;var o=e.slice(r.place,i+r.place);if(r.place+=i,2!==e[r.place++])return!1;var a=vr(e,r);if(!1===a)return!1;if(e.length!==a+r.place)return!1;var s=e.slice(r.place,a+r.place);if(0===o[0]){if(!(128&o[1]))return!1;o=o.slice(1)}if(0===s[0]){if(!(128&s[1]))return!1;s=s.slice(1)}return this.r=new hr(o),this.s=new hr(s),this.recoveryParam=null,!0},gr.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=wr(t),r=wr(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];Ar(n,t.length),(n=n.concat(t)).push(2),Ar(n,r.length);var i=n.concat(r),o=[48];return Ar(o,i.length),o=o.concat(i),pr.encode(o,e)};var _r=g,Er=cr,Sr=ie,Pr=S,xr=h.assert,kr=lr,Mr=yr;function Cr(e){if(!(this instanceof Cr))return new Cr(e);"string"==typeof e&&(xr(Object.prototype.hasOwnProperty.call(Sr,e),"Unknown curve "+e),e=Sr[e]),e instanceof Sr.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}var Ir=Cr;Cr.prototype.keyPair=function(e){return new kr(this,e)},Cr.prototype.keyFromPrivate=function(e,t){return kr.fromPrivate(this,e,t)},Cr.prototype.keyFromPublic=function(e,t){return kr.fromPublic(this,e,t)},Cr.prototype.genKeyPair=function(e){e||(e={});for(var t=new Er({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||Pr(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),n=this.n.sub(new _r(2));;){var i=new _r(t.generate(r));if(!(i.cmp(n)>0))return i.iaddn(1),this.keyFromPrivate(i)}},Cr.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},Cr.prototype.sign=function(e,t,r,n){"object"==typeof r&&(n=r,r=null),n||(n={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new _r(e,16));for(var i=this.n.byteLength(),o=t.getPrivate().toArray("be",i),a=e.toArray("be",i),s=new Er({hash:this.hash,entropy:o,nonce:a,pers:n.pers,persEnc:n.persEnc||"utf8"}),c=this.n.sub(new _r(1)),u=0;;u++){var f=n.k?n.k(u):new _r(s.generate(this.n.byteLength()));if(!((f=this._truncateToN(f,!0)).cmpn(1)<=0||f.cmp(c)>=0)){var d=this.g.mul(f);if(!d.isInfinity()){var l=d.getX(),h=l.umod(this.n);if(0!==h.cmpn(0)){var p=f.invm(this.n).mul(h.mul(t.getPrivate()).iadd(e));if(0!==(p=p.umod(this.n)).cmpn(0)){var m=(d.getY().isOdd()?1:0)|(0!==l.cmp(h)?2:0);return n.canonical&&p.cmp(this.nh)>0&&(p=this.n.sub(p),m^=1),new Mr({r:h,s:p,recoveryParam:m})}}}}}},Cr.prototype.verify=function(e,t,r,n){e=this._truncateToN(new _r(e,16)),r=this.keyFromPublic(r,n);var i=(t=new Mr(t,"hex")).r,o=t.s;if(i.cmpn(1)<0||i.cmp(this.n)>=0)return!1;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var a,s=o.invm(this.n),c=s.mul(e).umod(this.n),u=s.mul(i).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(c,r.getPublic(),u)).isInfinity()&&a.eqXToP(i):!(a=this.g.mulAdd(c,r.getPublic(),u)).isInfinity()&&0===a.getX().umod(this.n).cmp(i)},Cr.prototype.recoverPubKey=function(e,t,r,n){xr((3&r)===r,"The recovery param is more than two bits"),t=new Mr(t,n);var i=this.n,o=new _r(e),a=t.r,s=t.s,c=1&r,u=r>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&u)throw new Error("Unable to find sencond key candinate");a=u?this.curve.pointFromX(a.add(this.curve.n),c):this.curve.pointFromX(a,c);var f=t.r.invm(i),d=i.sub(o).mul(f).umod(i),l=s.mul(f).umod(i);return this.g.mulAdd(d,a,l)},Cr.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new Mr(t,n)).recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(e,t,i)}catch(e){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")};var Rr=h,Nr=Rr.assert,Or=Rr.parseBytes,Tr=Rr.cachedProperty;function jr(e,t){this.eddsa=e,this._secret=Or(t.secret),e.isPoint(t.pub)?this._pub=t.pub:this._pubBytes=Or(t.pub)}jr.fromPublic=function(e,t){return t instanceof jr?t:new jr(e,{pub:t})},jr.fromSecret=function(e,t){return t instanceof jr?t:new jr(e,{secret:t})},jr.prototype.secret=function(){return this._secret},Tr(jr,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),Tr(jr,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),Tr(jr,"privBytes",(function(){var e=this.eddsa,t=this.hash(),r=e.encodingLength-1,n=t.slice(0,e.encodingLength);return n[0]&=248,n[r]&=127,n[r]|=64,n})),Tr(jr,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),Tr(jr,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),Tr(jr,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),jr.prototype.sign=function(e){return Nr(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},jr.prototype.verify=function(e,t){return this.eddsa.verify(e,t,this)},jr.prototype.getSecret=function(e){return Nr(this._secret,"KeyPair is public only"),Rr.encode(this.secret(),e)},jr.prototype.getPublic=function(e){return Rr.encode(this.pubBytes(),e)};var $r=jr,Dr=g,Br=h,Fr=Br.assert,zr=Br.cachedProperty,Ur=Br.parseBytes;function Lr(e,t){this.eddsa=e,"object"!=typeof t&&(t=Ur(t)),Array.isArray(t)&&(t={R:t.slice(0,e.encodingLength),S:t.slice(e.encodingLength)}),Fr(t.R&&t.S,"Signature without R or S"),e.isPoint(t.R)&&(this._R=t.R),t.S instanceof Dr&&(this._S=t.S),this._Rencoded=Array.isArray(t.R)?t.R:t.Rencoded,this._Sencoded=Array.isArray(t.S)?t.S:t.Sencoded}zr(Lr,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),zr(Lr,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),zr(Lr,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),zr(Lr,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),Lr.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},Lr.prototype.toHex=function(){return Br.encode(this.toBytes(),"hex").toUpperCase()};var qr=Lr,Hr=oe,Kr=ie,Jr=h,Wr=Jr.assert,Gr=Jr.parseBytes,Vr=$r,Zr=qr;function Xr(e){if(Wr("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof Xr))return new Xr(e);e=Kr[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=Hr.sha512}var Qr=Xr;Xr.prototype.sign=function(e,t){e=Gr(e);var r=this.keyFromSecret(t),n=this.hashInt(r.messagePrefix(),e),i=this.g.mul(n),o=this.encodePoint(i),a=this.hashInt(o,r.pubBytes(),e).mul(r.priv()),s=n.add(a).umod(this.curve.n);return this.makeSignature({R:i,S:s,Rencoded:o})},Xr.prototype.verify=function(e,t,r){e=Gr(e),t=this.makeSignature(t);var n=this.keyFromPublic(r),i=this.hashInt(t.Rencoded(),n.pubBytes(),e),o=this.g.mul(t.S());return t.R().add(n.pub().mul(i)).eq(o)},Xr.prototype.hashInt=function(){for(var e=this.hash(),t=0;te instanceof CryptoKey,fn=async(e,t)=>{const r=`SHA-${e.slice(-3)}`;return new Uint8Array(await cn.subtle.digest(r,t))},dn=new TextEncoder,ln=new TextDecoder,hn=2**32;function pn(...e){const t=e.reduce(((e,{length:t})=>e+t),0),r=new Uint8Array(t);let n=0;return e.forEach((e=>{r.set(e,n),n+=e.length})),r}function mn(e,t,r){if(t<0||t>=hn)throw new RangeError(`value must be >= 0 and <= ${hn-1}. Received ${t}`);e.set([t>>>24,t>>>16,t>>>8,255&t],r)}function gn(e){const t=Math.floor(e/hn),r=e%hn,n=new Uint8Array(8);return mn(n,t,0),mn(n,r,4),n}function yn(e){const t=new Uint8Array(4);return mn(t,e),t}function bn(e){return pn(yn(e.length),e)}const vn=e=>(e=>{let t=e;"string"==typeof t&&(t=dn.encode(t));const r=[];for(let e=0;e{let t=e;t instanceof Uint8Array&&(t=ln.decode(t)),t=t.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"");try{return(e=>{const t=atob(e),r=new Uint8Array(t.length);for(let e=0;eRn(new Uint8Array(Nn(e)>>3));const Tn=(e,t)=>{if(t.length<<3!==Nn(e))throw new kn("Invalid Initialization Vector length")},jn=(e,t)=>{const r=e.byteLength<<3;if(r!==t)throw new kn(`Invalid Content Encryption Key length. Expected ${t} bits, got ${r} bits`)};function $n(){return"undefined"!=typeof WebSocketPair||"undefined"!=typeof navigator&&"Cloudflare-Workers"===navigator.userAgent||"undefined"!=typeof EdgeRuntime&&"vercel"===EdgeRuntime}function Dn(e,t="algorithm.name"){return new TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`)}function Bn(e,t){return e.name===t}function Fn(e){return parseInt(e.name.slice(4),10)}function zn(e,t){if(t.length&&!t.some((t=>e.usages.includes(t)))){let e="CryptoKey does not support this operation, its usages must include ";if(t.length>2){const r=t.pop();e+=`one of ${t.join(", ")}, or ${r}.`}else 2===t.length?e+=`one of ${t[0]} or ${t[1]}.`:e+=`${t[0]}.`;throw new TypeError(e)}}function Un(e,t,...r){switch(t){case"HS256":case"HS384":case"HS512":{if(!Bn(e.algorithm,"HMAC"))throw Dn("HMAC");const r=parseInt(t.slice(2),10);if(Fn(e.algorithm.hash)!==r)throw Dn(`SHA-${r}`,"algorithm.hash");break}case"RS256":case"RS384":case"RS512":{if(!Bn(e.algorithm,"RSASSA-PKCS1-v1_5"))throw Dn("RSASSA-PKCS1-v1_5");const r=parseInt(t.slice(2),10);if(Fn(e.algorithm.hash)!==r)throw Dn(`SHA-${r}`,"algorithm.hash");break}case"PS256":case"PS384":case"PS512":{if(!Bn(e.algorithm,"RSA-PSS"))throw Dn("RSA-PSS");const r=parseInt(t.slice(2),10);if(Fn(e.algorithm.hash)!==r)throw Dn(`SHA-${r}`,"algorithm.hash");break}case"EdDSA":if("Ed25519"!==e.algorithm.name&&"Ed448"!==e.algorithm.name){if($n()){if(Bn(e.algorithm,"NODE-ED25519"))break;throw Dn("Ed25519, Ed448, or NODE-ED25519")}throw Dn("Ed25519 or Ed448")}break;case"ES256":case"ES384":case"ES512":{if(!Bn(e.algorithm,"ECDSA"))throw Dn("ECDSA");const r=function(e){switch(e){case"ES256":return"P-256";case"ES384":return"P-384";case"ES512":return"P-521";default:throw new Error("unreachable")}}(t);if(e.algorithm.namedCurve!==r)throw Dn(r,"algorithm.namedCurve");break}default:throw new TypeError("CryptoKey does not support this operation")}zn(e,r)}function Ln(e,t,...r){switch(t){case"A128GCM":case"A192GCM":case"A256GCM":{if(!Bn(e.algorithm,"AES-GCM"))throw Dn("AES-GCM");const r=parseInt(t.slice(1,4),10);if(e.algorithm.length!==r)throw Dn(r,"algorithm.length");break}case"A128KW":case"A192KW":case"A256KW":{if(!Bn(e.algorithm,"AES-KW"))throw Dn("AES-KW");const r=parseInt(t.slice(1,4),10);if(e.algorithm.length!==r)throw Dn(r,"algorithm.length");break}case"ECDH":switch(e.algorithm.name){case"ECDH":case"X25519":case"X448":break;default:throw Dn("ECDH, X25519, or X448")}break;case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":if(!Bn(e.algorithm,"PBKDF2"))throw Dn("PBKDF2");break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":{if(!Bn(e.algorithm,"RSA-OAEP"))throw Dn("RSA-OAEP");const r=parseInt(t.slice(9),10)||1;if(Fn(e.algorithm.hash)!==r)throw Dn(`SHA-${r}`,"algorithm.hash");break}default:throw new TypeError("CryptoKey does not support this operation")}zn(e,r)}function qn(e,t,...r){if(r.length>2){const t=r.pop();e+=`one of type ${r.join(", ")}, or ${t}.`}else 2===r.length?e+=`one of type ${r[0]} or ${r[1]}.`:e+=`of type ${r[0]}.`;return null==t?e+=` Received ${t}`:"function"==typeof t&&t.name?e+=` Received function ${t.name}`:"object"==typeof t&&null!=t&&t.constructor&&t.constructor.name&&(e+=` Received an instance of ${t.constructor.name}`),e}var Hn=(e,...t)=>qn("Key must be ",e,...t);function Kn(e,t,...r){return qn(`Key for the ${e} algorithm must be `,t,...r)}var Jn=e=>un(e);const Wn=["CryptoKey"];async function Gn(e,t,r,n,i,o){if(!(t instanceof Uint8Array))throw new TypeError(Hn(t,"Uint8Array"));const a=parseInt(e.slice(1,4),10),s=await cn.subtle.importKey("raw",t.subarray(a>>3),"AES-CBC",!1,["decrypt"]),c=await cn.subtle.importKey("raw",t.subarray(0,a>>3),{hash:"SHA-"+(a<<1),name:"HMAC"},!1,["sign"]),u=pn(o,n,r,gn(o.length<<3)),f=new Uint8Array((await cn.subtle.sign("HMAC",c,u)).slice(0,a>>3));let d,l;try{d=((e,t)=>{if(!(e instanceof Uint8Array))throw new TypeError("First argument must be a buffer");if(!(t instanceof Uint8Array))throw new TypeError("Second argument must be a buffer");if(e.length!==t.length)throw new TypeError("Input buffers must have the same length");const r=e.length;let n=0,i=-1;for(;++i{if(!(un(t)||t instanceof Uint8Array))throw new TypeError(Hn(t,...Wn,"Uint8Array"));switch(Tn(e,n),e){case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return t instanceof Uint8Array&&jn(t,parseInt(e.slice(-3),10)),Gn(e,t,r,n,i,o);case"A128GCM":case"A192GCM":case"A256GCM":return t instanceof Uint8Array&&jn(t,parseInt(e.slice(1,4),10)),async function(e,t,r,n,i,o){let a;t instanceof Uint8Array?a=await cn.subtle.importKey("raw",t,"AES-GCM",!1,["decrypt"]):(Ln(t,e,"decrypt"),a=t);try{return new Uint8Array(await cn.subtle.decrypt({additionalData:o,iv:n,name:"AES-GCM",tagLength:128},a,pn(r,i)))}catch(e){throw new xn}}(e,t,r,n,i,o);default:throw new Pn("Unsupported JWE Content Encryption Algorithm")}},Zn=async()=>{throw new Pn('JWE "zip" (Compression Algorithm) Header Parameter is not supported by your javascript runtime. You need to use the `inflateRaw` decrypt option to provide Inflate Raw implementation.')},Xn=async()=>{throw new Pn('JWE "zip" (Compression Algorithm) Header Parameter is not supported by your javascript runtime. You need to use the `deflateRaw` encrypt option to provide Deflate Raw implementation.')},Qn=(...e)=>{const t=e.filter(Boolean);if(0===t.length||1===t.length)return!0;let r;for(const e of t){const t=Object.keys(e);if(r&&0!==r.size)for(const e of t){if(r.has(e))return!1;r.add(e)}else r=new Set(t)}return!0};function Yn(e){if("object"!=typeof(t=e)||null===t||"[object Object]"!==Object.prototype.toString.call(e))return!1;var t;if(null===Object.getPrototypeOf(e))return!0;let r=e;for(;null!==Object.getPrototypeOf(r);)r=Object.getPrototypeOf(r);return Object.getPrototypeOf(e)===r}const ei=[{hash:"SHA-256",name:"HMAC"},!0,["sign"]];function ti(e,t){if(e.algorithm.length!==parseInt(t.slice(1,4),10))throw new TypeError(`Invalid key size for alg: ${t}`)}function ri(e,t,r){if(un(e))return Ln(e,t,r),e;if(e instanceof Uint8Array)return cn.subtle.importKey("raw",e,"AES-KW",!0,[r]);throw new TypeError(Hn(e,...Wn,"Uint8Array"))}const ni=async(e,t,r)=>{const n=await ri(t,e,"wrapKey");ti(n,e);const i=await cn.subtle.importKey("raw",r,...ei);return new Uint8Array(await cn.subtle.wrapKey("raw",i,n,"AES-KW"))},ii=async(e,t,r)=>{const n=await ri(t,e,"unwrapKey");ti(n,e);const i=await cn.subtle.unwrapKey("raw",r,n,"AES-KW",...ei);return new Uint8Array(await cn.subtle.exportKey("raw",i))};async function oi(e,t,r,n,i=new Uint8Array(0),o=new Uint8Array(0)){if(!un(e))throw new TypeError(Hn(e,...Wn));if(Ln(e,"ECDH"),!un(t))throw new TypeError(Hn(t,...Wn));Ln(t,"ECDH","deriveBits");const a=pn(bn(dn.encode(r)),bn(i),bn(o),yn(n));let s;s="X25519"===e.algorithm.name?256:"X448"===e.algorithm.name?448:Math.ceil(parseInt(e.algorithm.namedCurve.substr(-3),10)/8)<<3;return async function(e,t,r){const n=Math.ceil((t>>3)/32),i=new Uint8Array(32*n);for(let t=0;t>3)}(new Uint8Array(await cn.subtle.deriveBits({name:e.algorithm.name,public:e},t,s)),n,a)}function ai(e){if(!un(e))throw new TypeError(Hn(e,...Wn));return["P-256","P-384","P-521"].includes(e.algorithm.namedCurve)||"X25519"===e.algorithm.name||"X448"===e.algorithm.name}async function si(e,t,r,n){!function(e){if(!(e instanceof Uint8Array)||e.length<8)throw new kn("PBES2 Salt Input must be 8 or more octets")}(e);const i=function(e,t){return pn(dn.encode(e),new Uint8Array([0]),t)}(t,e),o=parseInt(t.slice(13,16),10),a={hash:`SHA-${t.slice(8,11)}`,iterations:r,name:"PBKDF2",salt:i},s={length:o,name:"AES-KW"},c=await function(e,t){if(e instanceof Uint8Array)return cn.subtle.importKey("raw",e,"PBKDF2",!1,["deriveBits"]);if(un(e))return Ln(e,t,"deriveBits","deriveKey"),e;throw new TypeError(Hn(e,...Wn,"Uint8Array"))}(n,t);if(c.usages.includes("deriveBits"))return new Uint8Array(await cn.subtle.deriveBits(a,c,o));if(c.usages.includes("deriveKey"))return cn.subtle.deriveKey(a,c,s,!1,["wrapKey","unwrapKey"]);throw new TypeError('PBKDF2 key "usages" must include "deriveBits" or "deriveKey"')}const ci=async(e,t,r,n,i)=>{const o=await si(i,e,n,t);return ii(e.slice(-6),o,r)};function ui(e){switch(e){case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":return"RSA-OAEP";default:throw new Pn(`alg ${e} is not supported either by JOSE or your javascript runtime`)}}var fi=(e,t)=>{if(e.startsWith("RS")||e.startsWith("PS")){const{modulusLength:r}=t.algorithm;if("number"!=typeof r||r<2048)throw new TypeError(`${e} requires key modulusLength to be 2048 bits or larger`)}};const di=async(e,t,r)=>{if(!un(t))throw new TypeError(Hn(t,...Wn));if(Ln(t,e,"decrypt","unwrapKey"),fi(e,t),t.usages.includes("decrypt"))return new Uint8Array(await cn.subtle.decrypt(ui(e),t,r));if(t.usages.includes("unwrapKey")){const n=await cn.subtle.unwrapKey("raw",r,t,ui(e),...ei);return new Uint8Array(await cn.subtle.exportKey("raw",n))}throw new TypeError('RSA-OAEP key "usages" must include "decrypt" or "unwrapKey" for this operation')};function li(e){switch(e){case"A128GCM":return 128;case"A192GCM":return 192;case"A256GCM":case"A128CBC-HS256":return 256;case"A192CBC-HS384":return 384;case"A256CBC-HS512":return 512;default:throw new Pn(`Unsupported JWE Algorithm: ${e}`)}}var hi=e=>Rn(new Uint8Array(li(e)>>3));var pi=async e=>{var t,r;if(!e.alg)throw new TypeError('"alg" argument is required when "jwk.alg" is not present');const{algorithm:n,keyUsages:i}=function(e){let t,r;switch(e.kty){case"oct":switch(e.alg){case"HS256":case"HS384":case"HS512":t={name:"HMAC",hash:`SHA-${e.alg.slice(-3)}`},r=["sign","verify"];break;case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":throw new Pn(`${e.alg} keys cannot be imported as CryptoKey instances`);case"A128GCM":case"A192GCM":case"A256GCM":case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":t={name:"AES-GCM"},r=["encrypt","decrypt"];break;case"A128KW":case"A192KW":case"A256KW":t={name:"AES-KW"},r=["wrapKey","unwrapKey"];break;case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":t={name:"PBKDF2"},r=["deriveBits"];break;default:throw new Pn('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"RSA":switch(e.alg){case"PS256":case"PS384":case"PS512":t={name:"RSA-PSS",hash:`SHA-${e.alg.slice(-3)}`},r=e.d?["sign"]:["verify"];break;case"RS256":case"RS384":case"RS512":t={name:"RSASSA-PKCS1-v1_5",hash:`SHA-${e.alg.slice(-3)}`},r=e.d?["sign"]:["verify"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":t={name:"RSA-OAEP",hash:`SHA-${parseInt(e.alg.slice(-3),10)||1}`},r=e.d?["decrypt","unwrapKey"]:["encrypt","wrapKey"];break;default:throw new Pn('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"EC":switch(e.alg){case"ES256":t={name:"ECDSA",namedCurve:"P-256"},r=e.d?["sign"]:["verify"];break;case"ES384":t={name:"ECDSA",namedCurve:"P-384"},r=e.d?["sign"]:["verify"];break;case"ES512":t={name:"ECDSA",namedCurve:"P-521"},r=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":t={name:"ECDH",namedCurve:e.crv},r=e.d?["deriveBits"]:[];break;default:throw new Pn('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"OKP":switch(e.alg){case"EdDSA":t={name:e.crv},r=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":t={name:e.crv},r=e.d?["deriveBits"]:[];break;default:throw new Pn('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;default:throw new Pn('Invalid or unsupported JWK "kty" (Key Type) Parameter value')}return{algorithm:t,keyUsages:r}}(e),o=[n,null!==(t=e.ext)&&void 0!==t&&t,null!==(r=e.key_ops)&&void 0!==r?r:i];if("PBKDF2"===n.name)return cn.subtle.importKey("raw",wn(e.k),...o);const a={...e};delete a.alg,delete a.use;try{return await cn.subtle.importKey("jwk",a,...o)}catch(e){if("Ed25519"===n.name&&"NotSupportedError"===(null==e?void 0:e.name)&&$n())return o[0]={name:"NODE-ED25519",namedCurve:"NODE-ED25519"},await cn.subtle.importKey("jwk",a,...o);throw e}};async function mi(e,t,r){var n;if(!Yn(e))throw new TypeError("JWK must be an object");switch(t||(t=e.alg),e.kty){case"oct":if("string"!=typeof e.k||!e.k)throw new TypeError('missing "k" (Key Value) Parameter value');return null!=r||(r=!0!==e.ext),r?pi({...e,alg:t,ext:null!==(n=e.ext)&&void 0!==n&&n}):wn(e.k);case"RSA":if(void 0!==e.oth)throw new Pn('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');case"EC":case"OKP":return pi({...e,alg:t});default:throw new Pn('Unsupported "kty" (Key Type) Parameter value')}}const gi=(e,t,r)=>{e.startsWith("HS")||"dir"===e||e.startsWith("PBES2")||/^A\d{3}(?:GCM)?KW$/.test(e)?((e,t)=>{if(!(t instanceof Uint8Array)){if(!Jn(t))throw new TypeError(Kn(e,t,...Wn,"Uint8Array"));if("secret"!==t.type)throw new TypeError(`${Wn.join(" or ")} instances for symmetric algorithms must be of type "secret"`)}})(e,t):((e,t,r)=>{if(!Jn(t))throw new TypeError(Kn(e,t,...Wn));if("secret"===t.type)throw new TypeError(`${Wn.join(" or ")} instances for asymmetric algorithms must not be of type "secret"`);if("sign"===r&&"public"===t.type)throw new TypeError(`${Wn.join(" or ")} instances for asymmetric algorithm signing must be of type "private"`);if("decrypt"===r&&"public"===t.type)throw new TypeError(`${Wn.join(" or ")} instances for asymmetric algorithm decryption must be of type "private"`);if(t.algorithm&&"verify"===r&&"private"===t.type)throw new TypeError(`${Wn.join(" or ")} instances for asymmetric algorithm verifying must be of type "public"`);if(t.algorithm&&"encrypt"===r&&"private"===t.type)throw new TypeError(`${Wn.join(" or ")} instances for asymmetric algorithm encryption must be of type "public"`)})(e,t,r)};const yi=async(e,t,r,n,i)=>{if(!(un(r)||r instanceof Uint8Array))throw new TypeError(Hn(r,...Wn,"Uint8Array"));switch(Tn(e,n),e){case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return r instanceof Uint8Array&&jn(r,parseInt(e.slice(-3),10)),async function(e,t,r,n,i){if(!(r instanceof Uint8Array))throw new TypeError(Hn(r,"Uint8Array"));const o=parseInt(e.slice(1,4),10),a=await cn.subtle.importKey("raw",r.subarray(o>>3),"AES-CBC",!1,["encrypt"]),s=await cn.subtle.importKey("raw",r.subarray(0,o>>3),{hash:"SHA-"+(o<<1),name:"HMAC"},!1,["sign"]),c=new Uint8Array(await cn.subtle.encrypt({iv:n,name:"AES-CBC"},a,t)),u=pn(i,n,c,gn(i.length<<3));return{ciphertext:c,tag:new Uint8Array((await cn.subtle.sign("HMAC",s,u)).slice(0,o>>3))}}(e,t,r,n,i);case"A128GCM":case"A192GCM":case"A256GCM":return r instanceof Uint8Array&&jn(r,parseInt(e.slice(1,4),10)),async function(e,t,r,n,i){let o;r instanceof Uint8Array?o=await cn.subtle.importKey("raw",r,"AES-GCM",!1,["encrypt"]):(Ln(r,e,"encrypt"),o=r);const a=new Uint8Array(await cn.subtle.encrypt({additionalData:i,iv:n,name:"AES-GCM",tagLength:128},o,t)),s=a.slice(-16);return{ciphertext:a.slice(0,-16),tag:s}}(e,t,r,n,i);default:throw new Pn("Unsupported JWE Content Encryption Algorithm")}};async function bi(e,t,r,n,i){switch(gi(e,t,"decrypt"),e){case"dir":if(void 0!==r)throw new kn("Encountered unexpected JWE Encrypted Key");return t;case"ECDH-ES":if(void 0!==r)throw new kn("Encountered unexpected JWE Encrypted Key");case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{if(!Yn(n.epk))throw new kn('JOSE Header "epk" (Ephemeral Public Key) missing or invalid');if(!ai(t))throw new Pn("ECDH with the provided key is not allowed or not supported by your javascript runtime");const i=await mi(n.epk,e);let o,a;if(void 0!==n.apu){if("string"!=typeof n.apu)throw new kn('JOSE Header "apu" (Agreement PartyUInfo) invalid');o=wn(n.apu)}if(void 0!==n.apv){if("string"!=typeof n.apv)throw new kn('JOSE Header "apv" (Agreement PartyVInfo) invalid');a=wn(n.apv)}const s=await oi(i,t,"ECDH-ES"===e?n.enc:e,"ECDH-ES"===e?li(n.enc):parseInt(e.slice(-5,-2),10),o,a);if("ECDH-ES"===e)return s;if(void 0===r)throw new kn("JWE Encrypted Key missing");return ii(e.slice(-6),s,r)}case"RSA1_5":case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":if(void 0===r)throw new kn("JWE Encrypted Key missing");return di(e,t,r);case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":{if(void 0===r)throw new kn("JWE Encrypted Key missing");if("number"!=typeof n.p2c)throw new kn('JOSE Header "p2c" (PBES2 Count) missing or invalid');const o=(null==i?void 0:i.maxPBES2Count)||1e4;if(n.p2c>o)throw new kn('JOSE Header "p2c" (PBES2 Count) out is of acceptable bounds');if("string"!=typeof n.p2s)throw new kn('JOSE Header "p2s" (PBES2 Salt) missing or invalid');return ci(e,t,r,n.p2c,wn(n.p2s))}case"A128KW":case"A192KW":case"A256KW":if(void 0===r)throw new kn("JWE Encrypted Key missing");return ii(e,t,r);case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":if(void 0===r)throw new kn("JWE Encrypted Key missing");if("string"!=typeof n.iv)throw new kn('JOSE Header "iv" (Initialization Vector) missing or invalid');if("string"!=typeof n.tag)throw new kn('JOSE Header "tag" (Authentication Tag) missing or invalid');return async function(e,t,r,n,i){const o=e.slice(0,7);return Vn(o,t,r,n,i,new Uint8Array(0))}(e,t,r,wn(n.iv),wn(n.tag));default:throw new Pn('Invalid or unsupported "alg" (JWE Algorithm) header value')}}function vi(e,t,r,n,i){if(void 0!==i.crit&&void 0===n.crit)throw new e('"crit" (Critical) Header Parameter MUST be integrity protected');if(!n||void 0===n.crit)return new Set;if(!Array.isArray(n.crit)||0===n.crit.length||n.crit.some((e=>"string"!=typeof e||0===e.length)))throw new e('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');let o;o=void 0!==r?new Map([...Object.entries(r),...t.entries()]):t;for(const t of n.crit){if(!o.has(t))throw new Pn(`Extension Header Parameter "${t}" is not recognized`);if(void 0===i[t])throw new e(`Extension Header Parameter "${t}" is missing`);if(o.get(t)&&void 0===n[t])throw new e(`Extension Header Parameter "${t}" MUST be integrity protected`)}return new Set(n.crit)}const wi=(e,t)=>{if(void 0!==t&&(!Array.isArray(t)||t.some((e=>"string"!=typeof e))))throw new TypeError(`"${e}" option must be an array of strings`);if(t)return new Set(t)};async function Ai(e,t,r){if(e instanceof Uint8Array&&(e=ln.decode(e)),"string"!=typeof e)throw new kn("Compact JWE must be a string or Uint8Array");const{0:n,1:i,2:o,3:a,4:s,length:c}=e.split(".");if(5!==c)throw new kn("Invalid Compact JWE");const u=await async function(e,t,r){var n;if(!Yn(e))throw new kn("Flattened JWE must be an object");if(void 0===e.protected&&void 0===e.header&&void 0===e.unprotected)throw new kn("JOSE Header missing");if("string"!=typeof e.iv)throw new kn("JWE Initialization Vector missing or incorrect type");if("string"!=typeof e.ciphertext)throw new kn("JWE Ciphertext missing or incorrect type");if("string"!=typeof e.tag)throw new kn("JWE Authentication Tag missing or incorrect type");if(void 0!==e.protected&&"string"!=typeof e.protected)throw new kn("JWE Protected Header incorrect type");if(void 0!==e.encrypted_key&&"string"!=typeof e.encrypted_key)throw new kn("JWE Encrypted Key incorrect type");if(void 0!==e.aad&&"string"!=typeof e.aad)throw new kn("JWE AAD incorrect type");if(void 0!==e.header&&!Yn(e.header))throw new kn("JWE Shared Unprotected Header incorrect type");if(void 0!==e.unprotected&&!Yn(e.unprotected))throw new kn("JWE Per-Recipient Unprotected Header incorrect type");let i;if(e.protected)try{const t=wn(e.protected);i=JSON.parse(ln.decode(t))}catch(e){throw new kn("JWE Protected Header is invalid")}if(!Qn(i,e.header,e.unprotected))throw new kn("JWE Protected, JWE Unprotected Header, and JWE Per-Recipient Unprotected Header Parameter names must be disjoint");const o={...i,...e.header,...e.unprotected};if(vi(kn,new Map,null==r?void 0:r.crit,i,o),void 0!==o.zip){if(!i||!i.zip)throw new kn('JWE "zip" (Compression Algorithm) Header MUST be integrity protected');if("DEF"!==o.zip)throw new Pn('Unsupported JWE "zip" (Compression Algorithm) Header Parameter value')}const{alg:a,enc:s}=o;if("string"!=typeof a||!a)throw new kn("missing JWE Algorithm (alg) in JWE Header");if("string"!=typeof s||!s)throw new kn("missing JWE Encryption Algorithm (enc) in JWE Header");const c=r&&wi("keyManagementAlgorithms",r.keyManagementAlgorithms),u=r&&wi("contentEncryptionAlgorithms",r.contentEncryptionAlgorithms);if(c&&!c.has(a))throw new Sn('"alg" (Algorithm) Header Parameter not allowed');if(u&&!u.has(s))throw new Sn('"enc" (Encryption Algorithm) Header Parameter not allowed');let f;void 0!==e.encrypted_key&&(f=wn(e.encrypted_key));let d,l=!1;"function"==typeof t&&(t=await t(i,e),l=!0);try{d=await bi(a,t,f,o,r)}catch(e){if(e instanceof TypeError||e instanceof kn||e instanceof Pn)throw e;d=hi(s)}const h=wn(e.iv),p=wn(e.tag),m=dn.encode(null!==(n=e.protected)&&void 0!==n?n:"");let g;g=void 0!==e.aad?pn(m,dn.encode("."),dn.encode(e.aad)):m;let y=await Vn(s,d,wn(e.ciphertext),h,p,g);"DEF"===o.zip&&(y=await((null==r?void 0:r.inflateRaw)||Zn)(y));const b={plaintext:y};return void 0!==e.protected&&(b.protectedHeader=i),void 0!==e.aad&&(b.additionalAuthenticatedData=wn(e.aad)),void 0!==e.unprotected&&(b.sharedUnprotectedHeader=e.unprotected),void 0!==e.header&&(b.unprotectedHeader=e.header),l?{...b,key:t}:b}({ciphertext:a,iv:o||void 0,protected:n||void 0,tag:s||void 0,encrypted_key:i||void 0},t,r),f={plaintext:u.plaintext,protectedHeader:u.protectedHeader};return"function"==typeof t?{...f,key:u.key}:f}var _i=async e=>{if(e instanceof Uint8Array)return{kty:"oct",k:vn(e)};if(!un(e))throw new TypeError(Hn(e,...Wn,"Uint8Array"));if(!e.extractable)throw new TypeError("non-extractable CryptoKey cannot be exported as a JWK");const{ext:t,key_ops:r,alg:n,use:i,...o}=await cn.subtle.exportKey("jwk",e);return o};async function Ei(e){return _i(e)}async function Si(e,t,r,n,i={}){let o,a,s;switch(gi(e,r,"encrypt"),e){case"dir":s=r;break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{if(!ai(r))throw new Pn("ECDH with the provided key is not allowed or not supported by your javascript runtime");const{apu:c,apv:u}=i;let{epk:f}=i;f||(f=(await async function(e){if(!un(e))throw new TypeError(Hn(e,...Wn));return cn.subtle.generateKey(e.algorithm,!0,["deriveBits"])}(r)).privateKey);const{x:d,y:l,crv:h,kty:p}=await Ei(f),m=await oi(r,f,"ECDH-ES"===e?t:e,"ECDH-ES"===e?li(t):parseInt(e.slice(-5,-2),10),c,u);if(a={epk:{x:d,crv:h,kty:p}},"EC"===p&&(a.epk.y=l),c&&(a.apu=vn(c)),u&&(a.apv=vn(u)),"ECDH-ES"===e){s=m;break}s=n||hi(t);const g=e.slice(-6);o=await ni(g,m,s);break}case"RSA1_5":case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":s=n||hi(t),o=await(async(e,t,r)=>{if(!un(t))throw new TypeError(Hn(t,...Wn));if(Ln(t,e,"encrypt","wrapKey"),fi(e,t),t.usages.includes("encrypt"))return new Uint8Array(await cn.subtle.encrypt(ui(e),t,r));if(t.usages.includes("wrapKey")){const n=await cn.subtle.importKey("raw",r,...ei);return new Uint8Array(await cn.subtle.wrapKey("raw",n,t,ui(e)))}throw new TypeError('RSA-OAEP key "usages" must include "encrypt" or "wrapKey" for this operation')})(e,r,s);break;case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":{s=n||hi(t);const{p2c:c,p2s:u}=i;({encryptedKey:o,...a}=await(async(e,t,r,n=2048,i=Rn(new Uint8Array(16)))=>{const o=await si(i,e,n,t);return{encryptedKey:await ni(e.slice(-6),o,r),p2c:n,p2s:vn(i)}})(e,r,s,c,u));break}case"A128KW":case"A192KW":case"A256KW":s=n||hi(t),o=await ni(e,r,s);break;case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":{s=n||hi(t);const{iv:c}=i;({encryptedKey:o,...a}=await async function(e,t,r,n){const i=e.slice(0,7);n||(n=On(i));const{ciphertext:o,tag:a}=await yi(i,r,t,n,new Uint8Array(0));return{encryptedKey:o,iv:vn(n),tag:vn(a)}}(e,r,s,c));break}default:throw new Pn('Invalid or unsupported "alg" (JWE Algorithm) header value')}return{cek:s,encryptedKey:o,parameters:a}}const Pi=Symbol();class xi{constructor(e){if(!(e instanceof Uint8Array))throw new TypeError("plaintext must be an instance of Uint8Array");this._plaintext=e}setKeyManagementParameters(e){if(this._keyManagementParameters)throw new TypeError("setKeyManagementParameters can only be called once");return this._keyManagementParameters=e,this}setProtectedHeader(e){if(this._protectedHeader)throw new TypeError("setProtectedHeader can only be called once");return this._protectedHeader=e,this}setSharedUnprotectedHeader(e){if(this._sharedUnprotectedHeader)throw new TypeError("setSharedUnprotectedHeader can only be called once");return this._sharedUnprotectedHeader=e,this}setUnprotectedHeader(e){if(this._unprotectedHeader)throw new TypeError("setUnprotectedHeader can only be called once");return this._unprotectedHeader=e,this}setAdditionalAuthenticatedData(e){return this._aad=e,this}setContentEncryptionKey(e){if(this._cek)throw new TypeError("setContentEncryptionKey can only be called once");return this._cek=e,this}setInitializationVector(e){if(this._iv)throw new TypeError("setInitializationVector can only be called once");return this._iv=e,this}async encrypt(e,t){if(!this._protectedHeader&&!this._unprotectedHeader&&!this._sharedUnprotectedHeader)throw new kn("either setProtectedHeader, setUnprotectedHeader, or sharedUnprotectedHeader must be called before #encrypt()");if(!Qn(this._protectedHeader,this._unprotectedHeader,this._sharedUnprotectedHeader))throw new kn("JWE Protected, JWE Shared Unprotected and JWE Per-Recipient Header Parameter names must be disjoint");const r={...this._protectedHeader,...this._unprotectedHeader,...this._sharedUnprotectedHeader};if(vi(kn,new Map,null==t?void 0:t.crit,this._protectedHeader,r),void 0!==r.zip){if(!this._protectedHeader||!this._protectedHeader.zip)throw new kn('JWE "zip" (Compression Algorithm) Header MUST be integrity protected');if("DEF"!==r.zip)throw new Pn('Unsupported JWE "zip" (Compression Algorithm) Header Parameter value')}const{alg:n,enc:i}=r;if("string"!=typeof n||!n)throw new kn('JWE "alg" (Algorithm) Header Parameter missing or invalid');if("string"!=typeof i||!i)throw new kn('JWE "enc" (Encryption Algorithm) Header Parameter missing or invalid');let o,a,s,c,u,f,d;if("dir"===n){if(this._cek)throw new TypeError("setContentEncryptionKey cannot be called when using Direct Encryption")}else if("ECDH-ES"===n&&this._cek)throw new TypeError("setContentEncryptionKey cannot be called when using Direct Key Agreement");{let r;({cek:a,encryptedKey:o,parameters:r}=await Si(n,i,e,this._cek,this._keyManagementParameters)),r&&(t&&Pi in t?this._unprotectedHeader?this._unprotectedHeader={...this._unprotectedHeader,...r}:this.setUnprotectedHeader(r):this._protectedHeader?this._protectedHeader={...this._protectedHeader,...r}:this.setProtectedHeader(r))}if(this._iv||(this._iv=On(i)),c=this._protectedHeader?dn.encode(vn(JSON.stringify(this._protectedHeader))):dn.encode(""),this._aad?(u=vn(this._aad),s=pn(c,dn.encode("."),dn.encode(u))):s=c,"DEF"===r.zip){const e=await((null==t?void 0:t.deflateRaw)||Xn)(this._plaintext);({ciphertext:f,tag:d}=await yi(i,e,a,this._iv,s))}else({ciphertext:f,tag:d}=await yi(i,this._plaintext,a,this._iv,s));const l={ciphertext:vn(f),iv:vn(this._iv),tag:vn(d)};return o&&(l.encrypted_key=vn(o)),u&&(l.aad=u),this._protectedHeader&&(l.protected=ln.decode(c)),this._sharedUnprotectedHeader&&(l.unprotected=this._sharedUnprotectedHeader),this._unprotectedHeader&&(l.header=this._unprotectedHeader),l}}function ki(e,t){const r=`SHA-${e.slice(-3)}`;switch(e){case"HS256":case"HS384":case"HS512":return{hash:r,name:"HMAC"};case"PS256":case"PS384":case"PS512":return{hash:r,name:"RSA-PSS",saltLength:e.slice(-3)>>3};case"RS256":case"RS384":case"RS512":return{hash:r,name:"RSASSA-PKCS1-v1_5"};case"ES256":case"ES384":case"ES512":return{hash:r,name:"ECDSA",namedCurve:t.namedCurve};case"EdDSA":return $n()&&"NODE-ED25519"===t.name?{name:"NODE-ED25519",namedCurve:"NODE-ED25519"}:{name:t.name};default:throw new Pn(`alg ${e} is not supported either by JOSE or your javascript runtime`)}}function Mi(e,t,r){if(un(t))return Un(t,e,r),t;if(t instanceof Uint8Array){if(!e.startsWith("HS"))throw new TypeError(Hn(t,...Wn));return cn.subtle.importKey("raw",t,{hash:`SHA-${e.slice(-3)}`,name:"HMAC"},!1,[r])}throw new TypeError(Hn(t,...Wn,"Uint8Array"))}const Ci=async(e,t,r,n)=>{const i=await Mi(e,t,"verify");fi(e,i);const o=ki(e,i.algorithm);try{return await cn.subtle.verify(o,i,r,n)}catch(e){return!1}};async function Ii(e,t,r){var n;if(!Yn(e))throw new Mn("Flattened JWS must be an object");if(void 0===e.protected&&void 0===e.header)throw new Mn('Flattened JWS must have either of the "protected" or "header" members');if(void 0!==e.protected&&"string"!=typeof e.protected)throw new Mn("JWS Protected Header incorrect type");if(void 0===e.payload)throw new Mn("JWS Payload missing");if("string"!=typeof e.signature)throw new Mn("JWS Signature missing or incorrect type");if(void 0!==e.header&&!Yn(e.header))throw new Mn("JWS Unprotected Header incorrect type");let i={};if(e.protected)try{const t=wn(e.protected);i=JSON.parse(ln.decode(t))}catch(e){throw new Mn("JWS Protected Header is invalid")}if(!Qn(i,e.header))throw new Mn("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");const o={...i,...e.header};let a=!0;if(vi(Mn,new Map([["b64",!0]]),null==r?void 0:r.crit,i,o).has("b64")&&(a=i.b64,"boolean"!=typeof a))throw new Mn('The "b64" (base64url-encode payload) Header Parameter must be a boolean');const{alg:s}=o;if("string"!=typeof s||!s)throw new Mn('JWS "alg" (Algorithm) Header Parameter missing or invalid');const c=r&&wi("algorithms",r.algorithms);if(c&&!c.has(s))throw new Sn('"alg" (Algorithm) Header Parameter not allowed');if(a){if("string"!=typeof e.payload)throw new Mn("JWS Payload must be a string")}else if("string"!=typeof e.payload&&!(e.payload instanceof Uint8Array))throw new Mn("JWS Payload must be a string or an Uint8Array instance");let u=!1;"function"==typeof t&&(t=await t(i,e),u=!0),gi(s,t,"verify");const f=pn(dn.encode(null!==(n=e.protected)&&void 0!==n?n:""),dn.encode("."),"string"==typeof e.payload?dn.encode(e.payload):e.payload),d=wn(e.signature);if(!await Ci(s,t,d,f))throw new In;let l;l=a?wn(e.payload):"string"==typeof e.payload?dn.encode(e.payload):e.payload;const h={payload:l};return void 0!==e.protected&&(h.protectedHeader=i),void 0!==e.header&&(h.unprotectedHeader=e.header),u?{...h,key:t}:h}var Ri=e=>Math.floor(e.getTime()/1e3);const Ni=86400,Oi=/^(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)$/i;var Ti=e=>{const t=Oi.exec(e);if(!t)throw new TypeError("Invalid time period format");const r=parseFloat(t[1]);switch(t[2].toLowerCase()){case"sec":case"secs":case"second":case"seconds":case"s":return Math.round(r);case"minute":case"minutes":case"min":case"mins":case"m":return Math.round(60*r);case"hour":case"hours":case"hr":case"hrs":case"h":return Math.round(3600*r);case"day":case"days":case"d":return Math.round(r*Ni);case"week":case"weeks":case"w":return Math.round(604800*r);default:return Math.round(31557600*r)}};const ji=e=>e.toLowerCase().replace(/^application\//,"");var $i=(e,t,r={})=>{const{typ:n}=r;if(n&&("string"!=typeof e.typ||ji(e.typ)!==ji(n)))throw new _n('unexpected "typ" JWT header value',"typ","check_failed");let i;try{i=JSON.parse(ln.decode(t))}catch(e){}if(!Yn(i))throw new Cn("JWT Claims Set must be a top-level JSON object");const{issuer:o}=r;if(o&&!(Array.isArray(o)?o:[o]).includes(i.iss))throw new _n('unexpected "iss" claim value',"iss","check_failed");const{subject:a}=r;if(a&&i.sub!==a)throw new _n('unexpected "sub" claim value',"sub","check_failed");const{audience:s}=r;if(s&&(c=i.aud,u="string"==typeof s?[s]:s,!("string"==typeof c?u.includes(c):Array.isArray(c)&&u.some(Set.prototype.has.bind(new Set(c))))))throw new _n('unexpected "aud" claim value',"aud","check_failed");var c,u;let f;switch(typeof r.clockTolerance){case"string":f=Ti(r.clockTolerance);break;case"number":f=r.clockTolerance;break;case"undefined":f=0;break;default:throw new TypeError("Invalid clockTolerance option type")}const{currentDate:d}=r,l=Ri(d||new Date);if((void 0!==i.iat||r.maxTokenAge)&&"number"!=typeof i.iat)throw new _n('"iat" claim must be a number',"iat","invalid");if(void 0!==i.nbf){if("number"!=typeof i.nbf)throw new _n('"nbf" claim must be a number',"nbf","invalid");if(i.nbf>l+f)throw new _n('"nbf" claim timestamp check failed',"nbf","check_failed")}if(void 0!==i.exp){if("number"!=typeof i.exp)throw new _n('"exp" claim must be a number',"exp","invalid");if(i.exp<=l-f)throw new En('"exp" claim timestamp check failed',"exp","check_failed")}if(r.maxTokenAge){const e=l-i.iat;if(e-f>("number"==typeof r.maxTokenAge?r.maxTokenAge:Ti(r.maxTokenAge)))throw new En('"iat" claim timestamp check failed (too far in the past)',"iat","check_failed");if(e<0-f)throw new _n('"iat" claim timestamp check failed (it should be in the past)',"iat","check_failed")}return i};async function Di(e,t,r){var n;const i=await async function(e,t,r){if(e instanceof Uint8Array&&(e=ln.decode(e)),"string"!=typeof e)throw new Mn("Compact JWS must be a string or Uint8Array");const{0:n,1:i,2:o,length:a}=e.split(".");if(3!==a)throw new Mn("Invalid Compact JWS");const s=await Ii({payload:i,protected:n,signature:o},t,r),c={payload:s.payload,protectedHeader:s.protectedHeader};return"function"==typeof t?{...c,key:s.key}:c}(e,t,r);if((null===(n=i.protectedHeader.crit)||void 0===n?void 0:n.includes("b64"))&&!1===i.protectedHeader.b64)throw new Cn("JWTs MUST NOT use unencoded payload");const o={payload:$i(i.protectedHeader,i.payload,r),protectedHeader:i.protectedHeader};return"function"==typeof t?{...o,key:i.key}:o}class Bi{constructor(e){this._flattened=new xi(e)}setContentEncryptionKey(e){return this._flattened.setContentEncryptionKey(e),this}setInitializationVector(e){return this._flattened.setInitializationVector(e),this}setProtectedHeader(e){return this._flattened.setProtectedHeader(e),this}setKeyManagementParameters(e){return this._flattened.setKeyManagementParameters(e),this}async encrypt(e,t){const r=await this._flattened.encrypt(e,t);return[r.protected,r.encrypted_key,r.iv,r.ciphertext,r.tag].join(".")}}class Fi{constructor(e){if(!(e instanceof Uint8Array))throw new TypeError("payload must be an instance of Uint8Array");this._payload=e}setProtectedHeader(e){if(this._protectedHeader)throw new TypeError("setProtectedHeader can only be called once");return this._protectedHeader=e,this}setUnprotectedHeader(e){if(this._unprotectedHeader)throw new TypeError("setUnprotectedHeader can only be called once");return this._unprotectedHeader=e,this}async sign(e,t){if(!this._protectedHeader&&!this._unprotectedHeader)throw new Mn("either setProtectedHeader or setUnprotectedHeader must be called before #sign()");if(!Qn(this._protectedHeader,this._unprotectedHeader))throw new Mn("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");const r={...this._protectedHeader,...this._unprotectedHeader};let n=!0;if(vi(Mn,new Map([["b64",!0]]),null==t?void 0:t.crit,this._protectedHeader,r).has("b64")&&(n=this._protectedHeader.b64,"boolean"!=typeof n))throw new Mn('The "b64" (base64url-encode payload) Header Parameter must be a boolean');const{alg:i}=r;if("string"!=typeof i||!i)throw new Mn('JWS "alg" (Algorithm) Header Parameter missing or invalid');gi(i,e,"sign");let o,a=this._payload;n&&(a=dn.encode(vn(a))),o=this._protectedHeader?dn.encode(vn(JSON.stringify(this._protectedHeader))):dn.encode("");const s=pn(o,dn.encode("."),a),c=await(async(e,t,r)=>{const n=await Mi(e,t,"sign");fi(e,n);const i=await cn.subtle.sign(ki(e,n.algorithm),n,r);return new Uint8Array(i)})(i,e,s),u={signature:vn(c),payload:""};return n&&(u.payload=ln.decode(a)),this._unprotectedHeader&&(u.header=this._unprotectedHeader),this._protectedHeader&&(u.protected=ln.decode(o)),u}}class zi{constructor(e){this._flattened=new Fi(e)}setProtectedHeader(e){return this._flattened.setProtectedHeader(e),this}async sign(e,t){const r=await this._flattened.sign(e,t);if(void 0===r.payload)throw new TypeError("use the flattened module for creating JWS with b64: false");return`${r.protected}.${r.payload}.${r.signature}`}}class Ui{constructor(e,t,r){this.parent=e,this.key=t,this.options=r}setProtectedHeader(e){if(this.protectedHeader)throw new TypeError("setProtectedHeader can only be called once");return this.protectedHeader=e,this}setUnprotectedHeader(e){if(this.unprotectedHeader)throw new TypeError("setUnprotectedHeader can only be called once");return this.unprotectedHeader=e,this}addSignature(...e){return this.parent.addSignature(...e)}sign(...e){return this.parent.sign(...e)}done(){return this.parent}}class Li{constructor(e){this._signatures=[],this._payload=e}addSignature(e,t){const r=new Ui(this,e,t);return this._signatures.push(r),r}async sign(){if(!this._signatures.length)throw new Mn("at least one signature must be added");const e={signatures:[],payload:""};for(let t=0;t>3));case"A128KW":case"A192KW":case"A256KW":n=parseInt(e.slice(1,4),10),i={name:"AES-KW",length:n},o=["wrapKey","unwrapKey"];break;case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":case"A128GCM":case"A192GCM":case"A256GCM":n=parseInt(e.slice(1,4),10),i={name:"AES-GCM",length:n},o=["encrypt","decrypt"];break;default:throw new Pn('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}return cn.subtle.generateKey(i,null!==(r=null==t?void 0:t.extractable)&&void 0!==r&&r,o)}(e,t)}async function Wi(e,t){const r=void 0===t?e.alg:t,n=rn.concat(tn).concat(nn);if(!n.includes(r))throw new on("invalid alg. Must be one of: "+n.join(","),["invalid algorithm"]);try{const r=await mi(e,t);if(null==r)throw new on(new Error("failed importing keys"),["invalid key"]);return r}catch(e){throw new on(e,["invalid key"])}}async function Gi(e,t,r){let n,i;const o={...t};if(rn.includes(t.alg))n="dir",i=void 0!==r?r:t.alg;else{if(!tn.concat(nn).includes(t.alg))throw new on(`Not a valid symmetric or assymetric alg: ${t.alg}`,["encryption failed","invalid key","invalid algorithm"]);if(void 0===r)throw new on("An encryption algorith encAlg for content encryption should be provided. Allowed values are: "+rn.join(","),["encryption failed"]);i=r,n="ECDH-ES",o.alg=n}const a=await Wi(o);let s;try{return s=await new Bi(e).setProtectedHeader({alg:n,enc:i,kid:t.kid}).encrypt(a),s}catch(e){throw new on(e,["encryption failed"])}}async function Vi(e,t){try{const r={...t},{alg:n,enc:i}=function(e){let t;if("string"==typeof e){const r=e.split(".");3!==r.length&&5!==r.length||([t]=r)}else if("object"==typeof e&&e){if(!("protected"in e))throw new TypeError("Token does not contain a Protected Header");t=e.protected}try{if("string"!=typeof t||!t)throw new Error;const e=JSON.parse(ln.decode(Ki(t)));if(!Yn(e))throw new Error;return e}catch(e){throw new TypeError("Invalid Token or Protected Header formatting")}}(e);if(void 0===n||void 0===i)throw new on("missing enc or alg in jwe header",["invalid format"]);"ECDH-ES"===n&&(r.alg=n);const o=await Wi(r);return await Ai(e,o,{contentEncryptionAlgorithms:[i]})}catch(e){throw new on(e,["decryption failed"])}}async function Zi(e,t){const r=e.match(/^([a-zA-Z0-9_-]+)\.{1,2}([a-zA-Z0-9_-]+)\.([a-zA-Z0-9_-]+)$/);if(null===r)throw new on(new Error(`${e} is not a JWS`),["not a compact jws"]);let i,o;try{i=JSON.parse(n(r[1],!0)),o=JSON.parse(n(r[2],!0))}catch(e){throw new on(e,["invalid format","not a compact jws"])}if(void 0!==t){const r="function"==typeof t?await t(i,o):t,n=await Wi(r);try{const t=await Di(e,n);return{header:t.protectedHeader,payload:t.payload,signer:r}}catch(e){throw new on(e,["jws verification failed"])}}return{header:i,payload:o}}function Xi(e){if(rn.concat(en).concat(tn).includes(e))return Number(e.match(/\d{3}/)[0])/8;throw new on("unsupported algorithm",["invalid algorithm"])}async function Qi(e,t,r){let s;if(!rn.includes(e))throw new on(new Error(`Invalid encAlg '${e}'. Supported values are: ${rn.toString()}`),["invalid algorithm"]);const c=Xi(e);if(void 0!==t){if("string"==typeof t)if(!0===r)s=n(t);else{const e=i(t,!1);if(e!==i(t,!1,c))throw new on(new RangeError(`Expected hex length ${2*c} does not meet provided one ${e.length/2}`),["invalid key"]);s=new Uint8Array(a(t))}else s=t;if(s.length!==c)throw new on(new RangeError(`Expected secret length ${c} does not meet provided one ${s.length}`),["invalid key"])}else try{s=await Ji(e,{extractable:!0})}catch(e){throw new on(e,["unexpected error"])}const u=await Ei(s);return u.alg=e,{jwk:u,hex:o(n(u.k),!1,c)}}async function Yi(e,t){if(void 0===e.alg||void 0===t.alg||e.alg!==t.alg)throw new Error("alg no present in either pubJwk or privJwk, or pubJWK.alg != privJWK.alg");const r=await Wi(e),n=await Wi(t);try{const e=await s(16),i=await new Li(e).addSignature(n).setProtectedHeader({alg:t.alg}).sign();await async function(e,t,r){if(!Yn(e))throw new Mn("General JWS must be an object");if(!Array.isArray(e.signatures)||!e.signatures.every(Yn))throw new Mn("JWS Signatures missing or incorrect type");for(const n of e.signatures)try{return await Ii({header:n.header,payload:e.payload,protected:n.protected,signature:n.signature},t,r)}catch(e){}throw new In}(i,r)}catch(e){throw new on(e,["unexpected error"])}}function eo(e){return null!=e&&"object"==typeof e&&!Array.isArray(e)}function to(e){return eo(e)||Array.isArray(e)?Array.isArray(e)?e.map((e=>Array.isArray(e)||eo(e)?to(e):e)):Object.keys(e).sort().map((t=>[t,to(e[t])])):e}function ro(e){return JSON.stringify(to(e))}function no(e,t,r,n=2e3){if(er+n)throw new on(new Error(`timestamp ${new Date(e).toTimeString()} after 'notAfter' ${new Date(r).toTimeString()} with tolerance of ${n/1e3}s`),["invalid timestamp"])}function io(e){return Array.isArray(e)?e.sort().map(io):(t=e,"[object Object]"===Object.prototype.toString.call(t)?Object.keys(e).sort().reduce((function(t,r){return t[r]=io(e[r]),t}),{}):e);var t}function oo(e,t=!1,r){try{return i(e,t,r)}catch(e){throw new on(e,["invalid format"])}}async function ao(e,t){try{await Wi(e,e.alg);const r=io(e);return t?JSON.stringify(r):r}catch(e){throw new on(e,["invalid key"])}}async function so(e,t){const r=en;if(!r.includes(t))throw new on(new RangeError(`Valid hash algorith values are any of ${JSON.stringify(r)}`),["invalid algorithm"]);const n=new TextEncoder,i="string"==typeof e?n.encode(e).buffer:e;try{let e;return e=new Uint8Array(await crypto.subtle.digest(t,i)),e}catch(e){throw new on(e,["unexpected error"])}}var co={exports:{}};!function(e,t){function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function n(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function i(e,t,r){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var o;"object"==typeof e?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:m.Buffer}catch(e){}function a(e,t){var n=e.charCodeAt(t);return n>=48&&n<=57?n-48:n>=65&&n<=70?n-55:n>=97&&n<=102?n-87:void r(!1,"Invalid character in "+e)}function s(e,t,r){var n=a(e,r);return r-1>=t&&(n|=a(e,r-1)<<4),n}function c(e,t,n,i){for(var o=0,a=0,s=Math.min(e.length,n),c=t;c=49?u-49+10:u>=17?u-17+10:u,r(u>=0&&a0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,n){if("number"==typeof e)return this._initNumber(e,t,n);if("object"==typeof e)return this._initArray(e,t,n);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)a=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===n)for(i=0,o=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this._strip()},i.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n=t;n-=2)i=s(e,t,n)<=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(n=(e.length-t)%2==0?t+1:t;n=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this._strip()},i.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,a=o%n,s=Math.min(o,o-a)+r,u=0,f=r;f1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=f}catch(e){i.prototype.inspect=f}else i.prototype.inspect=f;function f(){return(this.red?""}var d=["","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"],l=[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,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],a=i*o,s=67108863&a,c=a/67108864|0;r.words[0]=s;for(var u=1;u>>26,d=67108863&c,l=Math.min(u,t.length-1),h=Math.max(0,u-e.length+1);h<=l;h++){var p=u-h|0;f+=(a=(i=0|e.words[p])*(o=0|t.words[h])+d)/67108864|0,d=67108863&a}r.words[u]=0|d,c=0|f}return 0!==c?r.words[u]=0|c:r.length--,r._strip()}i.prototype.toString=function(e,t){var n;if(t=0|t||1,16===(e=e||10)||"hex"===e){n="";for(var i=0,o=0,a=0;a>>24-i&16777215,(i+=2)>=26&&(i-=26,a--),n=0!==o||a!==this.length-1?d[6-c.length]+c+n:c+n}for(0!==o&&(n=o.toString(16)+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(e===(0|e)&&e>=2&&e<=36){var u=l[e],f=h[e];n="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modrn(f).toString(e);n=(p=p.idivn(f)).isZero()?m+n:d[u-m.length]+m+n}for(this.isZero()&&(n="0"+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},i.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&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16,2)},o&&(i.prototype.toBuffer=function(e,t){return this.toArrayLike(o,e,t)}),i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},i.prototype.toArrayLike=function(e,t,n){this._strip();var i=this.byteLength(),o=n||Math.max(1,i);r(i<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0");var a=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,o);return this["_toArrayLike"+("le"===t?"LE":"BE")](a,i),a},i.prototype._toArrayLikeLE=function(e,t){for(var r=0,n=0,i=0,o=0;i>8&255),r>16&255),6===o?(r>24&255),n=0,o=0):(n=a>>>24,o+=2)}if(r=0&&(e[r--]=a>>8&255),r>=0&&(e[r--]=a>>16&255),6===o?(r>=0&&(e[r--]=a>>24&255),n=0,o=0):(n=a>>>24,o+=2)}if(r>=0)for(e[r--]=n;r>=0;)e[r--]=0},Math.clz32?i.prototype._countBits=function(e){return 32-Math.clz32(e)}:i.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){r("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),n>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-n),this._strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){r("number"==typeof e&&e>=0);var n=e/26|0,i=e%26;return this._expand(n+1),this.words[n]=t?this.words[n]|1<e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},i.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,a=0;a>26,this.words[a]=67108863&t;for(;0!==o&&a>26,this.words[a]=67108863&t;if(0===o&&a>>13,h=0|a[1],p=8191&h,m=h>>>13,g=0|a[2],y=8191&g,b=g>>>13,v=0|a[3],w=8191&v,A=v>>>13,_=0|a[4],E=8191&_,S=_>>>13,P=0|a[5],x=8191&P,k=P>>>13,M=0|a[6],C=8191&M,I=M>>>13,R=0|a[7],N=8191&R,O=R>>>13,T=0|a[8],j=8191&T,$=T>>>13,D=0|a[9],B=8191&D,F=D>>>13,z=0|s[0],U=8191&z,L=z>>>13,q=0|s[1],H=8191&q,K=q>>>13,J=0|s[2],W=8191&J,G=J>>>13,V=0|s[3],Z=8191&V,X=V>>>13,Q=0|s[4],Y=8191&Q,ee=Q>>>13,te=0|s[5],re=8191&te,ne=te>>>13,ie=0|s[6],oe=8191&ie,ae=ie>>>13,se=0|s[7],ce=8191&se,ue=se>>>13,fe=0|s[8],de=8191&fe,le=fe>>>13,he=0|s[9],pe=8191&he,me=he>>>13;r.negative=e.negative^t.negative,r.length=19;var ge=(u+(n=Math.imul(d,U))|0)+((8191&(i=(i=Math.imul(d,L))+Math.imul(l,U)|0))<<13)|0;u=((o=Math.imul(l,L))+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(p,U),i=(i=Math.imul(p,L))+Math.imul(m,U)|0,o=Math.imul(m,L);var ye=(u+(n=n+Math.imul(d,H)|0)|0)+((8191&(i=(i=i+Math.imul(d,K)|0)+Math.imul(l,H)|0))<<13)|0;u=((o=o+Math.imul(l,K)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(y,U),i=(i=Math.imul(y,L))+Math.imul(b,U)|0,o=Math.imul(b,L),n=n+Math.imul(p,H)|0,i=(i=i+Math.imul(p,K)|0)+Math.imul(m,H)|0,o=o+Math.imul(m,K)|0;var be=(u+(n=n+Math.imul(d,W)|0)|0)+((8191&(i=(i=i+Math.imul(d,G)|0)+Math.imul(l,W)|0))<<13)|0;u=((o=o+Math.imul(l,G)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(w,U),i=(i=Math.imul(w,L))+Math.imul(A,U)|0,o=Math.imul(A,L),n=n+Math.imul(y,H)|0,i=(i=i+Math.imul(y,K)|0)+Math.imul(b,H)|0,o=o+Math.imul(b,K)|0,n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(m,W)|0,o=o+Math.imul(m,G)|0;var ve=(u+(n=n+Math.imul(d,Z)|0)|0)+((8191&(i=(i=i+Math.imul(d,X)|0)+Math.imul(l,Z)|0))<<13)|0;u=((o=o+Math.imul(l,X)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(E,U),i=(i=Math.imul(E,L))+Math.imul(S,U)|0,o=Math.imul(S,L),n=n+Math.imul(w,H)|0,i=(i=i+Math.imul(w,K)|0)+Math.imul(A,H)|0,o=o+Math.imul(A,K)|0,n=n+Math.imul(y,W)|0,i=(i=i+Math.imul(y,G)|0)+Math.imul(b,W)|0,o=o+Math.imul(b,G)|0,n=n+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,X)|0;var we=(u+(n=n+Math.imul(d,Y)|0)|0)+((8191&(i=(i=i+Math.imul(d,ee)|0)+Math.imul(l,Y)|0))<<13)|0;u=((o=o+Math.imul(l,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(x,U),i=(i=Math.imul(x,L))+Math.imul(k,U)|0,o=Math.imul(k,L),n=n+Math.imul(E,H)|0,i=(i=i+Math.imul(E,K)|0)+Math.imul(S,H)|0,o=o+Math.imul(S,K)|0,n=n+Math.imul(w,W)|0,i=(i=i+Math.imul(w,G)|0)+Math.imul(A,W)|0,o=o+Math.imul(A,G)|0,n=n+Math.imul(y,Z)|0,i=(i=i+Math.imul(y,X)|0)+Math.imul(b,Z)|0,o=o+Math.imul(b,X)|0,n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(m,Y)|0,o=o+Math.imul(m,ee)|0;var Ae=(u+(n=n+Math.imul(d,re)|0)|0)+((8191&(i=(i=i+Math.imul(d,ne)|0)+Math.imul(l,re)|0))<<13)|0;u=((o=o+Math.imul(l,ne)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(C,U),i=(i=Math.imul(C,L))+Math.imul(I,U)|0,o=Math.imul(I,L),n=n+Math.imul(x,H)|0,i=(i=i+Math.imul(x,K)|0)+Math.imul(k,H)|0,o=o+Math.imul(k,K)|0,n=n+Math.imul(E,W)|0,i=(i=i+Math.imul(E,G)|0)+Math.imul(S,W)|0,o=o+Math.imul(S,G)|0,n=n+Math.imul(w,Z)|0,i=(i=i+Math.imul(w,X)|0)+Math.imul(A,Z)|0,o=o+Math.imul(A,X)|0,n=n+Math.imul(y,Y)|0,i=(i=i+Math.imul(y,ee)|0)+Math.imul(b,Y)|0,o=o+Math.imul(b,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(m,re)|0,o=o+Math.imul(m,ne)|0;var _e=(u+(n=n+Math.imul(d,oe)|0)|0)+((8191&(i=(i=i+Math.imul(d,ae)|0)+Math.imul(l,oe)|0))<<13)|0;u=((o=o+Math.imul(l,ae)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(N,U),i=(i=Math.imul(N,L))+Math.imul(O,U)|0,o=Math.imul(O,L),n=n+Math.imul(C,H)|0,i=(i=i+Math.imul(C,K)|0)+Math.imul(I,H)|0,o=o+Math.imul(I,K)|0,n=n+Math.imul(x,W)|0,i=(i=i+Math.imul(x,G)|0)+Math.imul(k,W)|0,o=o+Math.imul(k,G)|0,n=n+Math.imul(E,Z)|0,i=(i=i+Math.imul(E,X)|0)+Math.imul(S,Z)|0,o=o+Math.imul(S,X)|0,n=n+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(A,Y)|0,o=o+Math.imul(A,ee)|0,n=n+Math.imul(y,re)|0,i=(i=i+Math.imul(y,ne)|0)+Math.imul(b,re)|0,o=o+Math.imul(b,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,ae)|0)+Math.imul(m,oe)|0,o=o+Math.imul(m,ae)|0;var Ee=(u+(n=n+Math.imul(d,ce)|0)|0)+((8191&(i=(i=i+Math.imul(d,ue)|0)+Math.imul(l,ce)|0))<<13)|0;u=((o=o+Math.imul(l,ue)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(j,U),i=(i=Math.imul(j,L))+Math.imul($,U)|0,o=Math.imul($,L),n=n+Math.imul(N,H)|0,i=(i=i+Math.imul(N,K)|0)+Math.imul(O,H)|0,o=o+Math.imul(O,K)|0,n=n+Math.imul(C,W)|0,i=(i=i+Math.imul(C,G)|0)+Math.imul(I,W)|0,o=o+Math.imul(I,G)|0,n=n+Math.imul(x,Z)|0,i=(i=i+Math.imul(x,X)|0)+Math.imul(k,Z)|0,o=o+Math.imul(k,X)|0,n=n+Math.imul(E,Y)|0,i=(i=i+Math.imul(E,ee)|0)+Math.imul(S,Y)|0,o=o+Math.imul(S,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(A,re)|0,o=o+Math.imul(A,ne)|0,n=n+Math.imul(y,oe)|0,i=(i=i+Math.imul(y,ae)|0)+Math.imul(b,oe)|0,o=o+Math.imul(b,ae)|0,n=n+Math.imul(p,ce)|0,i=(i=i+Math.imul(p,ue)|0)+Math.imul(m,ce)|0,o=o+Math.imul(m,ue)|0;var Se=(u+(n=n+Math.imul(d,de)|0)|0)+((8191&(i=(i=i+Math.imul(d,le)|0)+Math.imul(l,de)|0))<<13)|0;u=((o=o+Math.imul(l,le)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(B,U),i=(i=Math.imul(B,L))+Math.imul(F,U)|0,o=Math.imul(F,L),n=n+Math.imul(j,H)|0,i=(i=i+Math.imul(j,K)|0)+Math.imul($,H)|0,o=o+Math.imul($,K)|0,n=n+Math.imul(N,W)|0,i=(i=i+Math.imul(N,G)|0)+Math.imul(O,W)|0,o=o+Math.imul(O,G)|0,n=n+Math.imul(C,Z)|0,i=(i=i+Math.imul(C,X)|0)+Math.imul(I,Z)|0,o=o+Math.imul(I,X)|0,n=n+Math.imul(x,Y)|0,i=(i=i+Math.imul(x,ee)|0)+Math.imul(k,Y)|0,o=o+Math.imul(k,ee)|0,n=n+Math.imul(E,re)|0,i=(i=i+Math.imul(E,ne)|0)+Math.imul(S,re)|0,o=o+Math.imul(S,ne)|0,n=n+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,ae)|0)+Math.imul(A,oe)|0,o=o+Math.imul(A,ae)|0,n=n+Math.imul(y,ce)|0,i=(i=i+Math.imul(y,ue)|0)+Math.imul(b,ce)|0,o=o+Math.imul(b,ue)|0,n=n+Math.imul(p,de)|0,i=(i=i+Math.imul(p,le)|0)+Math.imul(m,de)|0,o=o+Math.imul(m,le)|0;var Pe=(u+(n=n+Math.imul(d,pe)|0)|0)+((8191&(i=(i=i+Math.imul(d,me)|0)+Math.imul(l,pe)|0))<<13)|0;u=((o=o+Math.imul(l,me)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(B,H),i=(i=Math.imul(B,K))+Math.imul(F,H)|0,o=Math.imul(F,K),n=n+Math.imul(j,W)|0,i=(i=i+Math.imul(j,G)|0)+Math.imul($,W)|0,o=o+Math.imul($,G)|0,n=n+Math.imul(N,Z)|0,i=(i=i+Math.imul(N,X)|0)+Math.imul(O,Z)|0,o=o+Math.imul(O,X)|0,n=n+Math.imul(C,Y)|0,i=(i=i+Math.imul(C,ee)|0)+Math.imul(I,Y)|0,o=o+Math.imul(I,ee)|0,n=n+Math.imul(x,re)|0,i=(i=i+Math.imul(x,ne)|0)+Math.imul(k,re)|0,o=o+Math.imul(k,ne)|0,n=n+Math.imul(E,oe)|0,i=(i=i+Math.imul(E,ae)|0)+Math.imul(S,oe)|0,o=o+Math.imul(S,ae)|0,n=n+Math.imul(w,ce)|0,i=(i=i+Math.imul(w,ue)|0)+Math.imul(A,ce)|0,o=o+Math.imul(A,ue)|0,n=n+Math.imul(y,de)|0,i=(i=i+Math.imul(y,le)|0)+Math.imul(b,de)|0,o=o+Math.imul(b,le)|0;var xe=(u+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,me)|0)+Math.imul(m,pe)|0))<<13)|0;u=((o=o+Math.imul(m,me)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(B,W),i=(i=Math.imul(B,G))+Math.imul(F,W)|0,o=Math.imul(F,G),n=n+Math.imul(j,Z)|0,i=(i=i+Math.imul(j,X)|0)+Math.imul($,Z)|0,o=o+Math.imul($,X)|0,n=n+Math.imul(N,Y)|0,i=(i=i+Math.imul(N,ee)|0)+Math.imul(O,Y)|0,o=o+Math.imul(O,ee)|0,n=n+Math.imul(C,re)|0,i=(i=i+Math.imul(C,ne)|0)+Math.imul(I,re)|0,o=o+Math.imul(I,ne)|0,n=n+Math.imul(x,oe)|0,i=(i=i+Math.imul(x,ae)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,ae)|0,n=n+Math.imul(E,ce)|0,i=(i=i+Math.imul(E,ue)|0)+Math.imul(S,ce)|0,o=o+Math.imul(S,ue)|0,n=n+Math.imul(w,de)|0,i=(i=i+Math.imul(w,le)|0)+Math.imul(A,de)|0,o=o+Math.imul(A,le)|0;var ke=(u+(n=n+Math.imul(y,pe)|0)|0)+((8191&(i=(i=i+Math.imul(y,me)|0)+Math.imul(b,pe)|0))<<13)|0;u=((o=o+Math.imul(b,me)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(B,Z),i=(i=Math.imul(B,X))+Math.imul(F,Z)|0,o=Math.imul(F,X),n=n+Math.imul(j,Y)|0,i=(i=i+Math.imul(j,ee)|0)+Math.imul($,Y)|0,o=o+Math.imul($,ee)|0,n=n+Math.imul(N,re)|0,i=(i=i+Math.imul(N,ne)|0)+Math.imul(O,re)|0,o=o+Math.imul(O,ne)|0,n=n+Math.imul(C,oe)|0,i=(i=i+Math.imul(C,ae)|0)+Math.imul(I,oe)|0,o=o+Math.imul(I,ae)|0,n=n+Math.imul(x,ce)|0,i=(i=i+Math.imul(x,ue)|0)+Math.imul(k,ce)|0,o=o+Math.imul(k,ue)|0,n=n+Math.imul(E,de)|0,i=(i=i+Math.imul(E,le)|0)+Math.imul(S,de)|0,o=o+Math.imul(S,le)|0;var Me=(u+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,me)|0)+Math.imul(A,pe)|0))<<13)|0;u=((o=o+Math.imul(A,me)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(B,Y),i=(i=Math.imul(B,ee))+Math.imul(F,Y)|0,o=Math.imul(F,ee),n=n+Math.imul(j,re)|0,i=(i=i+Math.imul(j,ne)|0)+Math.imul($,re)|0,o=o+Math.imul($,ne)|0,n=n+Math.imul(N,oe)|0,i=(i=i+Math.imul(N,ae)|0)+Math.imul(O,oe)|0,o=o+Math.imul(O,ae)|0,n=n+Math.imul(C,ce)|0,i=(i=i+Math.imul(C,ue)|0)+Math.imul(I,ce)|0,o=o+Math.imul(I,ue)|0,n=n+Math.imul(x,de)|0,i=(i=i+Math.imul(x,le)|0)+Math.imul(k,de)|0,o=o+Math.imul(k,le)|0;var Ce=(u+(n=n+Math.imul(E,pe)|0)|0)+((8191&(i=(i=i+Math.imul(E,me)|0)+Math.imul(S,pe)|0))<<13)|0;u=((o=o+Math.imul(S,me)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(B,re),i=(i=Math.imul(B,ne))+Math.imul(F,re)|0,o=Math.imul(F,ne),n=n+Math.imul(j,oe)|0,i=(i=i+Math.imul(j,ae)|0)+Math.imul($,oe)|0,o=o+Math.imul($,ae)|0,n=n+Math.imul(N,ce)|0,i=(i=i+Math.imul(N,ue)|0)+Math.imul(O,ce)|0,o=o+Math.imul(O,ue)|0,n=n+Math.imul(C,de)|0,i=(i=i+Math.imul(C,le)|0)+Math.imul(I,de)|0,o=o+Math.imul(I,le)|0;var Ie=(u+(n=n+Math.imul(x,pe)|0)|0)+((8191&(i=(i=i+Math.imul(x,me)|0)+Math.imul(k,pe)|0))<<13)|0;u=((o=o+Math.imul(k,me)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(B,oe),i=(i=Math.imul(B,ae))+Math.imul(F,oe)|0,o=Math.imul(F,ae),n=n+Math.imul(j,ce)|0,i=(i=i+Math.imul(j,ue)|0)+Math.imul($,ce)|0,o=o+Math.imul($,ue)|0,n=n+Math.imul(N,de)|0,i=(i=i+Math.imul(N,le)|0)+Math.imul(O,de)|0,o=o+Math.imul(O,le)|0;var Re=(u+(n=n+Math.imul(C,pe)|0)|0)+((8191&(i=(i=i+Math.imul(C,me)|0)+Math.imul(I,pe)|0))<<13)|0;u=((o=o+Math.imul(I,me)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(B,ce),i=(i=Math.imul(B,ue))+Math.imul(F,ce)|0,o=Math.imul(F,ue),n=n+Math.imul(j,de)|0,i=(i=i+Math.imul(j,le)|0)+Math.imul($,de)|0,o=o+Math.imul($,le)|0;var Ne=(u+(n=n+Math.imul(N,pe)|0)|0)+((8191&(i=(i=i+Math.imul(N,me)|0)+Math.imul(O,pe)|0))<<13)|0;u=((o=o+Math.imul(O,me)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,n=Math.imul(B,de),i=(i=Math.imul(B,le))+Math.imul(F,de)|0,o=Math.imul(F,le);var Oe=(u+(n=n+Math.imul(j,pe)|0)|0)+((8191&(i=(i=i+Math.imul(j,me)|0)+Math.imul($,pe)|0))<<13)|0;u=((o=o+Math.imul($,me)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863;var Te=(u+(n=Math.imul(B,pe))|0)+((8191&(i=(i=Math.imul(B,me))+Math.imul(F,pe)|0))<<13)|0;return u=((o=Math.imul(F,me))+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,c[0]=ge,c[1]=ye,c[2]=be,c[3]=ve,c[4]=we,c[5]=Ae,c[6]=_e,c[7]=Ee,c[8]=Se,c[9]=Pe,c[10]=xe,c[11]=ke,c[12]=Me,c[13]=Ce,c[14]=Ie,c[15]=Re,c[16]=Ne,c[17]=Oe,c[18]=Te,0!==u&&(c[19]=u,r.length++),r};function y(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,a&=67108863}r.words[o]=s,n=a,a=i}return 0!==n?r.words[o]=n:r.length--,r._strip()}function b(e,t,r){return y(e,t,r)}Math.imul||(g=p),i.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?g(this,e,t):r<63?p(this,e,t):r<1024?y(this,e,t):b(this,e,t)},i.prototype.mul=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},i.prototype.mulf=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),b(this,e,t)},i.prototype.imul=function(e){return this.clone().mulTo(e,this)},i.prototype.imuln=function(e){var t=e<0;t&&(e=-e),r("number"==typeof e),r(e<67108864);for(var n=0,i=0;i>=26,n+=o/67108864|0,n+=a>>>26,this.words[i]=67108863&a}return 0!==n&&(this.words[i]=n,this.length++),t?this.ineg():this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>i&1}return t}(e);if(0===t.length)return new i(1);for(var r=this,n=0;n=0);var t,n=e%26,i=(e-n)/26,o=67108863>>>26-n<<26-n;if(0!==n){var a=0;for(t=0;t>>26-n}a&&(this.words[t]=a,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var o=e%26,a=Math.min((e-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,u=0;u=0&&(0!==f||u>=i);u--){var d=0|this.words[u];this.words[u]=f<<26-o|d>>>o,f=d&s}return c&&0!==f&&(c.words[c.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(e,t,n){return r(0===this.negative),this.iushrn(e,t,n)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){r("number"==typeof e&&e>=0);var t=e%26,n=(e-t)/26,i=1<=0);var t=e%26,n=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==t&&n++,this.length=Math.min(n,this.length),0!==t){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},i.prototype.isubn=function(e){if(r("number"==typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(c/67108864|0),this.words[i+n]=67108863&o}for(;i>26,this.words[i+n]=67108863&o;if(0===s)return this._strip();for(r(-1===s),s=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},i.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),o=e,a=0|o.words[o.length-1];0!=(r=26-this._countBits(a))&&(o=o.ushln(r),n.iushln(r),a=0|o.words[o.length-1]);var s,c=n.length-o.length;if("mod"!==t){(s=new i(null)).length=c+1,s.words=new Array(s.length);for(var u=0;u=0;d--){var l=67108864*(0|n.words[o.length+d])+(0|n.words[o.length+d-1]);for(l=Math.min(l/a|0,67108863),n._ishlnsubmul(o,l,d);0!==n.negative;)l--,n.negative=0,n._ishlnsubmul(o,1,d),n.isZero()||(n.negative^=1);s&&(s.words[d]=l)}return s&&s._strip(),n._strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},i.prototype.divmod=function(e,t,n){return r(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(o=s.div.neg()),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.iadd(e)),{div:o,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(o=s.div.neg()),{div:o,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modrn(e.words[0]))}:this._wordDiv(e,t);var o,a,s},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modrn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var n=(1<<26)%e,i=0,o=this.length-1;o>=0;o--)i=(n*i+(0|this.words[o]))%e;return t?-i:i},i.prototype.modn=function(e){return this.modrn(e)},i.prototype.idivn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var n=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*n;this.words[i]=o/e|0,n=o%e}return this._strip(),t?this.ineg():this},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o=new i(1),a=new i(0),s=new i(0),c=new i(1),u=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++u;for(var f=n.clone(),d=t.clone();!t.isZero();){for(var l=0,h=1;0==(t.words[0]&h)&&l<26;++l,h<<=1);if(l>0)for(t.iushrn(l);l-- >0;)(o.isOdd()||a.isOdd())&&(o.iadd(f),a.isub(d)),o.iushrn(1),a.iushrn(1);for(var p=0,m=1;0==(n.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(n.iushrn(p);p-- >0;)(s.isOdd()||c.isOdd())&&(s.iadd(f),c.isub(d)),s.iushrn(1),c.iushrn(1);t.cmp(n)>=0?(t.isub(n),o.isub(s),a.isub(c)):(n.isub(t),s.isub(o),c.isub(a))}return{a:s,b:c,gcd:n.iushln(u)}},i.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o,a=new i(1),s=new i(0),c=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(var u=0,f=1;0==(t.words[0]&f)&&u<26;++u,f<<=1);if(u>0)for(t.iushrn(u);u-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);for(var d=0,l=1;0==(n.words[0]&l)&&d<26;++d,l<<=1);if(d>0)for(n.iushrn(d);d-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);t.cmp(n)>=0?(t.isub(n),a.isub(s)):(n.isub(t),s.isub(a))}return(o=0===t.cmpn(1)?a:s).cmpn(0)<0&&o.iadd(e),o},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return 0==(1&this.words[0])},i.prototype.isOdd=function(){return 1==(1&this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){r("number"==typeof e);var t=e%26,n=(e-t)/26,i=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this._strip(),this.length>1)t=1;else{n&&(e=-e),r(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){ni&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new P(e)},i.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var v={k256:null,p224:null,p192:null,p25519:null};function w(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function A(){w.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function _(){w.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function E(){w.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function S(){w.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function P(e){if("string"==typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function x(e){P.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}w.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},w.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},w.prototype.split=function(e,t){e.iushrn(this.n,0,t)},w.prototype.imulK=function(e){return e.imul(this.k)},n(A,w),A.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i>>22,o=a}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},A.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(v[e])return v[e];var t;if("k256"===e)t=new A;else if("p224"===e)t=new _;else if("p192"===e)t=new E;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new S}return v[e]=t,t},P.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},P.prototype._verify2=function(e,t){r(0==(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},P.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(u(e,e.umod(this.m)._forceRed(this)),e)},P.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},P.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},P.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},P.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},P.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},P.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},P.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},P.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},P.prototype.isqr=function(e){return this.imul(e,e.clone())},P.prototype.sqr=function(e){return this.mul(e,e)},P.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2==1),3===t){var n=this.m.add(new i(1)).iushrn(2);return this.pow(e,n)}for(var o=this.m.subn(1),a=0;!o.isZero()&&0===o.andln(1);)a++,o.iushrn(1);r(!o.isZero());var s=new i(1).toRed(this),c=s.redNeg(),u=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new i(2*f*f).toRed(this);0!==this.pow(f,u).cmp(c);)f.redIAdd(c);for(var d=this.pow(f,o),l=this.pow(e,o.addn(1).iushrn(1)),h=this.pow(e,o),p=a;0!==h.cmp(s);){for(var m=h,g=0;0!==m.cmp(s);g++)m=m.redSqr();r(g=0;n--){for(var u=t.words[n],f=c-1;f>=0;f--){var d=u>>f&1;o!==r[0]&&(o=this.sqr(o)),0!==d||0!==a?(a<<=1,a|=d,(4==++s||0===n&&0===f)&&(o=this.mul(o,r[a]),s=0,a=0)):s=0}c=26}return o},P.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},P.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new x(e)},n(x,P),x.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},x.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},x.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},x.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(n).iushrn(this.shift),a=o;return o.cmp(this.m)>=0?a=o.isub(this.m):o.cmpn(0)<0&&(a=o.iadd(this.m)),a._forceRed(this)},x.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(co,c);var uo=u(co.exports);let fo=!1,lo=!1;const ho={debug:1,default:2,info:2,warning:3,error:4,off:5};let po=ho.default,mo=null;const go=function(){try{const e=[];if(["NFD","NFC","NFKD","NFKC"].forEach((t=>{try{if("test"!=="test".normalize(t))throw new Error("bad normalize")}catch(r){e.push(t)}})),e.length)throw new Error("missing "+e.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(e){return e.message}return null}();var yo,bo;!function(e){e.DEBUG="DEBUG",e.INFO="INFO",e.WARNING="WARNING",e.ERROR="ERROR",e.OFF="OFF"}(yo||(yo={})),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"}(bo||(bo={}));const vo="0123456789abcdef";class wo{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,t){const r=e.toLowerCase();null==ho[r]&&this.throwArgumentError("invalid log level name","logLevel",e),po>ho[r]||console.log.apply(console,t)}debug(...e){this._log(wo.levels.DEBUG,e)}info(...e){this._log(wo.levels.INFO,e)}warn(...e){this._log(wo.levels.WARNING,e)}makeError(e,t,r){if(lo)return this.makeError("censored error",t,{});t||(t=wo.errors.UNKNOWN_ERROR),r||(r={});const n=[];Object.keys(r).forEach((e=>{const t=r[e];try{if(t instanceof Uint8Array){let r="";for(let e=0;e>4],r+=vo[15&t[e]];n.push(e+"=Uint8Array(0x"+r+")")}else n.push(e+"="+JSON.stringify(t))}catch(t){n.push(e+"="+JSON.stringify(r[e].toString()))}})),n.push(`code=${t}`),n.push(`version=${this.version}`);const i=e;let o="";switch(t){case bo.NUMERIC_FAULT:{o="NUMERIC_FAULT";const t=e;switch(t){case"overflow":case"underflow":case"division-by-zero":o+="-"+t;break;case"negative-power":case"negative-width":o+="-unsupported";break;case"unbound-bitwise-result":o+="-unbound-result"}break}case bo.CALL_EXCEPTION:case bo.INSUFFICIENT_FUNDS:case bo.MISSING_NEW:case bo.NONCE_EXPIRED:case bo.REPLACEMENT_UNDERPRICED:case bo.TRANSACTION_REPLACED:case bo.UNPREDICTABLE_GAS_LIMIT:o=t}o&&(e+=" [ See: https://links.ethers.org/v5-errors-"+o+" ]"),n.length&&(e+=" ("+n.join(", ")+")");const a=new Error(e);return a.reason=i,a.code=t,Object.keys(r).forEach((function(e){a[e]=r[e]})),a}throwError(e,t,r){throw this.makeError(e,t,r)}throwArgumentError(e,t,r){return this.throwError(e,wo.errors.INVALID_ARGUMENT,{argument:t,value:r})}assert(e,t,r,n){e||this.throwError(t,r,n)}assertArgument(e,t,r,n){e||this.throwArgumentError(t,r,n)}checkNormalize(e){go&&this.throwError("platform missing String.prototype.normalize",wo.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:go})}checkSafeUint53(e,t){"number"==typeof e&&(null==t&&(t="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(t,wo.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(t,wo.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,t,r){r=r?": "+r:"",et&&this.throwError("too many arguments"+r,wo.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:t})}checkNew(e,t){e!==Object&&null!=e||this.throwError("missing new",wo.errors.MISSING_NEW,{name:t.name})}checkAbstract(e,t){e===t?this.throwError("cannot instantiate abstract class "+JSON.stringify(t.name)+" directly; use a sub-class",wo.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):e!==Object&&null!=e||this.throwError("missing new",wo.errors.MISSING_NEW,{name:t.name})}static globalLogger(){return mo||(mo=new wo("logger/5.7.0")),mo}static setCensorship(e,t){if(!e&&t&&this.globalLogger().throwError("cannot permanently disable censorship",wo.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),fo){if(!e)return;this.globalLogger().throwError("error censorship permanent",wo.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}lo=!!e,fo=!!t}static setLogLevel(e){const t=ho[e.toLowerCase()];null!=t?po=t:wo.globalLogger().warn("invalid log level - "+e)}static from(e){return new wo(e)}}wo.errors=bo,wo.levels=yo;var Ao=Object.freeze({__proto__:null,get ErrorCode(){return bo},get LogLevel(){return yo},Logger:wo});const _o=new wo("bytes/5.7.0");function Eo(e){return!!e.toHexString}function So(e){return e.slice||(e.slice=function(){const t=Array.prototype.slice.call(arguments);return So(new Uint8Array(Array.prototype.slice.apply(e,t)))}),e}function Po(e){return No(e)&&!(e.length%2)||ko(e)}function xo(e){return"number"==typeof e&&e==e&&e%1==0}function ko(e){if(null==e)return!1;if(e.constructor===Uint8Array)return!0;if("string"==typeof e)return!1;if(!xo(e.length)||e.length<0)return!1;for(let t=0;t=256)return!1}return!0}function Mo(e,t){if(t||(t={}),"number"==typeof e){_o.checkSafeUint53(e,"invalid arrayify value");const t=[];for(;e;)t.unshift(255&e),e=parseInt(String(e/256));return 0===t.length&&t.push(0),So(new Uint8Array(t))}if(t.allowMissingPrefix&&"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),Eo(e)&&(e=e.toHexString()),No(e)){let r=e.substring(2);r.length%2&&("left"===t.hexPad?r="0"+r:"right"===t.hexPad?r+="0":_o.throwArgumentError("hex data is odd-length","value",e));const n=[];for(let e=0;eMo(e))),r=t.reduce(((e,t)=>e+t.length),0),n=new Uint8Array(r);return t.reduce(((e,t)=>(n.set(t,e),e+t.length)),0),So(n)}function Io(e){let t=Mo(e);if(0===t.length)return t;let r=0;for(;rt&&_o.throwArgumentError("value out of range","value",arguments[0]);const r=new Uint8Array(t);return r.set(e,t-e.length),So(r)}function No(e,t){return!("string"!=typeof e||!e.match(/^0x[0-9A-Fa-f]*$/))&&(!t||e.length===2+2*t)}const Oo="0123456789abcdef";function To(e,t){if(t||(t={}),"number"==typeof e){_o.checkSafeUint53(e,"invalid hexlify value");let t="";for(;e;)t=Oo[15&e]+t,e=Math.floor(e/16);return t.length?(t.length%2&&(t="0"+t),"0x"+t):"0x00"}if("bigint"==typeof e)return(e=e.toString(16)).length%2?"0x0"+e:"0x"+e;if(t.allowMissingPrefix&&"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),Eo(e))return e.toHexString();if(No(e))return e.length%2&&("left"===t.hexPad?e="0x0"+e.substring(2):"right"===t.hexPad?e+="0":_o.throwArgumentError("hex data is odd-length","value",e)),e.toLowerCase();if(ko(e)){let t="0x";for(let r=0;r>4]+Oo[15&n]}return t}return _o.throwArgumentError("invalid hexlify value","value",e)}function jo(e){if("string"!=typeof e)e=To(e);else if(!No(e)||e.length%2)return null;return(e.length-2)/2}function $o(e,t,r){return"string"!=typeof e?e=To(e):(!No(e)||e.length%2)&&_o.throwArgumentError("invalid hexData","value",e),t=2+2*t,null!=r?"0x"+e.substring(t,2+2*r):"0x"+e.substring(t)}function Do(e){let t="0x";return e.forEach((e=>{t+=To(e).substring(2)})),t}function Bo(e){const t=Fo(To(e,{hexPad:"left"}));return"0x"===t?"0x0":t}function Fo(e){"string"!=typeof e&&(e=To(e)),No(e)||_o.throwArgumentError("invalid hex string","value",e),e=e.substring(2);let t=0;for(;t2*t+2&&_o.throwArgumentError("value out of range","value",arguments[1]);e.length<2*t+2;)e="0x0"+e.substring(2);return e}function Uo(e){const t={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(Po(e)){let r=Mo(e);64===r.length?(t.v=27+(r[32]>>7),r[32]&=127,t.r=To(r.slice(0,32)),t.s=To(r.slice(32,64))):65===r.length?(t.r=To(r.slice(0,32)),t.s=To(r.slice(32,64)),t.v=r[64]):_o.throwArgumentError("invalid signature string","signature",e),t.v<27&&(0===t.v||1===t.v?t.v+=27:_o.throwArgumentError("signature invalid v byte","signature",e)),t.recoveryParam=1-t.v%2,t.recoveryParam&&(r[32]|=128),t._vs=To(r.slice(32,64))}else{if(t.r=e.r,t.s=e.s,t.v=e.v,t.recoveryParam=e.recoveryParam,t._vs=e._vs,null!=t._vs){const r=Ro(Mo(t._vs),32);t._vs=To(r);const n=r[0]>=128?1:0;null==t.recoveryParam?t.recoveryParam=n:t.recoveryParam!==n&&_o.throwArgumentError("signature recoveryParam mismatch _vs","signature",e),r[0]&=127;const i=To(r);null==t.s?t.s=i:t.s!==i&&_o.throwArgumentError("signature v mismatch _vs","signature",e)}if(null==t.recoveryParam)null==t.v?_o.throwArgumentError("signature missing v and recoveryParam","signature",e):0===t.v||1===t.v?t.recoveryParam=t.v:t.recoveryParam=1-t.v%2;else if(null==t.v)t.v=27+t.recoveryParam;else{const r=0===t.v||1===t.v?t.v:1-t.v%2;t.recoveryParam!==r&&_o.throwArgumentError("signature recoveryParam mismatch v","signature",e)}null!=t.r&&No(t.r)?t.r=zo(t.r,32):_o.throwArgumentError("signature missing or invalid r","signature",e),null!=t.s&&No(t.s)?t.s=zo(t.s,32):_o.throwArgumentError("signature missing or invalid s","signature",e);const r=Mo(t.s);r[0]>=128&&_o.throwArgumentError("signature s out of range","signature",e),t.recoveryParam&&(r[0]|=128);const n=To(r);t._vs&&(No(t._vs)||_o.throwArgumentError("signature invalid _vs","signature",e),t._vs=zo(t._vs,32)),null==t._vs?t._vs=n:t._vs!==n&&_o.throwArgumentError("signature _vs mismatch v and s","signature",e)}return t.yParityAndS=t._vs,t.compact=t.r+t.yParityAndS.substring(2),t}function Lo(e){return To(Co([(e=Uo(e)).r,e.s,e.recoveryParam?"0x1c":"0x1b"]))}var qo=Object.freeze({__proto__:null,arrayify:Mo,concat:Co,hexConcat:Do,hexDataLength:jo,hexDataSlice:$o,hexStripZeros:Fo,hexValue:Bo,hexZeroPad:zo,hexlify:To,isBytes:ko,isBytesLike:Po,isHexString:No,joinSignature:Lo,splitSignature:Uo,stripZeros:Io,zeroPad:Ro});const Ho="bignumber/5.7.0";var Ko=uo.BN;const Jo=new wo(Ho),Wo={},Go=9007199254740991;let Vo=!1;class Zo{constructor(e,t){e!==Wo&&Jo.throwError("cannot call constructor directly; use BigNumber.from",wo.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=t,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return Qo(Yo(this).fromTwos(e))}toTwos(e){return Qo(Yo(this).toTwos(e))}abs(){return"-"===this._hex[0]?Zo.from(this._hex.substring(1)):this}add(e){return Qo(Yo(this).add(Yo(e)))}sub(e){return Qo(Yo(this).sub(Yo(e)))}div(e){return Zo.from(e).isZero()&&ea("division-by-zero","div"),Qo(Yo(this).div(Yo(e)))}mul(e){return Qo(Yo(this).mul(Yo(e)))}mod(e){const t=Yo(e);return t.isNeg()&&ea("division-by-zero","mod"),Qo(Yo(this).umod(t))}pow(e){const t=Yo(e);return t.isNeg()&&ea("negative-power","pow"),Qo(Yo(this).pow(t))}and(e){const t=Yo(e);return(this.isNegative()||t.isNeg())&&ea("unbound-bitwise-result","and"),Qo(Yo(this).and(t))}or(e){const t=Yo(e);return(this.isNegative()||t.isNeg())&&ea("unbound-bitwise-result","or"),Qo(Yo(this).or(t))}xor(e){const t=Yo(e);return(this.isNegative()||t.isNeg())&&ea("unbound-bitwise-result","xor"),Qo(Yo(this).xor(t))}mask(e){return(this.isNegative()||e<0)&&ea("negative-width","mask"),Qo(Yo(this).maskn(e))}shl(e){return(this.isNegative()||e<0)&&ea("negative-width","shl"),Qo(Yo(this).shln(e))}shr(e){return(this.isNegative()||e<0)&&ea("negative-width","shr"),Qo(Yo(this).shrn(e))}eq(e){return Yo(this).eq(Yo(e))}lt(e){return Yo(this).lt(Yo(e))}lte(e){return Yo(this).lte(Yo(e))}gt(e){return Yo(this).gt(Yo(e))}gte(e){return Yo(this).gte(Yo(e))}isNegative(){return"-"===this._hex[0]}isZero(){return Yo(this).isZero()}toNumber(){try{return Yo(this).toNumber()}catch(e){ea("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch(e){}return Jo.throwError("this platform does not support BigInt",wo.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(10===arguments[0]?Vo||(Vo=!0,Jo.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?Jo.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",wo.errors.UNEXPECTED_ARGUMENT,{}):Jo.throwError("BigNumber.toString does not accept parameters",wo.errors.UNEXPECTED_ARGUMENT,{})),Yo(this).toString(10)}toHexString(){return this._hex}toJSON(e){return{type:"BigNumber",hex:this.toHexString()}}static from(e){if(e instanceof Zo)return e;if("string"==typeof e)return e.match(/^-?0x[0-9a-f]+$/i)?new Zo(Wo,Xo(e)):e.match(/^-?[0-9]+$/)?new Zo(Wo,Xo(new Ko(e))):Jo.throwArgumentError("invalid BigNumber string","value",e);if("number"==typeof e)return e%1&&ea("underflow","BigNumber.from",e),(e>=Go||e<=-Go)&&ea("overflow","BigNumber.from",e),Zo.from(String(e));const t=e;if("bigint"==typeof t)return Zo.from(t.toString());if(ko(t))return Zo.from(To(t));if(t)if(t.toHexString){const e=t.toHexString();if("string"==typeof e)return Zo.from(e)}else{let e=t._hex;if(null==e&&"BigNumber"===t.type&&(e=t.hex),"string"==typeof e&&(No(e)||"-"===e[0]&&No(e.substring(1))))return Zo.from(e)}return Jo.throwArgumentError("invalid BigNumber value","value",e)}static isBigNumber(e){return!(!e||!e._isBigNumber)}}function Xo(e){if("string"!=typeof e)return Xo(e.toString(16));if("-"===e[0])return"-"===(e=e.substring(1))[0]&&Jo.throwArgumentError("invalid hex","value",e),"0x00"===(e=Xo(e))?e:"-"+e;if("0x"!==e.substring(0,2)&&(e="0x"+e),"0x"===e)return"0x00";for(e.length%2&&(e="0x0"+e.substring(2));e.length>4&&"0x00"===e.substring(0,4);)e="0x"+e.substring(4);return e}function Qo(e){return Zo.from(Xo(e))}function Yo(e){const t=Zo.from(e).toHexString();return"-"===t[0]?new Ko("-"+t.substring(3),16):new Ko(t.substring(2),16)}function ea(e,t,r){const n={fault:e,operation:t};return null!=r&&(n.value=r),Jo.throwError(e,wo.errors.NUMERIC_FAULT,n)}const ta=new wo(Ho),ra={},na=Zo.from(0),ia=Zo.from(-1);function oa(e,t,r,n){const i={fault:t,operation:r};return void 0!==n&&(i.value=n),ta.throwError(e,wo.errors.NUMERIC_FAULT,i)}let aa="0";for(;aa.length<256;)aa+=aa;function sa(e){if("number"!=typeof e)try{e=Zo.from(e).toNumber()}catch(e){}return"number"==typeof e&&e>=0&&e<=256&&!(e%1)?"1"+aa.substring(0,e):ta.throwArgumentError("invalid decimal size","decimals",e)}function ca(e,t){null==t&&(t=0);const r=sa(t),n=(e=Zo.from(e)).lt(na);n&&(e=e.mul(ia));let i=e.mod(r).toString();for(;i.length2&&ta.throwArgumentError("too many decimal points","value",e);let o=i[0],a=i[1];for(o||(o="0"),a||(a="0");"0"===a[a.length-1];)a=a.substring(0,a.length-1);for(a.length>r.length-1&&oa("fractional component exceeds decimals","underflow","parseFixed"),""===a&&(a="0");a.lengthnull==e[t]?n:(typeof e[t]!==r&&ta.throwArgumentError("invalid fixed format ("+t+" not "+r+")","format."+t,e[t]),e[t]);t=i("signed","boolean",t),r=i("width","number",r),n=i("decimals","number",n)}return r%8&&ta.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",r),n>80&&ta.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",n),new fa(ra,t,r,n)}}class da{constructor(e,t,r,n){e!==ra&&ta.throwError("cannot use FixedNumber constructor; use FixedNumber.from",wo.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=n,this._hex=t,this._value=r,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(e){this.format.name!==e.format.name&&ta.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",e)}addUnsafe(e){this._checkFormat(e);const t=ua(this._value,this.format.decimals),r=ua(e._value,e.format.decimals);return da.fromValue(t.add(r),this.format.decimals,this.format)}subUnsafe(e){this._checkFormat(e);const t=ua(this._value,this.format.decimals),r=ua(e._value,e.format.decimals);return da.fromValue(t.sub(r),this.format.decimals,this.format)}mulUnsafe(e){this._checkFormat(e);const t=ua(this._value,this.format.decimals),r=ua(e._value,e.format.decimals);return da.fromValue(t.mul(r).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(e){this._checkFormat(e);const t=ua(this._value,this.format.decimals),r=ua(e._value,e.format.decimals);return da.fromValue(t.mul(this.format._multiplier).div(r),this.format.decimals,this.format)}floor(){const e=this.toString().split(".");1===e.length&&e.push("0");let t=da.from(e[0],this.format);const r=!e[1].match(/^(0*)$/);return this.isNegative()&&r&&(t=t.subUnsafe(la.toFormat(t.format))),t}ceiling(){const e=this.toString().split(".");1===e.length&&e.push("0");let t=da.from(e[0],this.format);const r=!e[1].match(/^(0*)$/);return!this.isNegative()&&r&&(t=t.addUnsafe(la.toFormat(t.format))),t}round(e){null==e&&(e=0);const t=this.toString().split(".");if(1===t.length&&t.push("0"),(e<0||e>80||e%1)&&ta.throwArgumentError("invalid decimal count","decimals",e),t[1].length<=e)return this;const r=da.from("1"+aa.substring(0,e),this.format),n=ha.toFormat(this.format);return this.mulUnsafe(r).addUnsafe(n).floor().divUnsafe(r)}isZero(){return"0.0"===this._value||"0"===this._value}isNegative(){return"-"===this._value[0]}toString(){return this._value}toHexString(e){if(null==e)return this._hex;e%8&&ta.throwArgumentError("invalid byte width","width",e);return zo(Zo.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString(),e/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return da.fromString(this._value,e)}static fromValue(e,t,r){return null!=r||null==t||function(e){return null!=e&&(Zo.isBigNumber(e)||"number"==typeof e&&e%1==0||"string"==typeof e&&!!e.match(/^-?[0-9]+$/)||No(e)||"bigint"==typeof e||ko(e))}(t)||(r=t,t=null),null==t&&(t=0),null==r&&(r="fixed"),da.fromString(ca(e,t),fa.from(r))}static fromString(e,t){null==t&&(t="fixed");const r=fa.from(t),n=ua(e,r.decimals);!r.signed&&n.lt(na)&&oa("unsigned value cannot be negative","overflow","value",e);let i=null;r.signed?i=n.toTwos(r.width).toHexString():(i=n.toHexString(),i=zo(i,r.width/8));const o=ca(n,r.decimals);return new da(ra,i,o,r)}static fromBytes(e,t){null==t&&(t="fixed");const r=fa.from(t);if(Mo(e).length>r.width/8)throw new Error("overflow");let n=Zo.from(e);r.signed&&(n=n.fromTwos(r.width));const i=n.toTwos((r.signed?0:1)+r.width).toHexString(),o=ca(n,r.decimals);return new da(ra,i,o,r)}static from(e,t){if("string"==typeof e)return da.fromString(e,t);if(ko(e))return da.fromBytes(e,t);try{return da.fromValue(e,0,t)}catch(e){if(e.code!==wo.errors.INVALID_ARGUMENT)throw e}return ta.throwArgumentError("invalid FixedNumber value","value",e)}static isFixedNumber(e){return!(!e||!e._isFixedNumber)}}const la=da.from(1),ha=da.from("0.5");var pa=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))};const ma=new wo("properties/5.7.0");function ga(e,t,r){Object.defineProperty(e,t,{enumerable:!0,value:r,writable:!1})}function ya(e,t){for(let r=0;r<32;r++){if(e[t])return e[t];if(!e.prototype||"object"!=typeof e.prototype)break;e=Object.getPrototypeOf(e.prototype).constructor}return null}function ba(e){return pa(this,void 0,void 0,(function*(){const t=Object.keys(e).map((t=>{const r=e[t];return Promise.resolve(r).then((e=>({key:t,value:e})))}));return(yield Promise.all(t)).reduce(((e,t)=>(e[t.key]=t.value,e)),{})}))}function va(e,t){e&&"object"==typeof e||ma.throwArgumentError("invalid object","object",e),Object.keys(e).forEach((r=>{t[r]||ma.throwArgumentError("invalid object key - "+r,"transaction:"+r,e)}))}function wa(e){const t={};for(const r in e)t[r]=e[r];return t}const Aa={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function _a(e){if(null==e||Aa[typeof e])return!0;if(Array.isArray(e)||"object"==typeof e){if(!Object.isFrozen(e))return!1;const t=Object.keys(e);for(let r=0;rSa(e))));if("object"==typeof e){const t={};for(const r in e){const n=e[r];void 0!==n&&ga(t,r,Sa(n))}return t}return ma.throwArgumentError("Cannot deepCopy "+typeof e,"object",e)}function Sa(e){return Ea(e)}class Pa{constructor(e){for(const t in e)this[t]=Sa(e[t])}}var xa=Object.freeze({__proto__:null,Description:Pa,checkProperties:va,deepCopy:Sa,defineReadOnly:ga,getStatic:ya,resolveProperties:ba,shallowCopy:wa});const ka="abi/5.7.0",Ma=new wo(ka),Ca={};let Ia={calldata:!0,memory:!0,storage:!0},Ra={calldata:!0,memory:!0};function Na(e,t){if("bytes"===e||"string"===e){if(Ia[t])return!0}else if("address"===e){if("payable"===t)return!0}else if((e.indexOf("[")>=0||"tuple"===e)&&Ra[t])return!0;return(Ia[t]||"payable"===t)&&Ma.throwArgumentError("invalid modifier","name",t),!1}function Oa(e,t){for(let r in t)ga(e,r,t[r])}const Ta=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),ja=new RegExp(/^(.*)\[([0-9]*)\]$/);class $a{constructor(e,t){e!==Ca&&Ma.throwError("use fromString",wo.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),Oa(this,t);let r=this.type.match(ja);Oa(this,r?{arrayLength:parseInt(r[2]||"-1"),arrayChildren:$a.fromObject({type:r[1],components:this.components}),baseType:"array"}:{arrayLength:null,arrayChildren:null,baseType:null!=this.components?"tuple":this.type}),this._isParamType=!0,Object.freeze(this)}format(e){if(e||(e=Ta.sighash),Ta[e]||Ma.throwArgumentError("invalid format type","format",e),e===Ta.json){let t={type:"tuple"===this.baseType?"tuple":this.type,name:this.name||void 0};return"boolean"==typeof this.indexed&&(t.indexed=this.indexed),this.components&&(t.components=this.components.map((t=>JSON.parse(t.format(e))))),JSON.stringify(t)}let t="";return"array"===this.baseType?(t+=this.arrayChildren.format(e),t+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):"tuple"===this.baseType?(e!==Ta.sighash&&(t+=this.type),t+="("+this.components.map((t=>t.format(e))).join(e===Ta.full?", ":",")+")"):t+=this.type,e!==Ta.sighash&&(!0===this.indexed&&(t+=" indexed"),e===Ta.full&&this.name&&(t+=" "+this.name)),t}static from(e,t){return"string"==typeof e?$a.fromString(e,t):$a.fromObject(e)}static fromObject(e){return $a.isParamType(e)?e:new $a(Ca,{name:e.name||null,type:Wa(e.type),indexed:null==e.indexed?null:!!e.indexed,components:e.components?e.components.map($a.fromObject):null})}static fromString(e,t){return r=function(e,t){let r=e;function n(t){Ma.throwArgumentError(`unexpected character at position ${t}`,"param",e)}function i(e){let r={type:"",name:"",parent:e,state:{allowType:!0}};return t&&(r.indexed=!1),r}e=e.replace(/\s/g," ");let o={type:"",name:"",state:{allowType:!0}},a=o;for(let r=0;r$a.fromString(e,t)))}class Ba{constructor(e,t){e!==Ca&&Ma.throwError("use a static from method",wo.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),Oa(this,t),this._isFragment=!0,Object.freeze(this)}static from(e){return Ba.isFragment(e)?e:"string"==typeof e?Ba.fromString(e):Ba.fromObject(e)}static fromObject(e){if(Ba.isFragment(e))return e;switch(e.type){case"function":return Ha.fromObject(e);case"event":return Fa.fromObject(e);case"constructor":return qa.fromObject(e);case"error":return Ja.fromObject(e);case"fallback":case"receive":return null}return Ma.throwArgumentError("invalid fragment object","value",e)}static fromString(e){return"event"===(e=(e=(e=e.replace(/\s/g," ")).replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," ")).trim()).split(" ")[0]?Fa.fromString(e.substring(5).trim()):"function"===e.split(" ")[0]?Ha.fromString(e.substring(8).trim()):"constructor"===e.split("(")[0].trim()?qa.fromString(e.trim()):"error"===e.split(" ")[0]?Ja.fromString(e.substring(5).trim()):Ma.throwArgumentError("unsupported fragment","value",e)}static isFragment(e){return!(!e||!e._isFragment)}}class Fa extends Ba{format(e){if(e||(e=Ta.sighash),Ta[e]||Ma.throwArgumentError("invalid format type","format",e),e===Ta.json)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==Ta.sighash&&(t+="event "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===Ta.full?", ":",")+") ",e!==Ta.sighash&&this.anonymous&&(t+="anonymous "),t.trim()}static from(e){return"string"==typeof e?Fa.fromString(e):Fa.fromObject(e)}static fromObject(e){if(Fa.isEventFragment(e))return e;"event"!==e.type&&Ma.throwArgumentError("invalid event object","value",e);const t={name:Va(e.name),anonymous:e.anonymous,inputs:e.inputs?e.inputs.map($a.fromObject):[],type:"event"};return new Fa(Ca,t)}static fromString(e){let t=e.match(Za);t||Ma.throwArgumentError("invalid event string","value",e);let r=!1;return t[3].split(" ").forEach((e=>{switch(e.trim()){case"anonymous":r=!0;break;case"":break;default:Ma.warn("unknown modifier: "+e)}})),Fa.fromObject({name:t[1].trim(),anonymous:r,inputs:Da(t[2],!0),type:"event"})}static isEventFragment(e){return e&&e._isFragment&&"event"===e.type}}function za(e,t){t.gas=null;let r=e.split("@");return 1!==r.length?(r.length>2&&Ma.throwArgumentError("invalid human-readable ABI signature","value",e),r[1].match(/^[0-9]+$/)||Ma.throwArgumentError("invalid human-readable ABI signature gas","value",e),t.gas=Zo.from(r[1]),r[0]):e}function Ua(e,t){t.constant=!1,t.payable=!1,t.stateMutability="nonpayable",e.split(" ").forEach((e=>{switch(e.trim()){case"constant":t.constant=!0;break;case"payable":t.payable=!0,t.stateMutability="payable";break;case"nonpayable":t.payable=!1,t.stateMutability="nonpayable";break;case"pure":t.constant=!0,t.stateMutability="pure";break;case"view":t.constant=!0,t.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+e)}}))}function La(e){let t={constant:!1,payable:!0,stateMutability:"payable"};return null!=e.stateMutability?(t.stateMutability=e.stateMutability,t.constant="view"===t.stateMutability||"pure"===t.stateMutability,null!=e.constant&&!!e.constant!==t.constant&&Ma.throwArgumentError("cannot have constant function with mutability "+t.stateMutability,"value",e),t.payable="payable"===t.stateMutability,null!=e.payable&&!!e.payable!==t.payable&&Ma.throwArgumentError("cannot have payable function with mutability "+t.stateMutability,"value",e)):null!=e.payable?(t.payable=!!e.payable,null!=e.constant||t.payable||"constructor"===e.type||Ma.throwArgumentError("unable to determine stateMutability","value",e),t.constant=!!e.constant,t.constant?t.stateMutability="view":t.stateMutability=t.payable?"payable":"nonpayable",t.payable&&t.constant&&Ma.throwArgumentError("cannot have constant payable function","value",e)):null!=e.constant?(t.constant=!!e.constant,t.payable=!t.constant,t.stateMutability=t.constant?"view":"payable"):"constructor"!==e.type&&Ma.throwArgumentError("unable to determine stateMutability","value",e),t}class qa extends Ba{format(e){if(e||(e=Ta.sighash),Ta[e]||Ma.throwArgumentError("invalid format type","format",e),e===Ta.json)return JSON.stringify({type:"constructor",stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});e===Ta.sighash&&Ma.throwError("cannot format a constructor for sighash",wo.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});let t="constructor("+this.inputs.map((t=>t.format(e))).join(e===Ta.full?", ":",")+") ";return this.stateMutability&&"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "),t.trim()}static from(e){return"string"==typeof e?qa.fromString(e):qa.fromObject(e)}static fromObject(e){if(qa.isConstructorFragment(e))return e;"constructor"!==e.type&&Ma.throwArgumentError("invalid constructor object","value",e);let t=La(e);t.constant&&Ma.throwArgumentError("constructor cannot be constant","value",e);const r={name:null,type:e.type,inputs:e.inputs?e.inputs.map($a.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?Zo.from(e.gas):null};return new qa(Ca,r)}static fromString(e){let t={type:"constructor"},r=(e=za(e,t)).match(Za);return r&&"constructor"===r[1].trim()||Ma.throwArgumentError("invalid constructor string","value",e),t.inputs=Da(r[2].trim(),!1),Ua(r[3].trim(),t),qa.fromObject(t)}static isConstructorFragment(e){return e&&e._isFragment&&"constructor"===e.type}}class Ha extends qa{format(e){if(e||(e=Ta.sighash),Ta[e]||Ma.throwArgumentError("invalid format type","format",e),e===Ta.json)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((t=>JSON.parse(t.format(e)))),outputs:this.outputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==Ta.sighash&&(t+="function "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===Ta.full?", ":",")+") ",e!==Ta.sighash&&(this.stateMutability?"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "):this.constant&&(t+="view "),this.outputs&&this.outputs.length&&(t+="returns ("+this.outputs.map((t=>t.format(e))).join(", ")+") "),null!=this.gas&&(t+="@"+this.gas.toString()+" ")),t.trim()}static from(e){return"string"==typeof e?Ha.fromString(e):Ha.fromObject(e)}static fromObject(e){if(Ha.isFunctionFragment(e))return e;"function"!==e.type&&Ma.throwArgumentError("invalid function object","value",e);let t=La(e);const r={type:e.type,name:Va(e.name),constant:t.constant,inputs:e.inputs?e.inputs.map($a.fromObject):[],outputs:e.outputs?e.outputs.map($a.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?Zo.from(e.gas):null};return new Ha(Ca,r)}static fromString(e){let t={type:"function"},r=(e=za(e,t)).split(" returns ");r.length>2&&Ma.throwArgumentError("invalid function string","value",e);let n=r[0].match(Za);if(n||Ma.throwArgumentError("invalid function signature","value",e),t.name=n[1].trim(),t.name&&Va(t.name),t.inputs=Da(n[2],!1),Ua(n[3].trim(),t),r.length>1){let n=r[1].match(Za);""==n[1].trim()&&""==n[3].trim()||Ma.throwArgumentError("unexpected tokens","value",e),t.outputs=Da(n[2],!1)}else t.outputs=[];return Ha.fromObject(t)}static isFunctionFragment(e){return e&&e._isFragment&&"function"===e.type}}function Ka(e){const t=e.format();return"Error(string)"!==t&&"Panic(uint256)"!==t||Ma.throwArgumentError(`cannot specify user defined ${t} error`,"fragment",e),e}class Ja extends Ba{format(e){if(e||(e=Ta.sighash),Ta[e]||Ma.throwArgumentError("invalid format type","format",e),e===Ta.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==Ta.sighash&&(t+="error "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===Ta.full?", ":",")+") ",t.trim()}static from(e){return"string"==typeof e?Ja.fromString(e):Ja.fromObject(e)}static fromObject(e){if(Ja.isErrorFragment(e))return e;"error"!==e.type&&Ma.throwArgumentError("invalid error object","value",e);const t={type:e.type,name:Va(e.name),inputs:e.inputs?e.inputs.map($a.fromObject):[]};return Ka(new Ja(Ca,t))}static fromString(e){let t={type:"error"},r=e.match(Za);return r||Ma.throwArgumentError("invalid error signature","value",e),t.name=r[1].trim(),t.name&&Va(t.name),t.inputs=Da(r[2],!1),Ka(Ja.fromObject(t))}static isErrorFragment(e){return e&&e._isFragment&&"error"===e.type}}function Wa(e){return e.match(/^uint($|[^1-9])/)?e="uint256"+e.substring(4):e.match(/^int($|[^1-9])/)&&(e="int256"+e.substring(3)),e}const Ga=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function Va(e){return e&&e.match(Ga)||Ma.throwArgumentError(`invalid identifier "${e}"`,"value",e),e}const Za=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$");const Xa=new wo(ka);function Qa(e){const t=[],r=function(e,n){if(Array.isArray(n))for(let i in n){const o=e.slice();o.push(i);try{r(o,n[i])}catch(e){t.push({path:o,error:e})}}};return r([],e),t}class Ya{constructor(e,t,r,n){this.name=e,this.type=t,this.localName=r,this.dynamic=n}_throwError(e,t){Xa.throwArgumentError(e,this.localName,t)}}class es{constructor(e){ga(this,"wordSize",e||32),this._data=[],this._dataLength=0,this._padding=new Uint8Array(e)}get data(){return Do(this._data)}get length(){return this._dataLength}_writeData(e){return this._data.push(e),this._dataLength+=e.length,e.length}appendWriter(e){return this._writeData(Co(e._data))}writeBytes(e){let t=Mo(e);const r=t.length%this.wordSize;return r&&(t=Co([t,this._padding.slice(r)])),this._writeData(t)}_getValue(e){let t=Mo(Zo.from(e));return t.length>this.wordSize&&Xa.throwError("value out-of-bounds",wo.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:t.length}),t.length%this.wordSize&&(t=Co([this._padding.slice(t.length%this.wordSize),t])),t}writeValue(e){return this._writeData(this._getValue(e))}writeUpdatableValue(){const e=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,t=>{this._data[e]=this._getValue(t)}}}class ts{constructor(e,t,r,n){ga(this,"_data",Mo(e)),ga(this,"wordSize",t||32),ga(this,"_coerceFunc",r),ga(this,"allowLoose",n),this._offset=0}get data(){return To(this._data)}get consumed(){return this._offset}static coerce(e,t){let r=e.match("^u?int([0-9]+)$");return r&&parseInt(r[1])<=48&&(t=t.toNumber()),t}coerce(e,t){return this._coerceFunc?this._coerceFunc(e,t):ts.coerce(e,t)}_peekBytes(e,t,r){let n=Math.ceil(t/this.wordSize)*this.wordSize;return this._offset+n>this._data.length&&(this.allowLoose&&r&&this._offset+t<=this._data.length?n=t:Xa.throwError("data out-of-bounds",wo.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+n})),this._data.slice(this._offset,this._offset+n)}subReader(e){return new ts(this._data.slice(this._offset+e),this.wordSize,this._coerceFunc,this.allowLoose)}readBytes(e,t){let r=this._peekBytes(0,e,!!t);return this._offset+=r.length,r.slice(0,e)}readValue(){return Zo.from(this.readBytes(this.wordSize))}}var rs,ns={exports:{}}; /** * [js-sha3]{@link https://github.com/emn178/js-sha3} * @@ -6,10 +6,10 @@ function e(e,t=!1,r=!0){let n="";return n=(e=>{const t=[];for(let r=0;r>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var n=0;n<50;++n)this.s[n]=0}function R(e,t,r){I.call(this,e,t,r)}I.prototype.update=function(t){if(this.finalized)throw new Error("finalize already called");var r,n=typeof t;if("string"!==n){if("object"!==n)throw new Error(e);if(null===t)throw new Error(e);if(o&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||o&&ArrayBuffer.isView(t)))throw new Error(e);r=!0}for(var i,a,s=this.blocks,c=this.byteCount,f=t.length,d=this.blockCount,l=0,h=this.s;l>2]|=t[l]<>2]|=a<>2]|=(192|a>>6)<>2]|=(128|63&a)<=57344?(s[i>>2]|=(224|a>>12)<>2]|=(128|a>>6&63)<>2]|=(128|63&a)<>2]|=(240|a>>18)<>2]|=(128|a>>12&63)<>2]|=(128|a>>6&63)<>2]|=(128|63&a)<=c){for(this.start=i-c,this.block=s[d],i=0;i>=8);r>0;)i.unshift(r),r=255&(e>>=8),++n;return t?i.push(n):i.unshift(n),this.update(i),i.length},I.prototype.encodeString=function(t){var r,n=typeof t;if("string"!==n){if("object"!==n)throw new Error(e);if(null===t)throw new Error(e);if(o&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||o&&ArrayBuffer.isView(t)))throw new Error(e);r=!0}var i=0,a=t.length;if(r)i=a;else for(var s=0;s=57344?i+=3:(c=65536+((1023&c)<<10|1023&t.charCodeAt(++s)),i+=4)}return i+=this.encode(8*i),this.update(t),i},I.prototype.bytepad=function(e,t){for(var r=this.encode(t),n=0;n>2]|=this.padding[3&t],this.lastByteIndex===this.byteCount)for(e[0]=e[r],t=1;t>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];a%t==0&&(N(r),o=0)}return i&&(e=r[o],c+=s[e>>4&15]+s[15&e],i>1&&(c+=s[e>>12&15]+s[e>>8&15]),i>2&&(c+=s[e>>20&15]+s[e>>16&15])),c},I.prototype.arrayBuffer=function(){this.finalize();var e,t=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,a=0,s=this.outputBits>>3;e=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(s);for(var c=new Uint32Array(e);a>8&255,c[e+2]=t>>16&255,c[e+3]=t>>24&255;s%r==0&&N(n)}return o&&(e=s<<2,t=n[a],c[e]=255&t,o>1&&(c[e+1]=t>>8&255),o>2&&(c[e+2]=t>>16&255)),c},R.prototype=new I,R.prototype.finalize=function(){return this.encode(this.outputBits,!0),I.prototype.finalize.call(this)};var N=function(e){var t,r,n,i,o,a,s,c,u,d,l,h,p,m,g,y,b,v,w,A,_,E,S,P,x,k,M,C,I,R,N,O,T,j,$,D,B,F,z,U,L,q,H,K,J,W,G,V,Z,X,Q,Y,ee,te,re,ne,ie,oe,ae,se,ce,ue,fe;for(n=0;n<48;n+=2)i=e[0]^e[10]^e[20]^e[30]^e[40],o=e[1]^e[11]^e[21]^e[31]^e[41],a=e[2]^e[12]^e[22]^e[32]^e[42],s=e[3]^e[13]^e[23]^e[33]^e[43],c=e[4]^e[14]^e[24]^e[34]^e[44],u=e[5]^e[15]^e[25]^e[35]^e[45],d=e[6]^e[16]^e[26]^e[36]^e[46],l=e[7]^e[17]^e[27]^e[37]^e[47],t=(h=e[8]^e[18]^e[28]^e[38]^e[48])^(a<<1|s>>>31),r=(p=e[9]^e[19]^e[29]^e[39]^e[49])^(s<<1|a>>>31),e[0]^=t,e[1]^=r,e[10]^=t,e[11]^=r,e[20]^=t,e[21]^=r,e[30]^=t,e[31]^=r,e[40]^=t,e[41]^=r,t=i^(c<<1|u>>>31),r=o^(u<<1|c>>>31),e[2]^=t,e[3]^=r,e[12]^=t,e[13]^=r,e[22]^=t,e[23]^=r,e[32]^=t,e[33]^=r,e[42]^=t,e[43]^=r,t=a^(d<<1|l>>>31),r=s^(l<<1|d>>>31),e[4]^=t,e[5]^=r,e[14]^=t,e[15]^=r,e[24]^=t,e[25]^=r,e[34]^=t,e[35]^=r,e[44]^=t,e[45]^=r,t=c^(h<<1|p>>>31),r=u^(p<<1|h>>>31),e[6]^=t,e[7]^=r,e[16]^=t,e[17]^=r,e[26]^=t,e[27]^=r,e[36]^=t,e[37]^=r,e[46]^=t,e[47]^=r,t=d^(i<<1|o>>>31),r=l^(o<<1|i>>>31),e[8]^=t,e[9]^=r,e[18]^=t,e[19]^=r,e[28]^=t,e[29]^=r,e[38]^=t,e[39]^=r,e[48]^=t,e[49]^=r,m=e[0],g=e[1],W=e[11]<<4|e[10]>>>28,G=e[10]<<4|e[11]>>>28,C=e[20]<<3|e[21]>>>29,I=e[21]<<3|e[20]>>>29,se=e[31]<<9|e[30]>>>23,ce=e[30]<<9|e[31]>>>23,q=e[40]<<18|e[41]>>>14,H=e[41]<<18|e[40]>>>14,j=e[2]<<1|e[3]>>>31,$=e[3]<<1|e[2]>>>31,y=e[13]<<12|e[12]>>>20,b=e[12]<<12|e[13]>>>20,V=e[22]<<10|e[23]>>>22,Z=e[23]<<10|e[22]>>>22,R=e[33]<<13|e[32]>>>19,N=e[32]<<13|e[33]>>>19,ue=e[42]<<2|e[43]>>>30,fe=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,re=e[4]<<30|e[5]>>>2,D=e[14]<<6|e[15]>>>26,B=e[15]<<6|e[14]>>>26,v=e[25]<<11|e[24]>>>21,w=e[24]<<11|e[25]>>>21,X=e[34]<<15|e[35]>>>17,Q=e[35]<<15|e[34]>>>17,O=e[45]<<29|e[44]>>>3,T=e[44]<<29|e[45]>>>3,P=e[6]<<28|e[7]>>>4,x=e[7]<<28|e[6]>>>4,ne=e[17]<<23|e[16]>>>9,ie=e[16]<<23|e[17]>>>9,F=e[26]<<25|e[27]>>>7,z=e[27]<<25|e[26]>>>7,A=e[36]<<21|e[37]>>>11,_=e[37]<<21|e[36]>>>11,Y=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,K=e[8]<<27|e[9]>>>5,J=e[9]<<27|e[8]>>>5,k=e[18]<<20|e[19]>>>12,M=e[19]<<20|e[18]>>>12,oe=e[29]<<7|e[28]>>>25,ae=e[28]<<7|e[29]>>>25,U=e[38]<<8|e[39]>>>24,L=e[39]<<8|e[38]>>>24,E=e[48]<<14|e[49]>>>18,S=e[49]<<14|e[48]>>>18,e[0]=m^~y&v,e[1]=g^~b&w,e[10]=P^~k&C,e[11]=x^~M&I,e[20]=j^~D&F,e[21]=$^~B&z,e[30]=K^~W&V,e[31]=J^~G&Z,e[40]=te^~ne&oe,e[41]=re^~ie&ae,e[2]=y^~v&A,e[3]=b^~w&_,e[12]=k^~C&R,e[13]=M^~I&N,e[22]=D^~F&U,e[23]=B^~z&L,e[32]=W^~V&X,e[33]=G^~Z&Q,e[42]=ne^~oe&se,e[43]=ie^~ae&ce,e[4]=v^~A&E,e[5]=w^~_&S,e[14]=C^~R&O,e[15]=I^~N&T,e[24]=F^~U&q,e[25]=z^~L&H,e[34]=V^~X&Y,e[35]=Z^~Q&ee,e[44]=oe^~se&ue,e[45]=ae^~ce&fe,e[6]=A^~E&m,e[7]=_^~S&g,e[16]=R^~O&P,e[17]=N^~T&x,e[26]=U^~q&j,e[27]=L^~H&$,e[36]=X^~Y&K,e[37]=Q^~ee&J,e[46]=se^~ue&te,e[47]=ce^~fe&re,e[8]=E^~m&y,e[9]=S^~g&b,e[18]=O^~P&k,e[19]=T^~x&M,e[28]=q^~j&D,e[29]=H^~$&B,e[38]=Y^~K&W,e[39]=ee^~J&G,e[48]=ue^~te&ne,e[49]=fe^~re&ie,e[0]^=f[n],e[1]^=f[n+1]};if(i)es.exports=_;else for(S=0;S>=8;return t}function ss(e,t,r){let n=0;for(let i=0;it+1+n&&os.throwError("child data too short",bo.errors.BUFFER_OVERRUN,{})}return{consumed:1+n,result:i}}function ds(e,t){if(0===e.length&&os.throwError("data too short",bo.errors.BUFFER_OVERRUN,{}),e[t]>=248){const r=e[t]-247;t+1+r>e.length&&os.throwError("data short segment too short",bo.errors.BUFFER_OVERRUN,{});const n=ss(e,t+1,r);return t+1+r+n>e.length&&os.throwError("data long segment too short",bo.errors.BUFFER_OVERRUN,{}),fs(e,t,t+1+r,r+n)}if(e[t]>=192){const r=e[t]-192;return t+1+r>e.length&&os.throwError("data array too short",bo.errors.BUFFER_OVERRUN,{}),fs(e,t,t+1,r)}if(e[t]>=184){const r=e[t]-183;t+1+r>e.length&&os.throwError("data array too short",bo.errors.BUFFER_OVERRUN,{});const n=ss(e,t+1,r);t+1+r+n>e.length&&os.throwError("data array too short",bo.errors.BUFFER_OVERRUN,{});return{consumed:1+r+n,result:No(e.slice(t+1+r,t+1+r+n))}}if(e[t]>=128){const r=e[t]-128;t+1+r>e.length&&os.throwError("data too short",bo.errors.BUFFER_OVERRUN,{});return{consumed:1+r,result:No(e.slice(t+1,t+1+r))}}return{consumed:1,result:No(e[t])}}function ls(e){const t=xo(e),r=ds(t,0);return r.consumed!==t.length&&os.throwArgumentError("invalid rlp data","data",e),r.result}var hs=Object.freeze({__proto__:null,decode:ls,encode:us});const ps=new bo("address/5.7.0");function ms(e){Io(e,20)||ps.throwArgumentError("invalid address","address",e);const t=(e=e.toLowerCase()).substring(2).split(""),r=new Uint8Array(40);for(let e=0;e<40;e++)r[e]=t[e].charCodeAt(0);const n=xo(ns(r));for(let e=0;e<40;e+=2)n[e>>1]>>4>=8&&(t[e]=t[e].toUpperCase()),(15&n[e>>1])>=8&&(t[e+1]=t[e+1].toUpperCase());return"0x"+t.join("")}const gs={};for(let e=0;e<10;e++)gs[String(e)]=String(e);for(let e=0;e<26;e++)gs[String.fromCharCode(65+e)]=String(10+e);const ys=Math.floor(function(e){return Math.log10?Math.log10(e):Math.log(e)/Math.LN10}(9007199254740991));function bs(e){let t=(e=(e=e.toUpperCase()).substring(4)+e.substring(0,2)+"00").split("").map((e=>gs[e])).join("");for(;t.length>=ys;){let e=t.substring(0,ys);t=parseInt(e,10)%97+t.substring(e.length)}let r=String(98-parseInt(t,10)%97);for(;r.length<2;)r="0"+r;return r}function vs(e){let t=null;if("string"!=typeof e&&ps.throwArgumentError("invalid address","address",e),e.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==e.substring(0,2)&&(e="0x"+e),t=ms(e),e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==e&&ps.throwArgumentError("bad address checksum","address",e);else if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(e.substring(2,4)!==bs(e)&&ps.throwArgumentError("bad icap checksum","address",e),r=e.substring(4),t=new qo(r,36).toString(16);t.length<40;)t="0"+t;t=ms("0x"+t)}else ps.throwArgumentError("invalid address","address",e);var r;return t}function ws(e){let t=null;try{t=vs(e.from)}catch(t){ps.throwArgumentError("missing from address","transaction",e)}return vs(To(ns(us([t,Mo(xo(Go.from(e.nonce).toHexString()))])),12))}var As=Object.freeze({__proto__:null,getAddress:vs,getContractAddress:ws,getCreate2Address:function(e,t,r){return 32!==Oo(t)&&ps.throwArgumentError("salt must be 32 bytes","salt",t),32!==Oo(r)&&ps.throwArgumentError("initCodeHash must be 32 bytes","initCodeHash",r),vs(To(ns(ko(["0xff",vs(e),t,r])),12))},getIcapAddress:function(e){let t=(r=vs(e).substring(2),new qo(r,16).toString(36)).toUpperCase();for(var r;t.length<30;)t="0"+t;return"XE"+bs("XE00"+t)+t},isAddress:function(e){try{return vs(e),!0}catch(e){}return!1}});class _s extends Xa{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,t){try{t=vs(t)}catch(e){this._throwError(e.message,t)}return e.writeValue(t)}decode(e){return vs(Bo(e.readValue().toHexString(),20))}}class Es extends Xa{constructor(e){super(e.name,e.type,void 0,e.dynamic),this.coder=e}defaultValue(){return this.coder.defaultValue()}encode(e,t){return this.coder.encode(e,t)}decode(e){return this.coder.decode(e)}}const Ss=new bo(Pa);function Ps(e,t,r){let n=null;if(Array.isArray(r))n=r;else if(r&&"object"==typeof r){let e={};n=t.map((t=>{const n=t.localName;return n||Ss.throwError("cannot encode object for signature with missing names",bo.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:r}),e[n]&&Ss.throwError("cannot encode object for signature with duplicate names",bo.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:r}),e[n]=!0,r[n]}))}else Ss.throwArgumentError("invalid tuple value","tuple",r);t.length!==n.length&&Ss.throwArgumentError("types/value length mismatch","tuple",r);let i=new Qa(e.wordSize),o=new Qa(e.wordSize),a=[];t.forEach(((e,t)=>{let r=n[t];if(e.dynamic){let t=o.length;e.encode(o,r);let n=i.writeUpdatableValue();a.push((e=>{n(e+t)}))}else e.encode(i,r)})),a.forEach((e=>{e(i.length)}));let s=e.appendWriter(i);return s+=e.appendWriter(o),s}function xs(e,t){let r=[],n=e.subReader(0);t.forEach((t=>{let i=null;if(t.dynamic){let r=e.readValue(),o=n.subReader(r.toNumber());try{i=t.decode(o)}catch(e){if(e.code===bo.errors.BUFFER_OVERRUN)throw e;i=e,i.baseType=t.name,i.name=t.localName,i.type=t.type}}else try{i=t.decode(e)}catch(e){if(e.code===bo.errors.BUFFER_OVERRUN)throw e;i=e,i.baseType=t.name,i.name=t.localName,i.type=t.type}null!=i&&r.push(i)}));const i=t.reduce(((e,t)=>{const r=t.localName;return r&&(e[r]||(e[r]=0),e[r]++),e}),{});t.forEach(((e,t)=>{let n=e.localName;if(!n||1!==i[n])return;if("length"===n&&(n="_length"),null!=r[n])return;const o=r[t];o instanceof Error?Object.defineProperty(r,n,{enumerable:!0,get:()=>{throw o}}):r[n]=o}));for(let e=0;e{throw t}})}return Object.freeze(r)}class ks extends Xa{constructor(e,t,r){super("array",e.type+"["+(t>=0?t:"")+"]",r,-1===t||e.dynamic),this.coder=e,this.length=t}defaultValue(){const e=this.coder.defaultValue(),t=[];for(let r=0;re._data.length&&Ss.throwError("insufficient data length",bo.errors.BUFFER_OVERRUN,{length:e._data.length,count:t}));let r=[];for(let e=0;e>6==2;n++)e++;return e}return e===Us.OVERRUN?r.length-t-1:0}!function(e){e.current="",e.NFC="NFC",e.NFD="NFD",e.NFKC="NFKC",e.NFKD="NFKD"}(zs||(zs={})),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"}(Us||(Us={}));const qs=Object.freeze({error:function(e,t,r,n,i){return Fs.throwArgumentError(`invalid codepoint at offset ${t}; ${e}`,"bytes",r)},ignore:Ls,replace:function(e,t,r,n,i){return e===Us.OVERLONG?(n.push(i),0):(n.push(65533),Ls(e,t,r))}});function Hs(e,t){null==t&&(t=qs.error),e=xo(e);const r=[];let n=0;for(;n>7==0){r.push(i);continue}let o=null,a=null;if(192==(224&i))o=1,a=127;else if(224==(240&i))o=2,a=2047;else{if(240!=(248&i)){n+=t(128==(192&i)?Us.UNEXPECTED_CONTINUE:Us.BAD_PREFIX,n-1,e,r);continue}o=3,a=65535}if(n-1+o>=e.length){n+=t(Us.OVERRUN,n-1,e,r);continue}let s=i&(1<<8-o-1)-1;for(let i=0;i1114111?n+=t(Us.OUT_OF_RANGE,n-1-o,e,r,s):s>=55296&&s<=57343?n+=t(Us.UTF16_SURROGATE,n-1-o,e,r,s):s<=a?n+=t(Us.OVERLONG,n-1-o,e,r,s):r.push(s))}return r}function Ks(e,t=zs.current){t!=zs.current&&(Fs.checkNormalize(),e=e.normalize(t));let r=[];for(let t=0;t>6|192),r.push(63&n|128);else if(55296==(64512&n)){t++;const i=e.charCodeAt(t);if(t>=e.length||56320!=(64512&i))throw new Error("invalid utf-8 string");const o=65536+((1023&n)<<10)+(1023&i);r.push(o>>18|240),r.push(o>>12&63|128),r.push(o>>6&63|128),r.push(63&o|128)}else r.push(n>>12|224),r.push(n>>6&63|128),r.push(63&n|128)}return xo(r)}function Js(e){const t="0000"+e.toString(16);return"\\u"+t.substring(t.length-4)}function Ws(e){return e.map((e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10&1023),56320+(1023&e))))).join("")}function Gs(e,t){return Ws(Hs(e,t))}function Vs(e,t=zs.current){return Hs(Ks(e,t))}function Zs(e,t){t||(t=function(e){return[parseInt(e,16)]});let r=0,n={};return e.split(",").forEach((e=>{let i=e.split(":");r+=parseInt(i[0],16),n[r]=t(i[1])})),n}function Xs(e){let t=0;return e.split(",").map((e=>{let r=e.split("-");1===r.length?r[1]="0":""===r[1]&&(r[1]="1");let n=t+parseInt(r[0],16);return t=parseInt(r[1],16),{l:n,h:t}}))}function Qs(e,t){let r=0;for(let n=0;n=r&&e<=r+i.h&&(e-r)%(i.d||1)==0){if(i.e&&-1!==i.e.indexOf(e-r))continue;return i}}return null}const Ys=Xs("221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d"),ec="ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map((e=>parseInt(e,16))),tc=[{h:25,s:32,l:65},{h:30,s:32,e:[23],l:127},{h:54,s:1,e:[48],l:64,d:2},{h:14,s:1,l:57,d:2},{h:44,s:1,l:17,d:2},{h:10,s:1,e:[2,6,8],l:61,d:2},{h:16,s:1,l:68,d:2},{h:84,s:1,e:[18,24,66],l:19,d:2},{h:26,s:32,e:[17],l:435},{h:22,s:1,l:71,d:2},{h:15,s:80,l:40},{h:31,s:32,l:16},{h:32,s:1,l:80,d:2},{h:52,s:1,l:42,d:2},{h:12,s:1,l:55,d:2},{h:40,s:1,e:[38],l:15,d:2},{h:14,s:1,l:48,d:2},{h:37,s:48,l:49},{h:148,s:1,l:6351,d:2},{h:88,s:1,l:160,d:2},{h:15,s:16,l:704},{h:25,s:26,l:854},{h:25,s:32,l:55915},{h:37,s:40,l:1247},{h:25,s:-119711,l:53248},{h:25,s:-119763,l:52},{h:25,s:-119815,l:52},{h:25,s:-119867,e:[1,4,5,7,8,11,12,17],l:52},{h:25,s:-119919,l:52},{h:24,s:-119971,e:[2,7,8,17],l:52},{h:24,s:-120023,e:[2,7,13,15,16,17],l:52},{h:25,s:-120075,l:52},{h:25,s:-120127,l:52},{h:25,s:-120179,l:52},{h:25,s:-120231,l:52},{h:25,s:-120283,l:52},{h:25,s:-120335,l:52},{h:24,s:-119543,e:[17],l:56},{h:24,s:-119601,e:[17],l:58},{h:24,s:-119659,e:[17],l:58},{h:24,s:-119717,e:[17],l:58},{h:24,s:-119775,e:[17],l:58}],rc=Zs("b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3"),nc=Zs("179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7"),ic=Zs("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D",(function(e){if(e.length%4!=0)throw new Error("bad data");let t=[];for(let r=0;r{if(e<256){switch(e){case 8:return"\\b";case 9:return"\\t";case 10:return"\\n";case 13:return"\\r";case 34:return'\\"';case 92:return"\\\\"}if(e>=32&&e<127)return String.fromCharCode(e)}return e<=65535?Js(e):Js(55296+((e-=65536)>>10&1023))+Js(56320+(1023&e))})).join("")+'"'},formatBytes32String:function(e){const t=Ks(e);if(t.length>31)throw new Error("bytes32 string must be less than 32 bytes");return No(ko([t,Ds]).slice(0,32))},nameprep:function(e){if(e.match(/^[a-z0-9-]*$/i)&&e.length<=59)return e.toLowerCase();let t=Vs(e);var r;r=t.map((e=>{if(ec.indexOf(e)>=0)return[];if(e>=65024&&e<=65039)return[];let t=function(e){let t=Qs(e,tc);if(t)return[e+t.s];let r=rc[e];if(r)return r;let n=nc[e];return n?[e+n[0]]:ic[e]||null}(e);return t||[e]})),t=r.reduce(((e,t)=>(t.forEach((t=>{e.push(t)})),e)),[]),t=Vs(Ws(t),zs.NFKC),t.forEach((e=>{if(Qs(e,oc))throw new Error("STRINGPREP_CONTAINS_PROHIBITED")})),t.forEach((e=>{if(Qs(e,Ys))throw new Error("STRINGPREP_CONTAINS_UNASSIGNED")}));let n=Ws(t);if("-"===n.substring(0,1)||"--"===n.substring(2,4)||"-"===n.substring(n.length-1))throw new Error("invalid hyphen");return n},parseBytes32String:function(e){const t=xo(e);if(32!==t.length)throw new Error("invalid bytes32 - not 32 bytes long");if(0!==t[31])throw new Error("invalid bytes32 string - no null terminator");let r=31;for(;0===t[r-1];)r--;return Gs(t.slice(0,r))},toUtf8Bytes:Ks,toUtf8CodePoints:Vs,toUtf8String:Gs});class sc extends Cs{constructor(e){super("string",e)}defaultValue(){return""}encode(e,t){return super.encode(e,Ks(t))}decode(e){return Gs(super.decode(e))}}class cc extends Xa{constructor(e,t){let r=!1;const n=[];e.forEach((e=>{e.dynamic&&(r=!0),n.push(e.type)}));super("tuple","tuple("+n.join(",")+")",t,r),this.coders=e}defaultValue(){const e=[];this.coders.forEach((t=>{e.push(t.defaultValue())}));const t=this.coders.reduce(((e,t)=>{const r=t.localName;return r&&(e[r]||(e[r]=0),e[r]++),e}),{});return this.coders.forEach(((r,n)=>{let i=r.localName;i&&1===t[i]&&("length"===i&&(i="_length"),null==e[i]&&(e[i]=e[n]))})),Object.freeze(e)}encode(e,t){return Ps(e,this.coders,t)}decode(e){return e.coerce(this.name,xs(e,this.coders))}}const uc=new bo(Pa),fc=new RegExp(/^bytes([0-9]*)$/),dc=new RegExp(/^(u?int)([0-9]*)$/);class lc{constructor(e){pa(this,"coerceFunc",e||null)}_getCoder(e){switch(e.baseType){case"address":return new _s(e.name);case"bool":return new Ms(e.name);case"string":return new sc(e.name);case"bytes":return new Is(e.name);case"array":return new ks(this._getCoder(e.arrayChildren),e.arrayLength,e.name);case"tuple":return new cc((e.components||[]).map((e=>this._getCoder(e))),e.name);case"":return new Ns(e.name)}let t=e.type.match(dc);if(t){let r=parseInt(t[2]||"256");return(0===r||r>256||r%8!=0)&&uc.throwArgumentError("invalid "+t[1]+" bit length","param",e),new Bs(r/8,"int"===t[1],e.name)}if(t=e.type.match(fc),t){let r=parseInt(t[1]);return(0===r||r>32)&&uc.throwArgumentError("invalid bytes length","param",e),new Rs(r,e.name)}return uc.throwArgumentError("invalid type","type",e.type)}_getWordSize(){return 32}_getReader(e,t){return new Ya(e,this._getWordSize(),this.coerceFunc,t)}_getWriter(){return new Qa(this._getWordSize())}getDefaultValue(e){const t=e.map((e=>this._getCoder(Ta.from(e))));return new cc(t,"_").defaultValue()}encode(e,t){e.length!==t.length&&uc.throwError("types/values length mismatch",bo.errors.INVALID_ARGUMENT,{count:{types:e.length,values:t.length},value:{types:e,values:t}});const r=e.map((e=>this._getCoder(Ta.from(e)))),n=new cc(r,"_"),i=this._getWriter();return n.encode(i,t),i.data}decode(e,t,r){const n=e.map((e=>this._getCoder(Ta.from(e))));return new cc(n,"_").decode(this._getReader(xo(t),r))}}const hc=new lc;function pc(e){return ns(Ks(e))}const mc="hash/5.7.0";function gc(e){e=atob(e);const t=[];for(let r=0;r0&&Array.isArray(e)?i(e,t-1):r.push(e)}))};return i(e,t),r}function wc(e){return function(e){let t=0;return()=>e[t++]}(function(e){let t=0;function r(){return e[t++]<<8|e[t++]}let n=r(),i=1,o=[0,1];for(let e=1;e>--c&1}const d=Math.pow(2,31),l=d>>>1,h=l>>1,p=d-1;let m=0;for(let e=0;e<31;e++)m=m<<1|f();let g=[],y=0,b=d;for(;;){let e=Math.floor(((m-y+1)*i-1)/b),t=0,r=n;for(;r-t>1;){let n=t+r>>>1;e>>1|f(),a=a<<1^l,s=(s^l)<<1|l|1;y=a,b=1+s-a}let v=n-4;return g.map((t=>{switch(t-v){case 3:return v+65792+(e[s++]<<16|e[s++]<<8|e[s++]);case 2:return v+256+(e[s++]<<8|e[s++]);case 1:return v+e[s++];default:return t-1}}))}(e))}function Ac(e){return 1&e?~e>>1:e>>1}function _c(e,t){let r=Array(e);for(let n=0,i=-1;nt[e])):r}function Pc(e,t,r){let n=Array(e).fill(void 0).map((()=>[]));for(let i=0;in[t].push(e)));return n}function xc(e,t){let r=1+t(),n=t(),i=function(e){let t=[];for(;;){let r=e();if(0==r)break;t.push(r)}return t}(t);return vc(Pc(i.length,1+e,t).map(((e,t)=>{const o=e[0],a=e.slice(1);return Array(i[t]).fill(void 0).map(((e,t)=>{let i=t*n;return[o+t*r,a.map((e=>e+i))]}))})))}function kc(e,t){return Pc(1+t(),1+e,t).map((e=>[e[0],e.slice(1)]))}const Mc=wc(gc("AEQF2AO2DEsA2wIrAGsBRABxAN8AZwCcAEwAqgA0AGwAUgByADcATAAVAFYAIQAyACEAKAAYAFgAGwAjABQAMAAmADIAFAAfABQAKwATACoADgAbAA8AHQAYABoAGQAxADgALAAoADw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PLMNRGY23LO9zAVDly7jD+70G5TPPLdhRIl4WxcYjLnM+SNcJ26FOrkrISUtPObIz5Zb3AG612krnpy15RMW+1cQjlnWFI6538qky9axd2oJmHIHP08KyP0ubGO+TQNOYuv2uh17yCIvR8VcStw7o1g0NM60sk+8Tq7YfIBJrtp53GkvzXH7OA0p8/n/u1satf/VJhtR1l8Wa6Gmaug7haSpaCaYQax6ta0mkutlb+eAOSG1aobM81D9A4iS1RRlzBBoVX6tU1S6WE2N9ORY6DfeLRC4l9Rvr5h95XDWB2mR1d4WFudpsgVYwiTwT31ljskD8ZyDOlm5DkGh9N/UB/0AI5Xvb8ZBmai2hQ4BWMqFwYnzxwB26YHSOv9WgY3JXnvoN+2R4rqGVh/LLDMtpFP+SpMGJNWvbIl5SOodbCczW2RKleksPoUeGEzrjtKHVdtZA+kfqO+rVx/iclCqwoopepvJpSTDjT+b9GWylGRF8EDbGlw6eUzmJM95Ovoz+kwLX3c2fTjFeYEsE7vUZm3mqdGJuKh2w9/QGSaqRHs99aScGOdDqkFcACoqdbBoQqqjamhH6Q9ng39JCg3lrGJwd50Qk9ovnqBTr8MME7Ps2wiVfygUmPoUBJJfJWX5Nda0nuncbFkA==")),Cc=new Set(Sc(Mc)),Ic=new Set(Sc(Mc)),Rc=function(e){let t=[];for(;;){let r=e();if(0==r)break;t.push(xc(r,e))}for(;;){let r=e()-1;if(r<0)break;t.push(kc(r,e))}return function(e){const t={};for(let r=0;re-t));return function r(){let n=[];for(;;){let i=Sc(e,t);if(0==i.length)break;n.push({set:new Set(i),node:r()})}n.sort(((e,t)=>t.set.size-e.set.size));let i=e(),o=i%3;i=i/3|0;let a=!!(1&i);return i>>=1,{branches:n,valid:o,fe0f:a,save:1==i,check:2==i}}()}(Mc),Oc=45,Tc=95;function jc(e){return Vs(e)}function $c(e){return e.filter((e=>65039!=e))}function Dc(e){for(let t of e.split(".")){let e=jc(t);try{for(let t=e.lastIndexOf(Tc)-1;t>=0;t--)if(e[t]!==Tc)throw new Error("underscore only allowed at start");if(e.length>=4&&e.every((e=>e<128))&&e[2]===Oc&&e[3]===Oc)throw new Error("invalid label extension")}catch(e){throw new Error(`Invalid label "${t}": ${e.message}`)}}return e}function Bc(e){return Dc(function(e,t){let r=jc(e).reverse(),n=[];for(;r.length;){let e=Fc(r);if(e){n.push(...t(e));continue}let i=r.pop();if(Cc.has(i)){n.push(i);continue}if(Ic.has(i))continue;let o=Rc[i];if(!o)throw new Error(`Disallowed codepoint: 0x${i.toString(16).toUpperCase()}`);n.push(...o)}return Dc(function(e){return e.normalize("NFC")}(String.fromCodePoint(...n)))}(e,$c))}function Fc(e,t){var r;let n,i,o=Nc,a=[],s=e.length;for(t&&(t.length=0);s;){let c=e[--s];if(o=null===(r=o.branches.find((e=>e.set.has(c))))||void 0===r?void 0:r.node,!o)break;if(o.save)i=c;else if(o.check&&c===i)break;a.push(c),o.fe0f&&(a.push(65039),s>0&&65039==e[s-1]&&s--),o.valid&&(n=a.slice(),2==o.valid&&n.splice(1,1),t&&t.push(...e.slice(s).reverse()),e.length=s)}return n}const zc=new bo(mc),Uc=new Uint8Array(32);function Lc(e){if(0===e.length)throw new Error("invalid ENS name; empty component");return e}function qc(e){const t=Ks(Bc(e)),r=[];if(0===e.length)return r;let n=0;for(let e=0;e=t.length)throw new Error("invalid ENS name; empty component");return r.push(Lc(t.slice(n))),r}function Hc(e){"string"!=typeof e&&zc.throwArgumentError("invalid ENS name; not a string","name",e);let t=Uc;const r=qc(e);for(;r.length;)t=ns(ko([t,ns(r.pop())]));return No(t)}function Kc(e){return No(ko(qc(e).map((e=>{if(e.length>63)throw new Error("invalid DNS encoded entry; length exceeds 63 bytes");const t=new Uint8Array(e.length+1);return t.set(e,1),t[0]=t.length-1,t}))))+"00"}Uc.fill(0);const Jc="Ethereum Signed Message:\n";function Wc(e){return"string"==typeof e&&(e=Ks(e)),ns(ko([Ks(Jc),Ks(String(e.length)),e]))}var Gc=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))};const Vc=new bo(mc),Zc=new Uint8Array(32);Zc.fill(0);const Xc=Go.from(-1),Qc=Go.from(0),Yc=Go.from(1),eu=Go.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");const tu=Bo(Yc.toHexString(),32),ru=Bo(Qc.toHexString(),32),nu={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},iu=["name","version","chainId","verifyingContract","salt"];function ou(e){return function(t){return"string"!=typeof t&&Vc.throwArgumentError(`invalid domain value for ${JSON.stringify(e)}`,`domain.${e}`,t),t}}const au={name:ou("name"),version:ou("version"),chainId:function(e){try{return Go.from(e).toString()}catch(e){}return Vc.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",e)},verifyingContract:function(e){try{return vs(e).toLowerCase()}catch(e){}return Vc.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",e)},salt:function(e){try{const t=xo(e);if(32!==t.length)throw new Error("bad length");return No(t)}catch(e){}return Vc.throwArgumentError('invalid domain value "salt"',"domain.salt",e)}};function su(e){{const t=e.match(/^(u?)int(\d*)$/);if(t){const r=""===t[1],n=parseInt(t[2]||"256");(n%8!=0||n>256||t[2]&&t[2]!==String(n))&&Vc.throwArgumentError("invalid numeric width","type",e);const i=eu.mask(r?n-1:n),o=r?i.add(Yc).mul(Xc):Qc;return function(t){const r=Go.from(t);return(r.lt(o)||r.gt(i))&&Vc.throwArgumentError(`value out-of-bounds for ${e}`,"value",t),Bo(r.toTwos(256).toHexString(),32)}}}{const t=e.match(/^bytes(\d+)$/);if(t){const r=parseInt(t[1]);return(0===r||r>32||t[1]!==String(r))&&Vc.throwArgumentError("invalid bytes width","type",e),function(t){return xo(t).length!==r&&Vc.throwArgumentError(`invalid length for ${e}`,"value",t),function(e){const t=xo(e),r=t.length%32;return r?jo([t,Zc.slice(r)]):No(t)}(t)}}}switch(e){case"address":return function(e){return Bo(vs(e),32)};case"bool":return function(e){return e?tu:ru};case"bytes":return function(e){return ns(e)};case"string":return function(e){return pc(e)}}return null}function cu(e,t){return`${e}(${t.map((({name:e,type:t})=>t+" "+e)).join(",")})`}class uu{constructor(e){pa(this,"types",Object.freeze(_a(e))),pa(this,"_encoderCache",{}),pa(this,"_types",{});const t={},r={},n={};Object.keys(e).forEach((e=>{t[e]={},r[e]=[],n[e]={}}));for(const n in e){const i={};e[n].forEach((o=>{i[o.name]&&Vc.throwArgumentError(`duplicate variable name ${JSON.stringify(o.name)} in ${JSON.stringify(n)}`,"types",e),i[o.name]=!0;const a=o.type.match(/^([^\x5b]*)(\x5b|$)/)[1];a===n&&Vc.throwArgumentError(`circular type reference to ${JSON.stringify(a)}`,"types",e);su(a)||(r[a]||Vc.throwArgumentError(`unknown type ${JSON.stringify(a)}`,"types",e),r[a].push(n),t[n][a]=!0)}))}const i=Object.keys(r).filter((e=>0===r[e].length));0===i.length?Vc.throwArgumentError("missing primary type","types",e):i.length>1&&Vc.throwArgumentError(`ambiguous primary types or unused types: ${i.map((e=>JSON.stringify(e))).join(", ")}`,"types",e),pa(this,"primaryType",i[0]),function i(o,a){a[o]&&Vc.throwArgumentError(`circular type reference to ${JSON.stringify(o)}`,"types",e),a[o]=!0,Object.keys(t[o]).forEach((e=>{r[e]&&(i(e,a),Object.keys(a).forEach((t=>{n[t][e]=!0})))})),delete a[o]}(this.primaryType,{});for(const t in n){const r=Object.keys(n[t]);r.sort(),this._types[t]=cu(t,e[t])+r.map((t=>cu(t,e[t]))).join("")}}getEncoder(e){let t=this._encoderCache[e];return t||(t=this._encoderCache[e]=this._getEncoder(e)),t}_getEncoder(e){{const t=su(e);if(t)return t}const t=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(t){const e=t[1],r=this.getEncoder(e),n=parseInt(t[3]);return t=>{n>=0&&t.length!==n&&Vc.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",t);let i=t.map(r);return this._types[e]&&(i=i.map(ns)),ns(jo(i))}}const r=this.types[e];if(r){const t=pc(this._types[e]);return e=>{const n=r.map((({name:t,type:r})=>{const n=this.getEncoder(r)(e[t]);return this._types[r]?ns(n):n}));return n.unshift(t),jo(n)}}return Vc.throwArgumentError(`unknown type: ${e}`,"type",e)}encodeType(e){const t=this._types[e];return t||Vc.throwArgumentError(`unknown type: ${JSON.stringify(e)}`,"name",e),t}encodeData(e,t){return this.getEncoder(e)(t)}hashStruct(e,t){return ns(this.encodeData(e,t))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,t,r){if(su(e))return r(e,t);const n=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(n){const e=n[1],i=parseInt(n[3]);return i>=0&&t.length!==i&&Vc.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",t),t.map((t=>this._visit(e,t,r)))}const i=this.types[e];return i?i.reduce(((e,{name:n,type:i})=>(e[n]=this._visit(i,t[n],r),e)),{}):Vc.throwArgumentError(`unknown type: ${e}`,"type",e)}visit(e,t){return this._visit(this.primaryType,e,t)}static from(e){return new uu(e)}static getPrimaryType(e){return uu.from(e).primaryType}static hashStruct(e,t,r){return uu.from(t).hashStruct(e,r)}static hashDomain(e){const t=[];for(const r in e){const n=nu[r];n||Vc.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(r)}`,"domain",e),t.push({name:r,type:n})}return t.sort(((e,t)=>iu.indexOf(e.name)-iu.indexOf(t.name))),uu.hashStruct("EIP712Domain",{EIP712Domain:t},e)}static encode(e,t,r){return jo(["0x1901",uu.hashDomain(e),uu.from(t).hash(r)])}static hash(e,t,r){return ns(uu.encode(e,t,r))}static resolveNames(e,t,r,n){return Gc(this,void 0,void 0,(function*(){e=ba(e);const i={};e.verifyingContract&&!Io(e.verifyingContract,20)&&(i[e.verifyingContract]="0x");const o=uu.from(t);o.visit(r,((e,t)=>("address"!==e||Io(t,20)||(i[t]="0x"),t)));for(const e in i)i[e]=yield n(e);return e.verifyingContract&&i[e.verifyingContract]&&(e.verifyingContract=i[e.verifyingContract]),r=o.visit(r,((e,t)=>"address"===e&&i[t]?i[t]:t)),{domain:e,value:r}}))}static getPayload(e,t,r){uu.hashDomain(e);const n={},i=[];iu.forEach((t=>{const r=e[t];null!=r&&(n[t]=au[t](r),i.push({name:t,type:nu[t]}))}));const o=uu.from(t),a=ba(t);return a.EIP712Domain?Vc.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",t):a.EIP712Domain=i,o.encode(r),{types:a,domain:n,primaryType:o.primaryType,message:o.visit(r,((e,t)=>{if(e.match(/^bytes(\d*)/))return No(xo(t));if(e.match(/^u?int/))return Go.from(t).toString();switch(e){case"address":return t.toLowerCase();case"bool":return!!t;case"string":return"string"!=typeof t&&Vc.throwArgumentError("invalid string","value",t),t}return Vc.throwArgumentError("unsupported type","type",e)}))}}}var fu=Object.freeze({__proto__:null,_TypedDataEncoder:uu,dnsEncode:Kc,ensNormalize:function(e){return qc(e).map((e=>Gs(e))).join(".")},hashMessage:Wc,id:pc,isValidName:function(e){try{return 0!==qc(e).length}catch(e){}return!1},messagePrefix:Jc,namehash:Hc});const du=new bo(Pa);class lu extends Ea{}class hu extends Ea{}class pu extends Ea{}class mu extends Ea{static isIndexed(e){return!(!e||!e._isIndexed)}}const gu={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function yu(e,t){const r=new Error(`deferred error during ABI decoding triggered accessing ${e}`);return r.error=t,r}class bu{constructor(e){let t=[];t="string"==typeof e?JSON.parse(e):e,pa(this,"fragments",t.map((e=>$a.from(e))).filter((e=>null!=e))),pa(this,"_abiCoder",ma(new.target,"getAbiCoder")()),pa(this,"functions",{}),pa(this,"errors",{}),pa(this,"events",{}),pa(this,"structs",{}),this.fragments.forEach((e=>{let t=null;switch(e.type){case"constructor":return this.deploy?void du.warn("duplicate definition - constructor"):void pa(this,"deploy",e);case"function":t=this.functions;break;case"event":t=this.events;break;case"error":t=this.errors;break;default:return}let r=e.format();t[r]?du.warn("duplicate definition - "+r):t[r]=e})),this.deploy||pa(this,"deploy",Ua.from({payable:!1,type:"constructor"})),pa(this,"_isInterface",!0)}format(e){e||(e=Na.full),e===Na.sighash&&du.throwArgumentError("interface does not support formatting sighash","format",e);const t=this.fragments.map((t=>t.format(e)));return e===Na.json?JSON.stringify(t.map((e=>JSON.parse(e)))):t}static getAbiCoder(){return hc}static getAddress(e){return vs(e)}static getSighash(e){return To(pc(e.format()),0,4)}static getEventTopic(e){return pc(e.format())}getFunction(e){if(Io(e)){for(const t in this.functions)if(e===this.getSighash(t))return this.functions[t];du.throwArgumentError("no matching function","sighash",e)}if(-1===e.indexOf("(")){const t=e.trim(),r=Object.keys(this.functions).filter((e=>e.split("(")[0]===t));return 0===r.length?du.throwArgumentError("no matching function","name",t):r.length>1&&du.throwArgumentError("multiple matching functions","name",t),this.functions[r[0]]}const t=this.functions[La.fromString(e).format()];return t||du.throwArgumentError("no matching function","signature",e),t}getEvent(e){if(Io(e)){const t=e.toLowerCase();for(const e in this.events)if(t===this.getEventTopic(e))return this.events[e];du.throwArgumentError("no matching event","topichash",t)}if(-1===e.indexOf("(")){const t=e.trim(),r=Object.keys(this.events).filter((e=>e.split("(")[0]===t));return 0===r.length?du.throwArgumentError("no matching event","name",t):r.length>1&&du.throwArgumentError("multiple matching events","name",t),this.events[r[0]]}const t=this.events[Da.fromString(e).format()];return t||du.throwArgumentError("no matching event","signature",e),t}getError(e){if(Io(e)){const t=ma(this.constructor,"getSighash");for(const r in this.errors){if(e===t(this.errors[r]))return this.errors[r]}du.throwArgumentError("no matching error","sighash",e)}if(-1===e.indexOf("(")){const t=e.trim(),r=Object.keys(this.errors).filter((e=>e.split("(")[0]===t));return 0===r.length?du.throwArgumentError("no matching error","name",t):r.length>1&&du.throwArgumentError("multiple matching errors","name",t),this.errors[r[0]]}const t=this.errors[La.fromString(e).format()];return t||du.throwArgumentError("no matching error","signature",e),t}getSighash(e){if("string"==typeof e)try{e=this.getFunction(e)}catch(t){try{e=this.getError(e)}catch(e){throw t}}return ma(this.constructor,"getSighash")(e)}getEventTopic(e){return"string"==typeof e&&(e=this.getEvent(e)),ma(this.constructor,"getEventTopic")(e)}_decodeParams(e,t){return this._abiCoder.decode(e,t)}_encodeParams(e,t){return this._abiCoder.encode(e,t)}encodeDeploy(e){return this._encodeParams(this.deploy.inputs,e||[])}decodeErrorResult(e,t){"string"==typeof e&&(e=this.getError(e));const r=xo(t);return No(r.slice(0,4))!==this.getSighash(e)&&du.throwArgumentError(`data signature does not match error ${e.name}.`,"data",No(r)),this._decodeParams(e.inputs,r.slice(4))}encodeErrorResult(e,t){return"string"==typeof e&&(e=this.getError(e)),No(ko([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}decodeFunctionData(e,t){"string"==typeof e&&(e=this.getFunction(e));const r=xo(t);return No(r.slice(0,4))!==this.getSighash(e)&&du.throwArgumentError(`data signature does not match function ${e.name}.`,"data",No(r)),this._decodeParams(e.inputs,r.slice(4))}encodeFunctionData(e,t){return"string"==typeof e&&(e=this.getFunction(e)),No(ko([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}decodeFunctionResult(e,t){"string"==typeof e&&(e=this.getFunction(e));let r=xo(t),n=null,i="",o=null,a=null,s=null;switch(r.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(e.outputs,r)}catch(e){}break;case 4:{const e=No(r.slice(0,4)),t=gu[e];if(t)o=this._abiCoder.decode(t.inputs,r.slice(4)),a=t.name,s=t.signature,t.reason&&(n=o[0]),"Error"===a?i=`; VM Exception while processing transaction: reverted with reason string ${JSON.stringify(o[0])}`:"Panic"===a&&(i=`; VM Exception while processing transaction: reverted with panic code ${o[0]}`);else try{const t=this.getError(e);o=this._abiCoder.decode(t.inputs,r.slice(4)),a=t.name,s=t.format()}catch(e){}break}}return du.throwError("call revert exception"+i,bo.errors.CALL_EXCEPTION,{method:e.format(),data:No(t),errorArgs:o,errorName:a,errorSignature:s,reason:n})}encodeFunctionResult(e,t){return"string"==typeof e&&(e=this.getFunction(e)),No(this._abiCoder.encode(e.outputs,t||[]))}encodeFilterTopics(e,t){"string"==typeof e&&(e=this.getEvent(e)),t.length>e.inputs.length&&du.throwError("too many arguments for "+e.format(),bo.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:t});let r=[];e.anonymous||r.push(this.getEventTopic(e));const n=(e,t)=>"string"===e.type?pc(t):"bytes"===e.type?ns(No(t)):("bool"===e.type&&"boolean"==typeof t&&(t=t?"0x01":"0x00"),e.type.match(/^u?int/)&&(t=Go.from(t).toHexString()),"address"===e.type&&this._abiCoder.encode(["address"],[t]),Bo(No(t),32));for(t.forEach(((t,i)=>{let o=e.inputs[i];o.indexed?null==t?r.push(null):"array"===o.baseType||"tuple"===o.baseType?du.throwArgumentError("filtering with tuples or arrays not supported","contract."+o.name,t):Array.isArray(t)?r.push(t.map((e=>n(o,e)))):r.push(n(o,t)):null!=t&&du.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+o.name,t)}));r.length&&null===r[r.length-1];)r.pop();return r}encodeEventLog(e,t){"string"==typeof e&&(e=this.getEvent(e));const r=[],n=[],i=[];return e.anonymous||r.push(this.getEventTopic(e)),t.length!==e.inputs.length&&du.throwArgumentError("event arguments/values mismatch","values",t),e.inputs.forEach(((e,o)=>{const a=t[o];if(e.indexed)if("string"===e.type)r.push(pc(a));else if("bytes"===e.type)r.push(ns(a));else{if("tuple"===e.baseType||"array"===e.baseType)throw new Error("not implemented");r.push(this._abiCoder.encode([e.type],[a]))}else n.push(e),i.push(a)})),{data:this._abiCoder.encode(n,i),topics:r}}decodeEventLog(e,t,r){if("string"==typeof e&&(e=this.getEvent(e)),null!=r&&!e.anonymous){let t=this.getEventTopic(e);Io(r[0],32)&&r[0].toLowerCase()===t||du.throwError("fragment/topic mismatch",bo.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:t,value:r[0]}),r=r.slice(1)}let n=[],i=[],o=[];e.inputs.forEach(((e,t)=>{e.indexed?"string"===e.type||"bytes"===e.type||"tuple"===e.baseType||"array"===e.baseType?(n.push(Ta.fromObject({type:"bytes32",name:e.name})),o.push(!0)):(n.push(e),o.push(!1)):(i.push(e),o.push(!1))}));let a=null!=r?this._abiCoder.decode(n,ko(r)):null,s=this._abiCoder.decode(i,t,!0),c=[],u=0,f=0;e.inputs.forEach(((e,t)=>{if(e.indexed)if(null==a)c[t]=new mu({_isIndexed:!0,hash:null});else if(o[t])c[t]=new mu({_isIndexed:!0,hash:a[f++]});else try{c[t]=a[f++]}catch(e){c[t]=e}else try{c[t]=s[u++]}catch(e){c[t]=e}if(e.name&&null==c[e.name]){const r=c[t];r instanceof Error?Object.defineProperty(c,e.name,{enumerable:!0,get:()=>{throw yu(`property ${JSON.stringify(e.name)}`,r)}}):c[e.name]=r}}));for(let e=0;e{throw yu(`index ${e}`,t)}})}return Object.freeze(c)}parseTransaction(e){let t=this.getFunction(e.data.substring(0,10).toLowerCase());return t?new hu({args:this._abiCoder.decode(t.inputs,"0x"+e.data.substring(10)),functionFragment:t,name:t.name,signature:t.format(),sighash:this.getSighash(t),value:Go.from(e.value||"0")}):null}parseLog(e){let t=this.getEvent(e.topics[0]);return!t||t.anonymous?null:new lu({eventFragment:t,name:t.name,signature:t.format(),topic:this.getEventTopic(t),args:this.decodeEventLog(t,e.data,e.topics)})}parseError(e){const t=No(e);let r=this.getError(t.substring(0,10).toLowerCase());return r?new pu({args:this._abiCoder.decode(r.inputs,"0x"+t.substring(10)),errorFragment:r,name:r.name,signature:r.format(),sighash:this.getSighash(r)}):null}static isInterface(e){return!(!e||!e._isInterface)}}var vu=Object.freeze({__proto__:null,AbiCoder:lc,ConstructorFragment:Ua,ErrorFragment:Ha,EventFragment:Da,FormatTypes:Na,Fragment:$a,FunctionFragment:La,Indexed:mu,Interface:bu,LogDescription:lu,ParamType:Ta,TransactionDescription:hu,checkResultErrors:Za,defaultAbiCoder:hc});var wu=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))};const Au=new bo("abstract-provider/5.7.0");class _u extends Ea{static isForkEvent(e){return!(!e||!e._isForkEvent)}}class Eu{constructor(){Au.checkAbstract(new.target,Eu),pa(this,"_isProvider",!0)}getFeeData(){return wu(this,void 0,void 0,(function*(){const{block:e,gasPrice:t}=yield ga({block:this.getBlock("latest"),gasPrice:this.getGasPrice().catch((e=>null))});let r=null,n=null,i=null;return e&&e.baseFeePerGas&&(r=e.baseFeePerGas,i=Go.from("1500000000"),n=e.baseFeePerGas.mul(2).add(i)),{lastBaseFeePerGas:r,maxFeePerGas:n,maxPriorityFeePerGas:i,gasPrice:t}}))}addListener(e,t){return this.on(e,t)}removeListener(e,t){return this.off(e,t)}static isProvider(e){return!(!e||!e._isProvider)}}var Su=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))};const Pu=new bo("abstract-signer/5.7.0"),xu=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],ku=[bo.errors.INSUFFICIENT_FUNDS,bo.errors.NONCE_EXPIRED,bo.errors.REPLACEMENT_UNDERPRICED];class Mu{constructor(){Pu.checkAbstract(new.target,Mu),pa(this,"_isSigner",!0)}getBalance(e){return Su(this,void 0,void 0,(function*(){return this._checkProvider("getBalance"),yield this.provider.getBalance(this.getAddress(),e)}))}getTransactionCount(e){return Su(this,void 0,void 0,(function*(){return this._checkProvider("getTransactionCount"),yield this.provider.getTransactionCount(this.getAddress(),e)}))}estimateGas(e){return Su(this,void 0,void 0,(function*(){this._checkProvider("estimateGas");const t=yield ga(this.checkTransaction(e));return yield this.provider.estimateGas(t)}))}call(e,t){return Su(this,void 0,void 0,(function*(){this._checkProvider("call");const r=yield ga(this.checkTransaction(e));return yield this.provider.call(r,t)}))}sendTransaction(e){return Su(this,void 0,void 0,(function*(){this._checkProvider("sendTransaction");const t=yield this.populateTransaction(e),r=yield this.signTransaction(t);return yield this.provider.sendTransaction(r)}))}getChainId(){return Su(this,void 0,void 0,(function*(){this._checkProvider("getChainId");return(yield this.provider.getNetwork()).chainId}))}getGasPrice(){return Su(this,void 0,void 0,(function*(){return this._checkProvider("getGasPrice"),yield this.provider.getGasPrice()}))}getFeeData(){return Su(this,void 0,void 0,(function*(){return this._checkProvider("getFeeData"),yield this.provider.getFeeData()}))}resolveName(e){return Su(this,void 0,void 0,(function*(){return this._checkProvider("resolveName"),yield this.provider.resolveName(e)}))}checkTransaction(e){for(const t in e)-1===xu.indexOf(t)&&Pu.throwArgumentError("invalid transaction key: "+t,"transaction",e);const t=ba(e);return null==t.from?t.from=this.getAddress():t.from=Promise.all([Promise.resolve(t.from),this.getAddress()]).then((t=>(t[0].toLowerCase()!==t[1].toLowerCase()&&Pu.throwArgumentError("from address mismatch","transaction",e),t[0]))),t}populateTransaction(e){return Su(this,void 0,void 0,(function*(){const t=yield ga(this.checkTransaction(e));null!=t.to&&(t.to=Promise.resolve(t.to).then((e=>Su(this,void 0,void 0,(function*(){if(null==e)return null;const t=yield this.resolveName(e);return null==t&&Pu.throwArgumentError("provided ENS name resolves to null","tx.to",e),t})))),t.to.catch((e=>{})));const r=null!=t.maxFeePerGas||null!=t.maxPriorityFeePerGas;if(null==t.gasPrice||2!==t.type&&!r?0!==t.type&&1!==t.type||!r||Pu.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",e):Pu.throwArgumentError("eip-1559 transaction do not support gasPrice","transaction",e),2!==t.type&&null!=t.type||null==t.maxFeePerGas||null==t.maxPriorityFeePerGas)if(0===t.type||1===t.type)null==t.gasPrice&&(t.gasPrice=this.getGasPrice());else{const e=yield this.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?(r&&Pu.throwError("network does not support EIP-1559",bo.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),null==t.gasPrice&&(t.gasPrice=e.gasPrice),t.type=0):Pu.throwError("failed to get consistent fee data",bo.errors.UNSUPPORTED_OPERATION,{operation:"signer.getFeeData"});else 2===t.type&&(null==t.maxFeePerGas&&(t.maxFeePerGas=e.maxFeePerGas),null==t.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=e.maxPriorityFeePerGas))}else t.type=2;return null==t.nonce&&(t.nonce=this.getTransactionCount("pending")),null==t.gasLimit&&(t.gasLimit=this.estimateGas(t).catch((e=>{if(ku.indexOf(e.code)>=0)throw e;return Pu.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",bo.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,tx:t})}))),null==t.chainId?t.chainId=this.getChainId():t.chainId=Promise.all([Promise.resolve(t.chainId),this.getChainId()]).then((t=>(0!==t[1]&&t[0]!==t[1]&&Pu.throwArgumentError("chainId address mismatch","transaction",e),t[0]))),yield ga(t)}))}_checkProvider(e){this.provider||Pu.throwError("missing provider",bo.errors.UNSUPPORTED_OPERATION,{operation:e||"_checkProvider"})}static isSigner(e){return!(!e||!e._isSigner)}}class Cu extends Mu{constructor(e,t){super(),pa(this,"address",e),pa(this,"provider",t||null)}getAddress(){return Promise.resolve(this.address)}_fail(e,t){return Promise.resolve().then((()=>{Pu.throwError(e,bo.errors.UNSUPPORTED_OPERATION,{operation:t})}))}signMessage(e){return this._fail("VoidSigner cannot sign messages","signMessage")}signTransaction(e){return this._fail("VoidSigner cannot sign transactions","signTransaction")}_signTypedData(e,t,r){return this._fail("VoidSigner cannot sign typed data","signTypedData")}connect(e){return new Cu(this.address,e)}}function Iu(e,t,r){return r={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&r.path)}},e(r,r.exports),r.exports}var Ru=Nu;function Nu(e,t){if(!e)throw new Error(t||"Assertion failed")}Nu.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)};var Ou=Iu((function(e,t){var r=t;function n(e){return 1===e.length?"0"+e:e}function i(e){for(var t="",r=0;r>8,a=255&i;o?r.push(o,a):r.push(a)}return r},r.zero2=n,r.toHex=i,r.encode=function(e,t){return"hex"===t?i(e):e}})),Tu=Iu((function(e,t){var r=t;r.assert=Ru,r.toArray=Ou.toArray,r.zero2=Ou.zero2,r.toHex=Ou.toHex,r.encode=Ou.encode,r.getNAF=function(e,t,r){var n=new Array(Math.max(e.bitLength(),r)+1);n.fill(0);for(var i=1<(i>>1)-1?(i>>1)-c:c,o.isubn(s)):s=0,n[a]=s,o.iushrn(1)}return n},r.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n,i=0,o=0;e.cmpn(-i)>0||t.cmpn(-o)>0;){var a,s,c=e.andln(3)+i&3,u=t.andln(3)+o&3;3===c&&(c=-1),3===u&&(u=-1),a=0==(1&c)?0:3!==(n=e.andln(7)+i&7)&&5!==n||2!==u?c:-c,r[0].push(a),s=0==(1&u)?0:3!==(n=t.andln(7)+o&7)&&5!==n||2!==c?u:-u,r[1].push(s),2*i===a+1&&(i=1-i),2*o===s+1&&(o=1-o),e.iushrn(1),t.iushrn(1)}return r},r.cachedProperty=function(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},r.parseBytes=function(e){return"string"==typeof e?r.toArray(e,"hex"):e},r.intFromLE=function(e){return new so(e,"hex","le")}})),ju=Tu.getNAF,$u=Tu.getJSF,Du=Tu.assert;function Bu(e,t){this.type=e,this.p=new so(t.p,16),this.red=t.prime?so.red(t.prime):so.mont(this.p),this.zero=new so(0).toRed(this.red),this.one=new so(1).toRed(this.red),this.two=new so(2).toRed(this.red),this.n=t.n&&new so(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var Fu=Bu;function zu(e,t){this.curve=e,this.type=t,this.precomputed=null}Bu.prototype.point=function(){throw new Error("Not implemented")},Bu.prototype.validate=function(){throw new Error("Not implemented")},Bu.prototype._fixedNafMul=function(e,t){Du(e.precomputed);var r=e._getDoubles(),n=ju(t,1,this._bitLength),i=(1<=o;c--)a=(a<<1)+n[c];s.push(a)}for(var u=this.jpoint(null,null,null),f=this.jpoint(null,null,null),d=i;d>0;d--){for(o=0;o=0;s--){for(var c=0;s>=0&&0===o[s];s--)c++;if(s>=0&&c++,a=a.dblp(c),s<0)break;var u=o[s];Du(0!==u),a="affine"===e.type?u>0?a.mixedAdd(i[u-1>>1]):a.mixedAdd(i[-u-1>>1].neg()):u>0?a.add(i[u-1>>1]):a.add(i[-u-1>>1].neg())}return"affine"===e.type?a.toP():a},Bu.prototype._wnafMulAdd=function(e,t,r,n,i){var o,a,s,c=this._wnafT1,u=this._wnafT2,f=this._wnafT3,d=0;for(o=0;o=1;o-=2){var h=o-1,p=o;if(1===c[h]&&1===c[p]){var m=[t[h],null,null,t[p]];0===t[h].y.cmp(t[p].y)?(m[1]=t[h].add(t[p]),m[2]=t[h].toJ().mixedAdd(t[p].neg())):0===t[h].y.cmp(t[p].y.redNeg())?(m[1]=t[h].toJ().mixedAdd(t[p]),m[2]=t[h].add(t[p].neg())):(m[1]=t[h].toJ().mixedAdd(t[p]),m[2]=t[h].toJ().mixedAdd(t[p].neg()));var g=[-3,-1,-5,-7,0,7,5,1,3],y=$u(r[h],r[p]);for(d=Math.max(y[0].length,d),f[h]=new Array(d),f[p]=new Array(d),a=0;a=0;o--){for(var _=0;o>=0;){var E=!0;for(a=0;a=0&&_++,w=w.dblp(_),o<0)break;for(a=0;a0?s=u[a][S-1>>1]:S<0&&(s=u[a][-S-1>>1].neg()),w="affine"===s.type?w.mixedAdd(s):w.add(s))}}for(o=0;o=Math.ceil((e.bitLength()+1)/t.step)},zu.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i=0&&(o=t,a=r),n.negative&&(n=n.neg(),i=i.neg()),o.negative&&(o=o.neg(),a=a.neg()),[{a:n,b:i},{a:o,b:a}]},qu.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],i=n.b.mul(e).divRound(this.n),o=r.b.neg().mul(e).divRound(this.n),a=i.mul(r.a),s=o.mul(n.a),c=i.mul(r.b),u=o.mul(n.b);return{k1:e.sub(a).sub(s),k2:c.add(u).neg()}},qu.prototype.pointFromX=function(e,t){(e=new so(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var i=n.fromRed().isOdd();return(t&&!i||!t&&i)&&(n=n.redNeg()),this.point(e,n)},qu.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},qu.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o":""},Ku.prototype.isInfinity=function(){return this.inf},Ku.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},Ku.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),a=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)},Ku.prototype.getX=function(){return this.x.fromRed()},Ku.prototype.getY=function(){return this.y.fromRed()},Ku.prototype.mul=function(e){return e=new so(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)},Ku.prototype.mulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},Ku.prototype.jmulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},Ku.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))},Ku.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,n=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return t},Ku.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},Uu(Ju,Fu.BasePoint),qu.prototype.jpoint=function(e,t,r){return new Ju(this,e,t,r)},Ju.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},Ju.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},Ju.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),i=e.x.redMul(r),o=this.y.redMul(t.redMul(e.z)),a=e.y.redMul(r.redMul(this.z)),s=n.redSub(i),c=o.redSub(a);if(0===s.cmpn(0))return 0!==c.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=s.redSqr(),f=u.redMul(s),d=n.redMul(u),l=c.redSqr().redIAdd(f).redISub(d).redISub(d),h=c.redMul(d.redISub(l)).redISub(o.redMul(f)),p=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(l,h,p)},Ju.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),i=this.y,o=e.y.redMul(t).redMul(this.z),a=r.redSub(n),s=i.redSub(o);if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=a.redSqr(),u=c.redMul(a),f=r.redMul(c),d=s.redSqr().redIAdd(u).redISub(f).redISub(f),l=s.redMul(f.redISub(d)).redISub(i.redMul(u)),h=this.z.redMul(a);return this.curve.jpoint(d,l,h)},Ju.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var r=this;for(t=0;t=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},Ju.prototype.inspect=function(){return this.isInfinity()?"":""},Ju.prototype.isInfinity=function(){return 0===this.z.cmpn(0)};var Wu=Iu((function(e,t){var r=t;r.base=Fu,r.short=Hu,r.mont=null,r.edwards=null})),Gu=Iu((function(e,t){var r,n=t,i=Tu.assert;function o(e){"short"===e.type?this.curve=new Wu.short(e):"edwards"===e.type?this.curve=new Wu.edwards(e):this.curve=new Wu.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,i(this.g.validate(),"Invalid curve"),i(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function a(e,t){Object.defineProperty(n,e,{configurable:!0,enumerable:!0,get:function(){var r=new o(t);return Object.defineProperty(n,e,{configurable:!0,enumerable:!0,value:r}),r}})}n.PresetCurve=o,a("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:tr.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),a("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:tr.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),a("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:tr.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),a("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:tr.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"]}),a("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:tr.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"]}),a("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:tr.sha256,gRed:!1,g:["9"]}),a("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:tr.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{r=null.crash()}catch(e){r=void 0}a("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:tr.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})}));function Vu(e){if(!(this instanceof Vu))return new Vu(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=Ou.toArray(e.entropy,e.entropyEnc||"hex"),r=Ou.toArray(e.nonce,e.nonceEnc||"hex"),n=Ou.toArray(e.pers,e.persEnc||"hex");Ru(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}var Zu=Vu;Vu.prototype._init=function(e,t,r){var n=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},Vu.prototype.generate=function(e,t,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(n=r,r=t,t=null),r&&(r=Ou.toArray(r,n||"hex"),this._update(r));for(var i=[];i.length"};var ef=Tu.assert;function tf(e,t){if(e instanceof tf)return e;this._importDER(e,t)||(ef(e.r&&e.s,"Signature without r or s"),this.r=new so(e.r,16),this.s=new so(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}var rf=tf;function nf(){this.place=0}function of(e,t){var r=e[t.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var i=0,o=0,a=t.place;o>>=0;return!(i<=127)&&(t.place=a,i)}function af(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}tf.prototype._importDER=function(e,t){e=Tu.toArray(e,t);var r=new nf;if(48!==e[r.place++])return!1;var n=of(e,r);if(!1===n)return!1;if(n+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var i=of(e,r);if(!1===i)return!1;var o=e.slice(r.place,i+r.place);if(r.place+=i,2!==e[r.place++])return!1;var a=of(e,r);if(!1===a)return!1;if(e.length!==a+r.place)return!1;var s=e.slice(r.place,a+r.place);if(0===o[0]){if(!(128&o[1]))return!1;o=o.slice(1)}if(0===s[0]){if(!(128&s[1]))return!1;s=s.slice(1)}return this.r=new so(o),this.s=new so(s),this.recoveryParam=null,!0},tf.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=af(t),r=af(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];sf(n,t.length),(n=n.concat(t)).push(2),sf(n,r.length);var i=n.concat(r),o=[48];return sf(o,i.length),o=o.concat(i),Tu.encode(o,e)};var cf=function(){throw new Error("unsupported")},uf=Tu.assert;function ff(e){if(!(this instanceof ff))return new ff(e);"string"==typeof e&&(uf(Object.prototype.hasOwnProperty.call(Gu,e),"Unknown curve "+e),e=Gu[e]),e instanceof Gu.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}var df=ff;ff.prototype.keyPair=function(e){return new Yu(this,e)},ff.prototype.keyFromPrivate=function(e,t){return Yu.fromPrivate(this,e,t)},ff.prototype.keyFromPublic=function(e,t){return Yu.fromPublic(this,e,t)},ff.prototype.genKeyPair=function(e){e||(e={});for(var t=new Zu({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||cf(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),n=this.n.sub(new so(2));;){var i=new so(t.generate(r));if(!(i.cmp(n)>0))return i.iaddn(1),this.keyFromPrivate(i)}},ff.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},ff.prototype.sign=function(e,t,r,n){"object"==typeof r&&(n=r,r=null),n||(n={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new so(e,16));for(var i=this.n.byteLength(),o=t.getPrivate().toArray("be",i),a=e.toArray("be",i),s=new Zu({hash:this.hash,entropy:o,nonce:a,pers:n.pers,persEnc:n.persEnc||"utf8"}),c=this.n.sub(new so(1)),u=0;;u++){var f=n.k?n.k(u):new so(s.generate(this.n.byteLength()));if(!((f=this._truncateToN(f,!0)).cmpn(1)<=0||f.cmp(c)>=0)){var d=this.g.mul(f);if(!d.isInfinity()){var l=d.getX(),h=l.umod(this.n);if(0!==h.cmpn(0)){var p=f.invm(this.n).mul(h.mul(t.getPrivate()).iadd(e));if(0!==(p=p.umod(this.n)).cmpn(0)){var m=(d.getY().isOdd()?1:0)|(0!==l.cmp(h)?2:0);return n.canonical&&p.cmp(this.nh)>0&&(p=this.n.sub(p),m^=1),new rf({r:h,s:p,recoveryParam:m})}}}}}},ff.prototype.verify=function(e,t,r,n){e=this._truncateToN(new so(e,16)),r=this.keyFromPublic(r,n);var i=(t=new rf(t,"hex")).r,o=t.s;if(i.cmpn(1)<0||i.cmp(this.n)>=0)return!1;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var a,s=o.invm(this.n),c=s.mul(e).umod(this.n),u=s.mul(i).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(c,r.getPublic(),u)).isInfinity()&&a.eqXToP(i):!(a=this.g.mulAdd(c,r.getPublic(),u)).isInfinity()&&0===a.getX().umod(this.n).cmp(i)},ff.prototype.recoverPubKey=function(e,t,r,n){uf((3&r)===r,"The recovery param is more than two bits"),t=new rf(t,n);var i=this.n,o=new so(e),a=t.r,s=t.s,c=1&r,u=r>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&u)throw new Error("Unable to find sencond key candinate");a=u?this.curve.pointFromX(a.add(this.curve.n),c):this.curve.pointFromX(a,c);var f=t.r.invm(i),d=i.sub(o).mul(f).umod(i),l=s.mul(f).umod(i);return this.g.mulAdd(d,a,l)},ff.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new rf(t,n)).recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(e,t,i)}catch(e){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")};var lf=Iu((function(e,t){var r=t;r.version="6.5.4",r.utils=Tu,r.rand=function(){throw new Error("unsupported")},r.curve=Wu,r.curves=Gu,r.ec=df,r.eddsa=null})),hf=lf.ec;const pf=new bo("signing-key/5.7.0");let mf=null;function gf(){return mf||(mf=new hf("secp256k1")),mf}class yf{constructor(e){pa(this,"curve","secp256k1"),pa(this,"privateKey",No(e)),32!==Oo(this.privateKey)&&pf.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const t=gf().keyFromPrivate(xo(this.privateKey));pa(this,"publicKey","0x"+t.getPublic(!1,"hex")),pa(this,"compressedPublicKey","0x"+t.getPublic(!0,"hex")),pa(this,"_isSigningKey",!0)}_addPoint(e){const t=gf().keyFromPublic(xo(this.publicKey)),r=gf().keyFromPublic(xo(e));return"0x"+t.pub.add(r.pub).encodeCompressed("hex")}signDigest(e){const t=gf().keyFromPrivate(xo(this.privateKey)),r=xo(e);32!==r.length&&pf.throwArgumentError("bad digest length","digest",e);const n=t.sign(r,{canonical:!0});return Fo({recoveryParam:n.recoveryParam,r:Bo("0x"+n.r.toString(16),32),s:Bo("0x"+n.s.toString(16),32)})}computeSharedSecret(e){const t=gf().keyFromPrivate(xo(this.privateKey)),r=gf().keyFromPublic(xo(vf(e)));return Bo("0x"+t.derive(r.getPublic()).toString(16),32)}static isSigningKey(e){return!(!e||!e._isSigningKey)}}function bf(e,t){const r=Fo(t),n={r:xo(r.r),s:xo(r.s)};return"0x"+gf().recoverPubKey(xo(e),n,r.recoveryParam).encode("hex",!1)}function vf(e,t){const r=xo(e);if(32===r.length){const e=new yf(r);return t?"0x"+gf().keyFromPrivate(r).getPublic(!0,"hex"):e.publicKey}return 33===r.length?t?No(r):"0x"+gf().keyFromPublic(r).getPublic(!1,"hex"):65===r.length?t?"0x"+gf().keyFromPublic(r).getPublic(!0,"hex"):No(r):pf.throwArgumentError("invalid public or private key","key","[REDACTED]")}var wf=Object.freeze({__proto__:null,SigningKey:yf,computePublicKey:vf,recoverPublicKey:bf});const Af=new bo("transactions/5.7.0");var _f;function Ef(e){return"0x"===e?null:vs(e)}function Sf(e){return"0x"===e?Ts:Go.from(e)}!function(e){e[e.legacy=0]="legacy",e[e.eip2930=1]="eip2930",e[e.eip1559=2]="eip1559"}(_f||(_f={}));const Pf=[{name:"nonce",maxLength:32,numeric:!0},{name:"gasPrice",maxLength:32,numeric:!0},{name:"gasLimit",maxLength:32,numeric:!0},{name:"to",length:20},{name:"value",maxLength:32,numeric:!0},{name:"data"}],xf={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,type:!0,value:!0};function kf(e){return vs(To(ns(To(vf(e),1)),12))}function Mf(e,t){return kf(bf(xo(e),t))}function Cf(e,t){const r=Mo(Go.from(e).toHexString());return r.length>32&&Af.throwArgumentError("invalid length for "+t,"transaction:"+t,e),r}function If(e,t){return{address:vs(e),storageKeys:(t||[]).map(((t,r)=>(32!==Oo(t)&&Af.throwArgumentError("invalid access list storageKey",`accessList[${e}:${r}]`,t),t.toLowerCase())))}}function Rf(e){if(Array.isArray(e))return e.map(((e,t)=>Array.isArray(e)?(e.length>2&&Af.throwArgumentError("access list expected to be [ address, storageKeys[] ]",`value[${t}]`,e),If(e[0],e[1])):If(e.address,e.storageKeys)));const t=Object.keys(e).map((t=>{const r=e[t].reduce(((e,t)=>(e[t]=!0,e)),{});return If(t,Object.keys(r).sort())}));return t.sort(((e,t)=>e.address.localeCompare(t.address))),t}function Nf(e){return Rf(e).map((e=>[e.address,e.storageKeys]))}function Of(e,t){if(null!=e.gasPrice){const t=Go.from(e.gasPrice),r=Go.from(e.maxFeePerGas||0);t.eq(r)||Af.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:t,maxFeePerGas:r})}const r=[Cf(e.chainId||0,"chainId"),Cf(e.nonce||0,"nonce"),Cf(e.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),Cf(e.maxFeePerGas||0,"maxFeePerGas"),Cf(e.gasLimit||0,"gasLimit"),null!=e.to?vs(e.to):"0x",Cf(e.value||0,"value"),e.data||"0x",Nf(e.accessList||[])];if(t){const e=Fo(t);r.push(Cf(e.recoveryParam,"recoveryParam")),r.push(Mo(e.r)),r.push(Mo(e.s))}return jo(["0x02",us(r)])}function Tf(e,t){const r=[Cf(e.chainId||0,"chainId"),Cf(e.nonce||0,"nonce"),Cf(e.gasPrice||0,"gasPrice"),Cf(e.gasLimit||0,"gasLimit"),null!=e.to?vs(e.to):"0x",Cf(e.value||0,"value"),e.data||"0x",Nf(e.accessList||[])];if(t){const e=Fo(t);r.push(Cf(e.recoveryParam,"recoveryParam")),r.push(Mo(e.r)),r.push(Mo(e.s))}return jo(["0x01",us(r)])}function jf(e,t){if(null==e.type||0===e.type)return null!=e.accessList&&Af.throwArgumentError("untyped transactions do not support accessList; include type: 1","transaction",e),function(e,t){ya(e,xf);const r=[];Pf.forEach((function(t){let n=e[t.name]||[];const i={};t.numeric&&(i.hexPad="left"),n=xo(No(n,i)),t.length&&n.length!==t.length&&n.length>0&&Af.throwArgumentError("invalid length for "+t.name,"transaction:"+t.name,n),t.maxLength&&(n=Mo(n),n.length>t.maxLength&&Af.throwArgumentError("invalid length for "+t.name,"transaction:"+t.name,n)),r.push(No(n))}));let n=0;if(null!=e.chainId?(n=e.chainId,"number"!=typeof n&&Af.throwArgumentError("invalid transaction.chainId","transaction",e)):t&&!Eo(t)&&t.v>28&&(n=Math.floor((t.v-35)/2)),0!==n&&(r.push(No(n)),r.push("0x"),r.push("0x")),!t)return us(r);const i=Fo(t);let o=27+i.recoveryParam;return 0!==n?(r.pop(),r.pop(),r.pop(),o+=2*n+8,i.v>28&&i.v!==o&&Af.throwArgumentError("transaction.chainId/signature.v mismatch","signature",t)):i.v!==o&&Af.throwArgumentError("transaction.chainId/signature.v mismatch","signature",t),r.push(No(o)),r.push(Mo(xo(i.r))),r.push(Mo(xo(i.s))),us(r)}(e,t);switch(e.type){case 1:return Tf(e,t);case 2:return Of(e,t)}return Af.throwError(`unsupported transaction type: ${e.type}`,bo.errors.UNSUPPORTED_OPERATION,{operation:"serializeTransaction",transactionType:e.type})}function $f(e,t,r){try{const r=Sf(t[0]).toNumber();if(0!==r&&1!==r)throw new Error("bad recid");e.v=r}catch(e){Af.throwArgumentError("invalid v for transaction type: 1","v",t[0])}e.r=Bo(t[1],32),e.s=Bo(t[2],32);try{const t=ns(r(e));e.from=Mf(t,{r:e.r,s:e.s,recoveryParam:e.v})}catch(e){}}function Df(e){const t=xo(e);if(t[0]>127)return function(e){const t=ls(e);9!==t.length&&6!==t.length&&Af.throwArgumentError("invalid raw transaction","rawTransaction",e);const r={nonce:Sf(t[0]).toNumber(),gasPrice:Sf(t[1]),gasLimit:Sf(t[2]),to:Ef(t[3]),value:Sf(t[4]),data:t[5],chainId:0};if(6===t.length)return r;try{r.v=Go.from(t[6]).toNumber()}catch(e){return r}if(r.r=Bo(t[7],32),r.s=Bo(t[8],32),Go.from(r.r).isZero()&&Go.from(r.s).isZero())r.chainId=r.v,r.v=0;else{r.chainId=Math.floor((r.v-35)/2),r.chainId<0&&(r.chainId=0);let n=r.v-27;const i=t.slice(0,6);0!==r.chainId&&(i.push(No(r.chainId)),i.push("0x"),i.push("0x"),n-=2*r.chainId+8);const o=ns(us(i));try{r.from=Mf(o,{r:No(r.r),s:No(r.s),recoveryParam:n})}catch(e){}r.hash=ns(e)}return r.type=null,r}(t);switch(t[0]){case 1:return function(e){const t=ls(e.slice(1));8!==t.length&&11!==t.length&&Af.throwArgumentError("invalid component count for transaction type: 1","payload",No(e));const r={type:1,chainId:Sf(t[0]).toNumber(),nonce:Sf(t[1]).toNumber(),gasPrice:Sf(t[2]),gasLimit:Sf(t[3]),to:Ef(t[4]),value:Sf(t[5]),data:t[6],accessList:Rf(t[7])};return 8===t.length||(r.hash=ns(e),$f(r,t.slice(8),Tf)),r}(t);case 2:return function(e){const t=ls(e.slice(1));9!==t.length&&12!==t.length&&Af.throwArgumentError("invalid component count for transaction type: 2","payload",No(e));const r=Sf(t[2]),n=Sf(t[3]),i={type:2,chainId:Sf(t[0]).toNumber(),nonce:Sf(t[1]).toNumber(),maxPriorityFeePerGas:r,maxFeePerGas:n,gasPrice:null,gasLimit:Sf(t[4]),to:Ef(t[5]),value:Sf(t[6]),data:t[7],accessList:Rf(t[8])};return 9===t.length||(i.hash=ns(e),$f(i,t.slice(9),Of)),i}(t)}return Af.throwError(`unsupported transaction type: ${t[0]}`,bo.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:t[0]})}var Bf=Object.freeze({__proto__:null,get TransactionTypes(){return _f},accessListify:Rf,computeAddress:kf,parse:Df,recoverAddress:Mf,serialize:jf});var Ff=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))};const zf=new bo("contracts/5.7.0");function Uf(e,t){return Ff(this,void 0,void 0,(function*(){const r=yield t;"string"!=typeof r&&zf.throwArgumentError("invalid address or ENS name","name",r);try{return vs(r)}catch(e){}e||zf.throwError("a provider or signer is needed to resolve ENS names",bo.errors.UNSUPPORTED_OPERATION,{operation:"resolveName"});const n=yield e.resolveName(r);return null==n&&zf.throwArgumentError("resolver or addr is not configured for ENS name","name",r),n}))}function Lf(e,t,r){return Ff(this,void 0,void 0,(function*(){return Array.isArray(r)?yield Promise.all(r.map(((r,n)=>Lf(e,Array.isArray(t)?t[n]:t[r.name],r)))):"address"===r.type?yield Uf(e,t):"tuple"===r.type?yield Lf(e,t,r.components):"array"===r.baseType?Array.isArray(t)?yield Promise.all(t.map((t=>Lf(e,t,r.arrayChildren)))):Promise.reject(zf.makeError("invalid value for array",bo.errors.INVALID_ARGUMENT,{argument:"value",value:t})):t}))}function qf(e,t,r){return Ff(this,void 0,void 0,(function*(){let n={};r.length===t.inputs.length+1&&"object"==typeof r[r.length-1]&&(n=ba(r.pop())),zf.checkArgumentCount(r.length,t.inputs.length,"passed to contract"),e.signer?n.from?n.from=ga({override:Uf(e.signer,n.from),signer:e.signer.getAddress()}).then((e=>Ff(this,void 0,void 0,(function*(){return vs(e.signer)!==e.override&&zf.throwError("Contract with a Signer cannot override from",bo.errors.UNSUPPORTED_OPERATION,{operation:"overrides.from"}),e.override})))):n.from=e.signer.getAddress():n.from&&(n.from=Uf(e.provider,n.from));const i=yield ga({args:Lf(e.signer||e.provider,r,t.inputs),address:e.resolvedAddress,overrides:ga(n)||{}}),o=e.interface.encodeFunctionData(t,i.args),a={data:o,to:i.address},s=i.overrides;if(null!=s.nonce&&(a.nonce=Go.from(s.nonce).toNumber()),null!=s.gasLimit&&(a.gasLimit=Go.from(s.gasLimit)),null!=s.gasPrice&&(a.gasPrice=Go.from(s.gasPrice)),null!=s.maxFeePerGas&&(a.maxFeePerGas=Go.from(s.maxFeePerGas)),null!=s.maxPriorityFeePerGas&&(a.maxPriorityFeePerGas=Go.from(s.maxPriorityFeePerGas)),null!=s.from&&(a.from=s.from),null!=s.type&&(a.type=s.type),null!=s.accessList&&(a.accessList=Rf(s.accessList)),null==a.gasLimit&&null!=t.gas){let e=21e3;const r=xo(o);for(let t=0;tnull!=n[e]));return c.length&&zf.throwError(`cannot override ${c.map((e=>JSON.stringify(e))).join(",")}`,bo.errors.UNSUPPORTED_OPERATION,{operation:"overrides",overrides:c}),a}))}function Hf(e,t,r){const n=e.signer||e.provider;return function(...i){return Ff(this,void 0,void 0,(function*(){let o;if(i.length===t.inputs.length+1&&"object"==typeof i[i.length-1]){const e=ba(i.pop());null!=e.blockTag&&(o=yield e.blockTag),delete e.blockTag,i.push(e)}null!=e.deployTransaction&&(yield e._deployed(o));const a=yield qf(e,t,i),s=yield n.call(a,o);try{let n=e.interface.decodeFunctionResult(t,s);return r&&1===t.outputs.length&&(n=n[0]),n}catch(t){throw t.code===bo.errors.CALL_EXCEPTION&&(t.address=e.address,t.args=i,t.transaction=a),t}}))}}function Kf(e,t){return function(...r){return Ff(this,void 0,void 0,(function*(){e.signer||zf.throwError("sending a transaction requires a signer",bo.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction"}),null!=e.deployTransaction&&(yield e._deployed());const n=yield qf(e,t,r),i=yield e.signer.sendTransaction(n);return function(e,t){const r=t.wait.bind(t);t.wait=t=>r(t).then((t=>(t.events=t.logs.map((r=>{let n=_a(r),i=null;try{i=e.interface.parseLog(r)}catch(e){}return i&&(n.args=i.args,n.decode=(t,r)=>e.interface.decodeEventLog(i.eventFragment,t,r),n.event=i.name,n.eventSignature=i.signature),n.removeListener=()=>e.provider,n.getBlock=()=>e.provider.getBlock(t.blockHash),n.getTransaction=()=>e.provider.getTransaction(t.transactionHash),n.getTransactionReceipt=()=>Promise.resolve(t),n})),t)))}(e,i),i}))}}function Jf(e,t,r){return t.constant?Hf(e,t,r):Kf(e,t)}function Wf(e){return!e.address||null!=e.topics&&0!==e.topics.length?(e.address||"*")+"@"+(e.topics?e.topics.map((e=>Array.isArray(e)?e.join("|"):e)).join(":"):""):"*"}class Gf{constructor(e,t){pa(this,"tag",e),pa(this,"filter",t),this._listeners=[]}addListener(e,t){this._listeners.push({listener:e,once:t})}removeListener(e){let t=!1;this._listeners=this._listeners.filter((r=>!(!t&&r.listener===e)||(t=!0,!1)))}removeAllListeners(){this._listeners=[]}listeners(){return this._listeners.map((e=>e.listener))}listenerCount(){return this._listeners.length}run(e){const t=this.listenerCount();return this._listeners=this._listeners.filter((t=>{const r=e.slice();return setTimeout((()=>{t.listener.apply(this,r)}),0),!t.once})),t}prepareEvent(e){}getEmit(e){return[e]}}class Vf extends Gf{constructor(){super("error",null)}}class Zf extends Gf{constructor(e,t,r,n){const i={address:e};let o=t.getEventTopic(r);n?(o!==n[0]&&zf.throwArgumentError("topic mismatch","topics",n),i.topics=n.slice()):i.topics=[o],super(Wf(i),i),pa(this,"address",e),pa(this,"interface",t),pa(this,"fragment",r)}prepareEvent(e){super.prepareEvent(e),e.event=this.fragment.name,e.eventSignature=this.fragment.format(),e.decode=(e,t)=>this.interface.decodeEventLog(this.fragment,e,t);try{e.args=this.interface.decodeEventLog(this.fragment,e.data,e.topics)}catch(t){e.args=null,e.decodeError=t}}getEmit(e){const t=Za(e.args);if(t.length)throw t[0].error;const r=(e.args||[]).slice();return r.push(e),r}}class Xf extends Gf{constructor(e,t){super("*",{address:e}),pa(this,"address",e),pa(this,"interface",t)}prepareEvent(e){super.prepareEvent(e);try{const t=this.interface.parseLog(e);e.event=t.name,e.eventSignature=t.signature,e.decode=(e,r)=>this.interface.decodeEventLog(t.eventFragment,e,r),e.args=t.args}catch(e){}}}class Qf{constructor(e,t,r){pa(this,"interface",ma(new.target,"getInterface")(t)),null==r?(pa(this,"provider",null),pa(this,"signer",null)):Mu.isSigner(r)?(pa(this,"provider",r.provider||null),pa(this,"signer",r)):Eu.isProvider(r)?(pa(this,"provider",r),pa(this,"signer",null)):zf.throwArgumentError("invalid signer or provider","signerOrProvider",r),pa(this,"callStatic",{}),pa(this,"estimateGas",{}),pa(this,"functions",{}),pa(this,"populateTransaction",{}),pa(this,"filters",{});{const e={};Object.keys(this.interface.events).forEach((t=>{const r=this.interface.events[t];pa(this.filters,t,((...e)=>({address:this.address,topics:this.interface.encodeFilterTopics(r,e)}))),e[r.name]||(e[r.name]=[]),e[r.name].push(t)})),Object.keys(e).forEach((t=>{const r=e[t];1===r.length?pa(this.filters,t,this.filters[r[0]]):zf.warn(`Duplicate definition of ${t} (${r.join(", ")})`)}))}if(pa(this,"_runningEvents",{}),pa(this,"_wrappedEmits",{}),null==e&&zf.throwArgumentError("invalid contract address or ENS name","addressOrName",e),pa(this,"address",e),this.provider)pa(this,"resolvedAddress",Uf(this.provider,e));else try{pa(this,"resolvedAddress",Promise.resolve(vs(e)))}catch(e){zf.throwError("provider is required to use ENS name as contract address",bo.errors.UNSUPPORTED_OPERATION,{operation:"new Contract"})}this.resolvedAddress.catch((e=>{}));const n={},i={};Object.keys(this.interface.functions).forEach((e=>{const t=this.interface.functions[e];if(i[e])zf.warn(`Duplicate ABI entry for ${JSON.stringify(e)}`);else{i[e]=!0;{const r=t.name;n[`%${r}`]||(n[`%${r}`]=[]),n[`%${r}`].push(e)}null==this[e]&&pa(this,e,Jf(this,t,!0)),null==this.functions[e]&&pa(this.functions,e,Jf(this,t,!1)),null==this.callStatic[e]&&pa(this.callStatic,e,Hf(this,t,!0)),null==this.populateTransaction[e]&&pa(this.populateTransaction,e,function(e,t){return function(...r){return qf(e,t,r)}}(this,t)),null==this.estimateGas[e]&&pa(this.estimateGas,e,function(e,t){const r=e.signer||e.provider;return function(...n){return Ff(this,void 0,void 0,(function*(){r||zf.throwError("estimate require a provider or signer",bo.errors.UNSUPPORTED_OPERATION,{operation:"estimateGas"});const i=yield qf(e,t,n);return yield r.estimateGas(i)}))}}(this,t))}})),Object.keys(n).forEach((e=>{const t=n[e];if(t.length>1)return;e=e.substring(1);const r=t[0];try{null==this[e]&&pa(this,e,this[r])}catch(e){}null==this.functions[e]&&pa(this.functions,e,this.functions[r]),null==this.callStatic[e]&&pa(this.callStatic,e,this.callStatic[r]),null==this.populateTransaction[e]&&pa(this.populateTransaction,e,this.populateTransaction[r]),null==this.estimateGas[e]&&pa(this.estimateGas,e,this.estimateGas[r])}))}static getContractAddress(e){return ws(e)}static getInterface(e){return bu.isInterface(e)?e:new bu(e)}deployed(){return this._deployed()}_deployed(e){return this._deployedPromise||(this.deployTransaction?this._deployedPromise=this.deployTransaction.wait().then((()=>this)):this._deployedPromise=this.provider.getCode(this.address,e).then((e=>("0x"===e&&zf.throwError("contract not deployed",bo.errors.UNSUPPORTED_OPERATION,{contractAddress:this.address,operation:"getDeployed"}),this)))),this._deployedPromise}fallback(e){this.signer||zf.throwError("sending a transactions require a signer",bo.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction(fallback)"});const t=ba(e||{});return["from","to"].forEach((function(e){null!=t[e]&&zf.throwError("cannot override "+e,bo.errors.UNSUPPORTED_OPERATION,{operation:e})})),t.to=this.resolvedAddress,this.deployed().then((()=>this.signer.sendTransaction(t)))}connect(e){"string"==typeof e&&(e=new Cu(e,this.provider));const t=new this.constructor(this.address,this.interface,e);return this.deployTransaction&&pa(t,"deployTransaction",this.deployTransaction),t}attach(e){return new this.constructor(e,this.interface,this.signer||this.provider)}static isIndexed(e){return mu.isIndexed(e)}_normalizeRunningEvent(e){return this._runningEvents[e.tag]?this._runningEvents[e.tag]:e}_getRunningEvent(e){if("string"==typeof e){if("error"===e)return this._normalizeRunningEvent(new Vf);if("event"===e)return this._normalizeRunningEvent(new Gf("event",null));if("*"===e)return this._normalizeRunningEvent(new Xf(this.address,this.interface));const t=this.interface.getEvent(e);return this._normalizeRunningEvent(new Zf(this.address,this.interface,t))}if(e.topics&&e.topics.length>0){try{const t=e.topics[0];if("string"!=typeof t)throw new Error("invalid topic");const r=this.interface.getEvent(t);return this._normalizeRunningEvent(new Zf(this.address,this.interface,r,e.topics))}catch(e){}const t={address:this.address,topics:e.topics};return this._normalizeRunningEvent(new Gf(Wf(t),t))}return this._normalizeRunningEvent(new Xf(this.address,this.interface))}_checkRunningEvents(e){if(0===e.listenerCount()){delete this._runningEvents[e.tag];const t=this._wrappedEmits[e.tag];t&&e.filter&&(this.provider.off(e.filter,t),delete this._wrappedEmits[e.tag])}}_wrapEvent(e,t,r){const n=_a(t);return n.removeListener=()=>{r&&(e.removeListener(r),this._checkRunningEvents(e))},n.getBlock=()=>this.provider.getBlock(t.blockHash),n.getTransaction=()=>this.provider.getTransaction(t.transactionHash),n.getTransactionReceipt=()=>this.provider.getTransactionReceipt(t.transactionHash),e.prepareEvent(n),n}_addEventListener(e,t,r){if(this.provider||zf.throwError("events require a provider or a signer with a provider",bo.errors.UNSUPPORTED_OPERATION,{operation:"once"}),e.addListener(t,r),this._runningEvents[e.tag]=e,!this._wrappedEmits[e.tag]){const r=r=>{let n=this._wrapEvent(e,r,t);if(null==n.decodeError)try{const t=e.getEmit(n);this.emit(e.filter,...t)}catch(e){n.decodeError=e.error}null!=e.filter&&this.emit("event",n),null!=n.decodeError&&this.emit("error",n.decodeError,n)};this._wrappedEmits[e.tag]=r,null!=e.filter&&this.provider.on(e.filter,r)}}queryFilter(e,t,r){const n=this._getRunningEvent(e),i=ba(n.filter);return"string"==typeof t&&Io(t,32)?(null!=r&&zf.throwArgumentError("cannot specify toBlock with blockhash","toBlock",r),i.blockHash=t):(i.fromBlock=null!=t?t:0,i.toBlock=null!=r?r:"latest"),this.provider.getLogs(i).then((e=>e.map((e=>this._wrapEvent(n,e,null)))))}on(e,t){return this._addEventListener(this._getRunningEvent(e),t,!1),this}once(e,t){return this._addEventListener(this._getRunningEvent(e),t,!0),this}emit(e,...t){if(!this.provider)return!1;const r=this._getRunningEvent(e),n=r.run(t)>0;return this._checkRunningEvents(r),n}listenerCount(e){return this.provider?null==e?Object.keys(this._runningEvents).reduce(((e,t)=>e+this._runningEvents[t].listenerCount()),0):this._getRunningEvent(e).listenerCount():0}listeners(e){if(!this.provider)return[];if(null==e){const e=[];for(let t in this._runningEvents)this._runningEvents[t].listeners().forEach((t=>{e.push(t)}));return e}return this._getRunningEvent(e).listeners()}removeAllListeners(e){if(!this.provider)return this;if(null==e){for(const e in this._runningEvents){const t=this._runningEvents[e];t.removeAllListeners(),this._checkRunningEvents(t)}return this}const t=this._getRunningEvent(e);return t.removeAllListeners(),this._checkRunningEvents(t),this}off(e,t){if(!this.provider)return this;const r=this._getRunningEvent(e);return r.removeListener(t),this._checkRunningEvents(r),this}removeListener(e,t){return this.off(e,t)}}class Yf extends Qf{}class ed{constructor(e){pa(this,"alphabet",e),pa(this,"base",e.length),pa(this,"_alphabetMap",{}),pa(this,"_leader",e.charAt(0));for(let t=0;t0;)r.push(n%this.base),n=n/this.base|0}let n="";for(let e=0;0===t[e]&&e=0;--e)n+=this.alphabet[r[e]];return n}decode(e){if("string"!=typeof e)throw new TypeError("Expected String");let t=[];if(0===e.length)return new Uint8Array(t);t.push(0);for(let r=0;r>=8;for(;i>0;)t.push(255&i),i>>=8}for(let r=0;e[r]===this._leader&&r>24&255,c[t.length+1]=d>>16&255,c[t.length+2]=d>>8&255,c[t.length+3]=255&d;let l=xo(cd(i,e,c));o||(o=l.length,f=new Uint8Array(o),a=Math.ceil(n/o),u=n-(a-1)*o),f.set(l);for(let t=1;t=256)throw new Error("Depth too large!");return Ed(ko([null!=this.privateKey?"0x0488ADE4":"0x0488B21E",No(this.depth),this.parentFingerprint,Bo(No(this.index),4),this.chainCode,null!=this.privateKey?ko(["0x00",this.privateKey]):this.publicKey]))}neuter(){return new kd(Pd,null,this.publicKey,this.parentFingerprint,this.chainCode,this.index,this.depth,this.path)}_derive(e){if(e>4294967295)throw new Error("invalid index - "+String(e));let t=this.path;t&&(t+="/"+(2147483647&e));const r=new Uint8Array(37);if(e&wd){if(!this.privateKey)throw new Error("cannot derive child of neutered node");r.set(xo(this.privateKey),1),t&&(t+="'")}else r.set(xo(this.publicKey));for(let t=24;t>=0;t-=8)r[33+(t>>3)]=e>>24-t&255;const n=xo(cd(nd.sha512,this.chainCode,r)),i=n.slice(0,32),o=n.slice(32);let a=null,s=null;if(this.privateKey)a=_d(Go.from(i).add(this.privateKey).mod(bd));else{s=new yf(No(i))._addPoint(this.publicKey)}let c=t;const u=this.mnemonic;return u&&(c=Object.freeze({phrase:u.phrase,path:t,locale:u.locale||"en"})),new kd(Pd,a,s,this.fingerprint,_d(o),e,this.depth+1,c)}derivePath(e){const t=e.split("/");if(0===t.length||"m"===t[0]&&0!==this.depth)throw new Error("invalid path - "+e);"m"===t[0]&&t.shift();let r=this;for(let e=0;e=wd)throw new Error("invalid path index - "+n);r=r._derive(wd+e)}else{if(!n.match(/^[0-9]+$/))throw new Error("invalid path component - "+n);{const e=parseInt(n);if(e>=wd)throw new Error("invalid path index - "+n);r=r._derive(e)}}}return r}static _fromSeed(e,t){const r=xo(e);if(r.length<16||r.length>64)throw new Error("invalid seed");const n=xo(cd(nd.sha512,vd,r));return new kd(Pd,_d(n.slice(0,32)),null,"0x00000000",_d(n.slice(32)),0,0,t)}static fromMnemonic(e,t,r){return e=Id(Cd(e,r=Sd(r)),r),kd._fromSeed(Md(e,t),{phrase:e,path:"m",locale:r.locale})}static fromSeed(e){return kd._fromSeed(e,null)}static fromExtendedKey(e){const t=rd.decode(e);82===t.length&&Ed(t.slice(0,78))===e||yd.throwArgumentError("invalid extended key","extendedKey","[REDACTED]");const r=t[4],n=No(t.slice(5,9)),i=parseInt(No(t.slice(9,13)).substring(2),16),o=No(t.slice(13,45)),a=t.slice(45,78);switch(No(t.slice(0,4))){case"0x0488b21e":case"0x043587cf":return new kd(Pd,null,No(a),n,o,i,r,null);case"0x0488ade4":case"0x04358394 ":if(0!==a[0])break;return new kd(Pd,No(a.slice(1)),null,n,o,i,r,null)}return yd.throwArgumentError("invalid extended key","extendedKey","[REDACTED]")}}function Md(e,t){t||(t="");const r=Ks("mnemonic"+t,zs.NFKD);return fd(Ks(e,zs.NFKD),r,2048,64,"sha512")}function Cd(e,t){t=Sd(t),yd.checkNormalize();const r=t.split(e);if(r.length%3!=0)throw new Error("invalid mnemonic");const n=xo(new Uint8Array(Math.ceil(11*r.length/8)));let i=0;for(let e=0;e>3]|=1<<7-i%8),i++}const o=32*r.length/3,a=Ad(r.length/3);if((xo(sd(n.slice(0,o/8)))[0]&a)!==(n[n.length-1]&a))throw new Error("invalid checksum");return No(n.slice(0,o/8))}function Id(e,t){if(t=Sd(t),(e=xo(e)).length%4!=0||e.length<16||e.length>32)throw new Error("invalid entropy");const r=[0];let n=11;for(let t=0;t8?(r[r.length-1]<<=8,r[r.length-1]|=e[t],n-=8):(r[r.length-1]<<=n,r[r.length-1]|=e[t]>>8-n,r.push(e[t]&(1<<8-n)-1),n+=3);const i=e.length/4,o=xo(sd(e))[0]&Ad(i);return r[r.length-1]<<=i,r[r.length-1]|=o>>8-i,t.join(r.map((e=>t.getWord(e))))}var Rd=Object.freeze({__proto__:null,HDNode:kd,defaultPath:xd,entropyToMnemonic:Id,getAccountPath:function(e){return("number"!=typeof e||e<0||e>=wd||e%1)&&yd.throwArgumentError("invalid account index","index",e),`m/44'/60'/${e}'/0/0`},isValidMnemonic:function(e,t){try{return Cd(e,t),!0}catch(e){}return!1},mnemonicToEntropy:Cd,mnemonicToSeed:Md});const Nd=new bo("random/5.7.0");const Od=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")}();let Td=Od.crypto||Od.msCrypto;function jd(e){(e<=0||e>1024||e%1||e!=e)&&Nd.throwArgumentError("invalid length","length",e);const t=new Uint8Array(e);return Td.getRandomValues(t),xo(t)}Td&&Td.getRandomValues||(Nd.warn("WARNING: Missing strong random number source"),Td={getRandomValues:function(e){return Nd.throwError("no secure random source avaialble",bo.errors.UNSUPPORTED_OPERATION,{operation:"crypto.getRandomValues"})}});var $d=Object.freeze({__proto__:null,randomBytes:jd,shuffled:function(e){for(let t=(e=e.slice()).length-1;t>0;t--){const r=Math.floor(Math.random()*(t+1)),n=e[t];e[t]=e[r],e[r]=n}return e}}),Dd={exports:{}};!function(e,t){!function(t){function r(e){return parseInt(e)===e}function n(e){if(!r(e.length))return!1;for(var t=0;t255)return!1;return!0}function i(e,t){if(e.buffer&&ArrayBuffer.isView(e)&&"Uint8Array"===e.name)return t&&(e=e.slice?e.slice():Array.prototype.slice.call(e)),e;if(Array.isArray(e)){if(!n(e))throw new Error("Array contains invalid value: "+e);return new Uint8Array(e)}if(r(e.length)&&n(e))return new Uint8Array(e);throw new Error("unsupported array-like object")}function o(e){return new Uint8Array(e)}function a(e,t,r,n,i){null==n&&null==i||(e=e.slice?e.slice(n,i):Array.prototype.slice.call(e,n,i)),t.set(e,r)}var s,c={toBytes:function(e){var t=[],r=0;for(e=encodeURI(e);r191&&n<224?(t.push(String.fromCharCode((31&n)<<6|63&e[r+1])),r+=2):(t.push(String.fromCharCode((15&n)<<12|(63&e[r+1])<<6|63&e[r+2])),r+=3)}return t.join("")}},u=(s="0123456789abcdef",{toBytes:function(e){for(var t=[],r=0;r>4]+s[15&n])}return t.join("")}}),f={16:10,24:12,32:14},d=[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],l=[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],h=[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],p=[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],m=[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],g=[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],y=[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],b=[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],v=[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],w=[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],A=[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],_=[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],E=[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],S=[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],P=[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 x(e){for(var t=[],r=0;r>2,this._Ke[r][t%4]=o[t],this._Kd[e-r][t%4]=o[t];for(var a,s=0,c=i;c>16&255]<<24^l[a>>8&255]<<16^l[255&a]<<8^l[a>>24&255]^d[s]<<24,s+=1,8!=i)for(t=1;t>8&255]<<8^l[a>>16&255]<<16^l[a>>24&255]<<24;for(t=i/2+1;t>2,h=c%4,this._Ke[u][h]=o[t],this._Kd[e-u][h]=o[t++],c++}for(var u=1;u>24&255]^E[a>>16&255]^S[a>>8&255]^P[255&a]},k.prototype.encrypt=function(e){if(16!=e.length)throw new Error("invalid plaintext size (must be 16 bytes)");for(var t=this._Ke.length-1,r=[0,0,0,0],n=x(e),i=0;i<4;i++)n[i]^=this._Ke[0][i];for(var a=1;a>24&255]^m[n[(i+1)%4]>>16&255]^g[n[(i+2)%4]>>8&255]^y[255&n[(i+3)%4]]^this._Ke[a][i];n=r.slice()}var s,c=o(16);for(i=0;i<4;i++)s=this._Ke[t][i],c[4*i]=255&(l[n[i]>>24&255]^s>>24),c[4*i+1]=255&(l[n[(i+1)%4]>>16&255]^s>>16),c[4*i+2]=255&(l[n[(i+2)%4]>>8&255]^s>>8),c[4*i+3]=255&(l[255&n[(i+3)%4]]^s);return c},k.prototype.decrypt=function(e){if(16!=e.length)throw new Error("invalid ciphertext size (must be 16 bytes)");for(var t=this._Kd.length-1,r=[0,0,0,0],n=x(e),i=0;i<4;i++)n[i]^=this._Kd[0][i];for(var a=1;a>24&255]^v[n[(i+3)%4]>>16&255]^w[n[(i+2)%4]>>8&255]^A[255&n[(i+1)%4]]^this._Kd[a][i];n=r.slice()}var s,c=o(16);for(i=0;i<4;i++)s=this._Kd[t][i],c[4*i]=255&(h[n[i]>>24&255]^s>>24),c[4*i+1]=255&(h[n[(i+3)%4]>>16&255]^s>>16),c[4*i+2]=255&(h[n[(i+2)%4]>>8&255]^s>>8),c[4*i+3]=255&(h[255&n[(i+1)%4]]^s);return c};var M=function(e){if(!(this instanceof M))throw Error("AES must be instanitated with `new`");this.description="Electronic Code Block",this.name="ecb",this._aes=new k(e)};M.prototype.encrypt=function(e){if((e=i(e)).length%16!=0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var t=o(e.length),r=o(16),n=0;n=0;--t)this._counter[t]=e%256,e>>=8},N.prototype.setBytes=function(e){if(16!=(e=i(e,!0)).length)throw new Error("invalid counter bytes size (must be 16 bytes)");this._counter=e},N.prototype.increment=function(){for(var e=15;e>=0;e--){if(255!==this._counter[e]){this._counter[e]++;break}this._counter[e]=0}};var O=function(e,t){if(!(this instanceof O))throw Error("AES must be instanitated with `new`");this.description="Counter",this.name="ctr",t instanceof N||(t=new N(t)),this._counter=t,this._remainingCounter=null,this._remainingCounterIndex=16,this._aes=new k(e)};O.prototype.encrypt=function(e){for(var t=i(e,!0),r=0;r16)throw new Error("PKCS#7 padding byte out of range");for(var r=e.length-t,n=0;n=64;){let h,p,m,g,y,b=r,v=n,w=i,A=o,_=a,E=s,S=c,P=u;for(p=0;p<16;p++)m=d+4*p,f[p]=(255&e[m])<<24|(255&e[m+1])<<16|(255&e[m+2])<<8|255&e[m+3];for(p=16;p<64;p++)h=f[p-2],g=(h>>>17|h<<15)^(h>>>19|h<<13)^h>>>10,h=f[p-15],y=(h>>>7|h<<25)^(h>>>18|h<<14)^h>>>3,f[p]=(g+f[p-7]|0)+(y+f[p-16]|0)|0;for(p=0;p<64;p++)g=(((_>>>6|_<<26)^(_>>>11|_<<21)^(_>>>25|_<<7))+(_&E^~_&S)|0)+(P+(t[p]+f[p]|0)|0)|0,y=((b>>>2|b<<30)^(b>>>13|b<<19)^(b>>>22|b<<10))+(b&v^b&w^v&w)|0,P=S,S=E,E=_,_=A+g|0,A=w,w=v,v=b,b=g+y|0;r=r+b|0,n=n+v|0,i=i+w|0,o=o+A|0,a=a+_|0,s=s+E|0,c=c+S|0,u=u+P|0,d+=64,l-=64}}d(e);let l,h=e.length%64,p=e.length/536870912|0,m=e.length<<3,g=h<56?56:120,y=e.slice(e.length-h,e.length);for(y.push(128),l=h+1;l>>24&255),y.push(p>>>16&255),y.push(p>>>8&255),y.push(p>>>0&255),y.push(m>>>24&255),y.push(m>>>16&255),y.push(m>>>8&255),y.push(m>>>0&255),d(y),[r>>>24&255,r>>>16&255,r>>>8&255,r>>>0&255,n>>>24&255,n>>>16&255,n>>>8&255,n>>>0&255,i>>>24&255,i>>>16&255,i>>>8&255,i>>>0&255,o>>>24&255,o>>>16&255,o>>>8&255,o>>>0&255,a>>>24&255,a>>>16&255,a>>>8&255,a>>>0&255,s>>>24&255,s>>>16&255,s>>>8&255,s>>>0&255,c>>>24&255,c>>>16&255,c>>>8&255,c>>>0&255,u>>>24&255,u>>>16&255,u>>>8&255,u>>>0&255]}function i(e,t,r){e=e.length<=64?e:n(e);const i=64+t.length+4,o=new Array(i),a=new Array(64);let s,c=[];for(s=0;s<64;s++)o[s]=54;for(s=0;s=i-4;e--){if(o[e]++,o[e]<=255)return;o[e]=0}}for(;r>=32;)u(),c=c.concat(n(a.concat(n(o)))),r-=32;return r>0&&(u(),c=c.concat(n(a.concat(n(o))).slice(0,r))),c}function o(e,t,r,n,i){let o;for(u(e,16*(2*r-1),i,0,16),o=0;o<2*r;o++)c(e,16*o,i,16),s(i,n),u(i,0,e,t+16*o,16);for(o=0;o>>32-t}function s(e,t){u(e,0,t,0,16);for(let e=8;e>0;e-=2)t[4]^=a(t[0]+t[12],7),t[8]^=a(t[4]+t[0],9),t[12]^=a(t[8]+t[4],13),t[0]^=a(t[12]+t[8],18),t[9]^=a(t[5]+t[1],7),t[13]^=a(t[9]+t[5],9),t[1]^=a(t[13]+t[9],13),t[5]^=a(t[1]+t[13],18),t[14]^=a(t[10]+t[6],7),t[2]^=a(t[14]+t[10],9),t[6]^=a(t[2]+t[14],13),t[10]^=a(t[6]+t[2],18),t[3]^=a(t[15]+t[11],7),t[7]^=a(t[3]+t[15],9),t[11]^=a(t[7]+t[3],13),t[15]^=a(t[11]+t[7],18),t[1]^=a(t[0]+t[3],7),t[2]^=a(t[1]+t[0],9),t[3]^=a(t[2]+t[1],13),t[0]^=a(t[3]+t[2],18),t[6]^=a(t[5]+t[4],7),t[7]^=a(t[6]+t[5],9),t[4]^=a(t[7]+t[6],13),t[5]^=a(t[4]+t[7],18),t[11]^=a(t[10]+t[9],7),t[8]^=a(t[11]+t[10],9),t[9]^=a(t[8]+t[11],13),t[10]^=a(t[9]+t[8],18),t[12]^=a(t[15]+t[14],7),t[13]^=a(t[12]+t[15],9),t[14]^=a(t[13]+t[12],13),t[15]^=a(t[14]+t[13],18);for(let r=0;r<16;++r)e[r]+=t[r]}function c(e,t,r,n){for(let i=0;i=256)return!1}return!0}function d(e,t){if("number"!=typeof e||e%1)throw new Error("invalid "+t);return e}function l(e,t,n,a,s,l,h){if(n=d(n,"N"),a=d(a,"r"),s=d(s,"p"),l=d(l,"dkLen"),0===n||0!=(n&n-1))throw new Error("N must be power of 2");if(n>r/128/a)throw new Error("N too large");if(a>r/128/s)throw new Error("r too large");if(!f(e))throw new Error("password must be an array or buffer");if(e=Array.prototype.slice.call(e),!f(t))throw new Error("salt must be an array or buffer");t=Array.prototype.slice.call(t);let p=i(e,t,128*s*a);const m=new Uint32Array(32*s*a);for(let e=0;eC&&(t=C);for(let e=0;eC&&(t=C);for(let e=0;e>0&255),p.push(m[e]>>8&255),p.push(m[e]>>16&255),p.push(m[e]>>24&255);const r=i(e,p,l);return h&&h(null,1,r),r}h&&I(R)};if(!h)for(;;){const e=R();if(null!=e)return e}R()}const h={scrypt:function(e,t,r,n,i,o,a){return new Promise((function(s,c){let u=0;a&&a(0),l(e,t,r,n,i,o,(function(e,t,r){if(e)c(e);else if(r)a&&1!==u&&a(1),s(new Uint8Array(r));else if(a&&t!==u)return u=t,a(t)}))}))},syncScrypt:function(e,t,r,n,i,o){return new Uint8Array(l(e,t,r,n,i,o))}};e.exports=h}()}(Zd);var Xd=s(Zd.exports),Qd=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))};const Yd=new bo(Fd);function el(e){return null!=e&&e.mnemonic&&e.mnemonic.phrase}class tl extends Ea{isKeystoreAccount(e){return!(!e||!e._isKeystoreAccount)}}function rl(e,t){const r=zd(qd(e,"crypto/ciphertext"));if(No(ns(ko([t.slice(16,32),r]))).substring(2)!==qd(e,"crypto/mac").toLowerCase())throw new Error("invalid password");const n=function(e,t,r){if("aes-128-ctr"===qd(e,"crypto/cipher")){const n=zd(qd(e,"crypto/cipherparams/iv")),i=new Bd.Counter(n);return xo(new Bd.ModeOfOperation.ctr(t,i).decrypt(r))}return null}(e,t.slice(0,16),r);n||Yd.throwError("unsupported cipher",bo.errors.UNSUPPORTED_OPERATION,{operation:"decrypt"});const i=t.slice(32,64),o=kf(n);if(e.address){let t=e.address.toLowerCase();if("0x"!==t.substring(0,2)&&(t="0x"+t),vs(t)!==o)throw new Error("address mismatch")}const a={_isKeystoreAccount:!0,address:o,privateKey:No(n)};if("0.1"===qd(e,"x-ethers/version")){const t=zd(qd(e,"x-ethers/mnemonicCiphertext")),r=zd(qd(e,"x-ethers/mnemonicCounter")),n=new Bd.Counter(r),o=new Bd.ModeOfOperation.ctr(i,n),s=qd(e,"x-ethers/path")||xd,c=qd(e,"x-ethers/locale")||"en",u=xo(o.decrypt(t));try{const e=Id(u,c),t=kd.fromMnemonic(e,null,c).derivePath(s);if(t.privateKey!=a.privateKey)throw new Error("mnemonic mismatch");a.mnemonic=t.mnemonic}catch(e){if(e.code!==bo.errors.INVALID_ARGUMENT||"wordlist"!==e.argument)throw e}}return new tl(a)}function nl(e,t,r,n,i){return xo(fd(e,t,r,n,i))}function il(e,t,r,n,i){return Promise.resolve(nl(e,t,r,n,i))}function ol(e,t,r,n,i){const o=Ld(t),a=qd(e,"crypto/kdf");if(a&&"string"==typeof a){const t=function(e,t){return Yd.throwArgumentError("invalid key-derivation function parameters",e,t)};if("scrypt"===a.toLowerCase()){const r=zd(qd(e,"crypto/kdfparams/salt")),s=parseInt(qd(e,"crypto/kdfparams/n")),c=parseInt(qd(e,"crypto/kdfparams/r")),u=parseInt(qd(e,"crypto/kdfparams/p"));s&&c&&u||t("kdf",a),0!=(s&s-1)&&t("N",s);const f=parseInt(qd(e,"crypto/kdfparams/dklen"));return 32!==f&&t("dklen",f),n(o,r,s,c,u,64,i)}if("pbkdf2"===a.toLowerCase()){const n=zd(qd(e,"crypto/kdfparams/salt"));let i=null;const a=qd(e,"crypto/kdfparams/prf");"hmac-sha256"===a?i="sha256":"hmac-sha512"===a?i="sha512":t("prf",a);const s=parseInt(qd(e,"crypto/kdfparams/c")),c=parseInt(qd(e,"crypto/kdfparams/dklen"));return 32!==c&&t("dklen",c),r(o,n,s,c,i)}}return Yd.throwArgumentError("unsupported key-derivation function","kdf",a)}function al(e,t){const r=JSON.parse(e);return rl(r,ol(r,t,nl,Xd.syncScrypt))}function sl(e,t,r){return Qd(this,void 0,void 0,(function*(){const n=JSON.parse(e);return rl(n,yield ol(n,t,il,Xd.scrypt,r))}))}function cl(e,t,r,n){try{if(vs(e.address)!==kf(e.privateKey))throw new Error("address/privateKey mismatch");if(el(e)){const t=e.mnemonic;if(kd.fromMnemonic(t.phrase,null,t.locale).derivePath(t.path||xd).privateKey!=e.privateKey)throw new Error("mnemonic mismatch")}}catch(e){return Promise.reject(e)}"function"!=typeof r||n||(n=r,r={}),r||(r={});const i=xo(e.privateKey),o=Ld(t);let a=null,s=null,c=null;if(el(e)){const t=e.mnemonic;a=xo(Cd(t.phrase,t.locale||"en")),s=t.path||xd,c=t.locale||"en"}let u=r.client;u||(u="ethers.js");let f=null;f=r.salt?xo(r.salt):jd(32);let d=null;if(r.iv){if(d=xo(r.iv),16!==d.length)throw new Error("invalid iv")}else d=jd(16);let l=null;if(r.uuid){if(l=xo(r.uuid),16!==l.length)throw new Error("invalid uuid")}else l=jd(16);let h=1<<17,p=8,m=1;return r.scrypt&&(r.scrypt.N&&(h=r.scrypt.N),r.scrypt.r&&(p=r.scrypt.r),r.scrypt.p&&(m=r.scrypt.p)),Xd.scrypt(o,f,h,p,m,64,n).then((t=>{const r=(t=xo(t)).slice(0,16),n=t.slice(16,32),o=t.slice(32,64),g=new Bd.Counter(d),y=xo(new Bd.ModeOfOperation.ctr(r,g).encrypt(i)),b=ns(ko([n,y])),v={address:e.address.substring(2).toLowerCase(),id:Hd(l),version:3,crypto:{cipher:"aes-128-ctr",cipherparams:{iv:No(d).substring(2)},ciphertext:No(y).substring(2),kdf:"scrypt",kdfparams:{salt:No(f).substring(2),n:h,dklen:32,p:m,r:p},mac:b.substring(2)}};if(a){const e=jd(16),t=new Bd.Counter(e),r=xo(new Bd.ModeOfOperation.ctr(o,t).encrypt(a)),n=new Date,i=n.getUTCFullYear()+"-"+Ud(n.getUTCMonth()+1,2)+"-"+Ud(n.getUTCDate(),2)+"T"+Ud(n.getUTCHours(),2)+"-"+Ud(n.getUTCMinutes(),2)+"-"+Ud(n.getUTCSeconds(),2)+".0Z";v["x-ethers"]={client:u,gethFilename:"UTC--"+i+"--"+v.address,mnemonicCounter:No(e).substring(2),mnemonicCiphertext:No(r).substring(2),path:s,locale:c,version:"0.1"}}return JSON.stringify(v)}))}function ul(e,t,r){if(Gd(e)){r&&r(0);const n=Wd(e,t);return r&&r(1),Promise.resolve(n)}return Vd(e)?sl(e,t,r):Promise.reject(new Error("invalid JSON wallet"))}function fl(e,t){if(Gd(e))return Wd(e,t);if(Vd(e))return al(e,t);throw new Error("invalid JSON wallet")}var dl=Object.freeze({__proto__:null,decryptCrowdsale:Wd,decryptJsonWallet:ul,decryptJsonWalletSync:fl,decryptKeystore:sl,decryptKeystoreSync:al,encryptKeystore:cl,getJsonWalletAddress:function(e){if(Gd(e))try{return vs(JSON.parse(e).ethaddr)}catch(e){return null}if(Vd(e))try{return vs(JSON.parse(e).address)}catch(e){return null}return null},isCrowdsaleWallet:Gd,isKeystoreWallet:Vd});var ll=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))};const hl=new bo("wallet/5.7.0");class pl extends Mu{constructor(e,t){if(super(),null!=(r=e)&&Io(r.privateKey,32)&&null!=r.address){const t=new yf(e.privateKey);if(pa(this,"_signingKey",(()=>t)),pa(this,"address",kf(this.publicKey)),this.address!==vs(e.address)&&hl.throwArgumentError("privateKey/address mismatch","privateKey","[REDACTED]"),function(e){const t=e.mnemonic;return t&&t.phrase}(e)){const t=e.mnemonic;pa(this,"_mnemonic",(()=>({phrase:t.phrase,path:t.path||xd,locale:t.locale||"en"})));const r=this.mnemonic;kf(kd.fromMnemonic(r.phrase,null,r.locale).derivePath(r.path).privateKey)!==this.address&&hl.throwArgumentError("mnemonic/address mismatch","privateKey","[REDACTED]")}else pa(this,"_mnemonic",(()=>null))}else{if(yf.isSigningKey(e))"secp256k1"!==e.curve&&hl.throwArgumentError("unsupported curve; must be secp256k1","privateKey","[REDACTED]"),pa(this,"_signingKey",(()=>e));else{"string"==typeof e&&e.match(/^[0-9a-f]*$/i)&&64===e.length&&(e="0x"+e);const t=new yf(e);pa(this,"_signingKey",(()=>t))}pa(this,"_mnemonic",(()=>null)),pa(this,"address",kf(this.publicKey))}var r;t&&!Eu.isProvider(t)&&hl.throwArgumentError("invalid provider","provider",t),pa(this,"provider",t||null)}get mnemonic(){return this._mnemonic()}get privateKey(){return this._signingKey().privateKey}get publicKey(){return this._signingKey().publicKey}getAddress(){return Promise.resolve(this.address)}connect(e){return new pl(this,e)}signTransaction(e){return ga(e).then((t=>{null!=t.from&&(vs(t.from)!==this.address&&hl.throwArgumentError("transaction from address mismatch","transaction.from",e.from),delete t.from);const r=this._signingKey().signDigest(ns(jf(t)));return jf(t,r)}))}signMessage(e){return ll(this,void 0,void 0,(function*(){return zo(this._signingKey().signDigest(Wc(e)))}))}_signTypedData(e,t,r){return ll(this,void 0,void 0,(function*(){const n=yield uu.resolveNames(e,t,r,(e=>(null==this.provider&&hl.throwError("cannot resolve ENS names without a provider",bo.errors.UNSUPPORTED_OPERATION,{operation:"resolveName",value:e}),this.provider.resolveName(e))));return zo(this._signingKey().signDigest(uu.hash(n.domain,t,n.value)))}))}encrypt(e,t,r){if("function"!=typeof t||r||(r=t,t={}),r&&"function"!=typeof r)throw new Error("invalid callback");return t||(t={}),cl(this,e,t,r)}static createRandom(e){let t=jd(16);e||(e={}),e.extraEntropy&&(t=xo(To(ns(ko([t,e.extraEntropy])),0,16)));const r=Id(t,e.locale);return pl.fromMnemonic(r,e.path,e.locale)}static fromEncryptedJson(e,t,r){return ul(e,t,r).then((e=>new pl(e)))}static fromEncryptedJsonSync(e,t){return new pl(fl(e,t))}static fromMnemonic(e,t,r){return t||(t=xd),new pl(kd.fromMnemonic(e,null,r).derivePath(t))}}var ml=Object.freeze({__proto__:null,Wallet:pl,verifyMessage:function(e,t){return Mf(Wc(e),t)},verifyTypedData:function(e,t,r,n){return Mf(uu.hash(e,t,r),n)}});const gl=new bo("networks/5.7.1");function yl(e){const t=function(t,r){null==r&&(r={});const n=[];if(t.InfuraProvider&&"-"!==r.infura)try{n.push(new t.InfuraProvider(e,r.infura))}catch(e){}if(t.EtherscanProvider&&"-"!==r.etherscan)try{n.push(new t.EtherscanProvider(e,r.etherscan))}catch(e){}if(t.AlchemyProvider&&"-"!==r.alchemy)try{n.push(new t.AlchemyProvider(e,r.alchemy))}catch(e){}if(t.PocketProvider&&"-"!==r.pocket){const i=["goerli","ropsten","rinkeby","sepolia"];try{const o=new t.PocketProvider(e,r.pocket);o.network&&-1===i.indexOf(o.network.name)&&n.push(o)}catch(e){}}if(t.CloudflareProvider&&"-"!==r.cloudflare)try{n.push(new t.CloudflareProvider(e))}catch(e){}if(t.AnkrProvider&&"-"!==r.ankr)try{const i=["ropsten"],o=new t.AnkrProvider(e,r.ankr);o.network&&-1===i.indexOf(o.network.name)&&n.push(o)}catch(e){}if(0===n.length)return null;if(t.FallbackProvider){let i=1;return null!=r.quorum?i=r.quorum:"homestead"===e&&(i=2),new t.FallbackProvider(n,i)}return n[0]};return t.renetwork=function(e){return yl(e)},t}function bl(e,t){const r=function(r,n){return r.JsonRpcProvider?new r.JsonRpcProvider(e,t):null};return r.renetwork=function(t){return bl(e,t)},r}const vl={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:yl("homestead")},wl={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:yl("ropsten")},Al={chainId:63,name:"classicMordor",_defaultProvider:bl("https://www.ethercluster.com/mordor","classicMordor")},_l={unspecified:{chainId:0,name:"unspecified"},homestead:vl,mainnet:vl,morden:{chainId:2,name:"morden"},ropsten:wl,testnet:wl,rinkeby:{chainId:4,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"rinkeby",_defaultProvider:yl("rinkeby")},kovan:{chainId:42,name:"kovan",_defaultProvider:yl("kovan")},goerli:{chainId:5,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"goerli",_defaultProvider:yl("goerli")},kintsugi:{chainId:1337702,name:"kintsugi"},sepolia:{chainId:11155111,name:"sepolia",_defaultProvider:yl("sepolia")},classic:{chainId:61,name:"classic",_defaultProvider:bl("https://www.ethercluster.com/etc","classic")},classicMorden:{chainId:62,name:"classicMorden"},classicMordor:Al,classicTestnet:Al,classicKotti:{chainId:6,name:"classicKotti",_defaultProvider:bl("https://www.ethercluster.com/kotti","classicKotti")},xdai:{chainId:100,name:"xdai"},matic:{chainId:137,name:"matic",_defaultProvider:yl("matic")},maticmum:{chainId:80001,name:"maticmum"},optimism:{chainId:10,name:"optimism",_defaultProvider:yl("optimism")},"optimism-kovan":{chainId:69,name:"optimism-kovan"},"optimism-goerli":{chainId:420,name:"optimism-goerli"},arbitrum:{chainId:42161,name:"arbitrum"},"arbitrum-rinkeby":{chainId:421611,name:"arbitrum-rinkeby"},"arbitrum-goerli":{chainId:421613,name:"arbitrum-goerli"},bnb:{chainId:56,name:"bnb"},bnbt:{chainId:97,name:"bnbt"}};var El=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))};function Sl(e,t){return El(this,void 0,void 0,(function*(){null==t&&(t={});const r={method:t.method||"GET",headers:t.headers||{},body:t.body||void 0};if(!0!==t.skipFetchSetup&&(r.mode="cors",r.cache="no-cache",r.credentials="same-origin",r.redirect="follow",r.referrer="client"),null!=t.fetchOptions){const e=t.fetchOptions;e.mode&&(r.mode=e.mode),e.cache&&(r.cache=e.cache),e.credentials&&(r.credentials=e.credentials),e.redirect&&(r.redirect=e.redirect),e.referrer&&(r.referrer=e.referrer)}const n=yield fetch(e,r),i=yield n.arrayBuffer(),o={};return n.headers.forEach?n.headers.forEach(((e,t)=>{o[t.toLowerCase()]=e})):n.headers.keys().forEach((e=>{o[e.toLowerCase()]=n.headers.get(e)})),{headers:o,statusCode:n.status,statusMessage:n.statusText,body:xo(new Uint8Array(i))}}))}var Pl=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))};const xl=new bo("web/5.7.1");function kl(e){return new Promise((t=>{setTimeout(t,e)}))}function Ml(e,t){if(null==e)return null;if("string"==typeof e)return e;if(Eo(e)){if(t&&("text"===t.split("/")[0]||"application/json"===t.split(";")[0].trim()))try{return Gs(e)}catch(e){}return No(e)}return e}function Cl(e,t,r){const n="object"==typeof e&&null!=e.throttleLimit?e.throttleLimit:12;xl.assertArgument(n>0&&n%1==0,"invalid connection throttle limit","connection.throttleLimit",n);const i="object"==typeof e?e.throttleCallback:null,o="object"==typeof e&&"number"==typeof e.throttleSlotInterval?e.throttleSlotInterval:100;xl.assertArgument(o>0&&o%1==0,"invalid connection throttle slot interval","connection.throttleSlotInterval",o);const a="object"==typeof e&&!!e.errorPassThrough,s={};let c=null;const u={method:"GET"};let f=!1,d=12e4;if("string"==typeof e)c=e;else if("object"==typeof e){if(null!=e&&null!=e.url||xl.throwArgumentError("missing URL","connection.url",e),c=e.url,"number"==typeof e.timeout&&e.timeout>0&&(d=e.timeout),e.headers)for(const t in e.headers)s[t.toLowerCase()]={key:t,value:String(e.headers[t])},["if-none-match","if-modified-since"].indexOf(t.toLowerCase())>=0&&(f=!0);if(u.allowGzip=!!e.allowGzip,null!=e.user&&null!=e.password){"https:"!==c.substring(0,6)&&!0!==e.allowInsecureAuthentication&&xl.throwError("basic authentication requires a secure https url",bo.errors.INVALID_ARGUMENT,{argument:"url",url:c,user:e.user,password:"[REDACTED]"});const t=e.user+":"+e.password;s.authorization={key:"Authorization",value:"Basic "+yc(Ks(t))}}null!=e.skipFetchSetup&&(u.skipFetchSetup=!!e.skipFetchSetup),null!=e.fetchOptions&&(u.fetchOptions=ba(e.fetchOptions))}const l=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),h=c?c.match(l):null;if(h)try{const e={statusCode:200,statusMessage:"OK",headers:{"content-type":h[1]||"text/plain"},body:h[2]?gc(h[3]):(p=h[3],Ks(p.replace(/%([0-9a-f][0-9a-f])/gi,((e,t)=>String.fromCharCode(parseInt(t,16))))))};let t=e.body;return r&&(t=r(e.body,e)),Promise.resolve(t)}catch(e){xl.throwError("processing response error",bo.errors.SERVER_ERROR,{body:Ml(h[1],h[2]),error:e,requestBody:null,requestMethod:"GET",url:c})}var p;t&&(u.method="POST",u.body=t,null==s["content-type"]&&(s["content-type"]={key:"Content-Type",value:"application/octet-stream"}),null==s["content-length"]&&(s["content-length"]={key:"Content-Length",value:String(t.length)}));const m={};Object.keys(s).forEach((e=>{const t=s[e];m[t.key]=t.value})),u.headers=m;const g=function(){let e=null;return{promise:new Promise((function(t,r){d&&(e=setTimeout((()=>{null!=e&&(e=null,r(xl.makeError("timeout",bo.errors.TIMEOUT,{requestBody:Ml(u.body,m["content-type"]),requestMethod:u.method,timeout:d,url:c})))}),d))})),cancel:function(){null!=e&&(clearTimeout(e),e=null)}}}(),y=function(){return Pl(this,void 0,void 0,(function*(){for(let e=0;e=300)&&(g.cancel(),xl.throwError("bad response",bo.errors.SERVER_ERROR,{status:t.statusCode,headers:t.headers,body:Ml(s,t.headers?t.headers["content-type"]:null),requestBody:Ml(u.body,m["content-type"]),requestMethod:u.method,url:c})),r)try{const e=yield r(s,t);return g.cancel(),e}catch(r){if(r.throttleRetry&&e"content-type"===e.toLowerCase())).length||(r.headers=ba(r.headers),r.headers["content-type"]="application/json")}else r.headers={"content-type":"application/json"};e=r}return Cl(e,n,((e,t)=>{let n=null;if(null!=e)try{n=JSON.parse(Gs(e))}catch(t){xl.throwError("invalid JSON",bo.errors.SERVER_ERROR,{body:e,error:t})}return r&&(n=r(n,t)),n}))}function Rl(e,t){return t||(t={}),null==(t=ba(t)).floor&&(t.floor=0),null==t.ceiling&&(t.ceiling=1e4),null==t.interval&&(t.interval=250),new Promise((function(r,n){let i=null,o=!1;const a=()=>!o&&(o=!0,i&&clearTimeout(i),!0);t.timeout&&(i=setTimeout((()=>{a()&&n(new Error("timeout"))}),t.timeout));const s=t.retryLimit;let c=0;!function i(){return e().then((function(e){if(void 0!==e)a()&&r(e);else if(t.oncePoll)t.oncePoll.once("poll",i);else if(t.onceBlock)t.onceBlock.once("block",i);else if(!o){if(c++,c>s)return void(a()&&n(new Error("retry limit reached")));let e=t.interval*parseInt(String(Math.random()*Math.pow(2,c)));et.ceiling&&(e=t.ceiling),setTimeout(i,e)}return null}),(function(e){a()&&n(e)}))}()}))}for(var Nl=Object.freeze({__proto__:null,_fetchData:Cl,fetchJson:Il,poll:Rl}),Ol="qpzry9x8gf2tvdw0s3jn54khce6mua7l",Tl={},jl=0;jl>25;return(33554431&e)<<5^996825010&-(t>>0&1)^642813549&-(t>>1&1)^513874426&-(t>>2&1)^1027748829&-(t>>3&1)^705979059&-(t>>4&1)}function Bl(e){for(var t=1,r=0;r126)return"Invalid prefix ("+e+")";t=Dl(t)^n>>5}for(t=Dl(t),r=0;rt)return"Exceeds length limit";var r=e.toLowerCase(),n=e.toUpperCase();if(e!==r&&e!==n)return"Mixed-case string "+e;var i=(e=r).lastIndexOf("1");if(-1===i)return"No separator character for "+e;if(0===i)return"Missing prefix for "+e;var o=e.slice(0,i),a=e.slice(i+1);if(a.length<6)return"Data too short";var s=Bl(o);if("string"==typeof s)return s;for(var c=[],u=0;u=a.length||c.push(d)}return 1!==s?"Invalid checksum for "+e:{prefix:o,words:c}}function zl(e,t,r,n){for(var i=0,o=0,a=(1<=r;)o-=r,s.push(i>>o&a);if(n)o>0&&s.push(i<=t)return"Excess padding";if(i<r)throw new TypeError("Exceeds length limit");var n=Bl(e=e.toLowerCase());if("string"==typeof n)throw new Error(n);for(var i=e+"1",o=0;o>5!=0)throw new Error("Non 5-bit word");n=Dl(n)^a,i+=Ol.charAt(a)}for(o=0;o<6;++o)n=Dl(n);for(n^=1,o=0;o<6;++o){i+=Ol.charAt(n>>5*(5-o)&31)}return i},toWordsUnsafe:function(e){var t=zl(e,8,5,!0);if(Array.isArray(t))return t},toWords:function(e){var t=zl(e,8,5,!0);if(Array.isArray(t))return t;throw new Error(t)},fromWordsUnsafe:function(e){var t=zl(e,5,8,!1);if(Array.isArray(t))return t},fromWords:function(e){var t=zl(e,5,8,!1);if(Array.isArray(t))return t;throw new Error(t)}},Ll=s(Ul);const ql="providers/5.7.2",Hl=new bo(ql);class Kl{constructor(){this.formats=this.getDefaultFormats()}getDefaultFormats(){const e={},t=this.address.bind(this),r=this.bigNumber.bind(this),n=this.blockTag.bind(this),i=this.data.bind(this),o=this.hash.bind(this),a=this.hex.bind(this),s=this.number.bind(this),c=this.type.bind(this);return e.transaction={hash:o,type:c,accessList:Kl.allowNull(this.accessList.bind(this),null),blockHash:Kl.allowNull(o,null),blockNumber:Kl.allowNull(s,null),transactionIndex:Kl.allowNull(s,null),confirmations:Kl.allowNull(s,null),from:t,gasPrice:Kl.allowNull(r),maxPriorityFeePerGas:Kl.allowNull(r),maxFeePerGas:Kl.allowNull(r),gasLimit:r,to:Kl.allowNull(t,null),value:r,nonce:s,data:i,r:Kl.allowNull(this.uint256),s:Kl.allowNull(this.uint256),v:Kl.allowNull(s),creates:Kl.allowNull(t,null),raw:Kl.allowNull(i)},e.transactionRequest={from:Kl.allowNull(t),nonce:Kl.allowNull(s),gasLimit:Kl.allowNull(r),gasPrice:Kl.allowNull(r),maxPriorityFeePerGas:Kl.allowNull(r),maxFeePerGas:Kl.allowNull(r),to:Kl.allowNull(t),value:Kl.allowNull(r),data:Kl.allowNull((e=>this.data(e,!0))),type:Kl.allowNull(s),accessList:Kl.allowNull(this.accessList.bind(this),null)},e.receiptLog={transactionIndex:s,blockNumber:s,transactionHash:o,address:t,topics:Kl.arrayOf(o),data:i,logIndex:s,blockHash:o},e.receipt={to:Kl.allowNull(this.address,null),from:Kl.allowNull(this.address,null),contractAddress:Kl.allowNull(t,null),transactionIndex:s,root:Kl.allowNull(a),gasUsed:r,logsBloom:Kl.allowNull(i),blockHash:o,transactionHash:o,logs:Kl.arrayOf(this.receiptLog.bind(this)),blockNumber:s,confirmations:Kl.allowNull(s,null),cumulativeGasUsed:r,effectiveGasPrice:Kl.allowNull(r),status:Kl.allowNull(s),type:c},e.block={hash:Kl.allowNull(o),parentHash:o,number:s,timestamp:s,nonce:Kl.allowNull(a),difficulty:this.difficulty.bind(this),gasLimit:r,gasUsed:r,miner:Kl.allowNull(t),extraData:i,transactions:Kl.allowNull(Kl.arrayOf(o)),baseFeePerGas:Kl.allowNull(r)},e.blockWithTransactions=ba(e.block),e.blockWithTransactions.transactions=Kl.allowNull(Kl.arrayOf(this.transactionResponse.bind(this))),e.filter={fromBlock:Kl.allowNull(n,void 0),toBlock:Kl.allowNull(n,void 0),blockHash:Kl.allowNull(o,void 0),address:Kl.allowNull(t,void 0),topics:Kl.allowNull(this.topics.bind(this),void 0)},e.filterLog={blockNumber:Kl.allowNull(s),blockHash:Kl.allowNull(o),transactionIndex:s,removed:Kl.allowNull(this.boolean.bind(this)),address:t,data:Kl.allowFalsish(i,"0x"),topics:Kl.arrayOf(o),transactionHash:o,logIndex:s},e}accessList(e){return Rf(e||[])}number(e){return"0x"===e?0:Go.from(e).toNumber()}type(e){return"0x"===e||null==e?0:Go.from(e).toNumber()}bigNumber(e){return Go.from(e)}boolean(e){if("boolean"==typeof e)return e;if("string"==typeof e){if("true"===(e=e.toLowerCase()))return!0;if("false"===e)return!1}throw new Error("invalid boolean - "+e)}hex(e,t){return"string"==typeof e&&(t||"0x"===e.substring(0,2)||(e="0x"+e),Io(e))?e.toLowerCase():Hl.throwArgumentError("invalid hash","value",e)}data(e,t){const r=this.hex(e,t);if(r.length%2!=0)throw new Error("invalid data; odd-length - "+e);return r}address(e){return vs(e)}callAddress(e){if(!Io(e,32))return null;const t=vs(To(e,12));return"0x0000000000000000000000000000000000000000"===t?null:t}contractAddress(e){return ws(e)}blockTag(e){if(null==e)return"latest";if("earliest"===e)return"0x0";switch(e){case"earliest":return"0x0";case"latest":case"pending":case"safe":case"finalized":return e}if("number"==typeof e||Io(e))return $o(e);throw new Error("invalid blockTag")}hash(e,t){const r=this.hex(e,t);return 32!==Oo(r)?Hl.throwArgumentError("invalid hash","value",e):r}difficulty(e){if(null==e)return null;const t=Go.from(e);try{return t.toNumber()}catch(e){}return null}uint256(e){if(!Io(e))throw new Error("invalid uint256");return Bo(e,32)}_block(e,t){null!=e.author&&null==e.miner&&(e.miner=e.author);const r=null!=e._difficulty?e._difficulty:e.difficulty,n=Kl.check(t,e);return n._difficulty=null==r?null:Go.from(r),n}block(e){return this._block(e,this.formats.block)}blockWithTransactions(e){return this._block(e,this.formats.blockWithTransactions)}transactionRequest(e){return Kl.check(this.formats.transactionRequest,e)}transactionResponse(e){null!=e.gas&&null==e.gasLimit&&(e.gasLimit=e.gas),e.to&&Go.from(e.to).isZero()&&(e.to="0x0000000000000000000000000000000000000000"),null!=e.input&&null==e.data&&(e.data=e.input),null==e.to&&null==e.creates&&(e.creates=this.contractAddress(e)),1!==e.type&&2!==e.type||null!=e.accessList||(e.accessList=[]);const t=Kl.check(this.formats.transaction,e);if(null!=e.chainId){let r=e.chainId;Io(r)&&(r=Go.from(r).toNumber()),t.chainId=r}else{let r=e.networkId;null==r&&null==t.v&&(r=e.chainId),Io(r)&&(r=Go.from(r).toNumber()),"number"!=typeof r&&null!=t.v&&(r=(t.v-35)/2,r<0&&(r=0),r=parseInt(r)),"number"!=typeof r&&(r=0),t.chainId=r}return t.blockHash&&"x"===t.blockHash.replace(/0/g,"")&&(t.blockHash=null),t}transaction(e){return Df(e)}receiptLog(e){return Kl.check(this.formats.receiptLog,e)}receipt(e){const t=Kl.check(this.formats.receipt,e);if(null!=t.root)if(t.root.length<=4){const e=Go.from(t.root).toNumber();0===e||1===e?(null!=t.status&&t.status!==e&&Hl.throwArgumentError("alt-root-status/status mismatch","value",{root:t.root,status:t.status}),t.status=e,delete t.root):Hl.throwArgumentError("invalid alt-root-status","value.root",t.root)}else 66!==t.root.length&&Hl.throwArgumentError("invalid root hash","value.root",t.root);return null!=t.status&&(t.byzantium=!0),t}topics(e){return Array.isArray(e)?e.map((e=>this.topics(e))):null!=e?this.hash(e,!0):null}filter(e){return Kl.check(this.formats.filter,e)}filterLog(e){return Kl.check(this.formats.filterLog,e)}static check(e,t){const r={};for(const n in e)try{const i=e[n](t[n]);void 0!==i&&(r[n]=i)}catch(e){throw e.checkKey=n,e.checkValue=t[n],e}return r}static allowNull(e,t){return function(r){return null==r?t:e(r)}}static allowFalsish(e,t){return function(r){return r?e(r):t}}static arrayOf(e){return function(t){if(!Array.isArray(t))throw new Error("not an array");const r=[];return t.forEach((function(t){r.push(e(t))})),r}}}var Jl=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))};const Wl=new bo(ql);function Gl(e){return null==e?"null":(32!==Oo(e)&&Wl.throwArgumentError("invalid topic","topic",e),e.toLowerCase())}function Vl(e){for(e=e.slice();e.length>0&&null==e[e.length-1];)e.pop();return e.map((e=>{if(Array.isArray(e)){const t={};e.forEach((e=>{t[Gl(e)]=!0}));const r=Object.keys(t);return r.sort(),r.join("|")}return Gl(e)})).join("&")}function Zl(e){if("string"==typeof e){if(32===Oo(e=e.toLowerCase()))return"tx:"+e;if(-1===e.indexOf(":"))return e}else{if(Array.isArray(e))return"filter:*:"+Vl(e);if(_u.isForkEvent(e))throw Wl.warn("not implemented"),new Error("not implemented");if(e&&"object"==typeof e)return"filter:"+(e.address||"*")+":"+Vl(e.topics||[])}throw new Error("invalid event - "+e)}function Xl(){return(new Date).getTime()}function Ql(e){return new Promise((t=>{setTimeout(t,e)}))}const Yl=["block","network","pending","poll"];class eh{constructor(e,t,r){pa(this,"tag",e),pa(this,"listener",t),pa(this,"once",r),this._lastBlockNumber=-2,this._inflight=!1}get event(){switch(this.type){case"tx":return this.hash;case"filter":return this.filter}return this.tag}get type(){return this.tag.split(":")[0]}get hash(){const e=this.tag.split(":");return"tx"!==e[0]?null:e[1]}get filter(){const e=this.tag.split(":");if("filter"!==e[0])return null;const t=e[1],r=""===(n=e[2])?[]:n.split(/&/g).map((e=>{if(""===e)return[];const t=e.split("|").map((e=>"null"===e?null:e));return 1===t.length?t[0]:t}));var n;const i={};return r.length>0&&(i.topics=r),t&&"*"!==t&&(i.address=t),i}pollable(){return this.tag.indexOf(":")>=0||Yl.indexOf(this.tag)>=0}}const th={0:{symbol:"btc",p2pkh:0,p2sh:5,prefix:"bc"},2:{symbol:"ltc",p2pkh:48,p2sh:50,prefix:"ltc"},3:{symbol:"doge",p2pkh:30,p2sh:22},60:{symbol:"eth",ilk:"eth"},61:{symbol:"etc",ilk:"eth"},700:{symbol:"xdai",ilk:"eth"}};function rh(e){return Bo(Go.from(e).toHexString(),32)}function nh(e){return rd.encode(ko([e,To(sd(sd(e)),0,4)]))}const ih=new RegExp("^(ipfs)://(.*)$","i"),oh=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),ih,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function ah(e,t){try{return Gs(sh(e,t))}catch(e){}return null}function sh(e,t){if("0x"===e)return null;const r=Go.from(To(e,t,t+32)).toNumber(),n=Go.from(To(e,r,r+32)).toNumber();return To(e,r+32,r+32+n)}function ch(e){return e.match(/^ipfs:\/\/ipfs\//i)?e=e.substring(12):e.match(/^ipfs:\/\//i)?e=e.substring(7):Wl.throwArgumentError("unsupported IPFS format","link",e),`https://gateway.ipfs.io/ipfs/${e}`}function uh(e){const t=xo(e);if(t.length>32)throw new Error("internal; should not happen");const r=new Uint8Array(32);return r.set(t,32-t.length),r}function fh(e){if(e.length%32==0)return e;const t=new Uint8Array(32*Math.ceil(e.length/32));return t.set(e),t}function dh(e){const t=[];let r=0;for(let n=0;nGo.from(e).eq(1))).catch((e=>{if(e.code===bo.errors.CALL_EXCEPTION)return!1;throw this._supportsEip2544=null,e}))),this._supportsEip2544}_fetch(e,t){return Jl(this,void 0,void 0,(function*(){const r={to:this.address,ccipReadEnabled:!0,data:jo([e,Hc(this.name),t||"0x"])};let n=!1;(yield this.supportsWildcard())&&(n=!0,r.data=jo(["0x9061b923",dh([Kc(this.name),r.data])]));try{let e=yield this.provider.call(r);return xo(e).length%32==4&&Wl.throwError("resolver threw error",bo.errors.CALL_EXCEPTION,{transaction:r,data:e}),n&&(e=sh(e,0)),e}catch(e){if(e.code===bo.errors.CALL_EXCEPTION)return null;throw e}}))}_fetchBytes(e,t){return Jl(this,void 0,void 0,(function*(){const r=yield this._fetch(e,t);return null!=r?sh(r,0):null}))}_getAddress(e,t){const r=th[String(e)];if(null==r&&Wl.throwError(`unsupported coin type: ${e}`,bo.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`}),"eth"===r.ilk)return this.provider.formatter.address(t);const n=xo(t);if(null!=r.p2pkh){const e=t.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);if(e){const t=parseInt(e[1],16);if(e[2].length===2*t&&t>=1&&t<=75)return nh(ko([[r.p2pkh],"0x"+e[2]]))}}if(null!=r.p2sh){const e=t.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(e){const t=parseInt(e[1],16);if(e[2].length===2*t&&t>=1&&t<=75)return nh(ko([[r.p2sh],"0x"+e[2]]))}}if(null!=r.prefix){const e=n[1];let t=n[0];if(0===t?20!==e&&32!==e&&(t=-1):t=-1,t>=0&&n.length===2+e&&e>=1&&e<=75){const e=Ll.toWords(n.slice(2));return e.unshift(t),Ll.encode(r.prefix,e)}}return null}getAddress(e){return Jl(this,void 0,void 0,(function*(){if(null==e&&(e=60),60===e)try{const e=yield this._fetch("0x3b3b57de");return"0x"===e||e===Ds?null:this.provider.formatter.callAddress(e)}catch(e){if(e.code===bo.errors.CALL_EXCEPTION)return null;throw e}const t=yield this._fetchBytes("0xf1cb7e06",rh(e));if(null==t||"0x"===t)return null;const r=this._getAddress(e,t);return null==r&&Wl.throwError("invalid or unsupported coin data",bo.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`,coinType:e,data:t}),r}))}getAvatar(){return Jl(this,void 0,void 0,(function*(){const e=[{type:"name",content:this.name}];try{const t=yield this.getText("avatar");if(null==t)return null;for(let r=0;re[t]))}return Wl.throwError("invalid or unsupported content hash data",bo.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:e})}))}getText(e){return Jl(this,void 0,void 0,(function*(){let t=Ks(e);t=ko([rh(64),rh(t.length),t]),t.length%32!=0&&(t=ko([t,Bo("0x",32-e.length%32)]));const r=yield this._fetchBytes("0x59d1d43c",No(t));return null==r||"0x"===r?null:Gs(r)}))}}let hh=null,ph=1;class mh extends Eu{constructor(e){if(super(),this._events=[],this._emitted={block:-2},this.disableCcipRead=!1,this.formatter=new.target.getFormatter(),pa(this,"anyNetwork","any"===e),this.anyNetwork&&(e=this.detectNetwork()),e instanceof Promise)this._networkPromise=e,e.catch((e=>{})),this._ready().catch((e=>{}));else{const t=ma(new.target,"getNetwork")(e);t?(pa(this,"_network",t),this.emit("network",t,null)):Wl.throwArgumentError("invalid network","network",e)}this._maxInternalBlockNumber=-1024,this._lastBlockNumber=-2,this._maxFilterBlockRange=10,this._pollingInterval=4e3,this._fastQueryDate=0}_ready(){return Jl(this,void 0,void 0,(function*(){if(null==this._network){let e=null;if(this._networkPromise)try{e=yield this._networkPromise}catch(e){}null==e&&(e=yield this.detectNetwork()),e||Wl.throwError("no network detected",bo.errors.UNKNOWN_ERROR,{}),null==this._network&&(this.anyNetwork?this._network=e:pa(this,"_network",e),this.emit("network",e,null))}return this._network}))}get ready(){return Rl((()=>this._ready().then((e=>e),(e=>{if(e.code!==bo.errors.NETWORK_ERROR||"noNetwork"!==e.event)throw e}))))}static getFormatter(){return null==hh&&(hh=new Kl),hh}static getNetwork(e){return function(e){if(null==e)return null;if("number"==typeof e){for(const t in _l){const r=_l[t];if(r.chainId===e)return{name:r.name,chainId:r.chainId,ensAddress:r.ensAddress||null,_defaultProvider:r._defaultProvider||null}}return{chainId:e,name:"unknown"}}if("string"==typeof e){const t=_l[e];return null==t?null:{name:t.name,chainId:t.chainId,ensAddress:t.ensAddress,_defaultProvider:t._defaultProvider||null}}const t=_l[e.name];if(!t)return"number"!=typeof e.chainId&&gl.throwArgumentError("invalid network chainId","network",e),e;0!==e.chainId&&e.chainId!==t.chainId&&gl.throwArgumentError("network chainId mismatch","network",e);let r=e._defaultProvider||null;var n;return null==r&&t._defaultProvider&&(r=(n=t._defaultProvider)&&"function"==typeof n.renetwork?t._defaultProvider.renetwork(e):t._defaultProvider),{name:e.name,chainId:t.chainId,ensAddress:e.ensAddress||t.ensAddress||null,_defaultProvider:r}}(null==e?"homestead":e)}ccipReadFetch(e,t,r){return Jl(this,void 0,void 0,(function*(){if(this.disableCcipRead||0===r.length)return null;const n=e.to.toLowerCase(),i=t.toLowerCase(),o=[];for(let e=0;e=0?null:JSON.stringify({data:i,sender:n}),c=yield Il({url:a,errorPassThrough:!0},s,((e,t)=>(e.status=t.statusCode,e)));if(c.data)return c.data;const u=c.message||"unknown error";if(c.status>=400&&c.status<500)return Wl.throwError(`response not found during CCIP fetch: ${u}`,bo.errors.SERVER_ERROR,{url:t,errorMessage:u});o.push(u)}return Wl.throwError(`error encountered during CCIP fetch: ${o.map((e=>JSON.stringify(e))).join(", ")}`,bo.errors.SERVER_ERROR,{urls:r,errorMessages:o})}))}_getInternalBlockNumber(e){return Jl(this,void 0,void 0,(function*(){if(yield this._ready(),e>0)for(;this._internalBlockNumber;){const t=this._internalBlockNumber;try{const r=yield t;if(Xl()-r.respTime<=e)return r.blockNumber;break}catch(e){if(this._internalBlockNumber===t)break}}const t=Xl(),r=ga({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then((e=>null),(e=>e))}).then((({blockNumber:e,networkError:n})=>{if(n)throw this._internalBlockNumber===r&&(this._internalBlockNumber=null),n;const i=Xl();return(e=Go.from(e).toNumber()){this._internalBlockNumber===r&&(this._internalBlockNumber=null)})),(yield r).blockNumber}))}poll(){return Jl(this,void 0,void 0,(function*(){const e=ph++,t=[];let r=null;try{r=yield this._getInternalBlockNumber(100+this.pollingInterval/2)}catch(e){return void this.emit("error",e)}if(this._setFastBlockNumber(r),this.emit("poll",e,r),r!==this._lastBlockNumber){if(-2===this._emitted.block&&(this._emitted.block=r-1),Math.abs(this._emitted.block-r)>1e3)Wl.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${r})`),this.emit("error",Wl.makeError("network block skew detected",bo.errors.NETWORK_ERROR,{blockNumber:r,event:"blockSkew",previousBlockNumber:this._emitted.block})),this.emit("block",r);else for(let e=this._emitted.block+1;e<=r;e++)this.emit("block",e);this._emitted.block!==r&&(this._emitted.block=r,Object.keys(this._emitted).forEach((e=>{if("block"===e)return;const t=this._emitted[e];"pending"!==t&&r-t>12&&delete this._emitted[e]}))),-2===this._lastBlockNumber&&(this._lastBlockNumber=r-1),this._events.forEach((e=>{switch(e.type){case"tx":{const r=e.hash;let n=this.getTransactionReceipt(r).then((e=>e&&null!=e.blockNumber?(this._emitted["t:"+r]=e.blockNumber,this.emit(r,e),null):null)).catch((e=>{this.emit("error",e)}));t.push(n);break}case"filter":if(!e._inflight){e._inflight=!0,-2===e._lastBlockNumber&&(e._lastBlockNumber=r-1);const n=e.filter;n.fromBlock=e._lastBlockNumber+1,n.toBlock=r;const i=n.toBlock-this._maxFilterBlockRange;i>n.fromBlock&&(n.fromBlock=i),n.fromBlock<0&&(n.fromBlock=0);const o=this.getLogs(n).then((t=>{e._inflight=!1,0!==t.length&&t.forEach((t=>{t.blockNumber>e._lastBlockNumber&&(e._lastBlockNumber=t.blockNumber),this._emitted["b:"+t.blockHash]=t.blockNumber,this._emitted["t:"+t.transactionHash]=t.blockNumber,this.emit(n,t)}))})).catch((t=>{this.emit("error",t),e._inflight=!1}));t.push(o)}}})),this._lastBlockNumber=r,Promise.all(t).then((()=>{this.emit("didPoll",e)})).catch((e=>{this.emit("error",e)}))}else this.emit("didPoll",e)}))}resetEventsBlock(e){this._lastBlockNumber=e-1,this.polling&&this.poll()}get network(){return this._network}detectNetwork(){return Jl(this,void 0,void 0,(function*(){return Wl.throwError("provider does not support network detection",bo.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"})}))}getNetwork(){return Jl(this,void 0,void 0,(function*(){const e=yield this._ready(),t=yield this.detectNetwork();if(e.chainId!==t.chainId){if(this.anyNetwork)return this._network=t,this._lastBlockNumber=-2,this._fastBlockNumber=null,this._fastBlockNumberPromise=null,this._fastQueryDate=0,this._emitted.block=-2,this._maxInternalBlockNumber=-1024,this._internalBlockNumber=null,this.emit("network",t,e),yield Ql(0),this._network;const r=Wl.makeError("underlying network changed",bo.errors.NETWORK_ERROR,{event:"changed",network:e,detectedNetwork:t});throw this.emit("error",r),r}return e}))}get blockNumber(){return this._getInternalBlockNumber(100+this.pollingInterval/2).then((e=>{this._setFastBlockNumber(e)}),(e=>{})),null!=this._fastBlockNumber?this._fastBlockNumber:-1}get polling(){return null!=this._poller}set polling(e){e&&!this._poller?(this._poller=setInterval((()=>{this.poll()}),this.pollingInterval),this._bootstrapPoll||(this._bootstrapPoll=setTimeout((()=>{this.poll(),this._bootstrapPoll=setTimeout((()=>{this._poller||this.poll(),this._bootstrapPoll=null}),this.pollingInterval)}),0))):!e&&this._poller&&(clearInterval(this._poller),this._poller=null)}get pollingInterval(){return this._pollingInterval}set pollingInterval(e){if("number"!=typeof e||e<=0||parseInt(String(e))!=e)throw new Error("invalid polling interval");this._pollingInterval=e,this._poller&&(clearInterval(this._poller),this._poller=setInterval((()=>{this.poll()}),this._pollingInterval))}_getFastBlockNumber(){const e=Xl();return e-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=e,this._fastBlockNumberPromise=this.getBlockNumber().then((e=>((null==this._fastBlockNumber||e>this._fastBlockNumber)&&(this._fastBlockNumber=e),this._fastBlockNumber)))),this._fastBlockNumberPromise}_setFastBlockNumber(e){null!=this._fastBlockNumber&&ethis._fastBlockNumber)&&(this._fastBlockNumber=e,this._fastBlockNumberPromise=Promise.resolve(e)))}waitForTransaction(e,t,r){return Jl(this,void 0,void 0,(function*(){return this._waitForTransaction(e,null==t?1:t,r||0,null)}))}_waitForTransaction(e,t,r,n){return Jl(this,void 0,void 0,(function*(){const i=yield this.getTransactionReceipt(e);return(i?i.confirmations:0)>=t?i:new Promise(((i,o)=>{const a=[];let s=!1;const c=function(){return!!s||(s=!0,a.forEach((e=>{e()})),!1)},u=e=>{e.confirmations{this.removeListener(e,u)})),n){let r=n.startBlock,i=null;const u=a=>Jl(this,void 0,void 0,(function*(){s||(yield Ql(1e3),this.getTransactionCount(n.from).then((f=>Jl(this,void 0,void 0,(function*(){if(!s){if(f<=n.nonce)r=a;else{{const t=yield this.getTransaction(e);if(t&&null!=t.blockNumber)return}for(null==i&&(i=r-3,i{s||this.once("block",u)})))}));if(s)return;this.once("block",u),a.push((()=>{this.removeListener("block",u)}))}if("number"==typeof r&&r>0){const e=setTimeout((()=>{c()||o(Wl.makeError("timeout exceeded",bo.errors.TIMEOUT,{timeout:r}))}),r);e.unref&&e.unref(),a.push((()=>{clearTimeout(e)}))}}))}))}getBlockNumber(){return Jl(this,void 0,void 0,(function*(){return this._getInternalBlockNumber(0)}))}getGasPrice(){return Jl(this,void 0,void 0,(function*(){yield this.getNetwork();const e=yield this.perform("getGasPrice",{});try{return Go.from(e)}catch(t){return Wl.throwError("bad result from backend",bo.errors.SERVER_ERROR,{method:"getGasPrice",result:e,error:t})}}))}getBalance(e,t){return Jl(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield ga({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),n=yield this.perform("getBalance",r);try{return Go.from(n)}catch(e){return Wl.throwError("bad result from backend",bo.errors.SERVER_ERROR,{method:"getBalance",params:r,result:n,error:e})}}))}getTransactionCount(e,t){return Jl(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield ga({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),n=yield this.perform("getTransactionCount",r);try{return Go.from(n).toNumber()}catch(e){return Wl.throwError("bad result from backend",bo.errors.SERVER_ERROR,{method:"getTransactionCount",params:r,result:n,error:e})}}))}getCode(e,t){return Jl(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield ga({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),n=yield this.perform("getCode",r);try{return No(n)}catch(e){return Wl.throwError("bad result from backend",bo.errors.SERVER_ERROR,{method:"getCode",params:r,result:n,error:e})}}))}getStorageAt(e,t,r){return Jl(this,void 0,void 0,(function*(){yield this.getNetwork();const n=yield ga({address:this._getAddress(e),blockTag:this._getBlockTag(r),position:Promise.resolve(t).then((e=>$o(e)))}),i=yield this.perform("getStorageAt",n);try{return No(i)}catch(e){return Wl.throwError("bad result from backend",bo.errors.SERVER_ERROR,{method:"getStorageAt",params:n,result:i,error:e})}}))}_wrapTransaction(e,t,r){if(null!=t&&32!==Oo(t))throw new Error("invalid response - sendTransaction");const n=e;return null!=t&&e.hash!==t&&Wl.throwError("Transaction hash mismatch from Provider.sendTransaction.",bo.errors.UNKNOWN_ERROR,{expectedHash:e.hash,returnedHash:t}),n.wait=(t,n)=>Jl(this,void 0,void 0,(function*(){let i;null==t&&(t=1),null==n&&(n=0),0!==t&&null!=r&&(i={data:e.data,from:e.from,nonce:e.nonce,to:e.to,value:e.value,startBlock:r});const o=yield this._waitForTransaction(e.hash,t,n,i);return null==o&&0===t?null:(this._emitted["t:"+e.hash]=o.blockNumber,0===o.status&&Wl.throwError("transaction failed",bo.errors.CALL_EXCEPTION,{transactionHash:e.hash,transaction:e,receipt:o}),o)})),n}sendTransaction(e){return Jl(this,void 0,void 0,(function*(){yield this.getNetwork();const t=yield Promise.resolve(e).then((e=>No(e))),r=this.formatter.transaction(e);null==r.confirmations&&(r.confirmations=0);const n=yield this._getInternalBlockNumber(100+2*this.pollingInterval);try{const e=yield this.perform("sendTransaction",{signedTransaction:t});return this._wrapTransaction(r,e,n)}catch(e){throw e.transaction=r,e.transactionHash=r.hash,e}}))}_getTransactionRequest(e){return Jl(this,void 0,void 0,(function*(){const t=yield e,r={};return["from","to"].forEach((e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then((e=>e?this._getAddress(e):null)))})),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach((e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then((e=>e?Go.from(e):null)))})),["type"].forEach((e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then((e=>null!=e?e:null)))})),t.accessList&&(r.accessList=this.formatter.accessList(t.accessList)),["data"].forEach((e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then((e=>e?No(e):null)))})),this.formatter.transactionRequest(yield ga(r))}))}_getFilter(e){return Jl(this,void 0,void 0,(function*(){e=yield e;const t={};return null!=e.address&&(t.address=this._getAddress(e.address)),["blockHash","topics"].forEach((r=>{null!=e[r]&&(t[r]=e[r])})),["fromBlock","toBlock"].forEach((r=>{null!=e[r]&&(t[r]=this._getBlockTag(e[r]))})),this.formatter.filter(yield ga(t))}))}_call(e,t,r){return Jl(this,void 0,void 0,(function*(){r>=10&&Wl.throwError("CCIP read exceeded maximum redirections",bo.errors.SERVER_ERROR,{redirects:r,transaction:e});const n=e.to,i=yield this.perform("call",{transaction:e,blockTag:t});if(r>=0&&"latest"===t&&null!=n&&"0x556f1830"===i.substring(0,10)&&Oo(i)%32==4)try{const o=To(i,4),a=To(o,0,32);Go.from(a).eq(n)||Wl.throwError("CCIP Read sender did not match",bo.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:i});const s=[],c=Go.from(To(o,32,64)).toNumber(),u=Go.from(To(o,c,c+32)).toNumber(),f=To(o,c+32);for(let t=0;tJl(this,void 0,void 0,(function*(){const e=yield this.perform("getBlock",n);if(null==e)return null!=n.blockHash&&null==this._emitted["b:"+n.blockHash]||null!=n.blockTag&&r>this._emitted.block?null:void 0;if(t){let t=null;for(let r=0;rthis._wrapTransaction(e))),r}return this.formatter.block(e)}))),{oncePoll:this})}))}getBlock(e){return this._getBlock(e,!1)}getBlockWithTransactions(e){return this._getBlock(e,!0)}getTransaction(e){return Jl(this,void 0,void 0,(function*(){yield this.getNetwork(),e=yield e;const t={transactionHash:this.formatter.hash(e,!0)};return Rl((()=>Jl(this,void 0,void 0,(function*(){const r=yield this.perform("getTransaction",t);if(null==r)return null==this._emitted["t:"+e]?null:void 0;const n=this.formatter.transactionResponse(r);if(null==n.blockNumber)n.confirmations=0;else if(null==n.confirmations){let e=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-n.blockNumber+1;e<=0&&(e=1),n.confirmations=e}return this._wrapTransaction(n)}))),{oncePoll:this})}))}getTransactionReceipt(e){return Jl(this,void 0,void 0,(function*(){yield this.getNetwork(),e=yield e;const t={transactionHash:this.formatter.hash(e,!0)};return Rl((()=>Jl(this,void 0,void 0,(function*(){const r=yield this.perform("getTransactionReceipt",t);if(null==r)return null==this._emitted["t:"+e]?null:void 0;if(null==r.blockHash)return;const n=this.formatter.receipt(r);if(null==n.blockNumber)n.confirmations=0;else if(null==n.confirmations){let e=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-n.blockNumber+1;e<=0&&(e=1),n.confirmations=e}return n}))),{oncePoll:this})}))}getLogs(e){return Jl(this,void 0,void 0,(function*(){yield this.getNetwork();const t=yield ga({filter:this._getFilter(e)}),r=yield this.perform("getLogs",t);return r.forEach((e=>{null==e.removed&&(e.removed=!1)})),Kl.arrayOf(this.formatter.filterLog.bind(this.formatter))(r)}))}getEtherPrice(){return Jl(this,void 0,void 0,(function*(){return yield this.getNetwork(),this.perform("getEtherPrice",{})}))}_getBlockTag(e){return Jl(this,void 0,void 0,(function*(){if("number"==typeof(e=yield e)&&e<0){e%1&&Wl.throwArgumentError("invalid BlockTag","blockTag",e);let t=yield this._getInternalBlockNumber(100+2*this.pollingInterval);return t+=e,t<0&&(t=0),this.formatter.blockTag(t)}return this.formatter.blockTag(e)}))}getResolver(e){return Jl(this,void 0,void 0,(function*(){let t=e;for(;;){if(""===t||"."===t)return null;if("eth"!==e&&"eth"===t)return null;const r=yield this._getResolver(t,"getResolver");if(null!=r){const n=new lh(this,r,e);return t===e||(yield n.supportsWildcard())?n:null}t=t.split(".").slice(1).join(".")}}))}_getResolver(e,t){return Jl(this,void 0,void 0,(function*(){null==t&&(t="ENS");const r=yield this.getNetwork();r.ensAddress||Wl.throwError("network does not support ENS",bo.errors.UNSUPPORTED_OPERATION,{operation:t,network:r.name});try{const t=yield this.call({to:r.ensAddress,data:"0x0178b8bf"+Hc(e).substring(2)});return this.formatter.callAddress(t)}catch(e){}return null}))}resolveName(e){return Jl(this,void 0,void 0,(function*(){e=yield e;try{return Promise.resolve(this.formatter.address(e))}catch(t){if(Io(e))throw t}"string"!=typeof e&&Wl.throwArgumentError("invalid ENS name","name",e);const t=yield this.getResolver(e);return t?yield t.getAddress():null}))}lookupAddress(e){return Jl(this,void 0,void 0,(function*(){e=yield e;const t=(e=this.formatter.address(e)).substring(2).toLowerCase()+".addr.reverse",r=yield this._getResolver(t,"lookupAddress");if(null==r)return null;const n=ah(yield this.call({to:r,data:"0x691f3431"+Hc(t).substring(2)}),0);return(yield this.resolveName(n))!=e?null:n}))}getAvatar(e){return Jl(this,void 0,void 0,(function*(){let t=null;if(Io(e)){const r=this.formatter.address(e).substring(2).toLowerCase()+".addr.reverse",n=yield this._getResolver(r,"getAvatar");if(!n)return null;t=new lh(this,n,r);try{const e=yield t.getAvatar();if(e)return e.url}catch(e){if(e.code!==bo.errors.CALL_EXCEPTION)throw e}try{const e=ah(yield this.call({to:n,data:"0x691f3431"+Hc(r).substring(2)}),0);t=yield this.getResolver(e)}catch(e){if(e.code!==bo.errors.CALL_EXCEPTION)throw e;return null}}else if(t=yield this.getResolver(e),!t)return null;const r=yield t.getAvatar();return null==r?null:r.url}))}perform(e,t){return Wl.throwError(e+" not implemented",bo.errors.NOT_IMPLEMENTED,{operation:e})}_startEvent(e){this.polling=this._events.filter((e=>e.pollable())).length>0}_stopEvent(e){this.polling=this._events.filter((e=>e.pollable())).length>0}_addEventListener(e,t,r){const n=new eh(Zl(e),t,r);return this._events.push(n),this._startEvent(n),this}on(e,t){return this._addEventListener(e,t,!1)}once(e,t){return this._addEventListener(e,t,!0)}emit(e,...t){let r=!1,n=[],i=Zl(e);return this._events=this._events.filter((e=>e.tag!==i||(setTimeout((()=>{e.listener.apply(this,t)}),0),r=!0,!e.once||(n.push(e),!1)))),n.forEach((e=>{this._stopEvent(e)})),r}listenerCount(e){if(!e)return this._events.length;let t=Zl(e);return this._events.filter((e=>e.tag===t)).length}listeners(e){if(null==e)return this._events.map((e=>e.listener));let t=Zl(e);return this._events.filter((e=>e.tag===t)).map((e=>e.listener))}off(e,t){if(null==t)return this.removeAllListeners(e);const r=[];let n=!1,i=Zl(e);return this._events=this._events.filter((e=>e.tag!==i||e.listener!=t||(!!n||(n=!0,r.push(e),!1)))),r.forEach((e=>{this._stopEvent(e)})),this}removeAllListeners(e){let t=[];if(null==e)t=this._events,this._events=[];else{const r=Zl(e);this._events=this._events.filter((e=>e.tag!==r||(t.push(e),!1)))}return t.forEach((e=>{this._stopEvent(e)})),this}}var gh=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))};const yh=new bo(ql),bh=["call","estimateGas"];function vh(e,t){if(null==e)return null;if("string"==typeof e.message&&e.message.match("reverted")){const r=Io(e.data)?e.data:null;if(!t||r)return{message:e.message,data:r}}if("object"==typeof e){for(const r in e){const n=vh(e[r],t);if(n)return n}return null}if("string"==typeof e)try{return vh(JSON.parse(e),t)}catch(e){}return null}function wh(e,t,r){const n=r.transaction||r.signedTransaction;if("call"===e){const e=vh(t,!0);if(e)return e.data;yh.throwError("missing revert data in call exception; Transaction reverted without a reason string",bo.errors.CALL_EXCEPTION,{data:"0x",transaction:n,error:t})}if("estimateGas"===e){let r=vh(t.body,!1);null==r&&(r=vh(t,!1)),r&&yh.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",bo.errors.UNPREDICTABLE_GAS_LIMIT,{reason:r.message,method:e,transaction:n,error:t})}let i=t.message;throw t.code===bo.errors.SERVER_ERROR&&t.error&&"string"==typeof t.error.message?i=t.error.message:"string"==typeof t.body?i=t.body:"string"==typeof t.responseText&&(i=t.responseText),i=(i||"").toLowerCase(),i.match(/insufficient funds|base fee exceeds gas limit|InsufficientFunds/i)&&yh.throwError("insufficient funds for intrinsic transaction cost",bo.errors.INSUFFICIENT_FUNDS,{error:t,method:e,transaction:n}),i.match(/nonce (is )?too low/i)&&yh.throwError("nonce has already been used",bo.errors.NONCE_EXPIRED,{error:t,method:e,transaction:n}),i.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&yh.throwError("replacement fee too low",bo.errors.REPLACEMENT_UNDERPRICED,{error:t,method:e,transaction:n}),i.match(/only replay-protected/i)&&yh.throwError("legacy pre-eip-155 transactions not supported",bo.errors.UNSUPPORTED_OPERATION,{error:t,method:e,transaction:n}),bh.indexOf(e)>=0&&i.match(/gas required exceeds allowance|always failing transaction|execution reverted|revert/)&&yh.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",bo.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,method:e,transaction:n}),t}function Ah(e){return new Promise((function(t){setTimeout(t,e)}))}function _h(e){if(e.error){const t=new Error(e.error.message);throw t.code=e.error.code,t.data=e.error.data,t}return e.result}function Eh(e){return e?e.toLowerCase():e}const Sh={};class Ph extends Mu{constructor(e,t,r){if(super(),e!==Sh)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");pa(this,"provider",t),null==r&&(r=0),"string"==typeof r?(pa(this,"_address",this.provider.formatter.address(r)),pa(this,"_index",null)):"number"==typeof r?(pa(this,"_index",r),pa(this,"_address",null)):yh.throwArgumentError("invalid address or index","addressOrIndex",r)}connect(e){return yh.throwError("cannot alter JSON-RPC Signer connection",bo.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}connectUnchecked(){return new xh(Sh,this.provider,this._address||this._index)}getAddress(){return this._address?Promise.resolve(this._address):this.provider.send("eth_accounts",[]).then((e=>(e.length<=this._index&&yh.throwError("unknown account #"+this._index,bo.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),this.provider.formatter.address(e[this._index]))))}sendUncheckedTransaction(e){e=ba(e);const t=this.getAddress().then((e=>(e&&(e=e.toLowerCase()),e)));if(null==e.gasLimit){const r=ba(e);r.from=t,e.gasLimit=this.provider.estimateGas(r)}return null!=e.to&&(e.to=Promise.resolve(e.to).then((e=>gh(this,void 0,void 0,(function*(){if(null==e)return null;const t=yield this.provider.resolveName(e);return null==t&&yh.throwArgumentError("provided ENS name resolves to null","tx.to",e),t}))))),ga({tx:ga(e),sender:t}).then((({tx:t,sender:r})=>{null!=t.from?t.from.toLowerCase()!==r&&yh.throwArgumentError("from address mismatch","transaction",e):t.from=r;const n=this.provider.constructor.hexlifyTransaction(t,{from:!0});return this.provider.send("eth_sendTransaction",[n]).then((e=>e),(e=>("string"==typeof e.message&&e.message.match(/user denied/i)&&yh.throwError("user rejected transaction",bo.errors.ACTION_REJECTED,{action:"sendTransaction",transaction:t}),wh("sendTransaction",e,n))))}))}signTransaction(e){return yh.throwError("signing transactions is unsupported",bo.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}sendTransaction(e){return gh(this,void 0,void 0,(function*(){const t=yield this.provider._getInternalBlockNumber(100+2*this.provider.pollingInterval),r=yield this.sendUncheckedTransaction(e);try{return yield Rl((()=>gh(this,void 0,void 0,(function*(){const e=yield this.provider.getTransaction(r);if(null!==e)return this.provider._wrapTransaction(e,r,t)}))),{oncePoll:this.provider})}catch(e){throw e.transactionHash=r,e}}))}signMessage(e){return gh(this,void 0,void 0,(function*(){const t="string"==typeof e?Ks(e):e,r=yield this.getAddress();try{return yield this.provider.send("personal_sign",[No(t),r.toLowerCase()])}catch(t){throw"string"==typeof t.message&&t.message.match(/user denied/i)&&yh.throwError("user rejected signing",bo.errors.ACTION_REJECTED,{action:"signMessage",from:r,messageData:e}),t}}))}_legacySignMessage(e){return gh(this,void 0,void 0,(function*(){const t="string"==typeof e?Ks(e):e,r=yield this.getAddress();try{return yield this.provider.send("eth_sign",[r.toLowerCase(),No(t)])}catch(t){throw"string"==typeof t.message&&t.message.match(/user denied/i)&&yh.throwError("user rejected signing",bo.errors.ACTION_REJECTED,{action:"_legacySignMessage",from:r,messageData:e}),t}}))}_signTypedData(e,t,r){return gh(this,void 0,void 0,(function*(){const n=yield uu.resolveNames(e,t,r,(e=>this.provider.resolveName(e))),i=yield this.getAddress();try{return yield this.provider.send("eth_signTypedData_v4",[i.toLowerCase(),JSON.stringify(uu.getPayload(n.domain,t,n.value))])}catch(e){throw"string"==typeof e.message&&e.message.match(/user denied/i)&&yh.throwError("user rejected signing",bo.errors.ACTION_REJECTED,{action:"_signTypedData",from:i,messageData:{domain:n.domain,types:t,value:n.value}}),e}}))}unlock(e){return gh(this,void 0,void 0,(function*(){const t=this.provider,r=yield this.getAddress();return t.send("personal_unlockAccount",[r.toLowerCase(),e,null])}))}}class xh extends Ph{sendTransaction(e){return this.sendUncheckedTransaction(e).then((e=>({hash:e,nonce:null,gasLimit:null,gasPrice:null,data:null,value:null,chainId:null,confirmations:0,from:null,wait:t=>this.provider.waitForTransaction(e,t)})))}}const kh={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0};class Mh extends mh{constructor(e,t){let r=t;null==r&&(r=new Promise(((e,t)=>{setTimeout((()=>{this.detectNetwork().then((t=>{e(t)}),(e=>{t(e)}))}),0)}))),super(r),e||(e=ma(this.constructor,"defaultUrl")()),pa(this,"connection","string"==typeof e?Object.freeze({url:e}):Object.freeze(ba(e))),this._nextId=42}get _cache(){return null==this._eventLoopCache&&(this._eventLoopCache={}),this._eventLoopCache}static defaultUrl(){return"http://localhost:8545"}detectNetwork(){return this._cache.detectNetwork||(this._cache.detectNetwork=this._uncachedDetectNetwork(),setTimeout((()=>{this._cache.detectNetwork=null}),0)),this._cache.detectNetwork}_uncachedDetectNetwork(){return gh(this,void 0,void 0,(function*(){yield Ah(0);let e=null;try{e=yield this.send("eth_chainId",[])}catch(t){try{e=yield this.send("net_version",[])}catch(e){}}if(null!=e){const t=ma(this.constructor,"getNetwork");try{return t(Go.from(e).toNumber())}catch(t){return yh.throwError("could not detect network",bo.errors.NETWORK_ERROR,{chainId:e,event:"invalidNetwork",serverError:t})}}return yh.throwError("could not detect network",bo.errors.NETWORK_ERROR,{event:"noNetwork"})}))}getSigner(e){return new Ph(Sh,this,e)}getUncheckedSigner(e){return this.getSigner(e).connectUnchecked()}listAccounts(){return this.send("eth_accounts",[]).then((e=>e.map((e=>this.formatter.address(e)))))}send(e,t){const r={method:e,params:t,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:_a(r),provider:this});const n=["eth_chainId","eth_blockNumber"].indexOf(e)>=0;if(n&&this._cache[e])return this._cache[e];const i=Il(this.connection,JSON.stringify(r),_h).then((e=>(this.emit("debug",{action:"response",request:r,response:e,provider:this}),e)),(e=>{throw this.emit("debug",{action:"response",error:e,request:r,provider:this}),e}));return n&&(this._cache[e]=i,setTimeout((()=>{this._cache[e]=null}),0)),i}prepareRequest(e,t){switch(e){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[Eh(t.address),t.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[Eh(t.address),t.blockTag]];case"getCode":return["eth_getCode",[Eh(t.address),t.blockTag]];case"getStorageAt":return["eth_getStorageAt",[Eh(t.address),Bo(t.position,32),t.blockTag]];case"sendTransaction":return["eth_sendRawTransaction",[t.signedTransaction]];case"getBlock":return t.blockTag?["eth_getBlockByNumber",[t.blockTag,!!t.includeTransactions]]:t.blockHash?["eth_getBlockByHash",[t.blockHash,!!t.includeTransactions]]:null;case"getTransaction":return["eth_getTransactionByHash",[t.transactionHash]];case"getTransactionReceipt":return["eth_getTransactionReceipt",[t.transactionHash]];case"call":return["eth_call",[ma(this.constructor,"hexlifyTransaction")(t.transaction,{from:!0}),t.blockTag]];case"estimateGas":return["eth_estimateGas",[ma(this.constructor,"hexlifyTransaction")(t.transaction,{from:!0})]];case"getLogs":return t.filter&&null!=t.filter.address&&(t.filter.address=Eh(t.filter.address)),["eth_getLogs",[t.filter]]}return null}perform(e,t){return gh(this,void 0,void 0,(function*(){if("call"===e||"estimateGas"===e){const e=t.transaction;if(e&&null!=e.type&&Go.from(e.type).isZero()&&null==e.maxFeePerGas&&null==e.maxPriorityFeePerGas){const r=yield this.getFeeData();null==r.maxFeePerGas&&null==r.maxPriorityFeePerGas&&((t=ba(t)).transaction=ba(e),delete t.transaction.type)}}const r=this.prepareRequest(e,t);null==r&&yh.throwError(e+" not implemented",bo.errors.NOT_IMPLEMENTED,{operation:e});try{return yield this.send(r[0],r[1])}catch(r){return wh(e,r,t)}}))}_startEvent(e){"pending"===e.tag&&this._startPending(),super._startEvent(e)}_startPending(){if(null!=this._pendingFilter)return;const e=this,t=this.send("eth_newPendingTransactionFilter",[]);this._pendingFilter=t,t.then((function(r){return function n(){e.send("eth_getFilterChanges",[r]).then((function(r){if(e._pendingFilter!=t)return null;let n=Promise.resolve();return r.forEach((function(t){e._emitted["t:"+t.toLowerCase()]="pending",n=n.then((function(){return e.getTransaction(t).then((function(t){return e.emit("pending",t),null}))}))})),n.then((function(){return Ah(1e3)}))})).then((function(){if(e._pendingFilter==t)return setTimeout((function(){n()}),0),null;e.send("eth_uninstallFilter",[r])})).catch((e=>{}))}(),r})).catch((e=>{}))}_stopEvent(e){"pending"===e.tag&&0===this.listenerCount("pending")&&(this._pendingFilter=null),super._stopEvent(e)}static hexlifyTransaction(e,t){const r=ba(kh);if(t)for(const e in t)t[e]&&(r[e]=!0);ya(e,r);const n={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach((function(t){if(null==e[t])return;const r=$o(Go.from(e[t]));"gasLimit"===t&&(t="gas"),n[t]=r})),["from","to","data"].forEach((function(t){null!=e[t]&&(n[t]=No(e[t]))})),e.accessList&&(n.accessList=Rf(e.accessList)),n}}const Ch=new RegExp("^bytes([0-9]+)$"),Ih=new RegExp("^(u?int)([0-9]*)$"),Rh=new RegExp("^(.*)\\[([0-9]*)\\]$"),Nh="0000000000000000000000000000000000000000000000000000000000000000",Oh=new bo("solidity/5.7.0");function Th(e,t,r){switch(e){case"address":return r?Co(t,32):xo(t);case"string":return Ks(t);case"bytes":return xo(t);case"bool":return t=t?"0x01":"0x00",r?Co(t,32):xo(t)}let n=e.match(Ih);if(n){let i=parseInt(n[2]||"256");return(n[2]&&String(i)!==n[2]||i%8!=0||0===i||i>256)&&Oh.throwArgumentError("invalid number type","type",e),r&&(i=256),Co(t=Go.from(t).toTwos(i),i/8)}if(n=e.match(Ch),n){const i=parseInt(n[1]);return(String(i)!==n[1]||0===i||i>32)&&Oh.throwArgumentError("invalid bytes type","type",e),xo(t).byteLength!==i&&Oh.throwArgumentError(`invalid value for ${e}`,"value",t),r?xo((t+Nh).substring(0,66)):t}if(n=e.match(Rh),n&&Array.isArray(t)){const r=n[1];parseInt(n[2]||String(t.length))!=t.length&&Oh.throwArgumentError(`invalid array length for ${e}`,"value",t);const i=[];return t.forEach((function(e){i.push(Th(r,e,!0))})),ko(i)}return Oh.throwArgumentError("invalid type","type",e)}function jh(e,t){e.length!=t.length&&Oh.throwArgumentError("wrong number of values; expected ${ types.length }","values",t);const r=[];return e.forEach((function(e,n){r.push(Th(e,t[n]))})),No(ko(r))}var $h=Object.freeze({__proto__:null,keccak256:function(e,t){return ns(jh(e,t))},pack:jh,sha256:function(e,t){return sd(jh(e,t))}});const Dh=new bo("units/5.7.0"),Bh=["wei","kwei","mwei","gwei","szabo","finney","ether"];function Fh(e,t){if("string"==typeof t){const e=Bh.indexOf(t);-1!==e&&(t=3*e)}return aa(e,null!=t?t:18)}function zh(e,t){if("string"!=typeof e&&Dh.throwArgumentError("value must be a string","value",e),"string"==typeof t){const e=Bh.indexOf(t);-1!==e&&(t=3*e)}return sa(e,null!=t?t:18)}var Uh=Object.freeze({__proto__:null,commify:function(e){const t=String(e).split(".");(t.length>2||!t[0].match(/^-?[0-9]*$/)||t[1]&&!t[1].match(/^[0-9]*$/)||"."===e||"-."===e)&&Dh.throwArgumentError("invalid value","value",e);let r=t[0],n="";for("-"===r.substring(0,1)&&(n="-",r=r.substring(1));"0"===r.substring(0,1);)r=r.substring(1);""===r&&(r="0");let i="";for(2===t.length&&(i="."+(t[1]||"0"));i.length>2&&"0"===i[i.length-1];)i=i.substring(0,i.length-1);const o=[];for(;r.length;){if(r.length<=3){o.unshift(r);break}{const e=r.length-3;o.unshift(r.substring(e)),r=r.substring(0,e)}}return n+o.join(",")+i},formatEther:function(e){return Fh(e,18)},formatUnits:Fh,parseEther:function(e){return zh(e,18)},parseUnits:zh});function Lh(e){if(null==e.match(/^(0x)?([\da-fA-F]{40})$/))throw new RangeError("incorrect address format");try{return vs(no(e,!0,20))}catch(e){throw new rn(e,["invalid EIP-55 address"])}}function qh(e){const t=e.match(/^did:ethr:(\w+:)?(0x[0-9a-fA-F]{40}[0-9a-fA-F]{26}?)$/),r=null!==t?t[t.length-1]:e;try{return kf(r)}catch(e){throw new rn("no a DID or a valid public or private key",["invalid format"])}}async function Hh(t){return e(await oo(eo(t),"SHA-256"),!0,!1)}async function Kh(e,t){if(void 0===e.iss)throw new Error('Payload iss should be set to either "orig" or "dest"');const r=JSON.parse(e.exchange[e.iss]);await Xi(r,t);const n=await Ki(t),i=t.alg,o={...e,iat:Math.floor(Date.now()/1e3)};return{jws:await new Li(o).setProtectedHeader({alg:i}).setIssuedAt(o.iat).sign(n),payload:o}}async function Jh(e,t,r){const n=JSON.parse(t.exchange[t.iss]),i=await Gi(e,n);if(void 0===i.payload.iss)throw new Error('Property "iss" missing');if(void 0===i.payload.iat)throw new Error("Property claim iat missing");if(void 0!==r){to("iat"===r.timestamp?1e3*i.payload.iat:r.timestamp,"iat"===r.notBefore?1e3*i.payload.iat:r.notBefore,"iat"===r.notAfter?1e3*i.payload.iat:r.notAfter,r.tolerance)}const o=i.payload,a=o.exchange[o.iss];if(eo(n)!==eo(JSON.parse(a)))throw new Error(`The proof is issued by ${a} instead of ${JSON.stringify(n)}`);const s=t;for(const e in s){if(void 0===o[e])throw new Error(`Expected key '${e}' not found in proof`);if("exchange"===e){const e=t.exchange;Wh(o.exchange,e)}else if(""!==s[e]&&eo(s[e])!==eo(o[e]))throw new Error(`Proof's ${e}: ${JSON.stringify(o[e],void 0,2)} does not meet provided value ${JSON.stringify(s[e],void 0,2)}`)}return i}function Wh(e,t){const r=["id","orig","dest","hashAlg","cipherblockDgst","blockCommitment","blockCommitment","secretCommitment","schema"];for(const t of r)if("schema"!==t&&(void 0===e[t]||""===e[t]))throw new Error(`${t} is missing on dataExchange.\ndataExchange: ${JSON.stringify(e,void 0,2)}`);for(const r in t)if(""!==t[r]&&eo(t[r])!==eo(e[r]))throw new Error(`dataExchange's ${r}: ${JSON.stringify(e[r],void 0,2)} does not meet expected value ${JSON.stringify(t[r],void 0,2)}`)}async function Gh(e,t,r=10){const{payload:n}=await Gi(e),i=n.exchange,o={...i};delete o.id;if(await Hh(o)!==i.id)throw new rn(new Error("data exchange integrity failed"),["dataExchange integrity violated"]);const a=JSON.parse(i.dest),s=JSON.parse(i.orig);let c,u,f;try{c=(await Jh(n.poo,{iss:"orig",proofType:"PoO",exchange:i})).payload}catch(e){throw new rn(e,["invalid poo"])}try{await Jh(e,{iss:"dest",proofType:"PoR",exchange:i},{timestamp:"iat",notBefore:1e3*c.iat,notAfter:1e3*c.iat+i.pooToPorDelay})}catch(e){throw new rn(e,["invalid por"])}try{const e=await t.getSecretFromLedger(Vi(i.encAlg),i.ledgerSignerAddress,i.id,r);u=e.hex,f=e.iat}catch(e){throw new rn(e,["cannot verify"])}try{to(1e3*f,1e3*n.iat,1e3*c.iat+i.pooToSecretDelay)}catch(e){throw new rn(`Although the secret has been obtained (and you could try to decrypt the cipherblock), it's been published later than agreed: ${new Date(1e3*f).toUTCString()} > ${new Date(1e3*c.iat+i.pooToSecretDelay).toUTCString()}`,["secret not published in time"])}return{pooPayload:c,porPayload:n,secretHex:u,destPublicJwk:a,origPublicJwk:s}}async function Vh(e,t,r=10){let n,i,o,a,s;try{n=(await Gi(e)).payload}catch(e){throw new rn(e,["invalid verification request"])}try{const e=await Gh(n.por,t,r);i=e.destPublicJwk,o=e.origPublicJwk,a=e.pooPayload,s=e.porPayload}catch(e){throw new rn(e,["invalid por","invalid verification request"])}try{await Gi(e,"dest"===n.iss?i:o)}catch(e){throw new rn(e,["invalid verification request"])}return{pooPayload:a,porPayload:s,vrPayload:n,destPublicJwk:i,origPublicJwk:o}}async function Zh(t,r){const{payload:n}=await Gi(t),{destPublicJwk:i,origPublicJwk:o,secretHex:a,pooPayload:s,porPayload:c}=await Gh(n.por,r);try{await Gi(t,i)}catch(e){throw e instanceof rn&&e.add("invalid dispute request"),e}if(e(await oo(n.cipherblock,c.exchange.hashAlg),!0,!1)!==c.exchange.cipherblockDgst)throw new rn(new Error("cipherblock does not meet the committed (and already accepted) one"),["invalid dispute request"]);return await Wi(n.cipherblock,(await Zi(c.exchange.encAlg,a)).jwk),{pooPayload:s,porPayload:c,drPayload:n,destPublicJwk:i,origPublicJwk:o}}async function Xh(e,t,r,n){const i={proofType:"request",iss:e,dataExchangeId:t,por:r,type:"verificationRequest",iat:Math.floor(Date.now()/1e3)},o=await hi(n);return await new Li(i).setProtectedHeader({alg:n.alg}).setIssuedAt(i.iat).sign(o)}var Qh=Object.freeze({__proto__:null,ConflictResolver:class{constructor(e,t){this.jwkPair=e,this.dltAgent=t,this.initialized=new Promise(((e,t)=>{this.init().then((()=>{e(!0)})).catch((e=>{t(e)}))}))}async init(){await Xi(this.jwkPair.publicJwk,this.jwkPair.privateJwk)}async resolveCompleteness(e){await this.initialized;const{payload:t}=await Gi(e);let r;try{r=(await Gi(t.por)).payload}catch(e){throw new rn(e,["invalid por"])}const n={...await this._resolution(t.dataExchangeId,r.exchange[t.iss]),resolution:"not completed",type:"verification"};try{await Vh(e,this.dltAgent),n.resolution="completed"}catch(e){if(!(e instanceof rn)||e.nrErrors.includes("invalid verification request")||e.nrErrors.includes("unexpected error"))throw e}const i=await hi(this.jwkPair.privateJwk);return await new Li(n).setProtectedHeader({alg:this.jwkPair.privateJwk.alg}).setIssuedAt(n.iat).sign(i)}async resolveDispute(e){await this.initialized;const{payload:t}=await Gi(e);let r;try{r=(await Gi(t.por)).payload}catch(e){throw new rn(e,["invalid por"])}const n={...await this._resolution(t.dataExchangeId,r.exchange[t.iss]),resolution:"denied",type:"dispute"};try{await Zh(e,this.dltAgent)}catch(e){if(!(e instanceof rn&&e.nrErrors.includes("decryption failed")))throw new rn(e,["cannot verify"]);n.resolution="accepted"}const i=await hi(this.jwkPair.privateJwk);return await new Li(n).setProtectedHeader({alg:this.jwkPair.privateJwk.alg}).setIssuedAt(n.iat).sign(i)}async _resolution(e,t){return{proofType:"resolution",dataExchangeId:e,iat:Math.floor(Date.now()/1e3),iss:await io(this.jwkPair.publicJwk,!0),sub:t}}},checkCompleteness:Vh,checkDecryption:Zh,generateVerificationRequest:Xh,verifyPor:Gh,verifyResolution:async function(e,t){return await Gi(e,t??((e,t)=>JSON.parse(t.iss)))}});const Yh={gasLimit:125e5,contract:{address:"0x8d407A1722633bDD1dcf221474be7a44C05d7c2F",abi:[{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"sender",type:"address"},{indexed:!1,internalType:"uint256",name:"dataExchangeId",type:"uint256"},{indexed:!1,internalType:"uint256",name:"timestamp",type:"uint256"},{indexed:!1,internalType:"uint256",name:"secret",type:"uint256"}],name:"Registration",type:"event"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"uint256",name:"",type:"uint256"}],name:"registry",outputs:[{internalType:"uint256",name:"timestamp",type:"uint256"},{internalType:"uint256",name:"secret",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"_dataExchangeId",type:"uint256"},{internalType:"uint256",name:"_secret",type:"uint256"}],name:"setRegistry",outputs:[],stateMutability:"nonpayable",type:"function"}],transactionHash:"0x6a3828f8fe232819dc40ca66f93930b3bd1619db31a67ec34b44446b3e7c8289",receipt:{to:null,from:"0x17bd12C2134AfC1f6E9302a532eFE30C19B9E903",contractAddress:"0x8d407A1722633bDD1dcf221474be7a44C05d7c2F",transactionIndex:0,gasUsed:"253928",logsBloom:"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",blockHash:"0x0118672bb9b27679e616831d056d36291dd20cfe88c3ee2abd8f2dfce579cad4",transactionHash:"0x6a3828f8fe232819dc40ca66f93930b3bd1619db31a67ec34b44446b3e7c8289",logs:[],blockNumber:119389,cumulativeGasUsed:"253928",status:1,byzantium:!0},args:[],solcInputHash:"c528a37588793ef74285d75e08d6b8eb",metadata:'{"compiler":{"version":"0.8.4+commit.c7e474f2"},"language":"Solidity","output":{"abi":[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"dataExchangeId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"secret","type":"uint256"}],"name":"Registration","type":"event"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"registry","outputs":[{"internalType":"uint256","name":"timestamp","type":"uint256"},{"internalType":"uint256","name":"secret","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_dataExchangeId","type":"uint256"},{"internalType":"uint256","name":"_secret","type":"uint256"}],"name":"setRegistry","outputs":[],"stateMutability":"nonpayable","type":"function"}],"devdoc":{"kind":"dev","methods":{},"version":1},"userdoc":{"kind":"user","methods":{},"version":1}},"settings":{"compilationTarget":{"contracts/NonRepudiation.sol":"NonRepudiation"},"evmVersion":"istanbul","libraries":{},"metadata":{"bytecodeHash":"ipfs","useLiteralContent":true},"optimizer":{"enabled":false,"runs":200},"remappings":[]},"sources":{"contracts/NonRepudiation.sol":{"content":"//SPDX-License-Identifier: Unlicense\\npragma solidity ^0.8.0;\\n\\ncontract NonRepudiation {\\n struct Proof {\\n uint256 timestamp;\\n uint256 secret;\\n }\\n mapping(address => mapping (uint256 => Proof)) public registry;\\n event Registration(address sender, uint256 dataExchangeId, uint256 timestamp, uint256 secret);\\n\\n function setRegistry(uint256 _dataExchangeId, uint256 _secret) public {\\n require(registry[msg.sender][_dataExchangeId].secret == 0);\\n registry[msg.sender][_dataExchangeId] = Proof(block.timestamp, _secret);\\n emit Registration(msg.sender, _dataExchangeId, block.timestamp, _secret);\\n }\\n}\\n","keccak256":"0x8d371257a9b03c9102f158323e61f56ce49dd8489bd92c5a7d8abc3d9f6f8399","license":"Unlicense"}},"version":1}',bytecode:"0x608060405234801561001057600080fd5b506103a2806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c8063032439371461003b578063d05cb54514610057575b600080fd5b6100556004803603810190610050919061023a565b610088565b005b610071600480360381019061006c91906101fe565b6101a3565b60405161007f9291906102d9565b60405180910390f35b60008060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002060010154146100e757600080fd5b6040518060400160405280428152602001828152506000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002060008201518160000155602082015181600101559050507faa58599838af2e5e0f3251cfbb4eac5d5d447ded49f6b0ac28d6b44098224e63338342846040516101979493929190610294565b60405180910390a15050565b6000602052816000526040600020602052806000526040600020600091509150508060000154908060010154905082565b6000813590506101e38161033e565b92915050565b6000813590506101f881610355565b92915050565b6000806040838503121561021157600080fd5b600061021f858286016101d4565b9250506020610230858286016101e9565b9150509250929050565b6000806040838503121561024d57600080fd5b600061025b858286016101e9565b925050602061026c858286016101e9565b9150509250929050565b61027f81610302565b82525050565b61028e81610334565b82525050565b60006080820190506102a96000830187610276565b6102b66020830186610285565b6102c36040830185610285565b6102d06060830184610285565b95945050505050565b60006040820190506102ee6000830185610285565b6102fb6020830184610285565b9392505050565b600061030d82610314565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b61034781610302565b811461035257600080fd5b50565b61035e81610334565b811461036957600080fd5b5056fea26469706673582212204fd0fc653fb487221da9a14a4ca5d5499f9e9bc7b27ac8ab0f8d397fd6e3148564736f6c63430008040033",deployedBytecode:"0x608060405234801561001057600080fd5b50600436106100365760003560e01c8063032439371461003b578063d05cb54514610057575b600080fd5b6100556004803603810190610050919061023a565b610088565b005b610071600480360381019061006c91906101fe565b6101a3565b60405161007f9291906102d9565b60405180910390f35b60008060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002060010154146100e757600080fd5b6040518060400160405280428152602001828152506000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002060008201518160000155602082015181600101559050507faa58599838af2e5e0f3251cfbb4eac5d5d447ded49f6b0ac28d6b44098224e63338342846040516101979493929190610294565b60405180910390a15050565b6000602052816000526040600020602052806000526040600020600091509150508060000154908060010154905082565b6000813590506101e38161033e565b92915050565b6000813590506101f881610355565b92915050565b6000806040838503121561021157600080fd5b600061021f858286016101d4565b9250506020610230858286016101e9565b9150509250929050565b6000806040838503121561024d57600080fd5b600061025b858286016101e9565b925050602061026c858286016101e9565b9150509250929050565b61027f81610302565b82525050565b61028e81610334565b82525050565b60006080820190506102a96000830187610276565b6102b66020830186610285565b6102c36040830185610285565b6102d06060830184610285565b95945050505050565b60006040820190506102ee6000830185610285565b6102fb6020830184610285565b9392505050565b600061030d82610314565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b61034781610302565b811461035257600080fd5b50565b61035e81610334565b811461036957600080fd5b5056fea26469706673582212204fd0fc653fb487221da9a14a4ca5d5499f9e9bc7b27ac8ab0f8d397fd6e3148564736f6c63430008040033",devdoc:{kind:"dev",methods:{},version:1},userdoc:{kind:"user",methods:{},version:1},storageLayout:{storage:[{astId:13,contract:"contracts/NonRepudiation.sol:NonRepudiation",label:"registry",offset:0,slot:"0",type:"t_mapping(t_address,t_mapping(t_uint256,t_struct(Proof)6_storage))"}],types:{t_address:{encoding:"inplace",label:"address",numberOfBytes:"20"},"t_mapping(t_address,t_mapping(t_uint256,t_struct(Proof)6_storage))":{encoding:"mapping",key:"t_address",label:"mapping(address => mapping(uint256 => struct NonRepudiation.Proof))",numberOfBytes:"32",value:"t_mapping(t_uint256,t_struct(Proof)6_storage)"},"t_mapping(t_uint256,t_struct(Proof)6_storage)":{encoding:"mapping",key:"t_uint256",label:"mapping(uint256 => struct NonRepudiation.Proof)",numberOfBytes:"32",value:"t_struct(Proof)6_storage"},"t_struct(Proof)6_storage":{encoding:"inplace",label:"struct NonRepudiation.Proof",members:[{astId:3,contract:"contracts/NonRepudiation.sol:NonRepudiation",label:"timestamp",offset:0,slot:"0",type:"t_uint256"},{astId:5,contract:"contracts/NonRepudiation.sol:NonRepudiation",label:"secret",offset:0,slot:"1",type:"t_uint256"}],numberOfBytes:"64"},t_uint256:{encoding:"inplace",label:"uint256",numberOfBytes:"32"}}}}};async function ep(e,r,i,o,a){let s=Go.from(0),c=Go.from(0);const u=no(n(t(i)),!0);let f=0;do{try{({secret:s,timestamp:c}=await e.registry(no(r,!0),u))}catch(e){throw new rn(e,["cannot contact the ledger"])}s.isZero()&&(f++,await new Promise((e=>setTimeout(e,1e3))))}while(s.isZero()&&f{null!==e&&"object"==typeof e&&"function"==typeof e.then?e.then((e=>{this.dltConfig={...Yh,...e},this.provider=new Mh(this.dltConfig.rpcProviderUrl),this.contract=new Yf(this.dltConfig.contract.address,this.dltConfig.contract.abi,this.provider),t(!0)})).catch((e=>r(e))):(this.dltConfig={...Yh,...e},this.provider=new Mh(this.dltConfig.rpcProviderUrl),this.contract=new Yf(this.dltConfig.contract.address,this.dltConfig.contract.abi,this.provider),t(!0))}))}async getContractAddress(){return await this.initialized,this.contract.address}}class ip extends np{async getSecretFromLedger(e,t,r,n){return await this.initialized,await ep(this.contract,t,r,n,e)}}class op extends np{constructor(e,t,r){const n=new Promise(((t,n)=>{e.providerinfo.get().then((e=>{const i=e.rpcUrl;void 0===i?n(new Error("wallet is not connected to RPC endpoint")):t({...r,rpcProviderUrl:"string"==typeof i?i:i[0]})})).catch((e=>{n(e)}))}));super(n),this.wallet=e,this.did=t}}class ap extends op{async getSecretFromLedger(e,t,r,n){return await this.initialized,await ep(this.contract,t,r,n,e)}}class sp extends np{constructor(e,t,r){const n=new Promise(((t,n)=>{e.providerinfoGet().then((e=>{const i=e.rpcUrl;void 0===i?n(new Error("wallet is not connected to RPC endpoint")):t({...r,rpcProviderUrl:"string"==typeof i?i:i[0]})})).catch((e=>{n(e)}))}));super(n),this.wallet=e,this.did=t}}class cp extends sp{async getSecretFromLedger(e,t,r,n){return await this.initialized,await ep(this.contract,t,r,n,e)}}var up={},fp=c(vu),dp=c(As),lp=c(bc),hp=c(id),pp=c(Uo),mp=c(fu),gp=c(Rd),yp=c(dl),bp=c(is),vp=c(vo),wp=c(ud),Ap=c($h),_p=c($d),Ep=c(Sa),Sp=c(hs),Pp=c(wf),xp=c(ac),kp=c(Bf),Mp=c(Uh),Cp=c(ml),Ip=c(Nl);!function(e){var t=a&&a.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),r=a&&a.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=a&&a.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&t(n,e,i);return r(n,e),n};Object.defineProperty(e,"__esModule",{value:!0}),e.formatBytes32String=e.Utf8ErrorFuncs=e.toUtf8String=e.toUtf8CodePoints=e.toUtf8Bytes=e._toEscapedUtf8String=e.nameprep=e.hexDataSlice=e.hexDataLength=e.hexZeroPad=e.hexValue=e.hexStripZeros=e.hexConcat=e.isHexString=e.hexlify=e.base64=e.base58=e.TransactionDescription=e.LogDescription=e.Interface=e.SigningKey=e.HDNode=e.defaultPath=e.isBytesLike=e.isBytes=e.zeroPad=e.stripZeros=e.concat=e.arrayify=e.shallowCopy=e.resolveProperties=e.getStatic=e.defineReadOnly=e.deepCopy=e.checkProperties=e.poll=e.fetchJson=e._fetchData=e.RLP=e.Logger=e.checkResultErrors=e.FormatTypes=e.ParamType=e.FunctionFragment=e.EventFragment=e.ErrorFragment=e.ConstructorFragment=e.Fragment=e.defaultAbiCoder=e.AbiCoder=void 0,e.Indexed=e.Utf8ErrorReason=e.UnicodeNormalizationForm=e.SupportedAlgorithm=e.mnemonicToSeed=e.isValidMnemonic=e.entropyToMnemonic=e.mnemonicToEntropy=e.getAccountPath=e.verifyTypedData=e.verifyMessage=e.recoverPublicKey=e.computePublicKey=e.recoverAddress=e.computeAddress=e.getJsonWalletAddress=e.TransactionTypes=e.serializeTransaction=e.parseTransaction=e.accessListify=e.joinSignature=e.splitSignature=e.soliditySha256=e.solidityKeccak256=e.solidityPack=e.shuffled=e.randomBytes=e.sha512=e.sha256=e.ripemd160=e.keccak256=e.computeHmac=e.commify=e.parseUnits=e.formatUnits=e.parseEther=e.formatEther=e.isAddress=e.getCreate2Address=e.getContractAddress=e.getIcapAddress=e.getAddress=e._TypedDataEncoder=e.id=e.isValidName=e.namehash=e.hashMessage=e.dnsEncode=e.parseBytes32String=void 0;var i=fp;Object.defineProperty(e,"AbiCoder",{enumerable:!0,get:function(){return i.AbiCoder}}),Object.defineProperty(e,"checkResultErrors",{enumerable:!0,get:function(){return i.checkResultErrors}}),Object.defineProperty(e,"ConstructorFragment",{enumerable:!0,get:function(){return i.ConstructorFragment}}),Object.defineProperty(e,"defaultAbiCoder",{enumerable:!0,get:function(){return i.defaultAbiCoder}}),Object.defineProperty(e,"ErrorFragment",{enumerable:!0,get:function(){return i.ErrorFragment}}),Object.defineProperty(e,"EventFragment",{enumerable:!0,get:function(){return i.EventFragment}}),Object.defineProperty(e,"FormatTypes",{enumerable:!0,get:function(){return i.FormatTypes}}),Object.defineProperty(e,"Fragment",{enumerable:!0,get:function(){return i.Fragment}}),Object.defineProperty(e,"FunctionFragment",{enumerable:!0,get:function(){return i.FunctionFragment}}),Object.defineProperty(e,"Indexed",{enumerable:!0,get:function(){return i.Indexed}}),Object.defineProperty(e,"Interface",{enumerable:!0,get:function(){return i.Interface}}),Object.defineProperty(e,"LogDescription",{enumerable:!0,get:function(){return i.LogDescription}}),Object.defineProperty(e,"ParamType",{enumerable:!0,get:function(){return i.ParamType}}),Object.defineProperty(e,"TransactionDescription",{enumerable:!0,get:function(){return i.TransactionDescription}});var o=dp;Object.defineProperty(e,"getAddress",{enumerable:!0,get:function(){return o.getAddress}}),Object.defineProperty(e,"getCreate2Address",{enumerable:!0,get:function(){return o.getCreate2Address}}),Object.defineProperty(e,"getContractAddress",{enumerable:!0,get:function(){return o.getContractAddress}}),Object.defineProperty(e,"getIcapAddress",{enumerable:!0,get:function(){return o.getIcapAddress}}),Object.defineProperty(e,"isAddress",{enumerable:!0,get:function(){return o.isAddress}});var s=n(lp);e.base64=s;var c=hp;Object.defineProperty(e,"base58",{enumerable:!0,get:function(){return c.Base58}});var u=pp;Object.defineProperty(e,"arrayify",{enumerable:!0,get:function(){return u.arrayify}}),Object.defineProperty(e,"concat",{enumerable:!0,get:function(){return u.concat}}),Object.defineProperty(e,"hexConcat",{enumerable:!0,get:function(){return u.hexConcat}}),Object.defineProperty(e,"hexDataSlice",{enumerable:!0,get:function(){return u.hexDataSlice}}),Object.defineProperty(e,"hexDataLength",{enumerable:!0,get:function(){return u.hexDataLength}}),Object.defineProperty(e,"hexlify",{enumerable:!0,get:function(){return u.hexlify}}),Object.defineProperty(e,"hexStripZeros",{enumerable:!0,get:function(){return u.hexStripZeros}}),Object.defineProperty(e,"hexValue",{enumerable:!0,get:function(){return u.hexValue}}),Object.defineProperty(e,"hexZeroPad",{enumerable:!0,get:function(){return u.hexZeroPad}}),Object.defineProperty(e,"isBytes",{enumerable:!0,get:function(){return u.isBytes}}),Object.defineProperty(e,"isBytesLike",{enumerable:!0,get:function(){return u.isBytesLike}}),Object.defineProperty(e,"isHexString",{enumerable:!0,get:function(){return u.isHexString}}),Object.defineProperty(e,"joinSignature",{enumerable:!0,get:function(){return u.joinSignature}}),Object.defineProperty(e,"zeroPad",{enumerable:!0,get:function(){return u.zeroPad}}),Object.defineProperty(e,"splitSignature",{enumerable:!0,get:function(){return u.splitSignature}}),Object.defineProperty(e,"stripZeros",{enumerable:!0,get:function(){return u.stripZeros}});var f=mp;Object.defineProperty(e,"_TypedDataEncoder",{enumerable:!0,get:function(){return f._TypedDataEncoder}}),Object.defineProperty(e,"dnsEncode",{enumerable:!0,get:function(){return f.dnsEncode}}),Object.defineProperty(e,"hashMessage",{enumerable:!0,get:function(){return f.hashMessage}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return f.id}}),Object.defineProperty(e,"isValidName",{enumerable:!0,get:function(){return f.isValidName}}),Object.defineProperty(e,"namehash",{enumerable:!0,get:function(){return f.namehash}});var d=gp;Object.defineProperty(e,"defaultPath",{enumerable:!0,get:function(){return d.defaultPath}}),Object.defineProperty(e,"entropyToMnemonic",{enumerable:!0,get:function(){return d.entropyToMnemonic}}),Object.defineProperty(e,"getAccountPath",{enumerable:!0,get:function(){return d.getAccountPath}}),Object.defineProperty(e,"HDNode",{enumerable:!0,get:function(){return d.HDNode}}),Object.defineProperty(e,"isValidMnemonic",{enumerable:!0,get:function(){return d.isValidMnemonic}}),Object.defineProperty(e,"mnemonicToEntropy",{enumerable:!0,get:function(){return d.mnemonicToEntropy}}),Object.defineProperty(e,"mnemonicToSeed",{enumerable:!0,get:function(){return d.mnemonicToSeed}});var l=yp;Object.defineProperty(e,"getJsonWalletAddress",{enumerable:!0,get:function(){return l.getJsonWalletAddress}});var h=bp;Object.defineProperty(e,"keccak256",{enumerable:!0,get:function(){return h.keccak256}});var p=vp;Object.defineProperty(e,"Logger",{enumerable:!0,get:function(){return p.Logger}});var m=wp;Object.defineProperty(e,"computeHmac",{enumerable:!0,get:function(){return m.computeHmac}}),Object.defineProperty(e,"ripemd160",{enumerable:!0,get:function(){return m.ripemd160}}),Object.defineProperty(e,"sha256",{enumerable:!0,get:function(){return m.sha256}}),Object.defineProperty(e,"sha512",{enumerable:!0,get:function(){return m.sha512}});var g=Ap;Object.defineProperty(e,"solidityKeccak256",{enumerable:!0,get:function(){return g.keccak256}}),Object.defineProperty(e,"solidityPack",{enumerable:!0,get:function(){return g.pack}}),Object.defineProperty(e,"soliditySha256",{enumerable:!0,get:function(){return g.sha256}});var y=_p;Object.defineProperty(e,"randomBytes",{enumerable:!0,get:function(){return y.randomBytes}}),Object.defineProperty(e,"shuffled",{enumerable:!0,get:function(){return y.shuffled}});var b=Ep;Object.defineProperty(e,"checkProperties",{enumerable:!0,get:function(){return b.checkProperties}}),Object.defineProperty(e,"deepCopy",{enumerable:!0,get:function(){return b.deepCopy}}),Object.defineProperty(e,"defineReadOnly",{enumerable:!0,get:function(){return b.defineReadOnly}}),Object.defineProperty(e,"getStatic",{enumerable:!0,get:function(){return b.getStatic}}),Object.defineProperty(e,"resolveProperties",{enumerable:!0,get:function(){return b.resolveProperties}}),Object.defineProperty(e,"shallowCopy",{enumerable:!0,get:function(){return b.shallowCopy}});var v=n(Sp);e.RLP=v;var w=Pp;Object.defineProperty(e,"computePublicKey",{enumerable:!0,get:function(){return w.computePublicKey}}),Object.defineProperty(e,"recoverPublicKey",{enumerable:!0,get:function(){return w.recoverPublicKey}}),Object.defineProperty(e,"SigningKey",{enumerable:!0,get:function(){return w.SigningKey}});var A=xp;Object.defineProperty(e,"formatBytes32String",{enumerable:!0,get:function(){return A.formatBytes32String}}),Object.defineProperty(e,"nameprep",{enumerable:!0,get:function(){return A.nameprep}}),Object.defineProperty(e,"parseBytes32String",{enumerable:!0,get:function(){return A.parseBytes32String}}),Object.defineProperty(e,"_toEscapedUtf8String",{enumerable:!0,get:function(){return A._toEscapedUtf8String}}),Object.defineProperty(e,"toUtf8Bytes",{enumerable:!0,get:function(){return A.toUtf8Bytes}}),Object.defineProperty(e,"toUtf8CodePoints",{enumerable:!0,get:function(){return A.toUtf8CodePoints}}),Object.defineProperty(e,"toUtf8String",{enumerable:!0,get:function(){return A.toUtf8String}}),Object.defineProperty(e,"Utf8ErrorFuncs",{enumerable:!0,get:function(){return A.Utf8ErrorFuncs}});var _=kp;Object.defineProperty(e,"accessListify",{enumerable:!0,get:function(){return _.accessListify}}),Object.defineProperty(e,"computeAddress",{enumerable:!0,get:function(){return _.computeAddress}}),Object.defineProperty(e,"parseTransaction",{enumerable:!0,get:function(){return _.parse}}),Object.defineProperty(e,"recoverAddress",{enumerable:!0,get:function(){return _.recoverAddress}}),Object.defineProperty(e,"serializeTransaction",{enumerable:!0,get:function(){return _.serialize}}),Object.defineProperty(e,"TransactionTypes",{enumerable:!0,get:function(){return _.TransactionTypes}});var E=Mp;Object.defineProperty(e,"commify",{enumerable:!0,get:function(){return E.commify}}),Object.defineProperty(e,"formatEther",{enumerable:!0,get:function(){return E.formatEther}}),Object.defineProperty(e,"parseEther",{enumerable:!0,get:function(){return E.parseEther}}),Object.defineProperty(e,"formatUnits",{enumerable:!0,get:function(){return E.formatUnits}}),Object.defineProperty(e,"parseUnits",{enumerable:!0,get:function(){return E.parseUnits}});var S=Cp;Object.defineProperty(e,"verifyMessage",{enumerable:!0,get:function(){return S.verifyMessage}}),Object.defineProperty(e,"verifyTypedData",{enumerable:!0,get:function(){return S.verifyTypedData}});var P=Ip;Object.defineProperty(e,"_fetchData",{enumerable:!0,get:function(){return P._fetchData}}),Object.defineProperty(e,"fetchJson",{enumerable:!0,get:function(){return P.fetchJson}}),Object.defineProperty(e,"poll",{enumerable:!0,get:function(){return P.poll}});var x=wp;Object.defineProperty(e,"SupportedAlgorithm",{enumerable:!0,get:function(){return x.SupportedAlgorithm}});var k=xp;Object.defineProperty(e,"UnicodeNormalizationForm",{enumerable:!0,get:function(){return k.UnicodeNormalizationForm}}),Object.defineProperty(e,"Utf8ErrorReason",{enumerable:!0,get:function(){return k.Utf8ErrorReason}})}(up);class Rp extends np{constructor(e,t){let r;super(e),this.count=-1,r=void 0===t?function(e,t=!1){if(e<1)throw new RangeError("byteLength MUST be > 0");{const r=new Uint8Array(e);if(e<=65536)self.crypto.getRandomValues(r);else for(let t=0;tthis.count&&(this.count=e),this.count}}class Np extends op{constructor(){super(...arguments),this.count=-1}async deploySecret(e,t){await this.initialized;const r=await tp(e,t,this),n=(await this.wallet.identities.sign({did:this.did},{type:"Transaction",data:r})).signature,i=await this.provider.sendTransaction(n);return this.count=this.count+1,i.hash}async getAddress(){await this.initialized;const e=await this.wallet.identities.info({did:this.did});if(void 0===e.addresses)throw new rn(new Error("no addresses for did "+this.did),["unexpected error"]);return e.addresses[0]}async nextNonce(){await this.initialized;const e=await this.provider.getTransactionCount(await this.getAddress(),"pending");return e>this.count&&(this.count=e),this.count}}class Op extends sp{constructor(){super(...arguments),this.count=-1}async deploySecret(e,t){await this.initialized;const r=await tp(e,t,this),n=(await this.wallet.identitySign({did:this.did},{type:"Transaction",data:r})).signature,i=await this.provider.sendTransaction(n);return this.count=this.count+1,i.hash}async getAddress(){await this.initialized;const e=await this.wallet.identityInfo({did:this.did});if(void 0===e.addresses)throw new rn(`Can't get address for did: ${this.did}`,["unexpected error"]);return e.addresses[0]}async nextNonce(){await this.initialized;const e=await this.provider.getTransactionCount(await this.getAddress(),"pending");return e>this.count&&(this.count=e),this.count}}var Tp=Object.freeze({__proto__:null,EthersIoAgentDest:ip,EthersIoAgentOrig:Rp,I3mServerWalletAgentDest:cp,I3mServerWalletAgentOrig:Op,I3mWalletAgentDest:ap,I3mWalletAgentOrig:Np}),jp={schemas:{IdentitySelectOutput:{title:"IdentitySelectOutput",type:"object",properties:{did:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},required:["did"]},SignInput:{title:"SignInput",oneOf:[{title:"SignTransaction",type:"object",properties:{type:{enum:["Transaction"]},data:{title:"Transaction",type:"object",additionalProperties:!0,properties:{from:{type:"string"},to:{type:"string"},nonce:{type:"number"}}}},required:["type","data"]},{title:"SignRaw",type:"object",properties:{type:{enum:["Raw"]},data:{type:"object",properties:{payload:{description:"Base64Url encoded data to sign",type:"string",pattern:"^[A-Za-z0-9_-]+$"}},required:["payload"]}},required:["type","data"]},{title:"SignJWT",type:"object",properties:{type:{enum:["JWT"]},data:{type:"object",properties:{header:{description:'header fields to be added to the JWS header. "alg" and "kid" will be ignored since they are automatically added by the wallet.',type:"object",additionalProperties:!0},payload:{description:"A JSON object to be signed by the wallet. It will become the payload of the generated JWS. 'iss' (issuer) and 'iat' (issued at) will be automatically added by the wallet and will override provided values.",type:"object",additionalProperties:!0}},required:["payload"]}},required:["type","data"]}]},SignRaw:{title:"SignRaw",type:"object",properties:{type:{enum:["Raw"]},data:{type:"object",properties:{payload:{description:"Base64Url encoded data to sign",type:"string",pattern:"^[A-Za-z0-9_-]+$"}},required:["payload"]}},required:["type","data"]},SignTransaction:{title:"SignTransaction",type:"object",properties:{type:{enum:["Transaction"]},data:{title:"Transaction",type:"object",additionalProperties:!0,properties:{from:{type:"string"},to:{type:"string"},nonce:{type:"number"}}}},required:["type","data"]},SignJWT:{title:"SignJWT",type:"object",properties:{type:{enum:["JWT"]},data:{type:"object",properties:{header:{description:'header fields to be added to the JWS header. "alg" and "kid" will be ignored since they are automatically added by the wallet.',type:"object",additionalProperties:!0},payload:{description:"A JSON object to be signed by the wallet. It will become the payload of the generated JWS. 'iss' (issuer) and 'iat' (issued at) will be automatically added by the wallet and will override provided values.",type:"object",additionalProperties:!0}},required:["payload"]}},required:["type","data"]},Transaction:{title:"Transaction",type:"object",additionalProperties:!0,properties:{from:{type:"string"},to:{type:"string"},nonce:{type:"number"}}},SignOutput:{title:"SignOutput",type:"object",properties:{signature:{type:"string"}},required:["signature"]},Receipt:{title:"Receipt",type:"object",properties:{receipt:{type:"string"}},required:["receipt"]},SignTypes:{title:"SignTypes",type:"string",enum:["Transaction","Raw","JWT"]},IdentityListInput:{title:"IdentityListInput",description:"A list of DIDs",type:"array",items:{type:"object",properties:{did:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},required:["did"]}},IdentityCreateInput:{title:"IdentityCreateInput",description:'Besides the here defined options, provider specific properties should be added here if necessary, e.g. "path" for BIP21 wallets, or the key algorithm (if the wallet supports multiple algorithm).\n',type:"object",properties:{alias:{type:"string"}},additionalProperties:!0},IdentityCreateOutput:{title:"IdentityCreateOutput",description:"It returns the account id and type\n",type:"object",properties:{did:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},additionalProperties:!0,required:["did"]},ResourceListOutput:{title:"ResourceListOutput",description:"A list of resources",type:"array",items:{title:"Resource",anyOf:[{title:"VerifiableCredential",type:"object",properties:{type:{example:"VerifiableCredential",enum:["VerifiableCredential"]},name:{type:"string",example:"Resource name"},resource:{type:"object",properties:{"@context":{type:"array",items:{type:"string"},example:["https://www.w3.org/2018/credentials/v1"]},id:{type:"string",example:"http://example.edu/credentials/1872"},type:{type:"array",items:{type:"string"},example:["VerifiableCredential"]},issuer:{type:"object",properties:{id:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},additionalProperties:!0,required:["id"]},issuanceDate:{type:"string",format:"date-time",example:"2021-06-10T19:07:28.000Z"},credentialSubject:{type:"object",properties:{id:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},required:["id"],additionalProperties:!0},proof:{type:"object",properties:{type:{type:"string",enum:["JwtProof2020"]}},required:["type"],additionalProperties:!0}},additionalProperties:!0,required:["@context","type","issuer","issuanceDate","credentialSubject","proof"]}},required:["type","resource"]},{title:"ObjectResource",type:"object",properties:{type:{example:"Object",enum:["Object"]},name:{type:"string",example:"Resource name"},parentResource:{type:"string"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",additionalProperties:!0}},required:["type","resource"]},{title:"JWK pair",type:"object",properties:{type:{example:"KeyPair",enum:["KeyPair"]},name:{type:"string",example:"Resource name"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",properties:{keyPair:{type:"object",properties:{privateJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents a private key (complementary to `publicJwk`)\n",example:'{"alg":"ES256","crv":"P-256","d":"rQp_3eZzvXwt1sK7WWsRhVYipqNGblzYDKKaYirlqs0","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'},publicJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents the public key (complementary to `privateJwk`).\n",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'}},required:["privateJwk","publicJwk"]}},required:["keyPair"]}},required:["type","resource"]},{title:"Contract",type:"object",properties:{type:{example:"Contract",enum:["Contract"]},name:{type:"string",example:"Resource name"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",properties:{dataSharingAgreement:{type:"object",required:["dataOfferingDescription","parties","purpose","duration","intendedUse","licenseGrant","dataStream","personalData","pricingModel","dataExchangeAgreement","signatures"],properties:{dataOfferingDescription:{type:"object",required:["dataOfferingId","version","active"],properties:{dataOfferingId:{type:"string"},version:{type:"integer"},category:{type:"string"},active:{type:"boolean"},title:{type:"string"}}},parties:{type:"object",required:["providerDid","consumerDid"],properties:{providerDid:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},consumerDid:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}}},purpose:{type:"string"},duration:{type:"object",required:["creationDate","startDate","endDate"],properties:{creationDate:{type:"integer"},startDate:{type:"integer"},endDate:{type:"integer"}}},intendedUse:{type:"object",required:["processData","shareDataWithThirdParty","editData"],properties:{processData:{type:"boolean"},shareDataWithThirdParty:{type:"boolean"},editData:{type:"boolean"}}},licenseGrant:{type:"object",required:["transferable","exclusiveness","paidUp","revocable","processing","modifying","analyzing","storingData","storingCopy","reproducing","distributing","loaning","selling","renting","furtherLicensing","leasing"],properties:{transferable:{type:"boolean"},exclusiveness:{type:"boolean"},paidUp:{type:"boolean"},revocable:{type:"boolean"},processing:{type:"boolean"},modifying:{type:"boolean"},analyzing:{type:"boolean"},storingData:{type:"boolean"},storingCopy:{type:"boolean"},reproducing:{type:"boolean"},distributing:{type:"boolean"},loaning:{type:"boolean"},selling:{type:"boolean"},renting:{type:"boolean"},furtherLicensing:{type:"boolean"},leasing:{type:"boolean"}}},dataStream:{type:"boolean"},personalData:{type:"boolean"},pricingModel:{type:"object",required:["basicPrice","currency","hasFreePrice"],properties:{paymentType:{type:"string"},pricingModelName:{type:"string"},basicPrice:{type:"number",format:"float"},currency:{type:"string"},fee:{type:"number",format:"float"},hasPaymentOnSubscription:{type:"object",properties:{paymentOnSubscriptionName:{type:"string"},paymentType:{type:"string"},timeDuration:{type:"string"},description:{type:"string"},repeat:{type:"string"},hasSubscriptionPrice:{type:"number"}}},hasFreePrice:{type:"object",properties:{hasPriceFree:{type:"boolean"}}}}},dataExchangeAgreement:{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},signatures:{type:"object",required:["providerSignature","consumerSignature"],properties:{providerSignature:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"},consumerSignature:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"}}}}},keyPair:{type:"object",properties:{privateJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents a private key (complementary to `publicJwk`)\n",example:'{"alg":"ES256","crv":"P-256","d":"rQp_3eZzvXwt1sK7WWsRhVYipqNGblzYDKKaYirlqs0","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'},publicJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents the public key (complementary to `privateJwk`).\n",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'}},required:["privateJwk","publicJwk"]}},required:["dataSharingAgreement"]}},required:["type","resource"]},{title:"NonRepudiationProof",type:"object",properties:{type:{example:"NonRepudiationProof",enum:["NonRepudiationProof"]},name:{type:"string",example:"Resource name"},resource:{description:"a non-repudiation proof (either a PoO, a PoR or a PoP) as a compact JWS"}},required:["type","resource"]},{title:"DataExchangeResource",type:"object",properties:{type:{example:"DataExchange",enum:["DataExchange"]},name:{type:"string",example:"Resource name"},resource:{allOf:[{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},{type:"object",properties:{cipherblockDgst:{type:"string",description:"hash of the cipherblock in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"},blockCommitment:{type:"string",description:"hash of the plaintext block in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"},secretCommitment:{type:"string",description:"ash of the secret that can be used to decrypt the block in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"}},required:["cipherblockDgst","blockCommitment","secretCommitment"]}]}},required:["type","resource"]}]}},Resource:{title:"Resource",anyOf:[{title:"VerifiableCredential",type:"object",properties:{type:{example:"VerifiableCredential",enum:["VerifiableCredential"]},name:{type:"string",example:"Resource name"},resource:{type:"object",properties:{"@context":{type:"array",items:{type:"string"},example:["https://www.w3.org/2018/credentials/v1"]},id:{type:"string",example:"http://example.edu/credentials/1872"},type:{type:"array",items:{type:"string"},example:["VerifiableCredential"]},issuer:{type:"object",properties:{id:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},additionalProperties:!0,required:["id"]},issuanceDate:{type:"string",format:"date-time",example:"2021-06-10T19:07:28.000Z"},credentialSubject:{type:"object",properties:{id:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},required:["id"],additionalProperties:!0},proof:{type:"object",properties:{type:{type:"string",enum:["JwtProof2020"]}},required:["type"],additionalProperties:!0}},additionalProperties:!0,required:["@context","type","issuer","issuanceDate","credentialSubject","proof"]}},required:["type","resource"]},{title:"ObjectResource",type:"object",properties:{type:{example:"Object",enum:["Object"]},name:{type:"string",example:"Resource name"},parentResource:{type:"string"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",additionalProperties:!0}},required:["type","resource"]},{title:"JWK pair",type:"object",properties:{type:{example:"KeyPair",enum:["KeyPair"]},name:{type:"string",example:"Resource name"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",properties:{keyPair:{type:"object",properties:{privateJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents a private key (complementary to `publicJwk`)\n",example:'{"alg":"ES256","crv":"P-256","d":"rQp_3eZzvXwt1sK7WWsRhVYipqNGblzYDKKaYirlqs0","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'},publicJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents the public key (complementary to `privateJwk`).\n",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'}},required:["privateJwk","publicJwk"]}},required:["keyPair"]}},required:["type","resource"]},{title:"Contract",type:"object",properties:{type:{example:"Contract",enum:["Contract"]},name:{type:"string",example:"Resource name"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",properties:{dataSharingAgreement:{type:"object",required:["dataOfferingDescription","parties","purpose","duration","intendedUse","licenseGrant","dataStream","personalData","pricingModel","dataExchangeAgreement","signatures"],properties:{dataOfferingDescription:{type:"object",required:["dataOfferingId","version","active"],properties:{dataOfferingId:{type:"string"},version:{type:"integer"},category:{type:"string"},active:{type:"boolean"},title:{type:"string"}}},parties:{type:"object",required:["providerDid","consumerDid"],properties:{providerDid:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},consumerDid:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}}},purpose:{type:"string"},duration:{type:"object",required:["creationDate","startDate","endDate"],properties:{creationDate:{type:"integer"},startDate:{type:"integer"},endDate:{type:"integer"}}},intendedUse:{type:"object",required:["processData","shareDataWithThirdParty","editData"],properties:{processData:{type:"boolean"},shareDataWithThirdParty:{type:"boolean"},editData:{type:"boolean"}}},licenseGrant:{type:"object",required:["transferable","exclusiveness","paidUp","revocable","processing","modifying","analyzing","storingData","storingCopy","reproducing","distributing","loaning","selling","renting","furtherLicensing","leasing"],properties:{transferable:{type:"boolean"},exclusiveness:{type:"boolean"},paidUp:{type:"boolean"},revocable:{type:"boolean"},processing:{type:"boolean"},modifying:{type:"boolean"},analyzing:{type:"boolean"},storingData:{type:"boolean"},storingCopy:{type:"boolean"},reproducing:{type:"boolean"},distributing:{type:"boolean"},loaning:{type:"boolean"},selling:{type:"boolean"},renting:{type:"boolean"},furtherLicensing:{type:"boolean"},leasing:{type:"boolean"}}},dataStream:{type:"boolean"},personalData:{type:"boolean"},pricingModel:{type:"object",required:["basicPrice","currency","hasFreePrice"],properties:{paymentType:{type:"string"},pricingModelName:{type:"string"},basicPrice:{type:"number",format:"float"},currency:{type:"string"},fee:{type:"number",format:"float"},hasPaymentOnSubscription:{type:"object",properties:{paymentOnSubscriptionName:{type:"string"},paymentType:{type:"string"},timeDuration:{type:"string"},description:{type:"string"},repeat:{type:"string"},hasSubscriptionPrice:{type:"number"}}},hasFreePrice:{type:"object",properties:{hasPriceFree:{type:"boolean"}}}}},dataExchangeAgreement:{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},signatures:{type:"object",required:["providerSignature","consumerSignature"],properties:{providerSignature:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"},consumerSignature:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"}}}}},keyPair:{type:"object",properties:{privateJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents a private key (complementary to `publicJwk`)\n",example:'{"alg":"ES256","crv":"P-256","d":"rQp_3eZzvXwt1sK7WWsRhVYipqNGblzYDKKaYirlqs0","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'},publicJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents the public key (complementary to `privateJwk`).\n",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'}},required:["privateJwk","publicJwk"]}},required:["dataSharingAgreement"]}},required:["type","resource"]},{title:"NonRepudiationProof",type:"object",properties:{type:{example:"NonRepudiationProof",enum:["NonRepudiationProof"]},name:{type:"string",example:"Resource name"},resource:{description:"a non-repudiation proof (either a PoO, a PoR or a PoP) as a compact JWS"}},required:["type","resource"]},{title:"DataExchangeResource",type:"object",properties:{type:{example:"DataExchange",enum:["DataExchange"]},name:{type:"string",example:"Resource name"},resource:{allOf:[{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},{type:"object",properties:{cipherblockDgst:{type:"string",description:"hash of the cipherblock in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"},blockCommitment:{type:"string",description:"hash of the plaintext block in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"},secretCommitment:{type:"string",description:"ash of the secret that can be used to decrypt the block in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"}},required:["cipherblockDgst","blockCommitment","secretCommitment"]}]}},required:["type","resource"]}]},VerifiableCredential:{title:"VerifiableCredential",type:"object",properties:{type:{example:"VerifiableCredential",enum:["VerifiableCredential"]},name:{type:"string",example:"Resource name"},resource:{type:"object",properties:{"@context":{type:"array",items:{type:"string"},example:["https://www.w3.org/2018/credentials/v1"]},id:{type:"string",example:"http://example.edu/credentials/1872"},type:{type:"array",items:{type:"string"},example:["VerifiableCredential"]},issuer:{type:"object",properties:{id:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},additionalProperties:!0,required:["id"]},issuanceDate:{type:"string",format:"date-time",example:"2021-06-10T19:07:28.000Z"},credentialSubject:{type:"object",properties:{id:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},required:["id"],additionalProperties:!0},proof:{type:"object",properties:{type:{type:"string",enum:["JwtProof2020"]}},required:["type"],additionalProperties:!0}},additionalProperties:!0,required:["@context","type","issuer","issuanceDate","credentialSubject","proof"]}},required:["type","resource"]},ObjectResource:{title:"ObjectResource",type:"object",properties:{type:{example:"Object",enum:["Object"]},name:{type:"string",example:"Resource name"},parentResource:{type:"string"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",additionalProperties:!0}},required:["type","resource"]},KeyPair:{title:"JWK pair",type:"object",properties:{type:{example:"KeyPair",enum:["KeyPair"]},name:{type:"string",example:"Resource name"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",properties:{keyPair:{type:"object",properties:{privateJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents a private key (complementary to `publicJwk`)\n",example:'{"alg":"ES256","crv":"P-256","d":"rQp_3eZzvXwt1sK7WWsRhVYipqNGblzYDKKaYirlqs0","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'},publicJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents the public key (complementary to `privateJwk`).\n",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'}},required:["privateJwk","publicJwk"]}},required:["keyPair"]}},required:["type","resource"]},Contract:{title:"Contract",type:"object",properties:{type:{example:"Contract",enum:["Contract"]},name:{type:"string",example:"Resource name"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",properties:{dataSharingAgreement:{type:"object",required:["dataOfferingDescription","parties","purpose","duration","intendedUse","licenseGrant","dataStream","personalData","pricingModel","dataExchangeAgreement","signatures"],properties:{dataOfferingDescription:{type:"object",required:["dataOfferingId","version","active"],properties:{dataOfferingId:{type:"string"},version:{type:"integer"},category:{type:"string"},active:{type:"boolean"},title:{type:"string"}}},parties:{type:"object",required:["providerDid","consumerDid"],properties:{providerDid:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},consumerDid:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}}},purpose:{type:"string"},duration:{type:"object",required:["creationDate","startDate","endDate"],properties:{creationDate:{type:"integer"},startDate:{type:"integer"},endDate:{type:"integer"}}},intendedUse:{type:"object",required:["processData","shareDataWithThirdParty","editData"],properties:{processData:{type:"boolean"},shareDataWithThirdParty:{type:"boolean"},editData:{type:"boolean"}}},licenseGrant:{type:"object",required:["transferable","exclusiveness","paidUp","revocable","processing","modifying","analyzing","storingData","storingCopy","reproducing","distributing","loaning","selling","renting","furtherLicensing","leasing"],properties:{transferable:{type:"boolean"},exclusiveness:{type:"boolean"},paidUp:{type:"boolean"},revocable:{type:"boolean"},processing:{type:"boolean"},modifying:{type:"boolean"},analyzing:{type:"boolean"},storingData:{type:"boolean"},storingCopy:{type:"boolean"},reproducing:{type:"boolean"},distributing:{type:"boolean"},loaning:{type:"boolean"},selling:{type:"boolean"},renting:{type:"boolean"},furtherLicensing:{type:"boolean"},leasing:{type:"boolean"}}},dataStream:{type:"boolean"},personalData:{type:"boolean"},pricingModel:{type:"object",required:["basicPrice","currency","hasFreePrice"],properties:{paymentType:{type:"string"},pricingModelName:{type:"string"},basicPrice:{type:"number",format:"float"},currency:{type:"string"},fee:{type:"number",format:"float"},hasPaymentOnSubscription:{type:"object",properties:{paymentOnSubscriptionName:{type:"string"},paymentType:{type:"string"},timeDuration:{type:"string"},description:{type:"string"},repeat:{type:"string"},hasSubscriptionPrice:{type:"number"}}},hasFreePrice:{type:"object",properties:{hasPriceFree:{type:"boolean"}}}}},dataExchangeAgreement:{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},signatures:{type:"object",required:["providerSignature","consumerSignature"],properties:{providerSignature:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"},consumerSignature:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"}}}}},keyPair:{type:"object",properties:{privateJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents a private key (complementary to `publicJwk`)\n",example:'{"alg":"ES256","crv":"P-256","d":"rQp_3eZzvXwt1sK7WWsRhVYipqNGblzYDKKaYirlqs0","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'},publicJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents the public key (complementary to `privateJwk`).\n",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'}},required:["privateJwk","publicJwk"]}},required:["dataSharingAgreement"]}},required:["type","resource"]},DataExchangeResource:{title:"DataExchangeResource",type:"object",properties:{type:{example:"DataExchange",enum:["DataExchange"]},name:{type:"string",example:"Resource name"},resource:{allOf:[{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},{type:"object",properties:{cipherblockDgst:{type:"string",description:"hash of the cipherblock in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"},blockCommitment:{type:"string",description:"hash of the plaintext block in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"},secretCommitment:{type:"string",description:"ash of the secret that can be used to decrypt the block in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"}},required:["cipherblockDgst","blockCommitment","secretCommitment"]}]}},required:["type","resource"]},NonRepudiationProof:{title:"NonRepudiationProof",type:"object",properties:{type:{example:"NonRepudiationProof",enum:["NonRepudiationProof"]},name:{type:"string",example:"Resource name"},resource:{description:"a non-repudiation proof (either a PoO, a PoR or a PoP) as a compact JWS"}},required:["type","resource"]},ResourceId:{type:"object",properties:{id:{type:"string"}},required:["id"]},ResourceType:{type:"string",enum:["VerifiableCredential","Object","KeyPair","Contract","DataExchange","NonRepudiationProof"]},SignedTransaction:{title:"SignedTransaction",description:"A list of resources",type:"object",properties:{transaction:{type:"string",pattern:"^0x(?:[A-Fa-f0-9])+$"}}},DecodedJwt:{title:"JwtPayload",type:"object",properties:{header:{type:"object",properties:{typ:{type:"string",enum:["JWT"]},alg:{type:"string",enum:["ES256K"]}},required:["typ","alg"],additionalProperties:!0},payload:{type:"object",properties:{iss:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},required:["iss"],additionalProperties:!0},signature:{type:"string",format:"^[A-Za-z0-9_-]+$"},data:{type:"string",format:"^[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+$",description:"."}},required:["signature","data"]},VerificationOutput:{title:"VerificationOutput",type:"object",properties:{verification:{type:"string",enum:["success","failed"],description:"whether verification has been successful or has failed"},error:{type:"string",description:"error message if verification failed"},decodedJwt:{description:"the decoded JWT"}},required:["verification"]},ProviderData:{title:"ProviderData",description:"A JSON object with information of the DLT provider currently in use.",type:"object",properties:{provider:{type:"string",example:"did:ethr:i3m"},network:{type:"string",example:"i3m"},rpcUrl:{oneOf:[{type:"string",example:"http://95.211.3.250:8545"},{type:"array",items:{type:"string"},uniqueItems:!0,example:["http://95.211.3.249:8545","http://95.211.3.250:8545"]}]}},additionalProperties:!0},EthereumAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},did:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},IdentityData:{title:"Identity Data",type:"object",properties:{did:{type:"string",example:"did:ethr:i3m:0x03142f480f831e835822fc0cd35726844a7069d28df58fb82037f1598812e1ade8"},alias:{type:"string",example:"identity1"},provider:{type:"string",example:"did:ethr:i3m"},addresses:{type:"array",items:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},example:["0x8646cAcF516de1292be1D30AB68E7Ea51e9B1BE7"]}},required:["did"]},ApiError:{type:"object",title:"Error",required:["code","message"],properties:{code:{type:"integer",format:"int32"},message:{type:"string"}}},JwkPair:{type:"object",properties:{privateJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents a private key (complementary to `publicJwk`)\n",example:'{"alg":"ES256","crv":"P-256","d":"rQp_3eZzvXwt1sK7WWsRhVYipqNGblzYDKKaYirlqs0","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'},publicJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents the public key (complementary to `privateJwk`).\n",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'}},required:["privateJwk","publicJwk"]},CompactJWS:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"},DataExchangeAgreement:{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},DataSharingAgreement:{type:"object",required:["dataOfferingDescription","parties","purpose","duration","intendedUse","licenseGrant","dataStream","personalData","pricingModel","dataExchangeAgreement","signatures"],properties:{dataOfferingDescription:{type:"object",required:["dataOfferingId","version","active"],properties:{dataOfferingId:{type:"string"},version:{type:"integer"},category:{type:"string"},active:{type:"boolean"},title:{type:"string"}}},parties:{type:"object",required:["providerDid","consumerDid"],properties:{providerDid:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},consumerDid:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}}},purpose:{type:"string"},duration:{type:"object",required:["creationDate","startDate","endDate"],properties:{creationDate:{type:"integer"},startDate:{type:"integer"},endDate:{type:"integer"}}},intendedUse:{type:"object",required:["processData","shareDataWithThirdParty","editData"],properties:{processData:{type:"boolean"},shareDataWithThirdParty:{type:"boolean"},editData:{type:"boolean"}}},licenseGrant:{type:"object",required:["transferable","exclusiveness","paidUp","revocable","processing","modifying","analyzing","storingData","storingCopy","reproducing","distributing","loaning","selling","renting","furtherLicensing","leasing"],properties:{transferable:{type:"boolean"},exclusiveness:{type:"boolean"},paidUp:{type:"boolean"},revocable:{type:"boolean"},processing:{type:"boolean"},modifying:{type:"boolean"},analyzing:{type:"boolean"},storingData:{type:"boolean"},storingCopy:{type:"boolean"},reproducing:{type:"boolean"},distributing:{type:"boolean"},loaning:{type:"boolean"},selling:{type:"boolean"},renting:{type:"boolean"},furtherLicensing:{type:"boolean"},leasing:{type:"boolean"}}},dataStream:{type:"boolean"},personalData:{type:"boolean"},pricingModel:{type:"object",required:["basicPrice","currency","hasFreePrice"],properties:{paymentType:{type:"string"},pricingModelName:{type:"string"},basicPrice:{type:"number",format:"float"},currency:{type:"string"},fee:{type:"number",format:"float"},hasPaymentOnSubscription:{type:"object",properties:{paymentOnSubscriptionName:{type:"string"},paymentType:{type:"string"},timeDuration:{type:"string"},description:{type:"string"},repeat:{type:"string"},hasSubscriptionPrice:{type:"number"}}},hasFreePrice:{type:"object",properties:{hasPriceFree:{type:"boolean"}}}}},dataExchangeAgreement:{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},signatures:{type:"object",required:["providerSignature","consumerSignature"],properties:{providerSignature:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"},consumerSignature:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"}}}}},DataExchange:{allOf:[{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},{type:"object",properties:{cipherblockDgst:{type:"string",description:"hash of the cipherblock in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"},blockCommitment:{type:"string",description:"hash of the plaintext block in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"},secretCommitment:{type:"string",description:"ash of the secret that can be used to decrypt the block in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"}},required:["cipherblockDgst","blockCommitment","secretCommitment"]}]}}},$p={exports:{}},Dp={},Bp={},Fp={},zp={},Up={},Lp={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;class t{}e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class r extends t{constructor(t){if(super(),!e.IDENTIFIER.test(t))throw new Error("CodeGen: name must be a valid identifier");this.str=t}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=r;class n 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,t)=>`${e}${t}`),"")}get names(){var e;return null!==(e=this._names)&&void 0!==e?e:this._names=this._items.reduce(((e,t)=>(t instanceof r&&(e[t.str]=(e[t.str]||0)+1),e)),{})}}function i(e,...t){const r=[e[0]];let i=0;for(;i{if(void 0===r.scopePath)throw new Error(`CodeGen: name "${r}" has no value`);return t._`${e}${r.scopePath}`}))}scopeCode(e=this._values,t,r){return this._reduceValues(e,(e=>{if(void 0===e.value)throw new Error(`CodeGen: name "${e}" has no value`);return e.value.code}),t,r)}_reduceValues(i,o,a={},s){let c=t.nil;for(const u in i){const f=i[u];if(!f)continue;const d=a[u]=a[u]||new Map;f.forEach((i=>{if(d.has(i))return;d.set(i,n.Started);let a=o(i);if(a){const r=this.opts.es5?e.varKinds.var:e.varKinds.const;c=t._`${c}${r} ${i} = ${a};${this.opts._n}`}else{if(!(a=null==s?void 0:s(i)))throw new r(i);c=t._`${c}${a}${this.opts._n}`}d.set(i,n.Completed)}))}return c}}}(qp),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;const t=Lp,r=qp;var n=Lp;Object.defineProperty(e,"_",{enumerable:!0,get:function(){return n._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return n.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return n.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return n.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return n.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return n.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return n.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return n.Name}});var i=qp;Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return i.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return i.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return i.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return i.varKinds}}),e.operators={GT:new t._Code(">"),GTE:new t._Code(">="),LT:new t._Code("<"),LTE:new t._Code("<="),EQ:new t._Code("==="),NEQ:new t._Code("!=="),NOT:new t._Code("!"),OR:new t._Code("||"),AND:new t._Code("&&"),ADD:new t._Code("+")};class o{optimizeNodes(){return this}optimizeNames(e,t){return this}}class a extends o{constructor(e,t,r){super(),this.varKind=e,this.name=t,this.rhs=r}render({es5:e,_n:t}){const n=e?r.varKinds.var:this.varKind,i=void 0===this.rhs?"":` = ${this.rhs}`;return`${n} ${this.name}${i};`+t}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&(this.rhs=C(this.rhs,e,t)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class s extends o{constructor(e,t,r){super(),this.lhs=e,this.rhs=t,this.sideEffects=r}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof t.Name)||e[this.lhs.str]||this.sideEffects)return this.rhs=C(this.rhs,e,r),this}get names(){return M(this.lhs instanceof t.Name?{}:{...this.lhs.names},this.rhs)}}class c extends s{constructor(e,t,r,n){super(e,r,n),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class u extends o{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class f extends o{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class d extends o{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class l extends o{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=C(this.code,e,t),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class h extends o{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce(((t,r)=>t+r.render(e)),"")}optimizeNodes(){const{nodes:e}=this;let t=e.length;for(;t--;){const r=e[t].optimizeNodes();Array.isArray(r)?e.splice(t,1,...r):r?e[t]=r:e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){const{nodes:r}=this;let n=r.length;for(;n--;){const i=r[n];i.optimizeNames(e,t)||(I(e,i.names),r.splice(n,1))}return r.length>0?this:void 0}get names(){return this.nodes.reduce(((e,t)=>k(e,t.names)),{})}}class p extends h{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class m extends h{}class g extends p{}g.kind="else";class y extends p{constructor(e,t){super(t),this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);return this.else&&(t+="else "+this.else.render(e)),t}optimizeNodes(){super.optimizeNodes();const e=this.condition;if(!0===e)return this.nodes;let t=this.else;if(t){const e=t.optimizeNodes();t=this.else=Array.isArray(e)?new g(e):e}return t?!1===e?t instanceof y?t:t.nodes:this.nodes.length?this:new y(R(e),t instanceof y?[t]:t.nodes):!1!==e&&this.nodes.length?this:void 0}optimizeNames(e,t){var r;if(this.else=null===(r=this.else)||void 0===r?void 0:r.optimizeNames(e,t),super.optimizeNames(e,t)||this.else)return this.condition=C(this.condition,e,t),this}get names(){const e=super.names;return M(e,this.condition),this.else&&k(e,this.else.names),e}}y.kind="if";class b extends p{}b.kind="for";class v extends b{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iteration=C(this.iteration,e,t),this}get names(){return k(super.names,this.iteration.names)}}class w extends b{constructor(e,t,r,n){super(),this.varKind=e,this.name=t,this.from=r,this.to=n}render(e){const t=e.es5?r.varKinds.var:this.varKind,{name:n,from:i,to:o}=this;return`for(${t} ${n}=${i}; ${n}<${o}; ${n}++)`+super.render(e)}get names(){const e=M(super.names,this.from);return M(e,this.to)}}class A extends b{constructor(e,t,r,n){super(),this.loop=e,this.varKind=t,this.name=r,this.iterable=n}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iterable=C(this.iterable,e,t),this}get names(){return k(super.names,this.iterable.names)}}class _ extends p{constructor(e,t,r){super(),this.name=e,this.args=t,this.async=r}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}}_.kind="func";class E extends h{render(e){return"return "+super.render(e)}}E.kind="return";class S extends p{render(e){let t="try"+super.render(e);return this.catch&&(t+=this.catch.render(e)),this.finally&&(t+=this.finally.render(e)),t}optimizeNodes(){var e,t;return super.optimizeNodes(),null===(e=this.catch)||void 0===e||e.optimizeNodes(),null===(t=this.finally)||void 0===t||t.optimizeNodes(),this}optimizeNames(e,t){var r,n;return super.optimizeNames(e,t),null===(r=this.catch)||void 0===r||r.optimizeNames(e,t),null===(n=this.finally)||void 0===n||n.optimizeNames(e,t),this}get names(){const e=super.names;return this.catch&&k(e,this.catch.names),this.finally&&k(e,this.finally.names),e}}class P extends p{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}P.kind="catch";class x extends p{render(e){return"finally"+super.render(e)}}x.kind="finally";function k(e,t){for(const r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function M(e,r){return r instanceof t._CodeOrName?k(e,r.names):e}function C(e,r,n){return e instanceof t.Name?i(e):function(e){return e instanceof t._Code&&e._items.some((e=>e instanceof t.Name&&1===r[e.str]&&void 0!==n[e.str]))}(e)?new t._Code(e._items.reduce(((e,r)=>(r instanceof t.Name&&(r=i(r)),r instanceof t._Code?e.push(...r._items):e.push(r),e)),[])):e;function i(e){const t=n[e.str];return void 0===t||1!==r[e.str]?e:(delete r[e.str],t)}}function I(e,t){for(const r in t)e[r]=(e[r]||0)-(t[r]||0)}function R(e){return"boolean"==typeof e||"number"==typeof e||null===e?!e:t._`!${j(e)}`}e.CodeGen=class{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?"\n":""},this._extScope=e,this._scope=new r.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,t){const r=this._extScope.value(e,t);return(this._values[r.prefix]||(this._values[r.prefix]=new Set)).add(r),r}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,r,n){const i=this._scope.toName(t);return void 0!==r&&n&&(this._constants[i.str]=r),this._leafNode(new a(e,i,r)),i}const(e,t,n){return this._def(r.varKinds.const,e,t,n)}let(e,t,n){return this._def(r.varKinds.let,e,t,n)}var(e,t,n){return this._def(r.varKinds.var,e,t,n)}assign(e,t,r){return this._leafNode(new s(e,t,r))}add(t,r){return this._leafNode(new c(t,e.operators.ADD,r))}code(e){return"function"==typeof e?e():e!==t.nil&&this._leafNode(new l(e)),this}object(...e){const r=["{"];for(const[n,i]of e)r.length>1&&r.push(","),r.push(n),(n!==i||this.opts.es5)&&(r.push(":"),(0,t.addCodeArg)(r,i));return r.push("}"),new t._Code(r)}if(e,t,r){if(this._blockNode(new y(e)),t&&r)this.code(t).else().code(r).endIf();else if(t)this.code(t).endIf();else if(r)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new y(e))}else(){return this._elseNode(new g)}endIf(){return this._endBlockNode(y,g)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new v(e),t)}forRange(e,t,n,i,o=(this.opts.es5?r.varKinds.var:r.varKinds.let)){const a=this._scope.toName(e);return this._for(new w(o,a,t,n),(()=>i(a)))}forOf(e,n,i,o=r.varKinds.const){const a=this._scope.toName(e);if(this.opts.es5){const e=n instanceof t.Name?n:this.var("_arr",n);return this.forRange("_i",0,t._`${e}.length`,(r=>{this.var(a,t._`${e}[${r}]`),i(a)}))}return this._for(new A("of",o,a,n),(()=>i(a)))}forIn(e,n,i,o=(this.opts.es5?r.varKinds.var:r.varKinds.const)){if(this.opts.ownProperties)return this.forOf(e,t._`Object.keys(${n})`,i);const a=this._scope.toName(e);return this._for(new A("in",o,a,n),(()=>i(a)))}endFor(){return this._endBlockNode(b)}label(e){return this._leafNode(new u(e))}break(e){return this._leafNode(new f(e))}return(e){const t=new E;if(this._blockNode(t),this.code(e),1!==t.nodes.length)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(E)}try(e,t,r){if(!t&&!r)throw new Error('CodeGen: "try" without "catch" and "finally"');const n=new S;if(this._blockNode(n),this.code(e),t){const e=this.name("e");this._currNode=n.catch=new P(e),t(e)}return r&&(this._currNode=n.finally=new x,this.code(r)),this._endBlockNode(P,x)}throw(e){return this._leafNode(new d(e))}block(e,t){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(t),this}endBlock(e){const t=this._blockStarts.pop();if(void 0===t)throw new Error("CodeGen: not in self-balancing block");const r=this._nodes.length-t;if(r<0||void 0!==e&&r!==e)throw new Error(`CodeGen: wrong number of nodes: ${r} vs ${e} expected`);return this._nodes.length=t,this}func(e,r=t.nil,n,i){return this._blockNode(new _(e,r,n)),i&&this.code(i).endFunc(),this}endFunc(){return this._endBlockNode(_)}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,t){const r=this._currNode;if(r instanceof e||t&&r instanceof t)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){const t=this._currNode;if(!(t instanceof y))throw new Error('CodeGen: "else" without "if"');return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){const e=this._nodes;return e[e.length-1]}set _currNode(e){const t=this._nodes;t[t.length-1]=e}},e.not=R;const N=T(e.operators.AND);e.and=function(...e){return e.reduce(N)};const O=T(e.operators.OR);function T(e){return(r,n)=>r===t.nil?n:n===t.nil?r:t._`${j(r)} ${e} ${j(n)}`}function j(e){return e instanceof t.Name?e:t._`(${e})`}e.or=function(...e){return e.reduce(O)}}(Up);var Hp={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.checkStrictMode=e.getErrorPath=e.Type=e.useFunc=e.setEvaluated=e.evaluatedPropsToName=e.mergeEvaluated=e.eachItem=e.unescapeJsonPointer=e.escapeJsonPointer=e.escapeFragment=e.unescapeFragment=e.schemaRefOrVal=e.schemaHasRulesButRef=e.schemaHasRules=e.checkUnknownRules=e.alwaysValidSchema=e.toHash=void 0;const t=Up,r=Lp;function n(e,t=e.schema){const{opts:r,self:n}=e;if(!r.strictSchema)return;if("boolean"==typeof t)return;const i=n.RULES.keywords;for(const r in t)i[r]||l(e,`unknown keyword: "${r}"`)}function i(e,t){if("boolean"==typeof e)return!e;for(const r in e)if(t[r])return!0;return!1}function o(e){return"number"==typeof e?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}function a(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function s({mergeNames:e,mergeToName:r,mergeValues:n,resultToName:i}){return(o,a,s,c)=>{const u=void 0===s?a:s instanceof t.Name?(a instanceof t.Name?e(o,a,s):r(o,a,s),s):a instanceof t.Name?(r(o,s,a),a):n(a,s);return c!==t.Name||u instanceof t.Name?u:i(o,u)}}function c(e,r){if(!0===r)return e.var("props",!0);const n=e.var("props",t._`{}`);return void 0!==r&&u(e,n,r),n}function u(e,r,n){Object.keys(n).forEach((n=>e.assign(t._`${r}${(0,t.getProperty)(n)}`,!0)))}e.toHash=function(e){const t={};for(const r of e)t[r]=!0;return t},e.alwaysValidSchema=function(e,t){return"boolean"==typeof t?t:0===Object.keys(t).length||(n(e,t),!i(t,e.self.RULES.all))},e.checkUnknownRules=n,e.schemaHasRules=i,e.schemaHasRulesButRef=function(e,t){if("boolean"==typeof e)return!e;for(const r in e)if("$ref"!==r&&t.all[r])return!0;return!1},e.schemaRefOrVal=function({topSchemaRef:e,schemaPath:r},n,i,o){if(!o){if("number"==typeof n||"boolean"==typeof n)return n;if("string"==typeof n)return t._`${n}`}return t._`${e}${r}${(0,t.getProperty)(i)}`},e.unescapeFragment=function(e){return a(decodeURIComponent(e))},e.escapeFragment=function(e){return encodeURIComponent(o(e))},e.escapeJsonPointer=o,e.unescapeJsonPointer=a,e.eachItem=function(e,t){if(Array.isArray(e))for(const r of e)t(r);else t(e)},e.mergeEvaluated={props:s({mergeNames:(e,r,n)=>e.if(t._`${n} !== true && ${r} !== undefined`,(()=>{e.if(t._`${r} === true`,(()=>e.assign(n,!0)),(()=>e.assign(n,t._`${n} || {}`).code(t._`Object.assign(${n}, ${r})`)))})),mergeToName:(e,r,n)=>e.if(t._`${n} !== true`,(()=>{!0===r?e.assign(n,!0):(e.assign(n,t._`${n} || {}`),u(e,n,r))})),mergeValues:(e,t)=>!0===e||{...e,...t},resultToName:c}),items:s({mergeNames:(e,r,n)=>e.if(t._`${n} !== true && ${r} !== undefined`,(()=>e.assign(n,t._`${r} === true ? true : ${n} > ${r} ? ${n} : ${r}`))),mergeToName:(e,r,n)=>e.if(t._`${n} !== true`,(()=>e.assign(n,!0===r||t._`${n} > ${r} ? ${n} : ${r}`))),mergeValues:(e,t)=>!0===e||Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})},e.evaluatedPropsToName=c,e.setEvaluated=u;const f={};var d;function l(e,t,r=e.opts.strictSchema){if(r){if(t=`strict mode: ${t}`,!0===r)throw new Error(t);e.self.logger.warn(t)}}e.useFunc=function(e,t){return e.scopeValue("func",{ref:t,code:f[t.code]||(f[t.code]=new r._Code(t.code))})},function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"}(d=e.Type||(e.Type={})),e.getErrorPath=function(e,r,n){if(e instanceof t.Name){const i=r===d.Num;return n?i?t._`"[" + ${e} + "]"`:t._`"['" + ${e} + "']"`:i?t._`"/" + ${e}`:t._`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return n?(0,t.getProperty)(e).toString():"/"+o(e)},e.checkStrictMode=l}(Hp);var Kp={};Object.defineProperty(Kp,"__esModule",{value:!0});const Jp=Up,Wp={data:new Jp.Name("data"),valCxt:new Jp.Name("valCxt"),instancePath:new Jp.Name("instancePath"),parentData:new Jp.Name("parentData"),parentDataProperty:new Jp.Name("parentDataProperty"),rootData:new Jp.Name("rootData"),dynamicAnchors:new Jp.Name("dynamicAnchors"),vErrors:new Jp.Name("vErrors"),errors:new Jp.Name("errors"),this:new Jp.Name("this"),self:new Jp.Name("self"),scope:new Jp.Name("scope"),json:new Jp.Name("json"),jsonPos:new Jp.Name("jsonPos"),jsonLen:new Jp.Name("jsonLen"),jsonPart:new Jp.Name("jsonPart")};Kp.default=Wp,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;const t=Up,r=Hp,n=Kp;function i(e,r){const i=e.const("err",r);e.if(t._`${n.default.vErrors} === null`,(()=>e.assign(n.default.vErrors,t._`[${i}]`)),t._`${n.default.vErrors}.push(${i})`),e.code(t._`${n.default.errors}++`)}function o(e,r){const{gen:n,validateName:i,schemaEnv:o}=e;o.$async?n.throw(t._`new ${e.ValidationError}(${r})`):(n.assign(t._`${i}.errors`,r),n.return(!1))}e.keywordError={message:({keyword:e})=>t.str`must pass "${e}" keyword validation`},e.keyword$DataError={message:({keyword:e,schemaType:r})=>r?t.str`"${e}" keyword must be ${r} ($data)`:t.str`"${e}" keyword is invalid ($data)`},e.reportError=function(r,n=e.keywordError,a,c){const{it:u}=r,{gen:f,compositeRule:d,allErrors:l}=u,h=s(r,n,a);(null!=c?c:d||l)?i(f,h):o(u,t._`[${h}]`)},e.reportExtraError=function(t,r=e.keywordError,a){const{it:c}=t,{gen:u,compositeRule:f,allErrors:d}=c;i(u,s(t,r,a)),f||d||o(c,n.default.vErrors)},e.resetErrorsCount=function(e,r){e.assign(n.default.errors,r),e.if(t._`${n.default.vErrors} !== null`,(()=>e.if(r,(()=>e.assign(t._`${n.default.vErrors}.length`,r)),(()=>e.assign(n.default.vErrors,null)))))},e.extendErrors=function({gen:e,keyword:r,schemaValue:i,data:o,errsCount:a,it:s}){if(void 0===a)throw new Error("ajv implementation error");const c=e.name("err");e.forRange("i",a,n.default.errors,(a=>{e.const(c,t._`${n.default.vErrors}[${a}]`),e.if(t._`${c}.instancePath === undefined`,(()=>e.assign(t._`${c}.instancePath`,(0,t.strConcat)(n.default.instancePath,s.errorPath)))),e.assign(t._`${c}.schemaPath`,t.str`${s.errSchemaPath}/${r}`),s.opts.verbose&&(e.assign(t._`${c}.schema`,i),e.assign(t._`${c}.data`,o))}))};const a={keyword:new t.Name("keyword"),schemaPath:new t.Name("schemaPath"),params:new t.Name("params"),propertyName:new t.Name("propertyName"),message:new t.Name("message"),schema:new t.Name("schema"),parentSchema:new t.Name("parentSchema")};function s(e,r,i){const{createErrors:o}=e.it;return!1===o?t._`{}`:function(e,r,i={}){const{gen:o,it:s}=e,f=[c(s,i),u(e,i)];return function(e,{params:r,message:i},o){const{keyword:s,data:c,schemaValue:u,it:f}=e,{opts:d,propertyName:l,topSchemaRef:h,schemaPath:p}=f;o.push([a.keyword,s],[a.params,"function"==typeof r?r(e):r||t._`{}`]),d.messages&&o.push([a.message,"function"==typeof i?i(e):i]);d.verbose&&o.push([a.schema,u],[a.parentSchema,t._`${h}${p}`],[n.default.data,c]);l&&o.push([a.propertyName,l])}(e,r,f),o.object(...f)}(e,r,i)}function c({errorPath:e},{instancePath:i}){const o=i?t.str`${e}${(0,r.getErrorPath)(i,r.Type.Str)}`:e;return[n.default.instancePath,(0,t.strConcat)(n.default.instancePath,o)]}function u({keyword:e,it:{errSchemaPath:n}},{schemaPath:i,parentSchema:o}){let s=o?n:t.str`${n}/${e}`;return i&&(s=t.str`${s}${(0,r.getErrorPath)(i,r.Type.Str)}`),[a.schemaPath,s]}}(zp),Object.defineProperty(Fp,"__esModule",{value:!0}),Fp.boolOrEmptySchema=Fp.topBoolOrEmptySchema=void 0;const Gp=zp,Vp=Up,Zp=Kp,Xp={message:"boolean schema is false"};function Qp(e,t){const{gen:r,data:n}=e,i={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,Gp.reportError)(i,Xp,void 0,t)}Fp.topBoolOrEmptySchema=function(e){const{gen:t,schema:r,validateName:n}=e;!1===r?Qp(e,!1):"object"==typeof r&&!0===r.$async?t.return(Zp.default.data):(t.assign(Vp._`${n}.errors`,null),t.return(!0))},Fp.boolOrEmptySchema=function(e,t){const{gen:r,schema:n}=e;!1===n?(r.var(t,!1),Qp(e)):r.var(t,!0)};var Yp={},em={};Object.defineProperty(em,"__esModule",{value:!0}),em.getRules=em.isJSONType=void 0;const tm=new Set(["string","number","integer","boolean","null","object","array"]);em.isJSONType=function(e){return"string"==typeof e&&tm.has(e)},em.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:{}}};var rm={};function nm(e,t){return t.rules.some((t=>im(e,t)))}function im(e,t){var r;return void 0!==e[t.keyword]||(null===(r=t.definition.implements)||void 0===r?void 0:r.some((t=>void 0!==e[t])))}Object.defineProperty(rm,"__esModule",{value:!0}),rm.shouldUseRule=rm.shouldUseGroup=rm.schemaHasRulesForType=void 0,rm.schemaHasRulesForType=function({schema:e,self:t},r){const n=t.RULES.types[r];return n&&!0!==n&&nm(e,n)},rm.shouldUseGroup=nm,rm.shouldUseRule=im,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.reportTypeError=e.checkDataTypes=e.checkDataType=e.coerceAndCheckDataType=e.getJSONTypes=e.getSchemaTypes=e.DataType=void 0;const t=em,r=rm,n=zp,i=Up,o=Hp;var a;function s(e){const r=Array.isArray(e)?e:e?[e]:[];if(r.every(t.isJSONType))return r;throw new Error("type must be JSONType or JSONType[]: "+r.join(","))}!function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"}(a=e.DataType||(e.DataType={})),e.getSchemaTypes=function(e){const t=s(e.type);if(t.includes("null")){if(!1===e.nullable)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&void 0!==e.nullable)throw new Error('"nullable" cannot be used without "type"');!0===e.nullable&&t.push("null")}return t},e.getJSONTypes=s,e.coerceAndCheckDataType=function(e,t){const{gen:n,data:o,opts:s}=e,u=function(e,t){return t?e.filter((e=>c.has(e)||"array"===t&&"array"===e)):[]}(t,s.coerceTypes),d=t.length>0&&!(0===u.length&&1===t.length&&(0,r.schemaHasRulesForType)(e,t[0]));if(d){const r=f(t,o,s.strictNumbers,a.Wrong);n.if(r,(()=>{u.length?function(e,t,r){const{gen:n,data:o,opts:a}=e,s=n.let("dataType",i._`typeof ${o}`),u=n.let("coerced",i._`undefined`);"array"===a.coerceTypes&&n.if(i._`${s} == 'object' && Array.isArray(${o}) && ${o}.length == 1`,(()=>n.assign(o,i._`${o}[0]`).assign(s,i._`typeof ${o}`).if(f(t,o,a.strictNumbers),(()=>n.assign(u,o)))));n.if(i._`${u} !== undefined`);for(const e of r)(c.has(e)||"array"===e&&"array"===a.coerceTypes)&&d(e);function d(e){switch(e){case"string":return void n.elseIf(i._`${s} == "number" || ${s} == "boolean"`).assign(u,i._`"" + ${o}`).elseIf(i._`${o} === null`).assign(u,i._`""`);case"number":return void n.elseIf(i._`${s} == "boolean" || ${o} === null + */rs=ns,function(){var e="input is invalid type",t="object"==typeof window,r=t?window:{};r.JS_SHA3_NO_WINDOW&&(t=!1);var n=!t&&"object"==typeof self;!r.JS_SHA3_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node?r=c:n&&(r=self);var i=!r.JS_SHA3_NO_COMMON_JS&&rs.exports,o=!r.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,a="0123456789abcdef".split(""),s=[4,1024,262144,67108864],u=[0,8,16,24],f=[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],d=[224,256,384,512],l=[128,256],h=["hex","buffer","arrayBuffer","array","digest"],p={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 m=function(e,t,r){return function(n){return new I(e,t,e).update(n)[r]()}},g=function(e,t,r){return function(n,i){return new I(e,t,i).update(n)[r]()}},y=function(e,t,r){return function(t,n,i,o){return _["cshake"+e].update(t,n,i,o)[r]()}},b=function(e,t,r){return function(t,n,i,o){return _["kmac"+e].update(t,n,i,o)[r]()}},v=function(e,t,r,n){for(var i=0;i>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var n=0;n<50;++n)this.s[n]=0}function R(e,t,r){I.call(this,e,t,r)}I.prototype.update=function(t){if(this.finalized)throw new Error("finalize already called");var r,n=typeof t;if("string"!==n){if("object"!==n)throw new Error(e);if(null===t)throw new Error(e);if(o&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||o&&ArrayBuffer.isView(t)))throw new Error(e);r=!0}for(var i,a,s=this.blocks,c=this.byteCount,f=t.length,d=this.blockCount,l=0,h=this.s;l>2]|=t[l]<>2]|=a<>2]|=(192|a>>6)<>2]|=(128|63&a)<=57344?(s[i>>2]|=(224|a>>12)<>2]|=(128|a>>6&63)<>2]|=(128|63&a)<>2]|=(240|a>>18)<>2]|=(128|a>>12&63)<>2]|=(128|a>>6&63)<>2]|=(128|63&a)<=c){for(this.start=i-c,this.block=s[d],i=0;i>=8);r>0;)i.unshift(r),r=255&(e>>=8),++n;return t?i.push(n):i.unshift(n),this.update(i),i.length},I.prototype.encodeString=function(t){var r,n=typeof t;if("string"!==n){if("object"!==n)throw new Error(e);if(null===t)throw new Error(e);if(o&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||o&&ArrayBuffer.isView(t)))throw new Error(e);r=!0}var i=0,a=t.length;if(r)i=a;else for(var s=0;s=57344?i+=3:(c=65536+((1023&c)<<10|1023&t.charCodeAt(++s)),i+=4)}return i+=this.encode(8*i),this.update(t),i},I.prototype.bytepad=function(e,t){for(var r=this.encode(t),n=0;n>2]|=this.padding[3&t],this.lastByteIndex===this.byteCount)for(e[0]=e[r],t=1;t>4&15]+a[15&e]+a[e>>12&15]+a[e>>8&15]+a[e>>20&15]+a[e>>16&15]+a[e>>28&15]+a[e>>24&15];s%t==0&&(N(r),o=0)}return i&&(e=r[o],c+=a[e>>4&15]+a[15&e],i>1&&(c+=a[e>>12&15]+a[e>>8&15]),i>2&&(c+=a[e>>20&15]+a[e>>16&15])),c},I.prototype.arrayBuffer=function(){this.finalize();var e,t=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,a=0,s=this.outputBits>>3;e=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(s);for(var c=new Uint32Array(e);a>8&255,c[e+2]=t>>16&255,c[e+3]=t>>24&255;s%r==0&&N(n)}return o&&(e=s<<2,t=n[a],c[e]=255&t,o>1&&(c[e+1]=t>>8&255),o>2&&(c[e+2]=t>>16&255)),c},R.prototype=new I,R.prototype.finalize=function(){return this.encode(this.outputBits,!0),I.prototype.finalize.call(this)};var N=function(e){var t,r,n,i,o,a,s,c,u,d,l,h,p,m,g,y,b,v,w,A,_,E,S,P,x,k,M,C,I,R,N,O,T,j,$,D,B,F,z,U,L,q,H,K,J,W,G,V,Z,X,Q,Y,ee,te,re,ne,ie,oe,ae,se,ce,ue,fe;for(n=0;n<48;n+=2)i=e[0]^e[10]^e[20]^e[30]^e[40],o=e[1]^e[11]^e[21]^e[31]^e[41],a=e[2]^e[12]^e[22]^e[32]^e[42],s=e[3]^e[13]^e[23]^e[33]^e[43],c=e[4]^e[14]^e[24]^e[34]^e[44],u=e[5]^e[15]^e[25]^e[35]^e[45],d=e[6]^e[16]^e[26]^e[36]^e[46],l=e[7]^e[17]^e[27]^e[37]^e[47],t=(h=e[8]^e[18]^e[28]^e[38]^e[48])^(a<<1|s>>>31),r=(p=e[9]^e[19]^e[29]^e[39]^e[49])^(s<<1|a>>>31),e[0]^=t,e[1]^=r,e[10]^=t,e[11]^=r,e[20]^=t,e[21]^=r,e[30]^=t,e[31]^=r,e[40]^=t,e[41]^=r,t=i^(c<<1|u>>>31),r=o^(u<<1|c>>>31),e[2]^=t,e[3]^=r,e[12]^=t,e[13]^=r,e[22]^=t,e[23]^=r,e[32]^=t,e[33]^=r,e[42]^=t,e[43]^=r,t=a^(d<<1|l>>>31),r=s^(l<<1|d>>>31),e[4]^=t,e[5]^=r,e[14]^=t,e[15]^=r,e[24]^=t,e[25]^=r,e[34]^=t,e[35]^=r,e[44]^=t,e[45]^=r,t=c^(h<<1|p>>>31),r=u^(p<<1|h>>>31),e[6]^=t,e[7]^=r,e[16]^=t,e[17]^=r,e[26]^=t,e[27]^=r,e[36]^=t,e[37]^=r,e[46]^=t,e[47]^=r,t=d^(i<<1|o>>>31),r=l^(o<<1|i>>>31),e[8]^=t,e[9]^=r,e[18]^=t,e[19]^=r,e[28]^=t,e[29]^=r,e[38]^=t,e[39]^=r,e[48]^=t,e[49]^=r,m=e[0],g=e[1],W=e[11]<<4|e[10]>>>28,G=e[10]<<4|e[11]>>>28,C=e[20]<<3|e[21]>>>29,I=e[21]<<3|e[20]>>>29,se=e[31]<<9|e[30]>>>23,ce=e[30]<<9|e[31]>>>23,q=e[40]<<18|e[41]>>>14,H=e[41]<<18|e[40]>>>14,j=e[2]<<1|e[3]>>>31,$=e[3]<<1|e[2]>>>31,y=e[13]<<12|e[12]>>>20,b=e[12]<<12|e[13]>>>20,V=e[22]<<10|e[23]>>>22,Z=e[23]<<10|e[22]>>>22,R=e[33]<<13|e[32]>>>19,N=e[32]<<13|e[33]>>>19,ue=e[42]<<2|e[43]>>>30,fe=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,re=e[4]<<30|e[5]>>>2,D=e[14]<<6|e[15]>>>26,B=e[15]<<6|e[14]>>>26,v=e[25]<<11|e[24]>>>21,w=e[24]<<11|e[25]>>>21,X=e[34]<<15|e[35]>>>17,Q=e[35]<<15|e[34]>>>17,O=e[45]<<29|e[44]>>>3,T=e[44]<<29|e[45]>>>3,P=e[6]<<28|e[7]>>>4,x=e[7]<<28|e[6]>>>4,ne=e[17]<<23|e[16]>>>9,ie=e[16]<<23|e[17]>>>9,F=e[26]<<25|e[27]>>>7,z=e[27]<<25|e[26]>>>7,A=e[36]<<21|e[37]>>>11,_=e[37]<<21|e[36]>>>11,Y=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,K=e[8]<<27|e[9]>>>5,J=e[9]<<27|e[8]>>>5,k=e[18]<<20|e[19]>>>12,M=e[19]<<20|e[18]>>>12,oe=e[29]<<7|e[28]>>>25,ae=e[28]<<7|e[29]>>>25,U=e[38]<<8|e[39]>>>24,L=e[39]<<8|e[38]>>>24,E=e[48]<<14|e[49]>>>18,S=e[49]<<14|e[48]>>>18,e[0]=m^~y&v,e[1]=g^~b&w,e[10]=P^~k&C,e[11]=x^~M&I,e[20]=j^~D&F,e[21]=$^~B&z,e[30]=K^~W&V,e[31]=J^~G&Z,e[40]=te^~ne&oe,e[41]=re^~ie&ae,e[2]=y^~v&A,e[3]=b^~w&_,e[12]=k^~C&R,e[13]=M^~I&N,e[22]=D^~F&U,e[23]=B^~z&L,e[32]=W^~V&X,e[33]=G^~Z&Q,e[42]=ne^~oe&se,e[43]=ie^~ae&ce,e[4]=v^~A&E,e[5]=w^~_&S,e[14]=C^~R&O,e[15]=I^~N&T,e[24]=F^~U&q,e[25]=z^~L&H,e[34]=V^~X&Y,e[35]=Z^~Q&ee,e[44]=oe^~se&ue,e[45]=ae^~ce&fe,e[6]=A^~E&m,e[7]=_^~S&g,e[16]=R^~O&P,e[17]=N^~T&x,e[26]=U^~q&j,e[27]=L^~H&$,e[36]=X^~Y&K,e[37]=Q^~ee&J,e[46]=se^~ue&te,e[47]=ce^~fe&re,e[8]=E^~m&y,e[9]=S^~g&b,e[18]=O^~P&k,e[19]=T^~x&M,e[28]=q^~j&D,e[29]=H^~$&B,e[38]=Y^~K&W,e[39]=ee^~J&G,e[48]=ue^~te&ne,e[49]=fe^~re&ie,e[0]^=f[n],e[1]^=f[n+1]};if(i)rs.exports=_;else for(S=0;S>=8;return t}function us(e,t,r){let n=0;for(let i=0;it+1+n&&ss.throwError("child data too short",wo.errors.BUFFER_OVERRUN,{})}return{consumed:1+n,result:i}}function hs(e,t){if(0===e.length&&ss.throwError("data too short",wo.errors.BUFFER_OVERRUN,{}),e[t]>=248){const r=e[t]-247;t+1+r>e.length&&ss.throwError("data short segment too short",wo.errors.BUFFER_OVERRUN,{});const n=us(e,t+1,r);return t+1+r+n>e.length&&ss.throwError("data long segment too short",wo.errors.BUFFER_OVERRUN,{}),ls(e,t,t+1+r,r+n)}if(e[t]>=192){const r=e[t]-192;return t+1+r>e.length&&ss.throwError("data array too short",wo.errors.BUFFER_OVERRUN,{}),ls(e,t,t+1,r)}if(e[t]>=184){const r=e[t]-183;t+1+r>e.length&&ss.throwError("data array too short",wo.errors.BUFFER_OVERRUN,{});const n=us(e,t+1,r);t+1+r+n>e.length&&ss.throwError("data array too short",wo.errors.BUFFER_OVERRUN,{});return{consumed:1+r+n,result:To(e.slice(t+1+r,t+1+r+n))}}if(e[t]>=128){const r=e[t]-128;t+1+r>e.length&&ss.throwError("data too short",wo.errors.BUFFER_OVERRUN,{});return{consumed:1+r,result:To(e.slice(t+1,t+1+r))}}return{consumed:1,result:To(e[t])}}function ps(e){const t=Mo(e),r=hs(t,0);return r.consumed!==t.length&&ss.throwArgumentError("invalid rlp data","data",e),r.result}var ms=Object.freeze({__proto__:null,decode:ps,encode:ds});const gs=new wo("address/5.7.0");function ys(e){No(e,20)||gs.throwArgumentError("invalid address","address",e);const t=(e=e.toLowerCase()).substring(2).split(""),r=new Uint8Array(40);for(let e=0;e<40;e++)r[e]=t[e].charCodeAt(0);const n=Mo(os(r));for(let e=0;e<40;e+=2)n[e>>1]>>4>=8&&(t[e]=t[e].toUpperCase()),(15&n[e>>1])>=8&&(t[e+1]=t[e+1].toUpperCase());return"0x"+t.join("")}const bs={};for(let e=0;e<10;e++)bs[String(e)]=String(e);for(let e=0;e<26;e++)bs[String.fromCharCode(65+e)]=String(10+e);const vs=Math.floor(function(e){return Math.log10?Math.log10(e):Math.log(e)/Math.LN10}(9007199254740991));function ws(e){let t=(e=(e=e.toUpperCase()).substring(4)+e.substring(0,2)+"00").split("").map((e=>bs[e])).join("");for(;t.length>=vs;){let e=t.substring(0,vs);t=parseInt(e,10)%97+t.substring(e.length)}let r=String(98-parseInt(t,10)%97);for(;r.length<2;)r="0"+r;return r}function As(e){let t=null;if("string"!=typeof e&&gs.throwArgumentError("invalid address","address",e),e.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==e.substring(0,2)&&(e="0x"+e),t=ys(e),e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==e&&gs.throwArgumentError("bad address checksum","address",e);else if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(e.substring(2,4)!==ws(e)&&gs.throwArgumentError("bad icap checksum","address",e),r=e.substring(4),t=new Ko(r,36).toString(16);t.length<40;)t="0"+t;t=ys("0x"+t)}else gs.throwArgumentError("invalid address","address",e);var r;return t}function _s(e){let t=null;try{t=As(e.from)}catch(t){gs.throwArgumentError("missing from address","transaction",e)}return As($o(os(ds([t,Io(Mo(Zo.from(e.nonce).toHexString()))])),12))}var Es=Object.freeze({__proto__:null,getAddress:As,getContractAddress:_s,getCreate2Address:function(e,t,r){return 32!==jo(t)&&gs.throwArgumentError("salt must be 32 bytes","salt",t),32!==jo(r)&&gs.throwArgumentError("initCodeHash must be 32 bytes","initCodeHash",r),As($o(os(Co(["0xff",As(e),t,r])),12))},getIcapAddress:function(e){let t=(r=As(e).substring(2),new Ko(r,16).toString(36)).toUpperCase();for(var r;t.length<30;)t="0"+t;return"XE"+ws("XE00"+t)+t},isAddress:function(e){try{return As(e),!0}catch(e){}return!1}});class Ss extends Ya{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,t){try{t=As(t)}catch(e){this._throwError(e.message,t)}return e.writeValue(t)}decode(e){return As(zo(e.readValue().toHexString(),20))}}class Ps extends Ya{constructor(e){super(e.name,e.type,void 0,e.dynamic),this.coder=e}defaultValue(){return this.coder.defaultValue()}encode(e,t){return this.coder.encode(e,t)}decode(e){return this.coder.decode(e)}}const xs=new wo(ka);function ks(e,t,r){let n=null;if(Array.isArray(r))n=r;else if(r&&"object"==typeof r){let e={};n=t.map((t=>{const n=t.localName;return n||xs.throwError("cannot encode object for signature with missing names",wo.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:r}),e[n]&&xs.throwError("cannot encode object for signature with duplicate names",wo.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:r}),e[n]=!0,r[n]}))}else xs.throwArgumentError("invalid tuple value","tuple",r);t.length!==n.length&&xs.throwArgumentError("types/value length mismatch","tuple",r);let i=new es(e.wordSize),o=new es(e.wordSize),a=[];t.forEach(((e,t)=>{let r=n[t];if(e.dynamic){let t=o.length;e.encode(o,r);let n=i.writeUpdatableValue();a.push((e=>{n(e+t)}))}else e.encode(i,r)})),a.forEach((e=>{e(i.length)}));let s=e.appendWriter(i);return s+=e.appendWriter(o),s}function Ms(e,t){let r=[],n=e.subReader(0);t.forEach((t=>{let i=null;if(t.dynamic){let r=e.readValue(),o=n.subReader(r.toNumber());try{i=t.decode(o)}catch(e){if(e.code===wo.errors.BUFFER_OVERRUN)throw e;i=e,i.baseType=t.name,i.name=t.localName,i.type=t.type}}else try{i=t.decode(e)}catch(e){if(e.code===wo.errors.BUFFER_OVERRUN)throw e;i=e,i.baseType=t.name,i.name=t.localName,i.type=t.type}null!=i&&r.push(i)}));const i=t.reduce(((e,t)=>{const r=t.localName;return r&&(e[r]||(e[r]=0),e[r]++),e}),{});t.forEach(((e,t)=>{let n=e.localName;if(!n||1!==i[n])return;if("length"===n&&(n="_length"),null!=r[n])return;const o=r[t];o instanceof Error?Object.defineProperty(r,n,{enumerable:!0,get:()=>{throw o}}):r[n]=o}));for(let e=0;e{throw t}})}return Object.freeze(r)}class Cs extends Ya{constructor(e,t,r){super("array",e.type+"["+(t>=0?t:"")+"]",r,-1===t||e.dynamic),this.coder=e,this.length=t}defaultValue(){const e=this.coder.defaultValue(),t=[];for(let r=0;re._data.length&&xs.throwError("insufficient data length",wo.errors.BUFFER_OVERRUN,{length:e._data.length,count:t}));let r=[];for(let e=0;e>6==2;n++)e++;return e}return e===qs.OVERRUN?r.length-t-1:0}!function(e){e.current="",e.NFC="NFC",e.NFD="NFD",e.NFKC="NFKC",e.NFKD="NFKD"}(Ls||(Ls={})),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"}(qs||(qs={}));const Ks=Object.freeze({error:function(e,t,r,n,i){return Us.throwArgumentError(`invalid codepoint at offset ${t}; ${e}`,"bytes",r)},ignore:Hs,replace:function(e,t,r,n,i){return e===qs.OVERLONG?(n.push(i),0):(n.push(65533),Hs(e,t,r))}});function Js(e,t){null==t&&(t=Ks.error),e=Mo(e);const r=[];let n=0;for(;n>7==0){r.push(i);continue}let o=null,a=null;if(192==(224&i))o=1,a=127;else if(224==(240&i))o=2,a=2047;else{if(240!=(248&i)){n+=t(128==(192&i)?qs.UNEXPECTED_CONTINUE:qs.BAD_PREFIX,n-1,e,r);continue}o=3,a=65535}if(n-1+o>=e.length){n+=t(qs.OVERRUN,n-1,e,r);continue}let s=i&(1<<8-o-1)-1;for(let i=0;i1114111?n+=t(qs.OUT_OF_RANGE,n-1-o,e,r,s):s>=55296&&s<=57343?n+=t(qs.UTF16_SURROGATE,n-1-o,e,r,s):s<=a?n+=t(qs.OVERLONG,n-1-o,e,r,s):r.push(s))}return r}function Ws(e,t=Ls.current){t!=Ls.current&&(Us.checkNormalize(),e=e.normalize(t));let r=[];for(let t=0;t>6|192),r.push(63&n|128);else if(55296==(64512&n)){t++;const i=e.charCodeAt(t);if(t>=e.length||56320!=(64512&i))throw new Error("invalid utf-8 string");const o=65536+((1023&n)<<10)+(1023&i);r.push(o>>18|240),r.push(o>>12&63|128),r.push(o>>6&63|128),r.push(63&o|128)}else r.push(n>>12|224),r.push(n>>6&63|128),r.push(63&n|128)}return Mo(r)}function Gs(e){const t="0000"+e.toString(16);return"\\u"+t.substring(t.length-4)}function Vs(e){return e.map((e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10&1023),56320+(1023&e))))).join("")}function Zs(e,t){return Vs(Js(e,t))}function Xs(e,t=Ls.current){return Js(Ws(e,t))}function Qs(e,t){t||(t=function(e){return[parseInt(e,16)]});let r=0,n={};return e.split(",").forEach((e=>{let i=e.split(":");r+=parseInt(i[0],16),n[r]=t(i[1])})),n}function Ys(e){let t=0;return e.split(",").map((e=>{let r=e.split("-");1===r.length?r[1]="0":""===r[1]&&(r[1]="1");let n=t+parseInt(r[0],16);return t=parseInt(r[1],16),{l:n,h:t}}))}function ec(e,t){let r=0;for(let n=0;n=r&&e<=r+i.h&&(e-r)%(i.d||1)==0){if(i.e&&-1!==i.e.indexOf(e-r))continue;return i}}return null}const tc=Ys("221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d"),rc="ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map((e=>parseInt(e,16))),nc=[{h:25,s:32,l:65},{h:30,s:32,e:[23],l:127},{h:54,s:1,e:[48],l:64,d:2},{h:14,s:1,l:57,d:2},{h:44,s:1,l:17,d:2},{h:10,s:1,e:[2,6,8],l:61,d:2},{h:16,s:1,l:68,d:2},{h:84,s:1,e:[18,24,66],l:19,d:2},{h:26,s:32,e:[17],l:435},{h:22,s:1,l:71,d:2},{h:15,s:80,l:40},{h:31,s:32,l:16},{h:32,s:1,l:80,d:2},{h:52,s:1,l:42,d:2},{h:12,s:1,l:55,d:2},{h:40,s:1,e:[38],l:15,d:2},{h:14,s:1,l:48,d:2},{h:37,s:48,l:49},{h:148,s:1,l:6351,d:2},{h:88,s:1,l:160,d:2},{h:15,s:16,l:704},{h:25,s:26,l:854},{h:25,s:32,l:55915},{h:37,s:40,l:1247},{h:25,s:-119711,l:53248},{h:25,s:-119763,l:52},{h:25,s:-119815,l:52},{h:25,s:-119867,e:[1,4,5,7,8,11,12,17],l:52},{h:25,s:-119919,l:52},{h:24,s:-119971,e:[2,7,8,17],l:52},{h:24,s:-120023,e:[2,7,13,15,16,17],l:52},{h:25,s:-120075,l:52},{h:25,s:-120127,l:52},{h:25,s:-120179,l:52},{h:25,s:-120231,l:52},{h:25,s:-120283,l:52},{h:25,s:-120335,l:52},{h:24,s:-119543,e:[17],l:56},{h:24,s:-119601,e:[17],l:58},{h:24,s:-119659,e:[17],l:58},{h:24,s:-119717,e:[17],l:58},{h:24,s:-119775,e:[17],l:58}],ic=Qs("b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3"),oc=Qs("179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7"),ac=Qs("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D",(function(e){if(e.length%4!=0)throw new Error("bad data");let t=[];for(let r=0;r{if(e<256){switch(e){case 8:return"\\b";case 9:return"\\t";case 10:return"\\n";case 13:return"\\r";case 34:return'\\"';case 92:return"\\\\"}if(e>=32&&e<127)return String.fromCharCode(e)}return e<=65535?Gs(e):Gs(55296+((e-=65536)>>10&1023))+Gs(56320+(1023&e))})).join("")+'"'},formatBytes32String:function(e){const t=Ws(e);if(t.length>31)throw new Error("bytes32 string must be less than 32 bytes");return To(Co([t,Fs]).slice(0,32))},nameprep:function(e){if(e.match(/^[a-z0-9-]*$/i)&&e.length<=59)return e.toLowerCase();let t=Xs(e);var r;r=t.map((e=>{if(rc.indexOf(e)>=0)return[];if(e>=65024&&e<=65039)return[];let t=function(e){let t=ec(e,nc);if(t)return[e+t.s];let r=ic[e];if(r)return r;let n=oc[e];return n?[e+n[0]]:ac[e]||null}(e);return t||[e]})),t=r.reduce(((e,t)=>(t.forEach((t=>{e.push(t)})),e)),[]),t=Xs(Vs(t),Ls.NFKC),t.forEach((e=>{if(ec(e,sc))throw new Error("STRINGPREP_CONTAINS_PROHIBITED")})),t.forEach((e=>{if(ec(e,tc))throw new Error("STRINGPREP_CONTAINS_UNASSIGNED")}));let n=Vs(t);if("-"===n.substring(0,1)||"--"===n.substring(2,4)||"-"===n.substring(n.length-1))throw new Error("invalid hyphen");return n},parseBytes32String:function(e){const t=Mo(e);if(32!==t.length)throw new Error("invalid bytes32 - not 32 bytes long");if(0!==t[31])throw new Error("invalid bytes32 string - no null terminator");let r=31;for(;0===t[r-1];)r--;return Zs(t.slice(0,r))},toUtf8Bytes:Ws,toUtf8CodePoints:Xs,toUtf8String:Zs});class uc extends Rs{constructor(e){super("string",e)}defaultValue(){return""}encode(e,t){return super.encode(e,Ws(t))}decode(e){return Zs(super.decode(e))}}class fc extends Ya{constructor(e,t){let r=!1;const n=[];e.forEach((e=>{e.dynamic&&(r=!0),n.push(e.type)}));super("tuple","tuple("+n.join(",")+")",t,r),this.coders=e}defaultValue(){const e=[];this.coders.forEach((t=>{e.push(t.defaultValue())}));const t=this.coders.reduce(((e,t)=>{const r=t.localName;return r&&(e[r]||(e[r]=0),e[r]++),e}),{});return this.coders.forEach(((r,n)=>{let i=r.localName;i&&1===t[i]&&("length"===i&&(i="_length"),null==e[i]&&(e[i]=e[n]))})),Object.freeze(e)}encode(e,t){return ks(e,this.coders,t)}decode(e){return e.coerce(this.name,Ms(e,this.coders))}}const dc=new wo(ka),lc=new RegExp(/^bytes([0-9]*)$/),hc=new RegExp(/^(u?int)([0-9]*)$/);class pc{constructor(e){ga(this,"coerceFunc",e||null)}_getCoder(e){switch(e.baseType){case"address":return new Ss(e.name);case"bool":return new Is(e.name);case"string":return new uc(e.name);case"bytes":return new Ns(e.name);case"array":return new Cs(this._getCoder(e.arrayChildren),e.arrayLength,e.name);case"tuple":return new fc((e.components||[]).map((e=>this._getCoder(e))),e.name);case"":return new Ts(e.name)}let t=e.type.match(hc);if(t){let r=parseInt(t[2]||"256");return(0===r||r>256||r%8!=0)&&dc.throwArgumentError("invalid "+t[1]+" bit length","param",e),new zs(r/8,"int"===t[1],e.name)}if(t=e.type.match(lc),t){let r=parseInt(t[1]);return(0===r||r>32)&&dc.throwArgumentError("invalid bytes length","param",e),new Os(r,e.name)}return dc.throwArgumentError("invalid type","type",e.type)}_getWordSize(){return 32}_getReader(e,t){return new ts(e,this._getWordSize(),this.coerceFunc,t)}_getWriter(){return new es(this._getWordSize())}getDefaultValue(e){const t=e.map((e=>this._getCoder($a.from(e))));return new fc(t,"_").defaultValue()}encode(e,t){e.length!==t.length&&dc.throwError("types/values length mismatch",wo.errors.INVALID_ARGUMENT,{count:{types:e.length,values:t.length},value:{types:e,values:t}});const r=e.map((e=>this._getCoder($a.from(e)))),n=new fc(r,"_"),i=this._getWriter();return n.encode(i,t),i.data}decode(e,t,r){const n=e.map((e=>this._getCoder($a.from(e))));return new fc(n,"_").decode(this._getReader(Mo(t),r))}}const mc=new pc;function gc(e){return os(Ws(e))}const yc="hash/5.7.0";function bc(e){e=atob(e);const t=[];for(let r=0;r0&&Array.isArray(e)?i(e,t-1):r.push(e)}))};return i(e,t),r}function _c(e){return function(e){let t=0;return()=>e[t++]}(function(e){let t=0;function r(){return e[t++]<<8|e[t++]}let n=r(),i=1,o=[0,1];for(let e=1;e>--c&1}const d=Math.pow(2,31),l=d>>>1,h=l>>1,p=d-1;let m=0;for(let e=0;e<31;e++)m=m<<1|f();let g=[],y=0,b=d;for(;;){let e=Math.floor(((m-y+1)*i-1)/b),t=0,r=n;for(;r-t>1;){let n=t+r>>>1;e>>1|f(),a=a<<1^l,s=(s^l)<<1|l|1;y=a,b=1+s-a}let v=n-4;return g.map((t=>{switch(t-v){case 3:return v+65792+(e[s++]<<16|e[s++]<<8|e[s++]);case 2:return v+256+(e[s++]<<8|e[s++]);case 1:return v+e[s++];default:return t-1}}))}(e))}function Ec(e){return 1&e?~e>>1:e>>1}function Sc(e,t){let r=Array(e);for(let n=0,i=-1;nt[e])):r}function kc(e,t,r){let n=Array(e).fill(void 0).map((()=>[]));for(let i=0;in[t].push(e)));return n}function Mc(e,t){let r=1+t(),n=t(),i=function(e){let t=[];for(;;){let r=e();if(0==r)break;t.push(r)}return t}(t);return Ac(kc(i.length,1+e,t).map(((e,t)=>{const o=e[0],a=e.slice(1);return Array(i[t]).fill(void 0).map(((e,t)=>{let i=t*n;return[o+t*r,a.map((e=>e+i))]}))})))}function Cc(e,t){return kc(1+t(),1+e,t).map((e=>[e[0],e.slice(1)]))}const Ic=_c(bc("AEQF2AO2DEsA2wIrAGsBRABxAN8AZwCcAEwAqgA0AGwAUgByADcATAAVAFYAIQAyACEAKAAYAFgAGwAjABQAMAAmADIAFAAfABQAKwATACoADgAbAA8AHQAYABoAGQAxADgALAAoADwAEwA9ABMAGgARAA4ADwAWABMAFgAIAA8AHgQXBYMA5BHJAS8JtAYoAe4AExozi0UAH21tAaMnBT8CrnIyhrMDhRgDygIBUAEHcoFHUPe8AXBjAewCjgDQR8IICIcEcQLwATXCDgzvHwBmBoHNAqsBdBcUAykgDhAMShskMgo8AY8jqAQfAUAfHw8BDw87MioGlCIPBwZCa4ELatMAAMspJVgsDl8AIhckSg8XAHdvTwBcIQEiDT4OPhUqbyECAEoAS34Aej8Ybx83JgT/Xw8gHxZ/7w8RICxPHA9vBw+Pfw8PHwAPFv+fAsAvCc8vEr8ivwD/EQ8Bol8OEBa/A78hrwAPCU8vESNvvwWfHwNfAVoDHr+ZAAED34YaAdJPAK7PLwSEgDLHAGo1Pz8Pvx9fUwMrpb8O/58VTzAPIBoXIyQJNF8hpwIVAT8YGAUADDNBaX3RAMomJCg9EhUeA29MABsZBTMNJipjOhc19gcIDR8bBwQHEggCWi6DIgLuAQYA+BAFCha3A5XiAEsqM7UFFgFLhAMjFTMYE1Klnw74nRVBG/ASCm0BYRN/BrsU3VoWy+S0vV8LQx+vN8gF2AC2AK5EAWwApgYDKmAAroQ0NDQ0AT+OCg7wAAIHRAbpNgVcBV0APTA5BfbPFgMLzcYL/QqqA82eBALKCjQCjqYCht0/k2+OAsXQAoP3ASTKDgDw6ACKAUYCMpIKJpRaAE4A5womABzZvs0REEKiACIQAd5QdAECAj4Ywg/wGqY2AVgAYAD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TbrDgywJ/qG07gZJplnTvLcYdNaH0KMYOYMGX+rB4NGPFmQsNaIwlWrfCezxre8zXBrsMT+edVLbLqN1BqB76JH4BvZTqUIMfGwPGEn+EnmTV86fPBaYbFL3DFEhjB45CewkXEAtJxk4/Ms2pPXnaRqdky0HOYdcUcE2zcXq4vaIvW2/v0nHFJH2XXe22ueDmq/18XGtELSq85j9X8q0tcNSSKJIX8FTuJF/Pf8j5PhqG2u+osvsLxYrvvfeVJL+4tkcXcr9JV7v0ERmj/X6fM3NC4j6dS1+9Umr2oPavqiAydTZPLMNRGY23LO9zAVDly7jD+70G5TPPLdhRIl4WxcYjLnM+SNcJ26FOrkrISUtPObIz5Zb3AG612krnpy15RMW+1cQjlnWFI6538qky9axd2oJmHIHP08KyP0ubGO+TQNOYuv2uh17yCIvR8VcStw7o1g0NM60sk+8Tq7YfIBJrtp53GkvzXH7OA0p8/n/u1satf/VJhtR1l8Wa6Gmaug7haSpaCaYQax6ta0mkutlb+eAOSG1aobM81D9A4iS1RRlzBBoVX6tU1S6WE2N9ORY6DfeLRC4l9Rvr5h95XDWB2mR1d4WFudpsgVYwiTwT31ljskD8ZyDOlm5DkGh9N/UB/0AI5Xvb8ZBmai2hQ4BWMqFwYnzxwB26YHSOv9WgY3JXnvoN+2R4rqGVh/LLDMtpFP+SpMGJNWvbIl5SOodbCczW2RKleksPoUeGEzrjtKHVdtZA+kfqO+rVx/iclCqwoopepvJpSTDjT+b9GWylGRF8EDbGlw6eUzmJM95Ovoz+kwLX3c2fTjFeYEsE7vUZm3mqdGJuKh2w9/QGSaqRHs99aScGOdDqkFcACoqdbBoQqqjamhH6Q9ng39JCg3lrGJwd50Qk9ovnqBTr8MME7Ps2wiVfygUmPoUBJJfJWX5Nda0nuncbFkA==")),Rc=new Set(xc(Ic)),Nc=new Set(xc(Ic)),Oc=function(e){let t=[];for(;;){let r=e();if(0==r)break;t.push(Mc(r,e))}for(;;){let r=e()-1;if(r<0)break;t.push(Cc(r,e))}return function(e){const t={};for(let r=0;re-t));return function r(){let n=[];for(;;){let i=xc(e,t);if(0==i.length)break;n.push({set:new Set(i),node:r()})}n.sort(((e,t)=>t.set.size-e.set.size));let i=e(),o=i%3;i=i/3|0;let a=!!(1&i);return i>>=1,{branches:n,valid:o,fe0f:a,save:1==i,check:2==i}}()}(Ic),jc=45,$c=95;function Dc(e){return Xs(e)}function Bc(e){return e.filter((e=>65039!=e))}function Fc(e){for(let t of e.split(".")){let e=Dc(t);try{for(let t=e.lastIndexOf($c)-1;t>=0;t--)if(e[t]!==$c)throw new Error("underscore only allowed at start");if(e.length>=4&&e.every((e=>e<128))&&e[2]===jc&&e[3]===jc)throw new Error("invalid label extension")}catch(e){throw new Error(`Invalid label "${t}": ${e.message}`)}}return e}function zc(e){return Fc(function(e,t){let r=Dc(e).reverse(),n=[];for(;r.length;){let e=Uc(r);if(e){n.push(...t(e));continue}let i=r.pop();if(Rc.has(i)){n.push(i);continue}if(Nc.has(i))continue;let o=Oc[i];if(!o)throw new Error(`Disallowed codepoint: 0x${i.toString(16).toUpperCase()}`);n.push(...o)}return Fc(function(e){return e.normalize("NFC")}(String.fromCodePoint(...n)))}(e,Bc))}function Uc(e,t){var r;let n,i,o=Tc,a=[],s=e.length;for(t&&(t.length=0);s;){let c=e[--s];if(o=null===(r=o.branches.find((e=>e.set.has(c))))||void 0===r?void 0:r.node,!o)break;if(o.save)i=c;else if(o.check&&c===i)break;a.push(c),o.fe0f&&(a.push(65039),s>0&&65039==e[s-1]&&s--),o.valid&&(n=a.slice(),2==o.valid&&n.splice(1,1),t&&t.push(...e.slice(s).reverse()),e.length=s)}return n}const Lc=new wo(yc),qc=new Uint8Array(32);function Hc(e){if(0===e.length)throw new Error("invalid ENS name; empty component");return e}function Kc(e){const t=Ws(zc(e)),r=[];if(0===e.length)return r;let n=0;for(let e=0;e=t.length)throw new Error("invalid ENS name; empty component");return r.push(Hc(t.slice(n))),r}function Jc(e){"string"!=typeof e&&Lc.throwArgumentError("invalid ENS name; not a string","name",e);let t=qc;const r=Kc(e);for(;r.length;)t=os(Co([t,os(r.pop())]));return To(t)}function Wc(e){return To(Co(Kc(e).map((e=>{if(e.length>63)throw new Error("invalid DNS encoded entry; length exceeds 63 bytes");const t=new Uint8Array(e.length+1);return t.set(e,1),t[0]=t.length-1,t}))))+"00"}qc.fill(0);const Gc="Ethereum Signed Message:\n";function Vc(e){return"string"==typeof e&&(e=Ws(e)),os(Co([Ws(Gc),Ws(String(e.length)),e]))}var Zc=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))};const Xc=new wo(yc),Qc=new Uint8Array(32);Qc.fill(0);const Yc=Zo.from(-1),eu=Zo.from(0),tu=Zo.from(1),ru=Zo.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");const nu=zo(tu.toHexString(),32),iu=zo(eu.toHexString(),32),ou={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},au=["name","version","chainId","verifyingContract","salt"];function su(e){return function(t){return"string"!=typeof t&&Xc.throwArgumentError(`invalid domain value for ${JSON.stringify(e)}`,`domain.${e}`,t),t}}const cu={name:su("name"),version:su("version"),chainId:function(e){try{return Zo.from(e).toString()}catch(e){}return Xc.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",e)},verifyingContract:function(e){try{return As(e).toLowerCase()}catch(e){}return Xc.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",e)},salt:function(e){try{const t=Mo(e);if(32!==t.length)throw new Error("bad length");return To(t)}catch(e){}return Xc.throwArgumentError('invalid domain value "salt"',"domain.salt",e)}};function uu(e){{const t=e.match(/^(u?)int(\d*)$/);if(t){const r=""===t[1],n=parseInt(t[2]||"256");(n%8!=0||n>256||t[2]&&t[2]!==String(n))&&Xc.throwArgumentError("invalid numeric width","type",e);const i=ru.mask(r?n-1:n),o=r?i.add(tu).mul(Yc):eu;return function(t){const r=Zo.from(t);return(r.lt(o)||r.gt(i))&&Xc.throwArgumentError(`value out-of-bounds for ${e}`,"value",t),zo(r.toTwos(256).toHexString(),32)}}}{const t=e.match(/^bytes(\d+)$/);if(t){const r=parseInt(t[1]);return(0===r||r>32||t[1]!==String(r))&&Xc.throwArgumentError("invalid bytes width","type",e),function(t){return Mo(t).length!==r&&Xc.throwArgumentError(`invalid length for ${e}`,"value",t),function(e){const t=Mo(e),r=t.length%32;return r?Do([t,Qc.slice(r)]):To(t)}(t)}}}switch(e){case"address":return function(e){return zo(As(e),32)};case"bool":return function(e){return e?nu:iu};case"bytes":return function(e){return os(e)};case"string":return function(e){return gc(e)}}return null}function fu(e,t){return`${e}(${t.map((({name:e,type:t})=>t+" "+e)).join(",")})`}class du{constructor(e){ga(this,"types",Object.freeze(Sa(e))),ga(this,"_encoderCache",{}),ga(this,"_types",{});const t={},r={},n={};Object.keys(e).forEach((e=>{t[e]={},r[e]=[],n[e]={}}));for(const n in e){const i={};e[n].forEach((o=>{i[o.name]&&Xc.throwArgumentError(`duplicate variable name ${JSON.stringify(o.name)} in ${JSON.stringify(n)}`,"types",e),i[o.name]=!0;const a=o.type.match(/^([^\x5b]*)(\x5b|$)/)[1];a===n&&Xc.throwArgumentError(`circular type reference to ${JSON.stringify(a)}`,"types",e);uu(a)||(r[a]||Xc.throwArgumentError(`unknown type ${JSON.stringify(a)}`,"types",e),r[a].push(n),t[n][a]=!0)}))}const i=Object.keys(r).filter((e=>0===r[e].length));0===i.length?Xc.throwArgumentError("missing primary type","types",e):i.length>1&&Xc.throwArgumentError(`ambiguous primary types or unused types: ${i.map((e=>JSON.stringify(e))).join(", ")}`,"types",e),ga(this,"primaryType",i[0]),function i(o,a){a[o]&&Xc.throwArgumentError(`circular type reference to ${JSON.stringify(o)}`,"types",e),a[o]=!0,Object.keys(t[o]).forEach((e=>{r[e]&&(i(e,a),Object.keys(a).forEach((t=>{n[t][e]=!0})))})),delete a[o]}(this.primaryType,{});for(const t in n){const r=Object.keys(n[t]);r.sort(),this._types[t]=fu(t,e[t])+r.map((t=>fu(t,e[t]))).join("")}}getEncoder(e){let t=this._encoderCache[e];return t||(t=this._encoderCache[e]=this._getEncoder(e)),t}_getEncoder(e){{const t=uu(e);if(t)return t}const t=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(t){const e=t[1],r=this.getEncoder(e),n=parseInt(t[3]);return t=>{n>=0&&t.length!==n&&Xc.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",t);let i=t.map(r);return this._types[e]&&(i=i.map(os)),os(Do(i))}}const r=this.types[e];if(r){const t=gc(this._types[e]);return e=>{const n=r.map((({name:t,type:r})=>{const n=this.getEncoder(r)(e[t]);return this._types[r]?os(n):n}));return n.unshift(t),Do(n)}}return Xc.throwArgumentError(`unknown type: ${e}`,"type",e)}encodeType(e){const t=this._types[e];return t||Xc.throwArgumentError(`unknown type: ${JSON.stringify(e)}`,"name",e),t}encodeData(e,t){return this.getEncoder(e)(t)}hashStruct(e,t){return os(this.encodeData(e,t))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,t,r){if(uu(e))return r(e,t);const n=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(n){const e=n[1],i=parseInt(n[3]);return i>=0&&t.length!==i&&Xc.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",t),t.map((t=>this._visit(e,t,r)))}const i=this.types[e];return i?i.reduce(((e,{name:n,type:i})=>(e[n]=this._visit(i,t[n],r),e)),{}):Xc.throwArgumentError(`unknown type: ${e}`,"type",e)}visit(e,t){return this._visit(this.primaryType,e,t)}static from(e){return new du(e)}static getPrimaryType(e){return du.from(e).primaryType}static hashStruct(e,t,r){return du.from(t).hashStruct(e,r)}static hashDomain(e){const t=[];for(const r in e){const n=ou[r];n||Xc.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(r)}`,"domain",e),t.push({name:r,type:n})}return t.sort(((e,t)=>au.indexOf(e.name)-au.indexOf(t.name))),du.hashStruct("EIP712Domain",{EIP712Domain:t},e)}static encode(e,t,r){return Do(["0x1901",du.hashDomain(e),du.from(t).hash(r)])}static hash(e,t,r){return os(du.encode(e,t,r))}static resolveNames(e,t,r,n){return Zc(this,void 0,void 0,(function*(){e=wa(e);const i={};e.verifyingContract&&!No(e.verifyingContract,20)&&(i[e.verifyingContract]="0x");const o=du.from(t);o.visit(r,((e,t)=>("address"!==e||No(t,20)||(i[t]="0x"),t)));for(const e in i)i[e]=yield n(e);return e.verifyingContract&&i[e.verifyingContract]&&(e.verifyingContract=i[e.verifyingContract]),r=o.visit(r,((e,t)=>"address"===e&&i[t]?i[t]:t)),{domain:e,value:r}}))}static getPayload(e,t,r){du.hashDomain(e);const n={},i=[];au.forEach((t=>{const r=e[t];null!=r&&(n[t]=cu[t](r),i.push({name:t,type:ou[t]}))}));const o=du.from(t),a=wa(t);return a.EIP712Domain?Xc.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",t):a.EIP712Domain=i,o.encode(r),{types:a,domain:n,primaryType:o.primaryType,message:o.visit(r,((e,t)=>{if(e.match(/^bytes(\d*)/))return To(Mo(t));if(e.match(/^u?int/))return Zo.from(t).toString();switch(e){case"address":return t.toLowerCase();case"bool":return!!t;case"string":return"string"!=typeof t&&Xc.throwArgumentError("invalid string","value",t),t}return Xc.throwArgumentError("unsupported type","type",e)}))}}}var lu=Object.freeze({__proto__:null,_TypedDataEncoder:du,dnsEncode:Wc,ensNormalize:function(e){return Kc(e).map((e=>Zs(e))).join(".")},hashMessage:Vc,id:gc,isValidName:function(e){try{return 0!==Kc(e).length}catch(e){}return!1},messagePrefix:Gc,namehash:Jc});const hu=new wo(ka);class pu extends Pa{}class mu extends Pa{}class gu extends Pa{}class yu extends Pa{static isIndexed(e){return!(!e||!e._isIndexed)}}const bu={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function vu(e,t){const r=new Error(`deferred error during ABI decoding triggered accessing ${e}`);return r.error=t,r}class wu{constructor(e){let t=[];t="string"==typeof e?JSON.parse(e):e,ga(this,"fragments",t.map((e=>Ba.from(e))).filter((e=>null!=e))),ga(this,"_abiCoder",ya(new.target,"getAbiCoder")()),ga(this,"functions",{}),ga(this,"errors",{}),ga(this,"events",{}),ga(this,"structs",{}),this.fragments.forEach((e=>{let t=null;switch(e.type){case"constructor":return this.deploy?void hu.warn("duplicate definition - constructor"):void ga(this,"deploy",e);case"function":t=this.functions;break;case"event":t=this.events;break;case"error":t=this.errors;break;default:return}let r=e.format();t[r]?hu.warn("duplicate definition - "+r):t[r]=e})),this.deploy||ga(this,"deploy",qa.from({payable:!1,type:"constructor"})),ga(this,"_isInterface",!0)}format(e){e||(e=Ta.full),e===Ta.sighash&&hu.throwArgumentError("interface does not support formatting sighash","format",e);const t=this.fragments.map((t=>t.format(e)));return e===Ta.json?JSON.stringify(t.map((e=>JSON.parse(e)))):t}static getAbiCoder(){return mc}static getAddress(e){return As(e)}static getSighash(e){return $o(gc(e.format()),0,4)}static getEventTopic(e){return gc(e.format())}getFunction(e){if(No(e)){for(const t in this.functions)if(e===this.getSighash(t))return this.functions[t];hu.throwArgumentError("no matching function","sighash",e)}if(-1===e.indexOf("(")){const t=e.trim(),r=Object.keys(this.functions).filter((e=>e.split("(")[0]===t));return 0===r.length?hu.throwArgumentError("no matching function","name",t):r.length>1&&hu.throwArgumentError("multiple matching functions","name",t),this.functions[r[0]]}const t=this.functions[Ha.fromString(e).format()];return t||hu.throwArgumentError("no matching function","signature",e),t}getEvent(e){if(No(e)){const t=e.toLowerCase();for(const e in this.events)if(t===this.getEventTopic(e))return this.events[e];hu.throwArgumentError("no matching event","topichash",t)}if(-1===e.indexOf("(")){const t=e.trim(),r=Object.keys(this.events).filter((e=>e.split("(")[0]===t));return 0===r.length?hu.throwArgumentError("no matching event","name",t):r.length>1&&hu.throwArgumentError("multiple matching events","name",t),this.events[r[0]]}const t=this.events[Fa.fromString(e).format()];return t||hu.throwArgumentError("no matching event","signature",e),t}getError(e){if(No(e)){const t=ya(this.constructor,"getSighash");for(const r in this.errors){if(e===t(this.errors[r]))return this.errors[r]}hu.throwArgumentError("no matching error","sighash",e)}if(-1===e.indexOf("(")){const t=e.trim(),r=Object.keys(this.errors).filter((e=>e.split("(")[0]===t));return 0===r.length?hu.throwArgumentError("no matching error","name",t):r.length>1&&hu.throwArgumentError("multiple matching errors","name",t),this.errors[r[0]]}const t=this.errors[Ha.fromString(e).format()];return t||hu.throwArgumentError("no matching error","signature",e),t}getSighash(e){if("string"==typeof e)try{e=this.getFunction(e)}catch(t){try{e=this.getError(e)}catch(e){throw t}}return ya(this.constructor,"getSighash")(e)}getEventTopic(e){return"string"==typeof e&&(e=this.getEvent(e)),ya(this.constructor,"getEventTopic")(e)}_decodeParams(e,t){return this._abiCoder.decode(e,t)}_encodeParams(e,t){return this._abiCoder.encode(e,t)}encodeDeploy(e){return this._encodeParams(this.deploy.inputs,e||[])}decodeErrorResult(e,t){"string"==typeof e&&(e=this.getError(e));const r=Mo(t);return To(r.slice(0,4))!==this.getSighash(e)&&hu.throwArgumentError(`data signature does not match error ${e.name}.`,"data",To(r)),this._decodeParams(e.inputs,r.slice(4))}encodeErrorResult(e,t){return"string"==typeof e&&(e=this.getError(e)),To(Co([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}decodeFunctionData(e,t){"string"==typeof e&&(e=this.getFunction(e));const r=Mo(t);return To(r.slice(0,4))!==this.getSighash(e)&&hu.throwArgumentError(`data signature does not match function ${e.name}.`,"data",To(r)),this._decodeParams(e.inputs,r.slice(4))}encodeFunctionData(e,t){return"string"==typeof e&&(e=this.getFunction(e)),To(Co([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}decodeFunctionResult(e,t){"string"==typeof e&&(e=this.getFunction(e));let r=Mo(t),n=null,i="",o=null,a=null,s=null;switch(r.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(e.outputs,r)}catch(e){}break;case 4:{const e=To(r.slice(0,4)),t=bu[e];if(t)o=this._abiCoder.decode(t.inputs,r.slice(4)),a=t.name,s=t.signature,t.reason&&(n=o[0]),"Error"===a?i=`; VM Exception while processing transaction: reverted with reason string ${JSON.stringify(o[0])}`:"Panic"===a&&(i=`; VM Exception while processing transaction: reverted with panic code ${o[0]}`);else try{const t=this.getError(e);o=this._abiCoder.decode(t.inputs,r.slice(4)),a=t.name,s=t.format()}catch(e){}break}}return hu.throwError("call revert exception"+i,wo.errors.CALL_EXCEPTION,{method:e.format(),data:To(t),errorArgs:o,errorName:a,errorSignature:s,reason:n})}encodeFunctionResult(e,t){return"string"==typeof e&&(e=this.getFunction(e)),To(this._abiCoder.encode(e.outputs,t||[]))}encodeFilterTopics(e,t){"string"==typeof e&&(e=this.getEvent(e)),t.length>e.inputs.length&&hu.throwError("too many arguments for "+e.format(),wo.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:t});let r=[];e.anonymous||r.push(this.getEventTopic(e));const n=(e,t)=>"string"===e.type?gc(t):"bytes"===e.type?os(To(t)):("bool"===e.type&&"boolean"==typeof t&&(t=t?"0x01":"0x00"),e.type.match(/^u?int/)&&(t=Zo.from(t).toHexString()),"address"===e.type&&this._abiCoder.encode(["address"],[t]),zo(To(t),32));for(t.forEach(((t,i)=>{let o=e.inputs[i];o.indexed?null==t?r.push(null):"array"===o.baseType||"tuple"===o.baseType?hu.throwArgumentError("filtering with tuples or arrays not supported","contract."+o.name,t):Array.isArray(t)?r.push(t.map((e=>n(o,e)))):r.push(n(o,t)):null!=t&&hu.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+o.name,t)}));r.length&&null===r[r.length-1];)r.pop();return r}encodeEventLog(e,t){"string"==typeof e&&(e=this.getEvent(e));const r=[],n=[],i=[];return e.anonymous||r.push(this.getEventTopic(e)),t.length!==e.inputs.length&&hu.throwArgumentError("event arguments/values mismatch","values",t),e.inputs.forEach(((e,o)=>{const a=t[o];if(e.indexed)if("string"===e.type)r.push(gc(a));else if("bytes"===e.type)r.push(os(a));else{if("tuple"===e.baseType||"array"===e.baseType)throw new Error("not implemented");r.push(this._abiCoder.encode([e.type],[a]))}else n.push(e),i.push(a)})),{data:this._abiCoder.encode(n,i),topics:r}}decodeEventLog(e,t,r){if("string"==typeof e&&(e=this.getEvent(e)),null!=r&&!e.anonymous){let t=this.getEventTopic(e);No(r[0],32)&&r[0].toLowerCase()===t||hu.throwError("fragment/topic mismatch",wo.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:t,value:r[0]}),r=r.slice(1)}let n=[],i=[],o=[];e.inputs.forEach(((e,t)=>{e.indexed?"string"===e.type||"bytes"===e.type||"tuple"===e.baseType||"array"===e.baseType?(n.push($a.fromObject({type:"bytes32",name:e.name})),o.push(!0)):(n.push(e),o.push(!1)):(i.push(e),o.push(!1))}));let a=null!=r?this._abiCoder.decode(n,Co(r)):null,s=this._abiCoder.decode(i,t,!0),c=[],u=0,f=0;e.inputs.forEach(((e,t)=>{if(e.indexed)if(null==a)c[t]=new yu({_isIndexed:!0,hash:null});else if(o[t])c[t]=new yu({_isIndexed:!0,hash:a[f++]});else try{c[t]=a[f++]}catch(e){c[t]=e}else try{c[t]=s[u++]}catch(e){c[t]=e}if(e.name&&null==c[e.name]){const r=c[t];r instanceof Error?Object.defineProperty(c,e.name,{enumerable:!0,get:()=>{throw vu(`property ${JSON.stringify(e.name)}`,r)}}):c[e.name]=r}}));for(let e=0;e{throw vu(`index ${e}`,t)}})}return Object.freeze(c)}parseTransaction(e){let t=this.getFunction(e.data.substring(0,10).toLowerCase());return t?new mu({args:this._abiCoder.decode(t.inputs,"0x"+e.data.substring(10)),functionFragment:t,name:t.name,signature:t.format(),sighash:this.getSighash(t),value:Zo.from(e.value||"0")}):null}parseLog(e){let t=this.getEvent(e.topics[0]);return!t||t.anonymous?null:new pu({eventFragment:t,name:t.name,signature:t.format(),topic:this.getEventTopic(t),args:this.decodeEventLog(t,e.data,e.topics)})}parseError(e){const t=To(e);let r=this.getError(t.substring(0,10).toLowerCase());return r?new gu({args:this._abiCoder.decode(r.inputs,"0x"+t.substring(10)),errorFragment:r,name:r.name,signature:r.format(),sighash:this.getSighash(r)}):null}static isInterface(e){return!(!e||!e._isInterface)}}var Au=Object.freeze({__proto__:null,AbiCoder:pc,ConstructorFragment:qa,ErrorFragment:Ja,EventFragment:Fa,FormatTypes:Ta,Fragment:Ba,FunctionFragment:Ha,Indexed:yu,Interface:wu,LogDescription:pu,ParamType:$a,TransactionDescription:mu,checkResultErrors:Qa,defaultAbiCoder:mc});var _u=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))};const Eu=new wo("abstract-provider/5.7.0");class Su extends Pa{static isForkEvent(e){return!(!e||!e._isForkEvent)}}class Pu{constructor(){Eu.checkAbstract(new.target,Pu),ga(this,"_isProvider",!0)}getFeeData(){return _u(this,void 0,void 0,(function*(){const{block:e,gasPrice:t}=yield ba({block:this.getBlock("latest"),gasPrice:this.getGasPrice().catch((e=>null))});let r=null,n=null,i=null;return e&&e.baseFeePerGas&&(r=e.baseFeePerGas,i=Zo.from("1500000000"),n=e.baseFeePerGas.mul(2).add(i)),{lastBaseFeePerGas:r,maxFeePerGas:n,maxPriorityFeePerGas:i,gasPrice:t}}))}addListener(e,t){return this.on(e,t)}removeListener(e,t){return this.off(e,t)}static isProvider(e){return!(!e||!e._isProvider)}}var xu=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))};const ku=new wo("abstract-signer/5.7.0"),Mu=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],Cu=[wo.errors.INSUFFICIENT_FUNDS,wo.errors.NONCE_EXPIRED,wo.errors.REPLACEMENT_UNDERPRICED];class Iu{constructor(){ku.checkAbstract(new.target,Iu),ga(this,"_isSigner",!0)}getBalance(e){return xu(this,void 0,void 0,(function*(){return this._checkProvider("getBalance"),yield this.provider.getBalance(this.getAddress(),e)}))}getTransactionCount(e){return xu(this,void 0,void 0,(function*(){return this._checkProvider("getTransactionCount"),yield this.provider.getTransactionCount(this.getAddress(),e)}))}estimateGas(e){return xu(this,void 0,void 0,(function*(){this._checkProvider("estimateGas");const t=yield ba(this.checkTransaction(e));return yield this.provider.estimateGas(t)}))}call(e,t){return xu(this,void 0,void 0,(function*(){this._checkProvider("call");const r=yield ba(this.checkTransaction(e));return yield this.provider.call(r,t)}))}sendTransaction(e){return xu(this,void 0,void 0,(function*(){this._checkProvider("sendTransaction");const t=yield this.populateTransaction(e),r=yield this.signTransaction(t);return yield this.provider.sendTransaction(r)}))}getChainId(){return xu(this,void 0,void 0,(function*(){this._checkProvider("getChainId");return(yield this.provider.getNetwork()).chainId}))}getGasPrice(){return xu(this,void 0,void 0,(function*(){return this._checkProvider("getGasPrice"),yield this.provider.getGasPrice()}))}getFeeData(){return xu(this,void 0,void 0,(function*(){return this._checkProvider("getFeeData"),yield this.provider.getFeeData()}))}resolveName(e){return xu(this,void 0,void 0,(function*(){return this._checkProvider("resolveName"),yield this.provider.resolveName(e)}))}checkTransaction(e){for(const t in e)-1===Mu.indexOf(t)&&ku.throwArgumentError("invalid transaction key: "+t,"transaction",e);const t=wa(e);return null==t.from?t.from=this.getAddress():t.from=Promise.all([Promise.resolve(t.from),this.getAddress()]).then((t=>(t[0].toLowerCase()!==t[1].toLowerCase()&&ku.throwArgumentError("from address mismatch","transaction",e),t[0]))),t}populateTransaction(e){return xu(this,void 0,void 0,(function*(){const t=yield ba(this.checkTransaction(e));null!=t.to&&(t.to=Promise.resolve(t.to).then((e=>xu(this,void 0,void 0,(function*(){if(null==e)return null;const t=yield this.resolveName(e);return null==t&&ku.throwArgumentError("provided ENS name resolves to null","tx.to",e),t})))),t.to.catch((e=>{})));const r=null!=t.maxFeePerGas||null!=t.maxPriorityFeePerGas;if(null==t.gasPrice||2!==t.type&&!r?0!==t.type&&1!==t.type||!r||ku.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",e):ku.throwArgumentError("eip-1559 transaction do not support gasPrice","transaction",e),2!==t.type&&null!=t.type||null==t.maxFeePerGas||null==t.maxPriorityFeePerGas)if(0===t.type||1===t.type)null==t.gasPrice&&(t.gasPrice=this.getGasPrice());else{const e=yield this.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?(r&&ku.throwError("network does not support EIP-1559",wo.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),null==t.gasPrice&&(t.gasPrice=e.gasPrice),t.type=0):ku.throwError("failed to get consistent fee data",wo.errors.UNSUPPORTED_OPERATION,{operation:"signer.getFeeData"});else 2===t.type&&(null==t.maxFeePerGas&&(t.maxFeePerGas=e.maxFeePerGas),null==t.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=e.maxPriorityFeePerGas))}else t.type=2;return null==t.nonce&&(t.nonce=this.getTransactionCount("pending")),null==t.gasLimit&&(t.gasLimit=this.estimateGas(t).catch((e=>{if(Cu.indexOf(e.code)>=0)throw e;return ku.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",wo.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,tx:t})}))),null==t.chainId?t.chainId=this.getChainId():t.chainId=Promise.all([Promise.resolve(t.chainId),this.getChainId()]).then((t=>(0!==t[1]&&t[0]!==t[1]&&ku.throwArgumentError("chainId address mismatch","transaction",e),t[0]))),yield ba(t)}))}_checkProvider(e){this.provider||ku.throwError("missing provider",wo.errors.UNSUPPORTED_OPERATION,{operation:e||"_checkProvider"})}static isSigner(e){return!(!e||!e._isSigner)}}class Ru extends Iu{constructor(e,t){super(),ga(this,"address",e),ga(this,"provider",t||null)}getAddress(){return Promise.resolve(this.address)}_fail(e,t){return Promise.resolve().then((()=>{ku.throwError(e,wo.errors.UNSUPPORTED_OPERATION,{operation:t})}))}signMessage(e){return this._fail("VoidSigner cannot sign messages","signMessage")}signTransaction(e){return this._fail("VoidSigner cannot sign transactions","signTransaction")}_signTypedData(e,t,r){return this._fail("VoidSigner cannot sign typed data","signTypedData")}connect(e){return new Ru(this.address,e)}}function Nu(e,t,r){return r={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&r.path)}},e(r,r.exports),r.exports}var Ou=Tu;function Tu(e,t){if(!e)throw new Error(t||"Assertion failed")}Tu.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)};var ju=Nu((function(e,t){var r=t;function n(e){return 1===e.length?"0"+e:e}function i(e){for(var t="",r=0;r>8,a=255&i;o?r.push(o,a):r.push(a)}return r},r.zero2=n,r.toHex=i,r.encode=function(e,t){return"hex"===t?i(e):e}})),$u=Nu((function(e,t){var r=t;r.assert=Ou,r.toArray=ju.toArray,r.zero2=ju.zero2,r.toHex=ju.toHex,r.encode=ju.encode,r.getNAF=function(e,t,r){var n=new Array(Math.max(e.bitLength(),r)+1);n.fill(0);for(var i=1<(i>>1)-1?(i>>1)-c:c,o.isubn(s)):s=0,n[a]=s,o.iushrn(1)}return n},r.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n,i=0,o=0;e.cmpn(-i)>0||t.cmpn(-o)>0;){var a,s,c=e.andln(3)+i&3,u=t.andln(3)+o&3;3===c&&(c=-1),3===u&&(u=-1),a=0==(1&c)?0:3!==(n=e.andln(7)+i&7)&&5!==n||2!==u?c:-c,r[0].push(a),s=0==(1&u)?0:3!==(n=t.andln(7)+o&7)&&5!==n||2!==c?u:-u,r[1].push(s),2*i===a+1&&(i=1-i),2*o===s+1&&(o=1-o),e.iushrn(1),t.iushrn(1)}return r},r.cachedProperty=function(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},r.parseBytes=function(e){return"string"==typeof e?r.toArray(e,"hex"):e},r.intFromLE=function(e){return new uo(e,"hex","le")}})),Du=$u.getNAF,Bu=$u.getJSF,Fu=$u.assert;function zu(e,t){this.type=e,this.p=new uo(t.p,16),this.red=t.prime?uo.red(t.prime):uo.mont(this.p),this.zero=new uo(0).toRed(this.red),this.one=new uo(1).toRed(this.red),this.two=new uo(2).toRed(this.red),this.n=t.n&&new uo(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var Uu=zu;function Lu(e,t){this.curve=e,this.type=t,this.precomputed=null}zu.prototype.point=function(){throw new Error("Not implemented")},zu.prototype.validate=function(){throw new Error("Not implemented")},zu.prototype._fixedNafMul=function(e,t){Fu(e.precomputed);var r=e._getDoubles(),n=Du(t,1,this._bitLength),i=(1<=o;c--)a=(a<<1)+n[c];s.push(a)}for(var u=this.jpoint(null,null,null),f=this.jpoint(null,null,null),d=i;d>0;d--){for(o=0;o=0;s--){for(var c=0;s>=0&&0===o[s];s--)c++;if(s>=0&&c++,a=a.dblp(c),s<0)break;var u=o[s];Fu(0!==u),a="affine"===e.type?u>0?a.mixedAdd(i[u-1>>1]):a.mixedAdd(i[-u-1>>1].neg()):u>0?a.add(i[u-1>>1]):a.add(i[-u-1>>1].neg())}return"affine"===e.type?a.toP():a},zu.prototype._wnafMulAdd=function(e,t,r,n,i){var o,a,s,c=this._wnafT1,u=this._wnafT2,f=this._wnafT3,d=0;for(o=0;o=1;o-=2){var h=o-1,p=o;if(1===c[h]&&1===c[p]){var m=[t[h],null,null,t[p]];0===t[h].y.cmp(t[p].y)?(m[1]=t[h].add(t[p]),m[2]=t[h].toJ().mixedAdd(t[p].neg())):0===t[h].y.cmp(t[p].y.redNeg())?(m[1]=t[h].toJ().mixedAdd(t[p]),m[2]=t[h].add(t[p].neg())):(m[1]=t[h].toJ().mixedAdd(t[p]),m[2]=t[h].toJ().mixedAdd(t[p].neg()));var g=[-3,-1,-5,-7,0,7,5,1,3],y=Bu(r[h],r[p]);for(d=Math.max(y[0].length,d),f[h]=new Array(d),f[p]=new Array(d),a=0;a=0;o--){for(var _=0;o>=0;){var E=!0;for(a=0;a=0&&_++,w=w.dblp(_),o<0)break;for(a=0;a0?s=u[a][S-1>>1]:S<0&&(s=u[a][-S-1>>1].neg()),w="affine"===s.type?w.mixedAdd(s):w.add(s))}}for(o=0;o=Math.ceil((e.bitLength()+1)/t.step)},Lu.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i=0&&(o=t,a=r),n.negative&&(n=n.neg(),i=i.neg()),o.negative&&(o=o.neg(),a=a.neg()),[{a:n,b:i},{a:o,b:a}]},Ku.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],i=n.b.mul(e).divRound(this.n),o=r.b.neg().mul(e).divRound(this.n),a=i.mul(r.a),s=o.mul(n.a),c=i.mul(r.b),u=o.mul(n.b);return{k1:e.sub(a).sub(s),k2:c.add(u).neg()}},Ku.prototype.pointFromX=function(e,t){(e=new uo(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var i=n.fromRed().isOdd();return(t&&!i||!t&&i)&&(n=n.redNeg()),this.point(e,n)},Ku.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},Ku.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o":""},Wu.prototype.isInfinity=function(){return this.inf},Wu.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},Wu.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),a=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)},Wu.prototype.getX=function(){return this.x.fromRed()},Wu.prototype.getY=function(){return this.y.fromRed()},Wu.prototype.mul=function(e){return e=new uo(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)},Wu.prototype.mulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},Wu.prototype.jmulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},Wu.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))},Wu.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,n=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return t},Wu.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},qu(Gu,Uu.BasePoint),Ku.prototype.jpoint=function(e,t,r){return new Gu(this,e,t,r)},Gu.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},Gu.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},Gu.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),i=e.x.redMul(r),o=this.y.redMul(t.redMul(e.z)),a=e.y.redMul(r.redMul(this.z)),s=n.redSub(i),c=o.redSub(a);if(0===s.cmpn(0))return 0!==c.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=s.redSqr(),f=u.redMul(s),d=n.redMul(u),l=c.redSqr().redIAdd(f).redISub(d).redISub(d),h=c.redMul(d.redISub(l)).redISub(o.redMul(f)),p=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(l,h,p)},Gu.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),i=this.y,o=e.y.redMul(t).redMul(this.z),a=r.redSub(n),s=i.redSub(o);if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=a.redSqr(),u=c.redMul(a),f=r.redMul(c),d=s.redSqr().redIAdd(u).redISub(f).redISub(f),l=s.redMul(f.redISub(d)).redISub(i.redMul(u)),h=this.z.redMul(a);return this.curve.jpoint(d,l,h)},Gu.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var r=this;for(t=0;t=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},Gu.prototype.inspect=function(){return this.isInfinity()?"":""},Gu.prototype.isInfinity=function(){return 0===this.z.cmpn(0)};var Vu=Nu((function(e,t){var r=t;r.base=Uu,r.short=Ju,r.mont=null,r.edwards=null})),Zu=Nu((function(e,t){var r,n=t,i=$u.assert;function o(e){"short"===e.type?this.curve=new Vu.short(e):"edwards"===e.type?this.curve=new Vu.edwards(e):this.curve=new Vu.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,i(this.g.validate(),"Invalid curve"),i(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function a(e,t){Object.defineProperty(n,e,{configurable:!0,enumerable:!0,get:function(){var r=new o(t);return Object.defineProperty(n,e,{configurable:!0,enumerable:!0,value:r}),r}})}n.PresetCurve=o,a("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:nr.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),a("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:nr.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),a("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:nr.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),a("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:nr.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"]}),a("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:nr.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"]}),a("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:nr.sha256,gRed:!1,g:["9"]}),a("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:nr.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{r=null.crash()}catch(e){r=void 0}a("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:nr.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})}));function Xu(e){if(!(this instanceof Xu))return new Xu(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=ju.toArray(e.entropy,e.entropyEnc||"hex"),r=ju.toArray(e.nonce,e.nonceEnc||"hex"),n=ju.toArray(e.pers,e.persEnc||"hex");Ou(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}var Qu=Xu;Xu.prototype._init=function(e,t,r){var n=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},Xu.prototype.generate=function(e,t,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(n=r,r=t,t=null),r&&(r=ju.toArray(r,n||"hex"),this._update(r));for(var i=[];i.length"};var rf=$u.assert;function nf(e,t){if(e instanceof nf)return e;this._importDER(e,t)||(rf(e.r&&e.s,"Signature without r or s"),this.r=new uo(e.r,16),this.s=new uo(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}var of=nf;function af(){this.place=0}function sf(e,t){var r=e[t.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var i=0,o=0,a=t.place;o>>=0;return!(i<=127)&&(t.place=a,i)}function cf(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}nf.prototype._importDER=function(e,t){e=$u.toArray(e,t);var r=new af;if(48!==e[r.place++])return!1;var n=sf(e,r);if(!1===n)return!1;if(n+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var i=sf(e,r);if(!1===i)return!1;var o=e.slice(r.place,i+r.place);if(r.place+=i,2!==e[r.place++])return!1;var a=sf(e,r);if(!1===a)return!1;if(e.length!==a+r.place)return!1;var s=e.slice(r.place,a+r.place);if(0===o[0]){if(!(128&o[1]))return!1;o=o.slice(1)}if(0===s[0]){if(!(128&s[1]))return!1;s=s.slice(1)}return this.r=new uo(o),this.s=new uo(s),this.recoveryParam=null,!0},nf.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=cf(t),r=cf(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];uf(n,t.length),(n=n.concat(t)).push(2),uf(n,r.length);var i=n.concat(r),o=[48];return uf(o,i.length),o=o.concat(i),$u.encode(o,e)};var ff=function(){throw new Error("unsupported")},df=$u.assert;function lf(e){if(!(this instanceof lf))return new lf(e);"string"==typeof e&&(df(Object.prototype.hasOwnProperty.call(Zu,e),"Unknown curve "+e),e=Zu[e]),e instanceof Zu.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}var hf=lf;lf.prototype.keyPair=function(e){return new tf(this,e)},lf.prototype.keyFromPrivate=function(e,t){return tf.fromPrivate(this,e,t)},lf.prototype.keyFromPublic=function(e,t){return tf.fromPublic(this,e,t)},lf.prototype.genKeyPair=function(e){e||(e={});for(var t=new Qu({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||ff(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),n=this.n.sub(new uo(2));;){var i=new uo(t.generate(r));if(!(i.cmp(n)>0))return i.iaddn(1),this.keyFromPrivate(i)}},lf.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},lf.prototype.sign=function(e,t,r,n){"object"==typeof r&&(n=r,r=null),n||(n={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new uo(e,16));for(var i=this.n.byteLength(),o=t.getPrivate().toArray("be",i),a=e.toArray("be",i),s=new Qu({hash:this.hash,entropy:o,nonce:a,pers:n.pers,persEnc:n.persEnc||"utf8"}),c=this.n.sub(new uo(1)),u=0;;u++){var f=n.k?n.k(u):new uo(s.generate(this.n.byteLength()));if(!((f=this._truncateToN(f,!0)).cmpn(1)<=0||f.cmp(c)>=0)){var d=this.g.mul(f);if(!d.isInfinity()){var l=d.getX(),h=l.umod(this.n);if(0!==h.cmpn(0)){var p=f.invm(this.n).mul(h.mul(t.getPrivate()).iadd(e));if(0!==(p=p.umod(this.n)).cmpn(0)){var m=(d.getY().isOdd()?1:0)|(0!==l.cmp(h)?2:0);return n.canonical&&p.cmp(this.nh)>0&&(p=this.n.sub(p),m^=1),new of({r:h,s:p,recoveryParam:m})}}}}}},lf.prototype.verify=function(e,t,r,n){e=this._truncateToN(new uo(e,16)),r=this.keyFromPublic(r,n);var i=(t=new of(t,"hex")).r,o=t.s;if(i.cmpn(1)<0||i.cmp(this.n)>=0)return!1;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var a,s=o.invm(this.n),c=s.mul(e).umod(this.n),u=s.mul(i).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(c,r.getPublic(),u)).isInfinity()&&a.eqXToP(i):!(a=this.g.mulAdd(c,r.getPublic(),u)).isInfinity()&&0===a.getX().umod(this.n).cmp(i)},lf.prototype.recoverPubKey=function(e,t,r,n){df((3&r)===r,"The recovery param is more than two bits"),t=new of(t,n);var i=this.n,o=new uo(e),a=t.r,s=t.s,c=1&r,u=r>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&u)throw new Error("Unable to find sencond key candinate");a=u?this.curve.pointFromX(a.add(this.curve.n),c):this.curve.pointFromX(a,c);var f=t.r.invm(i),d=i.sub(o).mul(f).umod(i),l=s.mul(f).umod(i);return this.g.mulAdd(d,a,l)},lf.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new of(t,n)).recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(e,t,i)}catch(e){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")};var pf=Nu((function(e,t){var r=t;r.version="6.5.4",r.utils=$u,r.rand=function(){throw new Error("unsupported")},r.curve=Vu,r.curves=Zu,r.ec=hf,r.eddsa=null})),mf=pf.ec;const gf=new wo("signing-key/5.7.0");let yf=null;function bf(){return yf||(yf=new mf("secp256k1")),yf}class vf{constructor(e){ga(this,"curve","secp256k1"),ga(this,"privateKey",To(e)),32!==jo(this.privateKey)&&gf.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const t=bf().keyFromPrivate(Mo(this.privateKey));ga(this,"publicKey","0x"+t.getPublic(!1,"hex")),ga(this,"compressedPublicKey","0x"+t.getPublic(!0,"hex")),ga(this,"_isSigningKey",!0)}_addPoint(e){const t=bf().keyFromPublic(Mo(this.publicKey)),r=bf().keyFromPublic(Mo(e));return"0x"+t.pub.add(r.pub).encodeCompressed("hex")}signDigest(e){const t=bf().keyFromPrivate(Mo(this.privateKey)),r=Mo(e);32!==r.length&&gf.throwArgumentError("bad digest length","digest",e);const n=t.sign(r,{canonical:!0});return Uo({recoveryParam:n.recoveryParam,r:zo("0x"+n.r.toString(16),32),s:zo("0x"+n.s.toString(16),32)})}computeSharedSecret(e){const t=bf().keyFromPrivate(Mo(this.privateKey)),r=bf().keyFromPublic(Mo(Af(e)));return zo("0x"+t.derive(r.getPublic()).toString(16),32)}static isSigningKey(e){return!(!e||!e._isSigningKey)}}function wf(e,t){const r=Uo(t),n={r:Mo(r.r),s:Mo(r.s)};return"0x"+bf().recoverPubKey(Mo(e),n,r.recoveryParam).encode("hex",!1)}function Af(e,t){const r=Mo(e);if(32===r.length){const e=new vf(r);return t?"0x"+bf().keyFromPrivate(r).getPublic(!0,"hex"):e.publicKey}return 33===r.length?t?To(r):"0x"+bf().keyFromPublic(r).getPublic(!1,"hex"):65===r.length?t?"0x"+bf().keyFromPublic(r).getPublic(!0,"hex"):To(r):gf.throwArgumentError("invalid public or private key","key","[REDACTED]")}var _f=Object.freeze({__proto__:null,SigningKey:vf,computePublicKey:Af,recoverPublicKey:wf});const Ef=new wo("transactions/5.7.0");var Sf;function Pf(e){return"0x"===e?null:As(e)}function xf(e){return"0x"===e?$s:Zo.from(e)}!function(e){e[e.legacy=0]="legacy",e[e.eip2930=1]="eip2930",e[e.eip1559=2]="eip1559"}(Sf||(Sf={}));const kf=[{name:"nonce",maxLength:32,numeric:!0},{name:"gasPrice",maxLength:32,numeric:!0},{name:"gasLimit",maxLength:32,numeric:!0},{name:"to",length:20},{name:"value",maxLength:32,numeric:!0},{name:"data"}],Mf={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,type:!0,value:!0};function Cf(e){return As($o(os($o(Af(e),1)),12))}function If(e,t){return Cf(wf(Mo(e),t))}function Rf(e,t){const r=Io(Zo.from(e).toHexString());return r.length>32&&Ef.throwArgumentError("invalid length for "+t,"transaction:"+t,e),r}function Nf(e,t){return{address:As(e),storageKeys:(t||[]).map(((t,r)=>(32!==jo(t)&&Ef.throwArgumentError("invalid access list storageKey",`accessList[${e}:${r}]`,t),t.toLowerCase())))}}function Of(e){if(Array.isArray(e))return e.map(((e,t)=>Array.isArray(e)?(e.length>2&&Ef.throwArgumentError("access list expected to be [ address, storageKeys[] ]",`value[${t}]`,e),Nf(e[0],e[1])):Nf(e.address,e.storageKeys)));const t=Object.keys(e).map((t=>{const r=e[t].reduce(((e,t)=>(e[t]=!0,e)),{});return Nf(t,Object.keys(r).sort())}));return t.sort(((e,t)=>e.address.localeCompare(t.address))),t}function Tf(e){return Of(e).map((e=>[e.address,e.storageKeys]))}function jf(e,t){if(null!=e.gasPrice){const t=Zo.from(e.gasPrice),r=Zo.from(e.maxFeePerGas||0);t.eq(r)||Ef.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:t,maxFeePerGas:r})}const r=[Rf(e.chainId||0,"chainId"),Rf(e.nonce||0,"nonce"),Rf(e.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),Rf(e.maxFeePerGas||0,"maxFeePerGas"),Rf(e.gasLimit||0,"gasLimit"),null!=e.to?As(e.to):"0x",Rf(e.value||0,"value"),e.data||"0x",Tf(e.accessList||[])];if(t){const e=Uo(t);r.push(Rf(e.recoveryParam,"recoveryParam")),r.push(Io(e.r)),r.push(Io(e.s))}return Do(["0x02",ds(r)])}function $f(e,t){const r=[Rf(e.chainId||0,"chainId"),Rf(e.nonce||0,"nonce"),Rf(e.gasPrice||0,"gasPrice"),Rf(e.gasLimit||0,"gasLimit"),null!=e.to?As(e.to):"0x",Rf(e.value||0,"value"),e.data||"0x",Tf(e.accessList||[])];if(t){const e=Uo(t);r.push(Rf(e.recoveryParam,"recoveryParam")),r.push(Io(e.r)),r.push(Io(e.s))}return Do(["0x01",ds(r)])}function Df(e,t){if(null==e.type||0===e.type)return null!=e.accessList&&Ef.throwArgumentError("untyped transactions do not support accessList; include type: 1","transaction",e),function(e,t){va(e,Mf);const r=[];kf.forEach((function(t){let n=e[t.name]||[];const i={};t.numeric&&(i.hexPad="left"),n=Mo(To(n,i)),t.length&&n.length!==t.length&&n.length>0&&Ef.throwArgumentError("invalid length for "+t.name,"transaction:"+t.name,n),t.maxLength&&(n=Io(n),n.length>t.maxLength&&Ef.throwArgumentError("invalid length for "+t.name,"transaction:"+t.name,n)),r.push(To(n))}));let n=0;if(null!=e.chainId?(n=e.chainId,"number"!=typeof n&&Ef.throwArgumentError("invalid transaction.chainId","transaction",e)):t&&!Po(t)&&t.v>28&&(n=Math.floor((t.v-35)/2)),0!==n&&(r.push(To(n)),r.push("0x"),r.push("0x")),!t)return ds(r);const i=Uo(t);let o=27+i.recoveryParam;return 0!==n?(r.pop(),r.pop(),r.pop(),o+=2*n+8,i.v>28&&i.v!==o&&Ef.throwArgumentError("transaction.chainId/signature.v mismatch","signature",t)):i.v!==o&&Ef.throwArgumentError("transaction.chainId/signature.v mismatch","signature",t),r.push(To(o)),r.push(Io(Mo(i.r))),r.push(Io(Mo(i.s))),ds(r)}(e,t);switch(e.type){case 1:return $f(e,t);case 2:return jf(e,t)}return Ef.throwError(`unsupported transaction type: ${e.type}`,wo.errors.UNSUPPORTED_OPERATION,{operation:"serializeTransaction",transactionType:e.type})}function Bf(e,t,r){try{const r=xf(t[0]).toNumber();if(0!==r&&1!==r)throw new Error("bad recid");e.v=r}catch(e){Ef.throwArgumentError("invalid v for transaction type: 1","v",t[0])}e.r=zo(t[1],32),e.s=zo(t[2],32);try{const t=os(r(e));e.from=If(t,{r:e.r,s:e.s,recoveryParam:e.v})}catch(e){}}function Ff(e){const t=Mo(e);if(t[0]>127)return function(e){const t=ps(e);9!==t.length&&6!==t.length&&Ef.throwArgumentError("invalid raw transaction","rawTransaction",e);const r={nonce:xf(t[0]).toNumber(),gasPrice:xf(t[1]),gasLimit:xf(t[2]),to:Pf(t[3]),value:xf(t[4]),data:t[5],chainId:0};if(6===t.length)return r;try{r.v=Zo.from(t[6]).toNumber()}catch(e){return r}if(r.r=zo(t[7],32),r.s=zo(t[8],32),Zo.from(r.r).isZero()&&Zo.from(r.s).isZero())r.chainId=r.v,r.v=0;else{r.chainId=Math.floor((r.v-35)/2),r.chainId<0&&(r.chainId=0);let n=r.v-27;const i=t.slice(0,6);0!==r.chainId&&(i.push(To(r.chainId)),i.push("0x"),i.push("0x"),n-=2*r.chainId+8);const o=os(ds(i));try{r.from=If(o,{r:To(r.r),s:To(r.s),recoveryParam:n})}catch(e){}r.hash=os(e)}return r.type=null,r}(t);switch(t[0]){case 1:return function(e){const t=ps(e.slice(1));8!==t.length&&11!==t.length&&Ef.throwArgumentError("invalid component count for transaction type: 1","payload",To(e));const r={type:1,chainId:xf(t[0]).toNumber(),nonce:xf(t[1]).toNumber(),gasPrice:xf(t[2]),gasLimit:xf(t[3]),to:Pf(t[4]),value:xf(t[5]),data:t[6],accessList:Of(t[7])};return 8===t.length||(r.hash=os(e),Bf(r,t.slice(8),$f)),r}(t);case 2:return function(e){const t=ps(e.slice(1));9!==t.length&&12!==t.length&&Ef.throwArgumentError("invalid component count for transaction type: 2","payload",To(e));const r=xf(t[2]),n=xf(t[3]),i={type:2,chainId:xf(t[0]).toNumber(),nonce:xf(t[1]).toNumber(),maxPriorityFeePerGas:r,maxFeePerGas:n,gasPrice:null,gasLimit:xf(t[4]),to:Pf(t[5]),value:xf(t[6]),data:t[7],accessList:Of(t[8])};return 9===t.length||(i.hash=os(e),Bf(i,t.slice(9),jf)),i}(t)}return Ef.throwError(`unsupported transaction type: ${t[0]}`,wo.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:t[0]})}var zf=Object.freeze({__proto__:null,get TransactionTypes(){return Sf},accessListify:Of,computeAddress:Cf,parse:Ff,recoverAddress:If,serialize:Df});var Uf=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))};const Lf=new wo("contracts/5.7.0");function qf(e,t){return Uf(this,void 0,void 0,(function*(){const r=yield t;"string"!=typeof r&&Lf.throwArgumentError("invalid address or ENS name","name",r);try{return As(r)}catch(e){}e||Lf.throwError("a provider or signer is needed to resolve ENS names",wo.errors.UNSUPPORTED_OPERATION,{operation:"resolveName"});const n=yield e.resolveName(r);return null==n&&Lf.throwArgumentError("resolver or addr is not configured for ENS name","name",r),n}))}function Hf(e,t,r){return Uf(this,void 0,void 0,(function*(){return Array.isArray(r)?yield Promise.all(r.map(((r,n)=>Hf(e,Array.isArray(t)?t[n]:t[r.name],r)))):"address"===r.type?yield qf(e,t):"tuple"===r.type?yield Hf(e,t,r.components):"array"===r.baseType?Array.isArray(t)?yield Promise.all(t.map((t=>Hf(e,t,r.arrayChildren)))):Promise.reject(Lf.makeError("invalid value for array",wo.errors.INVALID_ARGUMENT,{argument:"value",value:t})):t}))}function Kf(e,t,r){return Uf(this,void 0,void 0,(function*(){let n={};r.length===t.inputs.length+1&&"object"==typeof r[r.length-1]&&(n=wa(r.pop())),Lf.checkArgumentCount(r.length,t.inputs.length,"passed to contract"),e.signer?n.from?n.from=ba({override:qf(e.signer,n.from),signer:e.signer.getAddress()}).then((e=>Uf(this,void 0,void 0,(function*(){return As(e.signer)!==e.override&&Lf.throwError("Contract with a Signer cannot override from",wo.errors.UNSUPPORTED_OPERATION,{operation:"overrides.from"}),e.override})))):n.from=e.signer.getAddress():n.from&&(n.from=qf(e.provider,n.from));const i=yield ba({args:Hf(e.signer||e.provider,r,t.inputs),address:e.resolvedAddress,overrides:ba(n)||{}}),o=e.interface.encodeFunctionData(t,i.args),a={data:o,to:i.address},s=i.overrides;if(null!=s.nonce&&(a.nonce=Zo.from(s.nonce).toNumber()),null!=s.gasLimit&&(a.gasLimit=Zo.from(s.gasLimit)),null!=s.gasPrice&&(a.gasPrice=Zo.from(s.gasPrice)),null!=s.maxFeePerGas&&(a.maxFeePerGas=Zo.from(s.maxFeePerGas)),null!=s.maxPriorityFeePerGas&&(a.maxPriorityFeePerGas=Zo.from(s.maxPriorityFeePerGas)),null!=s.from&&(a.from=s.from),null!=s.type&&(a.type=s.type),null!=s.accessList&&(a.accessList=Of(s.accessList)),null==a.gasLimit&&null!=t.gas){let e=21e3;const r=Mo(o);for(let t=0;tnull!=n[e]));return c.length&&Lf.throwError(`cannot override ${c.map((e=>JSON.stringify(e))).join(",")}`,wo.errors.UNSUPPORTED_OPERATION,{operation:"overrides",overrides:c}),a}))}function Jf(e,t,r){const n=e.signer||e.provider;return function(...i){return Uf(this,void 0,void 0,(function*(){let o;if(i.length===t.inputs.length+1&&"object"==typeof i[i.length-1]){const e=wa(i.pop());null!=e.blockTag&&(o=yield e.blockTag),delete e.blockTag,i.push(e)}null!=e.deployTransaction&&(yield e._deployed(o));const a=yield Kf(e,t,i),s=yield n.call(a,o);try{let n=e.interface.decodeFunctionResult(t,s);return r&&1===t.outputs.length&&(n=n[0]),n}catch(t){throw t.code===wo.errors.CALL_EXCEPTION&&(t.address=e.address,t.args=i,t.transaction=a),t}}))}}function Wf(e,t){return function(...r){return Uf(this,void 0,void 0,(function*(){e.signer||Lf.throwError("sending a transaction requires a signer",wo.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction"}),null!=e.deployTransaction&&(yield e._deployed());const n=yield Kf(e,t,r),i=yield e.signer.sendTransaction(n);return function(e,t){const r=t.wait.bind(t);t.wait=t=>r(t).then((t=>(t.events=t.logs.map((r=>{let n=Sa(r),i=null;try{i=e.interface.parseLog(r)}catch(e){}return i&&(n.args=i.args,n.decode=(t,r)=>e.interface.decodeEventLog(i.eventFragment,t,r),n.event=i.name,n.eventSignature=i.signature),n.removeListener=()=>e.provider,n.getBlock=()=>e.provider.getBlock(t.blockHash),n.getTransaction=()=>e.provider.getTransaction(t.transactionHash),n.getTransactionReceipt=()=>Promise.resolve(t),n})),t)))}(e,i),i}))}}function Gf(e,t,r){return t.constant?Jf(e,t,r):Wf(e,t)}function Vf(e){return!e.address||null!=e.topics&&0!==e.topics.length?(e.address||"*")+"@"+(e.topics?e.topics.map((e=>Array.isArray(e)?e.join("|"):e)).join(":"):""):"*"}class Zf{constructor(e,t){ga(this,"tag",e),ga(this,"filter",t),this._listeners=[]}addListener(e,t){this._listeners.push({listener:e,once:t})}removeListener(e){let t=!1;this._listeners=this._listeners.filter((r=>!(!t&&r.listener===e)||(t=!0,!1)))}removeAllListeners(){this._listeners=[]}listeners(){return this._listeners.map((e=>e.listener))}listenerCount(){return this._listeners.length}run(e){const t=this.listenerCount();return this._listeners=this._listeners.filter((t=>{const r=e.slice();return setTimeout((()=>{t.listener.apply(this,r)}),0),!t.once})),t}prepareEvent(e){}getEmit(e){return[e]}}class Xf extends Zf{constructor(){super("error",null)}}class Qf extends Zf{constructor(e,t,r,n){const i={address:e};let o=t.getEventTopic(r);n?(o!==n[0]&&Lf.throwArgumentError("topic mismatch","topics",n),i.topics=n.slice()):i.topics=[o],super(Vf(i),i),ga(this,"address",e),ga(this,"interface",t),ga(this,"fragment",r)}prepareEvent(e){super.prepareEvent(e),e.event=this.fragment.name,e.eventSignature=this.fragment.format(),e.decode=(e,t)=>this.interface.decodeEventLog(this.fragment,e,t);try{e.args=this.interface.decodeEventLog(this.fragment,e.data,e.topics)}catch(t){e.args=null,e.decodeError=t}}getEmit(e){const t=Qa(e.args);if(t.length)throw t[0].error;const r=(e.args||[]).slice();return r.push(e),r}}class Yf extends Zf{constructor(e,t){super("*",{address:e}),ga(this,"address",e),ga(this,"interface",t)}prepareEvent(e){super.prepareEvent(e);try{const t=this.interface.parseLog(e);e.event=t.name,e.eventSignature=t.signature,e.decode=(e,r)=>this.interface.decodeEventLog(t.eventFragment,e,r),e.args=t.args}catch(e){}}}class ed{constructor(e,t,r){ga(this,"interface",ya(new.target,"getInterface")(t)),null==r?(ga(this,"provider",null),ga(this,"signer",null)):Iu.isSigner(r)?(ga(this,"provider",r.provider||null),ga(this,"signer",r)):Pu.isProvider(r)?(ga(this,"provider",r),ga(this,"signer",null)):Lf.throwArgumentError("invalid signer or provider","signerOrProvider",r),ga(this,"callStatic",{}),ga(this,"estimateGas",{}),ga(this,"functions",{}),ga(this,"populateTransaction",{}),ga(this,"filters",{});{const e={};Object.keys(this.interface.events).forEach((t=>{const r=this.interface.events[t];ga(this.filters,t,((...e)=>({address:this.address,topics:this.interface.encodeFilterTopics(r,e)}))),e[r.name]||(e[r.name]=[]),e[r.name].push(t)})),Object.keys(e).forEach((t=>{const r=e[t];1===r.length?ga(this.filters,t,this.filters[r[0]]):Lf.warn(`Duplicate definition of ${t} (${r.join(", ")})`)}))}if(ga(this,"_runningEvents",{}),ga(this,"_wrappedEmits",{}),null==e&&Lf.throwArgumentError("invalid contract address or ENS name","addressOrName",e),ga(this,"address",e),this.provider)ga(this,"resolvedAddress",qf(this.provider,e));else try{ga(this,"resolvedAddress",Promise.resolve(As(e)))}catch(e){Lf.throwError("provider is required to use ENS name as contract address",wo.errors.UNSUPPORTED_OPERATION,{operation:"new Contract"})}this.resolvedAddress.catch((e=>{}));const n={},i={};Object.keys(this.interface.functions).forEach((e=>{const t=this.interface.functions[e];if(i[e])Lf.warn(`Duplicate ABI entry for ${JSON.stringify(e)}`);else{i[e]=!0;{const r=t.name;n[`%${r}`]||(n[`%${r}`]=[]),n[`%${r}`].push(e)}null==this[e]&&ga(this,e,Gf(this,t,!0)),null==this.functions[e]&&ga(this.functions,e,Gf(this,t,!1)),null==this.callStatic[e]&&ga(this.callStatic,e,Jf(this,t,!0)),null==this.populateTransaction[e]&&ga(this.populateTransaction,e,function(e,t){return function(...r){return Kf(e,t,r)}}(this,t)),null==this.estimateGas[e]&&ga(this.estimateGas,e,function(e,t){const r=e.signer||e.provider;return function(...n){return Uf(this,void 0,void 0,(function*(){r||Lf.throwError("estimate require a provider or signer",wo.errors.UNSUPPORTED_OPERATION,{operation:"estimateGas"});const i=yield Kf(e,t,n);return yield r.estimateGas(i)}))}}(this,t))}})),Object.keys(n).forEach((e=>{const t=n[e];if(t.length>1)return;e=e.substring(1);const r=t[0];try{null==this[e]&&ga(this,e,this[r])}catch(e){}null==this.functions[e]&&ga(this.functions,e,this.functions[r]),null==this.callStatic[e]&&ga(this.callStatic,e,this.callStatic[r]),null==this.populateTransaction[e]&&ga(this.populateTransaction,e,this.populateTransaction[r]),null==this.estimateGas[e]&&ga(this.estimateGas,e,this.estimateGas[r])}))}static getContractAddress(e){return _s(e)}static getInterface(e){return wu.isInterface(e)?e:new wu(e)}deployed(){return this._deployed()}_deployed(e){return this._deployedPromise||(this.deployTransaction?this._deployedPromise=this.deployTransaction.wait().then((()=>this)):this._deployedPromise=this.provider.getCode(this.address,e).then((e=>("0x"===e&&Lf.throwError("contract not deployed",wo.errors.UNSUPPORTED_OPERATION,{contractAddress:this.address,operation:"getDeployed"}),this)))),this._deployedPromise}fallback(e){this.signer||Lf.throwError("sending a transactions require a signer",wo.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction(fallback)"});const t=wa(e||{});return["from","to"].forEach((function(e){null!=t[e]&&Lf.throwError("cannot override "+e,wo.errors.UNSUPPORTED_OPERATION,{operation:e})})),t.to=this.resolvedAddress,this.deployed().then((()=>this.signer.sendTransaction(t)))}connect(e){"string"==typeof e&&(e=new Ru(e,this.provider));const t=new this.constructor(this.address,this.interface,e);return this.deployTransaction&&ga(t,"deployTransaction",this.deployTransaction),t}attach(e){return new this.constructor(e,this.interface,this.signer||this.provider)}static isIndexed(e){return yu.isIndexed(e)}_normalizeRunningEvent(e){return this._runningEvents[e.tag]?this._runningEvents[e.tag]:e}_getRunningEvent(e){if("string"==typeof e){if("error"===e)return this._normalizeRunningEvent(new Xf);if("event"===e)return this._normalizeRunningEvent(new Zf("event",null));if("*"===e)return this._normalizeRunningEvent(new Yf(this.address,this.interface));const t=this.interface.getEvent(e);return this._normalizeRunningEvent(new Qf(this.address,this.interface,t))}if(e.topics&&e.topics.length>0){try{const t=e.topics[0];if("string"!=typeof t)throw new Error("invalid topic");const r=this.interface.getEvent(t);return this._normalizeRunningEvent(new Qf(this.address,this.interface,r,e.topics))}catch(e){}const t={address:this.address,topics:e.topics};return this._normalizeRunningEvent(new Zf(Vf(t),t))}return this._normalizeRunningEvent(new Yf(this.address,this.interface))}_checkRunningEvents(e){if(0===e.listenerCount()){delete this._runningEvents[e.tag];const t=this._wrappedEmits[e.tag];t&&e.filter&&(this.provider.off(e.filter,t),delete this._wrappedEmits[e.tag])}}_wrapEvent(e,t,r){const n=Sa(t);return n.removeListener=()=>{r&&(e.removeListener(r),this._checkRunningEvents(e))},n.getBlock=()=>this.provider.getBlock(t.blockHash),n.getTransaction=()=>this.provider.getTransaction(t.transactionHash),n.getTransactionReceipt=()=>this.provider.getTransactionReceipt(t.transactionHash),e.prepareEvent(n),n}_addEventListener(e,t,r){if(this.provider||Lf.throwError("events require a provider or a signer with a provider",wo.errors.UNSUPPORTED_OPERATION,{operation:"once"}),e.addListener(t,r),this._runningEvents[e.tag]=e,!this._wrappedEmits[e.tag]){const r=r=>{let n=this._wrapEvent(e,r,t);if(null==n.decodeError)try{const t=e.getEmit(n);this.emit(e.filter,...t)}catch(e){n.decodeError=e.error}null!=e.filter&&this.emit("event",n),null!=n.decodeError&&this.emit("error",n.decodeError,n)};this._wrappedEmits[e.tag]=r,null!=e.filter&&this.provider.on(e.filter,r)}}queryFilter(e,t,r){const n=this._getRunningEvent(e),i=wa(n.filter);return"string"==typeof t&&No(t,32)?(null!=r&&Lf.throwArgumentError("cannot specify toBlock with blockhash","toBlock",r),i.blockHash=t):(i.fromBlock=null!=t?t:0,i.toBlock=null!=r?r:"latest"),this.provider.getLogs(i).then((e=>e.map((e=>this._wrapEvent(n,e,null)))))}on(e,t){return this._addEventListener(this._getRunningEvent(e),t,!1),this}once(e,t){return this._addEventListener(this._getRunningEvent(e),t,!0),this}emit(e,...t){if(!this.provider)return!1;const r=this._getRunningEvent(e),n=r.run(t)>0;return this._checkRunningEvents(r),n}listenerCount(e){return this.provider?null==e?Object.keys(this._runningEvents).reduce(((e,t)=>e+this._runningEvents[t].listenerCount()),0):this._getRunningEvent(e).listenerCount():0}listeners(e){if(!this.provider)return[];if(null==e){const e=[];for(let t in this._runningEvents)this._runningEvents[t].listeners().forEach((t=>{e.push(t)}));return e}return this._getRunningEvent(e).listeners()}removeAllListeners(e){if(!this.provider)return this;if(null==e){for(const e in this._runningEvents){const t=this._runningEvents[e];t.removeAllListeners(),this._checkRunningEvents(t)}return this}const t=this._getRunningEvent(e);return t.removeAllListeners(),this._checkRunningEvents(t),this}off(e,t){if(!this.provider)return this;const r=this._getRunningEvent(e);return r.removeListener(t),this._checkRunningEvents(r),this}removeListener(e,t){return this.off(e,t)}}class td extends ed{}class rd{constructor(e){ga(this,"alphabet",e),ga(this,"base",e.length),ga(this,"_alphabetMap",{}),ga(this,"_leader",e.charAt(0));for(let t=0;t0;)r.push(n%this.base),n=n/this.base|0}let n="";for(let e=0;0===t[e]&&e=0;--e)n+=this.alphabet[r[e]];return n}decode(e){if("string"!=typeof e)throw new TypeError("Expected String");let t=[];if(0===e.length)return new Uint8Array(t);t.push(0);for(let r=0;r>=8;for(;i>0;)t.push(255&i),i>>=8}for(let r=0;e[r]===this._leader&&r>24&255,c[t.length+1]=d>>16&255,c[t.length+2]=d>>8&255,c[t.length+3]=255&d;let l=Mo(fd(i,e,c));o||(o=l.length,f=new Uint8Array(o),a=Math.ceil(n/o),u=n-(a-1)*o),f.set(l);for(let t=1;t=256)throw new Error("Depth too large!");return Pd(Co([null!=this.privateKey?"0x0488ADE4":"0x0488B21E",To(this.depth),this.parentFingerprint,zo(To(this.index),4),this.chainCode,null!=this.privateKey?Co(["0x00",this.privateKey]):this.publicKey]))}neuter(){return new Cd(kd,null,this.publicKey,this.parentFingerprint,this.chainCode,this.index,this.depth,this.path)}_derive(e){if(e>4294967295)throw new Error("invalid index - "+String(e));let t=this.path;t&&(t+="/"+(2147483647&e));const r=new Uint8Array(37);if(e&_d){if(!this.privateKey)throw new Error("cannot derive child of neutered node");r.set(Mo(this.privateKey),1),t&&(t+="'")}else r.set(Mo(this.publicKey));for(let t=24;t>=0;t-=8)r[33+(t>>3)]=e>>24-t&255;const n=Mo(fd(od.sha512,this.chainCode,r)),i=n.slice(0,32),o=n.slice(32);let a=null,s=null;if(this.privateKey)a=Sd(Zo.from(i).add(this.privateKey).mod(wd));else{s=new vf(To(i))._addPoint(this.publicKey)}let c=t;const u=this.mnemonic;return u&&(c=Object.freeze({phrase:u.phrase,path:t,locale:u.locale||"en"})),new Cd(kd,a,s,this.fingerprint,Sd(o),e,this.depth+1,c)}derivePath(e){const t=e.split("/");if(0===t.length||"m"===t[0]&&0!==this.depth)throw new Error("invalid path - "+e);"m"===t[0]&&t.shift();let r=this;for(let e=0;e=_d)throw new Error("invalid path index - "+n);r=r._derive(_d+e)}else{if(!n.match(/^[0-9]+$/))throw new Error("invalid path component - "+n);{const e=parseInt(n);if(e>=_d)throw new Error("invalid path index - "+n);r=r._derive(e)}}}return r}static _fromSeed(e,t){const r=Mo(e);if(r.length<16||r.length>64)throw new Error("invalid seed");const n=Mo(fd(od.sha512,Ad,r));return new Cd(kd,Sd(n.slice(0,32)),null,"0x00000000",Sd(n.slice(32)),0,0,t)}static fromMnemonic(e,t,r){return e=Nd(Rd(e,r=xd(r)),r),Cd._fromSeed(Id(e,t),{phrase:e,path:"m",locale:r.locale})}static fromSeed(e){return Cd._fromSeed(e,null)}static fromExtendedKey(e){const t=id.decode(e);82===t.length&&Pd(t.slice(0,78))===e||vd.throwArgumentError("invalid extended key","extendedKey","[REDACTED]");const r=t[4],n=To(t.slice(5,9)),i=parseInt(To(t.slice(9,13)).substring(2),16),o=To(t.slice(13,45)),a=t.slice(45,78);switch(To(t.slice(0,4))){case"0x0488b21e":case"0x043587cf":return new Cd(kd,null,To(a),n,o,i,r,null);case"0x0488ade4":case"0x04358394 ":if(0!==a[0])break;return new Cd(kd,To(a.slice(1)),null,n,o,i,r,null)}return vd.throwArgumentError("invalid extended key","extendedKey","[REDACTED]")}}function Id(e,t){t||(t="");const r=Ws("mnemonic"+t,Ls.NFKD);return ld(Ws(e,Ls.NFKD),r,2048,64,"sha512")}function Rd(e,t){t=xd(t),vd.checkNormalize();const r=t.split(e);if(r.length%3!=0)throw new Error("invalid mnemonic");const n=Mo(new Uint8Array(Math.ceil(11*r.length/8)));let i=0;for(let e=0;e>3]|=1<<7-i%8),i++}const o=32*r.length/3,a=Ed(r.length/3);if((Mo(ud(n.slice(0,o/8)))[0]&a)!==(n[n.length-1]&a))throw new Error("invalid checksum");return To(n.slice(0,o/8))}function Nd(e,t){if(t=xd(t),(e=Mo(e)).length%4!=0||e.length<16||e.length>32)throw new Error("invalid entropy");const r=[0];let n=11;for(let t=0;t8?(r[r.length-1]<<=8,r[r.length-1]|=e[t],n-=8):(r[r.length-1]<<=n,r[r.length-1]|=e[t]>>8-n,r.push(e[t]&(1<<8-n)-1),n+=3);const i=e.length/4,o=Mo(ud(e))[0]&Ed(i);return r[r.length-1]<<=i,r[r.length-1]|=o>>8-i,t.join(r.map((e=>t.getWord(e))))}var Od=Object.freeze({__proto__:null,HDNode:Cd,defaultPath:Md,entropyToMnemonic:Nd,getAccountPath:function(e){return("number"!=typeof e||e<0||e>=_d||e%1)&&vd.throwArgumentError("invalid account index","index",e),`m/44'/60'/${e}'/0/0`},isValidMnemonic:function(e,t){try{return Rd(e,t),!0}catch(e){}return!1},mnemonicToEntropy:Rd,mnemonicToSeed:Id});const Td=new wo("random/5.7.0");const jd=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")}();let $d=jd.crypto||jd.msCrypto;function Dd(e){(e<=0||e>1024||e%1||e!=e)&&Td.throwArgumentError("invalid length","length",e);const t=new Uint8Array(e);return $d.getRandomValues(t),Mo(t)}$d&&$d.getRandomValues||(Td.warn("WARNING: Missing strong random number source"),$d={getRandomValues:function(e){return Td.throwError("no secure random source avaialble",wo.errors.UNSUPPORTED_OPERATION,{operation:"crypto.getRandomValues"})}});var Bd=Object.freeze({__proto__:null,randomBytes:Dd,shuffled:function(e){for(let t=(e=e.slice()).length-1;t>0;t--){const r=Math.floor(Math.random()*(t+1)),n=e[t];e[t]=e[r],e[r]=n}return e}}),Fd={exports:{}};!function(e,t){!function(t){function r(e){return parseInt(e)===e}function n(e){if(!r(e.length))return!1;for(var t=0;t255)return!1;return!0}function i(e,t){if(e.buffer&&ArrayBuffer.isView(e)&&"Uint8Array"===e.name)return t&&(e=e.slice?e.slice():Array.prototype.slice.call(e)),e;if(Array.isArray(e)){if(!n(e))throw new Error("Array contains invalid value: "+e);return new Uint8Array(e)}if(r(e.length)&&n(e))return new Uint8Array(e);throw new Error("unsupported array-like object")}function o(e){return new Uint8Array(e)}function a(e,t,r,n,i){null==n&&null==i||(e=e.slice?e.slice(n,i):Array.prototype.slice.call(e,n,i)),t.set(e,r)}var s,c={toBytes:function(e){var t=[],r=0;for(e=encodeURI(e);r191&&n<224?(t.push(String.fromCharCode((31&n)<<6|63&e[r+1])),r+=2):(t.push(String.fromCharCode((15&n)<<12|(63&e[r+1])<<6|63&e[r+2])),r+=3)}return t.join("")}},u=(s="0123456789abcdef",{toBytes:function(e){for(var t=[],r=0;r>4]+s[15&n])}return t.join("")}}),f={16:10,24:12,32:14},d=[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],l=[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],h=[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],p=[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],m=[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],g=[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],y=[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],b=[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],v=[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],w=[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],A=[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],_=[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],E=[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],S=[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],P=[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 x(e){for(var t=[],r=0;r>2,this._Ke[r][t%4]=o[t],this._Kd[e-r][t%4]=o[t];for(var a,s=0,c=i;c>16&255]<<24^l[a>>8&255]<<16^l[255&a]<<8^l[a>>24&255]^d[s]<<24,s+=1,8!=i)for(t=1;t>8&255]<<8^l[a>>16&255]<<16^l[a>>24&255]<<24;for(t=i/2+1;t>2,h=c%4,this._Ke[u][h]=o[t],this._Kd[e-u][h]=o[t++],c++}for(var u=1;u>24&255]^E[a>>16&255]^S[a>>8&255]^P[255&a]},k.prototype.encrypt=function(e){if(16!=e.length)throw new Error("invalid plaintext size (must be 16 bytes)");for(var t=this._Ke.length-1,r=[0,0,0,0],n=x(e),i=0;i<4;i++)n[i]^=this._Ke[0][i];for(var a=1;a>24&255]^m[n[(i+1)%4]>>16&255]^g[n[(i+2)%4]>>8&255]^y[255&n[(i+3)%4]]^this._Ke[a][i];n=r.slice()}var s,c=o(16);for(i=0;i<4;i++)s=this._Ke[t][i],c[4*i]=255&(l[n[i]>>24&255]^s>>24),c[4*i+1]=255&(l[n[(i+1)%4]>>16&255]^s>>16),c[4*i+2]=255&(l[n[(i+2)%4]>>8&255]^s>>8),c[4*i+3]=255&(l[255&n[(i+3)%4]]^s);return c},k.prototype.decrypt=function(e){if(16!=e.length)throw new Error("invalid ciphertext size (must be 16 bytes)");for(var t=this._Kd.length-1,r=[0,0,0,0],n=x(e),i=0;i<4;i++)n[i]^=this._Kd[0][i];for(var a=1;a>24&255]^v[n[(i+3)%4]>>16&255]^w[n[(i+2)%4]>>8&255]^A[255&n[(i+1)%4]]^this._Kd[a][i];n=r.slice()}var s,c=o(16);for(i=0;i<4;i++)s=this._Kd[t][i],c[4*i]=255&(h[n[i]>>24&255]^s>>24),c[4*i+1]=255&(h[n[(i+3)%4]>>16&255]^s>>16),c[4*i+2]=255&(h[n[(i+2)%4]>>8&255]^s>>8),c[4*i+3]=255&(h[255&n[(i+1)%4]]^s);return c};var M=function(e){if(!(this instanceof M))throw Error("AES must be instanitated with `new`");this.description="Electronic Code Block",this.name="ecb",this._aes=new k(e)};M.prototype.encrypt=function(e){if((e=i(e)).length%16!=0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var t=o(e.length),r=o(16),n=0;n=0;--t)this._counter[t]=e%256,e>>=8},N.prototype.setBytes=function(e){if(16!=(e=i(e,!0)).length)throw new Error("invalid counter bytes size (must be 16 bytes)");this._counter=e},N.prototype.increment=function(){for(var e=15;e>=0;e--){if(255!==this._counter[e]){this._counter[e]++;break}this._counter[e]=0}};var O=function(e,t){if(!(this instanceof O))throw Error("AES must be instanitated with `new`");this.description="Counter",this.name="ctr",t instanceof N||(t=new N(t)),this._counter=t,this._remainingCounter=null,this._remainingCounterIndex=16,this._aes=new k(e)};O.prototype.encrypt=function(e){for(var t=i(e,!0),r=0;r16)throw new Error("PKCS#7 padding byte out of range");for(var r=e.length-t,n=0;n=64;){let h,p,m,g,y,b=r,v=n,w=i,A=o,_=a,E=s,S=c,P=u;for(p=0;p<16;p++)m=d+4*p,f[p]=(255&e[m])<<24|(255&e[m+1])<<16|(255&e[m+2])<<8|255&e[m+3];for(p=16;p<64;p++)h=f[p-2],g=(h>>>17|h<<15)^(h>>>19|h<<13)^h>>>10,h=f[p-15],y=(h>>>7|h<<25)^(h>>>18|h<<14)^h>>>3,f[p]=(g+f[p-7]|0)+(y+f[p-16]|0)|0;for(p=0;p<64;p++)g=(((_>>>6|_<<26)^(_>>>11|_<<21)^(_>>>25|_<<7))+(_&E^~_&S)|0)+(P+(t[p]+f[p]|0)|0)|0,y=((b>>>2|b<<30)^(b>>>13|b<<19)^(b>>>22|b<<10))+(b&v^b&w^v&w)|0,P=S,S=E,E=_,_=A+g|0,A=w,w=v,v=b,b=g+y|0;r=r+b|0,n=n+v|0,i=i+w|0,o=o+A|0,a=a+_|0,s=s+E|0,c=c+S|0,u=u+P|0,d+=64,l-=64}}d(e);let l,h=e.length%64,p=e.length/536870912|0,m=e.length<<3,g=h<56?56:120,y=e.slice(e.length-h,e.length);for(y.push(128),l=h+1;l>>24&255),y.push(p>>>16&255),y.push(p>>>8&255),y.push(p>>>0&255),y.push(m>>>24&255),y.push(m>>>16&255),y.push(m>>>8&255),y.push(m>>>0&255),d(y),[r>>>24&255,r>>>16&255,r>>>8&255,r>>>0&255,n>>>24&255,n>>>16&255,n>>>8&255,n>>>0&255,i>>>24&255,i>>>16&255,i>>>8&255,i>>>0&255,o>>>24&255,o>>>16&255,o>>>8&255,o>>>0&255,a>>>24&255,a>>>16&255,a>>>8&255,a>>>0&255,s>>>24&255,s>>>16&255,s>>>8&255,s>>>0&255,c>>>24&255,c>>>16&255,c>>>8&255,c>>>0&255,u>>>24&255,u>>>16&255,u>>>8&255,u>>>0&255]}function i(e,t,r){e=e.length<=64?e:n(e);const i=64+t.length+4,o=new Array(i),a=new Array(64);let s,c=[];for(s=0;s<64;s++)o[s]=54;for(s=0;s=i-4;e--){if(o[e]++,o[e]<=255)return;o[e]=0}}for(;r>=32;)u(),c=c.concat(n(a.concat(n(o)))),r-=32;return r>0&&(u(),c=c.concat(n(a.concat(n(o))).slice(0,r))),c}function o(e,t,r,n,i){let o;for(u(e,16*(2*r-1),i,0,16),o=0;o<2*r;o++)c(e,16*o,i,16),s(i,n),u(i,0,e,t+16*o,16);for(o=0;o>>32-t}function s(e,t){u(e,0,t,0,16);for(let e=8;e>0;e-=2)t[4]^=a(t[0]+t[12],7),t[8]^=a(t[4]+t[0],9),t[12]^=a(t[8]+t[4],13),t[0]^=a(t[12]+t[8],18),t[9]^=a(t[5]+t[1],7),t[13]^=a(t[9]+t[5],9),t[1]^=a(t[13]+t[9],13),t[5]^=a(t[1]+t[13],18),t[14]^=a(t[10]+t[6],7),t[2]^=a(t[14]+t[10],9),t[6]^=a(t[2]+t[14],13),t[10]^=a(t[6]+t[2],18),t[3]^=a(t[15]+t[11],7),t[7]^=a(t[3]+t[15],9),t[11]^=a(t[7]+t[3],13),t[15]^=a(t[11]+t[7],18),t[1]^=a(t[0]+t[3],7),t[2]^=a(t[1]+t[0],9),t[3]^=a(t[2]+t[1],13),t[0]^=a(t[3]+t[2],18),t[6]^=a(t[5]+t[4],7),t[7]^=a(t[6]+t[5],9),t[4]^=a(t[7]+t[6],13),t[5]^=a(t[4]+t[7],18),t[11]^=a(t[10]+t[9],7),t[8]^=a(t[11]+t[10],9),t[9]^=a(t[8]+t[11],13),t[10]^=a(t[9]+t[8],18),t[12]^=a(t[15]+t[14],7),t[13]^=a(t[12]+t[15],9),t[14]^=a(t[13]+t[12],13),t[15]^=a(t[14]+t[13],18);for(let r=0;r<16;++r)e[r]+=t[r]}function c(e,t,r,n){for(let i=0;i=256)return!1}return!0}function d(e,t){if("number"!=typeof e||e%1)throw new Error("invalid "+t);return e}function l(e,t,n,a,s,l,h){if(n=d(n,"N"),a=d(a,"r"),s=d(s,"p"),l=d(l,"dkLen"),0===n||0!=(n&n-1))throw new Error("N must be power of 2");if(n>r/128/a)throw new Error("N too large");if(a>r/128/s)throw new Error("r too large");if(!f(e))throw new Error("password must be an array or buffer");if(e=Array.prototype.slice.call(e),!f(t))throw new Error("salt must be an array or buffer");t=Array.prototype.slice.call(t);let p=i(e,t,128*s*a);const m=new Uint32Array(32*s*a);for(let e=0;eC&&(t=C);for(let e=0;eC&&(t=C);for(let e=0;e>0&255),p.push(m[e]>>8&255),p.push(m[e]>>16&255),p.push(m[e]>>24&255);const r=i(e,p,l);return h&&h(null,1,r),r}h&&I(R)};if(!h)for(;;){const e=R();if(null!=e)return e}R()}const h={scrypt:function(e,t,r,n,i,o,a){return new Promise((function(s,c){let u=0;a&&a(0),l(e,t,r,n,i,o,(function(e,t,r){if(e)c(e);else if(r)a&&1!==u&&a(1),s(new Uint8Array(r));else if(a&&t!==u)return u=t,a(t)}))}))},syncScrypt:function(e,t,r,n,i,o){return new Uint8Array(l(e,t,r,n,i,o))}};e.exports=h}()}(Qd);var Yd=u(Qd.exports),el=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))};const tl=new wo(Ud);function rl(e){return null!=e&&e.mnemonic&&e.mnemonic.phrase}class nl extends Pa{isKeystoreAccount(e){return!(!e||!e._isKeystoreAccount)}}function il(e,t){const r=Ld(Kd(e,"crypto/ciphertext"));if(To(os(Co([t.slice(16,32),r]))).substring(2)!==Kd(e,"crypto/mac").toLowerCase())throw new Error("invalid password");const n=function(e,t,r){if("aes-128-ctr"===Kd(e,"crypto/cipher")){const n=Ld(Kd(e,"crypto/cipherparams/iv")),i=new zd.Counter(n);return Mo(new zd.ModeOfOperation.ctr(t,i).decrypt(r))}return null}(e,t.slice(0,16),r);n||tl.throwError("unsupported cipher",wo.errors.UNSUPPORTED_OPERATION,{operation:"decrypt"});const i=t.slice(32,64),o=Cf(n);if(e.address){let t=e.address.toLowerCase();if("0x"!==t.substring(0,2)&&(t="0x"+t),As(t)!==o)throw new Error("address mismatch")}const a={_isKeystoreAccount:!0,address:o,privateKey:To(n)};if("0.1"===Kd(e,"x-ethers/version")){const t=Ld(Kd(e,"x-ethers/mnemonicCiphertext")),r=Ld(Kd(e,"x-ethers/mnemonicCounter")),n=new zd.Counter(r),o=new zd.ModeOfOperation.ctr(i,n),s=Kd(e,"x-ethers/path")||Md,c=Kd(e,"x-ethers/locale")||"en",u=Mo(o.decrypt(t));try{const e=Nd(u,c),t=Cd.fromMnemonic(e,null,c).derivePath(s);if(t.privateKey!=a.privateKey)throw new Error("mnemonic mismatch");a.mnemonic=t.mnemonic}catch(e){if(e.code!==wo.errors.INVALID_ARGUMENT||"wordlist"!==e.argument)throw e}}return new nl(a)}function ol(e,t,r,n,i){return Mo(ld(e,t,r,n,i))}function al(e,t,r,n,i){return Promise.resolve(ol(e,t,r,n,i))}function sl(e,t,r,n,i){const o=Hd(t),a=Kd(e,"crypto/kdf");if(a&&"string"==typeof a){const t=function(e,t){return tl.throwArgumentError("invalid key-derivation function parameters",e,t)};if("scrypt"===a.toLowerCase()){const r=Ld(Kd(e,"crypto/kdfparams/salt")),s=parseInt(Kd(e,"crypto/kdfparams/n")),c=parseInt(Kd(e,"crypto/kdfparams/r")),u=parseInt(Kd(e,"crypto/kdfparams/p"));s&&c&&u||t("kdf",a),0!=(s&s-1)&&t("N",s);const f=parseInt(Kd(e,"crypto/kdfparams/dklen"));return 32!==f&&t("dklen",f),n(o,r,s,c,u,64,i)}if("pbkdf2"===a.toLowerCase()){const n=Ld(Kd(e,"crypto/kdfparams/salt"));let i=null;const a=Kd(e,"crypto/kdfparams/prf");"hmac-sha256"===a?i="sha256":"hmac-sha512"===a?i="sha512":t("prf",a);const s=parseInt(Kd(e,"crypto/kdfparams/c")),c=parseInt(Kd(e,"crypto/kdfparams/dklen"));return 32!==c&&t("dklen",c),r(o,n,s,c,i)}}return tl.throwArgumentError("unsupported key-derivation function","kdf",a)}function cl(e,t){const r=JSON.parse(e);return il(r,sl(r,t,ol,Yd.syncScrypt))}function ul(e,t,r){return el(this,void 0,void 0,(function*(){const n=JSON.parse(e);return il(n,yield sl(n,t,al,Yd.scrypt,r))}))}function fl(e,t,r,n){try{if(As(e.address)!==Cf(e.privateKey))throw new Error("address/privateKey mismatch");if(rl(e)){const t=e.mnemonic;if(Cd.fromMnemonic(t.phrase,null,t.locale).derivePath(t.path||Md).privateKey!=e.privateKey)throw new Error("mnemonic mismatch")}}catch(e){return Promise.reject(e)}"function"!=typeof r||n||(n=r,r={}),r||(r={});const i=Mo(e.privateKey),o=Hd(t);let a=null,s=null,c=null;if(rl(e)){const t=e.mnemonic;a=Mo(Rd(t.phrase,t.locale||"en")),s=t.path||Md,c=t.locale||"en"}let u=r.client;u||(u="ethers.js");let f=null;f=r.salt?Mo(r.salt):Dd(32);let d=null;if(r.iv){if(d=Mo(r.iv),16!==d.length)throw new Error("invalid iv")}else d=Dd(16);let l=null;if(r.uuid){if(l=Mo(r.uuid),16!==l.length)throw new Error("invalid uuid")}else l=Dd(16);let h=1<<17,p=8,m=1;return r.scrypt&&(r.scrypt.N&&(h=r.scrypt.N),r.scrypt.r&&(p=r.scrypt.r),r.scrypt.p&&(m=r.scrypt.p)),Yd.scrypt(o,f,h,p,m,64,n).then((t=>{const r=(t=Mo(t)).slice(0,16),n=t.slice(16,32),o=t.slice(32,64),g=new zd.Counter(d),y=Mo(new zd.ModeOfOperation.ctr(r,g).encrypt(i)),b=os(Co([n,y])),v={address:e.address.substring(2).toLowerCase(),id:Jd(l),version:3,crypto:{cipher:"aes-128-ctr",cipherparams:{iv:To(d).substring(2)},ciphertext:To(y).substring(2),kdf:"scrypt",kdfparams:{salt:To(f).substring(2),n:h,dklen:32,p:m,r:p},mac:b.substring(2)}};if(a){const e=Dd(16),t=new zd.Counter(e),r=Mo(new zd.ModeOfOperation.ctr(o,t).encrypt(a)),n=new Date,i=n.getUTCFullYear()+"-"+qd(n.getUTCMonth()+1,2)+"-"+qd(n.getUTCDate(),2)+"T"+qd(n.getUTCHours(),2)+"-"+qd(n.getUTCMinutes(),2)+"-"+qd(n.getUTCSeconds(),2)+".0Z";v["x-ethers"]={client:u,gethFilename:"UTC--"+i+"--"+v.address,mnemonicCounter:To(e).substring(2),mnemonicCiphertext:To(r).substring(2),path:s,locale:c,version:"0.1"}}return JSON.stringify(v)}))}function dl(e,t,r){if(Zd(e)){r&&r(0);const n=Vd(e,t);return r&&r(1),Promise.resolve(n)}return Xd(e)?ul(e,t,r):Promise.reject(new Error("invalid JSON wallet"))}function ll(e,t){if(Zd(e))return Vd(e,t);if(Xd(e))return cl(e,t);throw new Error("invalid JSON wallet")}var hl=Object.freeze({__proto__:null,decryptCrowdsale:Vd,decryptJsonWallet:dl,decryptJsonWalletSync:ll,decryptKeystore:ul,decryptKeystoreSync:cl,encryptKeystore:fl,getJsonWalletAddress:function(e){if(Zd(e))try{return As(JSON.parse(e).ethaddr)}catch(e){return null}if(Xd(e))try{return As(JSON.parse(e).address)}catch(e){return null}return null},isCrowdsaleWallet:Zd,isKeystoreWallet:Xd});var pl=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))};const ml=new wo("wallet/5.7.0");class gl extends Iu{constructor(e,t){if(super(),null!=(r=e)&&No(r.privateKey,32)&&null!=r.address){const t=new vf(e.privateKey);if(ga(this,"_signingKey",(()=>t)),ga(this,"address",Cf(this.publicKey)),this.address!==As(e.address)&&ml.throwArgumentError("privateKey/address mismatch","privateKey","[REDACTED]"),function(e){const t=e.mnemonic;return t&&t.phrase}(e)){const t=e.mnemonic;ga(this,"_mnemonic",(()=>({phrase:t.phrase,path:t.path||Md,locale:t.locale||"en"})));const r=this.mnemonic;Cf(Cd.fromMnemonic(r.phrase,null,r.locale).derivePath(r.path).privateKey)!==this.address&&ml.throwArgumentError("mnemonic/address mismatch","privateKey","[REDACTED]")}else ga(this,"_mnemonic",(()=>null))}else{if(vf.isSigningKey(e))"secp256k1"!==e.curve&&ml.throwArgumentError("unsupported curve; must be secp256k1","privateKey","[REDACTED]"),ga(this,"_signingKey",(()=>e));else{"string"==typeof e&&e.match(/^[0-9a-f]*$/i)&&64===e.length&&(e="0x"+e);const t=new vf(e);ga(this,"_signingKey",(()=>t))}ga(this,"_mnemonic",(()=>null)),ga(this,"address",Cf(this.publicKey))}var r;t&&!Pu.isProvider(t)&&ml.throwArgumentError("invalid provider","provider",t),ga(this,"provider",t||null)}get mnemonic(){return this._mnemonic()}get privateKey(){return this._signingKey().privateKey}get publicKey(){return this._signingKey().publicKey}getAddress(){return Promise.resolve(this.address)}connect(e){return new gl(this,e)}signTransaction(e){return ba(e).then((t=>{null!=t.from&&(As(t.from)!==this.address&&ml.throwArgumentError("transaction from address mismatch","transaction.from",e.from),delete t.from);const r=this._signingKey().signDigest(os(Df(t)));return Df(t,r)}))}signMessage(e){return pl(this,void 0,void 0,(function*(){return Lo(this._signingKey().signDigest(Vc(e)))}))}_signTypedData(e,t,r){return pl(this,void 0,void 0,(function*(){const n=yield du.resolveNames(e,t,r,(e=>(null==this.provider&&ml.throwError("cannot resolve ENS names without a provider",wo.errors.UNSUPPORTED_OPERATION,{operation:"resolveName",value:e}),this.provider.resolveName(e))));return Lo(this._signingKey().signDigest(du.hash(n.domain,t,n.value)))}))}encrypt(e,t,r){if("function"!=typeof t||r||(r=t,t={}),r&&"function"!=typeof r)throw new Error("invalid callback");return t||(t={}),fl(this,e,t,r)}static createRandom(e){let t=Dd(16);e||(e={}),e.extraEntropy&&(t=Mo($o(os(Co([t,e.extraEntropy])),0,16)));const r=Nd(t,e.locale);return gl.fromMnemonic(r,e.path,e.locale)}static fromEncryptedJson(e,t,r){return dl(e,t,r).then((e=>new gl(e)))}static fromEncryptedJsonSync(e,t){return new gl(ll(e,t))}static fromMnemonic(e,t,r){return t||(t=Md),new gl(Cd.fromMnemonic(e,null,r).derivePath(t))}}var yl=Object.freeze({__proto__:null,Wallet:gl,verifyMessage:function(e,t){return If(Vc(e),t)},verifyTypedData:function(e,t,r,n){return If(du.hash(e,t,r),n)}});const bl=new wo("networks/5.7.1");function vl(e){const t=function(t,r){null==r&&(r={});const n=[];if(t.InfuraProvider&&"-"!==r.infura)try{n.push(new t.InfuraProvider(e,r.infura))}catch(e){}if(t.EtherscanProvider&&"-"!==r.etherscan)try{n.push(new t.EtherscanProvider(e,r.etherscan))}catch(e){}if(t.AlchemyProvider&&"-"!==r.alchemy)try{n.push(new t.AlchemyProvider(e,r.alchemy))}catch(e){}if(t.PocketProvider&&"-"!==r.pocket){const i=["goerli","ropsten","rinkeby","sepolia"];try{const o=new t.PocketProvider(e,r.pocket);o.network&&-1===i.indexOf(o.network.name)&&n.push(o)}catch(e){}}if(t.CloudflareProvider&&"-"!==r.cloudflare)try{n.push(new t.CloudflareProvider(e))}catch(e){}if(t.AnkrProvider&&"-"!==r.ankr)try{const i=["ropsten"],o=new t.AnkrProvider(e,r.ankr);o.network&&-1===i.indexOf(o.network.name)&&n.push(o)}catch(e){}if(0===n.length)return null;if(t.FallbackProvider){let i=1;return null!=r.quorum?i=r.quorum:"homestead"===e&&(i=2),new t.FallbackProvider(n,i)}return n[0]};return t.renetwork=function(e){return vl(e)},t}function wl(e,t){const r=function(r,n){return r.JsonRpcProvider?new r.JsonRpcProvider(e,t):null};return r.renetwork=function(t){return wl(e,t)},r}const Al={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:vl("homestead")},_l={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:vl("ropsten")},El={chainId:63,name:"classicMordor",_defaultProvider:wl("https://www.ethercluster.com/mordor","classicMordor")},Sl={unspecified:{chainId:0,name:"unspecified"},homestead:Al,mainnet:Al,morden:{chainId:2,name:"morden"},ropsten:_l,testnet:_l,rinkeby:{chainId:4,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"rinkeby",_defaultProvider:vl("rinkeby")},kovan:{chainId:42,name:"kovan",_defaultProvider:vl("kovan")},goerli:{chainId:5,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"goerli",_defaultProvider:vl("goerli")},kintsugi:{chainId:1337702,name:"kintsugi"},sepolia:{chainId:11155111,name:"sepolia",_defaultProvider:vl("sepolia")},classic:{chainId:61,name:"classic",_defaultProvider:wl("https://www.ethercluster.com/etc","classic")},classicMorden:{chainId:62,name:"classicMorden"},classicMordor:El,classicTestnet:El,classicKotti:{chainId:6,name:"classicKotti",_defaultProvider:wl("https://www.ethercluster.com/kotti","classicKotti")},xdai:{chainId:100,name:"xdai"},matic:{chainId:137,name:"matic",_defaultProvider:vl("matic")},maticmum:{chainId:80001,name:"maticmum"},optimism:{chainId:10,name:"optimism",_defaultProvider:vl("optimism")},"optimism-kovan":{chainId:69,name:"optimism-kovan"},"optimism-goerli":{chainId:420,name:"optimism-goerli"},arbitrum:{chainId:42161,name:"arbitrum"},"arbitrum-rinkeby":{chainId:421611,name:"arbitrum-rinkeby"},"arbitrum-goerli":{chainId:421613,name:"arbitrum-goerli"},bnb:{chainId:56,name:"bnb"},bnbt:{chainId:97,name:"bnbt"}};var Pl=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))};function xl(e,t){return Pl(this,void 0,void 0,(function*(){null==t&&(t={});const r={method:t.method||"GET",headers:t.headers||{},body:t.body||void 0};if(!0!==t.skipFetchSetup&&(r.mode="cors",r.cache="no-cache",r.credentials="same-origin",r.redirect="follow",r.referrer="client"),null!=t.fetchOptions){const e=t.fetchOptions;e.mode&&(r.mode=e.mode),e.cache&&(r.cache=e.cache),e.credentials&&(r.credentials=e.credentials),e.redirect&&(r.redirect=e.redirect),e.referrer&&(r.referrer=e.referrer)}const n=yield fetch(e,r),i=yield n.arrayBuffer(),o={};return n.headers.forEach?n.headers.forEach(((e,t)=>{o[t.toLowerCase()]=e})):n.headers.keys().forEach((e=>{o[e.toLowerCase()]=n.headers.get(e)})),{headers:o,statusCode:n.status,statusMessage:n.statusText,body:Mo(new Uint8Array(i))}}))}var kl=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))};const Ml=new wo("web/5.7.1");function Cl(e){return new Promise((t=>{setTimeout(t,e)}))}function Il(e,t){if(null==e)return null;if("string"==typeof e)return e;if(Po(e)){if(t&&("text"===t.split("/")[0]||"application/json"===t.split(";")[0].trim()))try{return Zs(e)}catch(e){}return To(e)}return e}function Rl(e,t,r){const n="object"==typeof e&&null!=e.throttleLimit?e.throttleLimit:12;Ml.assertArgument(n>0&&n%1==0,"invalid connection throttle limit","connection.throttleLimit",n);const i="object"==typeof e?e.throttleCallback:null,o="object"==typeof e&&"number"==typeof e.throttleSlotInterval?e.throttleSlotInterval:100;Ml.assertArgument(o>0&&o%1==0,"invalid connection throttle slot interval","connection.throttleSlotInterval",o);const a="object"==typeof e&&!!e.errorPassThrough,s={};let c=null;const u={method:"GET"};let f=!1,d=12e4;if("string"==typeof e)c=e;else if("object"==typeof e){if(null!=e&&null!=e.url||Ml.throwArgumentError("missing URL","connection.url",e),c=e.url,"number"==typeof e.timeout&&e.timeout>0&&(d=e.timeout),e.headers)for(const t in e.headers)s[t.toLowerCase()]={key:t,value:String(e.headers[t])},["if-none-match","if-modified-since"].indexOf(t.toLowerCase())>=0&&(f=!0);if(u.allowGzip=!!e.allowGzip,null!=e.user&&null!=e.password){"https:"!==c.substring(0,6)&&!0!==e.allowInsecureAuthentication&&Ml.throwError("basic authentication requires a secure https url",wo.errors.INVALID_ARGUMENT,{argument:"url",url:c,user:e.user,password:"[REDACTED]"});const t=e.user+":"+e.password;s.authorization={key:"Authorization",value:"Basic "+vc(Ws(t))}}null!=e.skipFetchSetup&&(u.skipFetchSetup=!!e.skipFetchSetup),null!=e.fetchOptions&&(u.fetchOptions=wa(e.fetchOptions))}const l=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),h=c?c.match(l):null;if(h)try{const e={statusCode:200,statusMessage:"OK",headers:{"content-type":h[1]||"text/plain"},body:h[2]?bc(h[3]):(p=h[3],Ws(p.replace(/%([0-9a-f][0-9a-f])/gi,((e,t)=>String.fromCharCode(parseInt(t,16))))))};let t=e.body;return r&&(t=r(e.body,e)),Promise.resolve(t)}catch(e){Ml.throwError("processing response error",wo.errors.SERVER_ERROR,{body:Il(h[1],h[2]),error:e,requestBody:null,requestMethod:"GET",url:c})}var p;t&&(u.method="POST",u.body=t,null==s["content-type"]&&(s["content-type"]={key:"Content-Type",value:"application/octet-stream"}),null==s["content-length"]&&(s["content-length"]={key:"Content-Length",value:String(t.length)}));const m={};Object.keys(s).forEach((e=>{const t=s[e];m[t.key]=t.value})),u.headers=m;const g=function(){let e=null;return{promise:new Promise((function(t,r){d&&(e=setTimeout((()=>{null!=e&&(e=null,r(Ml.makeError("timeout",wo.errors.TIMEOUT,{requestBody:Il(u.body,m["content-type"]),requestMethod:u.method,timeout:d,url:c})))}),d))})),cancel:function(){null!=e&&(clearTimeout(e),e=null)}}}(),y=function(){return kl(this,void 0,void 0,(function*(){for(let e=0;e=300)&&(g.cancel(),Ml.throwError("bad response",wo.errors.SERVER_ERROR,{status:t.statusCode,headers:t.headers,body:Il(s,t.headers?t.headers["content-type"]:null),requestBody:Il(u.body,m["content-type"]),requestMethod:u.method,url:c})),r)try{const e=yield r(s,t);return g.cancel(),e}catch(r){if(r.throttleRetry&&e"content-type"===e.toLowerCase())).length||(r.headers=wa(r.headers),r.headers["content-type"]="application/json")}else r.headers={"content-type":"application/json"};e=r}return Rl(e,n,((e,t)=>{let n=null;if(null!=e)try{n=JSON.parse(Zs(e))}catch(t){Ml.throwError("invalid JSON",wo.errors.SERVER_ERROR,{body:e,error:t})}return r&&(n=r(n,t)),n}))}function Ol(e,t){return t||(t={}),null==(t=wa(t)).floor&&(t.floor=0),null==t.ceiling&&(t.ceiling=1e4),null==t.interval&&(t.interval=250),new Promise((function(r,n){let i=null,o=!1;const a=()=>!o&&(o=!0,i&&clearTimeout(i),!0);t.timeout&&(i=setTimeout((()=>{a()&&n(new Error("timeout"))}),t.timeout));const s=t.retryLimit;let c=0;!function i(){return e().then((function(e){if(void 0!==e)a()&&r(e);else if(t.oncePoll)t.oncePoll.once("poll",i);else if(t.onceBlock)t.onceBlock.once("block",i);else if(!o){if(c++,c>s)return void(a()&&n(new Error("retry limit reached")));let e=t.interval*parseInt(String(Math.random()*Math.pow(2,c)));et.ceiling&&(e=t.ceiling),setTimeout(i,e)}return null}),(function(e){a()&&n(e)}))}()}))}for(var Tl=Object.freeze({__proto__:null,_fetchData:Rl,fetchJson:Nl,poll:Ol}),jl="qpzry9x8gf2tvdw0s3jn54khce6mua7l",$l={},Dl=0;Dl>25;return(33554431&e)<<5^996825010&-(t>>0&1)^642813549&-(t>>1&1)^513874426&-(t>>2&1)^1027748829&-(t>>3&1)^705979059&-(t>>4&1)}function zl(e){for(var t=1,r=0;r126)return"Invalid prefix ("+e+")";t=Fl(t)^n>>5}for(t=Fl(t),r=0;rt)return"Exceeds length limit";var r=e.toLowerCase(),n=e.toUpperCase();if(e!==r&&e!==n)return"Mixed-case string "+e;var i=(e=r).lastIndexOf("1");if(-1===i)return"No separator character for "+e;if(0===i)return"Missing prefix for "+e;var o=e.slice(0,i),a=e.slice(i+1);if(a.length<6)return"Data too short";var s=zl(o);if("string"==typeof s)return s;for(var c=[],u=0;u=a.length||c.push(d)}return 1!==s?"Invalid checksum for "+e:{prefix:o,words:c}}function Ll(e,t,r,n){for(var i=0,o=0,a=(1<=r;)o-=r,s.push(i>>o&a);if(n)o>0&&s.push(i<=t)return"Excess padding";if(i<r)throw new TypeError("Exceeds length limit");var n=zl(e=e.toLowerCase());if("string"==typeof n)throw new Error(n);for(var i=e+"1",o=0;o>5!=0)throw new Error("Non 5-bit word");n=Fl(n)^a,i+=jl.charAt(a)}for(o=0;o<6;++o)n=Fl(n);for(n^=1,o=0;o<6;++o){i+=jl.charAt(n>>5*(5-o)&31)}return i},toWordsUnsafe:function(e){var t=Ll(e,8,5,!0);if(Array.isArray(t))return t},toWords:function(e){var t=Ll(e,8,5,!0);if(Array.isArray(t))return t;throw new Error(t)},fromWordsUnsafe:function(e){var t=Ll(e,5,8,!1);if(Array.isArray(t))return t},fromWords:function(e){var t=Ll(e,5,8,!1);if(Array.isArray(t))return t;throw new Error(t)}},Hl=u(ql);const Kl="providers/5.7.2",Jl=new wo(Kl);class Wl{constructor(){this.formats=this.getDefaultFormats()}getDefaultFormats(){const e={},t=this.address.bind(this),r=this.bigNumber.bind(this),n=this.blockTag.bind(this),i=this.data.bind(this),o=this.hash.bind(this),a=this.hex.bind(this),s=this.number.bind(this),c=this.type.bind(this);return e.transaction={hash:o,type:c,accessList:Wl.allowNull(this.accessList.bind(this),null),blockHash:Wl.allowNull(o,null),blockNumber:Wl.allowNull(s,null),transactionIndex:Wl.allowNull(s,null),confirmations:Wl.allowNull(s,null),from:t,gasPrice:Wl.allowNull(r),maxPriorityFeePerGas:Wl.allowNull(r),maxFeePerGas:Wl.allowNull(r),gasLimit:r,to:Wl.allowNull(t,null),value:r,nonce:s,data:i,r:Wl.allowNull(this.uint256),s:Wl.allowNull(this.uint256),v:Wl.allowNull(s),creates:Wl.allowNull(t,null),raw:Wl.allowNull(i)},e.transactionRequest={from:Wl.allowNull(t),nonce:Wl.allowNull(s),gasLimit:Wl.allowNull(r),gasPrice:Wl.allowNull(r),maxPriorityFeePerGas:Wl.allowNull(r),maxFeePerGas:Wl.allowNull(r),to:Wl.allowNull(t),value:Wl.allowNull(r),data:Wl.allowNull((e=>this.data(e,!0))),type:Wl.allowNull(s),accessList:Wl.allowNull(this.accessList.bind(this),null)},e.receiptLog={transactionIndex:s,blockNumber:s,transactionHash:o,address:t,topics:Wl.arrayOf(o),data:i,logIndex:s,blockHash:o},e.receipt={to:Wl.allowNull(this.address,null),from:Wl.allowNull(this.address,null),contractAddress:Wl.allowNull(t,null),transactionIndex:s,root:Wl.allowNull(a),gasUsed:r,logsBloom:Wl.allowNull(i),blockHash:o,transactionHash:o,logs:Wl.arrayOf(this.receiptLog.bind(this)),blockNumber:s,confirmations:Wl.allowNull(s,null),cumulativeGasUsed:r,effectiveGasPrice:Wl.allowNull(r),status:Wl.allowNull(s),type:c},e.block={hash:Wl.allowNull(o),parentHash:o,number:s,timestamp:s,nonce:Wl.allowNull(a),difficulty:this.difficulty.bind(this),gasLimit:r,gasUsed:r,miner:Wl.allowNull(t),extraData:i,transactions:Wl.allowNull(Wl.arrayOf(o)),baseFeePerGas:Wl.allowNull(r)},e.blockWithTransactions=wa(e.block),e.blockWithTransactions.transactions=Wl.allowNull(Wl.arrayOf(this.transactionResponse.bind(this))),e.filter={fromBlock:Wl.allowNull(n,void 0),toBlock:Wl.allowNull(n,void 0),blockHash:Wl.allowNull(o,void 0),address:Wl.allowNull(t,void 0),topics:Wl.allowNull(this.topics.bind(this),void 0)},e.filterLog={blockNumber:Wl.allowNull(s),blockHash:Wl.allowNull(o),transactionIndex:s,removed:Wl.allowNull(this.boolean.bind(this)),address:t,data:Wl.allowFalsish(i,"0x"),topics:Wl.arrayOf(o),transactionHash:o,logIndex:s},e}accessList(e){return Of(e||[])}number(e){return"0x"===e?0:Zo.from(e).toNumber()}type(e){return"0x"===e||null==e?0:Zo.from(e).toNumber()}bigNumber(e){return Zo.from(e)}boolean(e){if("boolean"==typeof e)return e;if("string"==typeof e){if("true"===(e=e.toLowerCase()))return!0;if("false"===e)return!1}throw new Error("invalid boolean - "+e)}hex(e,t){return"string"==typeof e&&(t||"0x"===e.substring(0,2)||(e="0x"+e),No(e))?e.toLowerCase():Jl.throwArgumentError("invalid hash","value",e)}data(e,t){const r=this.hex(e,t);if(r.length%2!=0)throw new Error("invalid data; odd-length - "+e);return r}address(e){return As(e)}callAddress(e){if(!No(e,32))return null;const t=As($o(e,12));return"0x0000000000000000000000000000000000000000"===t?null:t}contractAddress(e){return _s(e)}blockTag(e){if(null==e)return"latest";if("earliest"===e)return"0x0";switch(e){case"earliest":return"0x0";case"latest":case"pending":case"safe":case"finalized":return e}if("number"==typeof e||No(e))return Bo(e);throw new Error("invalid blockTag")}hash(e,t){const r=this.hex(e,t);return 32!==jo(r)?Jl.throwArgumentError("invalid hash","value",e):r}difficulty(e){if(null==e)return null;const t=Zo.from(e);try{return t.toNumber()}catch(e){}return null}uint256(e){if(!No(e))throw new Error("invalid uint256");return zo(e,32)}_block(e,t){null!=e.author&&null==e.miner&&(e.miner=e.author);const r=null!=e._difficulty?e._difficulty:e.difficulty,n=Wl.check(t,e);return n._difficulty=null==r?null:Zo.from(r),n}block(e){return this._block(e,this.formats.block)}blockWithTransactions(e){return this._block(e,this.formats.blockWithTransactions)}transactionRequest(e){return Wl.check(this.formats.transactionRequest,e)}transactionResponse(e){null!=e.gas&&null==e.gasLimit&&(e.gasLimit=e.gas),e.to&&Zo.from(e.to).isZero()&&(e.to="0x0000000000000000000000000000000000000000"),null!=e.input&&null==e.data&&(e.data=e.input),null==e.to&&null==e.creates&&(e.creates=this.contractAddress(e)),1!==e.type&&2!==e.type||null!=e.accessList||(e.accessList=[]);const t=Wl.check(this.formats.transaction,e);if(null!=e.chainId){let r=e.chainId;No(r)&&(r=Zo.from(r).toNumber()),t.chainId=r}else{let r=e.networkId;null==r&&null==t.v&&(r=e.chainId),No(r)&&(r=Zo.from(r).toNumber()),"number"!=typeof r&&null!=t.v&&(r=(t.v-35)/2,r<0&&(r=0),r=parseInt(r)),"number"!=typeof r&&(r=0),t.chainId=r}return t.blockHash&&"x"===t.blockHash.replace(/0/g,"")&&(t.blockHash=null),t}transaction(e){return Ff(e)}receiptLog(e){return Wl.check(this.formats.receiptLog,e)}receipt(e){const t=Wl.check(this.formats.receipt,e);if(null!=t.root)if(t.root.length<=4){const e=Zo.from(t.root).toNumber();0===e||1===e?(null!=t.status&&t.status!==e&&Jl.throwArgumentError("alt-root-status/status mismatch","value",{root:t.root,status:t.status}),t.status=e,delete t.root):Jl.throwArgumentError("invalid alt-root-status","value.root",t.root)}else 66!==t.root.length&&Jl.throwArgumentError("invalid root hash","value.root",t.root);return null!=t.status&&(t.byzantium=!0),t}topics(e){return Array.isArray(e)?e.map((e=>this.topics(e))):null!=e?this.hash(e,!0):null}filter(e){return Wl.check(this.formats.filter,e)}filterLog(e){return Wl.check(this.formats.filterLog,e)}static check(e,t){const r={};for(const n in e)try{const i=e[n](t[n]);void 0!==i&&(r[n]=i)}catch(e){throw e.checkKey=n,e.checkValue=t[n],e}return r}static allowNull(e,t){return function(r){return null==r?t:e(r)}}static allowFalsish(e,t){return function(r){return r?e(r):t}}static arrayOf(e){return function(t){if(!Array.isArray(t))throw new Error("not an array");const r=[];return t.forEach((function(t){r.push(e(t))})),r}}}var Gl=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))};const Vl=new wo(Kl);function Zl(e){return null==e?"null":(32!==jo(e)&&Vl.throwArgumentError("invalid topic","topic",e),e.toLowerCase())}function Xl(e){for(e=e.slice();e.length>0&&null==e[e.length-1];)e.pop();return e.map((e=>{if(Array.isArray(e)){const t={};e.forEach((e=>{t[Zl(e)]=!0}));const r=Object.keys(t);return r.sort(),r.join("|")}return Zl(e)})).join("&")}function Ql(e){if("string"==typeof e){if(32===jo(e=e.toLowerCase()))return"tx:"+e;if(-1===e.indexOf(":"))return e}else{if(Array.isArray(e))return"filter:*:"+Xl(e);if(Su.isForkEvent(e))throw Vl.warn("not implemented"),new Error("not implemented");if(e&&"object"==typeof e)return"filter:"+(e.address||"*")+":"+Xl(e.topics||[])}throw new Error("invalid event - "+e)}function Yl(){return(new Date).getTime()}function eh(e){return new Promise((t=>{setTimeout(t,e)}))}const th=["block","network","pending","poll"];class rh{constructor(e,t,r){ga(this,"tag",e),ga(this,"listener",t),ga(this,"once",r),this._lastBlockNumber=-2,this._inflight=!1}get event(){switch(this.type){case"tx":return this.hash;case"filter":return this.filter}return this.tag}get type(){return this.tag.split(":")[0]}get hash(){const e=this.tag.split(":");return"tx"!==e[0]?null:e[1]}get filter(){const e=this.tag.split(":");if("filter"!==e[0])return null;const t=e[1],r=""===(n=e[2])?[]:n.split(/&/g).map((e=>{if(""===e)return[];const t=e.split("|").map((e=>"null"===e?null:e));return 1===t.length?t[0]:t}));var n;const i={};return r.length>0&&(i.topics=r),t&&"*"!==t&&(i.address=t),i}pollable(){return this.tag.indexOf(":")>=0||th.indexOf(this.tag)>=0}}const nh={0:{symbol:"btc",p2pkh:0,p2sh:5,prefix:"bc"},2:{symbol:"ltc",p2pkh:48,p2sh:50,prefix:"ltc"},3:{symbol:"doge",p2pkh:30,p2sh:22},60:{symbol:"eth",ilk:"eth"},61:{symbol:"etc",ilk:"eth"},700:{symbol:"xdai",ilk:"eth"}};function ih(e){return zo(Zo.from(e).toHexString(),32)}function oh(e){return id.encode(Co([e,$o(ud(ud(e)),0,4)]))}const ah=new RegExp("^(ipfs)://(.*)$","i"),sh=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),ah,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function ch(e,t){try{return Zs(uh(e,t))}catch(e){}return null}function uh(e,t){if("0x"===e)return null;const r=Zo.from($o(e,t,t+32)).toNumber(),n=Zo.from($o(e,r,r+32)).toNumber();return $o(e,r+32,r+32+n)}function fh(e){return e.match(/^ipfs:\/\/ipfs\//i)?e=e.substring(12):e.match(/^ipfs:\/\//i)?e=e.substring(7):Vl.throwArgumentError("unsupported IPFS format","link",e),`https://gateway.ipfs.io/ipfs/${e}`}function dh(e){const t=Mo(e);if(t.length>32)throw new Error("internal; should not happen");const r=new Uint8Array(32);return r.set(t,32-t.length),r}function lh(e){if(e.length%32==0)return e;const t=new Uint8Array(32*Math.ceil(e.length/32));return t.set(e),t}function hh(e){const t=[];let r=0;for(let n=0;nZo.from(e).eq(1))).catch((e=>{if(e.code===wo.errors.CALL_EXCEPTION)return!1;throw this._supportsEip2544=null,e}))),this._supportsEip2544}_fetch(e,t){return Gl(this,void 0,void 0,(function*(){const r={to:this.address,ccipReadEnabled:!0,data:Do([e,Jc(this.name),t||"0x"])};let n=!1;(yield this.supportsWildcard())&&(n=!0,r.data=Do(["0x9061b923",hh([Wc(this.name),r.data])]));try{let e=yield this.provider.call(r);return Mo(e).length%32==4&&Vl.throwError("resolver threw error",wo.errors.CALL_EXCEPTION,{transaction:r,data:e}),n&&(e=uh(e,0)),e}catch(e){if(e.code===wo.errors.CALL_EXCEPTION)return null;throw e}}))}_fetchBytes(e,t){return Gl(this,void 0,void 0,(function*(){const r=yield this._fetch(e,t);return null!=r?uh(r,0):null}))}_getAddress(e,t){const r=nh[String(e)];if(null==r&&Vl.throwError(`unsupported coin type: ${e}`,wo.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`}),"eth"===r.ilk)return this.provider.formatter.address(t);const n=Mo(t);if(null!=r.p2pkh){const e=t.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);if(e){const t=parseInt(e[1],16);if(e[2].length===2*t&&t>=1&&t<=75)return oh(Co([[r.p2pkh],"0x"+e[2]]))}}if(null!=r.p2sh){const e=t.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(e){const t=parseInt(e[1],16);if(e[2].length===2*t&&t>=1&&t<=75)return oh(Co([[r.p2sh],"0x"+e[2]]))}}if(null!=r.prefix){const e=n[1];let t=n[0];if(0===t?20!==e&&32!==e&&(t=-1):t=-1,t>=0&&n.length===2+e&&e>=1&&e<=75){const e=Hl.toWords(n.slice(2));return e.unshift(t),Hl.encode(r.prefix,e)}}return null}getAddress(e){return Gl(this,void 0,void 0,(function*(){if(null==e&&(e=60),60===e)try{const e=yield this._fetch("0x3b3b57de");return"0x"===e||e===Fs?null:this.provider.formatter.callAddress(e)}catch(e){if(e.code===wo.errors.CALL_EXCEPTION)return null;throw e}const t=yield this._fetchBytes("0xf1cb7e06",ih(e));if(null==t||"0x"===t)return null;const r=this._getAddress(e,t);return null==r&&Vl.throwError("invalid or unsupported coin data",wo.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`,coinType:e,data:t}),r}))}getAvatar(){return Gl(this,void 0,void 0,(function*(){const e=[{type:"name",content:this.name}];try{const t=yield this.getText("avatar");if(null==t)return null;for(let r=0;re[t]))}return Vl.throwError("invalid or unsupported content hash data",wo.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:e})}))}getText(e){return Gl(this,void 0,void 0,(function*(){let t=Ws(e);t=Co([ih(64),ih(t.length),t]),t.length%32!=0&&(t=Co([t,zo("0x",32-e.length%32)]));const r=yield this._fetchBytes("0x59d1d43c",To(t));return null==r||"0x"===r?null:Zs(r)}))}}let mh=null,gh=1;class yh extends Pu{constructor(e){if(super(),this._events=[],this._emitted={block:-2},this.disableCcipRead=!1,this.formatter=new.target.getFormatter(),ga(this,"anyNetwork","any"===e),this.anyNetwork&&(e=this.detectNetwork()),e instanceof Promise)this._networkPromise=e,e.catch((e=>{})),this._ready().catch((e=>{}));else{const t=ya(new.target,"getNetwork")(e);t?(ga(this,"_network",t),this.emit("network",t,null)):Vl.throwArgumentError("invalid network","network",e)}this._maxInternalBlockNumber=-1024,this._lastBlockNumber=-2,this._maxFilterBlockRange=10,this._pollingInterval=4e3,this._fastQueryDate=0}_ready(){return Gl(this,void 0,void 0,(function*(){if(null==this._network){let e=null;if(this._networkPromise)try{e=yield this._networkPromise}catch(e){}null==e&&(e=yield this.detectNetwork()),e||Vl.throwError("no network detected",wo.errors.UNKNOWN_ERROR,{}),null==this._network&&(this.anyNetwork?this._network=e:ga(this,"_network",e),this.emit("network",e,null))}return this._network}))}get ready(){return Ol((()=>this._ready().then((e=>e),(e=>{if(e.code!==wo.errors.NETWORK_ERROR||"noNetwork"!==e.event)throw e}))))}static getFormatter(){return null==mh&&(mh=new Wl),mh}static getNetwork(e){return function(e){if(null==e)return null;if("number"==typeof e){for(const t in Sl){const r=Sl[t];if(r.chainId===e)return{name:r.name,chainId:r.chainId,ensAddress:r.ensAddress||null,_defaultProvider:r._defaultProvider||null}}return{chainId:e,name:"unknown"}}if("string"==typeof e){const t=Sl[e];return null==t?null:{name:t.name,chainId:t.chainId,ensAddress:t.ensAddress,_defaultProvider:t._defaultProvider||null}}const t=Sl[e.name];if(!t)return"number"!=typeof e.chainId&&bl.throwArgumentError("invalid network chainId","network",e),e;0!==e.chainId&&e.chainId!==t.chainId&&bl.throwArgumentError("network chainId mismatch","network",e);let r=e._defaultProvider||null;var n;return null==r&&t._defaultProvider&&(r=(n=t._defaultProvider)&&"function"==typeof n.renetwork?t._defaultProvider.renetwork(e):t._defaultProvider),{name:e.name,chainId:t.chainId,ensAddress:e.ensAddress||t.ensAddress||null,_defaultProvider:r}}(null==e?"homestead":e)}ccipReadFetch(e,t,r){return Gl(this,void 0,void 0,(function*(){if(this.disableCcipRead||0===r.length)return null;const n=e.to.toLowerCase(),i=t.toLowerCase(),o=[];for(let e=0;e=0?null:JSON.stringify({data:i,sender:n}),c=yield Nl({url:a,errorPassThrough:!0},s,((e,t)=>(e.status=t.statusCode,e)));if(c.data)return c.data;const u=c.message||"unknown error";if(c.status>=400&&c.status<500)return Vl.throwError(`response not found during CCIP fetch: ${u}`,wo.errors.SERVER_ERROR,{url:t,errorMessage:u});o.push(u)}return Vl.throwError(`error encountered during CCIP fetch: ${o.map((e=>JSON.stringify(e))).join(", ")}`,wo.errors.SERVER_ERROR,{urls:r,errorMessages:o})}))}_getInternalBlockNumber(e){return Gl(this,void 0,void 0,(function*(){if(yield this._ready(),e>0)for(;this._internalBlockNumber;){const t=this._internalBlockNumber;try{const r=yield t;if(Yl()-r.respTime<=e)return r.blockNumber;break}catch(e){if(this._internalBlockNumber===t)break}}const t=Yl(),r=ba({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then((e=>null),(e=>e))}).then((({blockNumber:e,networkError:n})=>{if(n)throw this._internalBlockNumber===r&&(this._internalBlockNumber=null),n;const i=Yl();return(e=Zo.from(e).toNumber()){this._internalBlockNumber===r&&(this._internalBlockNumber=null)})),(yield r).blockNumber}))}poll(){return Gl(this,void 0,void 0,(function*(){const e=gh++,t=[];let r=null;try{r=yield this._getInternalBlockNumber(100+this.pollingInterval/2)}catch(e){return void this.emit("error",e)}if(this._setFastBlockNumber(r),this.emit("poll",e,r),r!==this._lastBlockNumber){if(-2===this._emitted.block&&(this._emitted.block=r-1),Math.abs(this._emitted.block-r)>1e3)Vl.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${r})`),this.emit("error",Vl.makeError("network block skew detected",wo.errors.NETWORK_ERROR,{blockNumber:r,event:"blockSkew",previousBlockNumber:this._emitted.block})),this.emit("block",r);else for(let e=this._emitted.block+1;e<=r;e++)this.emit("block",e);this._emitted.block!==r&&(this._emitted.block=r,Object.keys(this._emitted).forEach((e=>{if("block"===e)return;const t=this._emitted[e];"pending"!==t&&r-t>12&&delete this._emitted[e]}))),-2===this._lastBlockNumber&&(this._lastBlockNumber=r-1),this._events.forEach((e=>{switch(e.type){case"tx":{const r=e.hash;let n=this.getTransactionReceipt(r).then((e=>e&&null!=e.blockNumber?(this._emitted["t:"+r]=e.blockNumber,this.emit(r,e),null):null)).catch((e=>{this.emit("error",e)}));t.push(n);break}case"filter":if(!e._inflight){e._inflight=!0,-2===e._lastBlockNumber&&(e._lastBlockNumber=r-1);const n=e.filter;n.fromBlock=e._lastBlockNumber+1,n.toBlock=r;const i=n.toBlock-this._maxFilterBlockRange;i>n.fromBlock&&(n.fromBlock=i),n.fromBlock<0&&(n.fromBlock=0);const o=this.getLogs(n).then((t=>{e._inflight=!1,0!==t.length&&t.forEach((t=>{t.blockNumber>e._lastBlockNumber&&(e._lastBlockNumber=t.blockNumber),this._emitted["b:"+t.blockHash]=t.blockNumber,this._emitted["t:"+t.transactionHash]=t.blockNumber,this.emit(n,t)}))})).catch((t=>{this.emit("error",t),e._inflight=!1}));t.push(o)}}})),this._lastBlockNumber=r,Promise.all(t).then((()=>{this.emit("didPoll",e)})).catch((e=>{this.emit("error",e)}))}else this.emit("didPoll",e)}))}resetEventsBlock(e){this._lastBlockNumber=e-1,this.polling&&this.poll()}get network(){return this._network}detectNetwork(){return Gl(this,void 0,void 0,(function*(){return Vl.throwError("provider does not support network detection",wo.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"})}))}getNetwork(){return Gl(this,void 0,void 0,(function*(){const e=yield this._ready(),t=yield this.detectNetwork();if(e.chainId!==t.chainId){if(this.anyNetwork)return this._network=t,this._lastBlockNumber=-2,this._fastBlockNumber=null,this._fastBlockNumberPromise=null,this._fastQueryDate=0,this._emitted.block=-2,this._maxInternalBlockNumber=-1024,this._internalBlockNumber=null,this.emit("network",t,e),yield eh(0),this._network;const r=Vl.makeError("underlying network changed",wo.errors.NETWORK_ERROR,{event:"changed",network:e,detectedNetwork:t});throw this.emit("error",r),r}return e}))}get blockNumber(){return this._getInternalBlockNumber(100+this.pollingInterval/2).then((e=>{this._setFastBlockNumber(e)}),(e=>{})),null!=this._fastBlockNumber?this._fastBlockNumber:-1}get polling(){return null!=this._poller}set polling(e){e&&!this._poller?(this._poller=setInterval((()=>{this.poll()}),this.pollingInterval),this._bootstrapPoll||(this._bootstrapPoll=setTimeout((()=>{this.poll(),this._bootstrapPoll=setTimeout((()=>{this._poller||this.poll(),this._bootstrapPoll=null}),this.pollingInterval)}),0))):!e&&this._poller&&(clearInterval(this._poller),this._poller=null)}get pollingInterval(){return this._pollingInterval}set pollingInterval(e){if("number"!=typeof e||e<=0||parseInt(String(e))!=e)throw new Error("invalid polling interval");this._pollingInterval=e,this._poller&&(clearInterval(this._poller),this._poller=setInterval((()=>{this.poll()}),this._pollingInterval))}_getFastBlockNumber(){const e=Yl();return e-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=e,this._fastBlockNumberPromise=this.getBlockNumber().then((e=>((null==this._fastBlockNumber||e>this._fastBlockNumber)&&(this._fastBlockNumber=e),this._fastBlockNumber)))),this._fastBlockNumberPromise}_setFastBlockNumber(e){null!=this._fastBlockNumber&&ethis._fastBlockNumber)&&(this._fastBlockNumber=e,this._fastBlockNumberPromise=Promise.resolve(e)))}waitForTransaction(e,t,r){return Gl(this,void 0,void 0,(function*(){return this._waitForTransaction(e,null==t?1:t,r||0,null)}))}_waitForTransaction(e,t,r,n){return Gl(this,void 0,void 0,(function*(){const i=yield this.getTransactionReceipt(e);return(i?i.confirmations:0)>=t?i:new Promise(((i,o)=>{const a=[];let s=!1;const c=function(){return!!s||(s=!0,a.forEach((e=>{e()})),!1)},u=e=>{e.confirmations{this.removeListener(e,u)})),n){let r=n.startBlock,i=null;const u=a=>Gl(this,void 0,void 0,(function*(){s||(yield eh(1e3),this.getTransactionCount(n.from).then((f=>Gl(this,void 0,void 0,(function*(){if(!s){if(f<=n.nonce)r=a;else{{const t=yield this.getTransaction(e);if(t&&null!=t.blockNumber)return}for(null==i&&(i=r-3,i{s||this.once("block",u)})))}));if(s)return;this.once("block",u),a.push((()=>{this.removeListener("block",u)}))}if("number"==typeof r&&r>0){const e=setTimeout((()=>{c()||o(Vl.makeError("timeout exceeded",wo.errors.TIMEOUT,{timeout:r}))}),r);e.unref&&e.unref(),a.push((()=>{clearTimeout(e)}))}}))}))}getBlockNumber(){return Gl(this,void 0,void 0,(function*(){return this._getInternalBlockNumber(0)}))}getGasPrice(){return Gl(this,void 0,void 0,(function*(){yield this.getNetwork();const e=yield this.perform("getGasPrice",{});try{return Zo.from(e)}catch(t){return Vl.throwError("bad result from backend",wo.errors.SERVER_ERROR,{method:"getGasPrice",result:e,error:t})}}))}getBalance(e,t){return Gl(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield ba({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),n=yield this.perform("getBalance",r);try{return Zo.from(n)}catch(e){return Vl.throwError("bad result from backend",wo.errors.SERVER_ERROR,{method:"getBalance",params:r,result:n,error:e})}}))}getTransactionCount(e,t){return Gl(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield ba({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),n=yield this.perform("getTransactionCount",r);try{return Zo.from(n).toNumber()}catch(e){return Vl.throwError("bad result from backend",wo.errors.SERVER_ERROR,{method:"getTransactionCount",params:r,result:n,error:e})}}))}getCode(e,t){return Gl(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield ba({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),n=yield this.perform("getCode",r);try{return To(n)}catch(e){return Vl.throwError("bad result from backend",wo.errors.SERVER_ERROR,{method:"getCode",params:r,result:n,error:e})}}))}getStorageAt(e,t,r){return Gl(this,void 0,void 0,(function*(){yield this.getNetwork();const n=yield ba({address:this._getAddress(e),blockTag:this._getBlockTag(r),position:Promise.resolve(t).then((e=>Bo(e)))}),i=yield this.perform("getStorageAt",n);try{return To(i)}catch(e){return Vl.throwError("bad result from backend",wo.errors.SERVER_ERROR,{method:"getStorageAt",params:n,result:i,error:e})}}))}_wrapTransaction(e,t,r){if(null!=t&&32!==jo(t))throw new Error("invalid response - sendTransaction");const n=e;return null!=t&&e.hash!==t&&Vl.throwError("Transaction hash mismatch from Provider.sendTransaction.",wo.errors.UNKNOWN_ERROR,{expectedHash:e.hash,returnedHash:t}),n.wait=(t,n)=>Gl(this,void 0,void 0,(function*(){let i;null==t&&(t=1),null==n&&(n=0),0!==t&&null!=r&&(i={data:e.data,from:e.from,nonce:e.nonce,to:e.to,value:e.value,startBlock:r});const o=yield this._waitForTransaction(e.hash,t,n,i);return null==o&&0===t?null:(this._emitted["t:"+e.hash]=o.blockNumber,0===o.status&&Vl.throwError("transaction failed",wo.errors.CALL_EXCEPTION,{transactionHash:e.hash,transaction:e,receipt:o}),o)})),n}sendTransaction(e){return Gl(this,void 0,void 0,(function*(){yield this.getNetwork();const t=yield Promise.resolve(e).then((e=>To(e))),r=this.formatter.transaction(e);null==r.confirmations&&(r.confirmations=0);const n=yield this._getInternalBlockNumber(100+2*this.pollingInterval);try{const e=yield this.perform("sendTransaction",{signedTransaction:t});return this._wrapTransaction(r,e,n)}catch(e){throw e.transaction=r,e.transactionHash=r.hash,e}}))}_getTransactionRequest(e){return Gl(this,void 0,void 0,(function*(){const t=yield e,r={};return["from","to"].forEach((e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then((e=>e?this._getAddress(e):null)))})),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach((e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then((e=>e?Zo.from(e):null)))})),["type"].forEach((e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then((e=>null!=e?e:null)))})),t.accessList&&(r.accessList=this.formatter.accessList(t.accessList)),["data"].forEach((e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then((e=>e?To(e):null)))})),this.formatter.transactionRequest(yield ba(r))}))}_getFilter(e){return Gl(this,void 0,void 0,(function*(){e=yield e;const t={};return null!=e.address&&(t.address=this._getAddress(e.address)),["blockHash","topics"].forEach((r=>{null!=e[r]&&(t[r]=e[r])})),["fromBlock","toBlock"].forEach((r=>{null!=e[r]&&(t[r]=this._getBlockTag(e[r]))})),this.formatter.filter(yield ba(t))}))}_call(e,t,r){return Gl(this,void 0,void 0,(function*(){r>=10&&Vl.throwError("CCIP read exceeded maximum redirections",wo.errors.SERVER_ERROR,{redirects:r,transaction:e});const n=e.to,i=yield this.perform("call",{transaction:e,blockTag:t});if(r>=0&&"latest"===t&&null!=n&&"0x556f1830"===i.substring(0,10)&&jo(i)%32==4)try{const o=$o(i,4),a=$o(o,0,32);Zo.from(a).eq(n)||Vl.throwError("CCIP Read sender did not match",wo.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:i});const s=[],c=Zo.from($o(o,32,64)).toNumber(),u=Zo.from($o(o,c,c+32)).toNumber(),f=$o(o,c+32);for(let t=0;tGl(this,void 0,void 0,(function*(){const e=yield this.perform("getBlock",n);if(null==e)return null!=n.blockHash&&null==this._emitted["b:"+n.blockHash]||null!=n.blockTag&&r>this._emitted.block?null:void 0;if(t){let t=null;for(let r=0;rthis._wrapTransaction(e))),r}return this.formatter.block(e)}))),{oncePoll:this})}))}getBlock(e){return this._getBlock(e,!1)}getBlockWithTransactions(e){return this._getBlock(e,!0)}getTransaction(e){return Gl(this,void 0,void 0,(function*(){yield this.getNetwork(),e=yield e;const t={transactionHash:this.formatter.hash(e,!0)};return Ol((()=>Gl(this,void 0,void 0,(function*(){const r=yield this.perform("getTransaction",t);if(null==r)return null==this._emitted["t:"+e]?null:void 0;const n=this.formatter.transactionResponse(r);if(null==n.blockNumber)n.confirmations=0;else if(null==n.confirmations){let e=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-n.blockNumber+1;e<=0&&(e=1),n.confirmations=e}return this._wrapTransaction(n)}))),{oncePoll:this})}))}getTransactionReceipt(e){return Gl(this,void 0,void 0,(function*(){yield this.getNetwork(),e=yield e;const t={transactionHash:this.formatter.hash(e,!0)};return Ol((()=>Gl(this,void 0,void 0,(function*(){const r=yield this.perform("getTransactionReceipt",t);if(null==r)return null==this._emitted["t:"+e]?null:void 0;if(null==r.blockHash)return;const n=this.formatter.receipt(r);if(null==n.blockNumber)n.confirmations=0;else if(null==n.confirmations){let e=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-n.blockNumber+1;e<=0&&(e=1),n.confirmations=e}return n}))),{oncePoll:this})}))}getLogs(e){return Gl(this,void 0,void 0,(function*(){yield this.getNetwork();const t=yield ba({filter:this._getFilter(e)}),r=yield this.perform("getLogs",t);return r.forEach((e=>{null==e.removed&&(e.removed=!1)})),Wl.arrayOf(this.formatter.filterLog.bind(this.formatter))(r)}))}getEtherPrice(){return Gl(this,void 0,void 0,(function*(){return yield this.getNetwork(),this.perform("getEtherPrice",{})}))}_getBlockTag(e){return Gl(this,void 0,void 0,(function*(){if("number"==typeof(e=yield e)&&e<0){e%1&&Vl.throwArgumentError("invalid BlockTag","blockTag",e);let t=yield this._getInternalBlockNumber(100+2*this.pollingInterval);return t+=e,t<0&&(t=0),this.formatter.blockTag(t)}return this.formatter.blockTag(e)}))}getResolver(e){return Gl(this,void 0,void 0,(function*(){let t=e;for(;;){if(""===t||"."===t)return null;if("eth"!==e&&"eth"===t)return null;const r=yield this._getResolver(t,"getResolver");if(null!=r){const n=new ph(this,r,e);return t===e||(yield n.supportsWildcard())?n:null}t=t.split(".").slice(1).join(".")}}))}_getResolver(e,t){return Gl(this,void 0,void 0,(function*(){null==t&&(t="ENS");const r=yield this.getNetwork();r.ensAddress||Vl.throwError("network does not support ENS",wo.errors.UNSUPPORTED_OPERATION,{operation:t,network:r.name});try{const t=yield this.call({to:r.ensAddress,data:"0x0178b8bf"+Jc(e).substring(2)});return this.formatter.callAddress(t)}catch(e){}return null}))}resolveName(e){return Gl(this,void 0,void 0,(function*(){e=yield e;try{return Promise.resolve(this.formatter.address(e))}catch(t){if(No(e))throw t}"string"!=typeof e&&Vl.throwArgumentError("invalid ENS name","name",e);const t=yield this.getResolver(e);return t?yield t.getAddress():null}))}lookupAddress(e){return Gl(this,void 0,void 0,(function*(){e=yield e;const t=(e=this.formatter.address(e)).substring(2).toLowerCase()+".addr.reverse",r=yield this._getResolver(t,"lookupAddress");if(null==r)return null;const n=ch(yield this.call({to:r,data:"0x691f3431"+Jc(t).substring(2)}),0);return(yield this.resolveName(n))!=e?null:n}))}getAvatar(e){return Gl(this,void 0,void 0,(function*(){let t=null;if(No(e)){const r=this.formatter.address(e).substring(2).toLowerCase()+".addr.reverse",n=yield this._getResolver(r,"getAvatar");if(!n)return null;t=new ph(this,n,r);try{const e=yield t.getAvatar();if(e)return e.url}catch(e){if(e.code!==wo.errors.CALL_EXCEPTION)throw e}try{const e=ch(yield this.call({to:n,data:"0x691f3431"+Jc(r).substring(2)}),0);t=yield this.getResolver(e)}catch(e){if(e.code!==wo.errors.CALL_EXCEPTION)throw e;return null}}else if(t=yield this.getResolver(e),!t)return null;const r=yield t.getAvatar();return null==r?null:r.url}))}perform(e,t){return Vl.throwError(e+" not implemented",wo.errors.NOT_IMPLEMENTED,{operation:e})}_startEvent(e){this.polling=this._events.filter((e=>e.pollable())).length>0}_stopEvent(e){this.polling=this._events.filter((e=>e.pollable())).length>0}_addEventListener(e,t,r){const n=new rh(Ql(e),t,r);return this._events.push(n),this._startEvent(n),this}on(e,t){return this._addEventListener(e,t,!1)}once(e,t){return this._addEventListener(e,t,!0)}emit(e,...t){let r=!1,n=[],i=Ql(e);return this._events=this._events.filter((e=>e.tag!==i||(setTimeout((()=>{e.listener.apply(this,t)}),0),r=!0,!e.once||(n.push(e),!1)))),n.forEach((e=>{this._stopEvent(e)})),r}listenerCount(e){if(!e)return this._events.length;let t=Ql(e);return this._events.filter((e=>e.tag===t)).length}listeners(e){if(null==e)return this._events.map((e=>e.listener));let t=Ql(e);return this._events.filter((e=>e.tag===t)).map((e=>e.listener))}off(e,t){if(null==t)return this.removeAllListeners(e);const r=[];let n=!1,i=Ql(e);return this._events=this._events.filter((e=>e.tag!==i||e.listener!=t||(!!n||(n=!0,r.push(e),!1)))),r.forEach((e=>{this._stopEvent(e)})),this}removeAllListeners(e){let t=[];if(null==e)t=this._events,this._events=[];else{const r=Ql(e);this._events=this._events.filter((e=>e.tag!==r||(t.push(e),!1)))}return t.forEach((e=>{this._stopEvent(e)})),this}}var bh=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))};const vh=new wo(Kl),wh=["call","estimateGas"];function Ah(e,t){if(null==e)return null;if("string"==typeof e.message&&e.message.match("reverted")){const r=No(e.data)?e.data:null;if(!t||r)return{message:e.message,data:r}}if("object"==typeof e){for(const r in e){const n=Ah(e[r],t);if(n)return n}return null}if("string"==typeof e)try{return Ah(JSON.parse(e),t)}catch(e){}return null}function _h(e,t,r){const n=r.transaction||r.signedTransaction;if("call"===e){const e=Ah(t,!0);if(e)return e.data;vh.throwError("missing revert data in call exception; Transaction reverted without a reason string",wo.errors.CALL_EXCEPTION,{data:"0x",transaction:n,error:t})}if("estimateGas"===e){let r=Ah(t.body,!1);null==r&&(r=Ah(t,!1)),r&&vh.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",wo.errors.UNPREDICTABLE_GAS_LIMIT,{reason:r.message,method:e,transaction:n,error:t})}let i=t.message;throw t.code===wo.errors.SERVER_ERROR&&t.error&&"string"==typeof t.error.message?i=t.error.message:"string"==typeof t.body?i=t.body:"string"==typeof t.responseText&&(i=t.responseText),i=(i||"").toLowerCase(),i.match(/insufficient funds|base fee exceeds gas limit|InsufficientFunds/i)&&vh.throwError("insufficient funds for intrinsic transaction cost",wo.errors.INSUFFICIENT_FUNDS,{error:t,method:e,transaction:n}),i.match(/nonce (is )?too low/i)&&vh.throwError("nonce has already been used",wo.errors.NONCE_EXPIRED,{error:t,method:e,transaction:n}),i.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&vh.throwError("replacement fee too low",wo.errors.REPLACEMENT_UNDERPRICED,{error:t,method:e,transaction:n}),i.match(/only replay-protected/i)&&vh.throwError("legacy pre-eip-155 transactions not supported",wo.errors.UNSUPPORTED_OPERATION,{error:t,method:e,transaction:n}),wh.indexOf(e)>=0&&i.match(/gas required exceeds allowance|always failing transaction|execution reverted|revert/)&&vh.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",wo.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,method:e,transaction:n}),t}function Eh(e){return new Promise((function(t){setTimeout(t,e)}))}function Sh(e){if(e.error){const t=new Error(e.error.message);throw t.code=e.error.code,t.data=e.error.data,t}return e.result}function Ph(e){return e?e.toLowerCase():e}const xh={};class kh extends Iu{constructor(e,t,r){if(super(),e!==xh)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");ga(this,"provider",t),null==r&&(r=0),"string"==typeof r?(ga(this,"_address",this.provider.formatter.address(r)),ga(this,"_index",null)):"number"==typeof r?(ga(this,"_index",r),ga(this,"_address",null)):vh.throwArgumentError("invalid address or index","addressOrIndex",r)}connect(e){return vh.throwError("cannot alter JSON-RPC Signer connection",wo.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}connectUnchecked(){return new Mh(xh,this.provider,this._address||this._index)}getAddress(){return this._address?Promise.resolve(this._address):this.provider.send("eth_accounts",[]).then((e=>(e.length<=this._index&&vh.throwError("unknown account #"+this._index,wo.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),this.provider.formatter.address(e[this._index]))))}sendUncheckedTransaction(e){e=wa(e);const t=this.getAddress().then((e=>(e&&(e=e.toLowerCase()),e)));if(null==e.gasLimit){const r=wa(e);r.from=t,e.gasLimit=this.provider.estimateGas(r)}return null!=e.to&&(e.to=Promise.resolve(e.to).then((e=>bh(this,void 0,void 0,(function*(){if(null==e)return null;const t=yield this.provider.resolveName(e);return null==t&&vh.throwArgumentError("provided ENS name resolves to null","tx.to",e),t}))))),ba({tx:ba(e),sender:t}).then((({tx:t,sender:r})=>{null!=t.from?t.from.toLowerCase()!==r&&vh.throwArgumentError("from address mismatch","transaction",e):t.from=r;const n=this.provider.constructor.hexlifyTransaction(t,{from:!0});return this.provider.send("eth_sendTransaction",[n]).then((e=>e),(e=>("string"==typeof e.message&&e.message.match(/user denied/i)&&vh.throwError("user rejected transaction",wo.errors.ACTION_REJECTED,{action:"sendTransaction",transaction:t}),_h("sendTransaction",e,n))))}))}signTransaction(e){return vh.throwError("signing transactions is unsupported",wo.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}sendTransaction(e){return bh(this,void 0,void 0,(function*(){const t=yield this.provider._getInternalBlockNumber(100+2*this.provider.pollingInterval),r=yield this.sendUncheckedTransaction(e);try{return yield Ol((()=>bh(this,void 0,void 0,(function*(){const e=yield this.provider.getTransaction(r);if(null!==e)return this.provider._wrapTransaction(e,r,t)}))),{oncePoll:this.provider})}catch(e){throw e.transactionHash=r,e}}))}signMessage(e){return bh(this,void 0,void 0,(function*(){const t="string"==typeof e?Ws(e):e,r=yield this.getAddress();try{return yield this.provider.send("personal_sign",[To(t),r.toLowerCase()])}catch(t){throw"string"==typeof t.message&&t.message.match(/user denied/i)&&vh.throwError("user rejected signing",wo.errors.ACTION_REJECTED,{action:"signMessage",from:r,messageData:e}),t}}))}_legacySignMessage(e){return bh(this,void 0,void 0,(function*(){const t="string"==typeof e?Ws(e):e,r=yield this.getAddress();try{return yield this.provider.send("eth_sign",[r.toLowerCase(),To(t)])}catch(t){throw"string"==typeof t.message&&t.message.match(/user denied/i)&&vh.throwError("user rejected signing",wo.errors.ACTION_REJECTED,{action:"_legacySignMessage",from:r,messageData:e}),t}}))}_signTypedData(e,t,r){return bh(this,void 0,void 0,(function*(){const n=yield du.resolveNames(e,t,r,(e=>this.provider.resolveName(e))),i=yield this.getAddress();try{return yield this.provider.send("eth_signTypedData_v4",[i.toLowerCase(),JSON.stringify(du.getPayload(n.domain,t,n.value))])}catch(e){throw"string"==typeof e.message&&e.message.match(/user denied/i)&&vh.throwError("user rejected signing",wo.errors.ACTION_REJECTED,{action:"_signTypedData",from:i,messageData:{domain:n.domain,types:t,value:n.value}}),e}}))}unlock(e){return bh(this,void 0,void 0,(function*(){const t=this.provider,r=yield this.getAddress();return t.send("personal_unlockAccount",[r.toLowerCase(),e,null])}))}}class Mh extends kh{sendTransaction(e){return this.sendUncheckedTransaction(e).then((e=>({hash:e,nonce:null,gasLimit:null,gasPrice:null,data:null,value:null,chainId:null,confirmations:0,from:null,wait:t=>this.provider.waitForTransaction(e,t)})))}}const Ch={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0};class Ih extends yh{constructor(e,t){let r=t;null==r&&(r=new Promise(((e,t)=>{setTimeout((()=>{this.detectNetwork().then((t=>{e(t)}),(e=>{t(e)}))}),0)}))),super(r),e||(e=ya(this.constructor,"defaultUrl")()),ga(this,"connection","string"==typeof e?Object.freeze({url:e}):Object.freeze(wa(e))),this._nextId=42}get _cache(){return null==this._eventLoopCache&&(this._eventLoopCache={}),this._eventLoopCache}static defaultUrl(){return"http://localhost:8545"}detectNetwork(){return this._cache.detectNetwork||(this._cache.detectNetwork=this._uncachedDetectNetwork(),setTimeout((()=>{this._cache.detectNetwork=null}),0)),this._cache.detectNetwork}_uncachedDetectNetwork(){return bh(this,void 0,void 0,(function*(){yield Eh(0);let e=null;try{e=yield this.send("eth_chainId",[])}catch(t){try{e=yield this.send("net_version",[])}catch(e){}}if(null!=e){const t=ya(this.constructor,"getNetwork");try{return t(Zo.from(e).toNumber())}catch(t){return vh.throwError("could not detect network",wo.errors.NETWORK_ERROR,{chainId:e,event:"invalidNetwork",serverError:t})}}return vh.throwError("could not detect network",wo.errors.NETWORK_ERROR,{event:"noNetwork"})}))}getSigner(e){return new kh(xh,this,e)}getUncheckedSigner(e){return this.getSigner(e).connectUnchecked()}listAccounts(){return this.send("eth_accounts",[]).then((e=>e.map((e=>this.formatter.address(e)))))}send(e,t){const r={method:e,params:t,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:Sa(r),provider:this});const n=["eth_chainId","eth_blockNumber"].indexOf(e)>=0;if(n&&this._cache[e])return this._cache[e];const i=Nl(this.connection,JSON.stringify(r),Sh).then((e=>(this.emit("debug",{action:"response",request:r,response:e,provider:this}),e)),(e=>{throw this.emit("debug",{action:"response",error:e,request:r,provider:this}),e}));return n&&(this._cache[e]=i,setTimeout((()=>{this._cache[e]=null}),0)),i}prepareRequest(e,t){switch(e){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[Ph(t.address),t.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[Ph(t.address),t.blockTag]];case"getCode":return["eth_getCode",[Ph(t.address),t.blockTag]];case"getStorageAt":return["eth_getStorageAt",[Ph(t.address),zo(t.position,32),t.blockTag]];case"sendTransaction":return["eth_sendRawTransaction",[t.signedTransaction]];case"getBlock":return t.blockTag?["eth_getBlockByNumber",[t.blockTag,!!t.includeTransactions]]:t.blockHash?["eth_getBlockByHash",[t.blockHash,!!t.includeTransactions]]:null;case"getTransaction":return["eth_getTransactionByHash",[t.transactionHash]];case"getTransactionReceipt":return["eth_getTransactionReceipt",[t.transactionHash]];case"call":return["eth_call",[ya(this.constructor,"hexlifyTransaction")(t.transaction,{from:!0}),t.blockTag]];case"estimateGas":return["eth_estimateGas",[ya(this.constructor,"hexlifyTransaction")(t.transaction,{from:!0})]];case"getLogs":return t.filter&&null!=t.filter.address&&(t.filter.address=Ph(t.filter.address)),["eth_getLogs",[t.filter]]}return null}perform(e,t){return bh(this,void 0,void 0,(function*(){if("call"===e||"estimateGas"===e){const e=t.transaction;if(e&&null!=e.type&&Zo.from(e.type).isZero()&&null==e.maxFeePerGas&&null==e.maxPriorityFeePerGas){const r=yield this.getFeeData();null==r.maxFeePerGas&&null==r.maxPriorityFeePerGas&&((t=wa(t)).transaction=wa(e),delete t.transaction.type)}}const r=this.prepareRequest(e,t);null==r&&vh.throwError(e+" not implemented",wo.errors.NOT_IMPLEMENTED,{operation:e});try{return yield this.send(r[0],r[1])}catch(r){return _h(e,r,t)}}))}_startEvent(e){"pending"===e.tag&&this._startPending(),super._startEvent(e)}_startPending(){if(null!=this._pendingFilter)return;const e=this,t=this.send("eth_newPendingTransactionFilter",[]);this._pendingFilter=t,t.then((function(r){return function n(){e.send("eth_getFilterChanges",[r]).then((function(r){if(e._pendingFilter!=t)return null;let n=Promise.resolve();return r.forEach((function(t){e._emitted["t:"+t.toLowerCase()]="pending",n=n.then((function(){return e.getTransaction(t).then((function(t){return e.emit("pending",t),null}))}))})),n.then((function(){return Eh(1e3)}))})).then((function(){if(e._pendingFilter==t)return setTimeout((function(){n()}),0),null;e.send("eth_uninstallFilter",[r])})).catch((e=>{}))}(),r})).catch((e=>{}))}_stopEvent(e){"pending"===e.tag&&0===this.listenerCount("pending")&&(this._pendingFilter=null),super._stopEvent(e)}static hexlifyTransaction(e,t){const r=wa(Ch);if(t)for(const e in t)t[e]&&(r[e]=!0);va(e,r);const n={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach((function(t){if(null==e[t])return;const r=Bo(Zo.from(e[t]));"gasLimit"===t&&(t="gas"),n[t]=r})),["from","to","data"].forEach((function(t){null!=e[t]&&(n[t]=To(e[t]))})),e.accessList&&(n.accessList=Of(e.accessList)),n}}const Rh=new RegExp("^bytes([0-9]+)$"),Nh=new RegExp("^(u?int)([0-9]*)$"),Oh=new RegExp("^(.*)\\[([0-9]*)\\]$"),Th="0000000000000000000000000000000000000000000000000000000000000000",jh=new wo("solidity/5.7.0");function $h(e,t,r){switch(e){case"address":return r?Ro(t,32):Mo(t);case"string":return Ws(t);case"bytes":return Mo(t);case"bool":return t=t?"0x01":"0x00",r?Ro(t,32):Mo(t)}let n=e.match(Nh);if(n){let i=parseInt(n[2]||"256");return(n[2]&&String(i)!==n[2]||i%8!=0||0===i||i>256)&&jh.throwArgumentError("invalid number type","type",e),r&&(i=256),Ro(t=Zo.from(t).toTwos(i),i/8)}if(n=e.match(Rh),n){const i=parseInt(n[1]);return(String(i)!==n[1]||0===i||i>32)&&jh.throwArgumentError("invalid bytes type","type",e),Mo(t).byteLength!==i&&jh.throwArgumentError(`invalid value for ${e}`,"value",t),r?Mo((t+Th).substring(0,66)):t}if(n=e.match(Oh),n&&Array.isArray(t)){const r=n[1];parseInt(n[2]||String(t.length))!=t.length&&jh.throwArgumentError(`invalid array length for ${e}`,"value",t);const i=[];return t.forEach((function(e){i.push($h(r,e,!0))})),Co(i)}return jh.throwArgumentError("invalid type","type",e)}function Dh(e,t){e.length!=t.length&&jh.throwArgumentError("wrong number of values; expected ${ types.length }","values",t);const r=[];return e.forEach((function(e,n){r.push($h(e,t[n]))})),To(Co(r))}var Bh=Object.freeze({__proto__:null,keccak256:function(e,t){return os(Dh(e,t))},pack:Dh,sha256:function(e,t){return ud(Dh(e,t))}});const Fh=new wo("units/5.7.0"),zh=["wei","kwei","mwei","gwei","szabo","finney","ether"];function Uh(e,t){if("string"==typeof t){const e=zh.indexOf(t);-1!==e&&(t=3*e)}return ca(e,null!=t?t:18)}function Lh(e,t){if("string"!=typeof e&&Fh.throwArgumentError("value must be a string","value",e),"string"==typeof t){const e=zh.indexOf(t);-1!==e&&(t=3*e)}return ua(e,null!=t?t:18)}var qh=Object.freeze({__proto__:null,commify:function(e){const t=String(e).split(".");(t.length>2||!t[0].match(/^-?[0-9]*$/)||t[1]&&!t[1].match(/^[0-9]*$/)||"."===e||"-."===e)&&Fh.throwArgumentError("invalid value","value",e);let r=t[0],n="";for("-"===r.substring(0,1)&&(n="-",r=r.substring(1));"0"===r.substring(0,1);)r=r.substring(1);""===r&&(r="0");let i="";for(2===t.length&&(i="."+(t[1]||"0"));i.length>2&&"0"===i[i.length-1];)i=i.substring(0,i.length-1);const o=[];for(;r.length;){if(r.length<=3){o.unshift(r);break}{const e=r.length-3;o.unshift(r.substring(e)),r=r.substring(0,e)}}return n+o.join(",")+i},formatEther:function(e){return Uh(e,18)},formatUnits:Uh,parseEther:function(e){return Lh(e,18)},parseUnits:Lh});function Hh(e){if(null==e.match(/^(0x)?([\da-fA-F]{40})$/))throw new RangeError("incorrect address format");try{return As(oo(e,!0,20))}catch(e){throw new on(e,["invalid EIP-55 address"])}}function Kh(e){const t=e.match(/^did:ethr:(\w+:)?(0x[0-9a-fA-F]{40}[0-9a-fA-F]{26}?)$/),r=null!==t?t[t.length-1]:e;try{return Cf(r)}catch(e){throw new on("no a DID or a valid public or private key",["invalid format"])}}async function Jh(e){return r(await so(ro(e),"SHA-256"),!0,!1)}async function Wh(e,t){if(void 0===e.iss)throw new Error('Payload iss should be set to either "orig" or "dest"');const r=JSON.parse(e.exchange[e.iss]);await Yi(r,t);const n=await Wi(t),i=t.alg,o={...e,iat:Math.floor(Date.now()/1e3)};return{jws:await new Hi(o).setProtectedHeader({alg:i}).setIssuedAt(o.iat).sign(n),payload:o}}async function Gh(e,t,r){const n=JSON.parse(t.exchange[t.iss]),i=await Zi(e,n);if(void 0===i.payload.iss)throw new Error('Property "iss" missing');if(void 0===i.payload.iat)throw new Error("Property claim iat missing");if(void 0!==r){no("iat"===r.timestamp?1e3*i.payload.iat:r.timestamp,"iat"===r.notBefore?1e3*i.payload.iat:r.notBefore,"iat"===r.notAfter?1e3*i.payload.iat:r.notAfter,r.tolerance)}const o=i.payload,a=o.exchange[o.iss];if(ro(n)!==ro(JSON.parse(a)))throw new Error(`The proof is issued by ${a} instead of ${JSON.stringify(n)}`);const s=t;for(const e in s){if(void 0===o[e])throw new Error(`Expected key '${e}' not found in proof`);if("exchange"===e){const e=t.exchange;Vh(o.exchange,e)}else if(""!==s[e]&&ro(s[e])!==ro(o[e]))throw new Error(`Proof's ${e}: ${JSON.stringify(o[e],void 0,2)} does not meet provided value ${JSON.stringify(s[e],void 0,2)}`)}return i}function Vh(e,t){const r=["id","orig","dest","hashAlg","cipherblockDgst","blockCommitment","blockCommitment","secretCommitment","schema"];for(const t of r)if("schema"!==t&&(void 0===e[t]||""===e[t]))throw new Error(`${t} is missing on dataExchange.\ndataExchange: ${JSON.stringify(e,void 0,2)}`);for(const r in t)if(""!==t[r]&&ro(t[r])!==ro(e[r]))throw new Error(`dataExchange's ${r}: ${JSON.stringify(e[r],void 0,2)} does not meet expected value ${JSON.stringify(t[r],void 0,2)}`)}async function Zh(e,t,r=10){const{payload:n}=await Zi(e),i=n.exchange,o={...i};delete o.id;if(await Jh(o)!==i.id)throw new on(new Error("data exchange integrity failed"),["dataExchange integrity violated"]);const a=JSON.parse(i.dest),s=JSON.parse(i.orig);let c,u,f;try{c=(await Gh(n.poo,{iss:"orig",proofType:"PoO",exchange:i})).payload}catch(e){throw new on(e,["invalid poo"])}try{await Gh(e,{iss:"dest",proofType:"PoR",exchange:i},{timestamp:"iat",notBefore:1e3*c.iat,notAfter:1e3*c.iat+i.pooToPorDelay})}catch(e){throw new on(e,["invalid por"])}try{const e=await t.getSecretFromLedger(Xi(i.encAlg),i.ledgerSignerAddress,i.id,r);u=e.hex,f=e.iat}catch(e){throw new on(e,["cannot verify"])}try{no(1e3*f,1e3*n.iat,1e3*c.iat+i.pooToSecretDelay)}catch(e){throw new on(`Although the secret has been obtained (and you could try to decrypt the cipherblock), it's been published later than agreed: ${new Date(1e3*f).toUTCString()} > ${new Date(1e3*c.iat+i.pooToSecretDelay).toUTCString()}`,["secret not published in time"])}return{pooPayload:c,porPayload:n,secretHex:u,destPublicJwk:a,origPublicJwk:s}}async function Xh(e,t,r=10){let n,i,o,a,s;try{n=(await Zi(e)).payload}catch(e){throw new on(e,["invalid verification request"])}try{const e=await Zh(n.por,t,r);i=e.destPublicJwk,o=e.origPublicJwk,a=e.pooPayload,s=e.porPayload}catch(e){throw new on(e,["invalid por","invalid verification request"])}try{await Zi(e,"dest"===n.iss?i:o)}catch(e){throw new on(e,["invalid verification request"])}return{pooPayload:a,porPayload:s,vrPayload:n,destPublicJwk:i,origPublicJwk:o}}async function Qh(e,t){const{payload:n}=await Zi(e),{destPublicJwk:i,origPublicJwk:o,secretHex:a,pooPayload:s,porPayload:c}=await Zh(n.por,t);try{await Zi(e,i)}catch(e){throw e instanceof on&&e.add("invalid dispute request"),e}if(r(await so(n.cipherblock,c.exchange.hashAlg),!0,!1)!==c.exchange.cipherblockDgst)throw new on(new Error("cipherblock does not meet the committed (and already accepted) one"),["invalid dispute request"]);return await Vi(n.cipherblock,(await Qi(c.exchange.encAlg,a)).jwk),{pooPayload:s,porPayload:c,drPayload:n,destPublicJwk:i,origPublicJwk:o}}async function Yh(e,t,r,n){const i={proofType:"request",iss:e,dataExchangeId:t,por:r,type:"verificationRequest",iat:Math.floor(Date.now()/1e3)},o=await mi(n);return await new Hi(i).setProtectedHeader({alg:n.alg}).setIssuedAt(i.iat).sign(o)}var ep=Object.freeze({__proto__:null,ConflictResolver:class{constructor(e,t){this.jwkPair=e,this.dltAgent=t,this.initialized=new Promise(((e,t)=>{this.init().then((()=>{e(!0)})).catch((e=>{t(e)}))}))}async init(){await Yi(this.jwkPair.publicJwk,this.jwkPair.privateJwk)}async resolveCompleteness(e){await this.initialized;const{payload:t}=await Zi(e);let r;try{r=(await Zi(t.por)).payload}catch(e){throw new on(e,["invalid por"])}const n={...await this._resolution(t.dataExchangeId,r.exchange[t.iss]),resolution:"not completed",type:"verification"};try{await Xh(e,this.dltAgent),n.resolution="completed"}catch(e){if(!(e instanceof on)||e.nrErrors.includes("invalid verification request")||e.nrErrors.includes("unexpected error"))throw e}const i=await mi(this.jwkPair.privateJwk);return await new Hi(n).setProtectedHeader({alg:this.jwkPair.privateJwk.alg}).setIssuedAt(n.iat).sign(i)}async resolveDispute(e){await this.initialized;const{payload:t}=await Zi(e);let r;try{r=(await Zi(t.por)).payload}catch(e){throw new on(e,["invalid por"])}const n={...await this._resolution(t.dataExchangeId,r.exchange[t.iss]),resolution:"denied",type:"dispute"};try{await Qh(e,this.dltAgent)}catch(e){if(!(e instanceof on&&e.nrErrors.includes("decryption failed")))throw new on(e,["cannot verify"]);n.resolution="accepted"}const i=await mi(this.jwkPair.privateJwk);return await new Hi(n).setProtectedHeader({alg:this.jwkPair.privateJwk.alg}).setIssuedAt(n.iat).sign(i)}async _resolution(e,t){return{proofType:"resolution",dataExchangeId:e,iat:Math.floor(Date.now()/1e3),iss:await ao(this.jwkPair.publicJwk,!0),sub:t}}},checkCompleteness:Xh,checkDecryption:Qh,generateVerificationRequest:Yh,verifyPor:Zh,verifyResolution:async function(e,t){return await Zi(e,t??((e,t)=>JSON.parse(t.iss)))}});const tp={gasLimit:125e5,contract:{address:"0x8d407A1722633bDD1dcf221474be7a44C05d7c2F",abi:[{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"sender",type:"address"},{indexed:!1,internalType:"uint256",name:"dataExchangeId",type:"uint256"},{indexed:!1,internalType:"uint256",name:"timestamp",type:"uint256"},{indexed:!1,internalType:"uint256",name:"secret",type:"uint256"}],name:"Registration",type:"event"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"uint256",name:"",type:"uint256"}],name:"registry",outputs:[{internalType:"uint256",name:"timestamp",type:"uint256"},{internalType:"uint256",name:"secret",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"_dataExchangeId",type:"uint256"},{internalType:"uint256",name:"_secret",type:"uint256"}],name:"setRegistry",outputs:[],stateMutability:"nonpayable",type:"function"}],transactionHash:"0x6a3828f8fe232819dc40ca66f93930b3bd1619db31a67ec34b44446b3e7c8289",receipt:{to:null,from:"0x17bd12C2134AfC1f6E9302a532eFE30C19B9E903",contractAddress:"0x8d407A1722633bDD1dcf221474be7a44C05d7c2F",transactionIndex:0,gasUsed:"253928",logsBloom:"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",blockHash:"0x0118672bb9b27679e616831d056d36291dd20cfe88c3ee2abd8f2dfce579cad4",transactionHash:"0x6a3828f8fe232819dc40ca66f93930b3bd1619db31a67ec34b44446b3e7c8289",logs:[],blockNumber:119389,cumulativeGasUsed:"253928",status:1,byzantium:!0},args:[],solcInputHash:"c528a37588793ef74285d75e08d6b8eb",metadata:'{"compiler":{"version":"0.8.4+commit.c7e474f2"},"language":"Solidity","output":{"abi":[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"dataExchangeId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"secret","type":"uint256"}],"name":"Registration","type":"event"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"registry","outputs":[{"internalType":"uint256","name":"timestamp","type":"uint256"},{"internalType":"uint256","name":"secret","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_dataExchangeId","type":"uint256"},{"internalType":"uint256","name":"_secret","type":"uint256"}],"name":"setRegistry","outputs":[],"stateMutability":"nonpayable","type":"function"}],"devdoc":{"kind":"dev","methods":{},"version":1},"userdoc":{"kind":"user","methods":{},"version":1}},"settings":{"compilationTarget":{"contracts/NonRepudiation.sol":"NonRepudiation"},"evmVersion":"istanbul","libraries":{},"metadata":{"bytecodeHash":"ipfs","useLiteralContent":true},"optimizer":{"enabled":false,"runs":200},"remappings":[]},"sources":{"contracts/NonRepudiation.sol":{"content":"//SPDX-License-Identifier: Unlicense\\npragma solidity ^0.8.0;\\n\\ncontract NonRepudiation {\\n struct Proof {\\n uint256 timestamp;\\n uint256 secret;\\n }\\n mapping(address => mapping (uint256 => Proof)) public registry;\\n event Registration(address sender, uint256 dataExchangeId, uint256 timestamp, uint256 secret);\\n\\n function setRegistry(uint256 _dataExchangeId, uint256 _secret) public {\\n require(registry[msg.sender][_dataExchangeId].secret == 0);\\n registry[msg.sender][_dataExchangeId] = Proof(block.timestamp, _secret);\\n emit Registration(msg.sender, _dataExchangeId, block.timestamp, _secret);\\n }\\n}\\n","keccak256":"0x8d371257a9b03c9102f158323e61f56ce49dd8489bd92c5a7d8abc3d9f6f8399","license":"Unlicense"}},"version":1}',bytecode:"0x608060405234801561001057600080fd5b506103a2806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c8063032439371461003b578063d05cb54514610057575b600080fd5b6100556004803603810190610050919061023a565b610088565b005b610071600480360381019061006c91906101fe565b6101a3565b60405161007f9291906102d9565b60405180910390f35b60008060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002060010154146100e757600080fd5b6040518060400160405280428152602001828152506000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002060008201518160000155602082015181600101559050507faa58599838af2e5e0f3251cfbb4eac5d5d447ded49f6b0ac28d6b44098224e63338342846040516101979493929190610294565b60405180910390a15050565b6000602052816000526040600020602052806000526040600020600091509150508060000154908060010154905082565b6000813590506101e38161033e565b92915050565b6000813590506101f881610355565b92915050565b6000806040838503121561021157600080fd5b600061021f858286016101d4565b9250506020610230858286016101e9565b9150509250929050565b6000806040838503121561024d57600080fd5b600061025b858286016101e9565b925050602061026c858286016101e9565b9150509250929050565b61027f81610302565b82525050565b61028e81610334565b82525050565b60006080820190506102a96000830187610276565b6102b66020830186610285565b6102c36040830185610285565b6102d06060830184610285565b95945050505050565b60006040820190506102ee6000830185610285565b6102fb6020830184610285565b9392505050565b600061030d82610314565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b61034781610302565b811461035257600080fd5b50565b61035e81610334565b811461036957600080fd5b5056fea26469706673582212204fd0fc653fb487221da9a14a4ca5d5499f9e9bc7b27ac8ab0f8d397fd6e3148564736f6c63430008040033",deployedBytecode:"0x608060405234801561001057600080fd5b50600436106100365760003560e01c8063032439371461003b578063d05cb54514610057575b600080fd5b6100556004803603810190610050919061023a565b610088565b005b610071600480360381019061006c91906101fe565b6101a3565b60405161007f9291906102d9565b60405180910390f35b60008060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002060010154146100e757600080fd5b6040518060400160405280428152602001828152506000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002060008201518160000155602082015181600101559050507faa58599838af2e5e0f3251cfbb4eac5d5d447ded49f6b0ac28d6b44098224e63338342846040516101979493929190610294565b60405180910390a15050565b6000602052816000526040600020602052806000526040600020600091509150508060000154908060010154905082565b6000813590506101e38161033e565b92915050565b6000813590506101f881610355565b92915050565b6000806040838503121561021157600080fd5b600061021f858286016101d4565b9250506020610230858286016101e9565b9150509250929050565b6000806040838503121561024d57600080fd5b600061025b858286016101e9565b925050602061026c858286016101e9565b9150509250929050565b61027f81610302565b82525050565b61028e81610334565b82525050565b60006080820190506102a96000830187610276565b6102b66020830186610285565b6102c36040830185610285565b6102d06060830184610285565b95945050505050565b60006040820190506102ee6000830185610285565b6102fb6020830184610285565b9392505050565b600061030d82610314565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b61034781610302565b811461035257600080fd5b50565b61035e81610334565b811461036957600080fd5b5056fea26469706673582212204fd0fc653fb487221da9a14a4ca5d5499f9e9bc7b27ac8ab0f8d397fd6e3148564736f6c63430008040033",devdoc:{kind:"dev",methods:{},version:1},userdoc:{kind:"user",methods:{},version:1},storageLayout:{storage:[{astId:13,contract:"contracts/NonRepudiation.sol:NonRepudiation",label:"registry",offset:0,slot:"0",type:"t_mapping(t_address,t_mapping(t_uint256,t_struct(Proof)6_storage))"}],types:{t_address:{encoding:"inplace",label:"address",numberOfBytes:"20"},"t_mapping(t_address,t_mapping(t_uint256,t_struct(Proof)6_storage))":{encoding:"mapping",key:"t_address",label:"mapping(address => mapping(uint256 => struct NonRepudiation.Proof))",numberOfBytes:"32",value:"t_mapping(t_uint256,t_struct(Proof)6_storage)"},"t_mapping(t_uint256,t_struct(Proof)6_storage)":{encoding:"mapping",key:"t_uint256",label:"mapping(uint256 => struct NonRepudiation.Proof)",numberOfBytes:"32",value:"t_struct(Proof)6_storage"},"t_struct(Proof)6_storage":{encoding:"inplace",label:"struct NonRepudiation.Proof",members:[{astId:3,contract:"contracts/NonRepudiation.sol:NonRepudiation",label:"timestamp",offset:0,slot:"0",type:"t_uint256"},{astId:5,contract:"contracts/NonRepudiation.sol:NonRepudiation",label:"secret",offset:0,slot:"1",type:"t_uint256"}],numberOfBytes:"64"},t_uint256:{encoding:"inplace",label:"uint256",numberOfBytes:"32"}}}}};async function rp(e,t,r,i,a){let s=Zo.from(0),c=Zo.from(0);const u=oo(o(n(r)),!0);let f=0;do{try{({secret:s,timestamp:c}=await e.registry(oo(t,!0),u))}catch(e){throw new on(e,["cannot contact the ledger"])}s.isZero()&&(f++,await new Promise((e=>setTimeout(e,1e3))))}while(s.isZero()&&f{null!==e&&"object"==typeof e&&"function"==typeof e.then?e.then((e=>{this.dltConfig={...tp,...e},this.provider=new Ih(this.dltConfig.rpcProviderUrl),this.contract=new td(this.dltConfig.contract.address,this.dltConfig.contract.abi,this.provider),t(!0)})).catch((e=>r(e))):(this.dltConfig={...tp,...e},this.provider=new Ih(this.dltConfig.rpcProviderUrl),this.contract=new td(this.dltConfig.contract.address,this.dltConfig.contract.abi,this.provider),t(!0))}))}async getContractAddress(){return await this.initialized,this.contract.address}}class ap extends op{async getSecretFromLedger(e,t,r,n){return await this.initialized,await rp(this.contract,t,r,n,e)}}class sp extends op{constructor(e,t,r){const n=new Promise(((t,n)=>{e.providerinfo.get().then((e=>{const i=e.rpcUrl;void 0===i?n(new Error("wallet is not connected to RPC endpoint")):t({...r,rpcProviderUrl:"string"==typeof i?i:i[0]})})).catch((e=>{n(e)}))}));super(n),this.wallet=e,this.did=t}}class cp extends sp{async getSecretFromLedger(e,t,r,n){return await this.initialized,await rp(this.contract,t,r,n,e)}}class up extends op{constructor(e,t,r){const n=new Promise(((t,n)=>{e.providerinfoGet().then((e=>{const i=e.rpcUrl;void 0===i?n(new Error("wallet is not connected to RPC endpoint")):t({...r,rpcProviderUrl:"string"==typeof i?i:i[0]})})).catch((e=>{n(e)}))}));super(n),this.wallet=e,this.did=t}}class fp extends up{async getSecretFromLedger(e,t,r,n){return await this.initialized,await rp(this.contract,t,r,n,e)}}var dp={},lp=f(Au),hp=f(Es),pp=f(wc),mp=f(ad),gp=f(qo),yp=f(lu),bp=f(Od),vp=f(hl),wp=f(as),Ap=f(Ao),_p=f(dd),Ep=f(Bh),Sp=f(Bd),Pp=f(xa),xp=f(ms),kp=f(_f),Mp=f(cc),Cp=f(zf),Ip=f(qh),Rp=f(yl),Np=f(Tl);!function(e){var t=c&&c.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),r=c&&c.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=c&&c.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&t(n,e,i);return r(n,e),n};Object.defineProperty(e,"__esModule",{value:!0}),e.formatBytes32String=e.Utf8ErrorFuncs=e.toUtf8String=e.toUtf8CodePoints=e.toUtf8Bytes=e._toEscapedUtf8String=e.nameprep=e.hexDataSlice=e.hexDataLength=e.hexZeroPad=e.hexValue=e.hexStripZeros=e.hexConcat=e.isHexString=e.hexlify=e.base64=e.base58=e.TransactionDescription=e.LogDescription=e.Interface=e.SigningKey=e.HDNode=e.defaultPath=e.isBytesLike=e.isBytes=e.zeroPad=e.stripZeros=e.concat=e.arrayify=e.shallowCopy=e.resolveProperties=e.getStatic=e.defineReadOnly=e.deepCopy=e.checkProperties=e.poll=e.fetchJson=e._fetchData=e.RLP=e.Logger=e.checkResultErrors=e.FormatTypes=e.ParamType=e.FunctionFragment=e.EventFragment=e.ErrorFragment=e.ConstructorFragment=e.Fragment=e.defaultAbiCoder=e.AbiCoder=void 0,e.Indexed=e.Utf8ErrorReason=e.UnicodeNormalizationForm=e.SupportedAlgorithm=e.mnemonicToSeed=e.isValidMnemonic=e.entropyToMnemonic=e.mnemonicToEntropy=e.getAccountPath=e.verifyTypedData=e.verifyMessage=e.recoverPublicKey=e.computePublicKey=e.recoverAddress=e.computeAddress=e.getJsonWalletAddress=e.TransactionTypes=e.serializeTransaction=e.parseTransaction=e.accessListify=e.joinSignature=e.splitSignature=e.soliditySha256=e.solidityKeccak256=e.solidityPack=e.shuffled=e.randomBytes=e.sha512=e.sha256=e.ripemd160=e.keccak256=e.computeHmac=e.commify=e.parseUnits=e.formatUnits=e.parseEther=e.formatEther=e.isAddress=e.getCreate2Address=e.getContractAddress=e.getIcapAddress=e.getAddress=e._TypedDataEncoder=e.id=e.isValidName=e.namehash=e.hashMessage=e.dnsEncode=e.parseBytes32String=void 0;var i=lp;Object.defineProperty(e,"AbiCoder",{enumerable:!0,get:function(){return i.AbiCoder}}),Object.defineProperty(e,"checkResultErrors",{enumerable:!0,get:function(){return i.checkResultErrors}}),Object.defineProperty(e,"ConstructorFragment",{enumerable:!0,get:function(){return i.ConstructorFragment}}),Object.defineProperty(e,"defaultAbiCoder",{enumerable:!0,get:function(){return i.defaultAbiCoder}}),Object.defineProperty(e,"ErrorFragment",{enumerable:!0,get:function(){return i.ErrorFragment}}),Object.defineProperty(e,"EventFragment",{enumerable:!0,get:function(){return i.EventFragment}}),Object.defineProperty(e,"FormatTypes",{enumerable:!0,get:function(){return i.FormatTypes}}),Object.defineProperty(e,"Fragment",{enumerable:!0,get:function(){return i.Fragment}}),Object.defineProperty(e,"FunctionFragment",{enumerable:!0,get:function(){return i.FunctionFragment}}),Object.defineProperty(e,"Indexed",{enumerable:!0,get:function(){return i.Indexed}}),Object.defineProperty(e,"Interface",{enumerable:!0,get:function(){return i.Interface}}),Object.defineProperty(e,"LogDescription",{enumerable:!0,get:function(){return i.LogDescription}}),Object.defineProperty(e,"ParamType",{enumerable:!0,get:function(){return i.ParamType}}),Object.defineProperty(e,"TransactionDescription",{enumerable:!0,get:function(){return i.TransactionDescription}});var o=hp;Object.defineProperty(e,"getAddress",{enumerable:!0,get:function(){return o.getAddress}}),Object.defineProperty(e,"getCreate2Address",{enumerable:!0,get:function(){return o.getCreate2Address}}),Object.defineProperty(e,"getContractAddress",{enumerable:!0,get:function(){return o.getContractAddress}}),Object.defineProperty(e,"getIcapAddress",{enumerable:!0,get:function(){return o.getIcapAddress}}),Object.defineProperty(e,"isAddress",{enumerable:!0,get:function(){return o.isAddress}});var a=n(pp);e.base64=a;var s=mp;Object.defineProperty(e,"base58",{enumerable:!0,get:function(){return s.Base58}});var u=gp;Object.defineProperty(e,"arrayify",{enumerable:!0,get:function(){return u.arrayify}}),Object.defineProperty(e,"concat",{enumerable:!0,get:function(){return u.concat}}),Object.defineProperty(e,"hexConcat",{enumerable:!0,get:function(){return u.hexConcat}}),Object.defineProperty(e,"hexDataSlice",{enumerable:!0,get:function(){return u.hexDataSlice}}),Object.defineProperty(e,"hexDataLength",{enumerable:!0,get:function(){return u.hexDataLength}}),Object.defineProperty(e,"hexlify",{enumerable:!0,get:function(){return u.hexlify}}),Object.defineProperty(e,"hexStripZeros",{enumerable:!0,get:function(){return u.hexStripZeros}}),Object.defineProperty(e,"hexValue",{enumerable:!0,get:function(){return u.hexValue}}),Object.defineProperty(e,"hexZeroPad",{enumerable:!0,get:function(){return u.hexZeroPad}}),Object.defineProperty(e,"isBytes",{enumerable:!0,get:function(){return u.isBytes}}),Object.defineProperty(e,"isBytesLike",{enumerable:!0,get:function(){return u.isBytesLike}}),Object.defineProperty(e,"isHexString",{enumerable:!0,get:function(){return u.isHexString}}),Object.defineProperty(e,"joinSignature",{enumerable:!0,get:function(){return u.joinSignature}}),Object.defineProperty(e,"zeroPad",{enumerable:!0,get:function(){return u.zeroPad}}),Object.defineProperty(e,"splitSignature",{enumerable:!0,get:function(){return u.splitSignature}}),Object.defineProperty(e,"stripZeros",{enumerable:!0,get:function(){return u.stripZeros}});var f=yp;Object.defineProperty(e,"_TypedDataEncoder",{enumerable:!0,get:function(){return f._TypedDataEncoder}}),Object.defineProperty(e,"dnsEncode",{enumerable:!0,get:function(){return f.dnsEncode}}),Object.defineProperty(e,"hashMessage",{enumerable:!0,get:function(){return f.hashMessage}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return f.id}}),Object.defineProperty(e,"isValidName",{enumerable:!0,get:function(){return f.isValidName}}),Object.defineProperty(e,"namehash",{enumerable:!0,get:function(){return f.namehash}});var d=bp;Object.defineProperty(e,"defaultPath",{enumerable:!0,get:function(){return d.defaultPath}}),Object.defineProperty(e,"entropyToMnemonic",{enumerable:!0,get:function(){return d.entropyToMnemonic}}),Object.defineProperty(e,"getAccountPath",{enumerable:!0,get:function(){return d.getAccountPath}}),Object.defineProperty(e,"HDNode",{enumerable:!0,get:function(){return d.HDNode}}),Object.defineProperty(e,"isValidMnemonic",{enumerable:!0,get:function(){return d.isValidMnemonic}}),Object.defineProperty(e,"mnemonicToEntropy",{enumerable:!0,get:function(){return d.mnemonicToEntropy}}),Object.defineProperty(e,"mnemonicToSeed",{enumerable:!0,get:function(){return d.mnemonicToSeed}});var l=vp;Object.defineProperty(e,"getJsonWalletAddress",{enumerable:!0,get:function(){return l.getJsonWalletAddress}});var h=wp;Object.defineProperty(e,"keccak256",{enumerable:!0,get:function(){return h.keccak256}});var p=Ap;Object.defineProperty(e,"Logger",{enumerable:!0,get:function(){return p.Logger}});var m=_p;Object.defineProperty(e,"computeHmac",{enumerable:!0,get:function(){return m.computeHmac}}),Object.defineProperty(e,"ripemd160",{enumerable:!0,get:function(){return m.ripemd160}}),Object.defineProperty(e,"sha256",{enumerable:!0,get:function(){return m.sha256}}),Object.defineProperty(e,"sha512",{enumerable:!0,get:function(){return m.sha512}});var g=Ep;Object.defineProperty(e,"solidityKeccak256",{enumerable:!0,get:function(){return g.keccak256}}),Object.defineProperty(e,"solidityPack",{enumerable:!0,get:function(){return g.pack}}),Object.defineProperty(e,"soliditySha256",{enumerable:!0,get:function(){return g.sha256}});var y=Sp;Object.defineProperty(e,"randomBytes",{enumerable:!0,get:function(){return y.randomBytes}}),Object.defineProperty(e,"shuffled",{enumerable:!0,get:function(){return y.shuffled}});var b=Pp;Object.defineProperty(e,"checkProperties",{enumerable:!0,get:function(){return b.checkProperties}}),Object.defineProperty(e,"deepCopy",{enumerable:!0,get:function(){return b.deepCopy}}),Object.defineProperty(e,"defineReadOnly",{enumerable:!0,get:function(){return b.defineReadOnly}}),Object.defineProperty(e,"getStatic",{enumerable:!0,get:function(){return b.getStatic}}),Object.defineProperty(e,"resolveProperties",{enumerable:!0,get:function(){return b.resolveProperties}}),Object.defineProperty(e,"shallowCopy",{enumerable:!0,get:function(){return b.shallowCopy}});var v=n(xp);e.RLP=v;var w=kp;Object.defineProperty(e,"computePublicKey",{enumerable:!0,get:function(){return w.computePublicKey}}),Object.defineProperty(e,"recoverPublicKey",{enumerable:!0,get:function(){return w.recoverPublicKey}}),Object.defineProperty(e,"SigningKey",{enumerable:!0,get:function(){return w.SigningKey}});var A=Mp;Object.defineProperty(e,"formatBytes32String",{enumerable:!0,get:function(){return A.formatBytes32String}}),Object.defineProperty(e,"nameprep",{enumerable:!0,get:function(){return A.nameprep}}),Object.defineProperty(e,"parseBytes32String",{enumerable:!0,get:function(){return A.parseBytes32String}}),Object.defineProperty(e,"_toEscapedUtf8String",{enumerable:!0,get:function(){return A._toEscapedUtf8String}}),Object.defineProperty(e,"toUtf8Bytes",{enumerable:!0,get:function(){return A.toUtf8Bytes}}),Object.defineProperty(e,"toUtf8CodePoints",{enumerable:!0,get:function(){return A.toUtf8CodePoints}}),Object.defineProperty(e,"toUtf8String",{enumerable:!0,get:function(){return A.toUtf8String}}),Object.defineProperty(e,"Utf8ErrorFuncs",{enumerable:!0,get:function(){return A.Utf8ErrorFuncs}});var _=Cp;Object.defineProperty(e,"accessListify",{enumerable:!0,get:function(){return _.accessListify}}),Object.defineProperty(e,"computeAddress",{enumerable:!0,get:function(){return _.computeAddress}}),Object.defineProperty(e,"parseTransaction",{enumerable:!0,get:function(){return _.parse}}),Object.defineProperty(e,"recoverAddress",{enumerable:!0,get:function(){return _.recoverAddress}}),Object.defineProperty(e,"serializeTransaction",{enumerable:!0,get:function(){return _.serialize}}),Object.defineProperty(e,"TransactionTypes",{enumerable:!0,get:function(){return _.TransactionTypes}});var E=Ip;Object.defineProperty(e,"commify",{enumerable:!0,get:function(){return E.commify}}),Object.defineProperty(e,"formatEther",{enumerable:!0,get:function(){return E.formatEther}}),Object.defineProperty(e,"parseEther",{enumerable:!0,get:function(){return E.parseEther}}),Object.defineProperty(e,"formatUnits",{enumerable:!0,get:function(){return E.formatUnits}}),Object.defineProperty(e,"parseUnits",{enumerable:!0,get:function(){return E.parseUnits}});var S=Rp;Object.defineProperty(e,"verifyMessage",{enumerable:!0,get:function(){return S.verifyMessage}}),Object.defineProperty(e,"verifyTypedData",{enumerable:!0,get:function(){return S.verifyTypedData}});var P=Np;Object.defineProperty(e,"_fetchData",{enumerable:!0,get:function(){return P._fetchData}}),Object.defineProperty(e,"fetchJson",{enumerable:!0,get:function(){return P.fetchJson}}),Object.defineProperty(e,"poll",{enumerable:!0,get:function(){return P.poll}});var x=_p;Object.defineProperty(e,"SupportedAlgorithm",{enumerable:!0,get:function(){return x.SupportedAlgorithm}});var k=Mp;Object.defineProperty(e,"UnicodeNormalizationForm",{enumerable:!0,get:function(){return k.UnicodeNormalizationForm}}),Object.defineProperty(e,"Utf8ErrorReason",{enumerable:!0,get:function(){return k.Utf8ErrorReason}})}(dp);class Op extends op{constructor(e,t){let r;super(e),this.count=-1,r=void 0===t?function(e,t=!1){if(e<1)throw new RangeError("byteLength MUST be > 0");{const r=new Uint8Array(e);if(e<=65536)self.crypto.getRandomValues(r);else for(let t=0;tthis.count&&(this.count=e),this.count}}class Tp extends sp{constructor(){super(...arguments),this.count=-1}async deploySecret(e,t){await this.initialized;const r=await np(e,t,this),n=(await this.wallet.identities.sign({did:this.did},{type:"Transaction",data:r})).signature,i=await this.provider.sendTransaction(n);return this.count=this.count+1,i.hash}async getAddress(){await this.initialized;const e=await this.wallet.identities.info({did:this.did});if(void 0===e.addresses)throw new on(new Error("no addresses for did "+this.did),["unexpected error"]);return e.addresses[0]}async nextNonce(){await this.initialized;const e=await this.provider.getTransactionCount(await this.getAddress(),"pending");return e>this.count&&(this.count=e),this.count}}class jp extends up{constructor(){super(...arguments),this.count=-1}async deploySecret(e,t){await this.initialized;const r=await np(e,t,this),n=(await this.wallet.identitySign({did:this.did},{type:"Transaction",data:r})).signature,i=await this.provider.sendTransaction(n);return this.count=this.count+1,i.hash}async getAddress(){await this.initialized;const e=await this.wallet.identityInfo({did:this.did});if(void 0===e.addresses)throw new on(`Can't get address for did: ${this.did}`,["unexpected error"]);return e.addresses[0]}async nextNonce(){await this.initialized;const e=await this.provider.getTransactionCount(await this.getAddress(),"pending");return e>this.count&&(this.count=e),this.count}}var $p=Object.freeze({__proto__:null,EthersIoAgentDest:ap,EthersIoAgentOrig:Op,I3mServerWalletAgentDest:fp,I3mServerWalletAgentOrig:jp,I3mWalletAgentDest:cp,I3mWalletAgentOrig:Tp}),Dp={schemas:{IdentitySelectOutput:{title:"IdentitySelectOutput",type:"object",properties:{did:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},required:["did"]},SignInput:{title:"SignInput",oneOf:[{title:"SignTransaction",type:"object",properties:{type:{enum:["Transaction"]},data:{title:"Transaction",type:"object",additionalProperties:!0,properties:{from:{type:"string"},to:{type:"string"},nonce:{type:"number"}}}},required:["type","data"]},{title:"SignRaw",type:"object",properties:{type:{enum:["Raw"]},data:{type:"object",properties:{payload:{description:"Base64Url encoded data to sign",type:"string",pattern:"^[A-Za-z0-9_-]+$"}},required:["payload"]}},required:["type","data"]},{title:"SignJWT",type:"object",properties:{type:{enum:["JWT"]},data:{type:"object",properties:{header:{description:'header fields to be added to the JWS header. "alg" and "kid" will be ignored since they are automatically added by the wallet.',type:"object",additionalProperties:!0},payload:{description:"A JSON object to be signed by the wallet. It will become the payload of the generated JWS. 'iss' (issuer) and 'iat' (issued at) will be automatically added by the wallet and will override provided values.",type:"object",additionalProperties:!0}},required:["payload"]}},required:["type","data"]}]},SignRaw:{title:"SignRaw",type:"object",properties:{type:{enum:["Raw"]},data:{type:"object",properties:{payload:{description:"Base64Url encoded data to sign",type:"string",pattern:"^[A-Za-z0-9_-]+$"}},required:["payload"]}},required:["type","data"]},SignTransaction:{title:"SignTransaction",type:"object",properties:{type:{enum:["Transaction"]},data:{title:"Transaction",type:"object",additionalProperties:!0,properties:{from:{type:"string"},to:{type:"string"},nonce:{type:"number"}}}},required:["type","data"]},SignJWT:{title:"SignJWT",type:"object",properties:{type:{enum:["JWT"]},data:{type:"object",properties:{header:{description:'header fields to be added to the JWS header. "alg" and "kid" will be ignored since they are automatically added by the wallet.',type:"object",additionalProperties:!0},payload:{description:"A JSON object to be signed by the wallet. It will become the payload of the generated JWS. 'iss' (issuer) and 'iat' (issued at) will be automatically added by the wallet and will override provided values.",type:"object",additionalProperties:!0}},required:["payload"]}},required:["type","data"]},Transaction:{title:"Transaction",type:"object",additionalProperties:!0,properties:{from:{type:"string"},to:{type:"string"},nonce:{type:"number"}}},SignOutput:{title:"SignOutput",type:"object",properties:{signature:{type:"string"}},required:["signature"]},Receipt:{title:"Receipt",type:"object",properties:{receipt:{type:"string"}},required:["receipt"]},SignTypes:{title:"SignTypes",type:"string",enum:["Transaction","Raw","JWT"]},IdentityListInput:{title:"IdentityListInput",description:"A list of DIDs",type:"array",items:{type:"object",properties:{did:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},required:["did"]}},IdentityCreateInput:{title:"IdentityCreateInput",description:'Besides the here defined options, provider specific properties should be added here if necessary, e.g. "path" for BIP21 wallets, or the key algorithm (if the wallet supports multiple algorithm).\n',type:"object",properties:{alias:{type:"string"}},additionalProperties:!0},IdentityCreateOutput:{title:"IdentityCreateOutput",description:"It returns the account id and type\n",type:"object",properties:{did:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},additionalProperties:!0,required:["did"]},ResourceListOutput:{title:"ResourceListOutput",description:"A list of resources",type:"array",items:{title:"Resource",anyOf:[{title:"VerifiableCredential",type:"object",properties:{type:{example:"VerifiableCredential",enum:["VerifiableCredential"]},name:{type:"string",example:"Resource name"},resource:{type:"object",properties:{"@context":{type:"array",items:{type:"string"},example:["https://www.w3.org/2018/credentials/v1"]},id:{type:"string",example:"http://example.edu/credentials/1872"},type:{type:"array",items:{type:"string"},example:["VerifiableCredential"]},issuer:{type:"object",properties:{id:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},additionalProperties:!0,required:["id"]},issuanceDate:{type:"string",format:"date-time",example:"2021-06-10T19:07:28.000Z"},credentialSubject:{type:"object",properties:{id:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},required:["id"],additionalProperties:!0},proof:{type:"object",properties:{type:{type:"string",enum:["JwtProof2020"]}},required:["type"],additionalProperties:!0}},additionalProperties:!0,required:["@context","type","issuer","issuanceDate","credentialSubject","proof"]}},required:["type","resource"]},{title:"ObjectResource",type:"object",properties:{type:{example:"Object",enum:["Object"]},name:{type:"string",example:"Resource name"},parentResource:{type:"string"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",additionalProperties:!0}},required:["type","resource"]},{title:"JWK pair",type:"object",properties:{type:{example:"KeyPair",enum:["KeyPair"]},name:{type:"string",example:"Resource name"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",properties:{keyPair:{type:"object",properties:{privateJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents a private key (complementary to `publicJwk`)\n",example:'{"alg":"ES256","crv":"P-256","d":"rQp_3eZzvXwt1sK7WWsRhVYipqNGblzYDKKaYirlqs0","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'},publicJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents the public key (complementary to `privateJwk`).\n",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'}},required:["privateJwk","publicJwk"]}},required:["keyPair"]}},required:["type","resource"]},{title:"Contract",type:"object",properties:{type:{example:"Contract",enum:["Contract"]},name:{type:"string",example:"Resource name"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",properties:{dataSharingAgreement:{type:"object",required:["dataOfferingDescription","parties","purpose","duration","intendedUse","licenseGrant","dataStream","personalData","pricingModel","dataExchangeAgreement","signatures"],properties:{dataOfferingDescription:{type:"object",required:["dataOfferingId","version","active"],properties:{dataOfferingId:{type:"string"},version:{type:"integer"},category:{type:"string"},active:{type:"boolean"},title:{type:"string"}}},parties:{type:"object",required:["providerDid","consumerDid"],properties:{providerDid:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},consumerDid:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}}},purpose:{type:"string"},duration:{type:"object",required:["creationDate","startDate","endDate"],properties:{creationDate:{type:"integer"},startDate:{type:"integer"},endDate:{type:"integer"}}},intendedUse:{type:"object",required:["processData","shareDataWithThirdParty","editData"],properties:{processData:{type:"boolean"},shareDataWithThirdParty:{type:"boolean"},editData:{type:"boolean"}}},licenseGrant:{type:"object",required:["transferable","exclusiveness","paidUp","revocable","processing","modifying","analyzing","storingData","storingCopy","reproducing","distributing","loaning","selling","renting","furtherLicensing","leasing"],properties:{transferable:{type:"boolean"},exclusiveness:{type:"boolean"},paidUp:{type:"boolean"},revocable:{type:"boolean"},processing:{type:"boolean"},modifying:{type:"boolean"},analyzing:{type:"boolean"},storingData:{type:"boolean"},storingCopy:{type:"boolean"},reproducing:{type:"boolean"},distributing:{type:"boolean"},loaning:{type:"boolean"},selling:{type:"boolean"},renting:{type:"boolean"},furtherLicensing:{type:"boolean"},leasing:{type:"boolean"}}},dataStream:{type:"boolean"},personalData:{type:"boolean"},pricingModel:{type:"object",required:["basicPrice","currency","hasFreePrice"],properties:{paymentType:{type:"string"},pricingModelName:{type:"string"},basicPrice:{type:"number",format:"float"},currency:{type:"string"},fee:{type:"number",format:"float"},hasPaymentOnSubscription:{type:"object",properties:{paymentOnSubscriptionName:{type:"string"},paymentType:{type:"string"},timeDuration:{type:"string"},description:{type:"string"},repeat:{type:"string"},hasSubscriptionPrice:{type:"number"}}},hasFreePrice:{type:"object",properties:{hasPriceFree:{type:"boolean"}}}}},dataExchangeAgreement:{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},signatures:{type:"object",required:["providerSignature","consumerSignature"],properties:{providerSignature:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"},consumerSignature:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"}}}}},keyPair:{type:"object",properties:{privateJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents a private key (complementary to `publicJwk`)\n",example:'{"alg":"ES256","crv":"P-256","d":"rQp_3eZzvXwt1sK7WWsRhVYipqNGblzYDKKaYirlqs0","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'},publicJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents the public key (complementary to `privateJwk`).\n",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'}},required:["privateJwk","publicJwk"]}},required:["dataSharingAgreement"]}},required:["type","resource"]},{title:"NonRepudiationProof",type:"object",properties:{type:{example:"NonRepudiationProof",enum:["NonRepudiationProof"]},name:{type:"string",example:"Resource name"},resource:{description:"a non-repudiation proof (either a PoO, a PoR or a PoP) as a compact JWS"}},required:["type","resource"]},{title:"DataExchangeResource",type:"object",properties:{type:{example:"DataExchange",enum:["DataExchange"]},name:{type:"string",example:"Resource name"},resource:{allOf:[{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},{type:"object",properties:{cipherblockDgst:{type:"string",description:"hash of the cipherblock in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"},blockCommitment:{type:"string",description:"hash of the plaintext block in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"},secretCommitment:{type:"string",description:"ash of the secret that can be used to decrypt the block in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"}},required:["cipherblockDgst","blockCommitment","secretCommitment"]}]}},required:["type","resource"]}]}},Resource:{title:"Resource",anyOf:[{title:"VerifiableCredential",type:"object",properties:{type:{example:"VerifiableCredential",enum:["VerifiableCredential"]},name:{type:"string",example:"Resource name"},resource:{type:"object",properties:{"@context":{type:"array",items:{type:"string"},example:["https://www.w3.org/2018/credentials/v1"]},id:{type:"string",example:"http://example.edu/credentials/1872"},type:{type:"array",items:{type:"string"},example:["VerifiableCredential"]},issuer:{type:"object",properties:{id:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},additionalProperties:!0,required:["id"]},issuanceDate:{type:"string",format:"date-time",example:"2021-06-10T19:07:28.000Z"},credentialSubject:{type:"object",properties:{id:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},required:["id"],additionalProperties:!0},proof:{type:"object",properties:{type:{type:"string",enum:["JwtProof2020"]}},required:["type"],additionalProperties:!0}},additionalProperties:!0,required:["@context","type","issuer","issuanceDate","credentialSubject","proof"]}},required:["type","resource"]},{title:"ObjectResource",type:"object",properties:{type:{example:"Object",enum:["Object"]},name:{type:"string",example:"Resource name"},parentResource:{type:"string"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",additionalProperties:!0}},required:["type","resource"]},{title:"JWK pair",type:"object",properties:{type:{example:"KeyPair",enum:["KeyPair"]},name:{type:"string",example:"Resource name"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",properties:{keyPair:{type:"object",properties:{privateJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents a private key (complementary to `publicJwk`)\n",example:'{"alg":"ES256","crv":"P-256","d":"rQp_3eZzvXwt1sK7WWsRhVYipqNGblzYDKKaYirlqs0","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'},publicJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents the public key (complementary to `privateJwk`).\n",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'}},required:["privateJwk","publicJwk"]}},required:["keyPair"]}},required:["type","resource"]},{title:"Contract",type:"object",properties:{type:{example:"Contract",enum:["Contract"]},name:{type:"string",example:"Resource name"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",properties:{dataSharingAgreement:{type:"object",required:["dataOfferingDescription","parties","purpose","duration","intendedUse","licenseGrant","dataStream","personalData","pricingModel","dataExchangeAgreement","signatures"],properties:{dataOfferingDescription:{type:"object",required:["dataOfferingId","version","active"],properties:{dataOfferingId:{type:"string"},version:{type:"integer"},category:{type:"string"},active:{type:"boolean"},title:{type:"string"}}},parties:{type:"object",required:["providerDid","consumerDid"],properties:{providerDid:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},consumerDid:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}}},purpose:{type:"string"},duration:{type:"object",required:["creationDate","startDate","endDate"],properties:{creationDate:{type:"integer"},startDate:{type:"integer"},endDate:{type:"integer"}}},intendedUse:{type:"object",required:["processData","shareDataWithThirdParty","editData"],properties:{processData:{type:"boolean"},shareDataWithThirdParty:{type:"boolean"},editData:{type:"boolean"}}},licenseGrant:{type:"object",required:["transferable","exclusiveness","paidUp","revocable","processing","modifying","analyzing","storingData","storingCopy","reproducing","distributing","loaning","selling","renting","furtherLicensing","leasing"],properties:{transferable:{type:"boolean"},exclusiveness:{type:"boolean"},paidUp:{type:"boolean"},revocable:{type:"boolean"},processing:{type:"boolean"},modifying:{type:"boolean"},analyzing:{type:"boolean"},storingData:{type:"boolean"},storingCopy:{type:"boolean"},reproducing:{type:"boolean"},distributing:{type:"boolean"},loaning:{type:"boolean"},selling:{type:"boolean"},renting:{type:"boolean"},furtherLicensing:{type:"boolean"},leasing:{type:"boolean"}}},dataStream:{type:"boolean"},personalData:{type:"boolean"},pricingModel:{type:"object",required:["basicPrice","currency","hasFreePrice"],properties:{paymentType:{type:"string"},pricingModelName:{type:"string"},basicPrice:{type:"number",format:"float"},currency:{type:"string"},fee:{type:"number",format:"float"},hasPaymentOnSubscription:{type:"object",properties:{paymentOnSubscriptionName:{type:"string"},paymentType:{type:"string"},timeDuration:{type:"string"},description:{type:"string"},repeat:{type:"string"},hasSubscriptionPrice:{type:"number"}}},hasFreePrice:{type:"object",properties:{hasPriceFree:{type:"boolean"}}}}},dataExchangeAgreement:{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},signatures:{type:"object",required:["providerSignature","consumerSignature"],properties:{providerSignature:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"},consumerSignature:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"}}}}},keyPair:{type:"object",properties:{privateJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents a private key (complementary to `publicJwk`)\n",example:'{"alg":"ES256","crv":"P-256","d":"rQp_3eZzvXwt1sK7WWsRhVYipqNGblzYDKKaYirlqs0","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'},publicJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents the public key (complementary to `privateJwk`).\n",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'}},required:["privateJwk","publicJwk"]}},required:["dataSharingAgreement"]}},required:["type","resource"]},{title:"NonRepudiationProof",type:"object",properties:{type:{example:"NonRepudiationProof",enum:["NonRepudiationProof"]},name:{type:"string",example:"Resource name"},resource:{description:"a non-repudiation proof (either a PoO, a PoR or a PoP) as a compact JWS"}},required:["type","resource"]},{title:"DataExchangeResource",type:"object",properties:{type:{example:"DataExchange",enum:["DataExchange"]},name:{type:"string",example:"Resource name"},resource:{allOf:[{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},{type:"object",properties:{cipherblockDgst:{type:"string",description:"hash of the cipherblock in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"},blockCommitment:{type:"string",description:"hash of the plaintext block in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"},secretCommitment:{type:"string",description:"ash of the secret that can be used to decrypt the block in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"}},required:["cipherblockDgst","blockCommitment","secretCommitment"]}]}},required:["type","resource"]}]},VerifiableCredential:{title:"VerifiableCredential",type:"object",properties:{type:{example:"VerifiableCredential",enum:["VerifiableCredential"]},name:{type:"string",example:"Resource name"},resource:{type:"object",properties:{"@context":{type:"array",items:{type:"string"},example:["https://www.w3.org/2018/credentials/v1"]},id:{type:"string",example:"http://example.edu/credentials/1872"},type:{type:"array",items:{type:"string"},example:["VerifiableCredential"]},issuer:{type:"object",properties:{id:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},additionalProperties:!0,required:["id"]},issuanceDate:{type:"string",format:"date-time",example:"2021-06-10T19:07:28.000Z"},credentialSubject:{type:"object",properties:{id:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},required:["id"],additionalProperties:!0},proof:{type:"object",properties:{type:{type:"string",enum:["JwtProof2020"]}},required:["type"],additionalProperties:!0}},additionalProperties:!0,required:["@context","type","issuer","issuanceDate","credentialSubject","proof"]}},required:["type","resource"]},ObjectResource:{title:"ObjectResource",type:"object",properties:{type:{example:"Object",enum:["Object"]},name:{type:"string",example:"Resource name"},parentResource:{type:"string"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",additionalProperties:!0}},required:["type","resource"]},KeyPair:{title:"JWK pair",type:"object",properties:{type:{example:"KeyPair",enum:["KeyPair"]},name:{type:"string",example:"Resource name"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",properties:{keyPair:{type:"object",properties:{privateJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents a private key (complementary to `publicJwk`)\n",example:'{"alg":"ES256","crv":"P-256","d":"rQp_3eZzvXwt1sK7WWsRhVYipqNGblzYDKKaYirlqs0","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'},publicJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents the public key (complementary to `privateJwk`).\n",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'}},required:["privateJwk","publicJwk"]}},required:["keyPair"]}},required:["type","resource"]},Contract:{title:"Contract",type:"object",properties:{type:{example:"Contract",enum:["Contract"]},name:{type:"string",example:"Resource name"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",properties:{dataSharingAgreement:{type:"object",required:["dataOfferingDescription","parties","purpose","duration","intendedUse","licenseGrant","dataStream","personalData","pricingModel","dataExchangeAgreement","signatures"],properties:{dataOfferingDescription:{type:"object",required:["dataOfferingId","version","active"],properties:{dataOfferingId:{type:"string"},version:{type:"integer"},category:{type:"string"},active:{type:"boolean"},title:{type:"string"}}},parties:{type:"object",required:["providerDid","consumerDid"],properties:{providerDid:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},consumerDid:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}}},purpose:{type:"string"},duration:{type:"object",required:["creationDate","startDate","endDate"],properties:{creationDate:{type:"integer"},startDate:{type:"integer"},endDate:{type:"integer"}}},intendedUse:{type:"object",required:["processData","shareDataWithThirdParty","editData"],properties:{processData:{type:"boolean"},shareDataWithThirdParty:{type:"boolean"},editData:{type:"boolean"}}},licenseGrant:{type:"object",required:["transferable","exclusiveness","paidUp","revocable","processing","modifying","analyzing","storingData","storingCopy","reproducing","distributing","loaning","selling","renting","furtherLicensing","leasing"],properties:{transferable:{type:"boolean"},exclusiveness:{type:"boolean"},paidUp:{type:"boolean"},revocable:{type:"boolean"},processing:{type:"boolean"},modifying:{type:"boolean"},analyzing:{type:"boolean"},storingData:{type:"boolean"},storingCopy:{type:"boolean"},reproducing:{type:"boolean"},distributing:{type:"boolean"},loaning:{type:"boolean"},selling:{type:"boolean"},renting:{type:"boolean"},furtherLicensing:{type:"boolean"},leasing:{type:"boolean"}}},dataStream:{type:"boolean"},personalData:{type:"boolean"},pricingModel:{type:"object",required:["basicPrice","currency","hasFreePrice"],properties:{paymentType:{type:"string"},pricingModelName:{type:"string"},basicPrice:{type:"number",format:"float"},currency:{type:"string"},fee:{type:"number",format:"float"},hasPaymentOnSubscription:{type:"object",properties:{paymentOnSubscriptionName:{type:"string"},paymentType:{type:"string"},timeDuration:{type:"string"},description:{type:"string"},repeat:{type:"string"},hasSubscriptionPrice:{type:"number"}}},hasFreePrice:{type:"object",properties:{hasPriceFree:{type:"boolean"}}}}},dataExchangeAgreement:{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},signatures:{type:"object",required:["providerSignature","consumerSignature"],properties:{providerSignature:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"},consumerSignature:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"}}}}},keyPair:{type:"object",properties:{privateJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents a private key (complementary to `publicJwk`)\n",example:'{"alg":"ES256","crv":"P-256","d":"rQp_3eZzvXwt1sK7WWsRhVYipqNGblzYDKKaYirlqs0","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'},publicJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents the public key (complementary to `privateJwk`).\n",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'}},required:["privateJwk","publicJwk"]}},required:["dataSharingAgreement"]}},required:["type","resource"]},DataExchangeResource:{title:"DataExchangeResource",type:"object",properties:{type:{example:"DataExchange",enum:["DataExchange"]},name:{type:"string",example:"Resource name"},resource:{allOf:[{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},{type:"object",properties:{cipherblockDgst:{type:"string",description:"hash of the cipherblock in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"},blockCommitment:{type:"string",description:"hash of the plaintext block in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"},secretCommitment:{type:"string",description:"ash of the secret that can be used to decrypt the block in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"}},required:["cipherblockDgst","blockCommitment","secretCommitment"]}]}},required:["type","resource"]},NonRepudiationProof:{title:"NonRepudiationProof",type:"object",properties:{type:{example:"NonRepudiationProof",enum:["NonRepudiationProof"]},name:{type:"string",example:"Resource name"},resource:{description:"a non-repudiation proof (either a PoO, a PoR or a PoP) as a compact JWS"}},required:["type","resource"]},ResourceId:{type:"object",properties:{id:{type:"string"}},required:["id"]},ResourceType:{type:"string",enum:["VerifiableCredential","Object","KeyPair","Contract","DataExchange","NonRepudiationProof"]},SignedTransaction:{title:"SignedTransaction",description:"A list of resources",type:"object",properties:{transaction:{type:"string",pattern:"^0x(?:[A-Fa-f0-9])+$"}}},DecodedJwt:{title:"JwtPayload",type:"object",properties:{header:{type:"object",properties:{typ:{type:"string",enum:["JWT"]},alg:{type:"string",enum:["ES256K"]}},required:["typ","alg"],additionalProperties:!0},payload:{type:"object",properties:{iss:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},required:["iss"],additionalProperties:!0},signature:{type:"string",format:"^[A-Za-z0-9_-]+$"},data:{type:"string",format:"^[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+$",description:"."}},required:["signature","data"]},VerificationOutput:{title:"VerificationOutput",type:"object",properties:{verification:{type:"string",enum:["success","failed"],description:"whether verification has been successful or has failed"},error:{type:"string",description:"error message if verification failed"},decodedJwt:{description:"the decoded JWT"}},required:["verification"]},ProviderData:{title:"ProviderData",description:"A JSON object with information of the DLT provider currently in use.",type:"object",properties:{provider:{type:"string",example:"did:ethr:i3m"},network:{type:"string",example:"i3m"},rpcUrl:{type:"string",example:"http://95.211.3.250:8545"}},additionalProperties:!0},EthereumAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},did:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},IdentityData:{title:"Identity Data",type:"object",properties:{did:{type:"string",example:"did:ethr:i3m:0x03142f480f831e835822fc0cd35726844a7069d28df58fb82037f1598812e1ade8"},alias:{type:"string",example:"identity1"},provider:{type:"string",example:"did:ethr:i3m"},addresses:{type:"array",items:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},example:["0x8646cAcF516de1292be1D30AB68E7Ea51e9B1BE7"]}},required:["did"]},ApiError:{type:"object",title:"Error",required:["code","message"],properties:{code:{type:"integer",format:"int32"},message:{type:"string"}}},JwkPair:{type:"object",properties:{privateJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents a private key (complementary to `publicJwk`)\n",example:'{"alg":"ES256","crv":"P-256","d":"rQp_3eZzvXwt1sK7WWsRhVYipqNGblzYDKKaYirlqs0","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'},publicJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents the public key (complementary to `privateJwk`).\n",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'}},required:["privateJwk","publicJwk"]},CompactJWS:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"},DataExchangeAgreement:{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},DataSharingAgreement:{type:"object",required:["dataOfferingDescription","parties","purpose","duration","intendedUse","licenseGrant","dataStream","personalData","pricingModel","dataExchangeAgreement","signatures"],properties:{dataOfferingDescription:{type:"object",required:["dataOfferingId","version","active"],properties:{dataOfferingId:{type:"string"},version:{type:"integer"},category:{type:"string"},active:{type:"boolean"},title:{type:"string"}}},parties:{type:"object",required:["providerDid","consumerDid"],properties:{providerDid:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},consumerDid:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}}},purpose:{type:"string"},duration:{type:"object",required:["creationDate","startDate","endDate"],properties:{creationDate:{type:"integer"},startDate:{type:"integer"},endDate:{type:"integer"}}},intendedUse:{type:"object",required:["processData","shareDataWithThirdParty","editData"],properties:{processData:{type:"boolean"},shareDataWithThirdParty:{type:"boolean"},editData:{type:"boolean"}}},licenseGrant:{type:"object",required:["transferable","exclusiveness","paidUp","revocable","processing","modifying","analyzing","storingData","storingCopy","reproducing","distributing","loaning","selling","renting","furtherLicensing","leasing"],properties:{transferable:{type:"boolean"},exclusiveness:{type:"boolean"},paidUp:{type:"boolean"},revocable:{type:"boolean"},processing:{type:"boolean"},modifying:{type:"boolean"},analyzing:{type:"boolean"},storingData:{type:"boolean"},storingCopy:{type:"boolean"},reproducing:{type:"boolean"},distributing:{type:"boolean"},loaning:{type:"boolean"},selling:{type:"boolean"},renting:{type:"boolean"},furtherLicensing:{type:"boolean"},leasing:{type:"boolean"}}},dataStream:{type:"boolean"},personalData:{type:"boolean"},pricingModel:{type:"object",required:["basicPrice","currency","hasFreePrice"],properties:{paymentType:{type:"string"},pricingModelName:{type:"string"},basicPrice:{type:"number",format:"float"},currency:{type:"string"},fee:{type:"number",format:"float"},hasPaymentOnSubscription:{type:"object",properties:{paymentOnSubscriptionName:{type:"string"},paymentType:{type:"string"},timeDuration:{type:"string"},description:{type:"string"},repeat:{type:"string"},hasSubscriptionPrice:{type:"number"}}},hasFreePrice:{type:"object",properties:{hasPriceFree:{type:"boolean"}}}}},dataExchangeAgreement:{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},signatures:{type:"object",required:["providerSignature","consumerSignature"],properties:{providerSignature:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"},consumerSignature:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"}}}}},DataExchange:{allOf:[{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},{type:"object",properties:{cipherblockDgst:{type:"string",description:"hash of the cipherblock in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"},blockCommitment:{type:"string",description:"hash of the plaintext block in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"},secretCommitment:{type:"string",description:"ash of the secret that can be used to decrypt the block in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"}},required:["cipherblockDgst","blockCommitment","secretCommitment"]}]}}},Bp={exports:{}},Fp={},zp={},Up={},Lp={},qp={},Hp={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;class t{}e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class r extends t{constructor(t){if(super(),!e.IDENTIFIER.test(t))throw new Error("CodeGen: name must be a valid identifier");this.str=t}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=r;class n 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,t)=>`${e}${t}`),"")}get names(){var e;return null!==(e=this._names)&&void 0!==e?e:this._names=this._items.reduce(((e,t)=>(t instanceof r&&(e[t.str]=(e[t.str]||0)+1),e)),{})}}function i(e,...t){const r=[e[0]];let i=0;for(;i{if(void 0===r.scopePath)throw new Error(`CodeGen: name "${r}" has no value`);return t._`${e}${r.scopePath}`}))}scopeCode(e=this._values,t,r){return this._reduceValues(e,(e=>{if(void 0===e.value)throw new Error(`CodeGen: name "${e}" has no value`);return e.value.code}),t,r)}_reduceValues(i,o,a={},s){let c=t.nil;for(const u in i){const f=i[u];if(!f)continue;const d=a[u]=a[u]||new Map;f.forEach((i=>{if(d.has(i))return;d.set(i,n.Started);let a=o(i);if(a){const r=this.opts.es5?e.varKinds.var:e.varKinds.const;c=t._`${c}${r} ${i} = ${a};${this.opts._n}`}else{if(!(a=null==s?void 0:s(i)))throw new r(i);c=t._`${c}${a}${this.opts._n}`}d.set(i,n.Completed)}))}return c}}}(Kp),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;const t=Hp,r=Kp;var n=Hp;Object.defineProperty(e,"_",{enumerable:!0,get:function(){return n._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return n.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return n.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return n.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return n.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return n.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return n.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return n.Name}});var i=Kp;Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return i.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return i.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return i.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return i.varKinds}}),e.operators={GT:new t._Code(">"),GTE:new t._Code(">="),LT:new t._Code("<"),LTE:new t._Code("<="),EQ:new t._Code("==="),NEQ:new t._Code("!=="),NOT:new t._Code("!"),OR:new t._Code("||"),AND:new t._Code("&&"),ADD:new t._Code("+")};class o{optimizeNodes(){return this}optimizeNames(e,t){return this}}class a extends o{constructor(e,t,r){super(),this.varKind=e,this.name=t,this.rhs=r}render({es5:e,_n:t}){const n=e?r.varKinds.var:this.varKind,i=void 0===this.rhs?"":` = ${this.rhs}`;return`${n} ${this.name}${i};`+t}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&(this.rhs=C(this.rhs,e,t)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class s extends o{constructor(e,t,r){super(),this.lhs=e,this.rhs=t,this.sideEffects=r}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof t.Name)||e[this.lhs.str]||this.sideEffects)return this.rhs=C(this.rhs,e,r),this}get names(){return M(this.lhs instanceof t.Name?{}:{...this.lhs.names},this.rhs)}}class c extends s{constructor(e,t,r,n){super(e,r,n),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class u extends o{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class f extends o{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class d extends o{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class l extends o{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=C(this.code,e,t),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class h extends o{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce(((t,r)=>t+r.render(e)),"")}optimizeNodes(){const{nodes:e}=this;let t=e.length;for(;t--;){const r=e[t].optimizeNodes();Array.isArray(r)?e.splice(t,1,...r):r?e[t]=r:e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){const{nodes:r}=this;let n=r.length;for(;n--;){const i=r[n];i.optimizeNames(e,t)||(I(e,i.names),r.splice(n,1))}return r.length>0?this:void 0}get names(){return this.nodes.reduce(((e,t)=>k(e,t.names)),{})}}class p extends h{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class m extends h{}class g extends p{}g.kind="else";class y extends p{constructor(e,t){super(t),this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);return this.else&&(t+="else "+this.else.render(e)),t}optimizeNodes(){super.optimizeNodes();const e=this.condition;if(!0===e)return this.nodes;let t=this.else;if(t){const e=t.optimizeNodes();t=this.else=Array.isArray(e)?new g(e):e}return t?!1===e?t instanceof y?t:t.nodes:this.nodes.length?this:new y(R(e),t instanceof y?[t]:t.nodes):!1!==e&&this.nodes.length?this:void 0}optimizeNames(e,t){var r;if(this.else=null===(r=this.else)||void 0===r?void 0:r.optimizeNames(e,t),super.optimizeNames(e,t)||this.else)return this.condition=C(this.condition,e,t),this}get names(){const e=super.names;return M(e,this.condition),this.else&&k(e,this.else.names),e}}y.kind="if";class b extends p{}b.kind="for";class v extends b{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iteration=C(this.iteration,e,t),this}get names(){return k(super.names,this.iteration.names)}}class w extends b{constructor(e,t,r,n){super(),this.varKind=e,this.name=t,this.from=r,this.to=n}render(e){const t=e.es5?r.varKinds.var:this.varKind,{name:n,from:i,to:o}=this;return`for(${t} ${n}=${i}; ${n}<${o}; ${n}++)`+super.render(e)}get names(){const e=M(super.names,this.from);return M(e,this.to)}}class A extends b{constructor(e,t,r,n){super(),this.loop=e,this.varKind=t,this.name=r,this.iterable=n}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iterable=C(this.iterable,e,t),this}get names(){return k(super.names,this.iterable.names)}}class _ extends p{constructor(e,t,r){super(),this.name=e,this.args=t,this.async=r}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}}_.kind="func";class E extends h{render(e){return"return "+super.render(e)}}E.kind="return";class S extends p{render(e){let t="try"+super.render(e);return this.catch&&(t+=this.catch.render(e)),this.finally&&(t+=this.finally.render(e)),t}optimizeNodes(){var e,t;return super.optimizeNodes(),null===(e=this.catch)||void 0===e||e.optimizeNodes(),null===(t=this.finally)||void 0===t||t.optimizeNodes(),this}optimizeNames(e,t){var r,n;return super.optimizeNames(e,t),null===(r=this.catch)||void 0===r||r.optimizeNames(e,t),null===(n=this.finally)||void 0===n||n.optimizeNames(e,t),this}get names(){const e=super.names;return this.catch&&k(e,this.catch.names),this.finally&&k(e,this.finally.names),e}}class P extends p{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}P.kind="catch";class x extends p{render(e){return"finally"+super.render(e)}}x.kind="finally";function k(e,t){for(const r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function M(e,r){return r instanceof t._CodeOrName?k(e,r.names):e}function C(e,r,n){return e instanceof t.Name?o(e):(i=e)instanceof t._Code&&i._items.some((e=>e instanceof t.Name&&1===r[e.str]&&void 0!==n[e.str]))?new t._Code(e._items.reduce(((e,r)=>(r instanceof t.Name&&(r=o(r)),r instanceof t._Code?e.push(...r._items):e.push(r),e)),[])):e;var i;function o(e){const t=n[e.str];return void 0===t||1!==r[e.str]?e:(delete r[e.str],t)}}function I(e,t){for(const r in t)e[r]=(e[r]||0)-(t[r]||0)}function R(e){return"boolean"==typeof e||"number"==typeof e||null===e?!e:t._`!${j(e)}`}e.CodeGen=class{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?"\n":""},this._extScope=e,this._scope=new r.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,t){const r=this._extScope.value(e,t);return(this._values[r.prefix]||(this._values[r.prefix]=new Set)).add(r),r}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,r,n){const i=this._scope.toName(t);return void 0!==r&&n&&(this._constants[i.str]=r),this._leafNode(new a(e,i,r)),i}const(e,t,n){return this._def(r.varKinds.const,e,t,n)}let(e,t,n){return this._def(r.varKinds.let,e,t,n)}var(e,t,n){return this._def(r.varKinds.var,e,t,n)}assign(e,t,r){return this._leafNode(new s(e,t,r))}add(t,r){return this._leafNode(new c(t,e.operators.ADD,r))}code(e){return"function"==typeof e?e():e!==t.nil&&this._leafNode(new l(e)),this}object(...e){const r=["{"];for(const[n,i]of e)r.length>1&&r.push(","),r.push(n),(n!==i||this.opts.es5)&&(r.push(":"),(0,t.addCodeArg)(r,i));return r.push("}"),new t._Code(r)}if(e,t,r){if(this._blockNode(new y(e)),t&&r)this.code(t).else().code(r).endIf();else if(t)this.code(t).endIf();else if(r)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new y(e))}else(){return this._elseNode(new g)}endIf(){return this._endBlockNode(y,g)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new v(e),t)}forRange(e,t,n,i,o=(this.opts.es5?r.varKinds.var:r.varKinds.let)){const a=this._scope.toName(e);return this._for(new w(o,a,t,n),(()=>i(a)))}forOf(e,n,i,o=r.varKinds.const){const a=this._scope.toName(e);if(this.opts.es5){const e=n instanceof t.Name?n:this.var("_arr",n);return this.forRange("_i",0,t._`${e}.length`,(r=>{this.var(a,t._`${e}[${r}]`),i(a)}))}return this._for(new A("of",o,a,n),(()=>i(a)))}forIn(e,n,i,o=(this.opts.es5?r.varKinds.var:r.varKinds.const)){if(this.opts.ownProperties)return this.forOf(e,t._`Object.keys(${n})`,i);const a=this._scope.toName(e);return this._for(new A("in",o,a,n),(()=>i(a)))}endFor(){return this._endBlockNode(b)}label(e){return this._leafNode(new u(e))}break(e){return this._leafNode(new f(e))}return(e){const t=new E;if(this._blockNode(t),this.code(e),1!==t.nodes.length)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(E)}try(e,t,r){if(!t&&!r)throw new Error('CodeGen: "try" without "catch" and "finally"');const n=new S;if(this._blockNode(n),this.code(e),t){const e=this.name("e");this._currNode=n.catch=new P(e),t(e)}return r&&(this._currNode=n.finally=new x,this.code(r)),this._endBlockNode(P,x)}throw(e){return this._leafNode(new d(e))}block(e,t){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(t),this}endBlock(e){const t=this._blockStarts.pop();if(void 0===t)throw new Error("CodeGen: not in self-balancing block");const r=this._nodes.length-t;if(r<0||void 0!==e&&r!==e)throw new Error(`CodeGen: wrong number of nodes: ${r} vs ${e} expected`);return this._nodes.length=t,this}func(e,r=t.nil,n,i){return this._blockNode(new _(e,r,n)),i&&this.code(i).endFunc(),this}endFunc(){return this._endBlockNode(_)}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,t){const r=this._currNode;if(r instanceof e||t&&r instanceof t)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){const t=this._currNode;if(!(t instanceof y))throw new Error('CodeGen: "else" without "if"');return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){const e=this._nodes;return e[e.length-1]}set _currNode(e){const t=this._nodes;t[t.length-1]=e}},e.not=R;const N=T(e.operators.AND);e.and=function(...e){return e.reduce(N)};const O=T(e.operators.OR);function T(e){return(r,n)=>r===t.nil?n:n===t.nil?r:t._`${j(r)} ${e} ${j(n)}`}function j(e){return e instanceof t.Name?e:t._`(${e})`}e.or=function(...e){return e.reduce(O)}}(qp);var Jp={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.checkStrictMode=e.getErrorPath=e.Type=e.useFunc=e.setEvaluated=e.evaluatedPropsToName=e.mergeEvaluated=e.eachItem=e.unescapeJsonPointer=e.escapeJsonPointer=e.escapeFragment=e.unescapeFragment=e.schemaRefOrVal=e.schemaHasRulesButRef=e.schemaHasRules=e.checkUnknownRules=e.alwaysValidSchema=e.toHash=void 0;const t=qp,r=Hp;function n(e,t=e.schema){const{opts:r,self:n}=e;if(!r.strictSchema)return;if("boolean"==typeof t)return;const i=n.RULES.keywords;for(const r in t)i[r]||l(e,`unknown keyword: "${r}"`)}function i(e,t){if("boolean"==typeof e)return!e;for(const r in e)if(t[r])return!0;return!1}function o(e){return"number"==typeof e?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}function a(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function s({mergeNames:e,mergeToName:r,mergeValues:n,resultToName:i}){return(o,a,s,c)=>{const u=void 0===s?a:s instanceof t.Name?(a instanceof t.Name?e(o,a,s):r(o,a,s),s):a instanceof t.Name?(r(o,s,a),a):n(a,s);return c!==t.Name||u instanceof t.Name?u:i(o,u)}}function c(e,r){if(!0===r)return e.var("props",!0);const n=e.var("props",t._`{}`);return void 0!==r&&u(e,n,r),n}function u(e,r,n){Object.keys(n).forEach((n=>e.assign(t._`${r}${(0,t.getProperty)(n)}`,!0)))}e.toHash=function(e){const t={};for(const r of e)t[r]=!0;return t},e.alwaysValidSchema=function(e,t){return"boolean"==typeof t?t:0===Object.keys(t).length||(n(e,t),!i(t,e.self.RULES.all))},e.checkUnknownRules=n,e.schemaHasRules=i,e.schemaHasRulesButRef=function(e,t){if("boolean"==typeof e)return!e;for(const r in e)if("$ref"!==r&&t.all[r])return!0;return!1},e.schemaRefOrVal=function({topSchemaRef:e,schemaPath:r},n,i,o){if(!o){if("number"==typeof n||"boolean"==typeof n)return n;if("string"==typeof n)return t._`${n}`}return t._`${e}${r}${(0,t.getProperty)(i)}`},e.unescapeFragment=function(e){return a(decodeURIComponent(e))},e.escapeFragment=function(e){return encodeURIComponent(o(e))},e.escapeJsonPointer=o,e.unescapeJsonPointer=a,e.eachItem=function(e,t){if(Array.isArray(e))for(const r of e)t(r);else t(e)},e.mergeEvaluated={props:s({mergeNames:(e,r,n)=>e.if(t._`${n} !== true && ${r} !== undefined`,(()=>{e.if(t._`${r} === true`,(()=>e.assign(n,!0)),(()=>e.assign(n,t._`${n} || {}`).code(t._`Object.assign(${n}, ${r})`)))})),mergeToName:(e,r,n)=>e.if(t._`${n} !== true`,(()=>{!0===r?e.assign(n,!0):(e.assign(n,t._`${n} || {}`),u(e,n,r))})),mergeValues:(e,t)=>!0===e||{...e,...t},resultToName:c}),items:s({mergeNames:(e,r,n)=>e.if(t._`${n} !== true && ${r} !== undefined`,(()=>e.assign(n,t._`${r} === true ? true : ${n} > ${r} ? ${n} : ${r}`))),mergeToName:(e,r,n)=>e.if(t._`${n} !== true`,(()=>e.assign(n,!0===r||t._`${n} > ${r} ? ${n} : ${r}`))),mergeValues:(e,t)=>!0===e||Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})},e.evaluatedPropsToName=c,e.setEvaluated=u;const f={};var d;function l(e,t,r=e.opts.strictSchema){if(r){if(t=`strict mode: ${t}`,!0===r)throw new Error(t);e.self.logger.warn(t)}}e.useFunc=function(e,t){return e.scopeValue("func",{ref:t,code:f[t.code]||(f[t.code]=new r._Code(t.code))})},function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"}(d=e.Type||(e.Type={})),e.getErrorPath=function(e,r,n){if(e instanceof t.Name){const i=r===d.Num;return n?i?t._`"[" + ${e} + "]"`:t._`"['" + ${e} + "']"`:i?t._`"/" + ${e}`:t._`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return n?(0,t.getProperty)(e).toString():"/"+o(e)},e.checkStrictMode=l}(Jp);var Wp={};Object.defineProperty(Wp,"__esModule",{value:!0});const Gp=qp,Vp={data:new Gp.Name("data"),valCxt:new Gp.Name("valCxt"),instancePath:new Gp.Name("instancePath"),parentData:new Gp.Name("parentData"),parentDataProperty:new Gp.Name("parentDataProperty"),rootData:new Gp.Name("rootData"),dynamicAnchors:new Gp.Name("dynamicAnchors"),vErrors:new Gp.Name("vErrors"),errors:new Gp.Name("errors"),this:new Gp.Name("this"),self:new Gp.Name("self"),scope:new Gp.Name("scope"),json:new Gp.Name("json"),jsonPos:new Gp.Name("jsonPos"),jsonLen:new Gp.Name("jsonLen"),jsonPart:new Gp.Name("jsonPart")};Wp.default=Vp,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;const t=qp,r=Jp,n=Wp;function i(e,r){const i=e.const("err",r);e.if(t._`${n.default.vErrors} === null`,(()=>e.assign(n.default.vErrors,t._`[${i}]`)),t._`${n.default.vErrors}.push(${i})`),e.code(t._`${n.default.errors}++`)}function o(e,r){const{gen:n,validateName:i,schemaEnv:o}=e;o.$async?n.throw(t._`new ${e.ValidationError}(${r})`):(n.assign(t._`${i}.errors`,r),n.return(!1))}e.keywordError={message:({keyword:e})=>t.str`must pass "${e}" keyword validation`},e.keyword$DataError={message:({keyword:e,schemaType:r})=>r?t.str`"${e}" keyword must be ${r} ($data)`:t.str`"${e}" keyword is invalid ($data)`},e.reportError=function(r,n=e.keywordError,a,c){const{it:u}=r,{gen:f,compositeRule:d,allErrors:l}=u,h=s(r,n,a);(null!=c?c:d||l)?i(f,h):o(u,t._`[${h}]`)},e.reportExtraError=function(t,r=e.keywordError,a){const{it:c}=t,{gen:u,compositeRule:f,allErrors:d}=c;i(u,s(t,r,a)),f||d||o(c,n.default.vErrors)},e.resetErrorsCount=function(e,r){e.assign(n.default.errors,r),e.if(t._`${n.default.vErrors} !== null`,(()=>e.if(r,(()=>e.assign(t._`${n.default.vErrors}.length`,r)),(()=>e.assign(n.default.vErrors,null)))))},e.extendErrors=function({gen:e,keyword:r,schemaValue:i,data:o,errsCount:a,it:s}){if(void 0===a)throw new Error("ajv implementation error");const c=e.name("err");e.forRange("i",a,n.default.errors,(a=>{e.const(c,t._`${n.default.vErrors}[${a}]`),e.if(t._`${c}.instancePath === undefined`,(()=>e.assign(t._`${c}.instancePath`,(0,t.strConcat)(n.default.instancePath,s.errorPath)))),e.assign(t._`${c}.schemaPath`,t.str`${s.errSchemaPath}/${r}`),s.opts.verbose&&(e.assign(t._`${c}.schema`,i),e.assign(t._`${c}.data`,o))}))};const a={keyword:new t.Name("keyword"),schemaPath:new t.Name("schemaPath"),params:new t.Name("params"),propertyName:new t.Name("propertyName"),message:new t.Name("message"),schema:new t.Name("schema"),parentSchema:new t.Name("parentSchema")};function s(e,r,i){const{createErrors:o}=e.it;return!1===o?t._`{}`:function(e,r,i={}){const{gen:o,it:s}=e,f=[c(s,i),u(e,i)];return function(e,{params:r,message:i},o){const{keyword:s,data:c,schemaValue:u,it:f}=e,{opts:d,propertyName:l,topSchemaRef:h,schemaPath:p}=f;o.push([a.keyword,s],[a.params,"function"==typeof r?r(e):r||t._`{}`]),d.messages&&o.push([a.message,"function"==typeof i?i(e):i]);d.verbose&&o.push([a.schema,u],[a.parentSchema,t._`${h}${p}`],[n.default.data,c]);l&&o.push([a.propertyName,l])}(e,r,f),o.object(...f)}(e,r,i)}function c({errorPath:e},{instancePath:i}){const o=i?t.str`${e}${(0,r.getErrorPath)(i,r.Type.Str)}`:e;return[n.default.instancePath,(0,t.strConcat)(n.default.instancePath,o)]}function u({keyword:e,it:{errSchemaPath:n}},{schemaPath:i,parentSchema:o}){let s=o?n:t.str`${n}/${e}`;return i&&(s=t.str`${s}${(0,r.getErrorPath)(i,r.Type.Str)}`),[a.schemaPath,s]}}(Lp),Object.defineProperty(Up,"__esModule",{value:!0}),Up.boolOrEmptySchema=Up.topBoolOrEmptySchema=void 0;const Zp=Lp,Xp=qp,Qp=Wp,Yp={message:"boolean schema is false"};function em(e,t){const{gen:r,data:n}=e,i={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,Zp.reportError)(i,Yp,void 0,t)}Up.topBoolOrEmptySchema=function(e){const{gen:t,schema:r,validateName:n}=e;!1===r?em(e,!1):"object"==typeof r&&!0===r.$async?t.return(Qp.default.data):(t.assign(Xp._`${n}.errors`,null),t.return(!0))},Up.boolOrEmptySchema=function(e,t){const{gen:r,schema:n}=e;!1===n?(r.var(t,!1),em(e)):r.var(t,!0)};var tm={},rm={};Object.defineProperty(rm,"__esModule",{value:!0}),rm.getRules=rm.isJSONType=void 0;const nm=new Set(["string","number","integer","boolean","null","object","array"]);rm.isJSONType=function(e){return"string"==typeof e&&nm.has(e)},rm.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:{}}};var im={};function om(e,t){return t.rules.some((t=>am(e,t)))}function am(e,t){var r;return void 0!==e[t.keyword]||(null===(r=t.definition.implements)||void 0===r?void 0:r.some((t=>void 0!==e[t])))}Object.defineProperty(im,"__esModule",{value:!0}),im.shouldUseRule=im.shouldUseGroup=im.schemaHasRulesForType=void 0,im.schemaHasRulesForType=function({schema:e,self:t},r){const n=t.RULES.types[r];return n&&!0!==n&&om(e,n)},im.shouldUseGroup=om,im.shouldUseRule=am,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.reportTypeError=e.checkDataTypes=e.checkDataType=e.coerceAndCheckDataType=e.getJSONTypes=e.getSchemaTypes=e.DataType=void 0;const t=rm,r=im,n=Lp,i=qp,o=Jp;var a;function s(e){const r=Array.isArray(e)?e:e?[e]:[];if(r.every(t.isJSONType))return r;throw new Error("type must be JSONType or JSONType[]: "+r.join(","))}!function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"}(a=e.DataType||(e.DataType={})),e.getSchemaTypes=function(e){const t=s(e.type);if(t.includes("null")){if(!1===e.nullable)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&void 0!==e.nullable)throw new Error('"nullable" cannot be used without "type"');!0===e.nullable&&t.push("null")}return t},e.getJSONTypes=s,e.coerceAndCheckDataType=function(e,t){const{gen:n,data:o,opts:s}=e,u=function(e,t){return t?e.filter((e=>c.has(e)||"array"===t&&"array"===e)):[]}(t,s.coerceTypes),d=t.length>0&&!(0===u.length&&1===t.length&&(0,r.schemaHasRulesForType)(e,t[0]));if(d){const r=f(t,o,s.strictNumbers,a.Wrong);n.if(r,(()=>{u.length?function(e,t,r){const{gen:n,data:o,opts:a}=e,s=n.let("dataType",i._`typeof ${o}`),u=n.let("coerced",i._`undefined`);"array"===a.coerceTypes&&n.if(i._`${s} == 'object' && Array.isArray(${o}) && ${o}.length == 1`,(()=>n.assign(o,i._`${o}[0]`).assign(s,i._`typeof ${o}`).if(f(t,o,a.strictNumbers),(()=>n.assign(u,o)))));n.if(i._`${u} !== undefined`);for(const e of r)(c.has(e)||"array"===e&&"array"===a.coerceTypes)&&d(e);function d(e){switch(e){case"string":return void n.elseIf(i._`${s} == "number" || ${s} == "boolean"`).assign(u,i._`"" + ${o}`).elseIf(i._`${o} === null`).assign(u,i._`""`);case"number":return void n.elseIf(i._`${s} == "boolean" || ${o} === null || (${s} == "string" && ${o} && ${o} == +${o})`).assign(u,i._`+${o}`);case"integer":return void n.elseIf(i._`${s} === "boolean" || ${o} === null || (${s} === "string" && ${o} && ${o} == +${o} && !(${o} % 1))`).assign(u,i._`+${o}`);case"boolean":return void n.elseIf(i._`${o} === "false" || ${o} === 0 || ${o} === null`).assign(u,!1).elseIf(i._`${o} === "true" || ${o} === 1`).assign(u,!0);case"null":return n.elseIf(i._`${o} === "" || ${o} === 0 || ${o} === false`),void n.assign(u,null);case"array":n.elseIf(i._`${s} === "string" || ${s} === "number" - || ${s} === "boolean" || ${o} === null`).assign(u,i._`[${o}]`)}}n.else(),l(e),n.endIf(),n.if(i._`${u} !== undefined`,(()=>{n.assign(o,u),function({gen:e,parentData:t,parentDataProperty:r},n){e.if(i._`${t} !== undefined`,(()=>e.assign(i._`${t}[${r}]`,n)))}(e,u)}))}(e,t,u):l(e)}))}return d};const c=new Set(["string","number","integer","boolean","null"]);function u(e,t,r,n=a.Correct){const o=n===a.Correct?i.operators.EQ:i.operators.NEQ;let s;switch(e){case"null":return i._`${t} ${o} null`;case"array":s=i._`Array.isArray(${t})`;break;case"object":s=i._`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":s=c(i._`!(${t} % 1) && !isNaN(${t})`);break;case"number":s=c();break;default:return i._`typeof ${t} ${o} ${e}`}return n===a.Correct?s:(0,i.not)(s);function c(e=i.nil){return(0,i.and)(i._`typeof ${t} == "number"`,e,r?i._`isFinite(${t})`:i.nil)}}function f(e,t,r,n){if(1===e.length)return u(e[0],t,r,n);let a;const s=(0,o.toHash)(e);if(s.array&&s.object){const e=i._`typeof ${t} != "object"`;a=s.null?e:i._`!${t} || ${e}`,delete s.null,delete s.array,delete s.object}else a=i.nil;s.number&&delete s.integer;for(const e in s)a=(0,i.and)(a,u(e,t,r,n));return a}e.checkDataType=u,e.checkDataTypes=f;const d={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>"string"==typeof e?i._`{type: ${e}}`:i._`{type: ${t}}`};function l(e){const t=function(e){const{gen:t,data:r,schema:n}=e,i=(0,o.schemaRefOrVal)(e,n,"type");return{gen:t,keyword:"type",data:r,schema:n.type,schemaCode:i,schemaValue:i,parentSchema:n,params:{},it:e}}(e);(0,n.reportError)(t,d)}e.reportTypeError=l}(Yp);var om={};Object.defineProperty(om,"__esModule",{value:!0}),om.assignDefaults=void 0;const am=Up,sm=Hp;function cm(e,t,r){const{gen:n,compositeRule:i,data:o,opts:a}=e;if(void 0===r)return;const s=am._`${o}${(0,am.getProperty)(t)}`;if(i)return void(0,sm.checkStrictMode)(e,`default is ignored for: ${s}`);let c=am._`${s} === undefined`;"empty"===a.useDefaults&&(c=am._`${c} || ${s} === null || ${s} === ""`),n.if(c,am._`${s} = ${(0,am.stringify)(r)}`)}om.assignDefaults=function(e,t){const{properties:r,items:n}=e.schema;if("object"===t&&r)for(const t in r)cm(e,t,r[t].default);else"array"===t&&Array.isArray(n)&&n.forEach(((t,r)=>cm(e,r,t.default)))};var um={},fm={};Object.defineProperty(fm,"__esModule",{value:!0}),fm.validateUnion=fm.validateArray=fm.usePattern=fm.callValidateCode=fm.schemaProperties=fm.allSchemaProperties=fm.noPropertyInData=fm.propertyInData=fm.isOwnProperty=fm.hasPropFunc=fm.reportMissingProp=fm.checkMissingProp=fm.checkReportMissingProp=void 0;const dm=Up,lm=Hp,hm=Kp,pm=Hp;function mm(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:dm._`Object.prototype.hasOwnProperty`})}function gm(e,t,r){return dm._`${mm(e)}.call(${t}, ${r})`}function ym(e,t,r,n){const i=dm._`${t}${(0,dm.getProperty)(r)} === undefined`;return n?(0,dm.or)(i,(0,dm.not)(gm(e,t,r))):i}function bm(e){return e?Object.keys(e).filter((e=>"__proto__"!==e)):[]}fm.checkReportMissingProp=function(e,t){const{gen:r,data:n,it:i}=e;r.if(ym(r,n,t,i.opts.ownProperties),(()=>{e.setParams({missingProperty:dm._`${t}`},!0),e.error()}))},fm.checkMissingProp=function({gen:e,data:t,it:{opts:r}},n,i){return(0,dm.or)(...n.map((n=>(0,dm.and)(ym(e,t,n,r.ownProperties),dm._`${i} = ${n}`))))},fm.reportMissingProp=function(e,t){e.setParams({missingProperty:t},!0),e.error()},fm.hasPropFunc=mm,fm.isOwnProperty=gm,fm.propertyInData=function(e,t,r,n){const i=dm._`${t}${(0,dm.getProperty)(r)} !== undefined`;return n?dm._`${i} && ${gm(e,t,r)}`:i},fm.noPropertyInData=ym,fm.allSchemaProperties=bm,fm.schemaProperties=function(e,t){return bm(t).filter((r=>!(0,lm.alwaysValidSchema)(e,t[r])))},fm.callValidateCode=function({schemaCode:e,data:t,it:{gen:r,topSchemaRef:n,schemaPath:i,errorPath:o},it:a},s,c,u){const f=u?dm._`${e}, ${t}, ${n}${i}`:t,d=[[hm.default.instancePath,(0,dm.strConcat)(hm.default.instancePath,o)],[hm.default.parentData,a.parentData],[hm.default.parentDataProperty,a.parentDataProperty],[hm.default.rootData,hm.default.rootData]];a.opts.dynamicRef&&d.push([hm.default.dynamicAnchors,hm.default.dynamicAnchors]);const l=dm._`${f}, ${r.object(...d)}`;return c!==dm.nil?dm._`${s}.call(${c}, ${l})`:dm._`${s}(${l})`};const vm=dm._`new RegExp`;fm.usePattern=function({gen:e,it:{opts:t}},r){const n=t.unicodeRegExp?"u":"",{regExp:i}=t.code,o=i(r,n);return e.scopeValue("pattern",{key:o.toString(),ref:o,code:dm._`${"new RegExp"===i.code?vm:(0,pm.useFunc)(e,i)}(${r}, ${n})`})},fm.validateArray=function(e){const{gen:t,data:r,keyword:n,it:i}=e,o=t.name("valid");if(i.allErrors){const e=t.let("valid",!0);return a((()=>t.assign(e,!1))),e}return t.var(o,!0),a((()=>t.break())),o;function a(i){const a=t.const("len",dm._`${r}.length`);t.forRange("i",0,a,(r=>{e.subschema({keyword:n,dataProp:r,dataPropType:lm.Type.Num},o),t.if((0,dm.not)(o),i)}))}},fm.validateUnion=function(e){const{gen:t,schema:r,keyword:n,it:i}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some((e=>(0,lm.alwaysValidSchema)(i,e)))&&!i.opts.unevaluated)return;const o=t.let("valid",!1),a=t.name("_valid");t.block((()=>r.forEach(((r,i)=>{const s=e.subschema({keyword:n,schemaProp:i,compositeRule:!0},a);t.assign(o,dm._`${o} || ${a}`);e.mergeValidEvaluated(s,a)||t.if((0,dm.not)(o))})))),e.result(o,(()=>e.reset()),(()=>e.error(!0)))},Object.defineProperty(um,"__esModule",{value:!0}),um.validateKeywordUsage=um.validSchemaType=um.funcKeywordCode=um.macroKeywordCode=void 0;const wm=Up,Am=Kp,_m=fm,Em=zp;function Sm(e){const{gen:t,data:r,it:n}=e;t.if(n.parentData,(()=>t.assign(r,wm._`${n.parentData}[${n.parentDataProperty}]`)))}function Pm(e,t,r){if(void 0===r)throw new Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword","function"==typeof r?{ref:r}:{ref:r,code:(0,wm.stringify)(r)})}um.macroKeywordCode=function(e,t){const{gen:r,keyword:n,schema:i,parentSchema:o,it:a}=e,s=t.macro.call(a.self,i,o,a),c=Pm(r,n,s);!1!==a.opts.validateSchema&&a.self.validateSchema(s,!0);const u=r.name("valid");e.subschema({schema:s,schemaPath:wm.nil,errSchemaPath:`${a.errSchemaPath}/${n}`,topSchemaRef:c,compositeRule:!0},u),e.pass(u,(()=>e.error(!0)))},um.funcKeywordCode=function(e,t){var r;const{gen:n,keyword:i,schema:o,parentSchema:a,$data:s,it:c}=e;!function({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}(c,t);const u=!s&&t.compile?t.compile.call(c.self,o,a,c):t.validate,f=Pm(n,i,u),d=n.let("valid");function l(r=(t.async?wm._`await `:wm.nil)){const i=c.opts.passContext?Am.default.this:Am.default.self,o=!("compile"in t&&!s||!1===t.schema);n.assign(d,wm._`${r}${(0,_m.callValidateCode)(e,f,i,o)}`,t.modifying)}function h(e){var r;n.if((0,wm.not)(null!==(r=t.valid)&&void 0!==r?r:d),e)}e.block$data(d,(function(){if(!1===t.errors)l(),t.modifying&&Sm(e),h((()=>e.error()));else{const r=t.async?function(){const e=n.let("ruleErrs",null);return n.try((()=>l(wm._`await `)),(t=>n.assign(d,!1).if(wm._`${t} instanceof ${c.ValidationError}`,(()=>n.assign(e,wm._`${t}.errors`)),(()=>n.throw(t))))),e}():function(){const e=wm._`${f}.errors`;return n.assign(e,null),l(wm.nil),e}();t.modifying&&Sm(e),h((()=>function(e,t){const{gen:r}=e;r.if(wm._`Array.isArray(${t})`,(()=>{r.assign(Am.default.vErrors,wm._`${Am.default.vErrors} === null ? ${t} : ${Am.default.vErrors}.concat(${t})`).assign(Am.default.errors,wm._`${Am.default.vErrors}.length`),(0,Em.extendErrors)(e)}),(()=>e.error()))}(e,r)))}})),e.ok(null!==(r=t.valid)&&void 0!==r?r:d)},um.validSchemaType=function(e,t,r=!1){return!t.length||t.some((t=>"array"===t?Array.isArray(e):"object"===t?e&&"object"==typeof e&&!Array.isArray(e):typeof e==t||r&&void 0===e))},um.validateKeywordUsage=function({schema:e,opts:t,self:r,errSchemaPath:n},i,o){if(Array.isArray(i.keyword)?!i.keyword.includes(o):i.keyword!==o)throw new Error("ajv implementation error");const a=i.dependencies;if(null==a?void 0:a.some((t=>!Object.prototype.hasOwnProperty.call(e,t))))throw new Error(`parent schema must have dependencies of ${o}: ${a.join(",")}`);if(i.validateSchema){if(!i.validateSchema(e[o])){const e=`keyword "${o}" value is invalid at path "${n}": `+r.errorsText(i.validateSchema.errors);if("log"!==t.validateSchema)throw new Error(e);r.logger.error(e)}}};var xm={};Object.defineProperty(xm,"__esModule",{value:!0}),xm.extendSubschemaMode=xm.extendSubschemaData=xm.getSubschema=void 0;const km=Up,Mm=Hp;xm.getSubschema=function(e,{keyword:t,schemaProp:r,schema:n,schemaPath:i,errSchemaPath:o,topSchemaRef:a}){if(void 0!==t&&void 0!==n)throw new Error('both "keyword" and "schema" passed, only one allowed');if(void 0!==t){const n=e.schema[t];return void 0===r?{schema:n,schemaPath:km._`${e.schemaPath}${(0,km.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:n[r],schemaPath:km._`${e.schemaPath}${(0,km.getProperty)(t)}${(0,km.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,Mm.escapeFragment)(r)}`}}if(void 0!==n){if(void 0===i||void 0===o||void 0===a)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:i,topSchemaRef:a,errSchemaPath:o}}throw new Error('either "keyword" or "schema" must be passed')},xm.extendSubschemaData=function(e,t,{dataProp:r,dataPropType:n,data:i,dataTypes:o,propertyName:a}){if(void 0!==i&&void 0!==r)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:s}=t;if(void 0!==r){const{errorPath:i,dataPathArr:o,opts:a}=t;c(s.let("data",km._`${t.data}${(0,km.getProperty)(r)}`,!0)),e.errorPath=km.str`${i}${(0,Mm.getErrorPath)(r,n,a.jsPropertySyntax)}`,e.parentDataProperty=km._`${r}`,e.dataPathArr=[...o,e.parentDataProperty]}if(void 0!==i){c(i instanceof km.Name?i:s.let("data",i,!0)),void 0!==a&&(e.propertyName=a)}function c(r){e.data=r,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,r]}o&&(e.dataTypes=o)},xm.extendSubschemaMode=function(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:n,createErrors:i,allErrors:o}){void 0!==n&&(e.compositeRule=n),void 0!==i&&(e.createErrors=i),void 0!==o&&(e.allErrors=o),e.jtdDiscriminator=t,e.jtdMetadata=r};var Cm={},Im=function e(t,r){if(t===r)return!0;if(t&&r&&"object"==typeof t&&"object"==typeof r){if(t.constructor!==r.constructor)return!1;var n,i,o;if(Array.isArray(t)){if((n=t.length)!=r.length)return!1;for(i=n;0!=i--;)if(!e(t[i],r[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if((n=(o=Object.keys(t)).length)!==Object.keys(r).length)return!1;for(i=n;0!=i--;)if(!Object.prototype.hasOwnProperty.call(r,o[i]))return!1;for(i=n;0!=i--;){var a=o[i];if(!e(t[a],r[a]))return!1}return!0}return t!=t&&r!=r},Rm={exports:{}},Nm=Rm.exports=function(e,t,r){"function"==typeof t&&(r=t,t={}),Om(t,"function"==typeof(r=t.cb||r)?r:r.pre||function(){},r.post||function(){},e,"",e)};function Om(e,t,r,n,i,o,a,s,c,u){if(n&&"object"==typeof n&&!Array.isArray(n)){for(var f in t(n,i,o,a,s,c,u),n){var d=n[f];if(Array.isArray(d)){if(f in Nm.arrayKeywords)for(var l=0;lt+=Um(e))),t===1/0))return 1/0}return t}function Lm(e,t="",r){!1!==r&&(t=Km(t));const n=e.parse(t);return qm(e,n)}function qm(e,t){return e.serialize(t).split("#")[0]+"#"}Cm.getFullPath=Lm,Cm._getFullPath=qm;const Hm=/#\/?$/;function Km(e){return e?e.replace(Hm,""):""}Cm.normalizeId=Km,Cm.resolveUrl=function(e,t,r){return r=Km(r),e.resolve(t,r)};const Jm=/^[a-z_][-a-z0-9._]*$/i;Cm.getSchemaRefs=function(e,t){if("boolean"==typeof e)return{};const{schemaId:r,uriResolver:n}=this.opts,i=Km(e[r]||t),o={"":i},a=Lm(n,i,!1),s={},c=new Set;return Dm(e,{allKeys:!0},((e,t,n,i)=>{if(void 0===i)return;const d=a+t;let l=o[i];function h(t){const r=this.opts.uriResolver.resolve;if(t=Km(l?r(l,t):t),c.has(t))throw f(t);c.add(t);let n=this.refs[t];return"string"==typeof n&&(n=this.refs[n]),"object"==typeof n?u(e,n.schema,t):t!==Km(d)&&("#"===t[0]?(u(e,s[t],t),s[t]=e):this.refs[t]=d),t}function p(e){if("string"==typeof e){if(!Jm.test(e))throw new Error(`invalid anchor "${e}"`);h.call(this,`#${e}`)}}"string"==typeof e[r]&&(l=h.call(this,e[r])),p.call(this,e.$anchor),p.call(this,e.$dynamicAnchor),o[t]=l})),s;function u(e,t,r){if(void 0!==t&&!$m(e,t))throw f(r)}function f(e){return new Error(`reference "${e}" resolves to more than one schema`)}},Object.defineProperty(Bp,"__esModule",{value:!0}),Bp.getData=Bp.KeywordCxt=Bp.validateFunctionCode=void 0;const Wm=Fp,Gm=Yp,Vm=rm,Zm=Yp,Xm=om,Qm=um,Ym=xm,eg=Up,tg=Kp,rg=Cm,ng=Hp,ig=zp;function og({gen:e,validateName:t,schema:r,schemaEnv:n,opts:i},o){i.code.es5?e.func(t,eg._`${tg.default.data}, ${tg.default.valCxt}`,n.$async,(()=>{e.code(eg._`"use strict"; ${ag(r,i)}`),function(e,t){e.if(tg.default.valCxt,(()=>{e.var(tg.default.instancePath,eg._`${tg.default.valCxt}.${tg.default.instancePath}`),e.var(tg.default.parentData,eg._`${tg.default.valCxt}.${tg.default.parentData}`),e.var(tg.default.parentDataProperty,eg._`${tg.default.valCxt}.${tg.default.parentDataProperty}`),e.var(tg.default.rootData,eg._`${tg.default.valCxt}.${tg.default.rootData}`),t.dynamicRef&&e.var(tg.default.dynamicAnchors,eg._`${tg.default.valCxt}.${tg.default.dynamicAnchors}`)}),(()=>{e.var(tg.default.instancePath,eg._`""`),e.var(tg.default.parentData,eg._`undefined`),e.var(tg.default.parentDataProperty,eg._`undefined`),e.var(tg.default.rootData,tg.default.data),t.dynamicRef&&e.var(tg.default.dynamicAnchors,eg._`{}`)}))}(e,i),e.code(o)})):e.func(t,eg._`${tg.default.data}, ${function(e){return eg._`{${tg.default.instancePath}="", ${tg.default.parentData}, ${tg.default.parentDataProperty}, ${tg.default.rootData}=${tg.default.data}${e.dynamicRef?eg._`, ${tg.default.dynamicAnchors}={}`:eg.nil}}={}`}(i)}`,n.$async,(()=>e.code(ag(r,i)).code(o)))}function ag(e,t){const r="object"==typeof e&&e[t.schemaId];return r&&(t.code.source||t.code.process)?eg._`/*# sourceURL=${r} */`:eg.nil}function sg(e,t){ug(e)&&(fg(e),cg(e))?function(e,t){const{schema:r,gen:n,opts:i}=e;i.$comment&&r.$comment&&lg(e);(function(e){const t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,rg.resolveUrl)(e.opts.uriResolver,e.baseId,t))})(e),function(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}(e);const o=n.const("_errs",tg.default.errors);dg(e,o),n.var(t,eg._`${o} === ${tg.default.errors}`)}(e,t):(0,Wm.boolOrEmptySchema)(e,t)}function cg({schema:e,self:t}){if("boolean"==typeof e)return!e;for(const r in e)if(t.RULES.all[r])return!0;return!1}function ug(e){return"boolean"!=typeof e.schema}function fg(e){(0,ng.checkUnknownRules)(e),function(e){const{schema:t,errSchemaPath:r,opts:n,self:i}=e;t.$ref&&n.ignoreKeywordsWithRef&&(0,ng.schemaHasRulesButRef)(t,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}(e)}function dg(e,t){if(e.opts.jtd)return hg(e,[],!1,t);const r=(0,Gm.getSchemaTypes)(e.schema);hg(e,r,!(0,Gm.coerceAndCheckDataType)(e,r),t)}function lg({gen:e,schemaEnv:t,schema:r,errSchemaPath:n,opts:i}){const o=r.$comment;if(!0===i.$comment)e.code(eg._`${tg.default.self}.logger.log(${o})`);else if("function"==typeof i.$comment){const r=eg.str`${n}/$comment`,i=e.scopeValue("root",{ref:t.root});e.code(eg._`${tg.default.self}.opts.$comment(${o}, ${r}, ${i}.schema)`)}}function hg(e,t,r,n){const{gen:i,schema:o,data:a,allErrors:s,opts:c,self:u}=e,{RULES:f}=u;function d(u){(0,Vm.shouldUseGroup)(o,u)&&(u.type?(i.if((0,Zm.checkDataType)(u.type,a,c.strictNumbers)),pg(e,u),1===t.length&&t[0]===u.type&&r&&(i.else(),(0,Zm.reportTypeError)(e)),i.endIf()):pg(e,u),s||i.if(eg._`${tg.default.errors} === ${n||0}`))}!o.$ref||!c.ignoreKeywordsWithRef&&(0,ng.schemaHasRulesButRef)(o,f)?(c.jtd||function(e,t){if(e.schemaEnv.meta||!e.opts.strictTypes)return;(function(e,t){if(!t.length)return;if(!e.dataTypes.length)return void(e.dataTypes=t);t.forEach((t=>{gg(e.dataTypes,t)||yg(e,`type "${t}" not allowed by context "${e.dataTypes.join(",")}"`)})),function(e,t){const r=[];for(const n of e.dataTypes)gg(t,n)?r.push(n):t.includes("integer")&&"number"===n&&r.push("integer");e.dataTypes=r}(e,t)})(e,t),e.opts.allowUnionTypes||function(e,t){t.length>1&&(2!==t.length||!t.includes("null"))&&yg(e,"use allowUnionTypes to allow union type keyword")}(e,t);!function(e,t){const r=e.self.RULES.all;for(const n in r){const i=r[n];if("object"==typeof i&&(0,Vm.shouldUseRule)(e.schema,i)){const{type:r}=i.definition;r.length&&!r.some((e=>mg(t,e)))&&yg(e,`missing type "${r.join(",")}" for keyword "${n}"`)}}}(e,e.dataTypes)}(e,t),i.block((()=>{for(const e of f.rules)d(e);d(f.post)}))):i.block((()=>vg(e,"$ref",f.all.$ref.definition)))}function pg(e,t){const{gen:r,schema:n,opts:{useDefaults:i}}=e;i&&(0,Xm.assignDefaults)(e,t.type),r.block((()=>{for(const r of t.rules)(0,Vm.shouldUseRule)(n,r)&&vg(e,r.keyword,r.definition,t.type)}))}function mg(e,t){return e.includes(t)||"number"===t&&e.includes("integer")}function gg(e,t){return e.includes(t)||"integer"===t&&e.includes("number")}function yg(e,t){t+=` at "${e.schemaEnv.baseId+e.errSchemaPath}" (strictTypes)`,(0,ng.checkStrictMode)(e,t,e.opts.strictTypes)}Bp.validateFunctionCode=function(e){ug(e)&&(fg(e),cg(e))?function(e){const{schema:t,opts:r,gen:n}=e;og(e,(()=>{r.$comment&&t.$comment&&lg(e),function(e){const{schema:t,opts:r}=e;void 0!==t.default&&r.useDefaults&&r.strictSchema&&(0,ng.checkStrictMode)(e,"default is ignored in the schema root")}(e),n.let(tg.default.vErrors,null),n.let(tg.default.errors,0),r.unevaluated&&function(e){const{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",eg._`${r}.evaluated`),t.if(eg._`${e.evaluated}.dynamicProps`,(()=>t.assign(eg._`${e.evaluated}.props`,eg._`undefined`))),t.if(eg._`${e.evaluated}.dynamicItems`,(()=>t.assign(eg._`${e.evaluated}.items`,eg._`undefined`)))}(e),dg(e),function(e){const{gen:t,schemaEnv:r,validateName:n,ValidationError:i,opts:o}=e;r.$async?t.if(eg._`${tg.default.errors} === 0`,(()=>t.return(tg.default.data)),(()=>t.throw(eg._`new ${i}(${tg.default.vErrors})`))):(t.assign(eg._`${n}.errors`,tg.default.vErrors),o.unevaluated&&function({gen:e,evaluated:t,props:r,items:n}){r instanceof eg.Name&&e.assign(eg._`${t}.props`,r);n instanceof eg.Name&&e.assign(eg._`${t}.items`,n)}(e),t.return(eg._`${tg.default.errors} === 0`))}(e)}))}(e):og(e,(()=>(0,Wm.topBoolOrEmptySchema)(e)))};class bg{constructor(e,t,r){if((0,Qm.validateKeywordUsage)(e,t,r),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=r,this.data=e.data,this.schema=e.schema[r],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,ng.schemaRefOrVal)(e,this.schema,r,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const("vSchema",_g(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,Qm.validSchemaType)(this.schema,t.schemaType,t.allowUndefined))throw new Error(`${r} value must be ${JSON.stringify(t.schemaType)}`);("code"in t?t.trackErrors:!1!==t.errors)&&(this.errsCount=e.gen.const("_errs",tg.default.errors))}result(e,t,r){this.failResult((0,eg.not)(e),t,r)}failResult(e,t,r){this.gen.if(e),r?r():this.error(),t?(this.gen.else(),t(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,t){this.failResult((0,eg.not)(e),void 0,t)}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:t}=this;this.fail(eg._`${t} !== undefined && (${(0,eg.or)(this.invalid$data(),e)})`)}error(e,t,r){if(t)return this.setParams(t),this._error(e,r),void this.setParams({});this._error(e,r)}_error(e,t){(e?ig.reportExtraError:ig.reportError)(this,this.def.error,t)}$dataError(){(0,ig.reportError)(this,this.def.$dataError||ig.keyword$DataError)}reset(){if(void 0===this.errsCount)throw new Error('add "trackErrors" to keyword definition');(0,ig.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,t){t?Object.assign(this.params,e):this.params=e}block$data(e,t,r=eg.nil){this.gen.block((()=>{this.check$data(e,r),t()}))}check$data(e=eg.nil,t=eg.nil){if(!this.$data)return;const{gen:r,schemaCode:n,schemaType:i,def:o}=this;r.if((0,eg.or)(eg._`${n} === undefined`,t)),e!==eg.nil&&r.assign(e,!0),(i.length||o.validateSchema)&&(r.elseIf(this.invalid$data()),this.$dataError(),e!==eg.nil&&r.assign(e,!1)),r.else()}invalid$data(){const{gen:e,schemaCode:t,schemaType:r,def:n,it:i}=this;return(0,eg.or)(function(){if(r.length){if(!(t instanceof eg.Name))throw new Error("ajv implementation error");const e=Array.isArray(r)?r:[r];return eg._`${(0,Zm.checkDataTypes)(e,t,i.opts.strictNumbers,Zm.DataType.Wrong)}`}return eg.nil}(),function(){if(n.validateSchema){const r=e.scopeValue("validate$data",{ref:n.validateSchema});return eg._`!${r}(${t})`}return eg.nil}())}subschema(e,t){const r=(0,Ym.getSubschema)(this.it,e);(0,Ym.extendSubschemaData)(r,this.it,e),(0,Ym.extendSubschemaMode)(r,e);const n={...this.it,...r,items:void 0,props:void 0};return sg(n,t),n}mergeEvaluated(e,t){const{it:r,gen:n}=this;r.opts.unevaluated&&(!0!==r.props&&void 0!==e.props&&(r.props=ng.mergeEvaluated.props(n,e.props,r.props,t)),!0!==r.items&&void 0!==e.items&&(r.items=ng.mergeEvaluated.items(n,e.items,r.items,t)))}mergeValidEvaluated(e,t){const{it:r,gen:n}=this;if(r.opts.unevaluated&&(!0!==r.props||!0!==r.items))return n.if(t,(()=>this.mergeEvaluated(e,eg.Name))),!0}}function vg(e,t,r,n){const i=new bg(e,r,t);"code"in r?r.code(i,n):i.$data&&r.validate?(0,Qm.funcKeywordCode)(i,r):"macro"in r?(0,Qm.macroKeywordCode)(i,r):(r.compile||r.validate)&&(0,Qm.funcKeywordCode)(i,r)}Bp.KeywordCxt=bg;const wg=/^\/(?:[^~]|~0|~1)*$/,Ag=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function _g(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let i,o;if(""===e)return tg.default.rootData;if("/"===e[0]){if(!wg.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);i=e,o=tg.default.rootData}else{const a=Ag.exec(e);if(!a)throw new Error(`Invalid JSON-pointer: ${e}`);const s=+a[1];if(i=a[2],"#"===i){if(s>=t)throw new Error(c("property/index",s));return n[t-s]}if(s>t)throw new Error(c("data",s));if(o=r[t-s],!i)return o}let a=o;const s=i.split("/");for(const e of s)e&&(o=eg._`${o}${(0,eg.getProperty)((0,ng.unescapeJsonPointer)(e))}`,a=eg._`${a} && ${o}`);return a;function c(e,r){return`Cannot access ${e} ${r} levels up, current level is ${t}`}}Bp.getData=_g;var Eg={};Object.defineProperty(Eg,"__esModule",{value:!0});class Sg extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}}Eg.default=Sg;var Pg={};Object.defineProperty(Pg,"__esModule",{value:!0});const xg=Cm;class kg extends Error{constructor(e,t,r,n){super(n||`can't resolve reference ${r} from id ${t}`),this.missingRef=(0,xg.resolveUrl)(e,t,r),this.missingSchema=(0,xg.normalizeId)((0,xg.getFullPath)(e,this.missingRef))}}Pg.default=kg;var Mg={};Object.defineProperty(Mg,"__esModule",{value:!0}),Mg.resolveSchema=Mg.getCompilingSchema=Mg.resolveRef=Mg.compileSchema=Mg.SchemaEnv=void 0;const Cg=Up,Ig=Eg,Rg=Kp,Ng=Cm,Og=Hp,Tg=Bp;class jg{constructor(e){var t;let r;this.refs={},this.dynamicAnchors={},"object"==typeof e.schema&&(r=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=null!==(t=e.baseId)&&void 0!==t?t:(0,Ng.normalizeId)(null==r?void 0:r[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=null==r?void 0:r.$async,this.refs={}}}function $g(e){const t=Bg.call(this,e);if(t)return t;const r=(0,Ng.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:n,lines:i}=this.opts.code,{ownProperties:o}=this.opts,a=new Cg.CodeGen(this.scope,{es5:n,lines:i,ownProperties:o});let s;e.$async&&(s=a.scopeValue("Error",{ref:Ig.default,code:Cg._`require("ajv/dist/runtime/validation_error").default`}));const c=a.scopeName("validate");e.validateName=c;const u={gen:a,allErrors:this.opts.allErrors,data:Rg.default.data,parentData:Rg.default.parentData,parentDataProperty:Rg.default.parentDataProperty,dataNames:[Rg.default.data],dataPathArr:[Cg.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:a.scopeValue("schema",!0===this.opts.code.source?{ref:e.schema,code:(0,Cg.stringify)(e.schema)}:{ref:e.schema}),validateName:c,ValidationError:s,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:Cg.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:Cg._`""`,opts:this.opts,self:this};let f;try{this._compilations.add(e),(0,Tg.validateFunctionCode)(u),a.optimize(this.opts.code.optimize);const t=a.toString();f=`${a.scopeRefs(Rg.default.scope)}return ${t}`,this.opts.code.process&&(f=this.opts.code.process(f,e));const r=new Function(`${Rg.default.self}`,`${Rg.default.scope}`,f)(this,this.scope.get());if(this.scope.value(c,{ref:r}),r.errors=null,r.schema=e.schema,r.schemaEnv=e,e.$async&&(r.$async=!0),!0===this.opts.code.source&&(r.source={validateName:c,validateCode:t,scopeValues:a._values}),this.opts.unevaluated){const{props:e,items:t}=u;r.evaluated={props:e instanceof Cg.Name?void 0:e,items:t instanceof Cg.Name?void 0:t,dynamicProps:e instanceof Cg.Name,dynamicItems:t instanceof Cg.Name},r.source&&(r.source.evaluated=(0,Cg.stringify)(r.evaluated))}return e.validate=r,e}catch(t){throw delete e.validate,delete e.validateName,f&&this.logger.error("Error compiling schema, function code:",f),t}finally{this._compilations.delete(e)}}function Dg(e){return(0,Ng.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:$g.call(this,e)}function Bg(e){for(const n of this._compilations)if(r=e,(t=n).schema===r.schema&&t.root===r.root&&t.baseId===r.baseId)return n;var t,r}function Fg(e,t){let r;for(;"string"==typeof(r=this.refs[t]);)t=r;return r||this.schemas[t]||zg.call(this,e,t)}function zg(e,t){const r=this.opts.uriResolver.parse(t),n=(0,Ng._getFullPath)(this.opts.uriResolver,r);let i=(0,Ng.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===i)return Lg.call(this,r,e);const o=(0,Ng.normalizeId)(n),a=this.refs[o]||this.schemas[o];if("string"==typeof a){const t=zg.call(this,e,a);if("object"!=typeof(null==t?void 0:t.schema))return;return Lg.call(this,r,t)}if("object"==typeof(null==a?void 0:a.schema)){if(a.validate||$g.call(this,a),o===(0,Ng.normalizeId)(t)){const{schema:t}=a,{schemaId:r}=this.opts,n=t[r];return n&&(i=(0,Ng.resolveUrl)(this.opts.uriResolver,i,n)),new jg({schema:t,schemaId:r,root:e,baseId:i})}return Lg.call(this,r,a)}}Mg.SchemaEnv=jg,Mg.compileSchema=$g,Mg.resolveRef=function(e,t,r){var n;r=(0,Ng.resolveUrl)(this.opts.uriResolver,t,r);const i=e.refs[r];if(i)return i;let o=Fg.call(this,e,r);if(void 0===o){const i=null===(n=e.localRefs)||void 0===n?void 0:n[r],{schemaId:a}=this.opts;i&&(o=new jg({schema:i,schemaId:a,root:e,baseId:t}))}return void 0!==o?e.refs[r]=Dg.call(this,o):void 0},Mg.getCompilingSchema=Bg,Mg.resolveSchema=zg;const Ug=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Lg(e,{baseId:t,schema:r,root:n}){var i;if("/"!==(null===(i=e.fragment)||void 0===i?void 0:i[0]))return;for(const n of e.fragment.slice(1).split("/")){if("boolean"==typeof r)return;const e=r[(0,Og.unescapeFragment)(n)];if(void 0===e)return;const i="object"==typeof(r=e)&&r[this.opts.schemaId];!Ug.has(n)&&i&&(t=(0,Ng.resolveUrl)(this.opts.uriResolver,t,i))}let o;if("boolean"!=typeof r&&r.$ref&&!(0,Og.schemaHasRulesButRef)(r,this.RULES)){const e=(0,Ng.resolveUrl)(this.opts.uriResolver,t,r.$ref);o=zg.call(this,n,e)}const{schemaId:a}=this.opts;return o=o||new jg({schema:r,schemaId:a,root:n,baseId:t}),o.schema!==o.root.schema?o:void 0}var qg={$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:!1},Hg={},Kg={exports:{}};!function(e){function t(){for(var e=arguments.length,t=Array(e),r=0;r1){t[0]=t[0].slice(0,-1);for(var n=t.length-1,i=1;i= 0x80 (not a basic code point)","invalid-input":"Invalid input"},P=h-p,x=Math.floor,k=String.fromCharCode;function M(e){throw new RangeError(S[e])}function C(e,t){for(var r=[],n=e.length;n--;)r[n]=t(e[n]);return r}function I(e,t){var r=e.split("@"),n="";return r.length>1&&(n=r[0]+"@",e=r[1]),n+C((e=e.replace(E,".")).split("."),t).join(".")}function R(e){for(var t=[],r=0,n=e.length;r=55296&&i<=56319&&r>1,e+=x(e/t);e>P*m>>1;n+=h)e=x(e/P);return x(n+(P+1)*e/(e+g))},j=function(e){var t=[],r=e.length,n=0,i=v,o=b,a=e.lastIndexOf(w);a<0&&(a=0);for(var s=0;s=128&&M("not-basic"),t.push(e.charCodeAt(s));for(var c=a>0?a+1:0;c=r&&M("invalid-input");var g=N(e.charCodeAt(c++));(g>=h||g>x((l-n)/f))&&M("overflow"),n+=g*f;var y=d<=o?p:d>=o+m?m:d-o;if(gx(l/A)&&M("overflow"),f*=A}var _=t.length+1;o=T(n-u,_,0==u),x(n/_)>l-i&&M("overflow"),i+=x(n/_),n%=_,t.splice(n++,0,i)}return String.fromCodePoint.apply(String,t)},$=function(e){var t=[],r=(e=R(e)).length,n=v,i=0,o=b,a=!0,s=!1,c=void 0;try{for(var u,f=e[Symbol.iterator]();!(a=(u=f.next()).done);a=!0){var d=u.value;d<128&&t.push(k(d))}}catch(e){s=!0,c=e}finally{try{!a&&f.return&&f.return()}finally{if(s)throw c}}var g=t.length,y=g;for(g&&t.push(w);y=n&&Ix((l-i)/N)&&M("overflow"),i+=(A-n)*N,n=A;var j=!0,$=!1,D=void 0;try{for(var B,F=e[Symbol.iterator]();!(j=(B=F.next()).done);j=!0){var z=B.value;if(zl&&M("overflow"),z==n){for(var U=i,L=h;;L+=h){var q=L<=o?p:L>=o+m?m:L-o;if(U>6|192).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase():"%"+(t>>12|224).toString(16).toUpperCase()+"%"+(t>>6&63|128).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase()}function L(e){for(var t="",r=0,n=e.length;r=194&&i<224){if(n-r>=6){var o=parseInt(e.substr(r+4,2),16);t+=String.fromCharCode((31&i)<<6|63&o)}else t+=e.substr(r,6);r+=6}else if(i>=224){if(n-r>=9){var a=parseInt(e.substr(r+4,2),16),s=parseInt(e.substr(r+7,2),16);t+=String.fromCharCode((15&i)<<12|(63&a)<<6|63&s)}else t+=e.substr(r,9);r+=9}else t+=e.substr(r,3),r+=3}return t}function q(e,t){function r(e){var r=L(e);return r.match(t.UNRESERVED)?r:e}return e.scheme&&(e.scheme=String(e.scheme).replace(t.PCT_ENCODED,r).toLowerCase().replace(t.NOT_SCHEME,"")),void 0!==e.userinfo&&(e.userinfo=String(e.userinfo).replace(t.PCT_ENCODED,r).replace(t.NOT_USERINFO,U).replace(t.PCT_ENCODED,i)),void 0!==e.host&&(e.host=String(e.host).replace(t.PCT_ENCODED,r).toLowerCase().replace(t.NOT_HOST,U).replace(t.PCT_ENCODED,i)),void 0!==e.path&&(e.path=String(e.path).replace(t.PCT_ENCODED,r).replace(e.scheme?t.NOT_PATH:t.NOT_PATH_NOSCHEME,U).replace(t.PCT_ENCODED,i)),void 0!==e.query&&(e.query=String(e.query).replace(t.PCT_ENCODED,r).replace(t.NOT_QUERY,U).replace(t.PCT_ENCODED,i)),void 0!==e.fragment&&(e.fragment=String(e.fragment).replace(t.PCT_ENCODED,r).replace(t.NOT_FRAGMENT,U).replace(t.PCT_ENCODED,i)),e}function H(e){return e.replace(/^0*(.*)/,"$1")||"0"}function K(e,t){var r=e.match(t.IPV4ADDRESS)||[],n=f(r,2)[1];return n?n.split(".").map(H).join("."):e}function J(e,t){var r=e.match(t.IPV6ADDRESS)||[],n=f(r,3),i=n[1],o=n[2];if(i){for(var a=i.toLowerCase().split("::").reverse(),s=f(a,2),c=s[0],u=s[1],d=u?u.split(":").map(H):[],l=c.split(":").map(H),h=t.IPV4ADDRESS.test(l[l.length-1]),p=h?7:8,m=l.length-p,g=Array(p),y=0;y1){var A=g.slice(0,v.index),_=g.slice(v.index+v.length);w=A.join(":")+"::"+_.join(":")}else w=g.join(":");return o&&(w+="%"+o),w}return e}var W=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,G=void 0==="".match(/(){0}/)[1];function V(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={},n=!1!==t.iri?u:c;"suffix"===t.reference&&(e=(t.scheme?t.scheme+":":"")+"//"+e);var i=e.match(W);if(i){G?(r.scheme=i[1],r.userinfo=i[3],r.host=i[4],r.port=parseInt(i[5],10),r.path=i[6]||"",r.query=i[7],r.fragment=i[8],isNaN(r.port)&&(r.port=i[5])):(r.scheme=i[1]||void 0,r.userinfo=-1!==e.indexOf("@")?i[3]:void 0,r.host=-1!==e.indexOf("//")?i[4]:void 0,r.port=parseInt(i[5],10),r.path=i[6]||"",r.query=-1!==e.indexOf("?")?i[7]:void 0,r.fragment=-1!==e.indexOf("#")?i[8]:void 0,isNaN(r.port)&&(r.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?i[4]:void 0)),r.host&&(r.host=J(K(r.host,n),n)),void 0!==r.scheme||void 0!==r.userinfo||void 0!==r.host||void 0!==r.port||r.path||void 0!==r.query?void 0===r.scheme?r.reference="relative":void 0===r.fragment?r.reference="absolute":r.reference="uri":r.reference="same-document",t.reference&&"suffix"!==t.reference&&t.reference!==r.reference&&(r.error=r.error||"URI is not a "+t.reference+" reference.");var o=z[(t.scheme||r.scheme||"").toLowerCase()];if(t.unicodeSupport||o&&o.unicodeSupport)q(r,n);else{if(r.host&&(t.domainHost||o&&o.domainHost))try{r.host=F.toASCII(r.host.replace(n.PCT_ENCODED,L).toLowerCase())}catch(e){r.error=r.error||"Host's domain name can not be converted to ASCII via punycode: "+e}q(r,c)}o&&o.parse&&o.parse(r,t)}else r.error=r.error||"URI can not be parsed.";return r}function Z(e,t){var r=!1!==t.iri?u:c,n=[];return void 0!==e.userinfo&&(n.push(e.userinfo),n.push("@")),void 0!==e.host&&n.push(J(K(String(e.host),r),r).replace(r.IPV6ADDRESS,(function(e,t,r){return"["+t+(r?"%25"+r:"")+"]"}))),"number"!=typeof e.port&&"string"!=typeof e.port||(n.push(":"),n.push(String(e.port))),n.length?n.join(""):void 0}var X=/^\.\.?\//,Q=/^\/\.(\/|$)/,Y=/^\/\.\.(\/|$)/,ee=/^\/?(?:.|\n)*?(?=\/|$)/;function te(e){for(var t=[];e.length;)if(e.match(X))e=e.replace(X,"");else if(e.match(Q))e=e.replace(Q,"/");else if(e.match(Y))e=e.replace(Y,"/"),t.pop();else if("."===e||".."===e)e="";else{var r=e.match(ee);if(!r)throw new Error("Unexpected dot segment condition");var n=r[0];e=e.slice(n.length),t.push(n)}return t.join("")}function re(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.iri?u:c,n=[],i=z[(t.scheme||e.scheme||"").toLowerCase()];if(i&&i.serialize&&i.serialize(e,t),e.host)if(r.IPV6ADDRESS.test(e.host));else if(t.domainHost||i&&i.domainHost)try{e.host=t.iri?F.toUnicode(e.host):F.toASCII(e.host.replace(r.PCT_ENCODED,L).toLowerCase())}catch(r){e.error=e.error||"Host's domain name can not be converted to "+(t.iri?"Unicode":"ASCII")+" via punycode: "+r}q(e,r),"suffix"!==t.reference&&e.scheme&&(n.push(e.scheme),n.push(":"));var o=Z(e,t);if(void 0!==o&&("suffix"!==t.reference&&n.push("//"),n.push(o),e.path&&"/"!==e.path.charAt(0)&&n.push("/")),void 0!==e.path){var a=e.path;t.absolutePath||i&&i.absolutePath||(a=te(a)),void 0===o&&(a=a.replace(/^\/\//,"/%2F")),n.push(a)}return void 0!==e.query&&(n.push("?"),n.push(e.query)),void 0!==e.fragment&&(n.push("#"),n.push(e.fragment)),n.join("")}function ne(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n={};return arguments[3]||(e=V(re(e,r),r),t=V(re(t,r),r)),!(r=r||{}).tolerant&&t.scheme?(n.scheme=t.scheme,n.userinfo=t.userinfo,n.host=t.host,n.port=t.port,n.path=te(t.path||""),n.query=t.query):(void 0!==t.userinfo||void 0!==t.host||void 0!==t.port?(n.userinfo=t.userinfo,n.host=t.host,n.port=t.port,n.path=te(t.path||""),n.query=t.query):(t.path?("/"===t.path.charAt(0)?n.path=te(t.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?n.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:n.path=t.path:n.path="/"+t.path,n.path=te(n.path)),n.query=t.query):(n.path=e.path,void 0!==t.query?n.query=t.query:n.query=e.query),n.userinfo=e.userinfo,n.host=e.host,n.port=e.port),n.scheme=e.scheme),n.fragment=t.fragment,n}function ie(e,t,r){var n=a({scheme:"null"},r);return re(ne(V(e,n),V(t,n),n,!0),n)}function oe(e,t){return"string"==typeof e?e=re(V(e,t),t):"object"===n(e)&&(e=V(re(e,t),t)),e}function ae(e,t,r){return"string"==typeof e?e=re(V(e,r),r):"object"===n(e)&&(e=re(e,r)),"string"==typeof t?t=re(V(t,r),r):"object"===n(t)&&(t=re(t,r)),e===t}function se(e,t){return e&&e.toString().replace(t&&t.iri?u.ESCAPE:c.ESCAPE,U)}function ce(e,t){return e&&e.toString().replace(t&&t.iri?u.PCT_ENCODED:c.PCT_ENCODED,L)}var ue={scheme:"http",domainHost:!0,parse:function(e,t){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e},serialize:function(e,t){var r="https"===String(e.scheme).toLowerCase();return e.port!==(r?443:80)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}},fe={scheme:"https",domainHost:ue.domainHost,parse:ue.parse,serialize:ue.serialize};function de(e){return"boolean"==typeof e.secure?e.secure:"wss"===String(e.scheme).toLowerCase()}var le={scheme:"ws",domainHost:!0,parse:function(e,t){var r=e;return r.secure=de(r),r.resourceName=(r.path||"/")+(r.query?"?"+r.query:""),r.path=void 0,r.query=void 0,r},serialize:function(e,t){if(e.port!==(de(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){var r=e.resourceName.split("?"),n=f(r,2),i=n[0],o=n[1];e.path=i&&"/"!==i?i:void 0,e.query=o,e.resourceName=void 0}return e.fragment=void 0,e}},he={scheme:"wss",domainHost:le.domainHost,parse:le.parse,serialize:le.serialize},pe={},me="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",ge="[0-9A-Fa-f]",ye=r(r("%[EFef]"+ge+"%"+ge+ge+"%"+ge+ge)+"|"+r("%[89A-Fa-f]"+ge+"%"+ge+ge)+"|"+r("%"+ge+ge)),be="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",ve=t("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),we="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",Ae=new RegExp(me,"g"),_e=new RegExp(ye,"g"),Ee=new RegExp(t("[^]",be,"[\\.]",'[\\"]',ve),"g"),Se=new RegExp(t("[^]",me,we),"g"),Pe=Se;function xe(e){var t=L(e);return t.match(Ae)?t:e}var ke={scheme:"mailto",parse:function(e,t){var r=e,n=r.to=r.path?r.path.split(","):[];if(r.path=void 0,r.query){for(var i=!1,o={},a=r.query.split("&"),s=0,c=a.length;snew RegExp(e,t);h.code="new RegExp";const p=["removeAdditional","useDefaults","coerceTypes"],m=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),g={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 b(e){var t,r,n,i,o,a,s,c,u,f,d,p,m,g,y,b,v,w,A,_,E,S,P,x,k;const M=e.strict,C=null===(t=e.code)||void 0===t?void 0:t.optimize,I=!0===C||void 0===C?1:C||0,R=null!==(n=null===(r=e.code)||void 0===r?void 0:r.regExp)&&void 0!==n?n:h,N=null!==(i=e.uriResolver)&&void 0!==i?i:l.default;return{strictSchema:null===(a=null!==(o=e.strictSchema)&&void 0!==o?o:M)||void 0===a||a,strictNumbers:null===(c=null!==(s=e.strictNumbers)&&void 0!==s?s:M)||void 0===c||c,strictTypes:null!==(f=null!==(u=e.strictTypes)&&void 0!==u?u:M)&&void 0!==f?f:"log",strictTuples:null!==(p=null!==(d=e.strictTuples)&&void 0!==d?d:M)&&void 0!==p?p:"log",strictRequired:null!==(g=null!==(m=e.strictRequired)&&void 0!==m?m:M)&&void 0!==g&&g,code:e.code?{...e.code,optimize:I,regExp:R}:{optimize:I,regExp:R},loopRequired:null!==(y=e.loopRequired)&&void 0!==y?y:200,loopEnum:null!==(b=e.loopEnum)&&void 0!==b?b:200,meta:null===(v=e.meta)||void 0===v||v,messages:null===(w=e.messages)||void 0===w||w,inlineRefs:null===(A=e.inlineRefs)||void 0===A||A,schemaId:null!==(_=e.schemaId)&&void 0!==_?_:"$id",addUsedSchema:null===(E=e.addUsedSchema)||void 0===E||E,validateSchema:null===(S=e.validateSchema)||void 0===S||S,validateFormats:null===(P=e.validateFormats)||void 0===P||P,unicodeRegExp:null===(x=e.unicodeRegExp)||void 0===x||x,int32range:null===(k=e.int32range)||void 0===k||k,uriResolver:N}}class v{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...b(e)};const{es5:t,lines:r}=this.opts.code;this.scope=new s.ValueScope({scope:{},prefixes:m,es5:t,lines:r}),this.logger=function(e){if(!1===e)return x;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 n=e.validateFormats;e.validateFormats=!1,this.RULES=(0,o.getRules)(),w.call(this,g,e,"NOT SUPPORTED"),w.call(this,y,e,"DEPRECATED","warn"),this._metaOpts=P.call(this),e.formats&&E.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&S.call(this,e.keywords),"object"==typeof e.meta&&this.addMetaSchema(e.meta),_.call(this),e.validateFormats=n}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:e,meta:t,schemaId:r}=this.opts;let n=d;"id"===r&&(n={...d},n.id=n.$id,delete n.$id),t&&e&&this.addMetaSchema(n,n[r],!1)}defaultMeta(){const{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta="object"==typeof e?e[t]||e:void 0}validate(e,t){let r;if("string"==typeof e){if(r=this.getSchema(e),!r)throw new Error(`no schema with key or ref "${e}"`)}else r=this.compile(e);const n=r(t);return"$async"in r||(this.errors=r.errors),n}compile(e,t){const r=this._addSchema(e,t);return r.validate||this._compileSchemaEnv(r)}compileAsync(e,t){if("function"!=typeof this.opts.loadSchema)throw new Error("options.loadSchema should be a function");const{loadSchema:r}=this.opts;return n.call(this,e,t);async function n(e,t){await o.call(this,e.$schema);const r=this._addSchema(e,t);return r.validate||a.call(this,r)}async function o(e){e&&!this.getSchema(e)&&await n.call(this,{$ref:e},!0)}async function a(e){try{return this._compileSchemaEnv(e)}catch(t){if(!(t instanceof i.default))throw t;return s.call(this,t),await c.call(this,t.missingSchema),a.call(this,e)}}function s({missingSchema:e,missingRef:t}){if(this.refs[e])throw new Error(`AnySchema ${e} is loaded but ${t} cannot be resolved`)}async function c(e){const r=await u.call(this,e);this.refs[e]||await o.call(this,r.$schema),this.refs[e]||this.addSchema(r,e,t)}async function u(e){const t=this._loading[e];if(t)return t;try{return await(this._loading[e]=r(e))}finally{delete this._loading[e]}}}addSchema(e,t,r,n=this.opts.validateSchema){if(Array.isArray(e)){for(const t of e)this.addSchema(t,void 0,r,n);return this}let i;if("object"==typeof e){const{schemaId:t}=this.opts;if(i=e[t],void 0!==i&&"string"!=typeof i)throw new Error(`schema ${t} must be string`)}return t=(0,c.normalizeId)(t||i),this._checkUnique(t),this.schemas[t]=this._addSchema(e,r,t,n,!0),this}addMetaSchema(e,t,r=this.opts.validateSchema){return this.addSchema(e,t,!0,r),this}validateSchema(e,t){if("boolean"==typeof e)return!0;let r;if(r=e.$schema,void 0!==r&&"string"!=typeof r)throw new Error("$schema must be a string");if(r=r||this.opts.defaultMeta||this.defaultMeta(),!r)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const n=this.validate(r,e);if(!n&&t){const e="schema is invalid: "+this.errorsText();if("log"!==this.opts.validateSchema)throw new Error(e);this.logger.error(e)}return n}getSchema(e){let t;for(;"string"==typeof(t=A.call(this,e));)e=t;if(void 0===t){const{schemaId:r}=this.opts,n=new a.SchemaEnv({schema:{},schemaId:r});if(t=a.resolveSchema.call(this,n,e),!t)return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}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 t=A.call(this,e);return"object"==typeof t&&this._cache.delete(t.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{const t=e;this._cache.delete(t);let r=e[this.opts.schemaId];return r&&(r=(0,c.normalizeId)(r),delete this.schemas[r],delete this.refs[r]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(const t of e)this.addKeyword(t);return this}addKeyword(e,t){let r;if("string"==typeof e)r=e,"object"==typeof t&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),t.keyword=r);else{if("object"!=typeof e||void 0!==t)throw new Error("invalid addKeywords parameters");if(r=(t=e).keyword,Array.isArray(r)&&!r.length)throw new Error("addKeywords: keyword must be string or non-empty array")}if(M.call(this,r,t),!t)return(0,f.eachItem)(r,(e=>C.call(this,e))),this;R.call(this,t);const n={...t,type:(0,u.getJSONTypes)(t.type),schemaType:(0,u.getJSONTypes)(t.schemaType)};return(0,f.eachItem)(r,0===n.type.length?e=>C.call(this,e,n):e=>n.type.forEach((t=>C.call(this,e,n,t)))),this}getKeyword(e){const t=this.RULES.all[e];return"object"==typeof t?t.definition:!!t}removeKeyword(e){const{RULES:t}=this;delete t.keywords[e],delete t.all[e];for(const r of t.rules){const t=r.rules.findIndex((t=>t.keyword===e));t>=0&&r.rules.splice(t,1)}return this}addFormat(e,t){return"string"==typeof t&&(t=new RegExp(t)),this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=", ",dataVar:r="data"}={}){return e&&0!==e.length?e.map((e=>`${r}${e.instancePath} ${e.message}`)).reduce(((e,r)=>e+t+r)):"No errors"}$dataMetaSchema(e,t){const r=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(const n of t){const t=n.split("/").slice(1);let i=e;for(const e of t)i=i[e];for(const e in r){const t=r[e];if("object"!=typeof t)continue;const{$data:n}=t.definition,o=i[e];n&&o&&(i[e]=O(o))}}return e}_removeAllSchemas(e,t){for(const r in e){const n=e[r];t&&!t.test(r)||("string"==typeof n?delete e[r]:n&&!n.meta&&(this._cache.delete(n.schema),delete e[r]))}}_addSchema(e,t,r,n=this.opts.validateSchema,i=this.opts.addUsedSchema){let o;const{schemaId:s}=this.opts;if("object"==typeof e)o=e[s];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 u=this._cache.get(e);if(void 0!==u)return u;r=(0,c.normalizeId)(o||r);const f=c.getSchemaRefs.call(this,e,r);return u=new a.SchemaEnv({schema:e,schemaId:s,meta:t,baseId:r,localRefs:f}),this._cache.set(u.schema,u),i&&!r.startsWith("#")&&(r&&this._checkUnique(r),this.refs[r]=u),n&&this.validateSchema(e,!0),u}_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):a.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){const t=this.opts;this.opts=this._metaOpts;try{a.compileSchema.call(this,e)}finally{this.opts=t}}}function w(e,t,r,n="error"){for(const i in e){const o=i;o in t&&this.logger[n](`${r}: option ${i}. ${e[o]}`)}}function A(e){return e=(0,c.normalizeId)(e),this.schemas[e]||this.refs[e]}function _(){const e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(const t in e)this.addSchema(e[t],t)}function E(){for(const e in this.opts.formats){const t=this.opts.formats[e];t&&this.addFormat(e,t)}}function S(e){if(Array.isArray(e))this.addVocabulary(e);else{this.logger.warn("keywords option as map is deprecated, pass array");for(const t in e){const r=e[t];r.keyword||(r.keyword=t),this.addKeyword(r)}}}function P(){const e={...this.opts};for(const t of p)delete e[t];return e}e.default=v,v.ValidationError=n.default,v.MissingRefError=i.default;const x={log(){},warn(){},error(){}};const k=/^[a-z_$][a-z0-9_$:-]*$/i;function M(e,t){const{RULES:r}=this;if((0,f.eachItem)(e,(e=>{if(r.keywords[e])throw new Error(`Keyword ${e} is already defined`);if(!k.test(e))throw new Error(`Keyword ${e} has invalid name`)})),t&&t.$data&&!("code"in t)&&!("validate"in t))throw new Error('$data keyword must have "code" or "validate" function')}function C(e,t,r){var n;const i=null==t?void 0:t.post;if(r&&i)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:o}=this;let a=i?o.post:o.rules.find((({type:e})=>e===r));if(a||(a={type:r,rules:[]},o.rules.push(a)),o.keywords[e]=!0,!t)return;const s={keyword:e,definition:{...t,type:(0,u.getJSONTypes)(t.type),schemaType:(0,u.getJSONTypes)(t.schemaType)}};t.before?I.call(this,a,s,t.before):a.rules.push(s),o.all[e]=s,null===(n=t.implements)||void 0===n||n.forEach((e=>this.addKeyword(e)))}function I(e,t,r){const n=e.rules.findIndex((e=>e.keyword===r));n>=0?e.rules.splice(n,0,t):(e.rules.push(t),this.logger.warn(`rule ${r} is not defined`))}function R(e){let{metaSchema:t}=e;void 0!==t&&(e.$data&&this.opts.$data&&(t=O(t)),e.validateSchema=this.compile(t,!0))}const N={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function O(e){return{anyOf:[e,N]}}}(Dp);var Gg={},Vg={},Zg={};Object.defineProperty(Zg,"__esModule",{value:!0}),Zg.callRef=Zg.getValidate=void 0;const Xg=Pg,Qg=fm,Yg=Up,ey=Kp,ty=Mg,ry=Hp,ny={keyword:"$ref",schemaType:"string",code(e){const{gen:t,schema:r,it:n}=e,{baseId:i,schemaEnv:o,validateName:a,opts:s,self:c}=n,{root:u}=o;if(("#"===r||"#/"===r)&&i===u.baseId)return function(){if(o===u)return oy(e,a,o,o.$async);const r=t.scopeValue("root",{ref:u});return oy(e,Yg._`${r}.validate`,u,u.$async)}();const f=ty.resolveRef.call(c,u,i,r);if(void 0===f)throw new Xg.default(n.opts.uriResolver,i,r);return f instanceof ty.SchemaEnv?function(t){const r=iy(e,t);oy(e,r,t,t.$async)}(f):function(n){const i=t.scopeValue("schema",!0===s.code.source?{ref:n,code:(0,Yg.stringify)(n)}:{ref:n}),o=t.name("valid"),a=e.subschema({schema:n,dataTypes:[],schemaPath:Yg.nil,topSchemaRef:i,errSchemaPath:r},o);e.mergeEvaluated(a),e.ok(o)}(f)}};function iy(e,t){const{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):Yg._`${r.scopeValue("wrapper",{ref:t})}.validate`}function oy(e,t,r,n){const{gen:i,it:o}=e,{allErrors:a,schemaEnv:s,opts:c}=o,u=c.passContext?ey.default.this:Yg.nil;function f(e){const t=Yg._`${e}.errors`;i.assign(ey.default.vErrors,Yg._`${ey.default.vErrors} === null ? ${t} : ${ey.default.vErrors}.concat(${t})`),i.assign(ey.default.errors,Yg._`${ey.default.vErrors}.length`)}function d(e){var t;if(!o.opts.unevaluated)return;const n=null===(t=null==r?void 0:r.validate)||void 0===t?void 0:t.evaluated;if(!0!==o.props)if(n&&!n.dynamicProps)void 0!==n.props&&(o.props=ry.mergeEvaluated.props(i,n.props,o.props));else{const t=i.var("props",Yg._`${e}.evaluated.props`);o.props=ry.mergeEvaluated.props(i,t,o.props,Yg.Name)}if(!0!==o.items)if(n&&!n.dynamicItems)void 0!==n.items&&(o.items=ry.mergeEvaluated.items(i,n.items,o.items));else{const t=i.var("items",Yg._`${e}.evaluated.items`);o.items=ry.mergeEvaluated.items(i,t,o.items,Yg.Name)}}n?function(){if(!s.$async)throw new Error("async schema referenced by sync schema");const r=i.let("valid");i.try((()=>{i.code(Yg._`await ${(0,Qg.callValidateCode)(e,t,u)}`),d(t),a||i.assign(r,!0)}),(e=>{i.if(Yg._`!(${e} instanceof ${o.ValidationError})`,(()=>i.throw(e))),f(e),a||i.assign(r,!1)})),e.ok(r)}():e.result((0,Qg.callValidateCode)(e,t,u),(()=>d(t)),(()=>f(t)))}Zg.getValidate=iy,Zg.callRef=oy,Zg.default=ny,Object.defineProperty(Vg,"__esModule",{value:!0});const ay=["$schema","id","$defs",{keyword:"$comment"},"definitions",Zg.default];Vg.default=ay;var sy={},cy={};Object.defineProperty(cy,"__esModule",{value:!0});const uy=Dp,fy=Up.operators,dy={maximum:{exclusive:"exclusiveMaximum",ops:[{okStr:"<=",ok:fy.LTE,fail:fy.GT},{okStr:"<",ok:fy.LT,fail:fy.GTE}]},minimum:{exclusive:"exclusiveMinimum",ops:[{okStr:">=",ok:fy.GTE,fail:fy.LT},{okStr:">",ok:fy.GT,fail:fy.LTE}]}},ly={message:e=>uy.str`must be ${py(e).okStr} ${e.schemaCode}`,params:e=>uy._`{comparison: ${py(e).okStr}, limit: ${e.schemaCode}}`},hy={keyword:Object.keys(dy),type:"number",schemaType:"number",$data:!0,error:ly,code(e){const{data:t,schemaCode:r}=e;e.fail$data(uy._`${t} ${py(e).fail} ${r} || isNaN(${t})`)}};function py(e){var t;const r=e.keyword,n=(null===(t=e.parentSchema)||void 0===t?void 0:t[dy[r].exclusive])?1:0;return dy[r].ops[n]}cy.default=hy;var my={};Object.defineProperty(my,"__esModule",{value:!0});const gy={exclusiveMaximum:"maximum",exclusiveMinimum:"minimum"},yy={keyword:Object.keys(gy),type:"number",schemaType:"boolean",code({keyword:e,parentSchema:t}){const r=gy[e];if(void 0===t[r])throw new Error(`${e} can only be used with ${r}`)}};my.default=yy;var by={};Object.defineProperty(by,"__esModule",{value:!0});const vy=Up,wy={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:e})=>vy.str`must be multiple of ${e}`,params:({schemaCode:e})=>vy._`{multipleOf: ${e}}`},code(e){const{gen:t,data:r,schemaCode:n,it:i}=e,o=i.opts.multipleOfPrecision,a=t.let("res"),s=o?vy._`Math.abs(Math.round(${a}) - ${a}) > 1e-${o}`:vy._`${a} !== parseInt(${a})`;e.fail$data(vy._`(${n} === 0 || (${a} = ${r}/${n}, ${s}))`)}};by.default=wy;var Ay={},_y={};function Ey(e){const t=e.length;let r,n=0,i=0;for(;i=55296&&r<=56319&&iSy.str`must NOT have ${"maxLength"===e?"more":"fewer"} than ${t} characters`,params:({schemaCode:e})=>Sy._`{limit: ${e}}`},My={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:ky,code(e){const{keyword:t,data:r,schemaCode:n,it:i}=e,o="maxLength"===t?Sy.operators.GT:Sy.operators.LT,a=!1===i.opts.unicode?Sy._`${r}.length`:Sy._`${(0,Py.useFunc)(e.gen,xy.default)}(${r})`;e.fail$data(Sy._`${a} ${o} ${n}`)}};Ay.default=My;var Cy={};Object.defineProperty(Cy,"__esModule",{value:!0});const Iy=fm,Ry=Up,Ny={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>Ry.str`must match pattern "${e}"`,params:({schemaCode:e})=>Ry._`{pattern: ${e}}`},code(e){const{data:t,$data:r,schema:n,schemaCode:i,it:o}=e,a=o.opts.unicodeRegExp?"u":"",s=r?Ry._`(new RegExp(${i}, ${a}))`:(0,Iy.usePattern)(e,n);e.fail$data(Ry._`!${s}.test(${t})`)}};Cy.default=Ny;var Oy={};Object.defineProperty(Oy,"__esModule",{value:!0});const Ty=Up,jy={message:({keyword:e,schemaCode:t})=>Ty.str`must NOT have ${"maxProperties"===e?"more":"fewer"} than ${t} properties`,params:({schemaCode:e})=>Ty._`{limit: ${e}}`},$y={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:jy,code(e){const{keyword:t,data:r,schemaCode:n}=e,i="maxProperties"===t?Ty.operators.GT:Ty.operators.LT;e.fail$data(Ty._`Object.keys(${r}).length ${i} ${n}`)}};Oy.default=$y;var Dy={};Object.defineProperty(Dy,"__esModule",{value:!0});const By=fm,Fy=Up,zy=Hp,Uy={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:e}})=>Fy.str`must have required property '${e}'`,params:({params:{missingProperty:e}})=>Fy._`{missingProperty: ${e}}`},code(e){const{gen:t,schema:r,schemaCode:n,data:i,$data:o,it:a}=e,{opts:s}=a;if(!o&&0===r.length)return;const c=r.length>=s.loopRequired;if(a.allErrors?function(){if(c||o)e.block$data(Fy.nil,u);else for(const t of r)(0,By.checkReportMissingProp)(e,t)}():function(){const a=t.let("missing");if(c||o){const r=t.let("valid",!0);e.block$data(r,(()=>function(r,o){e.setParams({missingProperty:r}),t.forOf(r,n,(()=>{t.assign(o,(0,By.propertyInData)(t,i,r,s.ownProperties)),t.if((0,Fy.not)(o),(()=>{e.error(),t.break()}))}),Fy.nil)}(a,r))),e.ok(r)}else t.if((0,By.checkMissingProp)(e,r,a)),(0,By.reportMissingProp)(e,a),t.else()}(),s.strictRequired){const t=e.parentSchema.properties,{definedProperties:n}=e.it;for(const e of r)if(void 0===(null==t?void 0:t[e])&&!n.has(e)){const t=a.schemaEnv.baseId+a.errSchemaPath;(0,zy.checkStrictMode)(a,`required property "${e}" is not defined at "${t}" (strictRequired)`,a.opts.strictRequired)}}function u(){t.forOf("prop",n,(r=>{e.setParams({missingProperty:r}),t.if((0,By.noPropertyInData)(t,i,r,s.ownProperties),(()=>e.error()))}))}}};Dy.default=Uy;var Ly={};Object.defineProperty(Ly,"__esModule",{value:!0});const qy=Up,Hy={message:({keyword:e,schemaCode:t})=>qy.str`must NOT have ${"maxItems"===e?"more":"fewer"} than ${t} items`,params:({schemaCode:e})=>qy._`{limit: ${e}}`},Ky={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:Hy,code(e){const{keyword:t,data:r,schemaCode:n}=e,i="maxItems"===t?qy.operators.GT:qy.operators.LT;e.fail$data(qy._`${r}.length ${i} ${n}`)}};Ly.default=Ky;var Jy={},Wy={};Object.defineProperty(Wy,"__esModule",{value:!0});const Gy=Im;Gy.code='require("ajv/dist/runtime/equal").default',Wy.default=Gy,Object.defineProperty(Jy,"__esModule",{value:!0});const Vy=Yp,Zy=Up,Xy=Hp,Qy=Wy,Yy={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:e,j:t}})=>Zy.str`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>Zy._`{i: ${e}, j: ${t}}`},code(e){const{gen:t,data:r,$data:n,schema:i,parentSchema:o,schemaCode:a,it:s}=e;if(!n&&!i)return;const c=t.let("valid"),u=o.items?(0,Vy.getSchemaTypes)(o.items):[];function f(n,i){const o=t.name("item"),a=(0,Vy.checkDataTypes)(u,o,s.opts.strictNumbers,Vy.DataType.Wrong),f=t.const("indices",Zy._`{}`);t.for(Zy._`;${n}--;`,(()=>{t.let(o,Zy._`${r}[${n}]`),t.if(a,Zy._`continue`),u.length>1&&t.if(Zy._`typeof ${o} == "string"`,Zy._`${o} += "_"`),t.if(Zy._`typeof ${f}[${o}] == "number"`,(()=>{t.assign(i,Zy._`${f}[${o}]`),e.error(),t.assign(c,!1).break()})).code(Zy._`${f}[${o}] = ${n}`)}))}function d(n,i){const o=(0,Xy.useFunc)(t,Qy.default),a=t.name("outer");t.label(a).for(Zy._`;${n}--;`,(()=>t.for(Zy._`${i} = ${n}; ${i}--;`,(()=>t.if(Zy._`${o}(${r}[${n}], ${r}[${i}])`,(()=>{e.error(),t.assign(c,!1).break(a)}))))))}e.block$data(c,(function(){const n=t.let("i",Zy._`${r}.length`),i=t.let("j");e.setParams({i:n,j:i}),t.assign(c,!0),t.if(Zy._`${n} > 1`,(()=>(u.length>0&&!u.some((e=>"object"===e||"array"===e))?f:d)(n,i)))}),Zy._`${a} === false`),e.ok(c)}};Jy.default=Yy;var eb={};Object.defineProperty(eb,"__esModule",{value:!0});const tb=Up,rb=Hp,nb=Wy,ib={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:e})=>tb._`{allowedValue: ${e}}`},code(e){const{gen:t,data:r,$data:n,schemaCode:i,schema:o}=e;n||o&&"object"==typeof o?e.fail$data(tb._`!${(0,rb.useFunc)(t,nb.default)}(${r}, ${i})`):e.fail(tb._`${o} !== ${r}`)}};eb.default=ib;var ob={};Object.defineProperty(ob,"__esModule",{value:!0});const ab=Up,sb=Hp,cb=Wy,ub={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:e})=>ab._`{allowedValues: ${e}}`},code(e){const{gen:t,data:r,$data:n,schema:i,schemaCode:o,it:a}=e;if(!n&&0===i.length)throw new Error("enum must have non-empty array");const s=i.length>=a.opts.loopEnum;let c;const u=()=>null!=c?c:c=(0,sb.useFunc)(t,cb.default);let f;if(s||n)f=t.let("valid"),e.block$data(f,(function(){t.assign(f,!1),t.forOf("v",o,(e=>t.if(ab._`${u()}(${r}, ${e})`,(()=>t.assign(f,!0).break()))))}));else{if(!Array.isArray(i))throw new Error("ajv implementation error");const e=t.const("vSchema",o);f=(0,ab.or)(...i.map(((t,n)=>function(e,t){const n=i[t];return"object"==typeof n&&null!==n?ab._`${u()}(${r}, ${e}[${t}])`:ab._`${r} === ${n}`}(e,n))))}e.pass(f)}};ob.default=ub,Object.defineProperty(sy,"__esModule",{value:!0});const fb=my,db=by,lb=Ay,hb=Cy,pb=Oy,mb=Dy,gb=Ly,yb=Jy,bb=eb,vb=ob,wb=[cy.default,fb.default,db.default,lb.default,hb.default,pb.default,mb.default,gb.default,yb.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},bb.default,vb.default];sy.default=wb;var Ab={},_b={};Object.defineProperty(_b,"__esModule",{value:!0}),_b.validateAdditionalItems=void 0;const Eb=Up,Sb=Hp,Pb={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:e}})=>Eb.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>Eb._`{limit: ${e}}`},code(e){const{parentSchema:t,it:r}=e,{items:n}=t;Array.isArray(n)?xb(e,n):(0,Sb.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas')}};function xb(e,t){const{gen:r,schema:n,data:i,keyword:o,it:a}=e;a.items=!0;const s=r.const("len",Eb._`${i}.length`);if(!1===n)e.setParams({len:t.length}),e.pass(Eb._`${s} <= ${t.length}`);else if("object"==typeof n&&!(0,Sb.alwaysValidSchema)(a,n)){const n=r.var("valid",Eb._`${s} <= ${t.length}`);r.if((0,Eb.not)(n),(()=>function(n){r.forRange("i",t.length,s,(t=>{e.subschema({keyword:o,dataProp:t,dataPropType:Sb.Type.Num},n),a.allErrors||r.if((0,Eb.not)(n),(()=>r.break()))}))}(n))),e.ok(n)}}_b.validateAdditionalItems=xb,_b.default=Pb;var kb={},Mb={};Object.defineProperty(Mb,"__esModule",{value:!0}),Mb.validateTuple=void 0;const Cb=Up,Ib=Hp,Rb=fm,Nb={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){const{schema:t,it:r}=e;if(Array.isArray(t))return Ob(e,"additionalItems",t);r.items=!0,(0,Ib.alwaysValidSchema)(r,t)||e.ok((0,Rb.validateArray)(e))}};function Ob(e,t,r=e.schema){const{gen:n,parentSchema:i,data:o,keyword:a,it:s}=e;!function(e){const{opts:n,errSchemaPath:i}=s,o=r.length,c=o===e.minItems&&(o===e.maxItems||!1===e[t]);if(n.strictTuples&&!c){const e=`"${a}" is ${o}-tuple, but minItems or maxItems/${t} are not specified or different at path "${i}"`;(0,Ib.checkStrictMode)(s,e,n.strictTuples)}}(i),s.opts.unevaluated&&r.length&&!0!==s.items&&(s.items=Ib.mergeEvaluated.items(n,r.length,s.items));const c=n.name("valid"),u=n.const("len",Cb._`${o}.length`);r.forEach(((t,r)=>{(0,Ib.alwaysValidSchema)(s,t)||(n.if(Cb._`${u} > ${r}`,(()=>e.subschema({keyword:a,schemaProp:r,dataProp:r},c))),e.ok(c))}))}Mb.validateTuple=Ob,Mb.default=Nb,Object.defineProperty(kb,"__esModule",{value:!0});const Tb=Mb,jb={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,Tb.validateTuple)(e,"items")};kb.default=jb;var $b={};Object.defineProperty($b,"__esModule",{value:!0});const Db=Up,Bb=Hp,Fb=fm,zb=_b,Ub={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:e}})=>Db.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>Db._`{limit: ${e}}`},code(e){const{schema:t,parentSchema:r,it:n}=e,{prefixItems:i}=r;n.items=!0,(0,Bb.alwaysValidSchema)(n,t)||(i?(0,zb.validateAdditionalItems)(e,i):e.ok((0,Fb.validateArray)(e)))}};$b.default=Ub;var Lb={};Object.defineProperty(Lb,"__esModule",{value:!0});const qb=Up,Hb=Hp,Kb={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:e,max:t}})=>void 0===t?qb.str`must contain at least ${e} valid item(s)`:qb.str`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>void 0===t?qb._`{minContains: ${e}}`:qb._`{minContains: ${e}, maxContains: ${t}}`},code(e){const{gen:t,schema:r,parentSchema:n,data:i,it:o}=e;let a,s;const{minContains:c,maxContains:u}=n;o.opts.next?(a=void 0===c?1:c,s=u):a=1;const f=t.const("len",qb._`${i}.length`);if(e.setParams({min:a,max:s}),void 0===s&&0===a)return void(0,Hb.checkStrictMode)(o,'"minContains" == 0 without "maxContains": "contains" keyword ignored');if(void 0!==s&&a>s)return(0,Hb.checkStrictMode)(o,'"minContains" > "maxContains" is always invalid'),void e.fail();if((0,Hb.alwaysValidSchema)(o,r)){let t=qb._`${f} >= ${a}`;return void 0!==s&&(t=qb._`${t} && ${f} <= ${s}`),void e.pass(t)}o.items=!0;const d=t.name("valid");function l(){const e=t.name("_valid"),r=t.let("count",0);h(e,(()=>t.if(e,(()=>function(e){t.code(qb._`${e}++`),void 0===s?t.if(qb._`${e} >= ${a}`,(()=>t.assign(d,!0).break())):(t.if(qb._`${e} > ${s}`,(()=>t.assign(d,!1).break())),1===a?t.assign(d,!0):t.if(qb._`${e} >= ${a}`,(()=>t.assign(d,!0))))}(r)))))}function h(r,n){t.forRange("i",0,f,(t=>{e.subschema({keyword:"contains",dataProp:t,dataPropType:Hb.Type.Num,compositeRule:!0},r),n()}))}void 0===s&&1===a?h(d,(()=>t.if(d,(()=>t.break())))):0===a?(t.let(d,!0),void 0!==s&&t.if(qb._`${i}.length > 0`,l)):(t.let(d,!1),l()),e.result(d,(()=>e.reset()))}};Lb.default=Kb;var Jb={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const t=Up,r=Hp,n=fm;e.error={message:({params:{property:e,depsCount:r,deps:n}})=>t.str`must have ${1===r?"property":"properties"} ${n} when property ${e} is present`,params:({params:{property:e,depsCount:r,deps:n,missingProperty:i}})=>t._`{property: ${e}, + || ${s} === "boolean" || ${o} === null`).assign(u,i._`[${o}]`)}}n.else(),l(e),n.endIf(),n.if(i._`${u} !== undefined`,(()=>{n.assign(o,u),function({gen:e,parentData:t,parentDataProperty:r},n){e.if(i._`${t} !== undefined`,(()=>e.assign(i._`${t}[${r}]`,n)))}(e,u)}))}(e,t,u):l(e)}))}return d};const c=new Set(["string","number","integer","boolean","null"]);function u(e,t,r,n=a.Correct){const o=n===a.Correct?i.operators.EQ:i.operators.NEQ;let s;switch(e){case"null":return i._`${t} ${o} null`;case"array":s=i._`Array.isArray(${t})`;break;case"object":s=i._`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":s=c(i._`!(${t} % 1) && !isNaN(${t})`);break;case"number":s=c();break;default:return i._`typeof ${t} ${o} ${e}`}return n===a.Correct?s:(0,i.not)(s);function c(e=i.nil){return(0,i.and)(i._`typeof ${t} == "number"`,e,r?i._`isFinite(${t})`:i.nil)}}function f(e,t,r,n){if(1===e.length)return u(e[0],t,r,n);let a;const s=(0,o.toHash)(e);if(s.array&&s.object){const e=i._`typeof ${t} != "object"`;a=s.null?e:i._`!${t} || ${e}`,delete s.null,delete s.array,delete s.object}else a=i.nil;s.number&&delete s.integer;for(const e in s)a=(0,i.and)(a,u(e,t,r,n));return a}e.checkDataType=u,e.checkDataTypes=f;const d={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>"string"==typeof e?i._`{type: ${e}}`:i._`{type: ${t}}`};function l(e){const t=function(e){const{gen:t,data:r,schema:n}=e,i=(0,o.schemaRefOrVal)(e,n,"type");return{gen:t,keyword:"type",data:r,schema:n.type,schemaCode:i,schemaValue:i,parentSchema:n,params:{},it:e}}(e);(0,n.reportError)(t,d)}e.reportTypeError=l}(tm);var sm={};Object.defineProperty(sm,"__esModule",{value:!0}),sm.assignDefaults=void 0;const cm=qp,um=Jp;function fm(e,t,r){const{gen:n,compositeRule:i,data:o,opts:a}=e;if(void 0===r)return;const s=cm._`${o}${(0,cm.getProperty)(t)}`;if(i)return void(0,um.checkStrictMode)(e,`default is ignored for: ${s}`);let c=cm._`${s} === undefined`;"empty"===a.useDefaults&&(c=cm._`${c} || ${s} === null || ${s} === ""`),n.if(c,cm._`${s} = ${(0,cm.stringify)(r)}`)}sm.assignDefaults=function(e,t){const{properties:r,items:n}=e.schema;if("object"===t&&r)for(const t in r)fm(e,t,r[t].default);else"array"===t&&Array.isArray(n)&&n.forEach(((t,r)=>fm(e,r,t.default)))};var dm={},lm={};Object.defineProperty(lm,"__esModule",{value:!0}),lm.validateUnion=lm.validateArray=lm.usePattern=lm.callValidateCode=lm.schemaProperties=lm.allSchemaProperties=lm.noPropertyInData=lm.propertyInData=lm.isOwnProperty=lm.hasPropFunc=lm.reportMissingProp=lm.checkMissingProp=lm.checkReportMissingProp=void 0;const hm=qp,pm=Jp,mm=Wp,gm=Jp;function ym(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:hm._`Object.prototype.hasOwnProperty`})}function bm(e,t,r){return hm._`${ym(e)}.call(${t}, ${r})`}function vm(e,t,r,n){const i=hm._`${t}${(0,hm.getProperty)(r)} === undefined`;return n?(0,hm.or)(i,(0,hm.not)(bm(e,t,r))):i}function wm(e){return e?Object.keys(e).filter((e=>"__proto__"!==e)):[]}lm.checkReportMissingProp=function(e,t){const{gen:r,data:n,it:i}=e;r.if(vm(r,n,t,i.opts.ownProperties),(()=>{e.setParams({missingProperty:hm._`${t}`},!0),e.error()}))},lm.checkMissingProp=function({gen:e,data:t,it:{opts:r}},n,i){return(0,hm.or)(...n.map((n=>(0,hm.and)(vm(e,t,n,r.ownProperties),hm._`${i} = ${n}`))))},lm.reportMissingProp=function(e,t){e.setParams({missingProperty:t},!0),e.error()},lm.hasPropFunc=ym,lm.isOwnProperty=bm,lm.propertyInData=function(e,t,r,n){const i=hm._`${t}${(0,hm.getProperty)(r)} !== undefined`;return n?hm._`${i} && ${bm(e,t,r)}`:i},lm.noPropertyInData=vm,lm.allSchemaProperties=wm,lm.schemaProperties=function(e,t){return wm(t).filter((r=>!(0,pm.alwaysValidSchema)(e,t[r])))},lm.callValidateCode=function({schemaCode:e,data:t,it:{gen:r,topSchemaRef:n,schemaPath:i,errorPath:o},it:a},s,c,u){const f=u?hm._`${e}, ${t}, ${n}${i}`:t,d=[[mm.default.instancePath,(0,hm.strConcat)(mm.default.instancePath,o)],[mm.default.parentData,a.parentData],[mm.default.parentDataProperty,a.parentDataProperty],[mm.default.rootData,mm.default.rootData]];a.opts.dynamicRef&&d.push([mm.default.dynamicAnchors,mm.default.dynamicAnchors]);const l=hm._`${f}, ${r.object(...d)}`;return c!==hm.nil?hm._`${s}.call(${c}, ${l})`:hm._`${s}(${l})`};const Am=hm._`new RegExp`;lm.usePattern=function({gen:e,it:{opts:t}},r){const n=t.unicodeRegExp?"u":"",{regExp:i}=t.code,o=i(r,n);return e.scopeValue("pattern",{key:o.toString(),ref:o,code:hm._`${"new RegExp"===i.code?Am:(0,gm.useFunc)(e,i)}(${r}, ${n})`})},lm.validateArray=function(e){const{gen:t,data:r,keyword:n,it:i}=e,o=t.name("valid");if(i.allErrors){const e=t.let("valid",!0);return a((()=>t.assign(e,!1))),e}return t.var(o,!0),a((()=>t.break())),o;function a(i){const a=t.const("len",hm._`${r}.length`);t.forRange("i",0,a,(r=>{e.subschema({keyword:n,dataProp:r,dataPropType:pm.Type.Num},o),t.if((0,hm.not)(o),i)}))}},lm.validateUnion=function(e){const{gen:t,schema:r,keyword:n,it:i}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some((e=>(0,pm.alwaysValidSchema)(i,e)))&&!i.opts.unevaluated)return;const o=t.let("valid",!1),a=t.name("_valid");t.block((()=>r.forEach(((r,i)=>{const s=e.subschema({keyword:n,schemaProp:i,compositeRule:!0},a);t.assign(o,hm._`${o} || ${a}`);e.mergeValidEvaluated(s,a)||t.if((0,hm.not)(o))})))),e.result(o,(()=>e.reset()),(()=>e.error(!0)))},Object.defineProperty(dm,"__esModule",{value:!0}),dm.validateKeywordUsage=dm.validSchemaType=dm.funcKeywordCode=dm.macroKeywordCode=void 0;const _m=qp,Em=Wp,Sm=lm,Pm=Lp;function xm(e){const{gen:t,data:r,it:n}=e;t.if(n.parentData,(()=>t.assign(r,_m._`${n.parentData}[${n.parentDataProperty}]`)))}function km(e,t,r){if(void 0===r)throw new Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword","function"==typeof r?{ref:r}:{ref:r,code:(0,_m.stringify)(r)})}dm.macroKeywordCode=function(e,t){const{gen:r,keyword:n,schema:i,parentSchema:o,it:a}=e,s=t.macro.call(a.self,i,o,a),c=km(r,n,s);!1!==a.opts.validateSchema&&a.self.validateSchema(s,!0);const u=r.name("valid");e.subschema({schema:s,schemaPath:_m.nil,errSchemaPath:`${a.errSchemaPath}/${n}`,topSchemaRef:c,compositeRule:!0},u),e.pass(u,(()=>e.error(!0)))},dm.funcKeywordCode=function(e,t){var r;const{gen:n,keyword:i,schema:o,parentSchema:a,$data:s,it:c}=e;!function({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}(c,t);const u=!s&&t.compile?t.compile.call(c.self,o,a,c):t.validate,f=km(n,i,u),d=n.let("valid");function l(r=(t.async?_m._`await `:_m.nil)){const i=c.opts.passContext?Em.default.this:Em.default.self,o=!("compile"in t&&!s||!1===t.schema);n.assign(d,_m._`${r}${(0,Sm.callValidateCode)(e,f,i,o)}`,t.modifying)}function h(e){var r;n.if((0,_m.not)(null!==(r=t.valid)&&void 0!==r?r:d),e)}e.block$data(d,(function(){if(!1===t.errors)l(),t.modifying&&xm(e),h((()=>e.error()));else{const r=t.async?function(){const e=n.let("ruleErrs",null);return n.try((()=>l(_m._`await `)),(t=>n.assign(d,!1).if(_m._`${t} instanceof ${c.ValidationError}`,(()=>n.assign(e,_m._`${t}.errors`)),(()=>n.throw(t))))),e}():function(){const e=_m._`${f}.errors`;return n.assign(e,null),l(_m.nil),e}();t.modifying&&xm(e),h((()=>function(e,t){const{gen:r}=e;r.if(_m._`Array.isArray(${t})`,(()=>{r.assign(Em.default.vErrors,_m._`${Em.default.vErrors} === null ? ${t} : ${Em.default.vErrors}.concat(${t})`).assign(Em.default.errors,_m._`${Em.default.vErrors}.length`),(0,Pm.extendErrors)(e)}),(()=>e.error()))}(e,r)))}})),e.ok(null!==(r=t.valid)&&void 0!==r?r:d)},dm.validSchemaType=function(e,t,r=!1){return!t.length||t.some((t=>"array"===t?Array.isArray(e):"object"===t?e&&"object"==typeof e&&!Array.isArray(e):typeof e==t||r&&void 0===e))},dm.validateKeywordUsage=function({schema:e,opts:t,self:r,errSchemaPath:n},i,o){if(Array.isArray(i.keyword)?!i.keyword.includes(o):i.keyword!==o)throw new Error("ajv implementation error");const a=i.dependencies;if(null==a?void 0:a.some((t=>!Object.prototype.hasOwnProperty.call(e,t))))throw new Error(`parent schema must have dependencies of ${o}: ${a.join(",")}`);if(i.validateSchema){if(!i.validateSchema(e[o])){const e=`keyword "${o}" value is invalid at path "${n}": `+r.errorsText(i.validateSchema.errors);if("log"!==t.validateSchema)throw new Error(e);r.logger.error(e)}}};var Mm={};Object.defineProperty(Mm,"__esModule",{value:!0}),Mm.extendSubschemaMode=Mm.extendSubschemaData=Mm.getSubschema=void 0;const Cm=qp,Im=Jp;Mm.getSubschema=function(e,{keyword:t,schemaProp:r,schema:n,schemaPath:i,errSchemaPath:o,topSchemaRef:a}){if(void 0!==t&&void 0!==n)throw new Error('both "keyword" and "schema" passed, only one allowed');if(void 0!==t){const n=e.schema[t];return void 0===r?{schema:n,schemaPath:Cm._`${e.schemaPath}${(0,Cm.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:n[r],schemaPath:Cm._`${e.schemaPath}${(0,Cm.getProperty)(t)}${(0,Cm.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,Im.escapeFragment)(r)}`}}if(void 0!==n){if(void 0===i||void 0===o||void 0===a)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:i,topSchemaRef:a,errSchemaPath:o}}throw new Error('either "keyword" or "schema" must be passed')},Mm.extendSubschemaData=function(e,t,{dataProp:r,dataPropType:n,data:i,dataTypes:o,propertyName:a}){if(void 0!==i&&void 0!==r)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:s}=t;if(void 0!==r){const{errorPath:i,dataPathArr:o,opts:a}=t;c(s.let("data",Cm._`${t.data}${(0,Cm.getProperty)(r)}`,!0)),e.errorPath=Cm.str`${i}${(0,Im.getErrorPath)(r,n,a.jsPropertySyntax)}`,e.parentDataProperty=Cm._`${r}`,e.dataPathArr=[...o,e.parentDataProperty]}if(void 0!==i){c(i instanceof Cm.Name?i:s.let("data",i,!0)),void 0!==a&&(e.propertyName=a)}function c(r){e.data=r,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,r]}o&&(e.dataTypes=o)},Mm.extendSubschemaMode=function(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:n,createErrors:i,allErrors:o}){void 0!==n&&(e.compositeRule=n),void 0!==i&&(e.createErrors=i),void 0!==o&&(e.allErrors=o),e.jtdDiscriminator=t,e.jtdMetadata=r};var Rm={},Nm=function e(t,r){if(t===r)return!0;if(t&&r&&"object"==typeof t&&"object"==typeof r){if(t.constructor!==r.constructor)return!1;var n,i,o;if(Array.isArray(t)){if((n=t.length)!=r.length)return!1;for(i=n;0!=i--;)if(!e(t[i],r[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if((n=(o=Object.keys(t)).length)!==Object.keys(r).length)return!1;for(i=n;0!=i--;)if(!Object.prototype.hasOwnProperty.call(r,o[i]))return!1;for(i=n;0!=i--;){var a=o[i];if(!e(t[a],r[a]))return!1}return!0}return t!=t&&r!=r},Om={exports:{}},Tm=Om.exports=function(e,t,r){"function"==typeof t&&(r=t,t={}),jm(t,"function"==typeof(r=t.cb||r)?r:r.pre||function(){},r.post||function(){},e,"",e)};function jm(e,t,r,n,i,o,a,s,c,u){if(n&&"object"==typeof n&&!Array.isArray(n)){for(var f in t(n,i,o,a,s,c,u),n){var d=n[f];if(Array.isArray(d)){if(f in Tm.arrayKeywords)for(var l=0;lt+=qm(e))),t===1/0))return 1/0}return t}function Hm(e,t="",r){!1!==r&&(t=Wm(t));const n=e.parse(t);return Km(e,n)}function Km(e,t){return e.serialize(t).split("#")[0]+"#"}Rm.getFullPath=Hm,Rm._getFullPath=Km;const Jm=/#\/?$/;function Wm(e){return e?e.replace(Jm,""):""}Rm.normalizeId=Wm,Rm.resolveUrl=function(e,t,r){return r=Wm(r),e.resolve(t,r)};const Gm=/^[a-z_][-a-z0-9._]*$/i;Rm.getSchemaRefs=function(e,t){if("boolean"==typeof e)return{};const{schemaId:r,uriResolver:n}=this.opts,i=Wm(e[r]||t),o={"":i},a=Hm(n,i,!1),s={},c=new Set;return Fm(e,{allKeys:!0},((e,t,n,i)=>{if(void 0===i)return;const d=a+t;let l=o[i];function h(t){const r=this.opts.uriResolver.resolve;if(t=Wm(l?r(l,t):t),c.has(t))throw f(t);c.add(t);let n=this.refs[t];return"string"==typeof n&&(n=this.refs[n]),"object"==typeof n?u(e,n.schema,t):t!==Wm(d)&&("#"===t[0]?(u(e,s[t],t),s[t]=e):this.refs[t]=d),t}function p(e){if("string"==typeof e){if(!Gm.test(e))throw new Error(`invalid anchor "${e}"`);h.call(this,`#${e}`)}}"string"==typeof e[r]&&(l=h.call(this,e[r])),p.call(this,e.$anchor),p.call(this,e.$dynamicAnchor),o[t]=l})),s;function u(e,t,r){if(void 0!==t&&!Bm(e,t))throw f(r)}function f(e){return new Error(`reference "${e}" resolves to more than one schema`)}},Object.defineProperty(zp,"__esModule",{value:!0}),zp.getData=zp.KeywordCxt=zp.validateFunctionCode=void 0;const Vm=Up,Zm=tm,Xm=im,Qm=tm,Ym=sm,eg=dm,tg=Mm,rg=qp,ng=Wp,ig=Rm,og=Jp,ag=Lp;function sg({gen:e,validateName:t,schema:r,schemaEnv:n,opts:i},o){i.code.es5?e.func(t,rg._`${ng.default.data}, ${ng.default.valCxt}`,n.$async,(()=>{e.code(rg._`"use strict"; ${cg(r,i)}`),function(e,t){e.if(ng.default.valCxt,(()=>{e.var(ng.default.instancePath,rg._`${ng.default.valCxt}.${ng.default.instancePath}`),e.var(ng.default.parentData,rg._`${ng.default.valCxt}.${ng.default.parentData}`),e.var(ng.default.parentDataProperty,rg._`${ng.default.valCxt}.${ng.default.parentDataProperty}`),e.var(ng.default.rootData,rg._`${ng.default.valCxt}.${ng.default.rootData}`),t.dynamicRef&&e.var(ng.default.dynamicAnchors,rg._`${ng.default.valCxt}.${ng.default.dynamicAnchors}`)}),(()=>{e.var(ng.default.instancePath,rg._`""`),e.var(ng.default.parentData,rg._`undefined`),e.var(ng.default.parentDataProperty,rg._`undefined`),e.var(ng.default.rootData,ng.default.data),t.dynamicRef&&e.var(ng.default.dynamicAnchors,rg._`{}`)}))}(e,i),e.code(o)})):e.func(t,rg._`${ng.default.data}, ${function(e){return rg._`{${ng.default.instancePath}="", ${ng.default.parentData}, ${ng.default.parentDataProperty}, ${ng.default.rootData}=${ng.default.data}${e.dynamicRef?rg._`, ${ng.default.dynamicAnchors}={}`:rg.nil}}={}`}(i)}`,n.$async,(()=>e.code(cg(r,i)).code(o)))}function cg(e,t){const r="object"==typeof e&&e[t.schemaId];return r&&(t.code.source||t.code.process)?rg._`/*# sourceURL=${r} */`:rg.nil}function ug(e,t){dg(e)&&(lg(e),fg(e))?function(e,t){const{schema:r,gen:n,opts:i}=e;i.$comment&&r.$comment&&pg(e);(function(e){const t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,ig.resolveUrl)(e.opts.uriResolver,e.baseId,t))})(e),function(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}(e);const o=n.const("_errs",ng.default.errors);hg(e,o),n.var(t,rg._`${o} === ${ng.default.errors}`)}(e,t):(0,Vm.boolOrEmptySchema)(e,t)}function fg({schema:e,self:t}){if("boolean"==typeof e)return!e;for(const r in e)if(t.RULES.all[r])return!0;return!1}function dg(e){return"boolean"!=typeof e.schema}function lg(e){(0,og.checkUnknownRules)(e),function(e){const{schema:t,errSchemaPath:r,opts:n,self:i}=e;t.$ref&&n.ignoreKeywordsWithRef&&(0,og.schemaHasRulesButRef)(t,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}(e)}function hg(e,t){if(e.opts.jtd)return mg(e,[],!1,t);const r=(0,Zm.getSchemaTypes)(e.schema);mg(e,r,!(0,Zm.coerceAndCheckDataType)(e,r),t)}function pg({gen:e,schemaEnv:t,schema:r,errSchemaPath:n,opts:i}){const o=r.$comment;if(!0===i.$comment)e.code(rg._`${ng.default.self}.logger.log(${o})`);else if("function"==typeof i.$comment){const r=rg.str`${n}/$comment`,i=e.scopeValue("root",{ref:t.root});e.code(rg._`${ng.default.self}.opts.$comment(${o}, ${r}, ${i}.schema)`)}}function mg(e,t,r,n){const{gen:i,schema:o,data:a,allErrors:s,opts:c,self:u}=e,{RULES:f}=u;function d(u){(0,Xm.shouldUseGroup)(o,u)&&(u.type?(i.if((0,Qm.checkDataType)(u.type,a,c.strictNumbers)),gg(e,u),1===t.length&&t[0]===u.type&&r&&(i.else(),(0,Qm.reportTypeError)(e)),i.endIf()):gg(e,u),s||i.if(rg._`${ng.default.errors} === ${n||0}`))}!o.$ref||!c.ignoreKeywordsWithRef&&(0,og.schemaHasRulesButRef)(o,f)?(c.jtd||function(e,t){if(e.schemaEnv.meta||!e.opts.strictTypes)return;(function(e,t){if(!t.length)return;if(!e.dataTypes.length)return void(e.dataTypes=t);t.forEach((t=>{bg(e.dataTypes,t)||vg(e,`type "${t}" not allowed by context "${e.dataTypes.join(",")}"`)})),function(e,t){const r=[];for(const n of e.dataTypes)bg(t,n)?r.push(n):t.includes("integer")&&"number"===n&&r.push("integer");e.dataTypes=r}(e,t)})(e,t),e.opts.allowUnionTypes||function(e,t){t.length>1&&(2!==t.length||!t.includes("null"))&&vg(e,"use allowUnionTypes to allow union type keyword")}(e,t);!function(e,t){const r=e.self.RULES.all;for(const n in r){const i=r[n];if("object"==typeof i&&(0,Xm.shouldUseRule)(e.schema,i)){const{type:r}=i.definition;r.length&&!r.some((e=>yg(t,e)))&&vg(e,`missing type "${r.join(",")}" for keyword "${n}"`)}}}(e,e.dataTypes)}(e,t),i.block((()=>{for(const e of f.rules)d(e);d(f.post)}))):i.block((()=>Ag(e,"$ref",f.all.$ref.definition)))}function gg(e,t){const{gen:r,schema:n,opts:{useDefaults:i}}=e;i&&(0,Ym.assignDefaults)(e,t.type),r.block((()=>{for(const r of t.rules)(0,Xm.shouldUseRule)(n,r)&&Ag(e,r.keyword,r.definition,t.type)}))}function yg(e,t){return e.includes(t)||"number"===t&&e.includes("integer")}function bg(e,t){return e.includes(t)||"integer"===t&&e.includes("number")}function vg(e,t){t+=` at "${e.schemaEnv.baseId+e.errSchemaPath}" (strictTypes)`,(0,og.checkStrictMode)(e,t,e.opts.strictTypes)}zp.validateFunctionCode=function(e){dg(e)&&(lg(e),fg(e))?function(e){const{schema:t,opts:r,gen:n}=e;sg(e,(()=>{r.$comment&&t.$comment&&pg(e),function(e){const{schema:t,opts:r}=e;void 0!==t.default&&r.useDefaults&&r.strictSchema&&(0,og.checkStrictMode)(e,"default is ignored in the schema root")}(e),n.let(ng.default.vErrors,null),n.let(ng.default.errors,0),r.unevaluated&&function(e){const{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",rg._`${r}.evaluated`),t.if(rg._`${e.evaluated}.dynamicProps`,(()=>t.assign(rg._`${e.evaluated}.props`,rg._`undefined`))),t.if(rg._`${e.evaluated}.dynamicItems`,(()=>t.assign(rg._`${e.evaluated}.items`,rg._`undefined`)))}(e),hg(e),function(e){const{gen:t,schemaEnv:r,validateName:n,ValidationError:i,opts:o}=e;r.$async?t.if(rg._`${ng.default.errors} === 0`,(()=>t.return(ng.default.data)),(()=>t.throw(rg._`new ${i}(${ng.default.vErrors})`))):(t.assign(rg._`${n}.errors`,ng.default.vErrors),o.unevaluated&&function({gen:e,evaluated:t,props:r,items:n}){r instanceof rg.Name&&e.assign(rg._`${t}.props`,r);n instanceof rg.Name&&e.assign(rg._`${t}.items`,n)}(e),t.return(rg._`${ng.default.errors} === 0`))}(e)}))}(e):sg(e,(()=>(0,Vm.topBoolOrEmptySchema)(e)))};class wg{constructor(e,t,r){if((0,eg.validateKeywordUsage)(e,t,r),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=r,this.data=e.data,this.schema=e.schema[r],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,og.schemaRefOrVal)(e,this.schema,r,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const("vSchema",Sg(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,eg.validSchemaType)(this.schema,t.schemaType,t.allowUndefined))throw new Error(`${r} value must be ${JSON.stringify(t.schemaType)}`);("code"in t?t.trackErrors:!1!==t.errors)&&(this.errsCount=e.gen.const("_errs",ng.default.errors))}result(e,t,r){this.failResult((0,rg.not)(e),t,r)}failResult(e,t,r){this.gen.if(e),r?r():this.error(),t?(this.gen.else(),t(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,t){this.failResult((0,rg.not)(e),void 0,t)}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:t}=this;this.fail(rg._`${t} !== undefined && (${(0,rg.or)(this.invalid$data(),e)})`)}error(e,t,r){if(t)return this.setParams(t),this._error(e,r),void this.setParams({});this._error(e,r)}_error(e,t){(e?ag.reportExtraError:ag.reportError)(this,this.def.error,t)}$dataError(){(0,ag.reportError)(this,this.def.$dataError||ag.keyword$DataError)}reset(){if(void 0===this.errsCount)throw new Error('add "trackErrors" to keyword definition');(0,ag.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,t){t?Object.assign(this.params,e):this.params=e}block$data(e,t,r=rg.nil){this.gen.block((()=>{this.check$data(e,r),t()}))}check$data(e=rg.nil,t=rg.nil){if(!this.$data)return;const{gen:r,schemaCode:n,schemaType:i,def:o}=this;r.if((0,rg.or)(rg._`${n} === undefined`,t)),e!==rg.nil&&r.assign(e,!0),(i.length||o.validateSchema)&&(r.elseIf(this.invalid$data()),this.$dataError(),e!==rg.nil&&r.assign(e,!1)),r.else()}invalid$data(){const{gen:e,schemaCode:t,schemaType:r,def:n,it:i}=this;return(0,rg.or)(function(){if(r.length){if(!(t instanceof rg.Name))throw new Error("ajv implementation error");const e=Array.isArray(r)?r:[r];return rg._`${(0,Qm.checkDataTypes)(e,t,i.opts.strictNumbers,Qm.DataType.Wrong)}`}return rg.nil}(),function(){if(n.validateSchema){const r=e.scopeValue("validate$data",{ref:n.validateSchema});return rg._`!${r}(${t})`}return rg.nil}())}subschema(e,t){const r=(0,tg.getSubschema)(this.it,e);(0,tg.extendSubschemaData)(r,this.it,e),(0,tg.extendSubschemaMode)(r,e);const n={...this.it,...r,items:void 0,props:void 0};return ug(n,t),n}mergeEvaluated(e,t){const{it:r,gen:n}=this;r.opts.unevaluated&&(!0!==r.props&&void 0!==e.props&&(r.props=og.mergeEvaluated.props(n,e.props,r.props,t)),!0!==r.items&&void 0!==e.items&&(r.items=og.mergeEvaluated.items(n,e.items,r.items,t)))}mergeValidEvaluated(e,t){const{it:r,gen:n}=this;if(r.opts.unevaluated&&(!0!==r.props||!0!==r.items))return n.if(t,(()=>this.mergeEvaluated(e,rg.Name))),!0}}function Ag(e,t,r,n){const i=new wg(e,r,t);"code"in r?r.code(i,n):i.$data&&r.validate?(0,eg.funcKeywordCode)(i,r):"macro"in r?(0,eg.macroKeywordCode)(i,r):(r.compile||r.validate)&&(0,eg.funcKeywordCode)(i,r)}zp.KeywordCxt=wg;const _g=/^\/(?:[^~]|~0|~1)*$/,Eg=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function Sg(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let i,o;if(""===e)return ng.default.rootData;if("/"===e[0]){if(!_g.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);i=e,o=ng.default.rootData}else{const a=Eg.exec(e);if(!a)throw new Error(`Invalid JSON-pointer: ${e}`);const s=+a[1];if(i=a[2],"#"===i){if(s>=t)throw new Error(c("property/index",s));return n[t-s]}if(s>t)throw new Error(c("data",s));if(o=r[t-s],!i)return o}let a=o;const s=i.split("/");for(const e of s)e&&(o=rg._`${o}${(0,rg.getProperty)((0,og.unescapeJsonPointer)(e))}`,a=rg._`${a} && ${o}`);return a;function c(e,r){return`Cannot access ${e} ${r} levels up, current level is ${t}`}}zp.getData=Sg;var Pg={};Object.defineProperty(Pg,"__esModule",{value:!0});class xg extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}}Pg.default=xg;var kg={};Object.defineProperty(kg,"__esModule",{value:!0});const Mg=Rm;class Cg extends Error{constructor(e,t,r,n){super(n||`can't resolve reference ${r} from id ${t}`),this.missingRef=(0,Mg.resolveUrl)(e,t,r),this.missingSchema=(0,Mg.normalizeId)((0,Mg.getFullPath)(e,this.missingRef))}}kg.default=Cg;var Ig={};Object.defineProperty(Ig,"__esModule",{value:!0}),Ig.resolveSchema=Ig.getCompilingSchema=Ig.resolveRef=Ig.compileSchema=Ig.SchemaEnv=void 0;const Rg=qp,Ng=Pg,Og=Wp,Tg=Rm,jg=Jp,$g=zp;class Dg{constructor(e){var t;let r;this.refs={},this.dynamicAnchors={},"object"==typeof e.schema&&(r=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=null!==(t=e.baseId)&&void 0!==t?t:(0,Tg.normalizeId)(null==r?void 0:r[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=null==r?void 0:r.$async,this.refs={}}}function Bg(e){const t=zg.call(this,e);if(t)return t;const r=(0,Tg.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:n,lines:i}=this.opts.code,{ownProperties:o}=this.opts,a=new Rg.CodeGen(this.scope,{es5:n,lines:i,ownProperties:o});let s;e.$async&&(s=a.scopeValue("Error",{ref:Ng.default,code:Rg._`require("ajv/dist/runtime/validation_error").default`}));const c=a.scopeName("validate");e.validateName=c;const u={gen:a,allErrors:this.opts.allErrors,data:Og.default.data,parentData:Og.default.parentData,parentDataProperty:Og.default.parentDataProperty,dataNames:[Og.default.data],dataPathArr:[Rg.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:a.scopeValue("schema",!0===this.opts.code.source?{ref:e.schema,code:(0,Rg.stringify)(e.schema)}:{ref:e.schema}),validateName:c,ValidationError:s,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:Rg.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:Rg._`""`,opts:this.opts,self:this};let f;try{this._compilations.add(e),(0,$g.validateFunctionCode)(u),a.optimize(this.opts.code.optimize);const t=a.toString();f=`${a.scopeRefs(Og.default.scope)}return ${t}`,this.opts.code.process&&(f=this.opts.code.process(f,e));const r=new Function(`${Og.default.self}`,`${Og.default.scope}`,f)(this,this.scope.get());if(this.scope.value(c,{ref:r}),r.errors=null,r.schema=e.schema,r.schemaEnv=e,e.$async&&(r.$async=!0),!0===this.opts.code.source&&(r.source={validateName:c,validateCode:t,scopeValues:a._values}),this.opts.unevaluated){const{props:e,items:t}=u;r.evaluated={props:e instanceof Rg.Name?void 0:e,items:t instanceof Rg.Name?void 0:t,dynamicProps:e instanceof Rg.Name,dynamicItems:t instanceof Rg.Name},r.source&&(r.source.evaluated=(0,Rg.stringify)(r.evaluated))}return e.validate=r,e}catch(t){throw delete e.validate,delete e.validateName,f&&this.logger.error("Error compiling schema, function code:",f),t}finally{this._compilations.delete(e)}}function Fg(e){return(0,Tg.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:Bg.call(this,e)}function zg(e){for(const n of this._compilations)if(r=e,(t=n).schema===r.schema&&t.root===r.root&&t.baseId===r.baseId)return n;var t,r}function Ug(e,t){let r;for(;"string"==typeof(r=this.refs[t]);)t=r;return r||this.schemas[t]||Lg.call(this,e,t)}function Lg(e,t){const r=this.opts.uriResolver.parse(t),n=(0,Tg._getFullPath)(this.opts.uriResolver,r);let i=(0,Tg.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===i)return Hg.call(this,r,e);const o=(0,Tg.normalizeId)(n),a=this.refs[o]||this.schemas[o];if("string"==typeof a){const t=Lg.call(this,e,a);if("object"!=typeof(null==t?void 0:t.schema))return;return Hg.call(this,r,t)}if("object"==typeof(null==a?void 0:a.schema)){if(a.validate||Bg.call(this,a),o===(0,Tg.normalizeId)(t)){const{schema:t}=a,{schemaId:r}=this.opts,n=t[r];return n&&(i=(0,Tg.resolveUrl)(this.opts.uriResolver,i,n)),new Dg({schema:t,schemaId:r,root:e,baseId:i})}return Hg.call(this,r,a)}}Ig.SchemaEnv=Dg,Ig.compileSchema=Bg,Ig.resolveRef=function(e,t,r){var n;r=(0,Tg.resolveUrl)(this.opts.uriResolver,t,r);const i=e.refs[r];if(i)return i;let o=Ug.call(this,e,r);if(void 0===o){const i=null===(n=e.localRefs)||void 0===n?void 0:n[r],{schemaId:a}=this.opts;i&&(o=new Dg({schema:i,schemaId:a,root:e,baseId:t}))}return void 0!==o?e.refs[r]=Fg.call(this,o):void 0},Ig.getCompilingSchema=zg,Ig.resolveSchema=Lg;const qg=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Hg(e,{baseId:t,schema:r,root:n}){var i;if("/"!==(null===(i=e.fragment)||void 0===i?void 0:i[0]))return;for(const n of e.fragment.slice(1).split("/")){if("boolean"==typeof r)return;const e=r[(0,jg.unescapeFragment)(n)];if(void 0===e)return;const i="object"==typeof(r=e)&&r[this.opts.schemaId];!qg.has(n)&&i&&(t=(0,Tg.resolveUrl)(this.opts.uriResolver,t,i))}let o;if("boolean"!=typeof r&&r.$ref&&!(0,jg.schemaHasRulesButRef)(r,this.RULES)){const e=(0,Tg.resolveUrl)(this.opts.uriResolver,t,r.$ref);o=Lg.call(this,n,e)}const{schemaId:a}=this.opts;return o=o||new Dg({schema:r,schemaId:a,root:n,baseId:t}),o.schema!==o.root.schema?o:void 0}var Kg={$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:!1},Jg={},Wg={exports:{}};!function(e){function t(){for(var e=arguments.length,t=Array(e),r=0;r1){t[0]=t[0].slice(0,-1);for(var n=t.length-1,i=1;i= 0x80 (not a basic code point)","invalid-input":"Invalid input"},P=h-p,x=Math.floor,k=String.fromCharCode;function M(e){throw new RangeError(S[e])}function C(e,t){for(var r=[],n=e.length;n--;)r[n]=t(e[n]);return r}function I(e,t){var r=e.split("@"),n="";return r.length>1&&(n=r[0]+"@",e=r[1]),n+C((e=e.replace(E,".")).split("."),t).join(".")}function R(e){for(var t=[],r=0,n=e.length;r=55296&&i<=56319&&r>1,e+=x(e/t);e>P*m>>1;n+=h)e=x(e/P);return x(n+(P+1)*e/(e+g))},j=function(e){var t=[],r=e.length,n=0,i=v,o=b,a=e.lastIndexOf(w);a<0&&(a=0);for(var s=0;s=128&&M("not-basic"),t.push(e.charCodeAt(s));for(var c=a>0?a+1:0;c=r&&M("invalid-input");var g=N(e.charCodeAt(c++));(g>=h||g>x((l-n)/f))&&M("overflow"),n+=g*f;var y=d<=o?p:d>=o+m?m:d-o;if(gx(l/A)&&M("overflow"),f*=A}var _=t.length+1;o=T(n-u,_,0==u),x(n/_)>l-i&&M("overflow"),i+=x(n/_),n%=_,t.splice(n++,0,i)}return String.fromCodePoint.apply(String,t)},$=function(e){var t=[],r=(e=R(e)).length,n=v,i=0,o=b,a=!0,s=!1,c=void 0;try{for(var u,f=e[Symbol.iterator]();!(a=(u=f.next()).done);a=!0){var d=u.value;d<128&&t.push(k(d))}}catch(e){s=!0,c=e}finally{try{!a&&f.return&&f.return()}finally{if(s)throw c}}var g=t.length,y=g;for(g&&t.push(w);y=n&&Ix((l-i)/N)&&M("overflow"),i+=(A-n)*N,n=A;var j=!0,$=!1,D=void 0;try{for(var B,F=e[Symbol.iterator]();!(j=(B=F.next()).done);j=!0){var z=B.value;if(zl&&M("overflow"),z==n){for(var U=i,L=h;;L+=h){var q=L<=o?p:L>=o+m?m:L-o;if(U>6|192).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase():"%"+(t>>12|224).toString(16).toUpperCase()+"%"+(t>>6&63|128).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase()}function L(e){for(var t="",r=0,n=e.length;r=194&&i<224){if(n-r>=6){var o=parseInt(e.substr(r+4,2),16);t+=String.fromCharCode((31&i)<<6|63&o)}else t+=e.substr(r,6);r+=6}else if(i>=224){if(n-r>=9){var a=parseInt(e.substr(r+4,2),16),s=parseInt(e.substr(r+7,2),16);t+=String.fromCharCode((15&i)<<12|(63&a)<<6|63&s)}else t+=e.substr(r,9);r+=9}else t+=e.substr(r,3),r+=3}return t}function q(e,t){function r(e){var r=L(e);return r.match(t.UNRESERVED)?r:e}return e.scheme&&(e.scheme=String(e.scheme).replace(t.PCT_ENCODED,r).toLowerCase().replace(t.NOT_SCHEME,"")),void 0!==e.userinfo&&(e.userinfo=String(e.userinfo).replace(t.PCT_ENCODED,r).replace(t.NOT_USERINFO,U).replace(t.PCT_ENCODED,i)),void 0!==e.host&&(e.host=String(e.host).replace(t.PCT_ENCODED,r).toLowerCase().replace(t.NOT_HOST,U).replace(t.PCT_ENCODED,i)),void 0!==e.path&&(e.path=String(e.path).replace(t.PCT_ENCODED,r).replace(e.scheme?t.NOT_PATH:t.NOT_PATH_NOSCHEME,U).replace(t.PCT_ENCODED,i)),void 0!==e.query&&(e.query=String(e.query).replace(t.PCT_ENCODED,r).replace(t.NOT_QUERY,U).replace(t.PCT_ENCODED,i)),void 0!==e.fragment&&(e.fragment=String(e.fragment).replace(t.PCT_ENCODED,r).replace(t.NOT_FRAGMENT,U).replace(t.PCT_ENCODED,i)),e}function H(e){return e.replace(/^0*(.*)/,"$1")||"0"}function K(e,t){var r=e.match(t.IPV4ADDRESS)||[],n=f(r,2)[1];return n?n.split(".").map(H).join("."):e}function J(e,t){var r=e.match(t.IPV6ADDRESS)||[],n=f(r,3),i=n[1],o=n[2];if(i){for(var a=i.toLowerCase().split("::").reverse(),s=f(a,2),c=s[0],u=s[1],d=u?u.split(":").map(H):[],l=c.split(":").map(H),h=t.IPV4ADDRESS.test(l[l.length-1]),p=h?7:8,m=l.length-p,g=Array(p),y=0;y1){var A=g.slice(0,v.index),_=g.slice(v.index+v.length);w=A.join(":")+"::"+_.join(":")}else w=g.join(":");return o&&(w+="%"+o),w}return e}var W=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,G=void 0==="".match(/(){0}/)[1];function V(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={},n=!1!==t.iri?u:c;"suffix"===t.reference&&(e=(t.scheme?t.scheme+":":"")+"//"+e);var i=e.match(W);if(i){G?(r.scheme=i[1],r.userinfo=i[3],r.host=i[4],r.port=parseInt(i[5],10),r.path=i[6]||"",r.query=i[7],r.fragment=i[8],isNaN(r.port)&&(r.port=i[5])):(r.scheme=i[1]||void 0,r.userinfo=-1!==e.indexOf("@")?i[3]:void 0,r.host=-1!==e.indexOf("//")?i[4]:void 0,r.port=parseInt(i[5],10),r.path=i[6]||"",r.query=-1!==e.indexOf("?")?i[7]:void 0,r.fragment=-1!==e.indexOf("#")?i[8]:void 0,isNaN(r.port)&&(r.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?i[4]:void 0)),r.host&&(r.host=J(K(r.host,n),n)),void 0!==r.scheme||void 0!==r.userinfo||void 0!==r.host||void 0!==r.port||r.path||void 0!==r.query?void 0===r.scheme?r.reference="relative":void 0===r.fragment?r.reference="absolute":r.reference="uri":r.reference="same-document",t.reference&&"suffix"!==t.reference&&t.reference!==r.reference&&(r.error=r.error||"URI is not a "+t.reference+" reference.");var o=z[(t.scheme||r.scheme||"").toLowerCase()];if(t.unicodeSupport||o&&o.unicodeSupport)q(r,n);else{if(r.host&&(t.domainHost||o&&o.domainHost))try{r.host=F.toASCII(r.host.replace(n.PCT_ENCODED,L).toLowerCase())}catch(e){r.error=r.error||"Host's domain name can not be converted to ASCII via punycode: "+e}q(r,c)}o&&o.parse&&o.parse(r,t)}else r.error=r.error||"URI can not be parsed.";return r}function Z(e,t){var r=!1!==t.iri?u:c,n=[];return void 0!==e.userinfo&&(n.push(e.userinfo),n.push("@")),void 0!==e.host&&n.push(J(K(String(e.host),r),r).replace(r.IPV6ADDRESS,(function(e,t,r){return"["+t+(r?"%25"+r:"")+"]"}))),"number"!=typeof e.port&&"string"!=typeof e.port||(n.push(":"),n.push(String(e.port))),n.length?n.join(""):void 0}var X=/^\.\.?\//,Q=/^\/\.(\/|$)/,Y=/^\/\.\.(\/|$)/,ee=/^\/?(?:.|\n)*?(?=\/|$)/;function te(e){for(var t=[];e.length;)if(e.match(X))e=e.replace(X,"");else if(e.match(Q))e=e.replace(Q,"/");else if(e.match(Y))e=e.replace(Y,"/"),t.pop();else if("."===e||".."===e)e="";else{var r=e.match(ee);if(!r)throw new Error("Unexpected dot segment condition");var n=r[0];e=e.slice(n.length),t.push(n)}return t.join("")}function re(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.iri?u:c,n=[],i=z[(t.scheme||e.scheme||"").toLowerCase()];if(i&&i.serialize&&i.serialize(e,t),e.host)if(r.IPV6ADDRESS.test(e.host));else if(t.domainHost||i&&i.domainHost)try{e.host=t.iri?F.toUnicode(e.host):F.toASCII(e.host.replace(r.PCT_ENCODED,L).toLowerCase())}catch(r){e.error=e.error||"Host's domain name can not be converted to "+(t.iri?"Unicode":"ASCII")+" via punycode: "+r}q(e,r),"suffix"!==t.reference&&e.scheme&&(n.push(e.scheme),n.push(":"));var o=Z(e,t);if(void 0!==o&&("suffix"!==t.reference&&n.push("//"),n.push(o),e.path&&"/"!==e.path.charAt(0)&&n.push("/")),void 0!==e.path){var a=e.path;t.absolutePath||i&&i.absolutePath||(a=te(a)),void 0===o&&(a=a.replace(/^\/\//,"/%2F")),n.push(a)}return void 0!==e.query&&(n.push("?"),n.push(e.query)),void 0!==e.fragment&&(n.push("#"),n.push(e.fragment)),n.join("")}function ne(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n={};return arguments[3]||(e=V(re(e,r),r),t=V(re(t,r),r)),!(r=r||{}).tolerant&&t.scheme?(n.scheme=t.scheme,n.userinfo=t.userinfo,n.host=t.host,n.port=t.port,n.path=te(t.path||""),n.query=t.query):(void 0!==t.userinfo||void 0!==t.host||void 0!==t.port?(n.userinfo=t.userinfo,n.host=t.host,n.port=t.port,n.path=te(t.path||""),n.query=t.query):(t.path?("/"===t.path.charAt(0)?n.path=te(t.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?n.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:n.path=t.path:n.path="/"+t.path,n.path=te(n.path)),n.query=t.query):(n.path=e.path,void 0!==t.query?n.query=t.query:n.query=e.query),n.userinfo=e.userinfo,n.host=e.host,n.port=e.port),n.scheme=e.scheme),n.fragment=t.fragment,n}function ie(e,t,r){var n=a({scheme:"null"},r);return re(ne(V(e,n),V(t,n),n,!0),n)}function oe(e,t){return"string"==typeof e?e=re(V(e,t),t):"object"===n(e)&&(e=V(re(e,t),t)),e}function ae(e,t,r){return"string"==typeof e?e=re(V(e,r),r):"object"===n(e)&&(e=re(e,r)),"string"==typeof t?t=re(V(t,r),r):"object"===n(t)&&(t=re(t,r)),e===t}function se(e,t){return e&&e.toString().replace(t&&t.iri?u.ESCAPE:c.ESCAPE,U)}function ce(e,t){return e&&e.toString().replace(t&&t.iri?u.PCT_ENCODED:c.PCT_ENCODED,L)}var ue={scheme:"http",domainHost:!0,parse:function(e,t){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e},serialize:function(e,t){var r="https"===String(e.scheme).toLowerCase();return e.port!==(r?443:80)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}},fe={scheme:"https",domainHost:ue.domainHost,parse:ue.parse,serialize:ue.serialize};function de(e){return"boolean"==typeof e.secure?e.secure:"wss"===String(e.scheme).toLowerCase()}var le={scheme:"ws",domainHost:!0,parse:function(e,t){var r=e;return r.secure=de(r),r.resourceName=(r.path||"/")+(r.query?"?"+r.query:""),r.path=void 0,r.query=void 0,r},serialize:function(e,t){if(e.port!==(de(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){var r=e.resourceName.split("?"),n=f(r,2),i=n[0],o=n[1];e.path=i&&"/"!==i?i:void 0,e.query=o,e.resourceName=void 0}return e.fragment=void 0,e}},he={scheme:"wss",domainHost:le.domainHost,parse:le.parse,serialize:le.serialize},pe={},me="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",ge="[0-9A-Fa-f]",ye=r(r("%[EFef]"+ge+"%"+ge+ge+"%"+ge+ge)+"|"+r("%[89A-Fa-f]"+ge+"%"+ge+ge)+"|"+r("%"+ge+ge)),be="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",ve=t("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),we="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",Ae=new RegExp(me,"g"),_e=new RegExp(ye,"g"),Ee=new RegExp(t("[^]",be,"[\\.]",'[\\"]',ve),"g"),Se=new RegExp(t("[^]",me,we),"g"),Pe=Se;function xe(e){var t=L(e);return t.match(Ae)?t:e}var ke={scheme:"mailto",parse:function(e,t){var r=e,n=r.to=r.path?r.path.split(","):[];if(r.path=void 0,r.query){for(var i=!1,o={},a=r.query.split("&"),s=0,c=a.length;snew RegExp(e,t);h.code="new RegExp";const p=["removeAdditional","useDefaults","coerceTypes"],m=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),g={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 b(e){var t,r,n,i,o,a,s,c,u,f,d,p,m,g,y,b,v,w,A,_,E,S,P,x,k;const M=e.strict,C=null===(t=e.code)||void 0===t?void 0:t.optimize,I=!0===C||void 0===C?1:C||0,R=null!==(n=null===(r=e.code)||void 0===r?void 0:r.regExp)&&void 0!==n?n:h,N=null!==(i=e.uriResolver)&&void 0!==i?i:l.default;return{strictSchema:null===(a=null!==(o=e.strictSchema)&&void 0!==o?o:M)||void 0===a||a,strictNumbers:null===(c=null!==(s=e.strictNumbers)&&void 0!==s?s:M)||void 0===c||c,strictTypes:null!==(f=null!==(u=e.strictTypes)&&void 0!==u?u:M)&&void 0!==f?f:"log",strictTuples:null!==(p=null!==(d=e.strictTuples)&&void 0!==d?d:M)&&void 0!==p?p:"log",strictRequired:null!==(g=null!==(m=e.strictRequired)&&void 0!==m?m:M)&&void 0!==g&&g,code:e.code?{...e.code,optimize:I,regExp:R}:{optimize:I,regExp:R},loopRequired:null!==(y=e.loopRequired)&&void 0!==y?y:200,loopEnum:null!==(b=e.loopEnum)&&void 0!==b?b:200,meta:null===(v=e.meta)||void 0===v||v,messages:null===(w=e.messages)||void 0===w||w,inlineRefs:null===(A=e.inlineRefs)||void 0===A||A,schemaId:null!==(_=e.schemaId)&&void 0!==_?_:"$id",addUsedSchema:null===(E=e.addUsedSchema)||void 0===E||E,validateSchema:null===(S=e.validateSchema)||void 0===S||S,validateFormats:null===(P=e.validateFormats)||void 0===P||P,unicodeRegExp:null===(x=e.unicodeRegExp)||void 0===x||x,int32range:null===(k=e.int32range)||void 0===k||k,uriResolver:N}}class v{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...b(e)};const{es5:t,lines:r}=this.opts.code;this.scope=new s.ValueScope({scope:{},prefixes:m,es5:t,lines:r}),this.logger=function(e){if(!1===e)return x;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 n=e.validateFormats;e.validateFormats=!1,this.RULES=(0,o.getRules)(),w.call(this,g,e,"NOT SUPPORTED"),w.call(this,y,e,"DEPRECATED","warn"),this._metaOpts=P.call(this),e.formats&&E.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&S.call(this,e.keywords),"object"==typeof e.meta&&this.addMetaSchema(e.meta),_.call(this),e.validateFormats=n}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:e,meta:t,schemaId:r}=this.opts;let n=d;"id"===r&&(n={...d},n.id=n.$id,delete n.$id),t&&e&&this.addMetaSchema(n,n[r],!1)}defaultMeta(){const{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta="object"==typeof e?e[t]||e:void 0}validate(e,t){let r;if("string"==typeof e){if(r=this.getSchema(e),!r)throw new Error(`no schema with key or ref "${e}"`)}else r=this.compile(e);const n=r(t);return"$async"in r||(this.errors=r.errors),n}compile(e,t){const r=this._addSchema(e,t);return r.validate||this._compileSchemaEnv(r)}compileAsync(e,t){if("function"!=typeof this.opts.loadSchema)throw new Error("options.loadSchema should be a function");const{loadSchema:r}=this.opts;return n.call(this,e,t);async function n(e,t){await o.call(this,e.$schema);const r=this._addSchema(e,t);return r.validate||a.call(this,r)}async function o(e){e&&!this.getSchema(e)&&await n.call(this,{$ref:e},!0)}async function a(e){try{return this._compileSchemaEnv(e)}catch(t){if(!(t instanceof i.default))throw t;return s.call(this,t),await c.call(this,t.missingSchema),a.call(this,e)}}function s({missingSchema:e,missingRef:t}){if(this.refs[e])throw new Error(`AnySchema ${e} is loaded but ${t} cannot be resolved`)}async function c(e){const r=await u.call(this,e);this.refs[e]||await o.call(this,r.$schema),this.refs[e]||this.addSchema(r,e,t)}async function u(e){const t=this._loading[e];if(t)return t;try{return await(this._loading[e]=r(e))}finally{delete this._loading[e]}}}addSchema(e,t,r,n=this.opts.validateSchema){if(Array.isArray(e)){for(const t of e)this.addSchema(t,void 0,r,n);return this}let i;if("object"==typeof e){const{schemaId:t}=this.opts;if(i=e[t],void 0!==i&&"string"!=typeof i)throw new Error(`schema ${t} must be string`)}return t=(0,c.normalizeId)(t||i),this._checkUnique(t),this.schemas[t]=this._addSchema(e,r,t,n,!0),this}addMetaSchema(e,t,r=this.opts.validateSchema){return this.addSchema(e,t,!0,r),this}validateSchema(e,t){if("boolean"==typeof e)return!0;let r;if(r=e.$schema,void 0!==r&&"string"!=typeof r)throw new Error("$schema must be a string");if(r=r||this.opts.defaultMeta||this.defaultMeta(),!r)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const n=this.validate(r,e);if(!n&&t){const e="schema is invalid: "+this.errorsText();if("log"!==this.opts.validateSchema)throw new Error(e);this.logger.error(e)}return n}getSchema(e){let t;for(;"string"==typeof(t=A.call(this,e));)e=t;if(void 0===t){const{schemaId:r}=this.opts,n=new a.SchemaEnv({schema:{},schemaId:r});if(t=a.resolveSchema.call(this,n,e),!t)return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}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 t=A.call(this,e);return"object"==typeof t&&this._cache.delete(t.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{const t=e;this._cache.delete(t);let r=e[this.opts.schemaId];return r&&(r=(0,c.normalizeId)(r),delete this.schemas[r],delete this.refs[r]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(const t of e)this.addKeyword(t);return this}addKeyword(e,t){let r;if("string"==typeof e)r=e,"object"==typeof t&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),t.keyword=r);else{if("object"!=typeof e||void 0!==t)throw new Error("invalid addKeywords parameters");if(r=(t=e).keyword,Array.isArray(r)&&!r.length)throw new Error("addKeywords: keyword must be string or non-empty array")}if(M.call(this,r,t),!t)return(0,f.eachItem)(r,(e=>C.call(this,e))),this;R.call(this,t);const n={...t,type:(0,u.getJSONTypes)(t.type),schemaType:(0,u.getJSONTypes)(t.schemaType)};return(0,f.eachItem)(r,0===n.type.length?e=>C.call(this,e,n):e=>n.type.forEach((t=>C.call(this,e,n,t)))),this}getKeyword(e){const t=this.RULES.all[e];return"object"==typeof t?t.definition:!!t}removeKeyword(e){const{RULES:t}=this;delete t.keywords[e],delete t.all[e];for(const r of t.rules){const t=r.rules.findIndex((t=>t.keyword===e));t>=0&&r.rules.splice(t,1)}return this}addFormat(e,t){return"string"==typeof t&&(t=new RegExp(t)),this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=", ",dataVar:r="data"}={}){return e&&0!==e.length?e.map((e=>`${r}${e.instancePath} ${e.message}`)).reduce(((e,r)=>e+t+r)):"No errors"}$dataMetaSchema(e,t){const r=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(const n of t){const t=n.split("/").slice(1);let i=e;for(const e of t)i=i[e];for(const e in r){const t=r[e];if("object"!=typeof t)continue;const{$data:n}=t.definition,o=i[e];n&&o&&(i[e]=O(o))}}return e}_removeAllSchemas(e,t){for(const r in e){const n=e[r];t&&!t.test(r)||("string"==typeof n?delete e[r]:n&&!n.meta&&(this._cache.delete(n.schema),delete e[r]))}}_addSchema(e,t,r,n=this.opts.validateSchema,i=this.opts.addUsedSchema){let o;const{schemaId:s}=this.opts;if("object"==typeof e)o=e[s];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 u=this._cache.get(e);if(void 0!==u)return u;r=(0,c.normalizeId)(o||r);const f=c.getSchemaRefs.call(this,e,r);return u=new a.SchemaEnv({schema:e,schemaId:s,meta:t,baseId:r,localRefs:f}),this._cache.set(u.schema,u),i&&!r.startsWith("#")&&(r&&this._checkUnique(r),this.refs[r]=u),n&&this.validateSchema(e,!0),u}_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):a.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){const t=this.opts;this.opts=this._metaOpts;try{a.compileSchema.call(this,e)}finally{this.opts=t}}}function w(e,t,r,n="error"){for(const i in e){const o=i;o in t&&this.logger[n](`${r}: option ${i}. ${e[o]}`)}}function A(e){return e=(0,c.normalizeId)(e),this.schemas[e]||this.refs[e]}function _(){const e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(const t in e)this.addSchema(e[t],t)}function E(){for(const e in this.opts.formats){const t=this.opts.formats[e];t&&this.addFormat(e,t)}}function S(e){if(Array.isArray(e))this.addVocabulary(e);else{this.logger.warn("keywords option as map is deprecated, pass array");for(const t in e){const r=e[t];r.keyword||(r.keyword=t),this.addKeyword(r)}}}function P(){const e={...this.opts};for(const t of p)delete e[t];return e}e.default=v,v.ValidationError=n.default,v.MissingRefError=i.default;const x={log(){},warn(){},error(){}};const k=/^[a-z_$][a-z0-9_$:-]*$/i;function M(e,t){const{RULES:r}=this;if((0,f.eachItem)(e,(e=>{if(r.keywords[e])throw new Error(`Keyword ${e} is already defined`);if(!k.test(e))throw new Error(`Keyword ${e} has invalid name`)})),t&&t.$data&&!("code"in t)&&!("validate"in t))throw new Error('$data keyword must have "code" or "validate" function')}function C(e,t,r){var n;const i=null==t?void 0:t.post;if(r&&i)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:o}=this;let a=i?o.post:o.rules.find((({type:e})=>e===r));if(a||(a={type:r,rules:[]},o.rules.push(a)),o.keywords[e]=!0,!t)return;const s={keyword:e,definition:{...t,type:(0,u.getJSONTypes)(t.type),schemaType:(0,u.getJSONTypes)(t.schemaType)}};t.before?I.call(this,a,s,t.before):a.rules.push(s),o.all[e]=s,null===(n=t.implements)||void 0===n||n.forEach((e=>this.addKeyword(e)))}function I(e,t,r){const n=e.rules.findIndex((e=>e.keyword===r));n>=0?e.rules.splice(n,0,t):(e.rules.push(t),this.logger.warn(`rule ${r} is not defined`))}function R(e){let{metaSchema:t}=e;void 0!==t&&(e.$data&&this.opts.$data&&(t=O(t)),e.validateSchema=this.compile(t,!0))}const N={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function O(e){return{anyOf:[e,N]}}}(Fp);var Zg={},Xg={},Qg={};Object.defineProperty(Qg,"__esModule",{value:!0}),Qg.callRef=Qg.getValidate=void 0;const Yg=kg,ey=lm,ty=qp,ry=Wp,ny=Ig,iy=Jp,oy={keyword:"$ref",schemaType:"string",code(e){const{gen:t,schema:r,it:n}=e,{baseId:i,schemaEnv:o,validateName:a,opts:s,self:c}=n,{root:u}=o;if(("#"===r||"#/"===r)&&i===u.baseId)return function(){if(o===u)return sy(e,a,o,o.$async);const r=t.scopeValue("root",{ref:u});return sy(e,ty._`${r}.validate`,u,u.$async)}();const f=ny.resolveRef.call(c,u,i,r);if(void 0===f)throw new Yg.default(n.opts.uriResolver,i,r);return f instanceof ny.SchemaEnv?function(t){const r=ay(e,t);sy(e,r,t,t.$async)}(f):function(n){const i=t.scopeValue("schema",!0===s.code.source?{ref:n,code:(0,ty.stringify)(n)}:{ref:n}),o=t.name("valid"),a=e.subschema({schema:n,dataTypes:[],schemaPath:ty.nil,topSchemaRef:i,errSchemaPath:r},o);e.mergeEvaluated(a),e.ok(o)}(f)}};function ay(e,t){const{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):ty._`${r.scopeValue("wrapper",{ref:t})}.validate`}function sy(e,t,r,n){const{gen:i,it:o}=e,{allErrors:a,schemaEnv:s,opts:c}=o,u=c.passContext?ry.default.this:ty.nil;function f(e){const t=ty._`${e}.errors`;i.assign(ry.default.vErrors,ty._`${ry.default.vErrors} === null ? ${t} : ${ry.default.vErrors}.concat(${t})`),i.assign(ry.default.errors,ty._`${ry.default.vErrors}.length`)}function d(e){var t;if(!o.opts.unevaluated)return;const n=null===(t=null==r?void 0:r.validate)||void 0===t?void 0:t.evaluated;if(!0!==o.props)if(n&&!n.dynamicProps)void 0!==n.props&&(o.props=iy.mergeEvaluated.props(i,n.props,o.props));else{const t=i.var("props",ty._`${e}.evaluated.props`);o.props=iy.mergeEvaluated.props(i,t,o.props,ty.Name)}if(!0!==o.items)if(n&&!n.dynamicItems)void 0!==n.items&&(o.items=iy.mergeEvaluated.items(i,n.items,o.items));else{const t=i.var("items",ty._`${e}.evaluated.items`);o.items=iy.mergeEvaluated.items(i,t,o.items,ty.Name)}}n?function(){if(!s.$async)throw new Error("async schema referenced by sync schema");const r=i.let("valid");i.try((()=>{i.code(ty._`await ${(0,ey.callValidateCode)(e,t,u)}`),d(t),a||i.assign(r,!0)}),(e=>{i.if(ty._`!(${e} instanceof ${o.ValidationError})`,(()=>i.throw(e))),f(e),a||i.assign(r,!1)})),e.ok(r)}():e.result((0,ey.callValidateCode)(e,t,u),(()=>d(t)),(()=>f(t)))}Qg.getValidate=ay,Qg.callRef=sy,Qg.default=oy,Object.defineProperty(Xg,"__esModule",{value:!0});const cy=["$schema","id","$defs",{keyword:"$comment"},"definitions",Qg.default];Xg.default=cy;var uy={},fy={};Object.defineProperty(fy,"__esModule",{value:!0});const dy=Fp,ly=qp.operators,hy={maximum:{exclusive:"exclusiveMaximum",ops:[{okStr:"<=",ok:ly.LTE,fail:ly.GT},{okStr:"<",ok:ly.LT,fail:ly.GTE}]},minimum:{exclusive:"exclusiveMinimum",ops:[{okStr:">=",ok:ly.GTE,fail:ly.LT},{okStr:">",ok:ly.GT,fail:ly.LTE}]}},py={message:e=>dy.str`must be ${gy(e).okStr} ${e.schemaCode}`,params:e=>dy._`{comparison: ${gy(e).okStr}, limit: ${e.schemaCode}}`},my={keyword:Object.keys(hy),type:"number",schemaType:"number",$data:!0,error:py,code(e){const{data:t,schemaCode:r}=e;e.fail$data(dy._`${t} ${gy(e).fail} ${r} || isNaN(${t})`)}};function gy(e){var t;const r=e.keyword,n=(null===(t=e.parentSchema)||void 0===t?void 0:t[hy[r].exclusive])?1:0;return hy[r].ops[n]}fy.default=my;var yy={};Object.defineProperty(yy,"__esModule",{value:!0});const by={exclusiveMaximum:"maximum",exclusiveMinimum:"minimum"},vy={keyword:Object.keys(by),type:"number",schemaType:"boolean",code({keyword:e,parentSchema:t}){const r=by[e];if(void 0===t[r])throw new Error(`${e} can only be used with ${r}`)}};yy.default=vy;var wy={};Object.defineProperty(wy,"__esModule",{value:!0});const Ay=qp,_y={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:e})=>Ay.str`must be multiple of ${e}`,params:({schemaCode:e})=>Ay._`{multipleOf: ${e}}`},code(e){const{gen:t,data:r,schemaCode:n,it:i}=e,o=i.opts.multipleOfPrecision,a=t.let("res"),s=o?Ay._`Math.abs(Math.round(${a}) - ${a}) > 1e-${o}`:Ay._`${a} !== parseInt(${a})`;e.fail$data(Ay._`(${n} === 0 || (${a} = ${r}/${n}, ${s}))`)}};wy.default=_y;var Ey={},Sy={};function Py(e){const t=e.length;let r,n=0,i=0;for(;i=55296&&r<=56319&&ixy.str`must NOT have ${"maxLength"===e?"more":"fewer"} than ${t} characters`,params:({schemaCode:e})=>xy._`{limit: ${e}}`},Iy={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:Cy,code(e){const{keyword:t,data:r,schemaCode:n,it:i}=e,o="maxLength"===t?xy.operators.GT:xy.operators.LT,a=!1===i.opts.unicode?xy._`${r}.length`:xy._`${(0,ky.useFunc)(e.gen,My.default)}(${r})`;e.fail$data(xy._`${a} ${o} ${n}`)}};Ey.default=Iy;var Ry={};Object.defineProperty(Ry,"__esModule",{value:!0});const Ny=lm,Oy=qp,Ty={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>Oy.str`must match pattern "${e}"`,params:({schemaCode:e})=>Oy._`{pattern: ${e}}`},code(e){const{data:t,$data:r,schema:n,schemaCode:i,it:o}=e,a=o.opts.unicodeRegExp?"u":"",s=r?Oy._`(new RegExp(${i}, ${a}))`:(0,Ny.usePattern)(e,n);e.fail$data(Oy._`!${s}.test(${t})`)}};Ry.default=Ty;var jy={};Object.defineProperty(jy,"__esModule",{value:!0});const $y=qp,Dy={message:({keyword:e,schemaCode:t})=>$y.str`must NOT have ${"maxProperties"===e?"more":"fewer"} than ${t} properties`,params:({schemaCode:e})=>$y._`{limit: ${e}}`},By={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:Dy,code(e){const{keyword:t,data:r,schemaCode:n}=e,i="maxProperties"===t?$y.operators.GT:$y.operators.LT;e.fail$data($y._`Object.keys(${r}).length ${i} ${n}`)}};jy.default=By;var Fy={};Object.defineProperty(Fy,"__esModule",{value:!0});const zy=lm,Uy=qp,Ly=Jp,qy={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:e}})=>Uy.str`must have required property '${e}'`,params:({params:{missingProperty:e}})=>Uy._`{missingProperty: ${e}}`},code(e){const{gen:t,schema:r,schemaCode:n,data:i,$data:o,it:a}=e,{opts:s}=a;if(!o&&0===r.length)return;const c=r.length>=s.loopRequired;if(a.allErrors?function(){if(c||o)e.block$data(Uy.nil,u);else for(const t of r)(0,zy.checkReportMissingProp)(e,t)}():function(){const a=t.let("missing");if(c||o){const r=t.let("valid",!0);e.block$data(r,(()=>function(r,o){e.setParams({missingProperty:r}),t.forOf(r,n,(()=>{t.assign(o,(0,zy.propertyInData)(t,i,r,s.ownProperties)),t.if((0,Uy.not)(o),(()=>{e.error(),t.break()}))}),Uy.nil)}(a,r))),e.ok(r)}else t.if((0,zy.checkMissingProp)(e,r,a)),(0,zy.reportMissingProp)(e,a),t.else()}(),s.strictRequired){const t=e.parentSchema.properties,{definedProperties:n}=e.it;for(const e of r)if(void 0===(null==t?void 0:t[e])&&!n.has(e)){const t=a.schemaEnv.baseId+a.errSchemaPath;(0,Ly.checkStrictMode)(a,`required property "${e}" is not defined at "${t}" (strictRequired)`,a.opts.strictRequired)}}function u(){t.forOf("prop",n,(r=>{e.setParams({missingProperty:r}),t.if((0,zy.noPropertyInData)(t,i,r,s.ownProperties),(()=>e.error()))}))}}};Fy.default=qy;var Hy={};Object.defineProperty(Hy,"__esModule",{value:!0});const Ky=qp,Jy={message:({keyword:e,schemaCode:t})=>Ky.str`must NOT have ${"maxItems"===e?"more":"fewer"} than ${t} items`,params:({schemaCode:e})=>Ky._`{limit: ${e}}`},Wy={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:Jy,code(e){const{keyword:t,data:r,schemaCode:n}=e,i="maxItems"===t?Ky.operators.GT:Ky.operators.LT;e.fail$data(Ky._`${r}.length ${i} ${n}`)}};Hy.default=Wy;var Gy={},Vy={};Object.defineProperty(Vy,"__esModule",{value:!0});const Zy=Nm;Zy.code='require("ajv/dist/runtime/equal").default',Vy.default=Zy,Object.defineProperty(Gy,"__esModule",{value:!0});const Xy=tm,Qy=qp,Yy=Jp,eb=Vy,tb={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:e,j:t}})=>Qy.str`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>Qy._`{i: ${e}, j: ${t}}`},code(e){const{gen:t,data:r,$data:n,schema:i,parentSchema:o,schemaCode:a,it:s}=e;if(!n&&!i)return;const c=t.let("valid"),u=o.items?(0,Xy.getSchemaTypes)(o.items):[];function f(n,i){const o=t.name("item"),a=(0,Xy.checkDataTypes)(u,o,s.opts.strictNumbers,Xy.DataType.Wrong),f=t.const("indices",Qy._`{}`);t.for(Qy._`;${n}--;`,(()=>{t.let(o,Qy._`${r}[${n}]`),t.if(a,Qy._`continue`),u.length>1&&t.if(Qy._`typeof ${o} == "string"`,Qy._`${o} += "_"`),t.if(Qy._`typeof ${f}[${o}] == "number"`,(()=>{t.assign(i,Qy._`${f}[${o}]`),e.error(),t.assign(c,!1).break()})).code(Qy._`${f}[${o}] = ${n}`)}))}function d(n,i){const o=(0,Yy.useFunc)(t,eb.default),a=t.name("outer");t.label(a).for(Qy._`;${n}--;`,(()=>t.for(Qy._`${i} = ${n}; ${i}--;`,(()=>t.if(Qy._`${o}(${r}[${n}], ${r}[${i}])`,(()=>{e.error(),t.assign(c,!1).break(a)}))))))}e.block$data(c,(function(){const n=t.let("i",Qy._`${r}.length`),i=t.let("j");e.setParams({i:n,j:i}),t.assign(c,!0),t.if(Qy._`${n} > 1`,(()=>(u.length>0&&!u.some((e=>"object"===e||"array"===e))?f:d)(n,i)))}),Qy._`${a} === false`),e.ok(c)}};Gy.default=tb;var rb={};Object.defineProperty(rb,"__esModule",{value:!0});const nb=qp,ib=Jp,ob=Vy,ab={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:e})=>nb._`{allowedValue: ${e}}`},code(e){const{gen:t,data:r,$data:n,schemaCode:i,schema:o}=e;n||o&&"object"==typeof o?e.fail$data(nb._`!${(0,ib.useFunc)(t,ob.default)}(${r}, ${i})`):e.fail(nb._`${o} !== ${r}`)}};rb.default=ab;var sb={};Object.defineProperty(sb,"__esModule",{value:!0});const cb=qp,ub=Jp,fb=Vy,db={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:e})=>cb._`{allowedValues: ${e}}`},code(e){const{gen:t,data:r,$data:n,schema:i,schemaCode:o,it:a}=e;if(!n&&0===i.length)throw new Error("enum must have non-empty array");const s=i.length>=a.opts.loopEnum;let c;const u=()=>null!=c?c:c=(0,ub.useFunc)(t,fb.default);let f;if(s||n)f=t.let("valid"),e.block$data(f,(function(){t.assign(f,!1),t.forOf("v",o,(e=>t.if(cb._`${u()}(${r}, ${e})`,(()=>t.assign(f,!0).break()))))}));else{if(!Array.isArray(i))throw new Error("ajv implementation error");const e=t.const("vSchema",o);f=(0,cb.or)(...i.map(((t,n)=>function(e,t){const n=i[t];return"object"==typeof n&&null!==n?cb._`${u()}(${r}, ${e}[${t}])`:cb._`${r} === ${n}`}(e,n))))}e.pass(f)}};sb.default=db,Object.defineProperty(uy,"__esModule",{value:!0});const lb=yy,hb=wy,pb=Ey,mb=Ry,gb=jy,yb=Fy,bb=Hy,vb=Gy,wb=rb,Ab=sb,_b=[fy.default,lb.default,hb.default,pb.default,mb.default,gb.default,yb.default,bb.default,vb.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},wb.default,Ab.default];uy.default=_b;var Eb={},Sb={};Object.defineProperty(Sb,"__esModule",{value:!0}),Sb.validateAdditionalItems=void 0;const Pb=qp,xb=Jp,kb={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:e}})=>Pb.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>Pb._`{limit: ${e}}`},code(e){const{parentSchema:t,it:r}=e,{items:n}=t;Array.isArray(n)?Mb(e,n):(0,xb.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas')}};function Mb(e,t){const{gen:r,schema:n,data:i,keyword:o,it:a}=e;a.items=!0;const s=r.const("len",Pb._`${i}.length`);if(!1===n)e.setParams({len:t.length}),e.pass(Pb._`${s} <= ${t.length}`);else if("object"==typeof n&&!(0,xb.alwaysValidSchema)(a,n)){const n=r.var("valid",Pb._`${s} <= ${t.length}`);r.if((0,Pb.not)(n),(()=>function(n){r.forRange("i",t.length,s,(t=>{e.subschema({keyword:o,dataProp:t,dataPropType:xb.Type.Num},n),a.allErrors||r.if((0,Pb.not)(n),(()=>r.break()))}))}(n))),e.ok(n)}}Sb.validateAdditionalItems=Mb,Sb.default=kb;var Cb={},Ib={};Object.defineProperty(Ib,"__esModule",{value:!0}),Ib.validateTuple=void 0;const Rb=qp,Nb=Jp,Ob=lm,Tb={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){const{schema:t,it:r}=e;if(Array.isArray(t))return jb(e,"additionalItems",t);r.items=!0,(0,Nb.alwaysValidSchema)(r,t)||e.ok((0,Ob.validateArray)(e))}};function jb(e,t,r=e.schema){const{gen:n,parentSchema:i,data:o,keyword:a,it:s}=e;!function(e){const{opts:n,errSchemaPath:i}=s,o=r.length,c=o===e.minItems&&(o===e.maxItems||!1===e[t]);if(n.strictTuples&&!c){const e=`"${a}" is ${o}-tuple, but minItems or maxItems/${t} are not specified or different at path "${i}"`;(0,Nb.checkStrictMode)(s,e,n.strictTuples)}}(i),s.opts.unevaluated&&r.length&&!0!==s.items&&(s.items=Nb.mergeEvaluated.items(n,r.length,s.items));const c=n.name("valid"),u=n.const("len",Rb._`${o}.length`);r.forEach(((t,r)=>{(0,Nb.alwaysValidSchema)(s,t)||(n.if(Rb._`${u} > ${r}`,(()=>e.subschema({keyword:a,schemaProp:r,dataProp:r},c))),e.ok(c))}))}Ib.validateTuple=jb,Ib.default=Tb,Object.defineProperty(Cb,"__esModule",{value:!0});const $b=Ib,Db={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,$b.validateTuple)(e,"items")};Cb.default=Db;var Bb={};Object.defineProperty(Bb,"__esModule",{value:!0});const Fb=qp,zb=Jp,Ub=lm,Lb=Sb,qb={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:e}})=>Fb.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>Fb._`{limit: ${e}}`},code(e){const{schema:t,parentSchema:r,it:n}=e,{prefixItems:i}=r;n.items=!0,(0,zb.alwaysValidSchema)(n,t)||(i?(0,Lb.validateAdditionalItems)(e,i):e.ok((0,Ub.validateArray)(e)))}};Bb.default=qb;var Hb={};Object.defineProperty(Hb,"__esModule",{value:!0});const Kb=qp,Jb=Jp,Wb={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:e,max:t}})=>void 0===t?Kb.str`must contain at least ${e} valid item(s)`:Kb.str`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>void 0===t?Kb._`{minContains: ${e}}`:Kb._`{minContains: ${e}, maxContains: ${t}}`},code(e){const{gen:t,schema:r,parentSchema:n,data:i,it:o}=e;let a,s;const{minContains:c,maxContains:u}=n;o.opts.next?(a=void 0===c?1:c,s=u):a=1;const f=t.const("len",Kb._`${i}.length`);if(e.setParams({min:a,max:s}),void 0===s&&0===a)return void(0,Jb.checkStrictMode)(o,'"minContains" == 0 without "maxContains": "contains" keyword ignored');if(void 0!==s&&a>s)return(0,Jb.checkStrictMode)(o,'"minContains" > "maxContains" is always invalid'),void e.fail();if((0,Jb.alwaysValidSchema)(o,r)){let t=Kb._`${f} >= ${a}`;return void 0!==s&&(t=Kb._`${t} && ${f} <= ${s}`),void e.pass(t)}o.items=!0;const d=t.name("valid");function l(){const e=t.name("_valid"),r=t.let("count",0);h(e,(()=>t.if(e,(()=>function(e){t.code(Kb._`${e}++`),void 0===s?t.if(Kb._`${e} >= ${a}`,(()=>t.assign(d,!0).break())):(t.if(Kb._`${e} > ${s}`,(()=>t.assign(d,!1).break())),1===a?t.assign(d,!0):t.if(Kb._`${e} >= ${a}`,(()=>t.assign(d,!0))))}(r)))))}function h(r,n){t.forRange("i",0,f,(t=>{e.subschema({keyword:"contains",dataProp:t,dataPropType:Jb.Type.Num,compositeRule:!0},r),n()}))}void 0===s&&1===a?h(d,(()=>t.if(d,(()=>t.break())))):0===a?(t.let(d,!0),void 0!==s&&t.if(Kb._`${i}.length > 0`,l)):(t.let(d,!1),l()),e.result(d,(()=>e.reset()))}};Hb.default=Wb;var Gb={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const t=qp,r=Jp,n=lm;e.error={message:({params:{property:e,depsCount:r,deps:n}})=>t.str`must have ${1===r?"property":"properties"} ${n} when property ${e} is present`,params:({params:{property:e,depsCount:r,deps:n,missingProperty:i}})=>t._`{property: ${e}, missingProperty: ${i}, depsCount: ${r}, - deps: ${n}}`};const i={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(e){const[t,r]=function({schema:e}){const t={},r={};for(const n in e){if("__proto__"===n)continue;(Array.isArray(e[n])?t:r)[n]=e[n]}return[t,r]}(e);o(e,t),a(e,r)}};function o(e,r=e.schema){const{gen:i,data:o,it:a}=e;if(0===Object.keys(r).length)return;const s=i.let("missing");for(const c in r){const u=r[c];if(0===u.length)continue;const f=(0,n.propertyInData)(i,o,c,a.opts.ownProperties);e.setParams({property:c,depsCount:u.length,deps:u.join(", ")}),a.allErrors?i.if(f,(()=>{for(const t of u)(0,n.checkReportMissingProp)(e,t)})):(i.if(t._`${f} && (${(0,n.checkMissingProp)(e,u,s)})`),(0,n.reportMissingProp)(e,s),i.else())}}function a(e,t=e.schema){const{gen:i,data:o,keyword:a,it:s}=e,c=i.name("valid");for(const u in t)(0,r.alwaysValidSchema)(s,t[u])||(i.if((0,n.propertyInData)(i,o,u,s.opts.ownProperties),(()=>{const t=e.subschema({keyword:a,schemaProp:u},c);e.mergeValidEvaluated(t,c)}),(()=>i.var(c,!0))),e.ok(c))}e.validatePropertyDeps=o,e.validateSchemaDeps=a,e.default=i}(Jb);var Wb={};Object.defineProperty(Wb,"__esModule",{value:!0});const Gb=Up,Vb=Hp,Zb={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:e})=>Gb._`{propertyName: ${e.propertyName}}`},code(e){const{gen:t,schema:r,data:n,it:i}=e;if((0,Vb.alwaysValidSchema)(i,r))return;const o=t.name("valid");t.forIn("key",n,(r=>{e.setParams({propertyName:r}),e.subschema({keyword:"propertyNames",data:r,dataTypes:["string"],propertyName:r,compositeRule:!0},o),t.if((0,Gb.not)(o),(()=>{e.error(!0),i.allErrors||t.break()}))})),e.ok(o)}};Wb.default=Zb;var Xb={};Object.defineProperty(Xb,"__esModule",{value:!0});const Qb=fm,Yb=Up,ev=Kp,tv=Hp,rv={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:e})=>Yb._`{additionalProperty: ${e.additionalProperty}}`},code(e){const{gen:t,schema:r,parentSchema:n,data:i,errsCount:o,it:a}=e;if(!o)throw new Error("ajv implementation error");const{allErrors:s,opts:c}=a;if(a.props=!0,"all"!==c.removeAdditional&&(0,tv.alwaysValidSchema)(a,r))return;const u=(0,Qb.allSchemaProperties)(n.properties),f=(0,Qb.allSchemaProperties)(n.patternProperties);function d(e){t.code(Yb._`delete ${i}[${e}]`)}function l(n){if("all"===c.removeAdditional||c.removeAdditional&&!1===r)d(n);else{if(!1===r)return e.setParams({additionalProperty:n}),e.error(),void(s||t.break());if("object"==typeof r&&!(0,tv.alwaysValidSchema)(a,r)){const r=t.name("valid");"failing"===c.removeAdditional?(h(n,r,!1),t.if((0,Yb.not)(r),(()=>{e.reset(),d(n)}))):(h(n,r),s||t.if((0,Yb.not)(r),(()=>t.break())))}}}function h(t,r,n){const i={keyword:"additionalProperties",dataProp:t,dataPropType:tv.Type.Str};!1===n&&Object.assign(i,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(i,r)}t.forIn("key",i,(r=>{u.length||f.length?t.if(function(r){let i;if(u.length>8){const e=(0,tv.schemaRefOrVal)(a,n.properties,"properties");i=(0,Qb.isOwnProperty)(t,e,r)}else i=u.length?(0,Yb.or)(...u.map((e=>Yb._`${r} === ${e}`))):Yb.nil;return f.length&&(i=(0,Yb.or)(i,...f.map((t=>Yb._`${(0,Qb.usePattern)(e,t)}.test(${r})`)))),(0,Yb.not)(i)}(r),(()=>l(r))):l(r)})),e.ok(Yb._`${o} === ${ev.default.errors}`)}};Xb.default=rv;var nv={};Object.defineProperty(nv,"__esModule",{value:!0});const iv=Bp,ov=fm,av=Hp,sv=Xb,cv={keyword:"properties",type:"object",schemaType:"object",code(e){const{gen:t,schema:r,parentSchema:n,data:i,it:o}=e;"all"===o.opts.removeAdditional&&void 0===n.additionalProperties&&sv.default.code(new iv.KeywordCxt(o,sv.default,"additionalProperties"));const a=(0,ov.allSchemaProperties)(r);for(const e of a)o.definedProperties.add(e);o.opts.unevaluated&&a.length&&!0!==o.props&&(o.props=av.mergeEvaluated.props(t,(0,av.toHash)(a),o.props));const s=a.filter((e=>!(0,av.alwaysValidSchema)(o,r[e])));if(0===s.length)return;const c=t.name("valid");for(const r of s)u(r)?f(r):(t.if((0,ov.propertyInData)(t,i,r,o.opts.ownProperties)),f(r),o.allErrors||t.else().var(c,!0),t.endIf()),e.it.definedProperties.add(r),e.ok(c);function u(e){return o.opts.useDefaults&&!o.compositeRule&&void 0!==r[e].default}function f(t){e.subschema({keyword:"properties",schemaProp:t,dataProp:t},c)}}};nv.default=cv;var uv={};Object.defineProperty(uv,"__esModule",{value:!0});const fv=fm,dv=Up,lv=Hp,hv=Hp,pv={keyword:"patternProperties",type:"object",schemaType:"object",code(e){const{gen:t,schema:r,data:n,parentSchema:i,it:o}=e,{opts:a}=o,s=(0,fv.allSchemaProperties)(r),c=s.filter((e=>(0,lv.alwaysValidSchema)(o,r[e])));if(0===s.length||c.length===s.length&&(!o.opts.unevaluated||!0===o.props))return;const u=a.strictSchema&&!a.allowMatchingProperties&&i.properties,f=t.name("valid");!0===o.props||o.props instanceof dv.Name||(o.props=(0,hv.evaluatedPropsToName)(t,o.props));const{props:d}=o;function l(e){for(const t in u)new RegExp(e).test(t)&&(0,lv.checkStrictMode)(o,`property ${t} matches pattern ${e} (use allowMatchingProperties)`)}function h(r){t.forIn("key",n,(n=>{t.if(dv._`${(0,fv.usePattern)(e,r)}.test(${n})`,(()=>{const i=c.includes(r);i||e.subschema({keyword:"patternProperties",schemaProp:r,dataProp:n,dataPropType:hv.Type.Str},f),o.opts.unevaluated&&!0!==d?t.assign(dv._`${d}[${n}]`,!0):i||o.allErrors||t.if((0,dv.not)(f),(()=>t.break()))}))}))}!function(){for(const e of s)u&&l(e),o.allErrors?h(e):(t.var(f,!0),h(e),t.if(f))}()}};uv.default=pv;var mv={};Object.defineProperty(mv,"__esModule",{value:!0});const gv=Hp,yv={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){const{gen:t,schema:r,it:n}=e;if((0,gv.alwaysValidSchema)(n,r))return void e.fail();const i=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},i),e.failResult(i,(()=>e.reset()),(()=>e.error()))},error:{message:"must NOT be valid"}};mv.default=yv;var bv={};Object.defineProperty(bv,"__esModule",{value:!0});const vv={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:fm.validateUnion,error:{message:"must match a schema in anyOf"}};bv.default=vv;var wv={};Object.defineProperty(wv,"__esModule",{value:!0});const Av=Up,_v=Hp,Ev={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:e})=>Av._`{passingSchemas: ${e.passing}}`},code(e){const{gen:t,schema:r,parentSchema:n,it:i}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(i.opts.discriminator&&n.discriminator)return;const o=r,a=t.let("valid",!1),s=t.let("passing",null),c=t.name("_valid");e.setParams({passing:s}),t.block((function(){o.forEach(((r,n)=>{let o;(0,_v.alwaysValidSchema)(i,r)?t.var(c,!0):o=e.subschema({keyword:"oneOf",schemaProp:n,compositeRule:!0},c),n>0&&t.if(Av._`${c} && ${a}`).assign(a,!1).assign(s,Av._`[${s}, ${n}]`).else(),t.if(c,(()=>{t.assign(a,!0),t.assign(s,n),o&&e.mergeEvaluated(o,Av.Name)}))}))})),e.result(a,(()=>e.reset()),(()=>e.error(!0)))}};wv.default=Ev;var Sv={};Object.defineProperty(Sv,"__esModule",{value:!0});const Pv=Hp,xv={keyword:"allOf",schemaType:"array",code(e){const{gen:t,schema:r,it:n}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");const i=t.name("valid");r.forEach(((t,r)=>{if((0,Pv.alwaysValidSchema)(n,t))return;const o=e.subschema({keyword:"allOf",schemaProp:r},i);e.ok(i),e.mergeEvaluated(o)}))}};Sv.default=xv;var kv={};Object.defineProperty(kv,"__esModule",{value:!0});const Mv=Up,Cv=Hp,Iv={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:e})=>Mv.str`must match "${e.ifClause}" schema`,params:({params:e})=>Mv._`{failingKeyword: ${e.ifClause}}`},code(e){const{gen:t,parentSchema:r,it:n}=e;void 0===r.then&&void 0===r.else&&(0,Cv.checkStrictMode)(n,'"if" without "then" and "else" is ignored');const i=Rv(n,"then"),o=Rv(n,"else");if(!i&&!o)return;const a=t.let("valid",!0),s=t.name("_valid");if(function(){const t=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},s);e.mergeEvaluated(t)}(),e.reset(),i&&o){const r=t.let("ifClause");e.setParams({ifClause:r}),t.if(s,c("then",r),c("else",r))}else i?t.if(s,c("then")):t.if((0,Mv.not)(s),c("else"));function c(r,n){return()=>{const i=e.subschema({keyword:r},s);t.assign(a,s),e.mergeValidEvaluated(i,a),n?t.assign(n,Mv._`${r}`):e.setParams({ifClause:r})}}e.pass(a,(()=>e.error(!0)))}};function Rv(e,t){const r=e.schema[t];return void 0!==r&&!(0,Cv.alwaysValidSchema)(e,r)}kv.default=Iv;var Nv={};Object.defineProperty(Nv,"__esModule",{value:!0});const Ov=Hp,Tv={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){void 0===t.if&&(0,Ov.checkStrictMode)(r,`"${e}" without "if" is ignored`)}};Nv.default=Tv,Object.defineProperty(Ab,"__esModule",{value:!0});const jv=_b,$v=kb,Dv=Mb,Bv=$b,Fv=Lb,zv=Jb,Uv=Wb,Lv=Xb,qv=nv,Hv=uv,Kv=mv,Jv=bv,Wv=wv,Gv=Sv,Vv=kv,Zv=Nv;Ab.default=function(e=!1){const t=[Kv.default,Jv.default,Wv.default,Gv.default,Vv.default,Zv.default,Uv.default,Lv.default,zv.default,qv.default,Hv.default];return e?t.push($v.default,Bv.default):t.push(jv.default,Dv.default),t.push(Fv.default),t};var Xv={},Qv={};Object.defineProperty(Qv,"__esModule",{value:!0});const Yv=Up,ew={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>Yv.str`must match format "${e}"`,params:({schemaCode:e})=>Yv._`{format: ${e}}`},code(e,t){const{gen:r,data:n,$data:i,schema:o,schemaCode:a,it:s}=e,{opts:c,errSchemaPath:u,schemaEnv:f,self:d}=s;c.validateFormats&&(i?function(){const i=r.scopeValue("formats",{ref:d.formats,code:c.code.formats}),o=r.const("fDef",Yv._`${i}[${a}]`),s=r.let("fType"),u=r.let("format");r.if(Yv._`typeof ${o} == "object" && !(${o} instanceof RegExp)`,(()=>r.assign(s,Yv._`${o}.type || "string"`).assign(u,Yv._`${o}.validate`)),(()=>r.assign(s,Yv._`"string"`).assign(u,o))),e.fail$data((0,Yv.or)(!1===c.strictSchema?Yv.nil:Yv._`${a} && !${u}`,function(){const e=f.$async?Yv._`(${o}.async ? await ${u}(${n}) : ${u}(${n}))`:Yv._`${u}(${n})`,r=Yv._`(typeof ${u} == "function" ? ${e} : ${u}.test(${n}))`;return Yv._`${u} && ${u} !== true && ${s} === ${t} && !${r}`}()))}():function(){const i=d.formats[o];if(!i)return void function(){if(!1===c.strictSchema)return void d.logger.warn(e());throw new Error(e());function e(){return`unknown format "${o}" ignored in schema at path "${u}"`}}();if(!0===i)return;const[a,s,l]=function(e){const t=e instanceof RegExp?(0,Yv.regexpCode)(e):c.code.formats?Yv._`${c.code.formats}${(0,Yv.getProperty)(o)}`:void 0,n=r.scopeValue("formats",{key:o,ref:e,code:t});if("object"==typeof e&&!(e instanceof RegExp))return[e.type||"string",e.validate,Yv._`${n}.validate`];return["string",e,n]}(i);a===t&&e.pass(function(){if("object"==typeof i&&!(i instanceof RegExp)&&i.async){if(!f.$async)throw new Error("async format in sync schema");return Yv._`await ${l}(${n})`}return"function"==typeof s?Yv._`${l}(${n})`:Yv._`${l}.test(${n})`}())}())}};Qv.default=ew,Object.defineProperty(Xv,"__esModule",{value:!0});const tw=[Qv.default];Xv.default=tw,Object.defineProperty(Gg,"__esModule",{value:!0});const rw=sy,nw=Ab,iw=Xv,ow=[Vg.default,rw.default,nw.default(),iw.default,["title","description","default"]];Gg.default=ow;var aw,sw,cw={},uw={};aw=uw,Object.defineProperty(aw,"__esModule",{value:!0}),aw.DiscrError=void 0,(sw=aw.DiscrError||(aw.DiscrError={})).Tag="tag",sw.Mapping="mapping",Object.defineProperty(cw,"__esModule",{value:!0});const fw=Up,dw=uw,lw=Mg,hw=Hp,pw={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:e,tagName:t}})=>e===dw.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>fw._`{error: ${e}, tag: ${r}, tagValue: ${t}}`},code(e){const{gen:t,data:r,schema:n,parentSchema:i,it:o}=e,{oneOf:a}=i;if(!o.opts.discriminator)throw new Error("discriminator: requires discriminator option");const s=n.propertyName;if("string"!=typeof s)throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!a)throw new Error("discriminator: requires oneOf keyword");const c=t.let("valid",!1),u=t.const("tag",fw._`${r}${(0,fw.getProperty)(s)}`);function f(r){const n=t.name("valid"),i=e.subschema({keyword:"oneOf",schemaProp:r},n);return e.mergeEvaluated(i,fw.Name),n}t.if(fw._`typeof ${u} == "string"`,(()=>function(){const r=function(){var e;const t={},r=c(i);let n=!0;for(let t=0;te.error(!1,{discrError:dw.DiscrError.Tag,tag:u,tagName:s}))),e.ok(c)}};cw.default=pw;var mw={id:"http://json-schema.org/draft-04/schema#",$schema:"http://json-schema.org/draft-04/schema#",description:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},positiveInteger:{type:"integer",minimum:0},positiveIntegerDefault0:{allOf:[{$ref:"#/definitions/positiveInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},minItems:1,uniqueItems:!0}},type:"object",properties:{id:{type:"string",format:"uri"},$schema:{type:"string",format:"uri"},title:{type:"string"},description:{type:"string"},default:{},multipleOf:{type:"number",minimum:0,exclusiveMinimum:!0},maximum:{type:"number"},exclusiveMaximum:{type:"boolean",default:!1},minimum:{type:"number"},exclusiveMinimum:{type:"boolean",default:!1},maxLength:{$ref:"#/definitions/positiveInteger"},minLength:{$ref:"#/definitions/positiveIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{anyOf:[{type:"boolean"},{$ref:"#"}],default:{}},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:{}},maxItems:{$ref:"#/definitions/positiveInteger"},minItems:{$ref:"#/definitions/positiveIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxProperties:{$ref:"#/definitions/positiveInteger"},minProperties:{$ref:"#/definitions/positiveIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{anyOf:[{type:"boolean"},{$ref:"#"}],default:{}},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},enum:{type:"array",minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},dependencies:{exclusiveMaximum:["maximum"],exclusiveMinimum:["minimum"]},default:{}};!function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;const r=Dp,n=Gg,i=cw,o=mw,a=["/properties"],s="http://json-schema.org/draft-04/schema";class c extends r.default{constructor(e={}){super({...e,schemaId:"id"})}_addVocabularies(){super._addVocabularies(),n.default.forEach((e=>this.addVocabulary(e))),this.opts.discriminator&&this.addKeyword(i.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const e=this.opts.$data?this.$dataMetaSchema(o,a):o;this.addMetaSchema(e,s,!1),this.refs["http://json-schema.org/schema"]=s}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(s)?s:void 0)}}e.exports=t=c,Object.defineProperty(t,"__esModule",{value:!0}),t.default=c;var u=Dp;Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return u.KeywordCxt}});var f=Dp;Object.defineProperty(t,"_",{enumerable:!0,get:function(){return f._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return f.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return f.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return f.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return f.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return f.CodeGen}})}($p,$p.exports);var gw=s($p.exports),yw={exports:{}},bw={};!function(e){function t(e,t){return{validate:e,compare:t}}Object.defineProperty(e,"__esModule",{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0,e.fullFormats={date:t(i,o),time:t(s,c),"date-time":t((function(e){const t=e.split(u);return 2===t.length&&i(t[0])&&s(t[1],!0)}),f),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:function(e){return d.test(e)&&l.test(e)},"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4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9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:function(e){if(y.test(e))return!1;try{return new RegExp(e),!0}catch(e){return!1}},uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:function(e){return h.lastIndex=0,h.test(e)},int32:{type:"number",validate:function(e){return Number.isInteger(e)&&e<=m&&e>=p}},int64:{type:"number",validate:function(e){return Number.isInteger(e)}},float:{type:"number",validate:g},double:{type:"number",validate:g},password:!0,binary:!0},e.fastFormats={...e.fullFormats,date:t(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,o),time:t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,c),"date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,f),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},e.formatNames=Object.keys(e.fullFormats);const r=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,n=[0,31,28,31,30,31,30,31,31,30,31,30,31];function i(e){const t=r.exec(e);if(!t)return!1;const i=+t[1],o=+t[2],a=+t[3];return o>=1&&o<=12&&a>=1&&a<=(2===o&&function(e){return e%4==0&&(e%100!=0||e%400==0)}(i)?29:n[o])}function o(e,t){if(e&&t)return e>t?1:e(t=n[1]+n[2]+n[3]+(n[4]||""))?1:e=",ok:Iw.GTE,fail:Iw.LT},exclusiveMaximum:{okStr:"<",ok:Iw.LT,fail:Iw.GTE},exclusiveMinimum:{okStr:">",ok:Iw.GT,fail:Iw.LTE}},Nw={message:({keyword:e,schemaCode:t})=>Cw.str`must be ${Rw[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>Cw._`{comparison: ${Rw[e].okStr}, limit: ${t}}`},Ow={keyword:Object.keys(Rw),type:"number",schemaType:"number",$data:!0,error:Nw,code(e){const{keyword:t,data:r,schemaCode:n}=e;e.fail$data(Cw._`${r} ${Rw[t].fail} ${n} || isNaN(${r})`)}};Mw.default=Ow,Object.defineProperty(kw,"__esModule",{value:!0});const Tw=by,jw=Ay,$w=Cy,Dw=Oy,Bw=Dy,Fw=Ly,zw=Jy,Uw=eb,Lw=ob,qw=[Mw.default,Tw.default,jw.default,$w.default,Dw.default,Bw.default,Fw.default,zw.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},Uw.default,Lw.default];kw.default=qw;var Hw={};Object.defineProperty(Hw,"__esModule",{value:!0}),Hw.contentVocabulary=Hw.metadataVocabulary=void 0,Hw.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],Hw.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"],Object.defineProperty(Aw,"__esModule",{value:!0});const Kw=kw,Jw=Ab,Ww=Xv,Gw=Hw,Vw=[_w.default,Kw.default,(0,Jw.default)(),Ww.default,Gw.metadataVocabulary,Gw.contentVocabulary];Aw.default=Vw;var Zw={$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:!0,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:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},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:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},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:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},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:!0};!function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;const r=Dp,n=Aw,i=cw,o=Zw,a=["/properties"],s="http://json-schema.org/draft-07/schema";class c extends r.default{_addVocabularies(){super._addVocabularies(),n.default.forEach((e=>this.addVocabulary(e))),this.opts.discriminator&&this.addKeyword(i.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const e=this.opts.$data?this.$dataMetaSchema(o,a):o;this.addMetaSchema(e,s,!1),this.refs["http://json-schema.org/schema"]=s}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(s)?s:void 0)}}e.exports=t=c,Object.defineProperty(t,"__esModule",{value:!0}),t.default=c;var u=Bp;Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return u.KeywordCxt}});var f=Up;Object.defineProperty(t,"_",{enumerable:!0,get:function(){return f._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return f.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return f.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return f.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return f.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return f.CodeGen}});var d=Eg;Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return d.default}});var l=Pg;Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return l.default}})}(ww,ww.exports);var Xw=ww.exports;!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;const t=Xw,r=Up,n=r.operators,i={formatMaximum:{okStr:"<=",ok:n.LTE,fail:n.GT},formatMinimum:{okStr:">=",ok:n.GTE,fail:n.LT},formatExclusiveMaximum:{okStr:"<",ok:n.LT,fail:n.GTE},formatExclusiveMinimum:{okStr:">",ok:n.GT,fail:n.LTE}},o={message:({keyword:e,schemaCode:t})=>r.str`should be ${i[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>r._`{comparison: ${i[e].okStr}, limit: ${t}}`};e.formatLimitDefinition={keyword:Object.keys(i),type:"string",schemaType:"string",$data:!0,error:o,code(e){const{gen:n,data:o,schemaCode:a,keyword:s,it:c}=e,{opts:u,self:f}=c;if(!u.validateFormats)return;const d=new t.KeywordCxt(c,f.RULES.all.format.definition,"format");function l(e){return r._`${e}.compare(${o}, ${a}) ${i[s].fail} 0`}d.$data?function(){const t=n.scopeValue("formats",{ref:f.formats,code:u.code.formats}),i=n.const("fmt",r._`${t}[${d.schemaCode}]`);e.fail$data(r.or(r._`typeof ${i} != "object"`,r._`${i} instanceof RegExp`,r._`typeof ${i}.compare != "function"`,l(i)))}():function(){const t=d.schema,i=f.formats[t];if(!i||!0===i)return;if("object"!=typeof i||i instanceof RegExp||"function"!=typeof i.compare)throw new Error(`"${s}": format "${t}" does not define "compare" function`);const o=n.scopeValue("formats",{key:t,ref:i,code:u.code.formats?r._`${u.code.formats}${r.getProperty(t)}`:void 0});e.fail$data(l(o))}()},dependencies:["format"]};e.default=t=>(t.addKeyword(e.formatLimitDefinition),t)}(vw),function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=bw,n=vw,i=Up,o=new i.Name("fullFormats"),a=new i.Name("fastFormats"),s=(e,t={keywords:!0})=>{if(Array.isArray(t))return c(e,t,r.fullFormats,o),e;const[i,s]="fast"===t.mode?[r.fastFormats,a]:[r.fullFormats,o];return c(e,t.formats||r.formatNames,i,s),t.keywords&&n.default(e),e};function c(e,t,r,n){var o,a;null!==(o=(a=e.opts.code).formats)&&void 0!==o||(a.formats=i._`require("ajv-formats/dist/formats").${n}`);for(const n of t)e.addFormat(n,r[n])}s.get=(e,t="full")=>{const n=("fast"===t?r.fastFormats:r.fullFormats)[e];if(!n)throw new Error(`Unknown format "${e}"`);return n},e.exports=t=s,Object.defineProperty(t,"__esModule",{value:!0}),t.default=s}(yw,yw.exports);var Qw=s(yw.exports),Yw={exports:{}};!function(e,t){(function(){var r,n="Expected a function",i="__lodash_hash_undefined__",o="__lodash_placeholder__",s=16,c=32,u=64,f=128,d=256,l=1/0,h=9007199254740991,p=NaN,m=4294967295,g=[["ary",f],["bind",1],["bindKey",2],["curry",8],["curryRight",s],["flip",512],["partial",c],["partialRight",u],["rearg",d]],y="[object Arguments]",b="[object Array]",v="[object Boolean]",w="[object Date]",A="[object Error]",_="[object Function]",E="[object GeneratorFunction]",S="[object Map]",P="[object Number]",x="[object Object]",k="[object Promise]",M="[object RegExp]",C="[object Set]",I="[object String]",R="[object Symbol]",N="[object WeakMap]",O="[object ArrayBuffer]",T="[object DataView]",j="[object Float32Array]",$="[object Float64Array]",D="[object Int8Array]",B="[object Int16Array]",F="[object Int32Array]",z="[object Uint8Array]",U="[object Uint8ClampedArray]",L="[object Uint16Array]",q="[object Uint32Array]",H=/\b__p \+= '';/g,K=/\b(__p \+=) '' \+/g,J=/(__e\(.*?\)|\b__t\)) \+\n'';/g,W=/&(?:amp|lt|gt|quot|#39);/g,G=/[&<>"']/g,V=RegExp(W.source),Z=RegExp(G.source),X=/<%-([\s\S]+?)%>/g,Q=/<%([\s\S]+?)%>/g,Y=/<%=([\s\S]+?)%>/g,ee=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,te=/^\w*$/,re=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ne=/[\\^$.*+?()[\]{}|]/g,ie=RegExp(ne.source),oe=/^\s+/,ae=/\s/,se=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ce=/\{\n\/\* \[wrapped with (.+)\] \*/,ue=/,? & /,fe=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,de=/[()=,{}\[\]\/\s]/,le=/\\(\\)?/g,he=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,pe=/\w*$/,me=/^[-+]0x[0-9a-f]+$/i,ge=/^0b[01]+$/i,ye=/^\[object .+?Constructor\]$/,be=/^0o[0-7]+$/i,ve=/^(?:0|[1-9]\d*)$/,we=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Ae=/($^)/,_e=/['\n\r\u2028\u2029\\]/g,Ee="\\ud800-\\udfff",Se="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Pe="\\u2700-\\u27bf",xe="a-z\\xdf-\\xf6\\xf8-\\xff",ke="A-Z\\xc0-\\xd6\\xd8-\\xde",Me="\\ufe0e\\ufe0f",Ce="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ie="['’]",Re="["+Ee+"]",Ne="["+Ce+"]",Oe="["+Se+"]",Te="\\d+",je="["+Pe+"]",$e="["+xe+"]",De="[^"+Ee+Ce+Te+Pe+xe+ke+"]",Be="\\ud83c[\\udffb-\\udfff]",Fe="[^"+Ee+"]",ze="(?:\\ud83c[\\udde6-\\uddff]){2}",Ue="[\\ud800-\\udbff][\\udc00-\\udfff]",Le="["+ke+"]",qe="\\u200d",He="(?:"+$e+"|"+De+")",Ke="(?:"+Le+"|"+De+")",Je="(?:['’](?:d|ll|m|re|s|t|ve))?",We="(?:['’](?:D|LL|M|RE|S|T|VE))?",Ge="(?:"+Oe+"|"+Be+")"+"?",Ve="["+Me+"]?",Ze=Ve+Ge+("(?:"+qe+"(?:"+[Fe,ze,Ue].join("|")+")"+Ve+Ge+")*"),Xe="(?:"+[je,ze,Ue].join("|")+")"+Ze,Qe="(?:"+[Fe+Oe+"?",Oe,ze,Ue,Re].join("|")+")",Ye=RegExp(Ie,"g"),et=RegExp(Oe,"g"),tt=RegExp(Be+"(?="+Be+")|"+Qe+Ze,"g"),rt=RegExp([Le+"?"+$e+"+"+Je+"(?="+[Ne,Le,"$"].join("|")+")",Ke+"+"+We+"(?="+[Ne,Le+He,"$"].join("|")+")",Le+"?"+He+"+"+Je,Le+"+"+We,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Te,Xe].join("|"),"g"),nt=RegExp("["+qe+Ee+Se+Me+"]"),it=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ot=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],at=-1,st={};st[j]=st[$]=st[D]=st[B]=st[F]=st[z]=st[U]=st[L]=st[q]=!0,st[y]=st[b]=st[O]=st[v]=st[T]=st[w]=st[A]=st[_]=st[S]=st[P]=st[x]=st[M]=st[C]=st[I]=st[N]=!1;var ct={};ct[y]=ct[b]=ct[O]=ct[T]=ct[v]=ct[w]=ct[j]=ct[$]=ct[D]=ct[B]=ct[F]=ct[S]=ct[P]=ct[x]=ct[M]=ct[C]=ct[I]=ct[R]=ct[z]=ct[U]=ct[L]=ct[q]=!0,ct[A]=ct[_]=ct[N]=!1;var ut={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ft=parseFloat,dt=parseInt,lt="object"==typeof a&&a&&a.Object===Object&&a,ht="object"==typeof self&&self&&self.Object===Object&&self,pt=lt||ht||Function("return this")(),mt=t&&!t.nodeType&&t,gt=mt&&e&&!e.nodeType&&e,yt=gt&>.exports===mt,bt=yt&<.process,vt=function(){try{var e=gt&>.require&>.require("util").types;return e||bt&&bt.binding&&bt.binding("util")}catch(e){}}(),wt=vt&&vt.isArrayBuffer,At=vt&&vt.isDate,_t=vt&&vt.isMap,Et=vt&&vt.isRegExp,St=vt&&vt.isSet,Pt=vt&&vt.isTypedArray;function xt(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}function kt(e,t,r,n){for(var i=-1,o=null==e?0:e.length;++i-1}function Ot(e,t,r){for(var n=-1,i=null==e?0:e.length;++n-1;);return r}function rr(e,t){for(var r=e.length;r--&&Lt(t,e[r],0)>-1;);return r}var nr=Wt({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),ir=Wt({"&":"&","<":"<",">":">",'"':""","'":"'"});function or(e){return"\\"+ut[e]}function ar(e){return nt.test(e)}function sr(e){var t=-1,r=Array(e.size);return e.forEach((function(e,n){r[++t]=[n,e]})),r}function cr(e,t){return function(r){return e(t(r))}}function ur(e,t){for(var r=-1,n=e.length,i=0,a=[];++r",""":'"',"'":"'"});var gr=function e(t){var a,ae=(t=null==t?pt:gr.defaults(pt.Object(),t,gr.pick(pt,ot))).Array,Ee=t.Date,Se=t.Error,Pe=t.Function,xe=t.Math,ke=t.Object,Me=t.RegExp,Ce=t.String,Ie=t.TypeError,Re=ae.prototype,Ne=Pe.prototype,Oe=ke.prototype,Te=t["__core-js_shared__"],je=Ne.toString,$e=Oe.hasOwnProperty,De=0,Be=(a=/[^.]+$/.exec(Te&&Te.keys&&Te.keys.IE_PROTO||""))?"Symbol(src)_1."+a:"",Fe=Oe.toString,ze=je.call(ke),Ue=pt._,Le=Me("^"+je.call($e).replace(ne,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),qe=yt?t.Buffer:r,He=t.Symbol,Ke=t.Uint8Array,Je=qe?qe.allocUnsafe:r,We=cr(ke.getPrototypeOf,ke),Ge=ke.create,Ve=Oe.propertyIsEnumerable,Ze=Re.splice,Xe=He?He.isConcatSpreadable:r,Qe=He?He.iterator:r,tt=He?He.toStringTag:r,nt=function(){try{var e=ho(ke,"defineProperty");return e({},"",{}),e}catch(e){}}(),ut=t.clearTimeout!==pt.clearTimeout&&t.clearTimeout,lt=Ee&&Ee.now!==pt.Date.now&&Ee.now,ht=t.setTimeout!==pt.setTimeout&&t.setTimeout,mt=xe.ceil,gt=xe.floor,bt=ke.getOwnPropertySymbols,vt=qe?qe.isBuffer:r,Ft=t.isFinite,Wt=Re.join,yr=cr(ke.keys,ke),br=xe.max,vr=xe.min,wr=Ee.now,Ar=t.parseInt,_r=xe.random,Er=Re.reverse,Sr=ho(t,"DataView"),Pr=ho(t,"Map"),xr=ho(t,"Promise"),kr=ho(t,"Set"),Mr=ho(t,"WeakMap"),Cr=ho(ke,"create"),Ir=Mr&&new Mr,Rr={},Nr=Fo(Sr),Or=Fo(Pr),Tr=Fo(xr),jr=Fo(kr),$r=Fo(Mr),Dr=He?He.prototype:r,Br=Dr?Dr.valueOf:r,Fr=Dr?Dr.toString:r;function zr(e){if(rs(e)&&!Ka(e)&&!(e instanceof Hr)){if(e instanceof qr)return e;if($e.call(e,"__wrapped__"))return zo(e)}return new qr(e)}var Ur=function(){function e(){}return function(t){if(!ts(t))return{};if(Ge)return Ge(t);e.prototype=t;var n=new e;return e.prototype=r,n}}();function Lr(){}function qr(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=r}function Hr(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=m,this.__views__=[]}function Kr(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t=t?e:t)),e}function un(e,t,n,i,o,a){var s,c=1&t,u=2&t,f=4&t;if(n&&(s=o?n(e,i,o,a):n(e)),s!==r)return s;if(!ts(e))return e;var d=Ka(e);if(d){if(s=function(e){var t=e.length,r=new e.constructor(t);t&&"string"==typeof e[0]&&$e.call(e,"index")&&(r.index=e.index,r.input=e.input);return r}(e),!c)return Ii(e,s)}else{var l=go(e),h=l==_||l==E;if(Va(e))return Si(e,c);if(l==x||l==y||h&&!o){if(s=u||h?{}:bo(e),!c)return u?function(e,t){return Ri(e,mo(e),t)}(e,function(e,t){return e&&Ri(t,Os(t),e)}(s,e)):function(e,t){return Ri(e,po(e),t)}(e,on(s,e))}else{if(!ct[l])return o?e:{};s=function(e,t,r){var n=e.constructor;switch(t){case O:return Pi(e);case v:case w:return new n(+e);case T:return function(e,t){var r=t?Pi(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}(e,r);case j:case $:case D:case B:case F:case z:case U:case L:case q:return xi(e,r);case S:return new n;case P:case I:return new n(e);case M:return function(e){var t=new e.constructor(e.source,pe.exec(e));return t.lastIndex=e.lastIndex,t}(e);case C:return new n;case R:return i=e,Br?ke(Br.call(i)):{}}var i}(e,l,c)}}a||(a=new Vr);var p=a.get(e);if(p)return p;a.set(e,s),ss(e)?e.forEach((function(r){s.add(un(r,t,n,r,e,a))})):ns(e)&&e.forEach((function(r,i){s.set(i,un(r,t,n,i,e,a))}));var m=d?r:(f?u?oo:io:u?Os:Ns)(e);return Mt(m||e,(function(r,i){m&&(r=e[i=r]),tn(s,i,un(r,t,n,i,e,a))})),s}function fn(e,t,n){var i=n.length;if(null==e)return!i;for(e=ke(e);i--;){var o=n[i],a=t[o],s=e[o];if(s===r&&!(o in e)||!a(s))return!1}return!0}function dn(e,t,i){if("function"!=typeof e)throw new Ie(n);return No((function(){e.apply(r,i)}),t)}function ln(e,t,r,n){var i=-1,o=Nt,a=!0,s=e.length,c=[],u=t.length;if(!s)return c;r&&(t=Tt(t,Qt(r))),n?(o=Ot,a=!1):t.length>=200&&(o=er,a=!1,t=new Gr(t));e:for(;++i-1},Jr.prototype.set=function(e,t){var r=this.__data__,n=rn(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this},Wr.prototype.clear=function(){this.size=0,this.__data__={hash:new Kr,map:new(Pr||Jr),string:new Kr}},Wr.prototype.delete=function(e){var t=fo(this,e).delete(e);return this.size-=t?1:0,t},Wr.prototype.get=function(e){return fo(this,e).get(e)},Wr.prototype.has=function(e){return fo(this,e).has(e)},Wr.prototype.set=function(e,t){var r=fo(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this},Gr.prototype.add=Gr.prototype.push=function(e){return this.__data__.set(e,i),this},Gr.prototype.has=function(e){return this.__data__.has(e)},Vr.prototype.clear=function(){this.__data__=new Jr,this.size=0},Vr.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},Vr.prototype.get=function(e){return this.__data__.get(e)},Vr.prototype.has=function(e){return this.__data__.has(e)},Vr.prototype.set=function(e,t){var r=this.__data__;if(r instanceof Jr){var n=r.__data__;if(!Pr||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new Wr(n)}return r.set(e,t),this.size=r.size,this};var hn=Ti(An),pn=Ti(_n,!0);function mn(e,t){var r=!0;return hn(e,(function(e,n,i){return r=!!t(e,n,i)})),r}function gn(e,t,n){for(var i=-1,o=e.length;++i0&&r(s)?t>1?bn(s,t-1,r,n,i):jt(i,s):n||(i[i.length]=s)}return i}var vn=ji(),wn=ji(!0);function An(e,t){return e&&vn(e,t,Ns)}function _n(e,t){return e&&wn(e,t,Ns)}function En(e,t){return Rt(t,(function(t){return Qa(e[t])}))}function Sn(e,t){for(var n=0,i=(t=wi(t,e)).length;null!=e&&nt}function Mn(e,t){return null!=e&&$e.call(e,t)}function Cn(e,t){return null!=e&&t in ke(e)}function In(e,t,n){for(var i=n?Ot:Nt,o=e[0].length,a=e.length,s=a,c=ae(a),u=1/0,f=[];s--;){var d=e[s];s&&t&&(d=Tt(d,Qt(t))),u=vr(d.length,u),c[s]=!n&&(t||o>=120&&d.length>=120)?new Gr(s&&d):r}d=e[0];var l=-1,h=c[0];e:for(;++l=s?c:c*("desc"==r[n]?-1:1)}return e.index-t.index}(e,t,r)}))}function Jn(e,t,r){for(var n=-1,i=t.length,o={};++n-1;)s!==e&&Ze.call(s,c,1),Ze.call(e,c,1);return e}function Gn(e,t){for(var r=e?t.length:0,n=r-1;r--;){var i=t[r];if(r==n||i!==o){var o=i;wo(i)?Ze.call(e,i,1):li(e,i)}}return e}function Vn(e,t){return e+gt(_r()*(t-e+1))}function Zn(e,t){var r="";if(!e||t<1||t>h)return r;do{t%2&&(r+=e),(t=gt(t/2))&&(e+=e)}while(t);return r}function Xn(e,t){return Oo(Mo(e,t,ic),e+"")}function Qn(e){return Xr(Us(e))}function Yn(e,t){var r=Us(e);return $o(r,cn(t,0,r.length))}function ei(e,t,n,i){if(!ts(e))return e;for(var o=-1,a=(t=wi(t,e)).length,s=a-1,c=e;null!=c&&++oi?0:i+t),(r=r>i?i:r)<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var o=ae(i);++n>>1,a=e[o];null!==a&&!us(a)&&(r?a<=t:a=200){var u=t?null:Zi(e);if(u)return fr(u);a=!1,i=er,c=new Gr}else c=t?[]:s;e:for(;++n=i?e:ii(e,t,n)}var Ei=ut||function(e){return pt.clearTimeout(e)};function Si(e,t){if(t)return e.slice();var r=e.length,n=Je?Je(r):new e.constructor(r);return e.copy(n),n}function Pi(e){var t=new e.constructor(e.byteLength);return new Ke(t).set(new Ke(e)),t}function xi(e,t){var r=t?Pi(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function ki(e,t){if(e!==t){var n=e!==r,i=null===e,o=e==e,a=us(e),s=t!==r,c=null===t,u=t==t,f=us(t);if(!c&&!f&&!a&&e>t||a&&s&&u&&!c&&!f||i&&s&&u||!n&&u||!o)return 1;if(!i&&!a&&!f&&e1?n[o-1]:r,s=o>2?n[2]:r;for(a=e.length>3&&"function"==typeof a?(o--,a):r,s&&Ao(n[0],n[1],s)&&(a=o<3?r:a,o=1),t=ke(t);++i-1?o[a?t[s]:s]:r}}function zi(e){return no((function(t){var i=t.length,o=i,a=qr.prototype.thru;for(e&&t.reverse();o--;){var s=t[o];if("function"!=typeof s)throw new Ie(n);if(a&&!c&&"wrapper"==so(s))var c=new qr([],!0)}for(o=c?o:i;++o1&&v.reverse(),l&&uc))return!1;var f=a.get(e),d=a.get(t);if(f&&d)return f==t&&d==e;var l=-1,h=!0,p=2&n?new Gr:r;for(a.set(e,t),a.set(t,e);++l-1&&e%1==0&&e1?"& ":"")+t[n],t=t.join(r>2?", ":" "),e.replace(se,"{\n/* [wrapped with "+t+"] */\n")}(n,function(e,t){return Mt(g,(function(r){var n="_."+r[0];t&r[1]&&!Nt(e,n)&&e.push(n)})),e.sort()}(function(e){var t=e.match(ce);return t?t[1].split(ue):[]}(n),r)))}function jo(e){var t=0,n=0;return function(){var i=wr(),o=16-(i-n);if(n=i,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(r,arguments)}}function $o(e,t){var n=-1,i=e.length,o=i-1;for(t=t===r?i:t;++n1?e[t-1]:r;return n="function"==typeof n?(e.pop(),n):r,aa(e,n)}));function ha(e){var t=zr(e);return t.__chain__=!0,t}function pa(e,t){return t(e)}var ma=no((function(e){var t=e.length,n=t?e[0]:0,i=this.__wrapped__,o=function(t){return sn(t,e)};return!(t>1||this.__actions__.length)&&i instanceof Hr&&wo(n)?((i=i.slice(n,+n+(t?1:0))).__actions__.push({func:pa,args:[o],thisArg:r}),new qr(i,this.__chain__).thru((function(e){return t&&!e.length&&e.push(r),e}))):this.thru(o)}));var ga=Ni((function(e,t,r){$e.call(e,r)?++e[r]:an(e,r,1)}));var ya=Fi(Ho),ba=Fi(Ko);function va(e,t){return(Ka(e)?Mt:hn)(e,uo(t,3))}function wa(e,t){return(Ka(e)?Ct:pn)(e,uo(t,3))}var Aa=Ni((function(e,t,r){$e.call(e,r)?e[r].push(t):an(e,r,[t])}));var _a=Xn((function(e,t,r){var n=-1,i="function"==typeof t,o=Wa(e)?ae(e.length):[];return hn(e,(function(e){o[++n]=i?xt(t,e,r):Rn(e,t,r)})),o})),Ea=Ni((function(e,t,r){an(e,r,t)}));function Sa(e,t){return(Ka(e)?Tt:zn)(e,uo(t,3))}var Pa=Ni((function(e,t,r){e[r?0:1].push(t)}),(function(){return[[],[]]}));var xa=Xn((function(e,t){if(null==e)return[];var r=t.length;return r>1&&Ao(e,t[0],t[1])?t=[]:r>2&&Ao(t[0],t[1],t[2])&&(t=[t[0]]),Kn(e,bn(t,1),[])})),ka=lt||function(){return pt.Date.now()};function Ma(e,t,n){return t=n?r:t,t=e&&null==t?e.length:t,Qi(e,f,r,r,r,r,t)}function Ca(e,t){var i;if("function"!=typeof t)throw new Ie(n);return e=ms(e),function(){return--e>0&&(i=t.apply(this,arguments)),e<=1&&(t=r),i}}var Ia=Xn((function(e,t,r){var n=1;if(r.length){var i=ur(r,co(Ia));n|=c}return Qi(e,n,t,r,i)})),Ra=Xn((function(e,t,r){var n=3;if(r.length){var i=ur(r,co(Ra));n|=c}return Qi(t,n,e,r,i)}));function Na(e,t,i){var o,a,s,c,u,f,d=0,l=!1,h=!1,p=!0;if("function"!=typeof e)throw new Ie(n);function m(t){var n=o,i=a;return o=a=r,d=t,c=e.apply(i,n)}function g(e){var n=e-f;return f===r||n>=t||n<0||h&&e-d>=s}function y(){var e=ka();if(g(e))return b(e);u=No(y,function(e){var r=t-(e-f);return h?vr(r,s-(e-d)):r}(e))}function b(e){return u=r,p&&o?m(e):(o=a=r,c)}function v(){var e=ka(),n=g(e);if(o=arguments,a=this,f=e,n){if(u===r)return function(e){return d=e,u=No(y,t),l?m(e):c}(f);if(h)return Ei(u),u=No(y,t),m(f)}return u===r&&(u=No(y,t)),c}return t=ys(t)||0,ts(i)&&(l=!!i.leading,s=(h="maxWait"in i)?br(ys(i.maxWait)||0,t):s,p="trailing"in i?!!i.trailing:p),v.cancel=function(){u!==r&&Ei(u),d=0,o=f=a=u=r},v.flush=function(){return u===r?c:b(ka())},v}var Oa=Xn((function(e,t){return dn(e,1,t)})),Ta=Xn((function(e,t,r){return dn(e,ys(t)||0,r)}));function ja(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Ie(n);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var a=e.apply(this,n);return r.cache=o.set(i,a)||o,a};return r.cache=new(ja.Cache||Wr),r}function $a(e){if("function"!=typeof e)throw new Ie(n);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}ja.Cache=Wr;var Da=Ai((function(e,t){var r=(t=1==t.length&&Ka(t[0])?Tt(t[0],Qt(uo())):Tt(bn(t,1),Qt(uo()))).length;return Xn((function(n){for(var i=-1,o=vr(n.length,r);++i=t})),Ha=Nn(function(){return arguments}())?Nn:function(e){return rs(e)&&$e.call(e,"callee")&&!Ve.call(e,"callee")},Ka=ae.isArray,Ja=wt?Qt(wt):function(e){return rs(e)&&xn(e)==O};function Wa(e){return null!=e&&es(e.length)&&!Qa(e)}function Ga(e){return rs(e)&&Wa(e)}var Va=vt||yc,Za=At?Qt(At):function(e){return rs(e)&&xn(e)==w};function Xa(e){if(!rs(e))return!1;var t=xn(e);return t==A||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!os(e)}function Qa(e){if(!ts(e))return!1;var t=xn(e);return t==_||t==E||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Ya(e){return"number"==typeof e&&e==ms(e)}function es(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=h}function ts(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function rs(e){return null!=e&&"object"==typeof e}var ns=_t?Qt(_t):function(e){return rs(e)&&go(e)==S};function is(e){return"number"==typeof e||rs(e)&&xn(e)==P}function os(e){if(!rs(e)||xn(e)!=x)return!1;var t=We(e);if(null===t)return!0;var r=$e.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&je.call(r)==ze}var as=Et?Qt(Et):function(e){return rs(e)&&xn(e)==M};var ss=St?Qt(St):function(e){return rs(e)&&go(e)==C};function cs(e){return"string"==typeof e||!Ka(e)&&rs(e)&&xn(e)==I}function us(e){return"symbol"==typeof e||rs(e)&&xn(e)==R}var fs=Pt?Qt(Pt):function(e){return rs(e)&&es(e.length)&&!!st[xn(e)]};var ds=Wi(Fn),ls=Wi((function(e,t){return e<=t}));function hs(e){if(!e)return[];if(Wa(e))return cs(e)?hr(e):Ii(e);if(Qe&&e[Qe])return function(e){for(var t,r=[];!(t=e.next()).done;)r.push(t.value);return r}(e[Qe]());var t=go(e);return(t==S?sr:t==C?fr:Us)(e)}function ps(e){return e?(e=ys(e))===l||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function ms(e){var t=ps(e),r=t%1;return t==t?r?t-r:t:0}function gs(e){return e?cn(ms(e),0,m):0}function ys(e){if("number"==typeof e)return e;if(us(e))return p;if(ts(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=ts(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Xt(e);var r=ge.test(e);return r||be.test(e)?dt(e.slice(2),r?2:8):me.test(e)?p:+e}function bs(e){return Ri(e,Os(e))}function vs(e){return null==e?"":fi(e)}var ws=Oi((function(e,t){if(Po(t)||Wa(t))Ri(t,Ns(t),e);else for(var r in t)$e.call(t,r)&&tn(e,r,t[r])})),As=Oi((function(e,t){Ri(t,Os(t),e)})),_s=Oi((function(e,t,r,n){Ri(t,Os(t),e,n)})),Es=Oi((function(e,t,r,n){Ri(t,Ns(t),e,n)})),Ss=no(sn);var Ps=Xn((function(e,t){e=ke(e);var n=-1,i=t.length,o=i>2?t[2]:r;for(o&&Ao(t[0],t[1],o)&&(i=1);++n1),t})),Ri(e,oo(e),r),n&&(r=un(r,7,to));for(var i=t.length;i--;)li(r,t[i]);return r}));var Ds=no((function(e,t){return null==e?{}:function(e,t){return Jn(e,t,(function(t,r){return Ms(e,r)}))}(e,t)}));function Bs(e,t){if(null==e)return{};var r=Tt(oo(e),(function(e){return[e]}));return t=uo(t),Jn(e,r,(function(e,r){return t(e,r[0])}))}var Fs=Xi(Ns),zs=Xi(Os);function Us(e){return null==e?[]:Yt(e,Ns(e))}var Ls=Di((function(e,t,r){return t=t.toLowerCase(),e+(r?qs(t):t)}));function qs(e){return Xs(vs(e).toLowerCase())}function Hs(e){return(e=vs(e))&&e.replace(we,nr).replace(et,"")}var Ks=Di((function(e,t,r){return e+(r?"-":"")+t.toLowerCase()})),Js=Di((function(e,t,r){return e+(r?" ":"")+t.toLowerCase()})),Ws=$i("toLowerCase");var Gs=Di((function(e,t,r){return e+(r?"_":"")+t.toLowerCase()}));var Vs=Di((function(e,t,r){return e+(r?" ":"")+Xs(t)}));var Zs=Di((function(e,t,r){return e+(r?" ":"")+t.toUpperCase()})),Xs=$i("toUpperCase");function Qs(e,t,n){return e=vs(e),(t=n?r:t)===r?function(e){return it.test(e)}(e)?function(e){return e.match(rt)||[]}(e):function(e){return e.match(fe)||[]}(e):e.match(t)||[]}var Ys=Xn((function(e,t){try{return xt(e,r,t)}catch(e){return Xa(e)?e:new Se(e)}})),ec=no((function(e,t){return Mt(t,(function(t){t=Bo(t),an(e,t,Ia(e[t],e))})),e}));function tc(e){return function(){return e}}var rc=zi(),nc=zi(!0);function ic(e){return e}function oc(e){return $n("function"==typeof e?e:un(e,1))}var ac=Xn((function(e,t){return function(r){return Rn(r,e,t)}})),sc=Xn((function(e,t){return function(r){return Rn(e,r,t)}}));function cc(e,t,r){var n=Ns(t),i=En(t,n);null!=r||ts(t)&&(i.length||!n.length)||(r=t,t=e,e=this,i=En(t,Ns(t)));var o=!(ts(r)&&"chain"in r&&!r.chain),a=Qa(e);return Mt(i,(function(r){var n=t[r];e[r]=n,a&&(e.prototype[r]=function(){var t=this.__chain__;if(o||t){var r=e(this.__wrapped__);return(r.__actions__=Ii(this.__actions__)).push({func:n,args:arguments,thisArg:e}),r.__chain__=t,r}return n.apply(e,jt([this.value()],arguments))})})),e}function uc(){}var fc=Hi(Tt),dc=Hi(It),lc=Hi(Bt);function hc(e){return _o(e)?Jt(Bo(e)):function(e){return function(t){return Sn(t,e)}}(e)}var pc=Ji(),mc=Ji(!0);function gc(){return[]}function yc(){return!1}var bc=qi((function(e,t){return e+t}),0),vc=Vi("ceil"),wc=qi((function(e,t){return e/t}),1),Ac=Vi("floor");var _c,Ec=qi((function(e,t){return e*t}),1),Sc=Vi("round"),Pc=qi((function(e,t){return e-t}),0);return zr.after=function(e,t){if("function"!=typeof t)throw new Ie(n);return e=ms(e),function(){if(--e<1)return t.apply(this,arguments)}},zr.ary=Ma,zr.assign=ws,zr.assignIn=As,zr.assignInWith=_s,zr.assignWith=Es,zr.at=Ss,zr.before=Ca,zr.bind=Ia,zr.bindAll=ec,zr.bindKey=Ra,zr.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Ka(e)?e:[e]},zr.chain=ha,zr.chunk=function(e,t,n){t=(n?Ao(e,t,n):t===r)?1:br(ms(t),0);var i=null==e?0:e.length;if(!i||t<1)return[];for(var o=0,a=0,s=ae(mt(i/t));oo?0:o+n),(i=i===r||i>o?o:ms(i))<0&&(i+=o),i=n>i?0:gs(i);n>>0)?(e=vs(e))&&("string"==typeof t||null!=t&&!as(t))&&!(t=fi(t))&&ar(e)?_i(hr(e),0,n):e.split(t,n):[]},zr.spread=function(e,t){if("function"!=typeof e)throw new Ie(n);return t=null==t?0:br(ms(t),0),Xn((function(r){var n=r[t],i=_i(r,0,t);return n&&jt(i,n),xt(e,this,i)}))},zr.tail=function(e){var t=null==e?0:e.length;return t?ii(e,1,t):[]},zr.take=function(e,t,n){return e&&e.length?ii(e,0,(t=n||t===r?1:ms(t))<0?0:t):[]},zr.takeRight=function(e,t,n){var i=null==e?0:e.length;return i?ii(e,(t=i-(t=n||t===r?1:ms(t)))<0?0:t,i):[]},zr.takeRightWhile=function(e,t){return e&&e.length?pi(e,uo(t,3),!1,!0):[]},zr.takeWhile=function(e,t){return e&&e.length?pi(e,uo(t,3)):[]},zr.tap=function(e,t){return t(e),e},zr.throttle=function(e,t,r){var i=!0,o=!0;if("function"!=typeof e)throw new Ie(n);return ts(r)&&(i="leading"in r?!!r.leading:i,o="trailing"in r?!!r.trailing:o),Na(e,t,{leading:i,maxWait:t,trailing:o})},zr.thru=pa,zr.toArray=hs,zr.toPairs=Fs,zr.toPairsIn=zs,zr.toPath=function(e){return Ka(e)?Tt(e,Bo):us(e)?[e]:Ii(Do(vs(e)))},zr.toPlainObject=bs,zr.transform=function(e,t,r){var n=Ka(e),i=n||Va(e)||fs(e);if(t=uo(t,4),null==r){var o=e&&e.constructor;r=i?n?new o:[]:ts(e)&&Qa(o)?Ur(We(e)):{}}return(i?Mt:An)(e,(function(e,n,i){return t(r,e,n,i)})),r},zr.unary=function(e){return Ma(e,1)},zr.union=ra,zr.unionBy=na,zr.unionWith=ia,zr.uniq=function(e){return e&&e.length?di(e):[]},zr.uniqBy=function(e,t){return e&&e.length?di(e,uo(t,2)):[]},zr.uniqWith=function(e,t){return t="function"==typeof t?t:r,e&&e.length?di(e,r,t):[]},zr.unset=function(e,t){return null==e||li(e,t)},zr.unzip=oa,zr.unzipWith=aa,zr.update=function(e,t,r){return null==e?e:hi(e,t,vi(r))},zr.updateWith=function(e,t,n,i){return i="function"==typeof i?i:r,null==e?e:hi(e,t,vi(n),i)},zr.values=Us,zr.valuesIn=function(e){return null==e?[]:Yt(e,Os(e))},zr.without=sa,zr.words=Qs,zr.wrap=function(e,t){return Ba(vi(t),e)},zr.xor=ca,zr.xorBy=ua,zr.xorWith=fa,zr.zip=da,zr.zipObject=function(e,t){return yi(e||[],t||[],tn)},zr.zipObjectDeep=function(e,t){return yi(e||[],t||[],ei)},zr.zipWith=la,zr.entries=Fs,zr.entriesIn=zs,zr.extend=As,zr.extendWith=_s,cc(zr,zr),zr.add=bc,zr.attempt=Ys,zr.camelCase=Ls,zr.capitalize=qs,zr.ceil=vc,zr.clamp=function(e,t,n){return n===r&&(n=t,t=r),n!==r&&(n=(n=ys(n))==n?n:0),t!==r&&(t=(t=ys(t))==t?t:0),cn(ys(e),t,n)},zr.clone=function(e){return un(e,4)},zr.cloneDeep=function(e){return un(e,5)},zr.cloneDeepWith=function(e,t){return un(e,5,t="function"==typeof t?t:r)},zr.cloneWith=function(e,t){return un(e,4,t="function"==typeof t?t:r)},zr.conformsTo=function(e,t){return null==t||fn(e,t,Ns(t))},zr.deburr=Hs,zr.defaultTo=function(e,t){return null==e||e!=e?t:e},zr.divide=wc,zr.endsWith=function(e,t,n){e=vs(e),t=fi(t);var i=e.length,o=n=n===r?i:cn(ms(n),0,i);return(n-=t.length)>=0&&e.slice(n,o)==t},zr.eq=Ua,zr.escape=function(e){return(e=vs(e))&&Z.test(e)?e.replace(G,ir):e},zr.escapeRegExp=function(e){return(e=vs(e))&&ie.test(e)?e.replace(ne,"\\$&"):e},zr.every=function(e,t,n){var i=Ka(e)?It:mn;return n&&Ao(e,t,n)&&(t=r),i(e,uo(t,3))},zr.find=ya,zr.findIndex=Ho,zr.findKey=function(e,t){return zt(e,uo(t,3),An)},zr.findLast=ba,zr.findLastIndex=Ko,zr.findLastKey=function(e,t){return zt(e,uo(t,3),_n)},zr.floor=Ac,zr.forEach=va,zr.forEachRight=wa,zr.forIn=function(e,t){return null==e?e:vn(e,uo(t,3),Os)},zr.forInRight=function(e,t){return null==e?e:wn(e,uo(t,3),Os)},zr.forOwn=function(e,t){return e&&An(e,uo(t,3))},zr.forOwnRight=function(e,t){return e&&_n(e,uo(t,3))},zr.get=ks,zr.gt=La,zr.gte=qa,zr.has=function(e,t){return null!=e&&yo(e,t,Mn)},zr.hasIn=Ms,zr.head=Wo,zr.identity=ic,zr.includes=function(e,t,r,n){e=Wa(e)?e:Us(e),r=r&&!n?ms(r):0;var i=e.length;return r<0&&(r=br(i+r,0)),cs(e)?r<=i&&e.indexOf(t,r)>-1:!!i&&Lt(e,t,r)>-1},zr.indexOf=function(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var i=null==r?0:ms(r);return i<0&&(i=br(n+i,0)),Lt(e,t,i)},zr.inRange=function(e,t,n){return t=ps(t),n===r?(n=t,t=0):n=ps(n),function(e,t,r){return e>=vr(t,r)&&e=-9007199254740991&&e<=h},zr.isSet=ss,zr.isString=cs,zr.isSymbol=us,zr.isTypedArray=fs,zr.isUndefined=function(e){return e===r},zr.isWeakMap=function(e){return rs(e)&&go(e)==N},zr.isWeakSet=function(e){return rs(e)&&"[object WeakSet]"==xn(e)},zr.join=function(e,t){return null==e?"":Wt.call(e,t)},zr.kebabCase=Ks,zr.last=Xo,zr.lastIndexOf=function(e,t,n){var i=null==e?0:e.length;if(!i)return-1;var o=i;return n!==r&&(o=(o=ms(n))<0?br(i+o,0):vr(o,i-1)),t==t?function(e,t,r){for(var n=r+1;n--;)if(e[n]===t)return n;return n}(e,t,o):Ut(e,Ht,o,!0)},zr.lowerCase=Js,zr.lowerFirst=Ws,zr.lt=ds,zr.lte=ls,zr.max=function(e){return e&&e.length?gn(e,ic,kn):r},zr.maxBy=function(e,t){return e&&e.length?gn(e,uo(t,2),kn):r},zr.mean=function(e){return Kt(e,ic)},zr.meanBy=function(e,t){return Kt(e,uo(t,2))},zr.min=function(e){return e&&e.length?gn(e,ic,Fn):r},zr.minBy=function(e,t){return e&&e.length?gn(e,uo(t,2),Fn):r},zr.stubArray=gc,zr.stubFalse=yc,zr.stubObject=function(){return{}},zr.stubString=function(){return""},zr.stubTrue=function(){return!0},zr.multiply=Ec,zr.nth=function(e,t){return e&&e.length?Hn(e,ms(t)):r},zr.noConflict=function(){return pt._===this&&(pt._=Ue),this},zr.noop=uc,zr.now=ka,zr.pad=function(e,t,r){e=vs(e);var n=(t=ms(t))?lr(e):0;if(!t||n>=t)return e;var i=(t-n)/2;return Ki(gt(i),r)+e+Ki(mt(i),r)},zr.padEnd=function(e,t,r){e=vs(e);var n=(t=ms(t))?lr(e):0;return t&&nt){var i=e;e=t,t=i}if(n||e%1||t%1){var o=_r();return vr(e+o*(t-e+ft("1e-"+((o+"").length-1))),t)}return Vn(e,t)},zr.reduce=function(e,t,r){var n=Ka(e)?$t:Gt,i=arguments.length<3;return n(e,uo(t,4),r,i,hn)},zr.reduceRight=function(e,t,r){var n=Ka(e)?Dt:Gt,i=arguments.length<3;return n(e,uo(t,4),r,i,pn)},zr.repeat=function(e,t,n){return t=(n?Ao(e,t,n):t===r)?1:ms(t),Zn(vs(e),t)},zr.replace=function(){var e=arguments,t=vs(e[0]);return e.length<3?t:t.replace(e[1],e[2])},zr.result=function(e,t,n){var i=-1,o=(t=wi(t,e)).length;for(o||(o=1,e=r);++ih)return[];var r=m,n=vr(e,m);t=uo(t),e-=m;for(var i=Zt(n,t);++r=a)return e;var c=n-lr(i);if(c<1)return i;var u=s?_i(s,0,c).join(""):e.slice(0,c);if(o===r)return u+i;if(s&&(c+=u.length-c),as(o)){if(e.slice(c).search(o)){var f,d=u;for(o.global||(o=Me(o.source,vs(pe.exec(o))+"g")),o.lastIndex=0;f=o.exec(d);)var l=f.index;u=u.slice(0,l===r?c:l)}}else if(e.indexOf(fi(o),c)!=c){var h=u.lastIndexOf(o);h>-1&&(u=u.slice(0,h))}return u+i},zr.unescape=function(e){return(e=vs(e))&&V.test(e)?e.replace(W,mr):e},zr.uniqueId=function(e){var t=++De;return vs(e)+t},zr.upperCase=Zs,zr.upperFirst=Xs,zr.each=va,zr.eachRight=wa,zr.first=Wo,cc(zr,(_c={},An(zr,(function(e,t){$e.call(zr.prototype,t)||(_c[t]=e)})),_c),{chain:!1}),zr.VERSION="4.17.21",Mt(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){zr[e].placeholder=zr})),Mt(["drop","take"],(function(e,t){Hr.prototype[e]=function(n){n=n===r?1:br(ms(n),0);var i=this.__filtered__&&!t?new Hr(this):this.clone();return i.__filtered__?i.__takeCount__=vr(n,i.__takeCount__):i.__views__.push({size:vr(n,m),type:e+(i.__dir__<0?"Right":"")}),i},Hr.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),Mt(["filter","map","takeWhile"],(function(e,t){var r=t+1,n=1==r||3==r;Hr.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:uo(e,3),type:r}),t.__filtered__=t.__filtered__||n,t}})),Mt(["head","last"],(function(e,t){var r="take"+(t?"Right":"");Hr.prototype[e]=function(){return this[r](1).value()[0]}})),Mt(["initial","tail"],(function(e,t){var r="drop"+(t?"":"Right");Hr.prototype[e]=function(){return this.__filtered__?new Hr(this):this[r](1)}})),Hr.prototype.compact=function(){return this.filter(ic)},Hr.prototype.find=function(e){return this.filter(e).head()},Hr.prototype.findLast=function(e){return this.reverse().find(e)},Hr.prototype.invokeMap=Xn((function(e,t){return"function"==typeof e?new Hr(this):this.map((function(r){return Rn(r,e,t)}))})),Hr.prototype.reject=function(e){return this.filter($a(uo(e)))},Hr.prototype.slice=function(e,t){e=ms(e);var n=this;return n.__filtered__&&(e>0||t<0)?new Hr(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==r&&(n=(t=ms(t))<0?n.dropRight(-t):n.take(t-e)),n)},Hr.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Hr.prototype.toArray=function(){return this.take(m)},An(Hr.prototype,(function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),i=/^(?:head|last)$/.test(t),o=zr[i?"take"+("last"==t?"Right":""):t],a=i||/^find/.test(t);o&&(zr.prototype[t]=function(){var t=this.__wrapped__,s=i?[1]:arguments,c=t instanceof Hr,u=s[0],f=c||Ka(t),d=function(e){var t=o.apply(zr,jt([e],s));return i&&l?t[0]:t};f&&n&&"function"==typeof u&&1!=u.length&&(c=f=!1);var l=this.__chain__,h=!!this.__actions__.length,p=a&&!l,m=c&&!h;if(!a&&f){t=m?t:new Hr(this);var g=e.apply(t,s);return g.__actions__.push({func:pa,args:[d],thisArg:r}),new qr(g,l)}return p&&m?e.apply(this,s):(g=this.thru(d),p?i?g.value()[0]:g.value():g)})})),Mt(["pop","push","shift","sort","splice","unshift"],(function(e){var t=Re[e],r=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",n=/^(?:pop|shift)$/.test(e);zr.prototype[e]=function(){var e=arguments;if(n&&!this.__chain__){var i=this.value();return t.apply(Ka(i)?i:[],e)}return this[r]((function(r){return t.apply(Ka(r)?r:[],e)}))}})),An(Hr.prototype,(function(e,t){var r=zr[t];if(r){var n=r.name+"";$e.call(Rr,n)||(Rr[n]=[]),Rr[n].push({name:t,func:r})}})),Rr[Ui(r,2).name]=[{name:"wrapper",func:r}],Hr.prototype.clone=function(){var e=new Hr(this.__wrapped__);return e.__actions__=Ii(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Ii(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Ii(this.__views__),e},Hr.prototype.reverse=function(){if(this.__filtered__){var e=new Hr(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Hr.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,r=Ka(e),n=t<0,i=r?e.length:0,o=function(e,t,r){var n=-1,i=r.length;for(;++n=this.__values__.length;return{done:e,value:e?r:this.__values__[this.__index__++]}},zr.prototype.plant=function(e){for(var t,n=this;n instanceof Lr;){var i=zo(n);i.__index__=0,i.__values__=r,t?o.__wrapped__=i:t=i;var o=i;n=n.__wrapped__}return o.__wrapped__=e,t},zr.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Hr){var t=e;return this.__actions__.length&&(t=new Hr(this)),(t=t.reverse()).__actions__.push({func:pa,args:[ta],thisArg:r}),new qr(t,this.__chain__)}return this.thru(ta)},zr.prototype.toJSON=zr.prototype.valueOf=zr.prototype.value=function(){return mi(this.__wrapped__,this.__actions__)},zr.prototype.first=zr.prototype.head,Qe&&(zr.prototype[Qe]=function(){return this}),zr}();gt?((gt.exports=gr)._=gr,mt._=gr):pt._=gr}).call(a)}(Yw,Yw.exports);var eA=s(Yw.exports),tA={id:"https://spec.openapis.org/oas/3.0/schema/2021-09-28",$schema:"http://json-schema.org/draft-04/schema#",description:"The description of OpenAPI v3.0.x documents, as defined by https://spec.openapis.org/oas/v3.0.3",type:"object",required:["openapi","info","paths"],properties:{openapi:{type:"string",pattern:"^3\\.0\\.\\d(-.+)?$"},info:{$ref:"#/definitions/Info"},externalDocs:{$ref:"#/definitions/ExternalDocumentation"},servers:{type:"array",items:{$ref:"#/definitions/Server"}},security:{type:"array",items:{$ref:"#/definitions/SecurityRequirement"}},tags:{type:"array",items:{$ref:"#/definitions/Tag"},uniqueItems:!0},paths:{$ref:"#/definitions/Paths"},components:{$ref:"#/definitions/Components"}},patternProperties:{"^x-":{}},additionalProperties:!1,definitions:{Reference:{type:"object",required:["$ref"],patternProperties:{"^\\$ref$":{type:"string",format:"uri-reference"}}},Info:{type:"object",required:["title","version"],properties:{title:{type:"string"},description:{type:"string"},termsOfService:{type:"string",format:"uri-reference"},contact:{$ref:"#/definitions/Contact"},license:{$ref:"#/definitions/License"},version:{type:"string"}},patternProperties:{"^x-":{}},additionalProperties:!1},Contact:{type:"object",properties:{name:{type:"string"},url:{type:"string",format:"uri-reference"},email:{type:"string",format:"email"}},patternProperties:{"^x-":{}},additionalProperties:!1},License:{type:"object",required:["name"],properties:{name:{type:"string"},url:{type:"string",format:"uri-reference"}},patternProperties:{"^x-":{}},additionalProperties:!1},Server:{type:"object",required:["url"],properties:{url:{type:"string"},description:{type:"string"},variables:{type:"object",additionalProperties:{$ref:"#/definitions/ServerVariable"}}},patternProperties:{"^x-":{}},additionalProperties:!1},ServerVariable:{type:"object",required:["default"],properties:{enum:{type:"array",items:{type:"string"}},default:{type:"string"},description:{type:"string"}},patternProperties:{"^x-":{}},additionalProperties:!1},Components:{type:"object",properties:{schemas:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]}}},responses:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/Response"}]}}},parameters:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/Parameter"}]}}},examples:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/Example"}]}}},requestBodies:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/RequestBody"}]}}},headers:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/Header"}]}}},securitySchemes:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/SecurityScheme"}]}}},links:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/Link"}]}}},callbacks:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/Callback"}]}}}},patternProperties:{"^x-":{}},additionalProperties:!1},Schema:{type:"object",properties:{title:{type:"string"},multipleOf:{type:"number",minimum:0,exclusiveMinimum:!0},maximum:{type:"number"},exclusiveMaximum:{type:"boolean",default:!1},minimum:{type:"number"},exclusiveMinimum:{type:"boolean",default:!1},maxLength:{type:"integer",minimum:0},minLength:{type:"integer",minimum:0,default:0},pattern:{type:"string",format:"regex"},maxItems:{type:"integer",minimum:0},minItems:{type:"integer",minimum:0,default:0},uniqueItems:{type:"boolean",default:!1},maxProperties:{type:"integer",minimum:0},minProperties:{type:"integer",minimum:0,default:0},required:{type:"array",items:{type:"string"},minItems:1,uniqueItems:!0},enum:{type:"array",items:{},minItems:1,uniqueItems:!1},type:{type:"string",enum:["array","boolean","integer","number","object","string"]},not:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]},allOf:{type:"array",items:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]}},oneOf:{type:"array",items:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]}},anyOf:{type:"array",items:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]}},items:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]},properties:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]}},additionalProperties:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"},{type:"boolean"}],default:!0},description:{type:"string"},format:{type:"string"},default:{},nullable:{type:"boolean",default:!1},discriminator:{$ref:"#/definitions/Discriminator"},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},example:{},externalDocs:{$ref:"#/definitions/ExternalDocumentation"},deprecated:{type:"boolean",default:!1},xml:{$ref:"#/definitions/XML"}},patternProperties:{"^x-":{}},additionalProperties:!1},Discriminator:{type:"object",required:["propertyName"],properties:{propertyName:{type:"string"},mapping:{type:"object",additionalProperties:{type:"string"}}}},XML:{type:"object",properties:{name:{type:"string"},namespace:{type:"string",format:"uri"},prefix:{type:"string"},attribute:{type:"boolean",default:!1},wrapped:{type:"boolean",default:!1}},patternProperties:{"^x-":{}},additionalProperties:!1},Response:{type:"object",required:["description"],properties:{description:{type:"string"},headers:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Header"},{$ref:"#/definitions/Reference"}]}},content:{type:"object",additionalProperties:{$ref:"#/definitions/MediaType"}},links:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Link"},{$ref:"#/definitions/Reference"}]}}},patternProperties:{"^x-":{}},additionalProperties:!1},MediaType:{type:"object",properties:{schema:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]},example:{},examples:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Example"},{$ref:"#/definitions/Reference"}]}},encoding:{type:"object",additionalProperties:{$ref:"#/definitions/Encoding"}}},patternProperties:{"^x-":{}},additionalProperties:!1,allOf:[{$ref:"#/definitions/ExampleXORExamples"}]},Example:{type:"object",properties:{summary:{type:"string"},description:{type:"string"},value:{},externalValue:{type:"string",format:"uri-reference"}},patternProperties:{"^x-":{}},additionalProperties:!1},Header:{type:"object",properties:{description:{type:"string"},required:{type:"boolean",default:!1},deprecated:{type:"boolean",default:!1},allowEmptyValue:{type:"boolean",default:!1},style:{type:"string",enum:["simple"],default:"simple"},explode:{type:"boolean"},allowReserved:{type:"boolean",default:!1},schema:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]},content:{type:"object",additionalProperties:{$ref:"#/definitions/MediaType"},minProperties:1,maxProperties:1},example:{},examples:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Example"},{$ref:"#/definitions/Reference"}]}}},patternProperties:{"^x-":{}},additionalProperties:!1,allOf:[{$ref:"#/definitions/ExampleXORExamples"},{$ref:"#/definitions/SchemaXORContent"}]},Paths:{type:"object",patternProperties:{"^\\/":{$ref:"#/definitions/PathItem"},"^x-":{}},additionalProperties:!1},PathItem:{type:"object",properties:{$ref:{type:"string"},summary:{type:"string"},description:{type:"string"},servers:{type:"array",items:{$ref:"#/definitions/Server"}},parameters:{type:"array",items:{oneOf:[{$ref:"#/definitions/Parameter"},{$ref:"#/definitions/Reference"}]},uniqueItems:!0}},patternProperties:{"^(get|put|post|delete|options|head|patch|trace)$":{$ref:"#/definitions/Operation"},"^x-":{}},additionalProperties:!1},Operation:{type:"object",required:["responses"],properties:{tags:{type:"array",items:{type:"string"}},summary:{type:"string"},description:{type:"string"},externalDocs:{$ref:"#/definitions/ExternalDocumentation"},operationId:{type:"string"},parameters:{type:"array",items:{oneOf:[{$ref:"#/definitions/Parameter"},{$ref:"#/definitions/Reference"}]},uniqueItems:!0},requestBody:{oneOf:[{$ref:"#/definitions/RequestBody"},{$ref:"#/definitions/Reference"}]},responses:{$ref:"#/definitions/Responses"},callbacks:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Callback"},{$ref:"#/definitions/Reference"}]}},deprecated:{type:"boolean",default:!1},security:{type:"array",items:{$ref:"#/definitions/SecurityRequirement"}},servers:{type:"array",items:{$ref:"#/definitions/Server"}}},patternProperties:{"^x-":{}},additionalProperties:!1},Responses:{type:"object",properties:{default:{oneOf:[{$ref:"#/definitions/Response"},{$ref:"#/definitions/Reference"}]}},patternProperties:{"^[1-5](?:\\d{2}|XX)$":{oneOf:[{$ref:"#/definitions/Response"},{$ref:"#/definitions/Reference"}]},"^x-":{}},minProperties:1,additionalProperties:!1},SecurityRequirement:{type:"object",additionalProperties:{type:"array",items:{type:"string"}}},Tag:{type:"object",required:["name"],properties:{name:{type:"string"},description:{type:"string"},externalDocs:{$ref:"#/definitions/ExternalDocumentation"}},patternProperties:{"^x-":{}},additionalProperties:!1},ExternalDocumentation:{type:"object",required:["url"],properties:{description:{type:"string"},url:{type:"string",format:"uri-reference"}},patternProperties:{"^x-":{}},additionalProperties:!1},ExampleXORExamples:{description:"Example and examples are mutually exclusive",not:{required:["example","examples"]}},SchemaXORContent:{description:"Schema and content are mutually exclusive, at least one is required",not:{required:["schema","content"]},oneOf:[{required:["schema"]},{required:["content"],description:"Some properties are not allowed if content is present",allOf:[{not:{required:["style"]}},{not:{required:["explode"]}},{not:{required:["allowReserved"]}},{not:{required:["example"]}},{not:{required:["examples"]}}]}]},Parameter:{type:"object",properties:{name:{type:"string"},in:{type:"string"},description:{type:"string"},required:{type:"boolean",default:!1},deprecated:{type:"boolean",default:!1},allowEmptyValue:{type:"boolean",default:!1},style:{type:"string"},explode:{type:"boolean"},allowReserved:{type:"boolean",default:!1},schema:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]},content:{type:"object",additionalProperties:{$ref:"#/definitions/MediaType"},minProperties:1,maxProperties:1},example:{},examples:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Example"},{$ref:"#/definitions/Reference"}]}}},patternProperties:{"^x-":{}},additionalProperties:!1,required:["name","in"],allOf:[{$ref:"#/definitions/ExampleXORExamples"},{$ref:"#/definitions/SchemaXORContent"},{$ref:"#/definitions/ParameterLocation"}]},ParameterLocation:{description:"Parameter location",oneOf:[{description:"Parameter in path",required:["required"],properties:{in:{enum:["path"]},style:{enum:["matrix","label","simple"],default:"simple"},required:{enum:[!0]}}},{description:"Parameter in query",properties:{in:{enum:["query"]},style:{enum:["form","spaceDelimited","pipeDelimited","deepObject"],default:"form"}}},{description:"Parameter in header",properties:{in:{enum:["header"]},style:{enum:["simple"],default:"simple"}}},{description:"Parameter in cookie",properties:{in:{enum:["cookie"]},style:{enum:["form"],default:"form"}}}]},RequestBody:{type:"object",required:["content"],properties:{description:{type:"string"},content:{type:"object",additionalProperties:{$ref:"#/definitions/MediaType"}},required:{type:"boolean",default:!1}},patternProperties:{"^x-":{}},additionalProperties:!1},SecurityScheme:{oneOf:[{$ref:"#/definitions/APIKeySecurityScheme"},{$ref:"#/definitions/HTTPSecurityScheme"},{$ref:"#/definitions/OAuth2SecurityScheme"},{$ref:"#/definitions/OpenIdConnectSecurityScheme"}]},APIKeySecurityScheme:{type:"object",required:["type","name","in"],properties:{type:{type:"string",enum:["apiKey"]},name:{type:"string"},in:{type:"string",enum:["header","query","cookie"]},description:{type:"string"}},patternProperties:{"^x-":{}},additionalProperties:!1},HTTPSecurityScheme:{type:"object",required:["scheme","type"],properties:{scheme:{type:"string"},bearerFormat:{type:"string"},description:{type:"string"},type:{type:"string",enum:["http"]}},patternProperties:{"^x-":{}},additionalProperties:!1,oneOf:[{description:"Bearer",properties:{scheme:{type:"string",pattern:"^[Bb][Ee][Aa][Rr][Ee][Rr]$"}}},{description:"Non Bearer",not:{required:["bearerFormat"]},properties:{scheme:{not:{type:"string",pattern:"^[Bb][Ee][Aa][Rr][Ee][Rr]$"}}}}]},OAuth2SecurityScheme:{type:"object",required:["type","flows"],properties:{type:{type:"string",enum:["oauth2"]},flows:{$ref:"#/definitions/OAuthFlows"},description:{type:"string"}},patternProperties:{"^x-":{}},additionalProperties:!1},OpenIdConnectSecurityScheme:{type:"object",required:["type","openIdConnectUrl"],properties:{type:{type:"string",enum:["openIdConnect"]},openIdConnectUrl:{type:"string",format:"uri-reference"},description:{type:"string"}},patternProperties:{"^x-":{}},additionalProperties:!1},OAuthFlows:{type:"object",properties:{implicit:{$ref:"#/definitions/ImplicitOAuthFlow"},password:{$ref:"#/definitions/PasswordOAuthFlow"},clientCredentials:{$ref:"#/definitions/ClientCredentialsFlow"},authorizationCode:{$ref:"#/definitions/AuthorizationCodeOAuthFlow"}},patternProperties:{"^x-":{}},additionalProperties:!1},ImplicitOAuthFlow:{type:"object",required:["authorizationUrl","scopes"],properties:{authorizationUrl:{type:"string",format:"uri-reference"},refreshUrl:{type:"string",format:"uri-reference"},scopes:{type:"object",additionalProperties:{type:"string"}}},patternProperties:{"^x-":{}},additionalProperties:!1},PasswordOAuthFlow:{type:"object",required:["tokenUrl","scopes"],properties:{tokenUrl:{type:"string",format:"uri-reference"},refreshUrl:{type:"string",format:"uri-reference"},scopes:{type:"object",additionalProperties:{type:"string"}}},patternProperties:{"^x-":{}},additionalProperties:!1},ClientCredentialsFlow:{type:"object",required:["tokenUrl","scopes"],properties:{tokenUrl:{type:"string",format:"uri-reference"},refreshUrl:{type:"string",format:"uri-reference"},scopes:{type:"object",additionalProperties:{type:"string"}}},patternProperties:{"^x-":{}},additionalProperties:!1},AuthorizationCodeOAuthFlow:{type:"object",required:["authorizationUrl","tokenUrl","scopes"],properties:{authorizationUrl:{type:"string",format:"uri-reference"},tokenUrl:{type:"string",format:"uri-reference"},refreshUrl:{type:"string",format:"uri-reference"},scopes:{type:"object",additionalProperties:{type:"string"}}},patternProperties:{"^x-":{}},additionalProperties:!1},Link:{type:"object",properties:{operationId:{type:"string"},operationRef:{type:"string",format:"uri-reference"},parameters:{type:"object",additionalProperties:{}},requestBody:{},description:{type:"string"},server:{$ref:"#/definitions/Server"}},patternProperties:{"^x-":{}},additionalProperties:!1,not:{description:"Operation Id and Operation Ref are mutually exclusive",required:["operationId","operationRef"]}},Callback:{type:"object",additionalProperties:{$ref:"#/definitions/PathItem"},patternProperties:{"^x-":{}}},Encoding:{type:"object",properties:{contentType:{type:"string"},headers:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Header"},{$ref:"#/definitions/Reference"}]}},style:{type:"string",enum:["form","spaceDelimited","pipeDelimited","deepObject"]},explode:{type:"boolean"},allowReserved:{type:"boolean",default:!1}},additionalProperties:!1}}};function rA(e){if(new Date(e).getTime()>0)return Number(e);throw new rn(new Error("invalid timestamp"),["invalid timestamp"])}async function nA(e){const t=[],r=new gw({strictSchema:!1,removeAdditional:"all"});r.addMetaSchema(tA),Qw(r);const n=jp.schemas.DataSharingAgreement;try{const i=r.compile(n),o=eA.cloneDeep(e);i(e)||null!==i.errors&&void 0!==i.errors&&i.errors.length>0&&i.errors.forEach((e=>{t.push(new rn(`[${e.instancePath}] ${e.message??"unknown"}`,["invalid format"]))})),eo(o)!==eo(e)&&t.push(new rn("Additional claims beyond the schema are not supported",["invalid format"]))}catch(e){t.push(new rn(e,["invalid format"]))}return t}async function iA(e){const t=[];try{const{id:r,...n}=e;r!==await Hh(n)&&t.push(new rn("Invalid dataExchange id",["cannot verify","invalid format"]));const{blockCommitment:i,secretCommitment:o,cipherblockDgst:a,...s}=n,c=await oA(s);c.length>0&&c.forEach((e=>{t.push(e)}))}catch(e){t.push(new rn("Invalid dataExchange",["cannot verify","invalid format"]))}return t}async function oA(e){const t=[],r=Object.keys(e);(r.length<10||r.length>11)&&t.push(new rn(new Error("Invalid agreeemt: "+JSON.stringify(e,void 0,2)),["invalid format"]));for(const n of r){let r;switch(n){case"orig":case"dest":try{e[n]!==await io(JSON.parse(e[n]),!0)&&t.push(new rn(`[dataExchangeAgreeement.${n}] A valid stringified JWK must be provided. For uniqueness, JWK claims must be alphabetically sorted in the stringified JWK. You can use the parseJWK(jwk, true) for that purpose.\n${e[n]}`,["invalid key","invalid format"]))}catch(e){t.push(new rn(`[dataExchangeAgreeement.${n}] A valid stringified JWK must be provided. For uniqueness, JWK claims must be alphabetically sorted in the stringified JWK. You can use the parseJWK(jwk, true) for that purpose.`,["invalid key","invalid format"]))}break;case"ledgerContractAddress":case"ledgerSignerAddress":try{r=Lh(e[n]),e[n]!==r&&t.push(new rn(`[dataExchangeAgreeement.${n}] Invalid EIP-55 address ${e[n]}. Did you mean ${r} instead?`,["invalid EIP-55 address","invalid format"]))}catch(r){t.push(new rn(`[dataExchangeAgreeement.${n}] Invalid EIP-55 address ${e[n]}.`,["invalid EIP-55 address","invalid format"]))}break;case"pooToPorDelay":case"pooToPopDelay":case"pooToSecretDelay":try{e[n]!==rA(e[n])&&t.push(new rn(`[dataExchangeAgreeement.${n}] < 0 or not a number`,["invalid timestamp","invalid format"]))}catch(e){t.push(new rn(`[dataExchangeAgreeement.${n}] < 0 or not a number`,["invalid timestamp","invalid format"]))}break;case"hashAlg":Qr.includes(e[n])||t.push(new rn(`[dataExchangeAgreeement.${n}Invalid hash algorithm '${e[n]}'. It must be one of: ${Qr.join(", ")}`,["invalid algorithm"]));break;case"encAlg":en.includes(e[n])||t.push(new rn(`[dataExchangeAgreeement.${n}Invalid encryption algorithm '${e[n]}'. It must be one of: ${en.join(", ")}`,["invalid algorithm"]));break;case"signingAlg":Yr.includes(e[n])||t.push(new rn(`[dataExchangeAgreeement.${n}Invalid signing algorithm '${e[n]}'. It must be one of: ${Yr.join(", ")}`,["invalid algorithm"]));break;case"schema":break;default:t.push(new rn(new Error(`Property ${n} not allowed in dataAgreement`),["invalid format"]))}}return t}var aA=Object.freeze({__proto__:null,NonRepudiationDest:class{constructor(e,t,r){this.initialized=new Promise(((n,i)=>{this.asyncConstructor(e,t,r).then((()=>{n(!0)})).catch((e=>{i(e)}))}))}async asyncConstructor(e,t,r){const n=await oA(e);if(n.length>0){const e=[];let t=[];throw n.forEach((r=>{e.push(r.message),t=t.concat(r.nrErrors)})),t=[...new Set(t)],new rn("Resource has not been validated:\n"+e.join("\n"),t)}this.agreement=e,this.jwkPairDest={privateJwk:t,publicJwk:JSON.parse(e.dest)},this.publicJwkOrig=JSON.parse(e.orig),await Xi(this.jwkPairDest.publicJwk,this.jwkPairDest.privateJwk),this.dltAgent=r;const i=await this.dltAgent.getContractAddress();if(this.agreement.ledgerContractAddress!==i)throw new Error(`Contract address ${i} does not meet agreed one ${this.agreement.ledgerContractAddress}`);this.block={}}async verifyPoO(t,r,n){await this.initialized;const i=e(await oo(r,this.agreement.hashAlg),!0,!1),{payload:o}=await Gi(t),a={...this.agreement,cipherblockDgst:i,blockCommitment:o.exchange.blockCommitment,secretCommitment:o.exchange.secretCommitment},s={proofType:"PoO",iss:"orig",exchange:{...a,id:await Hh(a)}},c={timestamp:Date.now(),notBefore:"iat",notAfter:"iat",...n},u=await Jh(t,s,c);return this.block={jwe:r,poo:{jws:t,payload:u.payload}},this.exchange=u.payload.exchange,u}async generatePoR(){if(await this.initialized,void 0===this.exchange||void 0===this.block.poo)throw new Error("Before computing a PoR, you have first to receive a valid cipherblock with a PoO and validate the PoO");const e={proofType:"PoR",iss:"dest",exchange:this.exchange,poo:this.block.poo.jws};return this.block.por=await Kh(e,this.jwkPairDest.privateJwk),this.block.por}async verifyPoP(e,r){if(await this.initialized,void 0===this.exchange||void 0===this.block.por||void 0===this.block.poo)throw new Error("Cannot verify a PoP if not even a PoR have been created");const i={proofType:"PoP",iss:"orig",exchange:this.exchange,por:this.block.por.jws,secret:"",verificationCode:""},o={timestamp:Date.now(),notBefore:"iat",notAfter:1e3*this.block.poo.payload.iat+this.exchange.pooToPopDelay,...r},a=await Jh(e,i,o),s=JSON.parse(a.payload.secret);return this.block.secret={hex:n(t(s.k)),jwk:s},this.block.pop={jws:e,payload:a.payload},a}async getSecretFromLedger(){if(await this.initialized,void 0===this.exchange||void 0===this.block.poo||void 0===this.block.por)throw new Error("Cannot get secret if a PoR has not been sent before");const e=Date.now(),t=1e3*this.block.poo.payload.iat+this.agreement.pooToSecretDelay,r=Math.round((t-e)/1e3),{hex:n,iat:i}=await this.dltAgent.getSecretFromLedger(Vi(this.agreement.encAlg),this.agreement.ledgerSignerAddress,this.exchange.id,r);this.block.secret=await Zi(this.exchange.encAlg,n);try{to(1e3*i,1e3*this.block.por.payload.iat,1e3*this.block.poo.payload.iat+this.exchange.pooToSecretDelay)}catch(e){throw new rn(`Although the secret has been obtained (and you could try to decrypt the cipherblock), it's been published later than agreed: ${new Date(1e3*i).toUTCString()} > ${new Date(1e3*this.block.poo.payload.iat+this.agreement.pooToSecretDelay).toUTCString()}`,["secret not published in time"])}return this.block.secret}async decrypt(){if(await this.initialized,void 0===this.exchange)throw new Error("No agreed exchange");if(void 0===this.block.secret?.jwk)throw new Error("Cannot decrypt without the secret");if(void 0===this.block.jwe)throw new Error("No cipherblock to decrypt");const t=(await Wi(this.block.jwe,this.block.secret.jwk)).plaintext;if(e(await oo(t,this.agreement.hashAlg),!0,!1)!==this.exchange.blockCommitment)throw new Error("Decrypted block does not meet the committed one");return this.block.raw=t,t}async generateVerificationRequest(){if(await this.initialized,void 0===this.block.por||void 0===this.exchange)throw new Error("Before generating a VerificationRequest, you have first to hold a valid PoR for the exchange");return await Xh("dest",this.exchange.id,this.block.por.jws,this.jwkPairDest.privateJwk)}async generateDisputeRequest(){if(await this.initialized,void 0===this.block.por||void 0===this.block.jwe||void 0===this.exchange)throw new Error("Before generating a VerificationRequest, you have first to hold a valid PoR for the exchange and have received the cipherblock");const e={proofType:"request",iss:"dest",por:this.block.por.jws,type:"disputeRequest",cipherblock:this.block.jwe,iat:Math.floor(Date.now()/1e3),dataExchangeId:this.exchange.id},t=await Ki(this.jwkPairDest.privateJwk);try{return await new Li(e).setProtectedHeader({alg:this.jwkPairDest.privateJwk.alg}).setIssuedAt(e.iat).sign(t)}catch(e){throw new rn(e,["unexpected error"])}}},NonRepudiationOrig:class{constructor(e,t,r,n){this.jwkPairOrig={privateJwk:t,publicJwk:JSON.parse(e.orig)},this.publicJwkDest=JSON.parse(e.dest),this.block={raw:r},this.initialized=new Promise(((t,r)=>{this.init(e,n).then((()=>{t(!0)})).catch((e=>{r(e)}))}))}async init(t,r){const n=await oA(t);if(n.length>0){const e=[];let t=[];throw n.forEach((r=>{e.push(r.message),t=t.concat(r.nrErrors)})),t=[...new Set(t)],new rn("Resource has not been validated:\n"+e.join("\n"),t)}this.agreement=t,await Xi(this.jwkPairOrig.publicJwk,this.jwkPairOrig.privateJwk);const o=await Zi(this.agreement.encAlg);this.block={...this.block,secret:o,jwe:await Ji(this.block.raw,o.jwk,this.agreement.encAlg)};const a=e(await oo(this.block.jwe,this.agreement.hashAlg),!0,!1),s=e(await oo(this.block.raw,this.agreement.hashAlg),!0,!1),c=e(await oo(new Uint8Array(i(this.block.secret.hex)),this.agreement.hashAlg),!0,!1),u={...this.agreement,cipherblockDgst:a,blockCommitment:s,secretCommitment:c},f=await Hh(u);this.exchange={...u,id:f},await this._dltSetup(r)}async _dltSetup(e){this.dltAgent=e;const t=await this.dltAgent.getAddress();if(t!==this.exchange.ledgerSignerAddress)throw new Error(`ledgerSignerAddress: ${this.exchange.ledgerSignerAddress} does not meet the address ${t} derived from the provided private key`);const r=await this.dltAgent.getContractAddress();if(r!==no(this.agreement.ledgerContractAddress,!0))throw new Error(`Contract address in use ${r} does not meet the agreed one ${this.agreement.ledgerContractAddress}`)}async generatePoO(){return await this.initialized,this.block.poo=await Kh({proofType:"PoO",iss:"orig",exchange:this.exchange},this.jwkPairOrig.privateJwk),this.block.poo}async verifyPoR(e,t){if(await this.initialized,void 0===this.block.poo)throw new Error("Cannot verify a PoR if not even a PoO have been created");const r={proofType:"PoR",iss:"dest",exchange:this.exchange,poo:this.block.poo.jws},n=1e3*this.block.poo.payload.iat,i={timestamp:Date.now(),notBefore:n,notAfter:n+this.exchange.pooToPorDelay,...t},o=await Jh(e,r,i);return this.block.por={jws:e,payload:o.payload},this.block.por}async generatePoP(){if(await this.initialized,void 0===this.block.por)throw new Error("Before computing a PoP, you have first to have received and verified the PoR");const e=await this.dltAgent.deploySecret(this.block.secret.hex,this.exchange.id),t={proofType:"PoP",iss:"orig",exchange:this.exchange,por:this.block.por.jws,secret:JSON.stringify(this.block.secret.jwk),verificationCode:e};return this.block.pop=await Kh(t,this.jwkPairOrig.privateJwk),this.block.pop}async generateVerificationRequest(){if(await this.initialized,void 0===this.block.por)throw new Error("Before generating a VerificationRequest, you have first to hold a valid PoR for the exchange");return await Xh("orig",this.exchange.id,this.block.por.jws,this.jwkPairOrig.privateJwk)}}});export{Qh as ConflictResolution,en as ENC_ALGS,ip as EthersIoAgentDest,Rp as EthersIoAgentOrig,Qr as HASH_ALGS,cp as I3mServerWalletAgentDest,Op as I3mServerWalletAgentOrig,ap as I3mWalletAgentDest,Np as I3mWalletAgentOrig,tn as KEY_AGREEMENT_ALGS,aA as NonRepudiationProtocol,rn as NrError,Yr as SIGNING_ALGS,Tp as Signers,to as checkTimestamp,Kh as createProof,Yh as defaultDltConfig,Hh as exchangeId,on as generateKeys,qh as getDltAddress,Ki as importJwk,ro as jsonSort,Wi as jweDecrypt,Ji as jweEncrypt,Gi as jwsDecode,Zi as oneTimeSecret,Lh as parseAddress,no as parseHex,io as parseJwk,oo as sha,iA as validateDataExchange,oA as validateDataExchangeAgreement,nA as validateDataSharingAgreementSchema,Xi as verifyKeyPair,Jh as verifyProof}; + deps: ${n}}`};const i={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(e){const[t,r]=function({schema:e}){const t={},r={};for(const n in e){if("__proto__"===n)continue;(Array.isArray(e[n])?t:r)[n]=e[n]}return[t,r]}(e);o(e,t),a(e,r)}};function o(e,r=e.schema){const{gen:i,data:o,it:a}=e;if(0===Object.keys(r).length)return;const s=i.let("missing");for(const c in r){const u=r[c];if(0===u.length)continue;const f=(0,n.propertyInData)(i,o,c,a.opts.ownProperties);e.setParams({property:c,depsCount:u.length,deps:u.join(", ")}),a.allErrors?i.if(f,(()=>{for(const t of u)(0,n.checkReportMissingProp)(e,t)})):(i.if(t._`${f} && (${(0,n.checkMissingProp)(e,u,s)})`),(0,n.reportMissingProp)(e,s),i.else())}}function a(e,t=e.schema){const{gen:i,data:o,keyword:a,it:s}=e,c=i.name("valid");for(const u in t)(0,r.alwaysValidSchema)(s,t[u])||(i.if((0,n.propertyInData)(i,o,u,s.opts.ownProperties),(()=>{const t=e.subschema({keyword:a,schemaProp:u},c);e.mergeValidEvaluated(t,c)}),(()=>i.var(c,!0))),e.ok(c))}e.validatePropertyDeps=o,e.validateSchemaDeps=a,e.default=i}(Gb);var Vb={};Object.defineProperty(Vb,"__esModule",{value:!0});const Zb=qp,Xb=Jp,Qb={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:e})=>Zb._`{propertyName: ${e.propertyName}}`},code(e){const{gen:t,schema:r,data:n,it:i}=e;if((0,Xb.alwaysValidSchema)(i,r))return;const o=t.name("valid");t.forIn("key",n,(r=>{e.setParams({propertyName:r}),e.subschema({keyword:"propertyNames",data:r,dataTypes:["string"],propertyName:r,compositeRule:!0},o),t.if((0,Zb.not)(o),(()=>{e.error(!0),i.allErrors||t.break()}))})),e.ok(o)}};Vb.default=Qb;var Yb={};Object.defineProperty(Yb,"__esModule",{value:!0});const ev=lm,tv=qp,rv=Wp,nv=Jp,iv={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:e})=>tv._`{additionalProperty: ${e.additionalProperty}}`},code(e){const{gen:t,schema:r,parentSchema:n,data:i,errsCount:o,it:a}=e;if(!o)throw new Error("ajv implementation error");const{allErrors:s,opts:c}=a;if(a.props=!0,"all"!==c.removeAdditional&&(0,nv.alwaysValidSchema)(a,r))return;const u=(0,ev.allSchemaProperties)(n.properties),f=(0,ev.allSchemaProperties)(n.patternProperties);function d(e){t.code(tv._`delete ${i}[${e}]`)}function l(n){if("all"===c.removeAdditional||c.removeAdditional&&!1===r)d(n);else{if(!1===r)return e.setParams({additionalProperty:n}),e.error(),void(s||t.break());if("object"==typeof r&&!(0,nv.alwaysValidSchema)(a,r)){const r=t.name("valid");"failing"===c.removeAdditional?(h(n,r,!1),t.if((0,tv.not)(r),(()=>{e.reset(),d(n)}))):(h(n,r),s||t.if((0,tv.not)(r),(()=>t.break())))}}}function h(t,r,n){const i={keyword:"additionalProperties",dataProp:t,dataPropType:nv.Type.Str};!1===n&&Object.assign(i,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(i,r)}t.forIn("key",i,(r=>{u.length||f.length?t.if(function(r){let i;if(u.length>8){const e=(0,nv.schemaRefOrVal)(a,n.properties,"properties");i=(0,ev.isOwnProperty)(t,e,r)}else i=u.length?(0,tv.or)(...u.map((e=>tv._`${r} === ${e}`))):tv.nil;return f.length&&(i=(0,tv.or)(i,...f.map((t=>tv._`${(0,ev.usePattern)(e,t)}.test(${r})`)))),(0,tv.not)(i)}(r),(()=>l(r))):l(r)})),e.ok(tv._`${o} === ${rv.default.errors}`)}};Yb.default=iv;var ov={};Object.defineProperty(ov,"__esModule",{value:!0});const av=zp,sv=lm,cv=Jp,uv=Yb,fv={keyword:"properties",type:"object",schemaType:"object",code(e){const{gen:t,schema:r,parentSchema:n,data:i,it:o}=e;"all"===o.opts.removeAdditional&&void 0===n.additionalProperties&&uv.default.code(new av.KeywordCxt(o,uv.default,"additionalProperties"));const a=(0,sv.allSchemaProperties)(r);for(const e of a)o.definedProperties.add(e);o.opts.unevaluated&&a.length&&!0!==o.props&&(o.props=cv.mergeEvaluated.props(t,(0,cv.toHash)(a),o.props));const s=a.filter((e=>!(0,cv.alwaysValidSchema)(o,r[e])));if(0===s.length)return;const c=t.name("valid");for(const r of s)u(r)?f(r):(t.if((0,sv.propertyInData)(t,i,r,o.opts.ownProperties)),f(r),o.allErrors||t.else().var(c,!0),t.endIf()),e.it.definedProperties.add(r),e.ok(c);function u(e){return o.opts.useDefaults&&!o.compositeRule&&void 0!==r[e].default}function f(t){e.subschema({keyword:"properties",schemaProp:t,dataProp:t},c)}}};ov.default=fv;var dv={};Object.defineProperty(dv,"__esModule",{value:!0});const lv=lm,hv=qp,pv=Jp,mv=Jp,gv={keyword:"patternProperties",type:"object",schemaType:"object",code(e){const{gen:t,schema:r,data:n,parentSchema:i,it:o}=e,{opts:a}=o,s=(0,lv.allSchemaProperties)(r),c=s.filter((e=>(0,pv.alwaysValidSchema)(o,r[e])));if(0===s.length||c.length===s.length&&(!o.opts.unevaluated||!0===o.props))return;const u=a.strictSchema&&!a.allowMatchingProperties&&i.properties,f=t.name("valid");!0===o.props||o.props instanceof hv.Name||(o.props=(0,mv.evaluatedPropsToName)(t,o.props));const{props:d}=o;function l(e){for(const t in u)new RegExp(e).test(t)&&(0,pv.checkStrictMode)(o,`property ${t} matches pattern ${e} (use allowMatchingProperties)`)}function h(r){t.forIn("key",n,(n=>{t.if(hv._`${(0,lv.usePattern)(e,r)}.test(${n})`,(()=>{const i=c.includes(r);i||e.subschema({keyword:"patternProperties",schemaProp:r,dataProp:n,dataPropType:mv.Type.Str},f),o.opts.unevaluated&&!0!==d?t.assign(hv._`${d}[${n}]`,!0):i||o.allErrors||t.if((0,hv.not)(f),(()=>t.break()))}))}))}!function(){for(const e of s)u&&l(e),o.allErrors?h(e):(t.var(f,!0),h(e),t.if(f))}()}};dv.default=gv;var yv={};Object.defineProperty(yv,"__esModule",{value:!0});const bv=Jp,vv={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){const{gen:t,schema:r,it:n}=e;if((0,bv.alwaysValidSchema)(n,r))return void e.fail();const i=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},i),e.failResult(i,(()=>e.reset()),(()=>e.error()))},error:{message:"must NOT be valid"}};yv.default=vv;var wv={};Object.defineProperty(wv,"__esModule",{value:!0});const Av={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:lm.validateUnion,error:{message:"must match a schema in anyOf"}};wv.default=Av;var _v={};Object.defineProperty(_v,"__esModule",{value:!0});const Ev=qp,Sv=Jp,Pv={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:e})=>Ev._`{passingSchemas: ${e.passing}}`},code(e){const{gen:t,schema:r,parentSchema:n,it:i}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(i.opts.discriminator&&n.discriminator)return;const o=r,a=t.let("valid",!1),s=t.let("passing",null),c=t.name("_valid");e.setParams({passing:s}),t.block((function(){o.forEach(((r,n)=>{let o;(0,Sv.alwaysValidSchema)(i,r)?t.var(c,!0):o=e.subschema({keyword:"oneOf",schemaProp:n,compositeRule:!0},c),n>0&&t.if(Ev._`${c} && ${a}`).assign(a,!1).assign(s,Ev._`[${s}, ${n}]`).else(),t.if(c,(()=>{t.assign(a,!0),t.assign(s,n),o&&e.mergeEvaluated(o,Ev.Name)}))}))})),e.result(a,(()=>e.reset()),(()=>e.error(!0)))}};_v.default=Pv;var xv={};Object.defineProperty(xv,"__esModule",{value:!0});const kv=Jp,Mv={keyword:"allOf",schemaType:"array",code(e){const{gen:t,schema:r,it:n}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");const i=t.name("valid");r.forEach(((t,r)=>{if((0,kv.alwaysValidSchema)(n,t))return;const o=e.subschema({keyword:"allOf",schemaProp:r},i);e.ok(i),e.mergeEvaluated(o)}))}};xv.default=Mv;var Cv={};Object.defineProperty(Cv,"__esModule",{value:!0});const Iv=qp,Rv=Jp,Nv={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:e})=>Iv.str`must match "${e.ifClause}" schema`,params:({params:e})=>Iv._`{failingKeyword: ${e.ifClause}}`},code(e){const{gen:t,parentSchema:r,it:n}=e;void 0===r.then&&void 0===r.else&&(0,Rv.checkStrictMode)(n,'"if" without "then" and "else" is ignored');const i=Ov(n,"then"),o=Ov(n,"else");if(!i&&!o)return;const a=t.let("valid",!0),s=t.name("_valid");if(function(){const t=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},s);e.mergeEvaluated(t)}(),e.reset(),i&&o){const r=t.let("ifClause");e.setParams({ifClause:r}),t.if(s,c("then",r),c("else",r))}else i?t.if(s,c("then")):t.if((0,Iv.not)(s),c("else"));function c(r,n){return()=>{const i=e.subschema({keyword:r},s);t.assign(a,s),e.mergeValidEvaluated(i,a),n?t.assign(n,Iv._`${r}`):e.setParams({ifClause:r})}}e.pass(a,(()=>e.error(!0)))}};function Ov(e,t){const r=e.schema[t];return void 0!==r&&!(0,Rv.alwaysValidSchema)(e,r)}Cv.default=Nv;var Tv={};Object.defineProperty(Tv,"__esModule",{value:!0});const jv=Jp,$v={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){void 0===t.if&&(0,jv.checkStrictMode)(r,`"${e}" without "if" is ignored`)}};Tv.default=$v,Object.defineProperty(Eb,"__esModule",{value:!0});const Dv=Sb,Bv=Cb,Fv=Ib,zv=Bb,Uv=Hb,Lv=Gb,qv=Vb,Hv=Yb,Kv=ov,Jv=dv,Wv=yv,Gv=wv,Vv=_v,Zv=xv,Xv=Cv,Qv=Tv;Eb.default=function(e=!1){const t=[Wv.default,Gv.default,Vv.default,Zv.default,Xv.default,Qv.default,qv.default,Hv.default,Lv.default,Kv.default,Jv.default];return e?t.push(Bv.default,zv.default):t.push(Dv.default,Fv.default),t.push(Uv.default),t};var Yv={},ew={};Object.defineProperty(ew,"__esModule",{value:!0});const tw=qp,rw={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>tw.str`must match format "${e}"`,params:({schemaCode:e})=>tw._`{format: ${e}}`},code(e,t){const{gen:r,data:n,$data:i,schema:o,schemaCode:a,it:s}=e,{opts:c,errSchemaPath:u,schemaEnv:f,self:d}=s;c.validateFormats&&(i?function(){const i=r.scopeValue("formats",{ref:d.formats,code:c.code.formats}),o=r.const("fDef",tw._`${i}[${a}]`),s=r.let("fType"),u=r.let("format");r.if(tw._`typeof ${o} == "object" && !(${o} instanceof RegExp)`,(()=>r.assign(s,tw._`${o}.type || "string"`).assign(u,tw._`${o}.validate`)),(()=>r.assign(s,tw._`"string"`).assign(u,o))),e.fail$data((0,tw.or)(!1===c.strictSchema?tw.nil:tw._`${a} && !${u}`,function(){const e=f.$async?tw._`(${o}.async ? await ${u}(${n}) : ${u}(${n}))`:tw._`${u}(${n})`,r=tw._`(typeof ${u} == "function" ? ${e} : ${u}.test(${n}))`;return tw._`${u} && ${u} !== true && ${s} === ${t} && !${r}`}()))}():function(){const i=d.formats[o];if(!i)return void function(){if(!1===c.strictSchema)return void d.logger.warn(e());throw new Error(e());function e(){return`unknown format "${o}" ignored in schema at path "${u}"`}}();if(!0===i)return;const[a,s,l]=function(e){const t=e instanceof RegExp?(0,tw.regexpCode)(e):c.code.formats?tw._`${c.code.formats}${(0,tw.getProperty)(o)}`:void 0,n=r.scopeValue("formats",{key:o,ref:e,code:t});if("object"==typeof e&&!(e instanceof RegExp))return[e.type||"string",e.validate,tw._`${n}.validate`];return["string",e,n]}(i);a===t&&e.pass(function(){if("object"==typeof i&&!(i instanceof RegExp)&&i.async){if(!f.$async)throw new Error("async format in sync schema");return tw._`await ${l}(${n})`}return"function"==typeof s?tw._`${l}(${n})`:tw._`${l}.test(${n})`}())}())}};ew.default=rw,Object.defineProperty(Yv,"__esModule",{value:!0});const nw=[ew.default];Yv.default=nw,Object.defineProperty(Zg,"__esModule",{value:!0});const iw=uy,ow=Eb,aw=Yv,sw=[Xg.default,iw.default,ow.default(),aw.default,["title","description","default"]];Zg.default=sw;var cw,uw,fw={},dw={};cw=dw,Object.defineProperty(cw,"__esModule",{value:!0}),cw.DiscrError=void 0,(uw=cw.DiscrError||(cw.DiscrError={})).Tag="tag",uw.Mapping="mapping",Object.defineProperty(fw,"__esModule",{value:!0});const lw=qp,hw=dw,pw=Ig,mw=Jp,gw={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:e,tagName:t}})=>e===hw.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>lw._`{error: ${e}, tag: ${r}, tagValue: ${t}}`},code(e){const{gen:t,data:r,schema:n,parentSchema:i,it:o}=e,{oneOf:a}=i;if(!o.opts.discriminator)throw new Error("discriminator: requires discriminator option");const s=n.propertyName;if("string"!=typeof s)throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!a)throw new Error("discriminator: requires oneOf keyword");const c=t.let("valid",!1),u=t.const("tag",lw._`${r}${(0,lw.getProperty)(s)}`);function f(r){const n=t.name("valid"),i=e.subschema({keyword:"oneOf",schemaProp:r},n);return e.mergeEvaluated(i,lw.Name),n}t.if(lw._`typeof ${u} == "string"`,(()=>function(){const r=function(){var e;const t={},r=c(i);let n=!0;for(let t=0;te.error(!1,{discrError:hw.DiscrError.Tag,tag:u,tagName:s}))),e.ok(c)}};fw.default=gw;var yw={id:"http://json-schema.org/draft-04/schema#",$schema:"http://json-schema.org/draft-04/schema#",description:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},positiveInteger:{type:"integer",minimum:0},positiveIntegerDefault0:{allOf:[{$ref:"#/definitions/positiveInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},minItems:1,uniqueItems:!0}},type:"object",properties:{id:{type:"string",format:"uri"},$schema:{type:"string",format:"uri"},title:{type:"string"},description:{type:"string"},default:{},multipleOf:{type:"number",minimum:0,exclusiveMinimum:!0},maximum:{type:"number"},exclusiveMaximum:{type:"boolean",default:!1},minimum:{type:"number"},exclusiveMinimum:{type:"boolean",default:!1},maxLength:{$ref:"#/definitions/positiveInteger"},minLength:{$ref:"#/definitions/positiveIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{anyOf:[{type:"boolean"},{$ref:"#"}],default:{}},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:{}},maxItems:{$ref:"#/definitions/positiveInteger"},minItems:{$ref:"#/definitions/positiveIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxProperties:{$ref:"#/definitions/positiveInteger"},minProperties:{$ref:"#/definitions/positiveIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{anyOf:[{type:"boolean"},{$ref:"#"}],default:{}},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},enum:{type:"array",minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},dependencies:{exclusiveMaximum:["maximum"],exclusiveMinimum:["minimum"]},default:{}};!function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;const r=Fp,n=Zg,i=fw,o=yw,a=["/properties"],s="http://json-schema.org/draft-04/schema";class c extends r.default{constructor(e={}){super({...e,schemaId:"id"})}_addVocabularies(){super._addVocabularies(),n.default.forEach((e=>this.addVocabulary(e))),this.opts.discriminator&&this.addKeyword(i.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const e=this.opts.$data?this.$dataMetaSchema(o,a):o;this.addMetaSchema(e,s,!1),this.refs["http://json-schema.org/schema"]=s}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(s)?s:void 0)}}e.exports=t=c,Object.defineProperty(t,"__esModule",{value:!0}),t.default=c;var u=Fp;Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return u.KeywordCxt}});var f=Fp;Object.defineProperty(t,"_",{enumerable:!0,get:function(){return f._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return f.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return f.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return f.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return f.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return f.CodeGen}})}(Bp,Bp.exports);var bw=u(Bp.exports),vw={exports:{}},ww={};!function(e){function t(e,t){return{validate:e,compare:t}}Object.defineProperty(e,"__esModule",{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0,e.fullFormats={date:t(i,o),time:t(s,c),"date-time":t((function(e){const t=e.split(u);return 2===t.length&&i(t[0])&&s(t[1],!0)}),f),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:function(e){return d.test(e)&&l.test(e)},"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-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f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:function(e){if(y.test(e))return!1;try{return new RegExp(e),!0}catch(e){return!1}},uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:function(e){return h.lastIndex=0,h.test(e)},int32:{type:"number",validate:function(e){return Number.isInteger(e)&&e<=m&&e>=p}},int64:{type:"number",validate:function(e){return Number.isInteger(e)}},float:{type:"number",validate:g},double:{type:"number",validate:g},password:!0,binary:!0},e.fastFormats={...e.fullFormats,date:t(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,o),time:t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,c),"date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,f),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},e.formatNames=Object.keys(e.fullFormats);const r=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,n=[0,31,28,31,30,31,30,31,31,30,31,30,31];function i(e){const t=r.exec(e);if(!t)return!1;const i=+t[1],o=+t[2],a=+t[3];return o>=1&&o<=12&&a>=1&&a<=(2===o&&function(e){return e%4==0&&(e%100!=0||e%400==0)}(i)?29:n[o])}function o(e,t){if(e&&t)return e>t?1:e(t=n[1]+n[2]+n[3]+(n[4]||""))?1:e=",ok:Nw.GTE,fail:Nw.LT},exclusiveMaximum:{okStr:"<",ok:Nw.LT,fail:Nw.GTE},exclusiveMinimum:{okStr:">",ok:Nw.GT,fail:Nw.LTE}},Tw={message:({keyword:e,schemaCode:t})=>Rw.str`must be ${Ow[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>Rw._`{comparison: ${Ow[e].okStr}, limit: ${t}}`},jw={keyword:Object.keys(Ow),type:"number",schemaType:"number",$data:!0,error:Tw,code(e){const{keyword:t,data:r,schemaCode:n}=e;e.fail$data(Rw._`${r} ${Ow[t].fail} ${n} || isNaN(${r})`)}};Iw.default=jw,Object.defineProperty(Cw,"__esModule",{value:!0});const $w=wy,Dw=Ey,Bw=Ry,Fw=jy,zw=Fy,Uw=Hy,Lw=Gy,qw=rb,Hw=sb,Kw=[Iw.default,$w.default,Dw.default,Bw.default,Fw.default,zw.default,Uw.default,Lw.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},qw.default,Hw.default];Cw.default=Kw;var Jw={};Object.defineProperty(Jw,"__esModule",{value:!0}),Jw.contentVocabulary=Jw.metadataVocabulary=void 0,Jw.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],Jw.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"],Object.defineProperty(Ew,"__esModule",{value:!0});const Ww=Cw,Gw=Eb,Vw=Yv,Zw=Jw,Xw=[Sw.default,Ww.default,(0,Gw.default)(),Vw.default,Zw.metadataVocabulary,Zw.contentVocabulary];Ew.default=Xw;var Qw={$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:!0,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:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},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:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},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:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},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:!0};!function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;const r=Fp,n=Ew,i=fw,o=Qw,a=["/properties"],s="http://json-schema.org/draft-07/schema";class c extends r.default{_addVocabularies(){super._addVocabularies(),n.default.forEach((e=>this.addVocabulary(e))),this.opts.discriminator&&this.addKeyword(i.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const e=this.opts.$data?this.$dataMetaSchema(o,a):o;this.addMetaSchema(e,s,!1),this.refs["http://json-schema.org/schema"]=s}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(s)?s:void 0)}}e.exports=t=c,Object.defineProperty(t,"__esModule",{value:!0}),t.default=c;var u=zp;Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return u.KeywordCxt}});var f=qp;Object.defineProperty(t,"_",{enumerable:!0,get:function(){return f._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return f.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return f.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return f.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return f.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return f.CodeGen}});var d=Pg;Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return d.default}});var l=kg;Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return l.default}})}(_w,_w.exports);var Yw=_w.exports;!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;const t=Yw,r=qp,n=r.operators,i={formatMaximum:{okStr:"<=",ok:n.LTE,fail:n.GT},formatMinimum:{okStr:">=",ok:n.GTE,fail:n.LT},formatExclusiveMaximum:{okStr:"<",ok:n.LT,fail:n.GTE},formatExclusiveMinimum:{okStr:">",ok:n.GT,fail:n.LTE}},o={message:({keyword:e,schemaCode:t})=>r.str`should be ${i[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>r._`{comparison: ${i[e].okStr}, limit: ${t}}`};e.formatLimitDefinition={keyword:Object.keys(i),type:"string",schemaType:"string",$data:!0,error:o,code(e){const{gen:n,data:o,schemaCode:a,keyword:s,it:c}=e,{opts:u,self:f}=c;if(!u.validateFormats)return;const d=new t.KeywordCxt(c,f.RULES.all.format.definition,"format");function l(e){return r._`${e}.compare(${o}, ${a}) ${i[s].fail} 0`}d.$data?function(){const t=n.scopeValue("formats",{ref:f.formats,code:u.code.formats}),i=n.const("fmt",r._`${t}[${d.schemaCode}]`);e.fail$data(r.or(r._`typeof ${i} != "object"`,r._`${i} instanceof RegExp`,r._`typeof ${i}.compare != "function"`,l(i)))}():function(){const t=d.schema,i=f.formats[t];if(!i||!0===i)return;if("object"!=typeof i||i instanceof RegExp||"function"!=typeof i.compare)throw new Error(`"${s}": format "${t}" does not define "compare" function`);const o=n.scopeValue("formats",{key:t,ref:i,code:u.code.formats?r._`${u.code.formats}${r.getProperty(t)}`:void 0});e.fail$data(l(o))}()},dependencies:["format"]};e.default=t=>(t.addKeyword(e.formatLimitDefinition),t)}(Aw),function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=ww,n=Aw,i=qp,o=new i.Name("fullFormats"),a=new i.Name("fastFormats"),s=(e,t={keywords:!0})=>{if(Array.isArray(t))return c(e,t,r.fullFormats,o),e;const[i,s]="fast"===t.mode?[r.fastFormats,a]:[r.fullFormats,o];return c(e,t.formats||r.formatNames,i,s),t.keywords&&n.default(e),e};function c(e,t,r,n){var o,a;null!==(o=(a=e.opts.code).formats)&&void 0!==o||(a.formats=i._`require("ajv-formats/dist/formats").${n}`);for(const n of t)e.addFormat(n,r[n])}s.get=(e,t="full")=>{const n=("fast"===t?r.fastFormats:r.fullFormats)[e];if(!n)throw new Error(`Unknown format "${e}"`);return n},e.exports=t=s,Object.defineProperty(t,"__esModule",{value:!0}),t.default=s}(vw,vw.exports);var eA=u(vw.exports),tA={exports:{}};!function(e,t){(function(){var r,n="Expected a function",i="__lodash_hash_undefined__",o="__lodash_placeholder__",a=16,s=32,u=64,f=128,d=256,l=1/0,h=9007199254740991,p=NaN,m=4294967295,g=[["ary",f],["bind",1],["bindKey",2],["curry",8],["curryRight",a],["flip",512],["partial",s],["partialRight",u],["rearg",d]],y="[object Arguments]",b="[object Array]",v="[object Boolean]",w="[object Date]",A="[object Error]",_="[object Function]",E="[object GeneratorFunction]",S="[object Map]",P="[object Number]",x="[object Object]",k="[object Promise]",M="[object RegExp]",C="[object Set]",I="[object String]",R="[object Symbol]",N="[object WeakMap]",O="[object ArrayBuffer]",T="[object DataView]",j="[object Float32Array]",$="[object Float64Array]",D="[object Int8Array]",B="[object Int16Array]",F="[object Int32Array]",z="[object Uint8Array]",U="[object Uint8ClampedArray]",L="[object Uint16Array]",q="[object Uint32Array]",H=/\b__p \+= '';/g,K=/\b(__p \+=) '' \+/g,J=/(__e\(.*?\)|\b__t\)) \+\n'';/g,W=/&(?:amp|lt|gt|quot|#39);/g,G=/[&<>"']/g,V=RegExp(W.source),Z=RegExp(G.source),X=/<%-([\s\S]+?)%>/g,Q=/<%([\s\S]+?)%>/g,Y=/<%=([\s\S]+?)%>/g,ee=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,te=/^\w*$/,re=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ne=/[\\^$.*+?()[\]{}|]/g,ie=RegExp(ne.source),oe=/^\s+/,ae=/\s/,se=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ce=/\{\n\/\* \[wrapped with (.+)\] \*/,ue=/,? & /,fe=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,de=/[()=,{}\[\]\/\s]/,le=/\\(\\)?/g,he=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,pe=/\w*$/,me=/^[-+]0x[0-9a-f]+$/i,ge=/^0b[01]+$/i,ye=/^\[object .+?Constructor\]$/,be=/^0o[0-7]+$/i,ve=/^(?:0|[1-9]\d*)$/,we=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Ae=/($^)/,_e=/['\n\r\u2028\u2029\\]/g,Ee="\\ud800-\\udfff",Se="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Pe="\\u2700-\\u27bf",xe="a-z\\xdf-\\xf6\\xf8-\\xff",ke="A-Z\\xc0-\\xd6\\xd8-\\xde",Me="\\ufe0e\\ufe0f",Ce="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ie="['’]",Re="["+Ee+"]",Ne="["+Ce+"]",Oe="["+Se+"]",Te="\\d+",je="["+Pe+"]",$e="["+xe+"]",De="[^"+Ee+Ce+Te+Pe+xe+ke+"]",Be="\\ud83c[\\udffb-\\udfff]",Fe="[^"+Ee+"]",ze="(?:\\ud83c[\\udde6-\\uddff]){2}",Ue="[\\ud800-\\udbff][\\udc00-\\udfff]",Le="["+ke+"]",qe="\\u200d",He="(?:"+$e+"|"+De+")",Ke="(?:"+Le+"|"+De+")",Je="(?:['’](?:d|ll|m|re|s|t|ve))?",We="(?:['’](?:D|LL|M|RE|S|T|VE))?",Ge="(?:"+Oe+"|"+Be+")"+"?",Ve="["+Me+"]?",Ze=Ve+Ge+("(?:"+qe+"(?:"+[Fe,ze,Ue].join("|")+")"+Ve+Ge+")*"),Xe="(?:"+[je,ze,Ue].join("|")+")"+Ze,Qe="(?:"+[Fe+Oe+"?",Oe,ze,Ue,Re].join("|")+")",Ye=RegExp(Ie,"g"),et=RegExp(Oe,"g"),tt=RegExp(Be+"(?="+Be+")|"+Qe+Ze,"g"),rt=RegExp([Le+"?"+$e+"+"+Je+"(?="+[Ne,Le,"$"].join("|")+")",Ke+"+"+We+"(?="+[Ne,Le+He,"$"].join("|")+")",Le+"?"+He+"+"+Je,Le+"+"+We,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Te,Xe].join("|"),"g"),nt=RegExp("["+qe+Ee+Se+Me+"]"),it=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ot=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],at=-1,st={};st[j]=st[$]=st[D]=st[B]=st[F]=st[z]=st[U]=st[L]=st[q]=!0,st[y]=st[b]=st[O]=st[v]=st[T]=st[w]=st[A]=st[_]=st[S]=st[P]=st[x]=st[M]=st[C]=st[I]=st[N]=!1;var ct={};ct[y]=ct[b]=ct[O]=ct[T]=ct[v]=ct[w]=ct[j]=ct[$]=ct[D]=ct[B]=ct[F]=ct[S]=ct[P]=ct[x]=ct[M]=ct[C]=ct[I]=ct[R]=ct[z]=ct[U]=ct[L]=ct[q]=!0,ct[A]=ct[_]=ct[N]=!1;var ut={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ft=parseFloat,dt=parseInt,lt="object"==typeof c&&c&&c.Object===Object&&c,ht="object"==typeof self&&self&&self.Object===Object&&self,pt=lt||ht||Function("return this")(),mt=t&&!t.nodeType&&t,gt=mt&&e&&!e.nodeType&&e,yt=gt&>.exports===mt,bt=yt&<.process,vt=function(){try{var e=gt&>.require&>.require("util").types;return e||bt&&bt.binding&&bt.binding("util")}catch(e){}}(),wt=vt&&vt.isArrayBuffer,At=vt&&vt.isDate,_t=vt&&vt.isMap,Et=vt&&vt.isRegExp,St=vt&&vt.isSet,Pt=vt&&vt.isTypedArray;function xt(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}function kt(e,t,r,n){for(var i=-1,o=null==e?0:e.length;++i-1}function Ot(e,t,r){for(var n=-1,i=null==e?0:e.length;++n-1;);return r}function rr(e,t){for(var r=e.length;r--&&Lt(t,e[r],0)>-1;);return r}var nr=Wt({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),ir=Wt({"&":"&","<":"<",">":">",'"':""","'":"'"});function or(e){return"\\"+ut[e]}function ar(e){return nt.test(e)}function sr(e){var t=-1,r=Array(e.size);return e.forEach((function(e,n){r[++t]=[n,e]})),r}function cr(e,t){return function(r){return e(t(r))}}function ur(e,t){for(var r=-1,n=e.length,i=0,a=[];++r",""":'"',"'":"'"});var gr=function e(t){var c,ae=(t=null==t?pt:gr.defaults(pt.Object(),t,gr.pick(pt,ot))).Array,Ee=t.Date,Se=t.Error,Pe=t.Function,xe=t.Math,ke=t.Object,Me=t.RegExp,Ce=t.String,Ie=t.TypeError,Re=ae.prototype,Ne=Pe.prototype,Oe=ke.prototype,Te=t["__core-js_shared__"],je=Ne.toString,$e=Oe.hasOwnProperty,De=0,Be=(c=/[^.]+$/.exec(Te&&Te.keys&&Te.keys.IE_PROTO||""))?"Symbol(src)_1."+c:"",Fe=Oe.toString,ze=je.call(ke),Ue=pt._,Le=Me("^"+je.call($e).replace(ne,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),qe=yt?t.Buffer:r,He=t.Symbol,Ke=t.Uint8Array,Je=qe?qe.allocUnsafe:r,We=cr(ke.getPrototypeOf,ke),Ge=ke.create,Ve=Oe.propertyIsEnumerable,Ze=Re.splice,Xe=He?He.isConcatSpreadable:r,Qe=He?He.iterator:r,tt=He?He.toStringTag:r,nt=function(){try{var e=ho(ke,"defineProperty");return e({},"",{}),e}catch(e){}}(),ut=t.clearTimeout!==pt.clearTimeout&&t.clearTimeout,lt=Ee&&Ee.now!==pt.Date.now&&Ee.now,ht=t.setTimeout!==pt.setTimeout&&t.setTimeout,mt=xe.ceil,gt=xe.floor,bt=ke.getOwnPropertySymbols,vt=qe?qe.isBuffer:r,Ft=t.isFinite,Wt=Re.join,yr=cr(ke.keys,ke),br=xe.max,vr=xe.min,wr=Ee.now,Ar=t.parseInt,_r=xe.random,Er=Re.reverse,Sr=ho(t,"DataView"),Pr=ho(t,"Map"),xr=ho(t,"Promise"),kr=ho(t,"Set"),Mr=ho(t,"WeakMap"),Cr=ho(ke,"create"),Ir=Mr&&new Mr,Rr={},Nr=Fo(Sr),Or=Fo(Pr),Tr=Fo(xr),jr=Fo(kr),$r=Fo(Mr),Dr=He?He.prototype:r,Br=Dr?Dr.valueOf:r,Fr=Dr?Dr.toString:r;function zr(e){if(rs(e)&&!Ka(e)&&!(e instanceof Hr)){if(e instanceof qr)return e;if($e.call(e,"__wrapped__"))return zo(e)}return new qr(e)}var Ur=function(){function e(){}return function(t){if(!ts(t))return{};if(Ge)return Ge(t);e.prototype=t;var n=new e;return e.prototype=r,n}}();function Lr(){}function qr(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=r}function Hr(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=m,this.__views__=[]}function Kr(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t=t?e:t)),e}function un(e,t,n,i,o,a){var s,c=1&t,u=2&t,f=4&t;if(n&&(s=o?n(e,i,o,a):n(e)),s!==r)return s;if(!ts(e))return e;var d=Ka(e);if(d){if(s=function(e){var t=e.length,r=new e.constructor(t);t&&"string"==typeof e[0]&&$e.call(e,"index")&&(r.index=e.index,r.input=e.input);return r}(e),!c)return Ii(e,s)}else{var l=go(e),h=l==_||l==E;if(Va(e))return Si(e,c);if(l==x||l==y||h&&!o){if(s=u||h?{}:bo(e),!c)return u?function(e,t){return Ri(e,mo(e),t)}(e,function(e,t){return e&&Ri(t,Os(t),e)}(s,e)):function(e,t){return Ri(e,po(e),t)}(e,on(s,e))}else{if(!ct[l])return o?e:{};s=function(e,t,r){var n=e.constructor;switch(t){case O:return Pi(e);case v:case w:return new n(+e);case T:return function(e,t){var r=t?Pi(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}(e,r);case j:case $:case D:case B:case F:case z:case U:case L:case q:return xi(e,r);case S:return new n;case P:case I:return new n(e);case M:return function(e){var t=new e.constructor(e.source,pe.exec(e));return t.lastIndex=e.lastIndex,t}(e);case C:return new n;case R:return i=e,Br?ke(Br.call(i)):{}}var i}(e,l,c)}}a||(a=new Vr);var p=a.get(e);if(p)return p;a.set(e,s),ss(e)?e.forEach((function(r){s.add(un(r,t,n,r,e,a))})):ns(e)&&e.forEach((function(r,i){s.set(i,un(r,t,n,i,e,a))}));var m=d?r:(f?u?oo:io:u?Os:Ns)(e);return Mt(m||e,(function(r,i){m&&(r=e[i=r]),tn(s,i,un(r,t,n,i,e,a))})),s}function fn(e,t,n){var i=n.length;if(null==e)return!i;for(e=ke(e);i--;){var o=n[i],a=t[o],s=e[o];if(s===r&&!(o in e)||!a(s))return!1}return!0}function dn(e,t,i){if("function"!=typeof e)throw new Ie(n);return No((function(){e.apply(r,i)}),t)}function ln(e,t,r,n){var i=-1,o=Nt,a=!0,s=e.length,c=[],u=t.length;if(!s)return c;r&&(t=Tt(t,Qt(r))),n?(o=Ot,a=!1):t.length>=200&&(o=er,a=!1,t=new Gr(t));e:for(;++i-1},Jr.prototype.set=function(e,t){var r=this.__data__,n=rn(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this},Wr.prototype.clear=function(){this.size=0,this.__data__={hash:new Kr,map:new(Pr||Jr),string:new Kr}},Wr.prototype.delete=function(e){var t=fo(this,e).delete(e);return this.size-=t?1:0,t},Wr.prototype.get=function(e){return fo(this,e).get(e)},Wr.prototype.has=function(e){return fo(this,e).has(e)},Wr.prototype.set=function(e,t){var r=fo(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this},Gr.prototype.add=Gr.prototype.push=function(e){return this.__data__.set(e,i),this},Gr.prototype.has=function(e){return this.__data__.has(e)},Vr.prototype.clear=function(){this.__data__=new Jr,this.size=0},Vr.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},Vr.prototype.get=function(e){return this.__data__.get(e)},Vr.prototype.has=function(e){return this.__data__.has(e)},Vr.prototype.set=function(e,t){var r=this.__data__;if(r instanceof Jr){var n=r.__data__;if(!Pr||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new Wr(n)}return r.set(e,t),this.size=r.size,this};var hn=Ti(An),pn=Ti(_n,!0);function mn(e,t){var r=!0;return hn(e,(function(e,n,i){return r=!!t(e,n,i)})),r}function gn(e,t,n){for(var i=-1,o=e.length;++i0&&r(s)?t>1?bn(s,t-1,r,n,i):jt(i,s):n||(i[i.length]=s)}return i}var vn=ji(),wn=ji(!0);function An(e,t){return e&&vn(e,t,Ns)}function _n(e,t){return e&&wn(e,t,Ns)}function En(e,t){return Rt(t,(function(t){return Qa(e[t])}))}function Sn(e,t){for(var n=0,i=(t=wi(t,e)).length;null!=e&&nt}function Mn(e,t){return null!=e&&$e.call(e,t)}function Cn(e,t){return null!=e&&t in ke(e)}function In(e,t,n){for(var i=n?Ot:Nt,o=e[0].length,a=e.length,s=a,c=ae(a),u=1/0,f=[];s--;){var d=e[s];s&&t&&(d=Tt(d,Qt(t))),u=vr(d.length,u),c[s]=!n&&(t||o>=120&&d.length>=120)?new Gr(s&&d):r}d=e[0];var l=-1,h=c[0];e:for(;++l=s?c:c*("desc"==r[n]?-1:1)}return e.index-t.index}(e,t,r)}))}function Jn(e,t,r){for(var n=-1,i=t.length,o={};++n-1;)s!==e&&Ze.call(s,c,1),Ze.call(e,c,1);return e}function Gn(e,t){for(var r=e?t.length:0,n=r-1;r--;){var i=t[r];if(r==n||i!==o){var o=i;wo(i)?Ze.call(e,i,1):li(e,i)}}return e}function Vn(e,t){return e+gt(_r()*(t-e+1))}function Zn(e,t){var r="";if(!e||t<1||t>h)return r;do{t%2&&(r+=e),(t=gt(t/2))&&(e+=e)}while(t);return r}function Xn(e,t){return Oo(Mo(e,t,ic),e+"")}function Qn(e){return Xr(Us(e))}function Yn(e,t){var r=Us(e);return $o(r,cn(t,0,r.length))}function ei(e,t,n,i){if(!ts(e))return e;for(var o=-1,a=(t=wi(t,e)).length,s=a-1,c=e;null!=c&&++oi?0:i+t),(r=r>i?i:r)<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var o=ae(i);++n>>1,a=e[o];null!==a&&!us(a)&&(r?a<=t:a=200){var u=t?null:Zi(e);if(u)return fr(u);a=!1,i=er,c=new Gr}else c=t?[]:s;e:for(;++n=i?e:ii(e,t,n)}var Ei=ut||function(e){return pt.clearTimeout(e)};function Si(e,t){if(t)return e.slice();var r=e.length,n=Je?Je(r):new e.constructor(r);return e.copy(n),n}function Pi(e){var t=new e.constructor(e.byteLength);return new Ke(t).set(new Ke(e)),t}function xi(e,t){var r=t?Pi(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function ki(e,t){if(e!==t){var n=e!==r,i=null===e,o=e==e,a=us(e),s=t!==r,c=null===t,u=t==t,f=us(t);if(!c&&!f&&!a&&e>t||a&&s&&u&&!c&&!f||i&&s&&u||!n&&u||!o)return 1;if(!i&&!a&&!f&&e1?n[o-1]:r,s=o>2?n[2]:r;for(a=e.length>3&&"function"==typeof a?(o--,a):r,s&&Ao(n[0],n[1],s)&&(a=o<3?r:a,o=1),t=ke(t);++i-1?o[a?t[s]:s]:r}}function zi(e){return no((function(t){var i=t.length,o=i,a=qr.prototype.thru;for(e&&t.reverse();o--;){var s=t[o];if("function"!=typeof s)throw new Ie(n);if(a&&!c&&"wrapper"==so(s))var c=new qr([],!0)}for(o=c?o:i;++o1&&v.reverse(),l&&uc))return!1;var f=a.get(e),d=a.get(t);if(f&&d)return f==t&&d==e;var l=-1,h=!0,p=2&n?new Gr:r;for(a.set(e,t),a.set(t,e);++l-1&&e%1==0&&e1?"& ":"")+t[n],t=t.join(r>2?", ":" "),e.replace(se,"{\n/* [wrapped with "+t+"] */\n")}(n,function(e,t){return Mt(g,(function(r){var n="_."+r[0];t&r[1]&&!Nt(e,n)&&e.push(n)})),e.sort()}(function(e){var t=e.match(ce);return t?t[1].split(ue):[]}(n),r)))}function jo(e){var t=0,n=0;return function(){var i=wr(),o=16-(i-n);if(n=i,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(r,arguments)}}function $o(e,t){var n=-1,i=e.length,o=i-1;for(t=t===r?i:t;++n1?e[t-1]:r;return n="function"==typeof n?(e.pop(),n):r,aa(e,n)}));function ha(e){var t=zr(e);return t.__chain__=!0,t}function pa(e,t){return t(e)}var ma=no((function(e){var t=e.length,n=t?e[0]:0,i=this.__wrapped__,o=function(t){return sn(t,e)};return!(t>1||this.__actions__.length)&&i instanceof Hr&&wo(n)?((i=i.slice(n,+n+(t?1:0))).__actions__.push({func:pa,args:[o],thisArg:r}),new qr(i,this.__chain__).thru((function(e){return t&&!e.length&&e.push(r),e}))):this.thru(o)}));var ga=Ni((function(e,t,r){$e.call(e,r)?++e[r]:an(e,r,1)}));var ya=Fi(Ho),ba=Fi(Ko);function va(e,t){return(Ka(e)?Mt:hn)(e,uo(t,3))}function wa(e,t){return(Ka(e)?Ct:pn)(e,uo(t,3))}var Aa=Ni((function(e,t,r){$e.call(e,r)?e[r].push(t):an(e,r,[t])}));var _a=Xn((function(e,t,r){var n=-1,i="function"==typeof t,o=Wa(e)?ae(e.length):[];return hn(e,(function(e){o[++n]=i?xt(t,e,r):Rn(e,t,r)})),o})),Ea=Ni((function(e,t,r){an(e,r,t)}));function Sa(e,t){return(Ka(e)?Tt:zn)(e,uo(t,3))}var Pa=Ni((function(e,t,r){e[r?0:1].push(t)}),(function(){return[[],[]]}));var xa=Xn((function(e,t){if(null==e)return[];var r=t.length;return r>1&&Ao(e,t[0],t[1])?t=[]:r>2&&Ao(t[0],t[1],t[2])&&(t=[t[0]]),Kn(e,bn(t,1),[])})),ka=lt||function(){return pt.Date.now()};function Ma(e,t,n){return t=n?r:t,t=e&&null==t?e.length:t,Qi(e,f,r,r,r,r,t)}function Ca(e,t){var i;if("function"!=typeof t)throw new Ie(n);return e=ms(e),function(){return--e>0&&(i=t.apply(this,arguments)),e<=1&&(t=r),i}}var Ia=Xn((function(e,t,r){var n=1;if(r.length){var i=ur(r,co(Ia));n|=s}return Qi(e,n,t,r,i)})),Ra=Xn((function(e,t,r){var n=3;if(r.length){var i=ur(r,co(Ra));n|=s}return Qi(t,n,e,r,i)}));function Na(e,t,i){var o,a,s,c,u,f,d=0,l=!1,h=!1,p=!0;if("function"!=typeof e)throw new Ie(n);function m(t){var n=o,i=a;return o=a=r,d=t,c=e.apply(i,n)}function g(e){var n=e-f;return f===r||n>=t||n<0||h&&e-d>=s}function y(){var e=ka();if(g(e))return b(e);u=No(y,function(e){var r=t-(e-f);return h?vr(r,s-(e-d)):r}(e))}function b(e){return u=r,p&&o?m(e):(o=a=r,c)}function v(){var e=ka(),n=g(e);if(o=arguments,a=this,f=e,n){if(u===r)return function(e){return d=e,u=No(y,t),l?m(e):c}(f);if(h)return Ei(u),u=No(y,t),m(f)}return u===r&&(u=No(y,t)),c}return t=ys(t)||0,ts(i)&&(l=!!i.leading,s=(h="maxWait"in i)?br(ys(i.maxWait)||0,t):s,p="trailing"in i?!!i.trailing:p),v.cancel=function(){u!==r&&Ei(u),d=0,o=f=a=u=r},v.flush=function(){return u===r?c:b(ka())},v}var Oa=Xn((function(e,t){return dn(e,1,t)})),Ta=Xn((function(e,t,r){return dn(e,ys(t)||0,r)}));function ja(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Ie(n);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var a=e.apply(this,n);return r.cache=o.set(i,a)||o,a};return r.cache=new(ja.Cache||Wr),r}function $a(e){if("function"!=typeof e)throw new Ie(n);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}ja.Cache=Wr;var Da=Ai((function(e,t){var r=(t=1==t.length&&Ka(t[0])?Tt(t[0],Qt(uo())):Tt(bn(t,1),Qt(uo()))).length;return Xn((function(n){for(var i=-1,o=vr(n.length,r);++i=t})),Ha=Nn(function(){return arguments}())?Nn:function(e){return rs(e)&&$e.call(e,"callee")&&!Ve.call(e,"callee")},Ka=ae.isArray,Ja=wt?Qt(wt):function(e){return rs(e)&&xn(e)==O};function Wa(e){return null!=e&&es(e.length)&&!Qa(e)}function Ga(e){return rs(e)&&Wa(e)}var Va=vt||yc,Za=At?Qt(At):function(e){return rs(e)&&xn(e)==w};function Xa(e){if(!rs(e))return!1;var t=xn(e);return t==A||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!os(e)}function Qa(e){if(!ts(e))return!1;var t=xn(e);return t==_||t==E||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Ya(e){return"number"==typeof e&&e==ms(e)}function es(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=h}function ts(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function rs(e){return null!=e&&"object"==typeof e}var ns=_t?Qt(_t):function(e){return rs(e)&&go(e)==S};function is(e){return"number"==typeof e||rs(e)&&xn(e)==P}function os(e){if(!rs(e)||xn(e)!=x)return!1;var t=We(e);if(null===t)return!0;var r=$e.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&je.call(r)==ze}var as=Et?Qt(Et):function(e){return rs(e)&&xn(e)==M};var ss=St?Qt(St):function(e){return rs(e)&&go(e)==C};function cs(e){return"string"==typeof e||!Ka(e)&&rs(e)&&xn(e)==I}function us(e){return"symbol"==typeof e||rs(e)&&xn(e)==R}var fs=Pt?Qt(Pt):function(e){return rs(e)&&es(e.length)&&!!st[xn(e)]};var ds=Wi(Fn),ls=Wi((function(e,t){return e<=t}));function hs(e){if(!e)return[];if(Wa(e))return cs(e)?hr(e):Ii(e);if(Qe&&e[Qe])return function(e){for(var t,r=[];!(t=e.next()).done;)r.push(t.value);return r}(e[Qe]());var t=go(e);return(t==S?sr:t==C?fr:Us)(e)}function ps(e){return e?(e=ys(e))===l||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function ms(e){var t=ps(e),r=t%1;return t==t?r?t-r:t:0}function gs(e){return e?cn(ms(e),0,m):0}function ys(e){if("number"==typeof e)return e;if(us(e))return p;if(ts(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=ts(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Xt(e);var r=ge.test(e);return r||be.test(e)?dt(e.slice(2),r?2:8):me.test(e)?p:+e}function bs(e){return Ri(e,Os(e))}function vs(e){return null==e?"":fi(e)}var ws=Oi((function(e,t){if(Po(t)||Wa(t))Ri(t,Ns(t),e);else for(var r in t)$e.call(t,r)&&tn(e,r,t[r])})),As=Oi((function(e,t){Ri(t,Os(t),e)})),_s=Oi((function(e,t,r,n){Ri(t,Os(t),e,n)})),Es=Oi((function(e,t,r,n){Ri(t,Ns(t),e,n)})),Ss=no(sn);var Ps=Xn((function(e,t){e=ke(e);var n=-1,i=t.length,o=i>2?t[2]:r;for(o&&Ao(t[0],t[1],o)&&(i=1);++n1),t})),Ri(e,oo(e),r),n&&(r=un(r,7,to));for(var i=t.length;i--;)li(r,t[i]);return r}));var Ds=no((function(e,t){return null==e?{}:function(e,t){return Jn(e,t,(function(t,r){return Ms(e,r)}))}(e,t)}));function Bs(e,t){if(null==e)return{};var r=Tt(oo(e),(function(e){return[e]}));return t=uo(t),Jn(e,r,(function(e,r){return t(e,r[0])}))}var Fs=Xi(Ns),zs=Xi(Os);function Us(e){return null==e?[]:Yt(e,Ns(e))}var Ls=Di((function(e,t,r){return t=t.toLowerCase(),e+(r?qs(t):t)}));function qs(e){return Xs(vs(e).toLowerCase())}function Hs(e){return(e=vs(e))&&e.replace(we,nr).replace(et,"")}var Ks=Di((function(e,t,r){return e+(r?"-":"")+t.toLowerCase()})),Js=Di((function(e,t,r){return e+(r?" ":"")+t.toLowerCase()})),Ws=$i("toLowerCase");var Gs=Di((function(e,t,r){return e+(r?"_":"")+t.toLowerCase()}));var Vs=Di((function(e,t,r){return e+(r?" ":"")+Xs(t)}));var Zs=Di((function(e,t,r){return e+(r?" ":"")+t.toUpperCase()})),Xs=$i("toUpperCase");function Qs(e,t,n){return e=vs(e),(t=n?r:t)===r?function(e){return it.test(e)}(e)?function(e){return e.match(rt)||[]}(e):function(e){return e.match(fe)||[]}(e):e.match(t)||[]}var Ys=Xn((function(e,t){try{return xt(e,r,t)}catch(e){return Xa(e)?e:new Se(e)}})),ec=no((function(e,t){return Mt(t,(function(t){t=Bo(t),an(e,t,Ia(e[t],e))})),e}));function tc(e){return function(){return e}}var rc=zi(),nc=zi(!0);function ic(e){return e}function oc(e){return $n("function"==typeof e?e:un(e,1))}var ac=Xn((function(e,t){return function(r){return Rn(r,e,t)}})),sc=Xn((function(e,t){return function(r){return Rn(e,r,t)}}));function cc(e,t,r){var n=Ns(t),i=En(t,n);null!=r||ts(t)&&(i.length||!n.length)||(r=t,t=e,e=this,i=En(t,Ns(t)));var o=!(ts(r)&&"chain"in r&&!r.chain),a=Qa(e);return Mt(i,(function(r){var n=t[r];e[r]=n,a&&(e.prototype[r]=function(){var t=this.__chain__;if(o||t){var r=e(this.__wrapped__);return(r.__actions__=Ii(this.__actions__)).push({func:n,args:arguments,thisArg:e}),r.__chain__=t,r}return n.apply(e,jt([this.value()],arguments))})})),e}function uc(){}var fc=Hi(Tt),dc=Hi(It),lc=Hi(Bt);function hc(e){return _o(e)?Jt(Bo(e)):function(e){return function(t){return Sn(t,e)}}(e)}var pc=Ji(),mc=Ji(!0);function gc(){return[]}function yc(){return!1}var bc=qi((function(e,t){return e+t}),0),vc=Vi("ceil"),wc=qi((function(e,t){return e/t}),1),Ac=Vi("floor");var _c,Ec=qi((function(e,t){return e*t}),1),Sc=Vi("round"),Pc=qi((function(e,t){return e-t}),0);return zr.after=function(e,t){if("function"!=typeof t)throw new Ie(n);return e=ms(e),function(){if(--e<1)return t.apply(this,arguments)}},zr.ary=Ma,zr.assign=ws,zr.assignIn=As,zr.assignInWith=_s,zr.assignWith=Es,zr.at=Ss,zr.before=Ca,zr.bind=Ia,zr.bindAll=ec,zr.bindKey=Ra,zr.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Ka(e)?e:[e]},zr.chain=ha,zr.chunk=function(e,t,n){t=(n?Ao(e,t,n):t===r)?1:br(ms(t),0);var i=null==e?0:e.length;if(!i||t<1)return[];for(var o=0,a=0,s=ae(mt(i/t));oo?0:o+n),(i=i===r||i>o?o:ms(i))<0&&(i+=o),i=n>i?0:gs(i);n>>0)?(e=vs(e))&&("string"==typeof t||null!=t&&!as(t))&&!(t=fi(t))&&ar(e)?_i(hr(e),0,n):e.split(t,n):[]},zr.spread=function(e,t){if("function"!=typeof e)throw new Ie(n);return t=null==t?0:br(ms(t),0),Xn((function(r){var n=r[t],i=_i(r,0,t);return n&&jt(i,n),xt(e,this,i)}))},zr.tail=function(e){var t=null==e?0:e.length;return t?ii(e,1,t):[]},zr.take=function(e,t,n){return e&&e.length?ii(e,0,(t=n||t===r?1:ms(t))<0?0:t):[]},zr.takeRight=function(e,t,n){var i=null==e?0:e.length;return i?ii(e,(t=i-(t=n||t===r?1:ms(t)))<0?0:t,i):[]},zr.takeRightWhile=function(e,t){return e&&e.length?pi(e,uo(t,3),!1,!0):[]},zr.takeWhile=function(e,t){return e&&e.length?pi(e,uo(t,3)):[]},zr.tap=function(e,t){return t(e),e},zr.throttle=function(e,t,r){var i=!0,o=!0;if("function"!=typeof e)throw new Ie(n);return ts(r)&&(i="leading"in r?!!r.leading:i,o="trailing"in r?!!r.trailing:o),Na(e,t,{leading:i,maxWait:t,trailing:o})},zr.thru=pa,zr.toArray=hs,zr.toPairs=Fs,zr.toPairsIn=zs,zr.toPath=function(e){return Ka(e)?Tt(e,Bo):us(e)?[e]:Ii(Do(vs(e)))},zr.toPlainObject=bs,zr.transform=function(e,t,r){var n=Ka(e),i=n||Va(e)||fs(e);if(t=uo(t,4),null==r){var o=e&&e.constructor;r=i?n?new o:[]:ts(e)&&Qa(o)?Ur(We(e)):{}}return(i?Mt:An)(e,(function(e,n,i){return t(r,e,n,i)})),r},zr.unary=function(e){return Ma(e,1)},zr.union=ra,zr.unionBy=na,zr.unionWith=ia,zr.uniq=function(e){return e&&e.length?di(e):[]},zr.uniqBy=function(e,t){return e&&e.length?di(e,uo(t,2)):[]},zr.uniqWith=function(e,t){return t="function"==typeof t?t:r,e&&e.length?di(e,r,t):[]},zr.unset=function(e,t){return null==e||li(e,t)},zr.unzip=oa,zr.unzipWith=aa,zr.update=function(e,t,r){return null==e?e:hi(e,t,vi(r))},zr.updateWith=function(e,t,n,i){return i="function"==typeof i?i:r,null==e?e:hi(e,t,vi(n),i)},zr.values=Us,zr.valuesIn=function(e){return null==e?[]:Yt(e,Os(e))},zr.without=sa,zr.words=Qs,zr.wrap=function(e,t){return Ba(vi(t),e)},zr.xor=ca,zr.xorBy=ua,zr.xorWith=fa,zr.zip=da,zr.zipObject=function(e,t){return yi(e||[],t||[],tn)},zr.zipObjectDeep=function(e,t){return yi(e||[],t||[],ei)},zr.zipWith=la,zr.entries=Fs,zr.entriesIn=zs,zr.extend=As,zr.extendWith=_s,cc(zr,zr),zr.add=bc,zr.attempt=Ys,zr.camelCase=Ls,zr.capitalize=qs,zr.ceil=vc,zr.clamp=function(e,t,n){return n===r&&(n=t,t=r),n!==r&&(n=(n=ys(n))==n?n:0),t!==r&&(t=(t=ys(t))==t?t:0),cn(ys(e),t,n)},zr.clone=function(e){return un(e,4)},zr.cloneDeep=function(e){return un(e,5)},zr.cloneDeepWith=function(e,t){return un(e,5,t="function"==typeof t?t:r)},zr.cloneWith=function(e,t){return un(e,4,t="function"==typeof t?t:r)},zr.conformsTo=function(e,t){return null==t||fn(e,t,Ns(t))},zr.deburr=Hs,zr.defaultTo=function(e,t){return null==e||e!=e?t:e},zr.divide=wc,zr.endsWith=function(e,t,n){e=vs(e),t=fi(t);var i=e.length,o=n=n===r?i:cn(ms(n),0,i);return(n-=t.length)>=0&&e.slice(n,o)==t},zr.eq=Ua,zr.escape=function(e){return(e=vs(e))&&Z.test(e)?e.replace(G,ir):e},zr.escapeRegExp=function(e){return(e=vs(e))&&ie.test(e)?e.replace(ne,"\\$&"):e},zr.every=function(e,t,n){var i=Ka(e)?It:mn;return n&&Ao(e,t,n)&&(t=r),i(e,uo(t,3))},zr.find=ya,zr.findIndex=Ho,zr.findKey=function(e,t){return zt(e,uo(t,3),An)},zr.findLast=ba,zr.findLastIndex=Ko,zr.findLastKey=function(e,t){return zt(e,uo(t,3),_n)},zr.floor=Ac,zr.forEach=va,zr.forEachRight=wa,zr.forIn=function(e,t){return null==e?e:vn(e,uo(t,3),Os)},zr.forInRight=function(e,t){return null==e?e:wn(e,uo(t,3),Os)},zr.forOwn=function(e,t){return e&&An(e,uo(t,3))},zr.forOwnRight=function(e,t){return e&&_n(e,uo(t,3))},zr.get=ks,zr.gt=La,zr.gte=qa,zr.has=function(e,t){return null!=e&&yo(e,t,Mn)},zr.hasIn=Ms,zr.head=Wo,zr.identity=ic,zr.includes=function(e,t,r,n){e=Wa(e)?e:Us(e),r=r&&!n?ms(r):0;var i=e.length;return r<0&&(r=br(i+r,0)),cs(e)?r<=i&&e.indexOf(t,r)>-1:!!i&&Lt(e,t,r)>-1},zr.indexOf=function(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var i=null==r?0:ms(r);return i<0&&(i=br(n+i,0)),Lt(e,t,i)},zr.inRange=function(e,t,n){return t=ps(t),n===r?(n=t,t=0):n=ps(n),function(e,t,r){return e>=vr(t,r)&&e=-9007199254740991&&e<=h},zr.isSet=ss,zr.isString=cs,zr.isSymbol=us,zr.isTypedArray=fs,zr.isUndefined=function(e){return e===r},zr.isWeakMap=function(e){return rs(e)&&go(e)==N},zr.isWeakSet=function(e){return rs(e)&&"[object WeakSet]"==xn(e)},zr.join=function(e,t){return null==e?"":Wt.call(e,t)},zr.kebabCase=Ks,zr.last=Xo,zr.lastIndexOf=function(e,t,n){var i=null==e?0:e.length;if(!i)return-1;var o=i;return n!==r&&(o=(o=ms(n))<0?br(i+o,0):vr(o,i-1)),t==t?function(e,t,r){for(var n=r+1;n--;)if(e[n]===t)return n;return n}(e,t,o):Ut(e,Ht,o,!0)},zr.lowerCase=Js,zr.lowerFirst=Ws,zr.lt=ds,zr.lte=ls,zr.max=function(e){return e&&e.length?gn(e,ic,kn):r},zr.maxBy=function(e,t){return e&&e.length?gn(e,uo(t,2),kn):r},zr.mean=function(e){return Kt(e,ic)},zr.meanBy=function(e,t){return Kt(e,uo(t,2))},zr.min=function(e){return e&&e.length?gn(e,ic,Fn):r},zr.minBy=function(e,t){return e&&e.length?gn(e,uo(t,2),Fn):r},zr.stubArray=gc,zr.stubFalse=yc,zr.stubObject=function(){return{}},zr.stubString=function(){return""},zr.stubTrue=function(){return!0},zr.multiply=Ec,zr.nth=function(e,t){return e&&e.length?Hn(e,ms(t)):r},zr.noConflict=function(){return pt._===this&&(pt._=Ue),this},zr.noop=uc,zr.now=ka,zr.pad=function(e,t,r){e=vs(e);var n=(t=ms(t))?lr(e):0;if(!t||n>=t)return e;var i=(t-n)/2;return Ki(gt(i),r)+e+Ki(mt(i),r)},zr.padEnd=function(e,t,r){e=vs(e);var n=(t=ms(t))?lr(e):0;return t&&nt){var i=e;e=t,t=i}if(n||e%1||t%1){var o=_r();return vr(e+o*(t-e+ft("1e-"+((o+"").length-1))),t)}return Vn(e,t)},zr.reduce=function(e,t,r){var n=Ka(e)?$t:Gt,i=arguments.length<3;return n(e,uo(t,4),r,i,hn)},zr.reduceRight=function(e,t,r){var n=Ka(e)?Dt:Gt,i=arguments.length<3;return n(e,uo(t,4),r,i,pn)},zr.repeat=function(e,t,n){return t=(n?Ao(e,t,n):t===r)?1:ms(t),Zn(vs(e),t)},zr.replace=function(){var e=arguments,t=vs(e[0]);return e.length<3?t:t.replace(e[1],e[2])},zr.result=function(e,t,n){var i=-1,o=(t=wi(t,e)).length;for(o||(o=1,e=r);++ih)return[];var r=m,n=vr(e,m);t=uo(t),e-=m;for(var i=Zt(n,t);++r=a)return e;var c=n-lr(i);if(c<1)return i;var u=s?_i(s,0,c).join(""):e.slice(0,c);if(o===r)return u+i;if(s&&(c+=u.length-c),as(o)){if(e.slice(c).search(o)){var f,d=u;for(o.global||(o=Me(o.source,vs(pe.exec(o))+"g")),o.lastIndex=0;f=o.exec(d);)var l=f.index;u=u.slice(0,l===r?c:l)}}else if(e.indexOf(fi(o),c)!=c){var h=u.lastIndexOf(o);h>-1&&(u=u.slice(0,h))}return u+i},zr.unescape=function(e){return(e=vs(e))&&V.test(e)?e.replace(W,mr):e},zr.uniqueId=function(e){var t=++De;return vs(e)+t},zr.upperCase=Zs,zr.upperFirst=Xs,zr.each=va,zr.eachRight=wa,zr.first=Wo,cc(zr,(_c={},An(zr,(function(e,t){$e.call(zr.prototype,t)||(_c[t]=e)})),_c),{chain:!1}),zr.VERSION="4.17.21",Mt(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){zr[e].placeholder=zr})),Mt(["drop","take"],(function(e,t){Hr.prototype[e]=function(n){n=n===r?1:br(ms(n),0);var i=this.__filtered__&&!t?new Hr(this):this.clone();return i.__filtered__?i.__takeCount__=vr(n,i.__takeCount__):i.__views__.push({size:vr(n,m),type:e+(i.__dir__<0?"Right":"")}),i},Hr.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),Mt(["filter","map","takeWhile"],(function(e,t){var r=t+1,n=1==r||3==r;Hr.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:uo(e,3),type:r}),t.__filtered__=t.__filtered__||n,t}})),Mt(["head","last"],(function(e,t){var r="take"+(t?"Right":"");Hr.prototype[e]=function(){return this[r](1).value()[0]}})),Mt(["initial","tail"],(function(e,t){var r="drop"+(t?"":"Right");Hr.prototype[e]=function(){return this.__filtered__?new Hr(this):this[r](1)}})),Hr.prototype.compact=function(){return this.filter(ic)},Hr.prototype.find=function(e){return this.filter(e).head()},Hr.prototype.findLast=function(e){return this.reverse().find(e)},Hr.prototype.invokeMap=Xn((function(e,t){return"function"==typeof e?new Hr(this):this.map((function(r){return Rn(r,e,t)}))})),Hr.prototype.reject=function(e){return this.filter($a(uo(e)))},Hr.prototype.slice=function(e,t){e=ms(e);var n=this;return n.__filtered__&&(e>0||t<0)?new Hr(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==r&&(n=(t=ms(t))<0?n.dropRight(-t):n.take(t-e)),n)},Hr.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Hr.prototype.toArray=function(){return this.take(m)},An(Hr.prototype,(function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),i=/^(?:head|last)$/.test(t),o=zr[i?"take"+("last"==t?"Right":""):t],a=i||/^find/.test(t);o&&(zr.prototype[t]=function(){var t=this.__wrapped__,s=i?[1]:arguments,c=t instanceof Hr,u=s[0],f=c||Ka(t),d=function(e){var t=o.apply(zr,jt([e],s));return i&&l?t[0]:t};f&&n&&"function"==typeof u&&1!=u.length&&(c=f=!1);var l=this.__chain__,h=!!this.__actions__.length,p=a&&!l,m=c&&!h;if(!a&&f){t=m?t:new Hr(this);var g=e.apply(t,s);return g.__actions__.push({func:pa,args:[d],thisArg:r}),new qr(g,l)}return p&&m?e.apply(this,s):(g=this.thru(d),p?i?g.value()[0]:g.value():g)})})),Mt(["pop","push","shift","sort","splice","unshift"],(function(e){var t=Re[e],r=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",n=/^(?:pop|shift)$/.test(e);zr.prototype[e]=function(){var e=arguments;if(n&&!this.__chain__){var i=this.value();return t.apply(Ka(i)?i:[],e)}return this[r]((function(r){return t.apply(Ka(r)?r:[],e)}))}})),An(Hr.prototype,(function(e,t){var r=zr[t];if(r){var n=r.name+"";$e.call(Rr,n)||(Rr[n]=[]),Rr[n].push({name:t,func:r})}})),Rr[Ui(r,2).name]=[{name:"wrapper",func:r}],Hr.prototype.clone=function(){var e=new Hr(this.__wrapped__);return e.__actions__=Ii(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Ii(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Ii(this.__views__),e},Hr.prototype.reverse=function(){if(this.__filtered__){var e=new Hr(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Hr.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,r=Ka(e),n=t<0,i=r?e.length:0,o=function(e,t,r){var n=-1,i=r.length;for(;++n=this.__values__.length;return{done:e,value:e?r:this.__values__[this.__index__++]}},zr.prototype.plant=function(e){for(var t,n=this;n instanceof Lr;){var i=zo(n);i.__index__=0,i.__values__=r,t?o.__wrapped__=i:t=i;var o=i;n=n.__wrapped__}return o.__wrapped__=e,t},zr.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Hr){var t=e;return this.__actions__.length&&(t=new Hr(this)),(t=t.reverse()).__actions__.push({func:pa,args:[ta],thisArg:r}),new qr(t,this.__chain__)}return this.thru(ta)},zr.prototype.toJSON=zr.prototype.valueOf=zr.prototype.value=function(){return mi(this.__wrapped__,this.__actions__)},zr.prototype.first=zr.prototype.head,Qe&&(zr.prototype[Qe]=function(){return this}),zr}();gt?((gt.exports=gr)._=gr,mt._=gr):pt._=gr}).call(c)}(tA,tA.exports);var rA=u(tA.exports),nA={id:"https://spec.openapis.org/oas/3.0/schema/2021-09-28",$schema:"http://json-schema.org/draft-04/schema#",description:"The description of OpenAPI v3.0.x documents, as defined by https://spec.openapis.org/oas/v3.0.3",type:"object",required:["openapi","info","paths"],properties:{openapi:{type:"string",pattern:"^3\\.0\\.\\d(-.+)?$"},info:{$ref:"#/definitions/Info"},externalDocs:{$ref:"#/definitions/ExternalDocumentation"},servers:{type:"array",items:{$ref:"#/definitions/Server"}},security:{type:"array",items:{$ref:"#/definitions/SecurityRequirement"}},tags:{type:"array",items:{$ref:"#/definitions/Tag"},uniqueItems:!0},paths:{$ref:"#/definitions/Paths"},components:{$ref:"#/definitions/Components"}},patternProperties:{"^x-":{}},additionalProperties:!1,definitions:{Reference:{type:"object",required:["$ref"],patternProperties:{"^\\$ref$":{type:"string",format:"uri-reference"}}},Info:{type:"object",required:["title","version"],properties:{title:{type:"string"},description:{type:"string"},termsOfService:{type:"string",format:"uri-reference"},contact:{$ref:"#/definitions/Contact"},license:{$ref:"#/definitions/License"},version:{type:"string"}},patternProperties:{"^x-":{}},additionalProperties:!1},Contact:{type:"object",properties:{name:{type:"string"},url:{type:"string",format:"uri-reference"},email:{type:"string",format:"email"}},patternProperties:{"^x-":{}},additionalProperties:!1},License:{type:"object",required:["name"],properties:{name:{type:"string"},url:{type:"string",format:"uri-reference"}},patternProperties:{"^x-":{}},additionalProperties:!1},Server:{type:"object",required:["url"],properties:{url:{type:"string"},description:{type:"string"},variables:{type:"object",additionalProperties:{$ref:"#/definitions/ServerVariable"}}},patternProperties:{"^x-":{}},additionalProperties:!1},ServerVariable:{type:"object",required:["default"],properties:{enum:{type:"array",items:{type:"string"}},default:{type:"string"},description:{type:"string"}},patternProperties:{"^x-":{}},additionalProperties:!1},Components:{type:"object",properties:{schemas:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]}}},responses:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/Response"}]}}},parameters:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/Parameter"}]}}},examples:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/Example"}]}}},requestBodies:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/RequestBody"}]}}},headers:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/Header"}]}}},securitySchemes:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/SecurityScheme"}]}}},links:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/Link"}]}}},callbacks:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/Callback"}]}}}},patternProperties:{"^x-":{}},additionalProperties:!1},Schema:{type:"object",properties:{title:{type:"string"},multipleOf:{type:"number",minimum:0,exclusiveMinimum:!0},maximum:{type:"number"},exclusiveMaximum:{type:"boolean",default:!1},minimum:{type:"number"},exclusiveMinimum:{type:"boolean",default:!1},maxLength:{type:"integer",minimum:0},minLength:{type:"integer",minimum:0,default:0},pattern:{type:"string",format:"regex"},maxItems:{type:"integer",minimum:0},minItems:{type:"integer",minimum:0,default:0},uniqueItems:{type:"boolean",default:!1},maxProperties:{type:"integer",minimum:0},minProperties:{type:"integer",minimum:0,default:0},required:{type:"array",items:{type:"string"},minItems:1,uniqueItems:!0},enum:{type:"array",items:{},minItems:1,uniqueItems:!1},type:{type:"string",enum:["array","boolean","integer","number","object","string"]},not:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]},allOf:{type:"array",items:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]}},oneOf:{type:"array",items:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]}},anyOf:{type:"array",items:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]}},items:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]},properties:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]}},additionalProperties:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"},{type:"boolean"}],default:!0},description:{type:"string"},format:{type:"string"},default:{},nullable:{type:"boolean",default:!1},discriminator:{$ref:"#/definitions/Discriminator"},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},example:{},externalDocs:{$ref:"#/definitions/ExternalDocumentation"},deprecated:{type:"boolean",default:!1},xml:{$ref:"#/definitions/XML"}},patternProperties:{"^x-":{}},additionalProperties:!1},Discriminator:{type:"object",required:["propertyName"],properties:{propertyName:{type:"string"},mapping:{type:"object",additionalProperties:{type:"string"}}}},XML:{type:"object",properties:{name:{type:"string"},namespace:{type:"string",format:"uri"},prefix:{type:"string"},attribute:{type:"boolean",default:!1},wrapped:{type:"boolean",default:!1}},patternProperties:{"^x-":{}},additionalProperties:!1},Response:{type:"object",required:["description"],properties:{description:{type:"string"},headers:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Header"},{$ref:"#/definitions/Reference"}]}},content:{type:"object",additionalProperties:{$ref:"#/definitions/MediaType"}},links:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Link"},{$ref:"#/definitions/Reference"}]}}},patternProperties:{"^x-":{}},additionalProperties:!1},MediaType:{type:"object",properties:{schema:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]},example:{},examples:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Example"},{$ref:"#/definitions/Reference"}]}},encoding:{type:"object",additionalProperties:{$ref:"#/definitions/Encoding"}}},patternProperties:{"^x-":{}},additionalProperties:!1,allOf:[{$ref:"#/definitions/ExampleXORExamples"}]},Example:{type:"object",properties:{summary:{type:"string"},description:{type:"string"},value:{},externalValue:{type:"string",format:"uri-reference"}},patternProperties:{"^x-":{}},additionalProperties:!1},Header:{type:"object",properties:{description:{type:"string"},required:{type:"boolean",default:!1},deprecated:{type:"boolean",default:!1},allowEmptyValue:{type:"boolean",default:!1},style:{type:"string",enum:["simple"],default:"simple"},explode:{type:"boolean"},allowReserved:{type:"boolean",default:!1},schema:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]},content:{type:"object",additionalProperties:{$ref:"#/definitions/MediaType"},minProperties:1,maxProperties:1},example:{},examples:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Example"},{$ref:"#/definitions/Reference"}]}}},patternProperties:{"^x-":{}},additionalProperties:!1,allOf:[{$ref:"#/definitions/ExampleXORExamples"},{$ref:"#/definitions/SchemaXORContent"}]},Paths:{type:"object",patternProperties:{"^\\/":{$ref:"#/definitions/PathItem"},"^x-":{}},additionalProperties:!1},PathItem:{type:"object",properties:{$ref:{type:"string"},summary:{type:"string"},description:{type:"string"},servers:{type:"array",items:{$ref:"#/definitions/Server"}},parameters:{type:"array",items:{oneOf:[{$ref:"#/definitions/Parameter"},{$ref:"#/definitions/Reference"}]},uniqueItems:!0}},patternProperties:{"^(get|put|post|delete|options|head|patch|trace)$":{$ref:"#/definitions/Operation"},"^x-":{}},additionalProperties:!1},Operation:{type:"object",required:["responses"],properties:{tags:{type:"array",items:{type:"string"}},summary:{type:"string"},description:{type:"string"},externalDocs:{$ref:"#/definitions/ExternalDocumentation"},operationId:{type:"string"},parameters:{type:"array",items:{oneOf:[{$ref:"#/definitions/Parameter"},{$ref:"#/definitions/Reference"}]},uniqueItems:!0},requestBody:{oneOf:[{$ref:"#/definitions/RequestBody"},{$ref:"#/definitions/Reference"}]},responses:{$ref:"#/definitions/Responses"},callbacks:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Callback"},{$ref:"#/definitions/Reference"}]}},deprecated:{type:"boolean",default:!1},security:{type:"array",items:{$ref:"#/definitions/SecurityRequirement"}},servers:{type:"array",items:{$ref:"#/definitions/Server"}}},patternProperties:{"^x-":{}},additionalProperties:!1},Responses:{type:"object",properties:{default:{oneOf:[{$ref:"#/definitions/Response"},{$ref:"#/definitions/Reference"}]}},patternProperties:{"^[1-5](?:\\d{2}|XX)$":{oneOf:[{$ref:"#/definitions/Response"},{$ref:"#/definitions/Reference"}]},"^x-":{}},minProperties:1,additionalProperties:!1},SecurityRequirement:{type:"object",additionalProperties:{type:"array",items:{type:"string"}}},Tag:{type:"object",required:["name"],properties:{name:{type:"string"},description:{type:"string"},externalDocs:{$ref:"#/definitions/ExternalDocumentation"}},patternProperties:{"^x-":{}},additionalProperties:!1},ExternalDocumentation:{type:"object",required:["url"],properties:{description:{type:"string"},url:{type:"string",format:"uri-reference"}},patternProperties:{"^x-":{}},additionalProperties:!1},ExampleXORExamples:{description:"Example and examples are mutually exclusive",not:{required:["example","examples"]}},SchemaXORContent:{description:"Schema and content are mutually exclusive, at least one is required",not:{required:["schema","content"]},oneOf:[{required:["schema"]},{required:["content"],description:"Some properties are not allowed if content is present",allOf:[{not:{required:["style"]}},{not:{required:["explode"]}},{not:{required:["allowReserved"]}},{not:{required:["example"]}},{not:{required:["examples"]}}]}]},Parameter:{type:"object",properties:{name:{type:"string"},in:{type:"string"},description:{type:"string"},required:{type:"boolean",default:!1},deprecated:{type:"boolean",default:!1},allowEmptyValue:{type:"boolean",default:!1},style:{type:"string"},explode:{type:"boolean"},allowReserved:{type:"boolean",default:!1},schema:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]},content:{type:"object",additionalProperties:{$ref:"#/definitions/MediaType"},minProperties:1,maxProperties:1},example:{},examples:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Example"},{$ref:"#/definitions/Reference"}]}}},patternProperties:{"^x-":{}},additionalProperties:!1,required:["name","in"],allOf:[{$ref:"#/definitions/ExampleXORExamples"},{$ref:"#/definitions/SchemaXORContent"},{$ref:"#/definitions/ParameterLocation"}]},ParameterLocation:{description:"Parameter location",oneOf:[{description:"Parameter in path",required:["required"],properties:{in:{enum:["path"]},style:{enum:["matrix","label","simple"],default:"simple"},required:{enum:[!0]}}},{description:"Parameter in query",properties:{in:{enum:["query"]},style:{enum:["form","spaceDelimited","pipeDelimited","deepObject"],default:"form"}}},{description:"Parameter in header",properties:{in:{enum:["header"]},style:{enum:["simple"],default:"simple"}}},{description:"Parameter in cookie",properties:{in:{enum:["cookie"]},style:{enum:["form"],default:"form"}}}]},RequestBody:{type:"object",required:["content"],properties:{description:{type:"string"},content:{type:"object",additionalProperties:{$ref:"#/definitions/MediaType"}},required:{type:"boolean",default:!1}},patternProperties:{"^x-":{}},additionalProperties:!1},SecurityScheme:{oneOf:[{$ref:"#/definitions/APIKeySecurityScheme"},{$ref:"#/definitions/HTTPSecurityScheme"},{$ref:"#/definitions/OAuth2SecurityScheme"},{$ref:"#/definitions/OpenIdConnectSecurityScheme"}]},APIKeySecurityScheme:{type:"object",required:["type","name","in"],properties:{type:{type:"string",enum:["apiKey"]},name:{type:"string"},in:{type:"string",enum:["header","query","cookie"]},description:{type:"string"}},patternProperties:{"^x-":{}},additionalProperties:!1},HTTPSecurityScheme:{type:"object",required:["scheme","type"],properties:{scheme:{type:"string"},bearerFormat:{type:"string"},description:{type:"string"},type:{type:"string",enum:["http"]}},patternProperties:{"^x-":{}},additionalProperties:!1,oneOf:[{description:"Bearer",properties:{scheme:{type:"string",pattern:"^[Bb][Ee][Aa][Rr][Ee][Rr]$"}}},{description:"Non Bearer",not:{required:["bearerFormat"]},properties:{scheme:{not:{type:"string",pattern:"^[Bb][Ee][Aa][Rr][Ee][Rr]$"}}}}]},OAuth2SecurityScheme:{type:"object",required:["type","flows"],properties:{type:{type:"string",enum:["oauth2"]},flows:{$ref:"#/definitions/OAuthFlows"},description:{type:"string"}},patternProperties:{"^x-":{}},additionalProperties:!1},OpenIdConnectSecurityScheme:{type:"object",required:["type","openIdConnectUrl"],properties:{type:{type:"string",enum:["openIdConnect"]},openIdConnectUrl:{type:"string",format:"uri-reference"},description:{type:"string"}},patternProperties:{"^x-":{}},additionalProperties:!1},OAuthFlows:{type:"object",properties:{implicit:{$ref:"#/definitions/ImplicitOAuthFlow"},password:{$ref:"#/definitions/PasswordOAuthFlow"},clientCredentials:{$ref:"#/definitions/ClientCredentialsFlow"},authorizationCode:{$ref:"#/definitions/AuthorizationCodeOAuthFlow"}},patternProperties:{"^x-":{}},additionalProperties:!1},ImplicitOAuthFlow:{type:"object",required:["authorizationUrl","scopes"],properties:{authorizationUrl:{type:"string",format:"uri-reference"},refreshUrl:{type:"string",format:"uri-reference"},scopes:{type:"object",additionalProperties:{type:"string"}}},patternProperties:{"^x-":{}},additionalProperties:!1},PasswordOAuthFlow:{type:"object",required:["tokenUrl","scopes"],properties:{tokenUrl:{type:"string",format:"uri-reference"},refreshUrl:{type:"string",format:"uri-reference"},scopes:{type:"object",additionalProperties:{type:"string"}}},patternProperties:{"^x-":{}},additionalProperties:!1},ClientCredentialsFlow:{type:"object",required:["tokenUrl","scopes"],properties:{tokenUrl:{type:"string",format:"uri-reference"},refreshUrl:{type:"string",format:"uri-reference"},scopes:{type:"object",additionalProperties:{type:"string"}}},patternProperties:{"^x-":{}},additionalProperties:!1},AuthorizationCodeOAuthFlow:{type:"object",required:["authorizationUrl","tokenUrl","scopes"],properties:{authorizationUrl:{type:"string",format:"uri-reference"},tokenUrl:{type:"string",format:"uri-reference"},refreshUrl:{type:"string",format:"uri-reference"},scopes:{type:"object",additionalProperties:{type:"string"}}},patternProperties:{"^x-":{}},additionalProperties:!1},Link:{type:"object",properties:{operationId:{type:"string"},operationRef:{type:"string",format:"uri-reference"},parameters:{type:"object",additionalProperties:{}},requestBody:{},description:{type:"string"},server:{$ref:"#/definitions/Server"}},patternProperties:{"^x-":{}},additionalProperties:!1,not:{description:"Operation Id and Operation Ref are mutually exclusive",required:["operationId","operationRef"]}},Callback:{type:"object",additionalProperties:{$ref:"#/definitions/PathItem"},patternProperties:{"^x-":{}}},Encoding:{type:"object",properties:{contentType:{type:"string"},headers:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Header"},{$ref:"#/definitions/Reference"}]}},style:{type:"string",enum:["form","spaceDelimited","pipeDelimited","deepObject"]},explode:{type:"boolean"},allowReserved:{type:"boolean",default:!1}},additionalProperties:!1}}};function iA(e){if(new Date(e).getTime()>0)return Number(e);throw new on(new Error("invalid timestamp"),["invalid timestamp"])}async function oA(e){const t=[],r=new bw({strictSchema:!1,removeAdditional:"all"});r.addMetaSchema(nA),eA(r);const n=Dp.schemas.DataSharingAgreement;try{const i=r.compile(n),o=rA.cloneDeep(e);i(e)||null!==i.errors&&void 0!==i.errors&&i.errors.length>0&&i.errors.forEach((e=>{t.push(new on(`[${e.instancePath}] ${e.message??"unknown"}`,["invalid format"]))})),ro(o)!==ro(e)&&t.push(new on("Additional claims beyond the schema are not supported",["invalid format"]))}catch(e){t.push(new on(e,["invalid format"]))}return t}async function aA(e){const t=[];try{const{id:r,...n}=e;r!==await Jh(n)&&t.push(new on("Invalid dataExchange id",["cannot verify","invalid format"]));const{blockCommitment:i,secretCommitment:o,cipherblockDgst:a,...s}=n,c=await sA(s);c.length>0&&c.forEach((e=>{t.push(e)}))}catch(e){t.push(new on("Invalid dataExchange",["cannot verify","invalid format"]))}return t}async function sA(e){const t=[],r=Object.keys(e);(r.length<10||r.length>11)&&t.push(new on(new Error("Invalid agreeemt: "+JSON.stringify(e,void 0,2)),["invalid format"]));for(const n of r){let r;switch(n){case"orig":case"dest":try{e[n]!==await ao(JSON.parse(e[n]),!0)&&t.push(new on(`[dataExchangeAgreeement.${n}] A valid stringified JWK must be provided. For uniqueness, JWK claims must be alphabetically sorted in the stringified JWK. You can use the parseJWK(jwk, true) for that purpose.\n${e[n]}`,["invalid key","invalid format"]))}catch(e){t.push(new on(`[dataExchangeAgreeement.${n}] A valid stringified JWK must be provided. For uniqueness, JWK claims must be alphabetically sorted in the stringified JWK. You can use the parseJWK(jwk, true) for that purpose.`,["invalid key","invalid format"]))}break;case"ledgerContractAddress":case"ledgerSignerAddress":try{r=Hh(e[n]),e[n]!==r&&t.push(new on(`[dataExchangeAgreeement.${n}] Invalid EIP-55 address ${e[n]}. Did you mean ${r} instead?`,["invalid EIP-55 address","invalid format"]))}catch(r){t.push(new on(`[dataExchangeAgreeement.${n}] Invalid EIP-55 address ${e[n]}.`,["invalid EIP-55 address","invalid format"]))}break;case"pooToPorDelay":case"pooToPopDelay":case"pooToSecretDelay":try{e[n]!==iA(e[n])&&t.push(new on(`[dataExchangeAgreeement.${n}] < 0 or not a number`,["invalid timestamp","invalid format"]))}catch(e){t.push(new on(`[dataExchangeAgreeement.${n}] < 0 or not a number`,["invalid timestamp","invalid format"]))}break;case"hashAlg":en.includes(e[n])||t.push(new on(`[dataExchangeAgreeement.${n}Invalid hash algorithm '${e[n]}'. It must be one of: ${en.join(", ")}`,["invalid algorithm"]));break;case"encAlg":rn.includes(e[n])||t.push(new on(`[dataExchangeAgreeement.${n}Invalid encryption algorithm '${e[n]}'. It must be one of: ${rn.join(", ")}`,["invalid algorithm"]));break;case"signingAlg":tn.includes(e[n])||t.push(new on(`[dataExchangeAgreeement.${n}Invalid signing algorithm '${e[n]}'. It must be one of: ${tn.join(", ")}`,["invalid algorithm"]));break;case"schema":break;default:t.push(new on(new Error(`Property ${n} not allowed in dataAgreement`),["invalid format"]))}}return t}var cA=Object.freeze({__proto__:null,NonRepudiationDest:class{constructor(e,t,r){this.initialized=new Promise(((n,i)=>{this.asyncConstructor(e,t,r).then((()=>{n(!0)})).catch((e=>{i(e)}))}))}async asyncConstructor(e,t,r){const n=await sA(e);if(n.length>0){const e=[];let t=[];throw n.forEach((r=>{e.push(r.message),t=t.concat(r.nrErrors)})),t=[...new Set(t)],new on("Resource has not been validated:\n"+e.join("\n"),t)}this.agreement=e,this.jwkPairDest={privateJwk:t,publicJwk:JSON.parse(e.dest)},this.publicJwkOrig=JSON.parse(e.orig),await Yi(this.jwkPairDest.publicJwk,this.jwkPairDest.privateJwk),this.dltAgent=r;const i=await this.dltAgent.getContractAddress();if(this.agreement.ledgerContractAddress!==i)throw new Error(`Contract address ${i} does not meet agreed one ${this.agreement.ledgerContractAddress}`);this.block={}}async verifyPoO(e,t,n){await this.initialized;const i=r(await so(t,this.agreement.hashAlg),!0,!1),{payload:o}=await Zi(e),a={...this.agreement,cipherblockDgst:i,blockCommitment:o.exchange.blockCommitment,secretCommitment:o.exchange.secretCommitment},s={proofType:"PoO",iss:"orig",exchange:{...a,id:await Jh(a)}},c={timestamp:Date.now(),notBefore:"iat",notAfter:"iat",...n},u=await Gh(e,s,c);return this.block={jwe:t,poo:{jws:e,payload:u.payload}},this.exchange=u.payload.exchange,u}async generatePoR(){if(await this.initialized,void 0===this.exchange||void 0===this.block.poo)throw new Error("Before computing a PoR, you have first to receive a valid cipherblock with a PoO and validate the PoO");const e={proofType:"PoR",iss:"dest",exchange:this.exchange,poo:this.block.poo.jws};return this.block.por=await Wh(e,this.jwkPairDest.privateJwk),this.block.por}async verifyPoP(e,t){if(await this.initialized,void 0===this.exchange||void 0===this.block.por||void 0===this.block.poo)throw new Error("Cannot verify a PoP if not even a PoR have been created");const r={proofType:"PoP",iss:"orig",exchange:this.exchange,por:this.block.por.jws,secret:"",verificationCode:""},i={timestamp:Date.now(),notBefore:"iat",notAfter:1e3*this.block.poo.payload.iat+this.exchange.pooToPopDelay,...t},a=await Gh(e,r,i),s=JSON.parse(a.payload.secret);return this.block.secret={hex:o(n(s.k)),jwk:s},this.block.pop={jws:e,payload:a.payload},a}async getSecretFromLedger(){if(await this.initialized,void 0===this.exchange||void 0===this.block.poo||void 0===this.block.por)throw new Error("Cannot get secret if a PoR has not been sent before");const e=Date.now(),t=1e3*this.block.poo.payload.iat+this.agreement.pooToSecretDelay,r=Math.round((t-e)/1e3),{hex:n,iat:i}=await this.dltAgent.getSecretFromLedger(Xi(this.agreement.encAlg),this.agreement.ledgerSignerAddress,this.exchange.id,r);this.block.secret=await Qi(this.exchange.encAlg,n);try{no(1e3*i,1e3*this.block.por.payload.iat,1e3*this.block.poo.payload.iat+this.exchange.pooToSecretDelay)}catch(e){throw new on(`Although the secret has been obtained (and you could try to decrypt the cipherblock), it's been published later than agreed: ${new Date(1e3*i).toUTCString()} > ${new Date(1e3*this.block.poo.payload.iat+this.agreement.pooToSecretDelay).toUTCString()}`,["secret not published in time"])}return this.block.secret}async decrypt(){if(await this.initialized,void 0===this.exchange)throw new Error("No agreed exchange");if(void 0===this.block.secret?.jwk)throw new Error("Cannot decrypt without the secret");if(void 0===this.block.jwe)throw new Error("No cipherblock to decrypt");const e=(await Vi(this.block.jwe,this.block.secret.jwk)).plaintext;if(r(await so(e,this.agreement.hashAlg),!0,!1)!==this.exchange.blockCommitment)throw new Error("Decrypted block does not meet the committed one");return this.block.raw=e,e}async generateVerificationRequest(){if(await this.initialized,void 0===this.block.por||void 0===this.exchange)throw new Error("Before generating a VerificationRequest, you have first to hold a valid PoR for the exchange");return await Yh("dest",this.exchange.id,this.block.por.jws,this.jwkPairDest.privateJwk)}async generateDisputeRequest(){if(await this.initialized,void 0===this.block.por||void 0===this.block.jwe||void 0===this.exchange)throw new Error("Before generating a VerificationRequest, you have first to hold a valid PoR for the exchange and have received the cipherblock");const e={proofType:"request",iss:"dest",por:this.block.por.jws,type:"disputeRequest",cipherblock:this.block.jwe,iat:Math.floor(Date.now()/1e3),dataExchangeId:this.exchange.id},t=await Wi(this.jwkPairDest.privateJwk);try{return await new Hi(e).setProtectedHeader({alg:this.jwkPairDest.privateJwk.alg}).setIssuedAt(e.iat).sign(t)}catch(e){throw new on(e,["unexpected error"])}}},NonRepudiationOrig:class{constructor(e,t,r,n){this.jwkPairOrig={privateJwk:t,publicJwk:JSON.parse(e.orig)},this.publicJwkDest=JSON.parse(e.dest),this.block={raw:r},this.initialized=new Promise(((t,r)=>{this.init(e,n).then((()=>{t(!0)})).catch((e=>{r(e)}))}))}async init(e,t){const n=await sA(e);if(n.length>0){const e=[];let t=[];throw n.forEach((r=>{e.push(r.message),t=t.concat(r.nrErrors)})),t=[...new Set(t)],new on("Resource has not been validated:\n"+e.join("\n"),t)}this.agreement=e,await Yi(this.jwkPairOrig.publicJwk,this.jwkPairOrig.privateJwk);const i=await Qi(this.agreement.encAlg);this.block={...this.block,secret:i,jwe:await Gi(this.block.raw,i.jwk,this.agreement.encAlg)};const o=r(await so(this.block.jwe,this.agreement.hashAlg),!0,!1),s=r(await so(this.block.raw,this.agreement.hashAlg),!0,!1),c=r(await so(new Uint8Array(a(this.block.secret.hex)),this.agreement.hashAlg),!0,!1),u={...this.agreement,cipherblockDgst:o,blockCommitment:s,secretCommitment:c},f=await Jh(u);this.exchange={...u,id:f},await this._dltSetup(t)}async _dltSetup(e){this.dltAgent=e;const t=await this.dltAgent.getAddress();if(t!==this.exchange.ledgerSignerAddress)throw new Error(`ledgerSignerAddress: ${this.exchange.ledgerSignerAddress} does not meet the address ${t} derived from the provided private key`);const r=await this.dltAgent.getContractAddress();if(r!==oo(this.agreement.ledgerContractAddress,!0))throw new Error(`Contract address in use ${r} does not meet the agreed one ${this.agreement.ledgerContractAddress}`)}async generatePoO(){return await this.initialized,this.block.poo=await Wh({proofType:"PoO",iss:"orig",exchange:this.exchange},this.jwkPairOrig.privateJwk),this.block.poo}async verifyPoR(e,t){if(await this.initialized,void 0===this.block.poo)throw new Error("Cannot verify a PoR if not even a PoO have been created");const r={proofType:"PoR",iss:"dest",exchange:this.exchange,poo:this.block.poo.jws},n=1e3*this.block.poo.payload.iat,i={timestamp:Date.now(),notBefore:n,notAfter:n+this.exchange.pooToPorDelay,...t},o=await Gh(e,r,i);return this.block.por={jws:e,payload:o.payload},this.block.por}async generatePoP(){if(await this.initialized,void 0===this.block.por)throw new Error("Before computing a PoP, you have first to have received and verified the PoR");const e=await this.dltAgent.deploySecret(this.block.secret.hex,this.exchange.id),t={proofType:"PoP",iss:"orig",exchange:this.exchange,por:this.block.por.jws,secret:JSON.stringify(this.block.secret.jwk),verificationCode:e};return this.block.pop=await Wh(t,this.jwkPairOrig.privateJwk),this.block.pop}async generateVerificationRequest(){if(await this.initialized,void 0===this.block.por)throw new Error("Before generating a VerificationRequest, you have first to hold a valid PoR for the exchange");return await Yh("orig",this.exchange.id,this.block.por.jws,this.jwkPairOrig.privateJwk)}}});export{ep as ConflictResolution,rn as ENC_ALGS,ap as EthersIoAgentDest,Op as EthersIoAgentOrig,en as HASH_ALGS,fp as I3mServerWalletAgentDest,jp as I3mServerWalletAgentOrig,cp as I3mWalletAgentDest,Tp as I3mWalletAgentOrig,nn as KEY_AGREEMENT_ALGS,cA as NonRepudiationProtocol,on as NrError,tn as SIGNING_ALGS,$p as Signers,no as checkTimestamp,Wh as createProof,tp as defaultDltConfig,Jh as exchangeId,sn as generateKeys,Kh as getDltAddress,Wi as importJwk,io as jsonSort,Vi as jweDecrypt,Gi as jweEncrypt,Zi as jwsDecode,Qi as oneTimeSecret,Hh as parseAddress,oo as parseHex,ao as parseJwk,so as sha,aA as validateDataExchange,sA as validateDataExchangeAgreement,oA as validateDataSharingAgreementSchema,Yi as verifyKeyPair,Gh as verifyProof}; diff --git a/dist/bundle.iife.js b/dist/bundle.iife.js index ba9a25e..0296300 100644 --- a/dist/bundle.iife.js +++ b/dist/bundle.iife.js @@ -1,17 +1,17 @@ -var nonRepudiationLibrary=function(e){"use strict";function t(e,t=!1,r=!0){let n="";return n=(e=>{const t=[];for(let r=0;re.charCodeAt(0))));return t?(new TextDecoder).decode(n):n}}function n(e,t=!1,r){const n=e.match(/^(0x)?([\da-fA-F]+)$/);if(null==n)throw new RangeError("input must be a hexadecimal string, e.g. '0x124fe3a' or '0214f1b2'");let i=n[2];if(void 0!==r){if(r{i+=o[e>>4]+o[15&e]})),n(i,t,r)}}function o(e,t=!1){let r=n(e);return r=n(e,!1,Math.ceil(r.length/2)),Uint8Array.from(r.match(/[\da-fA-F]{2}/g).map((e=>parseInt(e,16)))).buffer}function a(e,t=!1){if(e<1)throw new RangeError("byteLength MUST be > 0");return new Promise((function(r,n){{const n=new Uint8Array(e);if(e<=65536)self.crypto.getRandomValues(n);else for(let t=0;t=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function s(e,t,r){var n=a(e,r);return r-1>=t&&(n|=a(e,r-1)<<4),n}function c(e,t,r,n){for(var i=0,o=Math.min(e.length,r),a=t;a=49?s-49+10:s>=17?s-17+10:s}return i}i.isBN=function(e){return e instanceof i||null!==e&&"object"==typeof e&&e.constructor.wordSize===i.wordSize&&Array.isArray(e.words)},i.max=function(e,t){return e.cmp(t)>0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,n){if("number"==typeof e)return this._initNumber(e,t,n);if("object"==typeof e)return this._initArray(e,t,n);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)a=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===n)for(i=0,o=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this.strip()},i.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n=t;n-=2)i=s(e,t,n)<=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(n=(e.length-t)%2==0?t+1:t;n=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this.strip()},i.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,a=o%n,s=Math.min(o,o-a)+r,u=0,f=r;f1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?""};var u=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],f=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function l(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],a=i*o,s=67108863&a,c=a/67108864|0;r.words[0]=s;for(var u=1;u>>26,d=67108863&c,l=Math.min(u,t.length-1),h=Math.max(0,u-e.length+1);h<=l;h++){var p=u-h|0;f+=(a=(i=0|e.words[p])*(o=0|t.words[h])+d)/67108864|0,d=67108863&a}r.words[u]=0|d,c=0|f}return 0!==c?r.words[u]=0|c:r.length--,r.strip()}i.prototype.toString=function(e,t){var n;if(t=0|t||1,16===(e=e||10)||"hex"===e){n="";for(var i=0,o=0,a=0;a>>24-i&16777215)||a!==this.length-1?u[6-c.length]+c+n:c+n,(i+=2)>=26&&(i-=26,a--)}for(0!==o&&(n=o.toString(16)+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(e===(0|e)&&e>=2&&e<=36){var l=f[e],h=d[e];n="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(h).toString(e);n=(p=p.idivn(h)).isZero()?m+n:u[l-m.length]+m+n}for(this.isZero()&&(n="0"+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},i.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&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(e,t){return r(void 0!==o),this.toArrayLike(o,e,t)},i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},i.prototype.toArrayLike=function(e,t,n){var i=this.byteLength(),o=n||Math.max(1,i);r(i<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0"),this.strip();var a,s,c="le"===t,u=new e(o),f=this.clone();if(c){for(s=0;!f.isZero();s++)a=f.andln(255),f.iushrn(8),u[s]=a;for(;s=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){r("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),n>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-n),this.strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){r("number"==typeof e&&e>=0);var n=e/26|0,i=e%26;return this._expand(n+1),this.words[n]=t?this.words[n]|1<e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},i.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,a=0;a>26,this.words[a]=67108863&t;for(;0!==o&&a>26,this.words[a]=67108863&t;if(0===o&&a>>13,h=0|a[1],p=8191&h,m=h>>>13,g=0|a[2],y=8191&g,b=g>>>13,v=0|a[3],w=8191&v,A=v>>>13,_=0|a[4],E=8191&_,S=_>>>13,P=0|a[5],x=8191&P,k=P>>>13,M=0|a[6],C=8191&M,I=M>>>13,R=0|a[7],N=8191&R,O=R>>>13,T=0|a[8],j=8191&T,D=T>>>13,$=0|a[9],B=8191&$,F=$>>>13,z=0|s[0],U=8191&z,L=z>>>13,q=0|s[1],H=8191&q,K=q>>>13,J=0|s[2],W=8191&J,G=J>>>13,V=0|s[3],Z=8191&V,X=V>>>13,Q=0|s[4],Y=8191&Q,ee=Q>>>13,te=0|s[5],re=8191&te,ne=te>>>13,ie=0|s[6],oe=8191&ie,ae=ie>>>13,se=0|s[7],ce=8191&se,ue=se>>>13,fe=0|s[8],de=8191&fe,le=fe>>>13,he=0|s[9],pe=8191&he,me=he>>>13;r.negative=e.negative^t.negative,r.length=19;var ge=(u+(n=Math.imul(d,U))|0)+((8191&(i=(i=Math.imul(d,L))+Math.imul(l,U)|0))<<13)|0;u=((o=Math.imul(l,L))+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(p,U),i=(i=Math.imul(p,L))+Math.imul(m,U)|0,o=Math.imul(m,L);var ye=(u+(n=n+Math.imul(d,H)|0)|0)+((8191&(i=(i=i+Math.imul(d,K)|0)+Math.imul(l,H)|0))<<13)|0;u=((o=o+Math.imul(l,K)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(y,U),i=(i=Math.imul(y,L))+Math.imul(b,U)|0,o=Math.imul(b,L),n=n+Math.imul(p,H)|0,i=(i=i+Math.imul(p,K)|0)+Math.imul(m,H)|0,o=o+Math.imul(m,K)|0;var be=(u+(n=n+Math.imul(d,W)|0)|0)+((8191&(i=(i=i+Math.imul(d,G)|0)+Math.imul(l,W)|0))<<13)|0;u=((o=o+Math.imul(l,G)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(w,U),i=(i=Math.imul(w,L))+Math.imul(A,U)|0,o=Math.imul(A,L),n=n+Math.imul(y,H)|0,i=(i=i+Math.imul(y,K)|0)+Math.imul(b,H)|0,o=o+Math.imul(b,K)|0,n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(m,W)|0,o=o+Math.imul(m,G)|0;var ve=(u+(n=n+Math.imul(d,Z)|0)|0)+((8191&(i=(i=i+Math.imul(d,X)|0)+Math.imul(l,Z)|0))<<13)|0;u=((o=o+Math.imul(l,X)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(E,U),i=(i=Math.imul(E,L))+Math.imul(S,U)|0,o=Math.imul(S,L),n=n+Math.imul(w,H)|0,i=(i=i+Math.imul(w,K)|0)+Math.imul(A,H)|0,o=o+Math.imul(A,K)|0,n=n+Math.imul(y,W)|0,i=(i=i+Math.imul(y,G)|0)+Math.imul(b,W)|0,o=o+Math.imul(b,G)|0,n=n+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,X)|0;var we=(u+(n=n+Math.imul(d,Y)|0)|0)+((8191&(i=(i=i+Math.imul(d,ee)|0)+Math.imul(l,Y)|0))<<13)|0;u=((o=o+Math.imul(l,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(x,U),i=(i=Math.imul(x,L))+Math.imul(k,U)|0,o=Math.imul(k,L),n=n+Math.imul(E,H)|0,i=(i=i+Math.imul(E,K)|0)+Math.imul(S,H)|0,o=o+Math.imul(S,K)|0,n=n+Math.imul(w,W)|0,i=(i=i+Math.imul(w,G)|0)+Math.imul(A,W)|0,o=o+Math.imul(A,G)|0,n=n+Math.imul(y,Z)|0,i=(i=i+Math.imul(y,X)|0)+Math.imul(b,Z)|0,o=o+Math.imul(b,X)|0,n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(m,Y)|0,o=o+Math.imul(m,ee)|0;var Ae=(u+(n=n+Math.imul(d,re)|0)|0)+((8191&(i=(i=i+Math.imul(d,ne)|0)+Math.imul(l,re)|0))<<13)|0;u=((o=o+Math.imul(l,ne)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(C,U),i=(i=Math.imul(C,L))+Math.imul(I,U)|0,o=Math.imul(I,L),n=n+Math.imul(x,H)|0,i=(i=i+Math.imul(x,K)|0)+Math.imul(k,H)|0,o=o+Math.imul(k,K)|0,n=n+Math.imul(E,W)|0,i=(i=i+Math.imul(E,G)|0)+Math.imul(S,W)|0,o=o+Math.imul(S,G)|0,n=n+Math.imul(w,Z)|0,i=(i=i+Math.imul(w,X)|0)+Math.imul(A,Z)|0,o=o+Math.imul(A,X)|0,n=n+Math.imul(y,Y)|0,i=(i=i+Math.imul(y,ee)|0)+Math.imul(b,Y)|0,o=o+Math.imul(b,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(m,re)|0,o=o+Math.imul(m,ne)|0;var _e=(u+(n=n+Math.imul(d,oe)|0)|0)+((8191&(i=(i=i+Math.imul(d,ae)|0)+Math.imul(l,oe)|0))<<13)|0;u=((o=o+Math.imul(l,ae)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(N,U),i=(i=Math.imul(N,L))+Math.imul(O,U)|0,o=Math.imul(O,L),n=n+Math.imul(C,H)|0,i=(i=i+Math.imul(C,K)|0)+Math.imul(I,H)|0,o=o+Math.imul(I,K)|0,n=n+Math.imul(x,W)|0,i=(i=i+Math.imul(x,G)|0)+Math.imul(k,W)|0,o=o+Math.imul(k,G)|0,n=n+Math.imul(E,Z)|0,i=(i=i+Math.imul(E,X)|0)+Math.imul(S,Z)|0,o=o+Math.imul(S,X)|0,n=n+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(A,Y)|0,o=o+Math.imul(A,ee)|0,n=n+Math.imul(y,re)|0,i=(i=i+Math.imul(y,ne)|0)+Math.imul(b,re)|0,o=o+Math.imul(b,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,ae)|0)+Math.imul(m,oe)|0,o=o+Math.imul(m,ae)|0;var Ee=(u+(n=n+Math.imul(d,ce)|0)|0)+((8191&(i=(i=i+Math.imul(d,ue)|0)+Math.imul(l,ce)|0))<<13)|0;u=((o=o+Math.imul(l,ue)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(j,U),i=(i=Math.imul(j,L))+Math.imul(D,U)|0,o=Math.imul(D,L),n=n+Math.imul(N,H)|0,i=(i=i+Math.imul(N,K)|0)+Math.imul(O,H)|0,o=o+Math.imul(O,K)|0,n=n+Math.imul(C,W)|0,i=(i=i+Math.imul(C,G)|0)+Math.imul(I,W)|0,o=o+Math.imul(I,G)|0,n=n+Math.imul(x,Z)|0,i=(i=i+Math.imul(x,X)|0)+Math.imul(k,Z)|0,o=o+Math.imul(k,X)|0,n=n+Math.imul(E,Y)|0,i=(i=i+Math.imul(E,ee)|0)+Math.imul(S,Y)|0,o=o+Math.imul(S,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(A,re)|0,o=o+Math.imul(A,ne)|0,n=n+Math.imul(y,oe)|0,i=(i=i+Math.imul(y,ae)|0)+Math.imul(b,oe)|0,o=o+Math.imul(b,ae)|0,n=n+Math.imul(p,ce)|0,i=(i=i+Math.imul(p,ue)|0)+Math.imul(m,ce)|0,o=o+Math.imul(m,ue)|0;var Se=(u+(n=n+Math.imul(d,de)|0)|0)+((8191&(i=(i=i+Math.imul(d,le)|0)+Math.imul(l,de)|0))<<13)|0;u=((o=o+Math.imul(l,le)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(B,U),i=(i=Math.imul(B,L))+Math.imul(F,U)|0,o=Math.imul(F,L),n=n+Math.imul(j,H)|0,i=(i=i+Math.imul(j,K)|0)+Math.imul(D,H)|0,o=o+Math.imul(D,K)|0,n=n+Math.imul(N,W)|0,i=(i=i+Math.imul(N,G)|0)+Math.imul(O,W)|0,o=o+Math.imul(O,G)|0,n=n+Math.imul(C,Z)|0,i=(i=i+Math.imul(C,X)|0)+Math.imul(I,Z)|0,o=o+Math.imul(I,X)|0,n=n+Math.imul(x,Y)|0,i=(i=i+Math.imul(x,ee)|0)+Math.imul(k,Y)|0,o=o+Math.imul(k,ee)|0,n=n+Math.imul(E,re)|0,i=(i=i+Math.imul(E,ne)|0)+Math.imul(S,re)|0,o=o+Math.imul(S,ne)|0,n=n+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,ae)|0)+Math.imul(A,oe)|0,o=o+Math.imul(A,ae)|0,n=n+Math.imul(y,ce)|0,i=(i=i+Math.imul(y,ue)|0)+Math.imul(b,ce)|0,o=o+Math.imul(b,ue)|0,n=n+Math.imul(p,de)|0,i=(i=i+Math.imul(p,le)|0)+Math.imul(m,de)|0,o=o+Math.imul(m,le)|0;var Pe=(u+(n=n+Math.imul(d,pe)|0)|0)+((8191&(i=(i=i+Math.imul(d,me)|0)+Math.imul(l,pe)|0))<<13)|0;u=((o=o+Math.imul(l,me)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(B,H),i=(i=Math.imul(B,K))+Math.imul(F,H)|0,o=Math.imul(F,K),n=n+Math.imul(j,W)|0,i=(i=i+Math.imul(j,G)|0)+Math.imul(D,W)|0,o=o+Math.imul(D,G)|0,n=n+Math.imul(N,Z)|0,i=(i=i+Math.imul(N,X)|0)+Math.imul(O,Z)|0,o=o+Math.imul(O,X)|0,n=n+Math.imul(C,Y)|0,i=(i=i+Math.imul(C,ee)|0)+Math.imul(I,Y)|0,o=o+Math.imul(I,ee)|0,n=n+Math.imul(x,re)|0,i=(i=i+Math.imul(x,ne)|0)+Math.imul(k,re)|0,o=o+Math.imul(k,ne)|0,n=n+Math.imul(E,oe)|0,i=(i=i+Math.imul(E,ae)|0)+Math.imul(S,oe)|0,o=o+Math.imul(S,ae)|0,n=n+Math.imul(w,ce)|0,i=(i=i+Math.imul(w,ue)|0)+Math.imul(A,ce)|0,o=o+Math.imul(A,ue)|0,n=n+Math.imul(y,de)|0,i=(i=i+Math.imul(y,le)|0)+Math.imul(b,de)|0,o=o+Math.imul(b,le)|0;var xe=(u+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,me)|0)+Math.imul(m,pe)|0))<<13)|0;u=((o=o+Math.imul(m,me)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(B,W),i=(i=Math.imul(B,G))+Math.imul(F,W)|0,o=Math.imul(F,G),n=n+Math.imul(j,Z)|0,i=(i=i+Math.imul(j,X)|0)+Math.imul(D,Z)|0,o=o+Math.imul(D,X)|0,n=n+Math.imul(N,Y)|0,i=(i=i+Math.imul(N,ee)|0)+Math.imul(O,Y)|0,o=o+Math.imul(O,ee)|0,n=n+Math.imul(C,re)|0,i=(i=i+Math.imul(C,ne)|0)+Math.imul(I,re)|0,o=o+Math.imul(I,ne)|0,n=n+Math.imul(x,oe)|0,i=(i=i+Math.imul(x,ae)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,ae)|0,n=n+Math.imul(E,ce)|0,i=(i=i+Math.imul(E,ue)|0)+Math.imul(S,ce)|0,o=o+Math.imul(S,ue)|0,n=n+Math.imul(w,de)|0,i=(i=i+Math.imul(w,le)|0)+Math.imul(A,de)|0,o=o+Math.imul(A,le)|0;var ke=(u+(n=n+Math.imul(y,pe)|0)|0)+((8191&(i=(i=i+Math.imul(y,me)|0)+Math.imul(b,pe)|0))<<13)|0;u=((o=o+Math.imul(b,me)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(B,Z),i=(i=Math.imul(B,X))+Math.imul(F,Z)|0,o=Math.imul(F,X),n=n+Math.imul(j,Y)|0,i=(i=i+Math.imul(j,ee)|0)+Math.imul(D,Y)|0,o=o+Math.imul(D,ee)|0,n=n+Math.imul(N,re)|0,i=(i=i+Math.imul(N,ne)|0)+Math.imul(O,re)|0,o=o+Math.imul(O,ne)|0,n=n+Math.imul(C,oe)|0,i=(i=i+Math.imul(C,ae)|0)+Math.imul(I,oe)|0,o=o+Math.imul(I,ae)|0,n=n+Math.imul(x,ce)|0,i=(i=i+Math.imul(x,ue)|0)+Math.imul(k,ce)|0,o=o+Math.imul(k,ue)|0,n=n+Math.imul(E,de)|0,i=(i=i+Math.imul(E,le)|0)+Math.imul(S,de)|0,o=o+Math.imul(S,le)|0;var Me=(u+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,me)|0)+Math.imul(A,pe)|0))<<13)|0;u=((o=o+Math.imul(A,me)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(B,Y),i=(i=Math.imul(B,ee))+Math.imul(F,Y)|0,o=Math.imul(F,ee),n=n+Math.imul(j,re)|0,i=(i=i+Math.imul(j,ne)|0)+Math.imul(D,re)|0,o=o+Math.imul(D,ne)|0,n=n+Math.imul(N,oe)|0,i=(i=i+Math.imul(N,ae)|0)+Math.imul(O,oe)|0,o=o+Math.imul(O,ae)|0,n=n+Math.imul(C,ce)|0,i=(i=i+Math.imul(C,ue)|0)+Math.imul(I,ce)|0,o=o+Math.imul(I,ue)|0,n=n+Math.imul(x,de)|0,i=(i=i+Math.imul(x,le)|0)+Math.imul(k,de)|0,o=o+Math.imul(k,le)|0;var Ce=(u+(n=n+Math.imul(E,pe)|0)|0)+((8191&(i=(i=i+Math.imul(E,me)|0)+Math.imul(S,pe)|0))<<13)|0;u=((o=o+Math.imul(S,me)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(B,re),i=(i=Math.imul(B,ne))+Math.imul(F,re)|0,o=Math.imul(F,ne),n=n+Math.imul(j,oe)|0,i=(i=i+Math.imul(j,ae)|0)+Math.imul(D,oe)|0,o=o+Math.imul(D,ae)|0,n=n+Math.imul(N,ce)|0,i=(i=i+Math.imul(N,ue)|0)+Math.imul(O,ce)|0,o=o+Math.imul(O,ue)|0,n=n+Math.imul(C,de)|0,i=(i=i+Math.imul(C,le)|0)+Math.imul(I,de)|0,o=o+Math.imul(I,le)|0;var Ie=(u+(n=n+Math.imul(x,pe)|0)|0)+((8191&(i=(i=i+Math.imul(x,me)|0)+Math.imul(k,pe)|0))<<13)|0;u=((o=o+Math.imul(k,me)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(B,oe),i=(i=Math.imul(B,ae))+Math.imul(F,oe)|0,o=Math.imul(F,ae),n=n+Math.imul(j,ce)|0,i=(i=i+Math.imul(j,ue)|0)+Math.imul(D,ce)|0,o=o+Math.imul(D,ue)|0,n=n+Math.imul(N,de)|0,i=(i=i+Math.imul(N,le)|0)+Math.imul(O,de)|0,o=o+Math.imul(O,le)|0;var Re=(u+(n=n+Math.imul(C,pe)|0)|0)+((8191&(i=(i=i+Math.imul(C,me)|0)+Math.imul(I,pe)|0))<<13)|0;u=((o=o+Math.imul(I,me)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(B,ce),i=(i=Math.imul(B,ue))+Math.imul(F,ce)|0,o=Math.imul(F,ue),n=n+Math.imul(j,de)|0,i=(i=i+Math.imul(j,le)|0)+Math.imul(D,de)|0,o=o+Math.imul(D,le)|0;var Ne=(u+(n=n+Math.imul(N,pe)|0)|0)+((8191&(i=(i=i+Math.imul(N,me)|0)+Math.imul(O,pe)|0))<<13)|0;u=((o=o+Math.imul(O,me)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,n=Math.imul(B,de),i=(i=Math.imul(B,le))+Math.imul(F,de)|0,o=Math.imul(F,le);var Oe=(u+(n=n+Math.imul(j,pe)|0)|0)+((8191&(i=(i=i+Math.imul(j,me)|0)+Math.imul(D,pe)|0))<<13)|0;u=((o=o+Math.imul(D,me)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863;var Te=(u+(n=Math.imul(B,pe))|0)+((8191&(i=(i=Math.imul(B,me))+Math.imul(F,pe)|0))<<13)|0;return u=((o=Math.imul(F,me))+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,c[0]=ge,c[1]=ye,c[2]=be,c[3]=ve,c[4]=we,c[5]=Ae,c[6]=_e,c[7]=Ee,c[8]=Se,c[9]=Pe,c[10]=xe,c[11]=ke,c[12]=Me,c[13]=Ce,c[14]=Ie,c[15]=Re,c[16]=Ne,c[17]=Oe,c[18]=Te,0!==u&&(c[19]=u,r.length++),r};function m(e,t,r){return(new g).mulp(e,t,r)}function g(e,t){this.x=e,this.y=t}Math.imul||(h=l),i.prototype.mulTo=function(e,t){var r,n=this.length+e.length;return r=10===this.length&&10===e.length?h(this,e,t):n<63?l(this,e,t):n<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,a&=67108863}r.words[o]=s,n=a,a=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,e,t):m(this,e,t),r},g.prototype.makeRBT=function(e){for(var t=new Array(e),r=i.prototype._countBits(e)-1,n=0;n>=1;return n},g.prototype.permute=function(e,t,r,n,i,o){for(var a=0;a>>=1)i++;return 1<>>=13,n[2*a+1]=8191&o,o>>>=13;for(a=2*t;a>=26,t+=i/67108864|0,t+=o>>>26,this.words[n]=67108863&o}return 0!==t&&(this.words[n]=t,this.length++),this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>i}return t}(e);if(0===t.length)return new i(1);for(var r=this,n=0;n=0);var t,n=e%26,i=(e-n)/26,o=67108863>>>26-n<<26-n;if(0!==n){var a=0;for(t=0;t>>26-n}a&&(this.words[t]=a,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var o=e%26,a=Math.min((e-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,u=0;u=0&&(0!==f||u>=i);u--){var d=0|this.words[u];this.words[u]=f<<26-o|d>>>o,f=d&s}return c&&0!==f&&(c.words[c.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(e,t,n){return r(0===this.negative),this.iushrn(e,t,n)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){r("number"==typeof e&&e>=0);var t=e%26,n=(e-t)/26,i=1<=0);var t=e%26,n=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==t&&n++,this.length=Math.min(n,this.length),0!==t){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},i.prototype.isubn=function(e){if(r("number"==typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(c/67108864|0),this.words[i+n]=67108863&o}for(;i>26,this.words[i+n]=67108863&o;if(0===s)return this.strip();for(r(-1===s),s=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},i.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),o=e,a=0|o.words[o.length-1];0!=(r=26-this._countBits(a))&&(o=o.ushln(r),n.iushln(r),a=0|o.words[o.length-1]);var s,c=n.length-o.length;if("mod"!==t){(s=new i(null)).length=c+1,s.words=new Array(s.length);for(var u=0;u=0;d--){var l=67108864*(0|n.words[o.length+d])+(0|n.words[o.length+d-1]);for(l=Math.min(l/a|0,67108863),n._ishlnsubmul(o,l,d);0!==n.negative;)l--,n.negative=0,n._ishlnsubmul(o,1,d),n.isZero()||(n.negative^=1);s&&(s.words[d]=l)}return s&&s.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},i.prototype.divmod=function(e,t,n){return r(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(o=s.div.neg()),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.iadd(e)),{div:o,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(o=s.div.neg()),{div:o,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modn(e.words[0]))}:this._wordDiv(e,t);var o,a,s},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modn=function(e){r(e<=67108863);for(var t=(1<<26)%e,n=0,i=this.length-1;i>=0;i--)n=(t*n+(0|this.words[i]))%e;return n},i.prototype.idivn=function(e){r(e<=67108863);for(var t=0,n=this.length-1;n>=0;n--){var i=(0|this.words[n])+67108864*t;this.words[n]=i/e|0,t=i%e}return this.strip()},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o=new i(1),a=new i(0),s=new i(0),c=new i(1),u=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++u;for(var f=n.clone(),d=t.clone();!t.isZero();){for(var l=0,h=1;0==(t.words[0]&h)&&l<26;++l,h<<=1);if(l>0)for(t.iushrn(l);l-- >0;)(o.isOdd()||a.isOdd())&&(o.iadd(f),a.isub(d)),o.iushrn(1),a.iushrn(1);for(var p=0,m=1;0==(n.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(n.iushrn(p);p-- >0;)(s.isOdd()||c.isOdd())&&(s.iadd(f),c.isub(d)),s.iushrn(1),c.iushrn(1);t.cmp(n)>=0?(t.isub(n),o.isub(s),a.isub(c)):(n.isub(t),s.isub(o),c.isub(a))}return{a:s,b:c,gcd:n.iushln(u)}},i.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o,a=new i(1),s=new i(0),c=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(var u=0,f=1;0==(t.words[0]&f)&&u<26;++u,f<<=1);if(u>0)for(t.iushrn(u);u-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);for(var d=0,l=1;0==(n.words[0]&l)&&d<26;++d,l<<=1);if(d>0)for(n.iushrn(d);d-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);t.cmp(n)>=0?(t.isub(n),a.isub(s)):(n.isub(t),s.isub(a))}return(o=0===t.cmpn(1)?a:s).cmpn(0)<0&&o.iadd(e),o},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return 0==(1&this.words[0])},i.prototype.isOdd=function(){return 1==(1&this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){r("number"==typeof e);var t=e%26,n=(e-t)/26,i=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this.strip(),this.length>1)t=1;else{n&&(e=-e),r(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){ni&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new E(e)},i.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var y={k256:null,p224:null,p192:null,p25519:null};function b(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){b.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){b.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function A(){b.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){b.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function E(e){if("string"==typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function S(e){E.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(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)}b.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},b.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},b.prototype.split=function(e,t){e.iushrn(this.n,0,t)},b.prototype.imulK=function(e){return e.imul(this.k)},n(v,b),v.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i>>22,o=a}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},v.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(y[e])return y[e];var t;if("k256"===e)t=new v;else if("p224"===e)t=new w;else if("p192"===e)t=new A;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new _}return y[e]=t,t},E.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},E.prototype._verify2=function(e,t){r(0==(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},E.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},E.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},E.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},E.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},E.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},E.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},E.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},E.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},E.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},E.prototype.isqr=function(e){return this.imul(e,e.clone())},E.prototype.sqr=function(e){return this.mul(e,e)},E.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2==1),3===t){var n=this.m.add(new i(1)).iushrn(2);return this.pow(e,n)}for(var o=this.m.subn(1),a=0;!o.isZero()&&0===o.andln(1);)a++,o.iushrn(1);r(!o.isZero());var s=new i(1).toRed(this),c=s.redNeg(),u=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new i(2*f*f).toRed(this);0!==this.pow(f,u).cmp(c);)f.redIAdd(c);for(var d=this.pow(f,o),l=this.pow(e,o.addn(1).iushrn(1)),h=this.pow(e,o),p=a;0!==h.cmp(s);){for(var m=h,g=0;0!==m.cmp(s);g++)m=m.redSqr();r(g=0;n--){for(var u=t.words[n],f=c-1;f>=0;f--){var d=u>>f&1;o!==r[0]&&(o=this.sqr(o)),0!==d||0!==a?(a<<=1,a|=d,(4==++s||0===n&&0===f)&&(o=this.mul(o,r[a]),s=0,a=0)):s=0}c=26}return o},E.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},E.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new S(e)},n(S,E),S.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},S.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},S.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},S.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(n).iushrn(this.shift),a=o;return o.cmp(this.m)>=0?a=o.isub(this.m):o.cmpn(0)<0&&(a=o.iadd(this.m)),a._forceRed(this)},S.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}})(h,s);var m=h.exports,g=y;function y(e,t){if(!e)throw new Error(t||"Assertion failed")}y.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)};var b={};!function(e){var t=e;function r(e){return 1===e.length?"0"+e:e}function n(e){for(var t="",n=0;n>8,a=255&i;o?r.push(o,a):r.push(a)}return r},t.zero2=r,t.toHex=n,t.encode=function(e,t){return"hex"===t?n(e):e}}(b),function(e){var t=e,r=m,n=g,i=b;t.assert=n,t.toArray=i.toArray,t.zero2=i.zero2,t.toHex=i.toHex,t.encode=i.encode,t.getNAF=function(e,t,r){var n=new Array(Math.max(e.bitLength(),r)+1);n.fill(0);for(var i=1<(i>>1)-1?(i>>1)-c:c,o.isubn(s)):s=0,n[a]=s,o.iushrn(1)}return n},t.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n,i=0,o=0;e.cmpn(-i)>0||t.cmpn(-o)>0;){var a,s,c=e.andln(3)+i&3,u=t.andln(3)+o&3;3===c&&(c=-1),3===u&&(u=-1),a=0==(1&c)?0:3!==(n=e.andln(7)+i&7)&&5!==n||2!==u?c:-c,r[0].push(a),s=0==(1&u)?0:3!==(n=t.andln(7)+o&7)&&5!==n||2!==c?u:-u,r[1].push(s),2*i===a+1&&(i=1-i),2*o===s+1&&(o=1-o),e.iushrn(1),t.iushrn(1)}return r},t.cachedProperty=function(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},t.parseBytes=function(e){return"string"==typeof e?t.toArray(e,"hex"):e},t.intFromLE=function(e){return new r(e,"hex","le")}}(l);var v,w={exports:{}};function A(e){this.rand=e}if(w.exports=function(e){return v||(v=new A(null)),v.generate(e)},w.exports.Rand=A,A.prototype.generate=function(e){return this._rand(e)},A.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),r=0;r0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var R=I;function N(e,t){this.curve=e,this.type=t,this.precomputed=null}I.prototype.point=function(){throw new Error("Not implemented")},I.prototype.validate=function(){throw new Error("Not implemented")},I.prototype._fixedNafMul=function(e,t){C(e.precomputed);var r=e._getDoubles(),n=k(t,1,this._bitLength),i=(1<=o;c--)a=(a<<1)+n[c];s.push(a)}for(var u=this.jpoint(null,null,null),f=this.jpoint(null,null,null),d=i;d>0;d--){for(o=0;o=0;s--){for(var c=0;s>=0&&0===o[s];s--)c++;if(s>=0&&c++,a=a.dblp(c),s<0)break;var u=o[s];C(0!==u),a="affine"===e.type?u>0?a.mixedAdd(i[u-1>>1]):a.mixedAdd(i[-u-1>>1].neg()):u>0?a.add(i[u-1>>1]):a.add(i[-u-1>>1].neg())}return"affine"===e.type?a.toP():a},I.prototype._wnafMulAdd=function(e,t,r,n,i){var o,a,s,c=this._wnafT1,u=this._wnafT2,f=this._wnafT3,d=0;for(o=0;o=1;o-=2){var h=o-1,p=o;if(1===c[h]&&1===c[p]){var m=[t[h],null,null,t[p]];0===t[h].y.cmp(t[p].y)?(m[1]=t[h].add(t[p]),m[2]=t[h].toJ().mixedAdd(t[p].neg())):0===t[h].y.cmp(t[p].y.redNeg())?(m[1]=t[h].toJ().mixedAdd(t[p]),m[2]=t[h].add(t[p].neg())):(m[1]=t[h].toJ().mixedAdd(t[p]),m[2]=t[h].toJ().mixedAdd(t[p].neg()));var g=[-3,-1,-5,-7,0,7,5,1,3],y=M(r[h],r[p]);for(d=Math.max(y[0].length,d),f[h]=new Array(d),f[p]=new Array(d),a=0;a=0;o--){for(var _=0;o>=0;){var E=!0;for(a=0;a=0&&_++,w=w.dblp(_),o<0)break;for(a=0;a0?s=u[a][S-1>>1]:S<0&&(s=u[a][-S-1>>1].neg()),w="affine"===s.type?w.mixedAdd(s):w.add(s))}}for(o=0;o=Math.ceil((e.bitLength()+1)/t.step)},N.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i=0&&(o=t,a=r),n.negative&&(n=n.neg(),i=i.neg()),o.negative&&(o=o.neg(),a=a.neg()),[{a:n,b:i},{a:o,b:a}]},F.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],i=n.b.mul(e).divRound(this.n),o=r.b.neg().mul(e).divRound(this.n),a=i.mul(r.a),s=o.mul(n.a),c=i.mul(r.b),u=o.mul(n.b);return{k1:e.sub(a).sub(s),k2:c.add(u).neg()}},F.prototype.pointFromX=function(e,t){(e=new j(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var i=n.fromRed().isOdd();return(t&&!i||!t&&i)&&(n=n.redNeg()),this.point(e,n)},F.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},F.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o":""},U.prototype.isInfinity=function(){return this.inf},U.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},U.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),a=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)},U.prototype.getX=function(){return this.x.fromRed()},U.prototype.getY=function(){return this.y.fromRed()},U.prototype.mul=function(e){return e=new j(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)},U.prototype.mulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},U.prototype.jmulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},U.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))},U.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,n=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return t},U.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},D(L,$.BasePoint),F.prototype.jpoint=function(e,t,r){return new L(this,e,t,r)},L.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},L.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},L.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),i=e.x.redMul(r),o=this.y.redMul(t.redMul(e.z)),a=e.y.redMul(r.redMul(this.z)),s=n.redSub(i),c=o.redSub(a);if(0===s.cmpn(0))return 0!==c.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=s.redSqr(),f=u.redMul(s),d=n.redMul(u),l=c.redSqr().redIAdd(f).redISub(d).redISub(d),h=c.redMul(d.redISub(l)).redISub(o.redMul(f)),p=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(l,h,p)},L.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),i=this.y,o=e.y.redMul(t).redMul(this.z),a=r.redSub(n),s=i.redSub(o);if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=a.redSqr(),u=c.redMul(a),f=r.redMul(c),d=s.redSqr().redIAdd(u).redISub(f).redISub(f),l=s.redMul(f.redISub(d)).redISub(i.redMul(u)),h=this.z.redMul(a);return this.curve.jpoint(d,l,h)},L.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var r=this;for(t=0;t=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},L.prototype.inspect=function(){return this.isInfinity()?"":""},L.prototype.isInfinity=function(){return 0===this.z.cmpn(0)};var q=m,H=T,K=R,J=l;function W(e){K.call(this,"mont",e),this.a=new q(e.a,16).toRed(this.red),this.b=new q(e.b,16).toRed(this.red),this.i4=new q(4).toRed(this.red).redInvm(),this.two=new q(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}H(W,K);var G=W;function V(e,t,r){K.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new q(t,16),this.z=new q(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}W.prototype.validate=function(e){var t=e.normalize().x,r=t.redSqr(),n=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t);return 0===n.redSqrt().redSqr().cmp(n)},H(V,K.BasePoint),W.prototype.decodePoint=function(e,t){return this.point(J.toArray(e,t),1)},W.prototype.point=function(e,t){return new V(this,e,t)},W.prototype.pointFromJSON=function(e){return V.fromJSON(this,e)},V.prototype.precompute=function(){},V.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},V.fromJSON=function(e,t){return new V(e,t[0],t[1]||e.one)},V.prototype.inspect=function(){return this.isInfinity()?"":""},V.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},V.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),r=e.redSub(t),n=e.redMul(t),i=r.redMul(t.redAdd(this.curve.a24.redMul(r)));return this.curve.point(n,i)},V.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},V.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=e.x.redAdd(e.z),o=e.x.redSub(e.z).redMul(r),a=i.redMul(n),s=t.z.redMul(o.redAdd(a).redSqr()),c=t.x.redMul(o.redISub(a).redSqr());return this.curve.point(s,c)},V.prototype.mul=function(e){for(var t=e.clone(),r=this,n=this.curve.point(null,null),i=[];0!==t.cmpn(0);t.iushrn(1))i.push(t.andln(1));for(var o=i.length-1;o>=0;o--)0===i[o]?(r=r.diffAdd(n,this),n=n.dbl()):(n=r.diffAdd(n,this),r=r.dbl());return n},V.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},V.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},V.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},V.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},V.prototype.getX=function(){return this.normalize(),this.x.fromRed()};var Z=m,X=T,Q=R,Y=l.assert;function ee(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,Q.call(this,"edwards",e),this.a=new Z(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new Z(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new Z(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),Y(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}X(ee,Q);var te=ee;function re(e,t,r,n,i){Q.BasePoint.call(this,e,"projective"),null===t&&null===r&&null===n?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new Z(t,16),this.y=new Z(r,16),this.z=n?new Z(n,16):this.curve.one,this.t=i&&new Z(i,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}ee.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},ee.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},ee.prototype.jpoint=function(e,t,r,n){return this.point(e,t,r,n)},ee.prototype.pointFromX=function(e,t){(e=new Z(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=this.c2.redSub(this.a.redMul(r)),i=this.one.redSub(this.c2.redMul(this.d).redMul(r)),o=n.redMul(i.redInvm()),a=o.redSqrt();if(0!==a.redSqr().redSub(o).cmp(this.zero))throw new Error("invalid point");var s=a.fromRed().isOdd();return(t&&!s||!t&&s)&&(a=a.redNeg()),this.point(e,a)},ee.prototype.pointFromY=function(e,t){(e=new Z(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=r.redSub(this.c2),i=r.redMul(this.d).redMul(this.c2).redSub(this.a),o=n.redMul(i.redInvm());if(0===o.cmp(this.zero)){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var a=o.redSqrt();if(0!==a.redSqr().redSub(o).cmp(this.zero))throw new Error("invalid point");return a.fromRed().isOdd()!==t&&(a=a.redNeg()),this.point(a,e)},ee.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),r=e.y.redSqr(),n=t.redMul(this.a).redAdd(r),i=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(r)));return 0===n.cmp(i)},X(re,Q.BasePoint),ee.prototype.pointFromJSON=function(e){return re.fromJSON(this,e)},ee.prototype.point=function(e,t,r,n){return new re(this,e,t,r,n)},re.fromJSON=function(e,t){return new re(e,t[0],t[1],t[2])},re.prototype.inspect=function(){return this.isInfinity()?"":""},re.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},re.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(e),i=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),o=n.redAdd(t),a=o.redSub(r),s=n.redSub(t),c=i.redMul(a),u=o.redMul(s),f=i.redMul(s),d=a.redMul(o);return this.curve.point(c,u,d,f)},re.prototype._projDbl=function(){var e,t,r,n,i,o,a=this.x.redAdd(this.y).redSqr(),s=this.x.redSqr(),c=this.y.redSqr();if(this.curve.twisted){var u=(n=this.curve._mulA(s)).redAdd(c);this.zOne?(e=a.redSub(s).redSub(c).redMul(u.redSub(this.curve.two)),t=u.redMul(n.redSub(c)),r=u.redSqr().redSub(u).redSub(u)):(i=this.z.redSqr(),o=u.redSub(i).redISub(i),e=a.redSub(s).redISub(c).redMul(o),t=u.redMul(n.redSub(c)),r=u.redMul(o))}else n=s.redAdd(c),i=this.curve._mulC(this.z).redSqr(),o=n.redSub(i).redSub(i),e=this.curve._mulC(a.redISub(n)).redMul(o),t=this.curve._mulC(n).redMul(s.redISub(c)),r=n.redMul(o);return this.curve.point(e,t,r)},re.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},re.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),n=this.t.redMul(this.curve.dd).redMul(e.t),i=this.z.redMul(e.z.redAdd(e.z)),o=r.redSub(t),a=i.redSub(n),s=i.redAdd(n),c=r.redAdd(t),u=o.redMul(a),f=s.redMul(c),d=o.redMul(c),l=a.redMul(s);return this.curve.point(u,f,l,d)},re.prototype._projAdd=function(e){var t,r,n=this.z.redMul(e.z),i=n.redSqr(),o=this.x.redMul(e.x),a=this.y.redMul(e.y),s=this.curve.d.redMul(o).redMul(a),c=i.redSub(s),u=i.redAdd(s),f=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(o).redISub(a),d=n.redMul(c).redMul(f);return this.curve.twisted?(t=n.redMul(u).redMul(a.redSub(this.curve._mulA(o))),r=c.redMul(u)):(t=n.redMul(u).redMul(a.redSub(o)),r=this.curve._mulC(c).redMul(u)),this.curve.point(d,t,r)},re.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},re.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},re.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},re.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},re.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},re.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},re.prototype.getX=function(){return this.normalize(),this.x.fromRed()},re.prototype.getY=function(){return this.normalize(),this.y.fromRed()},re.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},re.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var r=e.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(n),0===this.x.cmp(t))return!0}},re.prototype.toP=re.prototype.normalize,re.prototype.mixedAdd=re.prototype.add,function(e){var t=e;t.base=R,t.short=z,t.mont=G,t.edwards=te}(S);var ne={},ie={},oe={},ae=g,se=T;function ce(e,t){return 55296==(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1)))}function ue(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function fe(e){return 1===e.length?"0"+e:e}function de(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}oe.inherits=se,oe.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),i=0;i>6|192,r[n++]=63&o|128):ce(e,i)?(o=65536+((1023&o)<<10)+(1023&e.charCodeAt(++i)),r[n++]=o>>18|240,r[n++]=o>>12&63|128,r[n++]=o>>6&63|128,r[n++]=63&o|128):(r[n++]=o>>12|224,r[n++]=o>>6&63|128,r[n++]=63&o|128)}else for(i=0;i>>0}return o},oe.split32=function(e,t){for(var r=new Array(4*e.length),n=0,i=0;n>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}return r},oe.rotr32=function(e,t){return e>>>t|e<<32-t},oe.rotl32=function(e,t){return e<>>32-t},oe.sum32=function(e,t){return e+t>>>0},oe.sum32_3=function(e,t,r){return e+t+r>>>0},oe.sum32_4=function(e,t,r,n){return e+t+r+n>>>0},oe.sum32_5=function(e,t,r,n,i){return e+t+r+n+i>>>0},oe.sum64=function(e,t,r,n){var i=e[t],o=n+e[t+1]>>>0,a=(o>>0,e[t+1]=o},oe.sum64_hi=function(e,t,r,n){return(t+n>>>0>>0},oe.sum64_lo=function(e,t,r,n){return t+n>>>0},oe.sum64_4_hi=function(e,t,r,n,i,o,a,s){var c=0,u=t;return c+=(u=u+n>>>0)>>0)>>0)>>0},oe.sum64_4_lo=function(e,t,r,n,i,o,a,s){return t+n+o+s>>>0},oe.sum64_5_hi=function(e,t,r,n,i,o,a,s,c,u){var f=0,d=t;return f+=(d=d+n>>>0)>>0)>>0)>>0)>>0},oe.sum64_5_lo=function(e,t,r,n,i,o,a,s,c,u){return t+n+o+s+u>>>0},oe.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},oe.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},oe.shr64_hi=function(e,t,r){return e>>>r},oe.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0};var le={},he=oe,pe=g;function me(){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}le.BlockHash=me,me.prototype.update=function(e,t){if(e=he.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=he.join32(e,0,e.length-r,this.endian);for(var n=0;n>>24&255,n[i++]=e>>>16&255,n[i++]=e>>>8&255,n[i++]=255&e}else for(n[i++]=255&e,n[i++]=e>>>8&255,n[i++]=e>>>16&255,n[i++]=e>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;o>>3},ye.g1_256=function(e){return be(e,17)^be(e,19)^e>>>10};var _e=oe,Ee=le,Se=ye,Pe=_e.rotl32,xe=_e.sum32,ke=_e.sum32_5,Me=Se.ft_1,Ce=Ee.BlockHash,Ie=[1518500249,1859775393,2400959708,3395469782];function Re(){if(!(this instanceof Re))return new Re;Ce.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}_e.inherits(Re,Ce);var Ne=Re;Re.blockSize=512,Re.outSize=160,Re.hmacStrength=80,Re.padLength=64,Re.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;nthis.blockSize&&(e=(new this.Hash).update(e).digest()),Xt(e.length<=this.blockSize);for(var t=e.length;t=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}var sr=ar;ar.prototype._init=function(e,t,r){var n=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},ar.prototype.generate=function(e,t,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(n=r,r=t,t=null),r&&(r=ir.toArray(r,n||"hex"),this._update(r));for(var i=[];i.length"};var lr=m,hr=l,pr=hr.assert;function mr(e,t){if(e instanceof mr)return e;this._importDER(e,t)||(pr(e.r&&e.s,"Signature without r or s"),this.r=new lr(e.r,16),this.s=new lr(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}var gr=mr;function yr(){this.place=0}function br(e,t){var r=e[t.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var i=0,o=0,a=t.place;o>>=0;return!(i<=127)&&(t.place=a,i)}function vr(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}mr.prototype._importDER=function(e,t){e=hr.toArray(e,t);var r=new yr;if(48!==e[r.place++])return!1;var n=br(e,r);if(!1===n)return!1;if(n+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var i=br(e,r);if(!1===i)return!1;var o=e.slice(r.place,i+r.place);if(r.place+=i,2!==e[r.place++])return!1;var a=br(e,r);if(!1===a)return!1;if(e.length!==a+r.place)return!1;var s=e.slice(r.place,a+r.place);if(0===o[0]){if(!(128&o[1]))return!1;o=o.slice(1)}if(0===s[0]){if(!(128&s[1]))return!1;s=s.slice(1)}return this.r=new lr(o),this.s=new lr(s),this.recoveryParam=null,!0},mr.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=vr(t),r=vr(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];wr(n,t.length),(n=n.concat(t)).push(2),wr(n,r.length);var i=n.concat(r),o=[48];return wr(o,i.length),o=o.concat(i),hr.encode(o,e)};var Ar=m,_r=sr,Er=ne,Sr=E,Pr=l.assert,xr=dr,kr=gr;function Mr(e){if(!(this instanceof Mr))return new Mr(e);"string"==typeof e&&(Pr(Object.prototype.hasOwnProperty.call(Er,e),"Unknown curve "+e),e=Er[e]),e instanceof Er.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}var Cr=Mr;Mr.prototype.keyPair=function(e){return new xr(this,e)},Mr.prototype.keyFromPrivate=function(e,t){return xr.fromPrivate(this,e,t)},Mr.prototype.keyFromPublic=function(e,t){return xr.fromPublic(this,e,t)},Mr.prototype.genKeyPair=function(e){e||(e={});for(var t=new _r({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||Sr(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),n=this.n.sub(new Ar(2));;){var i=new Ar(t.generate(r));if(!(i.cmp(n)>0))return i.iaddn(1),this.keyFromPrivate(i)}},Mr.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},Mr.prototype.sign=function(e,t,r,n){"object"==typeof r&&(n=r,r=null),n||(n={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new Ar(e,16));for(var i=this.n.byteLength(),o=t.getPrivate().toArray("be",i),a=e.toArray("be",i),s=new _r({hash:this.hash,entropy:o,nonce:a,pers:n.pers,persEnc:n.persEnc||"utf8"}),c=this.n.sub(new Ar(1)),u=0;;u++){var f=n.k?n.k(u):new Ar(s.generate(this.n.byteLength()));if(!((f=this._truncateToN(f,!0)).cmpn(1)<=0||f.cmp(c)>=0)){var d=this.g.mul(f);if(!d.isInfinity()){var l=d.getX(),h=l.umod(this.n);if(0!==h.cmpn(0)){var p=f.invm(this.n).mul(h.mul(t.getPrivate()).iadd(e));if(0!==(p=p.umod(this.n)).cmpn(0)){var m=(d.getY().isOdd()?1:0)|(0!==l.cmp(h)?2:0);return n.canonical&&p.cmp(this.nh)>0&&(p=this.n.sub(p),m^=1),new kr({r:h,s:p,recoveryParam:m})}}}}}},Mr.prototype.verify=function(e,t,r,n){e=this._truncateToN(new Ar(e,16)),r=this.keyFromPublic(r,n);var i=(t=new kr(t,"hex")).r,o=t.s;if(i.cmpn(1)<0||i.cmp(this.n)>=0)return!1;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var a,s=o.invm(this.n),c=s.mul(e).umod(this.n),u=s.mul(i).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(c,r.getPublic(),u)).isInfinity()&&a.eqXToP(i):!(a=this.g.mulAdd(c,r.getPublic(),u)).isInfinity()&&0===a.getX().umod(this.n).cmp(i)},Mr.prototype.recoverPubKey=function(e,t,r,n){Pr((3&r)===r,"The recovery param is more than two bits"),t=new kr(t,n);var i=this.n,o=new Ar(e),a=t.r,s=t.s,c=1&r,u=r>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&u)throw new Error("Unable to find sencond key candinate");a=u?this.curve.pointFromX(a.add(this.curve.n),c):this.curve.pointFromX(a,c);var f=t.r.invm(i),d=i.sub(o).mul(f).umod(i),l=s.mul(f).umod(i);return this.g.mulAdd(d,a,l)},Mr.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new kr(t,n)).recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(e,t,i)}catch(e){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")};var Ir=l,Rr=Ir.assert,Nr=Ir.parseBytes,Or=Ir.cachedProperty;function Tr(e,t){this.eddsa=e,this._secret=Nr(t.secret),e.isPoint(t.pub)?this._pub=t.pub:this._pubBytes=Nr(t.pub)}Tr.fromPublic=function(e,t){return t instanceof Tr?t:new Tr(e,{pub:t})},Tr.fromSecret=function(e,t){return t instanceof Tr?t:new Tr(e,{secret:t})},Tr.prototype.secret=function(){return this._secret},Or(Tr,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),Or(Tr,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),Or(Tr,"privBytes",(function(){var e=this.eddsa,t=this.hash(),r=e.encodingLength-1,n=t.slice(0,e.encodingLength);return n[0]&=248,n[r]&=127,n[r]|=64,n})),Or(Tr,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),Or(Tr,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),Or(Tr,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),Tr.prototype.sign=function(e){return Rr(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},Tr.prototype.verify=function(e,t){return this.eddsa.verify(e,t,this)},Tr.prototype.getSecret=function(e){return Rr(this._secret,"KeyPair is public only"),Ir.encode(this.secret(),e)},Tr.prototype.getPublic=function(e){return Ir.encode(this.pubBytes(),e)};var jr=Tr,Dr=m,$r=l,Br=$r.assert,Fr=$r.cachedProperty,zr=$r.parseBytes;function Ur(e,t){this.eddsa=e,"object"!=typeof t&&(t=zr(t)),Array.isArray(t)&&(t={R:t.slice(0,e.encodingLength),S:t.slice(e.encodingLength)}),Br(t.R&&t.S,"Signature without R or S"),e.isPoint(t.R)&&(this._R=t.R),t.S instanceof Dr&&(this._S=t.S),this._Rencoded=Array.isArray(t.R)?t.R:t.Rencoded,this._Sencoded=Array.isArray(t.S)?t.S:t.Sencoded}Fr(Ur,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),Fr(Ur,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),Fr(Ur,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),Fr(Ur,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),Ur.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},Ur.prototype.toHex=function(){return $r.encode(this.toBytes(),"hex").toUpperCase()};var Lr=Ur,qr=ie,Hr=ne,Kr=l,Jr=Kr.assert,Wr=Kr.parseBytes,Gr=jr,Vr=Lr;function Zr(e){if(Jr("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof Zr))return new Zr(e);e=Hr[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=qr.sha512}var Xr=Zr;Zr.prototype.sign=function(e,t){e=Wr(e);var r=this.keyFromSecret(t),n=this.hashInt(r.messagePrefix(),e),i=this.g.mul(n),o=this.encodePoint(i),a=this.hashInt(o,r.pubBytes(),e).mul(r.priv()),s=n.add(a).umod(this.curve.n);return this.makeSignature({R:i,S:s,Rencoded:o})},Zr.prototype.verify=function(e,t,r){e=Wr(e),t=this.makeSignature(t);var n=this.keyFromPublic(r),i=this.hashInt(t.Rencoded(),n.pubBytes(),e),o=this.g.mul(t.S());return t.R().add(n.pub().mul(i)).eq(o)},Zr.prototype.hashInt=function(){for(var e=this.hash(),t=0;te instanceof CryptoKey,cn=async(e,t)=>{const r=`SHA-${e.slice(-3)}`;return new Uint8Array(await an.subtle.digest(r,t))},un=new TextEncoder,fn=new TextDecoder,dn=2**32;function ln(...e){const t=e.reduce(((e,{length:t})=>e+t),0),r=new Uint8Array(t);let n=0;return e.forEach((e=>{r.set(e,n),n+=e.length})),r}function hn(e,t,r){if(t<0||t>=dn)throw new RangeError(`value must be >= 0 and <= ${dn-1}. Received ${t}`);e.set([t>>>24,t>>>16,t>>>8,255&t],r)}function pn(e){const t=Math.floor(e/dn),r=e%dn,n=new Uint8Array(8);return hn(n,t,0),hn(n,r,4),n}function mn(e){const t=new Uint8Array(4);return hn(t,e),t}function gn(e){return ln(mn(e.length),e)}const yn=e=>(e=>{let t=e;"string"==typeof t&&(t=un.encode(t));const r=[];for(let e=0;e{let t=e;t instanceof Uint8Array&&(t=fn.decode(t)),t=t.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"");try{return(e=>{const t=atob(e),r=new Uint8Array(t.length);for(let e=0;eCn(new Uint8Array(In(e)>>3));const Nn=(e,t)=>{if(t.length<<3!==In(e))throw new Pn("Invalid Initialization Vector length")},On=(e,t)=>{const r=e.byteLength<<3;if(r!==t)throw new Pn(`Invalid Content Encryption Key length. Expected ${t} bits, got ${r} bits`)};function Tn(){return"undefined"!=typeof WebSocketPair||"undefined"!=typeof navigator&&"Cloudflare-Workers"===navigator.userAgent||"undefined"!=typeof EdgeRuntime&&"vercel"===EdgeRuntime}function jn(e,t="algorithm.name"){return new TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`)}function Dn(e,t){return e.name===t}function $n(e){return parseInt(e.name.slice(4),10)}function Bn(e,t){if(t.length&&!t.some((t=>e.usages.includes(t)))){let e="CryptoKey does not support this operation, its usages must include ";if(t.length>2){const r=t.pop();e+=`one of ${t.join(", ")}, or ${r}.`}else 2===t.length?e+=`one of ${t[0]} or ${t[1]}.`:e+=`${t[0]}.`;throw new TypeError(e)}}function Fn(e,t,...r){switch(t){case"HS256":case"HS384":case"HS512":{if(!Dn(e.algorithm,"HMAC"))throw jn("HMAC");const r=parseInt(t.slice(2),10);if($n(e.algorithm.hash)!==r)throw jn(`SHA-${r}`,"algorithm.hash");break}case"RS256":case"RS384":case"RS512":{if(!Dn(e.algorithm,"RSASSA-PKCS1-v1_5"))throw jn("RSASSA-PKCS1-v1_5");const r=parseInt(t.slice(2),10);if($n(e.algorithm.hash)!==r)throw jn(`SHA-${r}`,"algorithm.hash");break}case"PS256":case"PS384":case"PS512":{if(!Dn(e.algorithm,"RSA-PSS"))throw jn("RSA-PSS");const r=parseInt(t.slice(2),10);if($n(e.algorithm.hash)!==r)throw jn(`SHA-${r}`,"algorithm.hash");break}case"EdDSA":if("Ed25519"!==e.algorithm.name&&"Ed448"!==e.algorithm.name){if(Tn()){if(Dn(e.algorithm,"NODE-ED25519"))break;throw jn("Ed25519, Ed448, or NODE-ED25519")}throw jn("Ed25519 or Ed448")}break;case"ES256":case"ES384":case"ES512":{if(!Dn(e.algorithm,"ECDSA"))throw jn("ECDSA");const r=function(e){switch(e){case"ES256":return"P-256";case"ES384":return"P-384";case"ES512":return"P-521";default:throw new Error("unreachable")}}(t);if(e.algorithm.namedCurve!==r)throw jn(r,"algorithm.namedCurve");break}default:throw new TypeError("CryptoKey does not support this operation")}Bn(e,r)}function zn(e,t,...r){switch(t){case"A128GCM":case"A192GCM":case"A256GCM":{if(!Dn(e.algorithm,"AES-GCM"))throw jn("AES-GCM");const r=parseInt(t.slice(1,4),10);if(e.algorithm.length!==r)throw jn(r,"algorithm.length");break}case"A128KW":case"A192KW":case"A256KW":{if(!Dn(e.algorithm,"AES-KW"))throw jn("AES-KW");const r=parseInt(t.slice(1,4),10);if(e.algorithm.length!==r)throw jn(r,"algorithm.length");break}case"ECDH":switch(e.algorithm.name){case"ECDH":case"X25519":case"X448":break;default:throw jn("ECDH, X25519, or X448")}break;case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":if(!Dn(e.algorithm,"PBKDF2"))throw jn("PBKDF2");break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":{if(!Dn(e.algorithm,"RSA-OAEP"))throw jn("RSA-OAEP");const r=parseInt(t.slice(9),10)||1;if($n(e.algorithm.hash)!==r)throw jn(`SHA-${r}`,"algorithm.hash");break}default:throw new TypeError("CryptoKey does not support this operation")}Bn(e,r)}function Un(e,t,...r){if(r.length>2){const t=r.pop();e+=`one of type ${r.join(", ")}, or ${t}.`}else 2===r.length?e+=`one of type ${r[0]} or ${r[1]}.`:e+=`of type ${r[0]}.`;return null==t?e+=` Received ${t}`:"function"==typeof t&&t.name?e+=` Received function ${t.name}`:"object"==typeof t&&null!=t&&t.constructor&&t.constructor.name&&(e+=` Received an instance of ${t.constructor.name}`),e}var Ln=(e,...t)=>Un("Key must be ",e,...t);function qn(e,t,...r){return Un(`Key for the ${e} algorithm must be `,t,...r)}var Hn=e=>sn(e);const Kn=["CryptoKey"];async function Jn(e,t,r,n,i,o){if(!(t instanceof Uint8Array))throw new TypeError(Ln(t,"Uint8Array"));const a=parseInt(e.slice(1,4),10),s=await an.subtle.importKey("raw",t.subarray(a>>3),"AES-CBC",!1,["decrypt"]),c=await an.subtle.importKey("raw",t.subarray(0,a>>3),{hash:"SHA-"+(a<<1),name:"HMAC"},!1,["sign"]),u=ln(o,n,r,pn(o.length<<3)),f=new Uint8Array((await an.subtle.sign("HMAC",c,u)).slice(0,a>>3));let d,l;try{d=((e,t)=>{if(!(e instanceof Uint8Array))throw new TypeError("First argument must be a buffer");if(!(t instanceof Uint8Array))throw new TypeError("Second argument must be a buffer");if(e.length!==t.length)throw new TypeError("Input buffers must have the same length");const r=e.length;let n=0,i=-1;for(;++i{if(!(sn(t)||t instanceof Uint8Array))throw new TypeError(Ln(t,...Kn,"Uint8Array"));switch(Nn(e,n),e){case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return t instanceof Uint8Array&&On(t,parseInt(e.slice(-3),10)),Jn(e,t,r,n,i,o);case"A128GCM":case"A192GCM":case"A256GCM":return t instanceof Uint8Array&&On(t,parseInt(e.slice(1,4),10)),async function(e,t,r,n,i,o){let a;t instanceof Uint8Array?a=await an.subtle.importKey("raw",t,"AES-GCM",!1,["decrypt"]):(zn(t,e,"decrypt"),a=t);try{return new Uint8Array(await an.subtle.decrypt({additionalData:o,iv:n,name:"AES-GCM",tagLength:128},a,ln(r,i)))}catch(e){throw new Sn}}(e,t,r,n,i,o);default:throw new En("Unsupported JWE Content Encryption Algorithm")}},Gn=async()=>{throw new En('JWE "zip" (Compression Algorithm) Header Parameter is not supported by your javascript runtime. You need to use the `inflateRaw` decrypt option to provide Inflate Raw implementation.')},Vn=async()=>{throw new En('JWE "zip" (Compression Algorithm) Header Parameter is not supported by your javascript runtime. You need to use the `deflateRaw` encrypt option to provide Deflate Raw implementation.')},Zn=(...e)=>{const t=e.filter(Boolean);if(0===t.length||1===t.length)return!0;let r;for(const e of t){const t=Object.keys(e);if(r&&0!==r.size)for(const e of t){if(r.has(e))return!1;r.add(e)}else r=new Set(t)}return!0};function Xn(e){if("object"!=typeof(t=e)||null===t||"[object Object]"!==Object.prototype.toString.call(e))return!1;var t;if(null===Object.getPrototypeOf(e))return!0;let r=e;for(;null!==Object.getPrototypeOf(r);)r=Object.getPrototypeOf(r);return Object.getPrototypeOf(e)===r}const Qn=[{hash:"SHA-256",name:"HMAC"},!0,["sign"]];function Yn(e,t){if(e.algorithm.length!==parseInt(t.slice(1,4),10))throw new TypeError(`Invalid key size for alg: ${t}`)}function ei(e,t,r){if(sn(e))return zn(e,t,r),e;if(e instanceof Uint8Array)return an.subtle.importKey("raw",e,"AES-KW",!0,[r]);throw new TypeError(Ln(e,...Kn,"Uint8Array"))}const ti=async(e,t,r)=>{const n=await ei(t,e,"wrapKey");Yn(n,e);const i=await an.subtle.importKey("raw",r,...Qn);return new Uint8Array(await an.subtle.wrapKey("raw",i,n,"AES-KW"))},ri=async(e,t,r)=>{const n=await ei(t,e,"unwrapKey");Yn(n,e);const i=await an.subtle.unwrapKey("raw",r,n,"AES-KW",...Qn);return new Uint8Array(await an.subtle.exportKey("raw",i))};async function ni(e,t,r,n,i=new Uint8Array(0),o=new Uint8Array(0)){if(!sn(e))throw new TypeError(Ln(e,...Kn));if(zn(e,"ECDH"),!sn(t))throw new TypeError(Ln(t,...Kn));zn(t,"ECDH","deriveBits");const a=ln(gn(un.encode(r)),gn(i),gn(o),mn(n));let s;s="X25519"===e.algorithm.name?256:"X448"===e.algorithm.name?448:Math.ceil(parseInt(e.algorithm.namedCurve.substr(-3),10)/8)<<3;return async function(e,t,r){const n=Math.ceil((t>>3)/32),i=new Uint8Array(32*n);for(let t=0;t>3)}(new Uint8Array(await an.subtle.deriveBits({name:e.algorithm.name,public:e},t,s)),n,a)}function ii(e){if(!sn(e))throw new TypeError(Ln(e,...Kn));return["P-256","P-384","P-521"].includes(e.algorithm.namedCurve)||"X25519"===e.algorithm.name||"X448"===e.algorithm.name}async function oi(e,t,r,n){!function(e){if(!(e instanceof Uint8Array)||e.length<8)throw new Pn("PBES2 Salt Input must be 8 or more octets")}(e);const i=function(e,t){return ln(un.encode(e),new Uint8Array([0]),t)}(t,e),o=parseInt(t.slice(13,16),10),a={hash:`SHA-${t.slice(8,11)}`,iterations:r,name:"PBKDF2",salt:i},s={length:o,name:"AES-KW"},c=await function(e,t){if(e instanceof Uint8Array)return an.subtle.importKey("raw",e,"PBKDF2",!1,["deriveBits"]);if(sn(e))return zn(e,t,"deriveBits","deriveKey"),e;throw new TypeError(Ln(e,...Kn,"Uint8Array"))}(n,t);if(c.usages.includes("deriveBits"))return new Uint8Array(await an.subtle.deriveBits(a,c,o));if(c.usages.includes("deriveKey"))return an.subtle.deriveKey(a,c,s,!1,["wrapKey","unwrapKey"]);throw new TypeError('PBKDF2 key "usages" must include "deriveBits" or "deriveKey"')}const ai=async(e,t,r,n,i)=>{const o=await oi(i,e,n,t);return ri(e.slice(-6),o,r)};function si(e){switch(e){case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":return"RSA-OAEP";default:throw new En(`alg ${e} is not supported either by JOSE or your javascript runtime`)}}var ci=(e,t)=>{if(e.startsWith("RS")||e.startsWith("PS")){const{modulusLength:r}=t.algorithm;if("number"!=typeof r||r<2048)throw new TypeError(`${e} requires key modulusLength to be 2048 bits or larger`)}};const ui=async(e,t,r)=>{if(!sn(t))throw new TypeError(Ln(t,...Kn));if(zn(t,e,"decrypt","unwrapKey"),ci(e,t),t.usages.includes("decrypt"))return new Uint8Array(await an.subtle.decrypt(si(e),t,r));if(t.usages.includes("unwrapKey")){const n=await an.subtle.unwrapKey("raw",r,t,si(e),...Qn);return new Uint8Array(await an.subtle.exportKey("raw",n))}throw new TypeError('RSA-OAEP key "usages" must include "decrypt" or "unwrapKey" for this operation')};function fi(e){switch(e){case"A128GCM":return 128;case"A192GCM":return 192;case"A256GCM":case"A128CBC-HS256":return 256;case"A192CBC-HS384":return 384;case"A256CBC-HS512":return 512;default:throw new En(`Unsupported JWE Algorithm: ${e}`)}}var di=e=>Cn(new Uint8Array(fi(e)>>3));var li=async e=>{var t,r;if(!e.alg)throw new TypeError('"alg" argument is required when "jwk.alg" is not present');const{algorithm:n,keyUsages:i}=function(e){let t,r;switch(e.kty){case"oct":switch(e.alg){case"HS256":case"HS384":case"HS512":t={name:"HMAC",hash:`SHA-${e.alg.slice(-3)}`},r=["sign","verify"];break;case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":throw new En(`${e.alg} keys cannot be imported as CryptoKey instances`);case"A128GCM":case"A192GCM":case"A256GCM":case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":t={name:"AES-GCM"},r=["encrypt","decrypt"];break;case"A128KW":case"A192KW":case"A256KW":t={name:"AES-KW"},r=["wrapKey","unwrapKey"];break;case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":t={name:"PBKDF2"},r=["deriveBits"];break;default:throw new En('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"RSA":switch(e.alg){case"PS256":case"PS384":case"PS512":t={name:"RSA-PSS",hash:`SHA-${e.alg.slice(-3)}`},r=e.d?["sign"]:["verify"];break;case"RS256":case"RS384":case"RS512":t={name:"RSASSA-PKCS1-v1_5",hash:`SHA-${e.alg.slice(-3)}`},r=e.d?["sign"]:["verify"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":t={name:"RSA-OAEP",hash:`SHA-${parseInt(e.alg.slice(-3),10)||1}`},r=e.d?["decrypt","unwrapKey"]:["encrypt","wrapKey"];break;default:throw new En('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"EC":switch(e.alg){case"ES256":t={name:"ECDSA",namedCurve:"P-256"},r=e.d?["sign"]:["verify"];break;case"ES384":t={name:"ECDSA",namedCurve:"P-384"},r=e.d?["sign"]:["verify"];break;case"ES512":t={name:"ECDSA",namedCurve:"P-521"},r=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":t={name:"ECDH",namedCurve:e.crv},r=e.d?["deriveBits"]:[];break;default:throw new En('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"OKP":switch(e.alg){case"EdDSA":t={name:e.crv},r=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":t={name:e.crv},r=e.d?["deriveBits"]:[];break;default:throw new En('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;default:throw new En('Invalid or unsupported JWK "kty" (Key Type) Parameter value')}return{algorithm:t,keyUsages:r}}(e),o=[n,null!==(t=e.ext)&&void 0!==t&&t,null!==(r=e.key_ops)&&void 0!==r?r:i];if("PBKDF2"===n.name)return an.subtle.importKey("raw",bn(e.k),...o);const a={...e};delete a.alg,delete a.use;try{return await an.subtle.importKey("jwk",a,...o)}catch(e){if("Ed25519"===n.name&&"NotSupportedError"===(null==e?void 0:e.name)&&Tn())return o[0]={name:"NODE-ED25519",namedCurve:"NODE-ED25519"},await an.subtle.importKey("jwk",a,...o);throw e}};async function hi(e,t,r){var n;if(!Xn(e))throw new TypeError("JWK must be an object");switch(t||(t=e.alg),e.kty){case"oct":if("string"!=typeof e.k||!e.k)throw new TypeError('missing "k" (Key Value) Parameter value');return null!=r||(r=!0!==e.ext),r?li({...e,alg:t,ext:null!==(n=e.ext)&&void 0!==n&&n}):bn(e.k);case"RSA":if(void 0!==e.oth)throw new En('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');case"EC":case"OKP":return li({...e,alg:t});default:throw new En('Unsupported "kty" (Key Type) Parameter value')}}const pi=(e,t,r)=>{e.startsWith("HS")||"dir"===e||e.startsWith("PBES2")||/^A\d{3}(?:GCM)?KW$/.test(e)?((e,t)=>{if(!(t instanceof Uint8Array)){if(!Hn(t))throw new TypeError(qn(e,t,...Kn,"Uint8Array"));if("secret"!==t.type)throw new TypeError(`${Kn.join(" or ")} instances for symmetric algorithms must be of type "secret"`)}})(e,t):((e,t,r)=>{if(!Hn(t))throw new TypeError(qn(e,t,...Kn));if("secret"===t.type)throw new TypeError(`${Kn.join(" or ")} instances for asymmetric algorithms must not be of type "secret"`);if("sign"===r&&"public"===t.type)throw new TypeError(`${Kn.join(" or ")} instances for asymmetric algorithm signing must be of type "private"`);if("decrypt"===r&&"public"===t.type)throw new TypeError(`${Kn.join(" or ")} instances for asymmetric algorithm decryption must be of type "private"`);if(t.algorithm&&"verify"===r&&"private"===t.type)throw new TypeError(`${Kn.join(" or ")} instances for asymmetric algorithm verifying must be of type "public"`);if(t.algorithm&&"encrypt"===r&&"private"===t.type)throw new TypeError(`${Kn.join(" or ")} instances for asymmetric algorithm encryption must be of type "public"`)})(e,t,r)};const mi=async(e,t,r,n,i)=>{if(!(sn(r)||r instanceof Uint8Array))throw new TypeError(Ln(r,...Kn,"Uint8Array"));switch(Nn(e,n),e){case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return r instanceof Uint8Array&&On(r,parseInt(e.slice(-3),10)),async function(e,t,r,n,i){if(!(r instanceof Uint8Array))throw new TypeError(Ln(r,"Uint8Array"));const o=parseInt(e.slice(1,4),10),a=await an.subtle.importKey("raw",r.subarray(o>>3),"AES-CBC",!1,["encrypt"]),s=await an.subtle.importKey("raw",r.subarray(0,o>>3),{hash:"SHA-"+(o<<1),name:"HMAC"},!1,["sign"]),c=new Uint8Array(await an.subtle.encrypt({iv:n,name:"AES-CBC"},a,t)),u=ln(i,n,c,pn(i.length<<3));return{ciphertext:c,tag:new Uint8Array((await an.subtle.sign("HMAC",s,u)).slice(0,o>>3))}}(e,t,r,n,i);case"A128GCM":case"A192GCM":case"A256GCM":return r instanceof Uint8Array&&On(r,parseInt(e.slice(1,4),10)),async function(e,t,r,n,i){let o;r instanceof Uint8Array?o=await an.subtle.importKey("raw",r,"AES-GCM",!1,["encrypt"]):(zn(r,e,"encrypt"),o=r);const a=new Uint8Array(await an.subtle.encrypt({additionalData:i,iv:n,name:"AES-GCM",tagLength:128},o,t)),s=a.slice(-16);return{ciphertext:a.slice(0,-16),tag:s}}(e,t,r,n,i);default:throw new En("Unsupported JWE Content Encryption Algorithm")}};async function gi(e,t,r,n,i){switch(pi(e,t,"decrypt"),e){case"dir":if(void 0!==r)throw new Pn("Encountered unexpected JWE Encrypted Key");return t;case"ECDH-ES":if(void 0!==r)throw new Pn("Encountered unexpected JWE Encrypted Key");case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{if(!Xn(n.epk))throw new Pn('JOSE Header "epk" (Ephemeral Public Key) missing or invalid');if(!ii(t))throw new En("ECDH with the provided key is not allowed or not supported by your javascript runtime");const i=await hi(n.epk,e);let o,a;if(void 0!==n.apu){if("string"!=typeof n.apu)throw new Pn('JOSE Header "apu" (Agreement PartyUInfo) invalid');o=bn(n.apu)}if(void 0!==n.apv){if("string"!=typeof n.apv)throw new Pn('JOSE Header "apv" (Agreement PartyVInfo) invalid');a=bn(n.apv)}const s=await ni(i,t,"ECDH-ES"===e?n.enc:e,"ECDH-ES"===e?fi(n.enc):parseInt(e.slice(-5,-2),10),o,a);if("ECDH-ES"===e)return s;if(void 0===r)throw new Pn("JWE Encrypted Key missing");return ri(e.slice(-6),s,r)}case"RSA1_5":case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":if(void 0===r)throw new Pn("JWE Encrypted Key missing");return ui(e,t,r);case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":{if(void 0===r)throw new Pn("JWE Encrypted Key missing");if("number"!=typeof n.p2c)throw new Pn('JOSE Header "p2c" (PBES2 Count) missing or invalid');const o=(null==i?void 0:i.maxPBES2Count)||1e4;if(n.p2c>o)throw new Pn('JOSE Header "p2c" (PBES2 Count) out is of acceptable bounds');if("string"!=typeof n.p2s)throw new Pn('JOSE Header "p2s" (PBES2 Salt) missing or invalid');return ai(e,t,r,n.p2c,bn(n.p2s))}case"A128KW":case"A192KW":case"A256KW":if(void 0===r)throw new Pn("JWE Encrypted Key missing");return ri(e,t,r);case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":if(void 0===r)throw new Pn("JWE Encrypted Key missing");if("string"!=typeof n.iv)throw new Pn('JOSE Header "iv" (Initialization Vector) missing or invalid');if("string"!=typeof n.tag)throw new Pn('JOSE Header "tag" (Authentication Tag) missing or invalid');return async function(e,t,r,n,i){const o=e.slice(0,7);return Wn(o,t,r,n,i,new Uint8Array(0))}(e,t,r,bn(n.iv),bn(n.tag));default:throw new En('Invalid or unsupported "alg" (JWE Algorithm) header value')}}function yi(e,t,r,n,i){if(void 0!==i.crit&&void 0===n.crit)throw new e('"crit" (Critical) Header Parameter MUST be integrity protected');if(!n||void 0===n.crit)return new Set;if(!Array.isArray(n.crit)||0===n.crit.length||n.crit.some((e=>"string"!=typeof e||0===e.length)))throw new e('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');let o;o=void 0!==r?new Map([...Object.entries(r),...t.entries()]):t;for(const t of n.crit){if(!o.has(t))throw new En(`Extension Header Parameter "${t}" is not recognized`);if(void 0===i[t])throw new e(`Extension Header Parameter "${t}" is missing`);if(o.get(t)&&void 0===n[t])throw new e(`Extension Header Parameter "${t}" MUST be integrity protected`)}return new Set(n.crit)}const bi=(e,t)=>{if(void 0!==t&&(!Array.isArray(t)||t.some((e=>"string"!=typeof e))))throw new TypeError(`"${e}" option must be an array of strings`);if(t)return new Set(t)};async function vi(e,t,r){if(e instanceof Uint8Array&&(e=fn.decode(e)),"string"!=typeof e)throw new Pn("Compact JWE must be a string or Uint8Array");const{0:n,1:i,2:o,3:a,4:s,length:c}=e.split(".");if(5!==c)throw new Pn("Invalid Compact JWE");const u=await async function(e,t,r){var n;if(!Xn(e))throw new Pn("Flattened JWE must be an object");if(void 0===e.protected&&void 0===e.header&&void 0===e.unprotected)throw new Pn("JOSE Header missing");if("string"!=typeof e.iv)throw new Pn("JWE Initialization Vector missing or incorrect type");if("string"!=typeof e.ciphertext)throw new Pn("JWE Ciphertext missing or incorrect type");if("string"!=typeof e.tag)throw new Pn("JWE Authentication Tag missing or incorrect type");if(void 0!==e.protected&&"string"!=typeof e.protected)throw new Pn("JWE Protected Header incorrect type");if(void 0!==e.encrypted_key&&"string"!=typeof e.encrypted_key)throw new Pn("JWE Encrypted Key incorrect type");if(void 0!==e.aad&&"string"!=typeof e.aad)throw new Pn("JWE AAD incorrect type");if(void 0!==e.header&&!Xn(e.header))throw new Pn("JWE Shared Unprotected Header incorrect type");if(void 0!==e.unprotected&&!Xn(e.unprotected))throw new Pn("JWE Per-Recipient Unprotected Header incorrect type");let i;if(e.protected)try{const t=bn(e.protected);i=JSON.parse(fn.decode(t))}catch(e){throw new Pn("JWE Protected Header is invalid")}if(!Zn(i,e.header,e.unprotected))throw new Pn("JWE Protected, JWE Unprotected Header, and JWE Per-Recipient Unprotected Header Parameter names must be disjoint");const o={...i,...e.header,...e.unprotected};if(yi(Pn,new Map,null==r?void 0:r.crit,i,o),void 0!==o.zip){if(!i||!i.zip)throw new Pn('JWE "zip" (Compression Algorithm) Header MUST be integrity protected');if("DEF"!==o.zip)throw new En('Unsupported JWE "zip" (Compression Algorithm) Header Parameter value')}const{alg:a,enc:s}=o;if("string"!=typeof a||!a)throw new Pn("missing JWE Algorithm (alg) in JWE Header");if("string"!=typeof s||!s)throw new Pn("missing JWE Encryption Algorithm (enc) in JWE Header");const c=r&&bi("keyManagementAlgorithms",r.keyManagementAlgorithms),u=r&&bi("contentEncryptionAlgorithms",r.contentEncryptionAlgorithms);if(c&&!c.has(a))throw new _n('"alg" (Algorithm) Header Parameter not allowed');if(u&&!u.has(s))throw new _n('"enc" (Encryption Algorithm) Header Parameter not allowed');let f;void 0!==e.encrypted_key&&(f=bn(e.encrypted_key));let d,l=!1;"function"==typeof t&&(t=await t(i,e),l=!0);try{d=await gi(a,t,f,o,r)}catch(e){if(e instanceof TypeError||e instanceof Pn||e instanceof En)throw e;d=di(s)}const h=bn(e.iv),p=bn(e.tag),m=un.encode(null!==(n=e.protected)&&void 0!==n?n:"");let g;g=void 0!==e.aad?ln(m,un.encode("."),un.encode(e.aad)):m;let y=await Wn(s,d,bn(e.ciphertext),h,p,g);"DEF"===o.zip&&(y=await((null==r?void 0:r.inflateRaw)||Gn)(y));const b={plaintext:y};return void 0!==e.protected&&(b.protectedHeader=i),void 0!==e.aad&&(b.additionalAuthenticatedData=bn(e.aad)),void 0!==e.unprotected&&(b.sharedUnprotectedHeader=e.unprotected),void 0!==e.header&&(b.unprotectedHeader=e.header),l?{...b,key:t}:b}({ciphertext:a,iv:o||void 0,protected:n||void 0,tag:s||void 0,encrypted_key:i||void 0},t,r),f={plaintext:u.plaintext,protectedHeader:u.protectedHeader};return"function"==typeof t?{...f,key:u.key}:f}var wi=async e=>{if(e instanceof Uint8Array)return{kty:"oct",k:yn(e)};if(!sn(e))throw new TypeError(Ln(e,...Kn,"Uint8Array"));if(!e.extractable)throw new TypeError("non-extractable CryptoKey cannot be exported as a JWK");const{ext:t,key_ops:r,alg:n,use:i,...o}=await an.subtle.exportKey("jwk",e);return o};async function Ai(e){return wi(e)}async function _i(e,t,r,n,i={}){let o,a,s;switch(pi(e,r,"encrypt"),e){case"dir":s=r;break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{if(!ii(r))throw new En("ECDH with the provided key is not allowed or not supported by your javascript runtime");const{apu:c,apv:u}=i;let{epk:f}=i;f||(f=(await async function(e){if(!sn(e))throw new TypeError(Ln(e,...Kn));return an.subtle.generateKey(e.algorithm,!0,["deriveBits"])}(r)).privateKey);const{x:d,y:l,crv:h,kty:p}=await Ai(f),m=await ni(r,f,"ECDH-ES"===e?t:e,"ECDH-ES"===e?fi(t):parseInt(e.slice(-5,-2),10),c,u);if(a={epk:{x:d,crv:h,kty:p}},"EC"===p&&(a.epk.y=l),c&&(a.apu=yn(c)),u&&(a.apv=yn(u)),"ECDH-ES"===e){s=m;break}s=n||di(t);const g=e.slice(-6);o=await ti(g,m,s);break}case"RSA1_5":case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":s=n||di(t),o=await(async(e,t,r)=>{if(!sn(t))throw new TypeError(Ln(t,...Kn));if(zn(t,e,"encrypt","wrapKey"),ci(e,t),t.usages.includes("encrypt"))return new Uint8Array(await an.subtle.encrypt(si(e),t,r));if(t.usages.includes("wrapKey")){const n=await an.subtle.importKey("raw",r,...Qn);return new Uint8Array(await an.subtle.wrapKey("raw",n,t,si(e)))}throw new TypeError('RSA-OAEP key "usages" must include "encrypt" or "wrapKey" for this operation')})(e,r,s);break;case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":{s=n||di(t);const{p2c:c,p2s:u}=i;({encryptedKey:o,...a}=await(async(e,t,r,n=2048,i=Cn(new Uint8Array(16)))=>{const o=await oi(i,e,n,t);return{encryptedKey:await ti(e.slice(-6),o,r),p2c:n,p2s:yn(i)}})(e,r,s,c,u));break}case"A128KW":case"A192KW":case"A256KW":s=n||di(t),o=await ti(e,r,s);break;case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":{s=n||di(t);const{iv:c}=i;({encryptedKey:o,...a}=await async function(e,t,r,n){const i=e.slice(0,7);n||(n=Rn(i));const{ciphertext:o,tag:a}=await mi(i,r,t,n,new Uint8Array(0));return{encryptedKey:o,iv:yn(n),tag:yn(a)}}(e,r,s,c));break}default:throw new En('Invalid or unsupported "alg" (JWE Algorithm) header value')}return{cek:s,encryptedKey:o,parameters:a}}const Ei=Symbol();class Si{constructor(e){if(!(e instanceof Uint8Array))throw new TypeError("plaintext must be an instance of Uint8Array");this._plaintext=e}setKeyManagementParameters(e){if(this._keyManagementParameters)throw new TypeError("setKeyManagementParameters can only be called once");return this._keyManagementParameters=e,this}setProtectedHeader(e){if(this._protectedHeader)throw new TypeError("setProtectedHeader can only be called once");return this._protectedHeader=e,this}setSharedUnprotectedHeader(e){if(this._sharedUnprotectedHeader)throw new TypeError("setSharedUnprotectedHeader can only be called once");return this._sharedUnprotectedHeader=e,this}setUnprotectedHeader(e){if(this._unprotectedHeader)throw new TypeError("setUnprotectedHeader can only be called once");return this._unprotectedHeader=e,this}setAdditionalAuthenticatedData(e){return this._aad=e,this}setContentEncryptionKey(e){if(this._cek)throw new TypeError("setContentEncryptionKey can only be called once");return this._cek=e,this}setInitializationVector(e){if(this._iv)throw new TypeError("setInitializationVector can only be called once");return this._iv=e,this}async encrypt(e,t){if(!this._protectedHeader&&!this._unprotectedHeader&&!this._sharedUnprotectedHeader)throw new Pn("either setProtectedHeader, setUnprotectedHeader, or sharedUnprotectedHeader must be called before #encrypt()");if(!Zn(this._protectedHeader,this._unprotectedHeader,this._sharedUnprotectedHeader))throw new Pn("JWE Protected, JWE Shared Unprotected and JWE Per-Recipient Header Parameter names must be disjoint");const r={...this._protectedHeader,...this._unprotectedHeader,...this._sharedUnprotectedHeader};if(yi(Pn,new Map,null==t?void 0:t.crit,this._protectedHeader,r),void 0!==r.zip){if(!this._protectedHeader||!this._protectedHeader.zip)throw new Pn('JWE "zip" (Compression Algorithm) Header MUST be integrity protected');if("DEF"!==r.zip)throw new En('Unsupported JWE "zip" (Compression Algorithm) Header Parameter value')}const{alg:n,enc:i}=r;if("string"!=typeof n||!n)throw new Pn('JWE "alg" (Algorithm) Header Parameter missing or invalid');if("string"!=typeof i||!i)throw new Pn('JWE "enc" (Encryption Algorithm) Header Parameter missing or invalid');let o,a,s,c,u,f,d;if("dir"===n){if(this._cek)throw new TypeError("setContentEncryptionKey cannot be called when using Direct Encryption")}else if("ECDH-ES"===n&&this._cek)throw new TypeError("setContentEncryptionKey cannot be called when using Direct Key Agreement");{let r;({cek:a,encryptedKey:o,parameters:r}=await _i(n,i,e,this._cek,this._keyManagementParameters)),r&&(t&&Ei in t?this._unprotectedHeader?this._unprotectedHeader={...this._unprotectedHeader,...r}:this.setUnprotectedHeader(r):this._protectedHeader?this._protectedHeader={...this._protectedHeader,...r}:this.setProtectedHeader(r))}if(this._iv||(this._iv=Rn(i)),c=this._protectedHeader?un.encode(yn(JSON.stringify(this._protectedHeader))):un.encode(""),this._aad?(u=yn(this._aad),s=ln(c,un.encode("."),un.encode(u))):s=c,"DEF"===r.zip){const e=await((null==t?void 0:t.deflateRaw)||Vn)(this._plaintext);({ciphertext:f,tag:d}=await mi(i,e,a,this._iv,s))}else({ciphertext:f,tag:d}=await mi(i,this._plaintext,a,this._iv,s));const l={ciphertext:yn(f),iv:yn(this._iv),tag:yn(d)};return o&&(l.encrypted_key=yn(o)),u&&(l.aad=u),this._protectedHeader&&(l.protected=fn.decode(c)),this._sharedUnprotectedHeader&&(l.unprotected=this._sharedUnprotectedHeader),this._unprotectedHeader&&(l.header=this._unprotectedHeader),l}}function Pi(e,t){const r=`SHA-${e.slice(-3)}`;switch(e){case"HS256":case"HS384":case"HS512":return{hash:r,name:"HMAC"};case"PS256":case"PS384":case"PS512":return{hash:r,name:"RSA-PSS",saltLength:e.slice(-3)>>3};case"RS256":case"RS384":case"RS512":return{hash:r,name:"RSASSA-PKCS1-v1_5"};case"ES256":case"ES384":case"ES512":return{hash:r,name:"ECDSA",namedCurve:t.namedCurve};case"EdDSA":return Tn()&&"NODE-ED25519"===t.name?{name:"NODE-ED25519",namedCurve:"NODE-ED25519"}:{name:t.name};default:throw new En(`alg ${e} is not supported either by JOSE or your javascript runtime`)}}function xi(e,t,r){if(sn(t))return Fn(t,e,r),t;if(t instanceof Uint8Array){if(!e.startsWith("HS"))throw new TypeError(Ln(t,...Kn));return an.subtle.importKey("raw",t,{hash:`SHA-${e.slice(-3)}`,name:"HMAC"},!1,[r])}throw new TypeError(Ln(t,...Kn,"Uint8Array"))}const ki=async(e,t,r,n)=>{const i=await xi(e,t,"verify");ci(e,i);const o=Pi(e,i.algorithm);try{return await an.subtle.verify(o,i,r,n)}catch(e){return!1}};async function Mi(e,t,r){var n;if(!Xn(e))throw new xn("Flattened JWS must be an object");if(void 0===e.protected&&void 0===e.header)throw new xn('Flattened JWS must have either of the "protected" or "header" members');if(void 0!==e.protected&&"string"!=typeof e.protected)throw new xn("JWS Protected Header incorrect type");if(void 0===e.payload)throw new xn("JWS Payload missing");if("string"!=typeof e.signature)throw new xn("JWS Signature missing or incorrect type");if(void 0!==e.header&&!Xn(e.header))throw new xn("JWS Unprotected Header incorrect type");let i={};if(e.protected)try{const t=bn(e.protected);i=JSON.parse(fn.decode(t))}catch(e){throw new xn("JWS Protected Header is invalid")}if(!Zn(i,e.header))throw new xn("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");const o={...i,...e.header};let a=!0;if(yi(xn,new Map([["b64",!0]]),null==r?void 0:r.crit,i,o).has("b64")&&(a=i.b64,"boolean"!=typeof a))throw new xn('The "b64" (base64url-encode payload) Header Parameter must be a boolean');const{alg:s}=o;if("string"!=typeof s||!s)throw new xn('JWS "alg" (Algorithm) Header Parameter missing or invalid');const c=r&&bi("algorithms",r.algorithms);if(c&&!c.has(s))throw new _n('"alg" (Algorithm) Header Parameter not allowed');if(a){if("string"!=typeof e.payload)throw new xn("JWS Payload must be a string")}else if("string"!=typeof e.payload&&!(e.payload instanceof Uint8Array))throw new xn("JWS Payload must be a string or an Uint8Array instance");let u=!1;"function"==typeof t&&(t=await t(i,e),u=!0),pi(s,t,"verify");const f=ln(un.encode(null!==(n=e.protected)&&void 0!==n?n:""),un.encode("."),"string"==typeof e.payload?un.encode(e.payload):e.payload),d=bn(e.signature);if(!await ki(s,t,d,f))throw new Mn;let l;l=a?bn(e.payload):"string"==typeof e.payload?un.encode(e.payload):e.payload;const h={payload:l};return void 0!==e.protected&&(h.protectedHeader=i),void 0!==e.header&&(h.unprotectedHeader=e.header),u?{...h,key:t}:h}var Ci=e=>Math.floor(e.getTime()/1e3);const Ii=86400,Ri=/^(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)$/i;var Ni=e=>{const t=Ri.exec(e);if(!t)throw new TypeError("Invalid time period format");const r=parseFloat(t[1]);switch(t[2].toLowerCase()){case"sec":case"secs":case"second":case"seconds":case"s":return Math.round(r);case"minute":case"minutes":case"min":case"mins":case"m":return Math.round(60*r);case"hour":case"hours":case"hr":case"hrs":case"h":return Math.round(3600*r);case"day":case"days":case"d":return Math.round(r*Ii);case"week":case"weeks":case"w":return Math.round(604800*r);default:return Math.round(31557600*r)}};const Oi=e=>e.toLowerCase().replace(/^application\//,"");var Ti=(e,t,r={})=>{const{typ:n}=r;if(n&&("string"!=typeof e.typ||Oi(e.typ)!==Oi(n)))throw new wn('unexpected "typ" JWT header value',"typ","check_failed");let i;try{i=JSON.parse(fn.decode(t))}catch(e){}if(!Xn(i))throw new kn("JWT Claims Set must be a top-level JSON object");const{requiredClaims:o=[],issuer:a,subject:s,audience:c,maxTokenAge:u}=r;void 0!==u&&o.push("iat"),void 0!==c&&o.push("aud"),void 0!==s&&o.push("sub"),void 0!==a&&o.push("iss");for(const e of new Set(o.reverse()))if(!(e in i))throw new wn(`missing required "${e}" claim`,e,"missing");if(a&&!(Array.isArray(a)?a:[a]).includes(i.iss))throw new wn('unexpected "iss" claim value',"iss","check_failed");if(s&&i.sub!==s)throw new wn('unexpected "sub" claim value',"sub","check_failed");if(c&&(f=i.aud,d="string"==typeof c?[c]:c,!("string"==typeof f?d.includes(f):Array.isArray(f)&&d.some(Set.prototype.has.bind(new Set(f))))))throw new wn('unexpected "aud" claim value',"aud","check_failed");var f,d;let l;switch(typeof r.clockTolerance){case"string":l=Ni(r.clockTolerance);break;case"number":l=r.clockTolerance;break;case"undefined":l=0;break;default:throw new TypeError("Invalid clockTolerance option type")}const{currentDate:h}=r,p=Ci(h||new Date);if((void 0!==i.iat||u)&&"number"!=typeof i.iat)throw new wn('"iat" claim must be a number',"iat","invalid");if(void 0!==i.nbf){if("number"!=typeof i.nbf)throw new wn('"nbf" claim must be a number',"nbf","invalid");if(i.nbf>p+l)throw new wn('"nbf" claim timestamp check failed',"nbf","check_failed")}if(void 0!==i.exp){if("number"!=typeof i.exp)throw new wn('"exp" claim must be a number',"exp","invalid");if(i.exp<=p-l)throw new An('"exp" claim timestamp check failed',"exp","check_failed")}if(u){const e=p-i.iat;if(e-l>("number"==typeof u?u:Ni(u)))throw new An('"iat" claim timestamp check failed (too far in the past)',"iat","check_failed");if(e<0-l)throw new wn('"iat" claim timestamp check failed (it should be in the past)',"iat","check_failed")}return i};async function ji(e,t,r){var n;const i=await async function(e,t,r){if(e instanceof Uint8Array&&(e=fn.decode(e)),"string"!=typeof e)throw new xn("Compact JWS must be a string or Uint8Array");const{0:n,1:i,2:o,length:a}=e.split(".");if(3!==a)throw new xn("Invalid Compact JWS");const s=await Mi({payload:i,protected:n,signature:o},t,r),c={payload:s.payload,protectedHeader:s.protectedHeader};return"function"==typeof t?{...c,key:s.key}:c}(e,t,r);if((null===(n=i.protectedHeader.crit)||void 0===n?void 0:n.includes("b64"))&&!1===i.protectedHeader.b64)throw new kn("JWTs MUST NOT use unencoded payload");const o={payload:Ti(i.protectedHeader,i.payload,r),protectedHeader:i.protectedHeader};return"function"==typeof t?{...o,key:i.key}:o}class Di{constructor(e){this._flattened=new Si(e)}setContentEncryptionKey(e){return this._flattened.setContentEncryptionKey(e),this}setInitializationVector(e){return this._flattened.setInitializationVector(e),this}setProtectedHeader(e){return this._flattened.setProtectedHeader(e),this}setKeyManagementParameters(e){return this._flattened.setKeyManagementParameters(e),this}async encrypt(e,t){const r=await this._flattened.encrypt(e,t);return[r.protected,r.encrypted_key,r.iv,r.ciphertext,r.tag].join(".")}}class $i{constructor(e){if(!(e instanceof Uint8Array))throw new TypeError("payload must be an instance of Uint8Array");this._payload=e}setProtectedHeader(e){if(this._protectedHeader)throw new TypeError("setProtectedHeader can only be called once");return this._protectedHeader=e,this}setUnprotectedHeader(e){if(this._unprotectedHeader)throw new TypeError("setUnprotectedHeader can only be called once");return this._unprotectedHeader=e,this}async sign(e,t){if(!this._protectedHeader&&!this._unprotectedHeader)throw new xn("either setProtectedHeader or setUnprotectedHeader must be called before #sign()");if(!Zn(this._protectedHeader,this._unprotectedHeader))throw new xn("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");const r={...this._protectedHeader,...this._unprotectedHeader};let n=!0;if(yi(xn,new Map([["b64",!0]]),null==t?void 0:t.crit,this._protectedHeader,r).has("b64")&&(n=this._protectedHeader.b64,"boolean"!=typeof n))throw new xn('The "b64" (base64url-encode payload) Header Parameter must be a boolean');const{alg:i}=r;if("string"!=typeof i||!i)throw new xn('JWS "alg" (Algorithm) Header Parameter missing or invalid');pi(i,e,"sign");let o,a=this._payload;n&&(a=un.encode(yn(a))),o=this._protectedHeader?un.encode(yn(JSON.stringify(this._protectedHeader))):un.encode("");const s=ln(o,un.encode("."),a),c=await(async(e,t,r)=>{const n=await xi(e,t,"sign");ci(e,n);const i=await an.subtle.sign(Pi(e,n.algorithm),n,r);return new Uint8Array(i)})(i,e,s),u={signature:yn(c),payload:""};return n&&(u.payload=fn.decode(a)),this._unprotectedHeader&&(u.header=this._unprotectedHeader),this._protectedHeader&&(u.protected=fn.decode(o)),u}}class Bi{constructor(e){this._flattened=new $i(e)}setProtectedHeader(e){return this._flattened.setProtectedHeader(e),this}async sign(e,t){const r=await this._flattened.sign(e,t);if(void 0===r.payload)throw new TypeError("use the flattened module for creating JWS with b64: false");return`${r.protected}.${r.payload}.${r.signature}`}}class Fi{constructor(e,t,r){this.parent=e,this.key=t,this.options=r}setProtectedHeader(e){if(this.protectedHeader)throw new TypeError("setProtectedHeader can only be called once");return this.protectedHeader=e,this}setUnprotectedHeader(e){if(this.unprotectedHeader)throw new TypeError("setUnprotectedHeader can only be called once");return this.unprotectedHeader=e,this}addSignature(...e){return this.parent.addSignature(...e)}sign(...e){return this.parent.sign(...e)}done(){return this.parent}}class zi{constructor(e){this._signatures=[],this._payload=e}addSignature(e,t){const r=new Fi(this,e,t);return this._signatures.push(r),r}async sign(){if(!this._signatures.length)throw new xn("at least one signature must be added");const e={signatures:[],payload:""};for(let t=0;t>3));case"A128KW":case"A192KW":case"A256KW":n=parseInt(e.slice(1,4),10),i={name:"AES-KW",length:n},o=["wrapKey","unwrapKey"];break;case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":case"A128GCM":case"A192GCM":case"A256GCM":n=parseInt(e.slice(1,4),10),i={name:"AES-GCM",length:n},o=["encrypt","decrypt"];break;default:throw new En('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}return an.subtle.generateKey(i,null!==(r=null==t?void 0:t.extractable)&&void 0!==r&&r,o)}(e,t)}async function Ki(e,t){const r=void 0===t?e.alg:t,n=tn.concat(en).concat(rn);if(!n.includes(r))throw new nn("invalid alg. Must be one of: "+n.join(","),["invalid algorithm"]);try{const r=await hi(e,t);if(null==r)throw new nn(new Error("failed importing keys"),["invalid key"]);return r}catch(e){throw new nn(e,["invalid key"])}}async function Ji(e,t,r){let n,i;const o={...t};if(tn.includes(t.alg))n="dir",i=void 0!==r?r:t.alg;else{if(!en.concat(rn).includes(t.alg))throw new nn(`Not a valid symmetric or assymetric alg: ${t.alg}`,["encryption failed","invalid key","invalid algorithm"]);if(void 0===r)throw new nn("An encryption algorith encAlg for content encryption should be provided. Allowed values are: "+tn.join(","),["encryption failed"]);i=r,n="ECDH-ES",o.alg=n}const a=await Ki(o);let s;try{return s=await new Di(e).setProtectedHeader({alg:n,enc:i,kid:t.kid}).encrypt(a),s}catch(e){throw new nn(e,["encryption failed"])}}async function Wi(e,t){try{const r={...t},{alg:n,enc:i}=function(e){let t;if("string"==typeof e){const r=e.split(".");3!==r.length&&5!==r.length||([t]=r)}else if("object"==typeof e&&e){if(!("protected"in e))throw new TypeError("Token does not contain a Protected Header");t=e.protected}try{if("string"!=typeof t||!t)throw new Error;const e=JSON.parse(fn.decode(qi(t)));if(!Xn(e))throw new Error;return e}catch(e){throw new TypeError("Invalid Token or Protected Header formatting")}}(e);if(void 0===n||void 0===i)throw new nn("missing enc or alg in jwe header",["invalid format"]);"ECDH-ES"===n&&(r.alg=n);const o=await Ki(r);return await vi(e,o,{contentEncryptionAlgorithms:[i]})}catch(e){throw new nn(e,["decryption failed"])}}async function Gi(e,t){const n=e.match(/^([a-zA-Z0-9_-]+)\.{1,2}([a-zA-Z0-9_-]+)\.([a-zA-Z0-9_-]+)$/);if(null===n)throw new nn(new Error(`${e} is not a JWS`),["not a compact jws"]);let i,o;try{i=JSON.parse(r(n[1],!0)),o=JSON.parse(r(n[2],!0))}catch(e){throw new nn(e,["invalid format","not a compact jws"])}if(void 0!==t){const r="function"==typeof t?await t(i,o):t,n=await Ki(r);try{const t=await ji(e,n);return{header:t.protectedHeader,payload:t.payload,signer:r}}catch(e){throw new nn(e,["jws verification failed"])}}return{header:i,payload:o}}function Vi(e){if(tn.concat(Yr).concat(en).includes(e))return Number(e.match(/\d{3}/)[0])/8;throw new nn("unsupported algorithm",["invalid algorithm"])}async function Zi(e,t,a){let s;if(!tn.includes(e))throw new nn(new Error(`Invalid encAlg '${e}'. Supported values are: ${tn.toString()}`),["invalid algorithm"]);const c=Vi(e);if(void 0!==t){if("string"==typeof t)if(!0===a)s=r(t);else{const e=n(t,!1);if(e!==n(t,!1,c))throw new nn(new RangeError(`Expected hex length ${2*c} does not meet provided one ${e.length/2}`),["invalid key"]);s=new Uint8Array(o(t))}else s=t;if(s.length!==c)throw new nn(new RangeError(`Expected secret length ${c} does not meet provided one ${s.length}`),["invalid key"])}else try{s=await Hi(e,{extractable:!0})}catch(e){throw new nn(e,["unexpected error"])}const u=await Ai(s);return u.alg=e,{jwk:u,hex:i(r(u.k),!1,c)}}async function Xi(e,t){if(void 0===e.alg||void 0===t.alg||e.alg!==t.alg)throw new Error("alg no present in either pubJwk or privJwk, or pubJWK.alg != privJWK.alg");const r=await Ki(e),n=await Ki(t);try{const e=await a(16),i=await new zi(e).addSignature(n).setProtectedHeader({alg:t.alg}).sign();await async function(e,t,r){if(!Xn(e))throw new xn("General JWS must be an object");if(!Array.isArray(e.signatures)||!e.signatures.every(Xn))throw new xn("JWS Signatures missing or incorrect type");for(const n of e.signatures)try{return await Mi({header:n.header,payload:e.payload,protected:n.protected,signature:n.signature},t,r)}catch(e){}throw new Mn}(i,r)}catch(e){throw new nn(e,["unexpected error"])}}function Qi(e){return null!=e&&"object"==typeof e&&!Array.isArray(e)}function Yi(e){return Qi(e)||Array.isArray(e)?Array.isArray(e)?e.map((e=>Array.isArray(e)||Qi(e)?Yi(e):e)):Object.keys(e).sort().map((t=>[t,Yi(e[t])])):e}function eo(e){return JSON.stringify(Yi(e))}function to(e,t,r,n=2e3){if(er+n)throw new nn(new Error(`timestamp ${new Date(e).toTimeString()} after 'notAfter' ${new Date(r).toTimeString()} with tolerance of ${n/1e3}s`),["invalid timestamp"])}function ro(e){return Array.isArray(e)?e.sort().map(ro):(t=e,"[object Object]"===Object.prototype.toString.call(t)?Object.keys(e).sort().reduce((function(t,r){return t[r]=ro(e[r]),t}),{}):e);var t}function no(e,t=!1,r){try{return n(e,t,r)}catch(e){throw new nn(e,["invalid format"])}}async function io(e,t){try{await Ki(e,e.alg);const r=ro(e);return t?JSON.stringify(r):r}catch(e){throw new nn(e,["invalid key"])}}async function oo(e,t){const r=Yr;if(!r.includes(t))throw new nn(new RangeError(`Valid hash algorith values are any of ${JSON.stringify(r)}`),["invalid algorithm"]);const n=new TextEncoder,i="string"==typeof e?n.encode(e).buffer:e;try{let e;return e=new Uint8Array(await crypto.subtle.digest(t,i)),e}catch(e){throw new nn(e,["unexpected error"])}}var ao={exports:{}};!function(e){!function(e,t){function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function n(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function i(e,t,r){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var o;"object"==typeof e?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:p.Buffer}catch(e){}function a(e,t){var n=e.charCodeAt(t);return n>=48&&n<=57?n-48:n>=65&&n<=70?n-55:n>=97&&n<=102?n-87:void r(!1,"Invalid character in "+e)}function s(e,t,r){var n=a(e,r);return r-1>=t&&(n|=a(e,r-1)<<4),n}function c(e,t,n,i){for(var o=0,a=0,s=Math.min(e.length,n),c=t;c=49?u-49+10:u>=17?u-17+10:u,r(u>=0&&a0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,n){if("number"==typeof e)return this._initNumber(e,t,n);if("object"==typeof e)return this._initArray(e,t,n);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)a=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===n)for(i=0,o=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this._strip()},i.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n=t;n-=2)i=s(e,t,n)<=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(n=(e.length-t)%2==0?t+1:t;n=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this._strip()},i.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,a=o%n,s=Math.min(o,o-a)+r,u=0,f=r;f1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=f}catch(e){i.prototype.inspect=f}else i.prototype.inspect=f;function f(){return(this.red?""}var d=["","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"],l=[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];i.prototype.toString=function(e,t){var n;if(t=0|t||1,16===(e=e||10)||"hex"===e){n="";for(var i=0,o=0,a=0;a>>24-i&16777215,(i+=2)>=26&&(i-=26,a--),n=0!==o||a!==this.length-1?d[6-c.length]+c+n:c+n}for(0!==o&&(n=o.toString(16)+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(e===(0|e)&&e>=2&&e<=36){var u=l[e],f=h[e];n="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modrn(f).toString(e);n=(p=p.idivn(f)).isZero()?m+n:d[u-m.length]+m+n}for(this.isZero()&&(n="0"+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},i.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&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16,2)},o&&(i.prototype.toBuffer=function(e,t){return this.toArrayLike(o,e,t)}),i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)};function m(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],a=i*o,s=67108863&a,c=a/67108864|0;r.words[0]=s;for(var u=1;u>>26,d=67108863&c,l=Math.min(u,t.length-1),h=Math.max(0,u-e.length+1);h<=l;h++){var p=u-h|0;f+=(a=(i=0|e.words[p])*(o=0|t.words[h])+d)/67108864|0,d=67108863&a}r.words[u]=0|d,c=0|f}return 0!==c?r.words[u]=0|c:r.length--,r._strip()}i.prototype.toArrayLike=function(e,t,n){this._strip();var i=this.byteLength(),o=n||Math.max(1,i);r(i<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0");var a=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,o);return this["_toArrayLike"+("le"===t?"LE":"BE")](a,i),a},i.prototype._toArrayLikeLE=function(e,t){for(var r=0,n=0,i=0,o=0;i>8&255),r>16&255),6===o?(r>24&255),n=0,o=0):(n=a>>>24,o+=2)}if(r=0&&(e[r--]=a>>8&255),r>=0&&(e[r--]=a>>16&255),6===o?(r>=0&&(e[r--]=a>>24&255),n=0,o=0):(n=a>>>24,o+=2)}if(r>=0)for(e[r--]=n;r>=0;)e[r--]=0},Math.clz32?i.prototype._countBits=function(e){return 32-Math.clz32(e)}:i.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){r("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),n>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-n),this._strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){r("number"==typeof e&&e>=0);var n=e/26|0,i=e%26;return this._expand(n+1),this.words[n]=t?this.words[n]|1<e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},i.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,a=0;a>26,this.words[a]=67108863&t;for(;0!==o&&a>26,this.words[a]=67108863&t;if(0===o&&a>>13,h=0|a[1],p=8191&h,m=h>>>13,g=0|a[2],y=8191&g,b=g>>>13,v=0|a[3],w=8191&v,A=v>>>13,_=0|a[4],E=8191&_,S=_>>>13,P=0|a[5],x=8191&P,k=P>>>13,M=0|a[6],C=8191&M,I=M>>>13,R=0|a[7],N=8191&R,O=R>>>13,T=0|a[8],j=8191&T,D=T>>>13,$=0|a[9],B=8191&$,F=$>>>13,z=0|s[0],U=8191&z,L=z>>>13,q=0|s[1],H=8191&q,K=q>>>13,J=0|s[2],W=8191&J,G=J>>>13,V=0|s[3],Z=8191&V,X=V>>>13,Q=0|s[4],Y=8191&Q,ee=Q>>>13,te=0|s[5],re=8191&te,ne=te>>>13,ie=0|s[6],oe=8191&ie,ae=ie>>>13,se=0|s[7],ce=8191&se,ue=se>>>13,fe=0|s[8],de=8191&fe,le=fe>>>13,he=0|s[9],pe=8191&he,me=he>>>13;r.negative=e.negative^t.negative,r.length=19;var ge=(u+(n=Math.imul(d,U))|0)+((8191&(i=(i=Math.imul(d,L))+Math.imul(l,U)|0))<<13)|0;u=((o=Math.imul(l,L))+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(p,U),i=(i=Math.imul(p,L))+Math.imul(m,U)|0,o=Math.imul(m,L);var ye=(u+(n=n+Math.imul(d,H)|0)|0)+((8191&(i=(i=i+Math.imul(d,K)|0)+Math.imul(l,H)|0))<<13)|0;u=((o=o+Math.imul(l,K)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(y,U),i=(i=Math.imul(y,L))+Math.imul(b,U)|0,o=Math.imul(b,L),n=n+Math.imul(p,H)|0,i=(i=i+Math.imul(p,K)|0)+Math.imul(m,H)|0,o=o+Math.imul(m,K)|0;var be=(u+(n=n+Math.imul(d,W)|0)|0)+((8191&(i=(i=i+Math.imul(d,G)|0)+Math.imul(l,W)|0))<<13)|0;u=((o=o+Math.imul(l,G)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(w,U),i=(i=Math.imul(w,L))+Math.imul(A,U)|0,o=Math.imul(A,L),n=n+Math.imul(y,H)|0,i=(i=i+Math.imul(y,K)|0)+Math.imul(b,H)|0,o=o+Math.imul(b,K)|0,n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(m,W)|0,o=o+Math.imul(m,G)|0;var ve=(u+(n=n+Math.imul(d,Z)|0)|0)+((8191&(i=(i=i+Math.imul(d,X)|0)+Math.imul(l,Z)|0))<<13)|0;u=((o=o+Math.imul(l,X)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(E,U),i=(i=Math.imul(E,L))+Math.imul(S,U)|0,o=Math.imul(S,L),n=n+Math.imul(w,H)|0,i=(i=i+Math.imul(w,K)|0)+Math.imul(A,H)|0,o=o+Math.imul(A,K)|0,n=n+Math.imul(y,W)|0,i=(i=i+Math.imul(y,G)|0)+Math.imul(b,W)|0,o=o+Math.imul(b,G)|0,n=n+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,X)|0;var we=(u+(n=n+Math.imul(d,Y)|0)|0)+((8191&(i=(i=i+Math.imul(d,ee)|0)+Math.imul(l,Y)|0))<<13)|0;u=((o=o+Math.imul(l,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(x,U),i=(i=Math.imul(x,L))+Math.imul(k,U)|0,o=Math.imul(k,L),n=n+Math.imul(E,H)|0,i=(i=i+Math.imul(E,K)|0)+Math.imul(S,H)|0,o=o+Math.imul(S,K)|0,n=n+Math.imul(w,W)|0,i=(i=i+Math.imul(w,G)|0)+Math.imul(A,W)|0,o=o+Math.imul(A,G)|0,n=n+Math.imul(y,Z)|0,i=(i=i+Math.imul(y,X)|0)+Math.imul(b,Z)|0,o=o+Math.imul(b,X)|0,n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(m,Y)|0,o=o+Math.imul(m,ee)|0;var Ae=(u+(n=n+Math.imul(d,re)|0)|0)+((8191&(i=(i=i+Math.imul(d,ne)|0)+Math.imul(l,re)|0))<<13)|0;u=((o=o+Math.imul(l,ne)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(C,U),i=(i=Math.imul(C,L))+Math.imul(I,U)|0,o=Math.imul(I,L),n=n+Math.imul(x,H)|0,i=(i=i+Math.imul(x,K)|0)+Math.imul(k,H)|0,o=o+Math.imul(k,K)|0,n=n+Math.imul(E,W)|0,i=(i=i+Math.imul(E,G)|0)+Math.imul(S,W)|0,o=o+Math.imul(S,G)|0,n=n+Math.imul(w,Z)|0,i=(i=i+Math.imul(w,X)|0)+Math.imul(A,Z)|0,o=o+Math.imul(A,X)|0,n=n+Math.imul(y,Y)|0,i=(i=i+Math.imul(y,ee)|0)+Math.imul(b,Y)|0,o=o+Math.imul(b,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(m,re)|0,o=o+Math.imul(m,ne)|0;var _e=(u+(n=n+Math.imul(d,oe)|0)|0)+((8191&(i=(i=i+Math.imul(d,ae)|0)+Math.imul(l,oe)|0))<<13)|0;u=((o=o+Math.imul(l,ae)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(N,U),i=(i=Math.imul(N,L))+Math.imul(O,U)|0,o=Math.imul(O,L),n=n+Math.imul(C,H)|0,i=(i=i+Math.imul(C,K)|0)+Math.imul(I,H)|0,o=o+Math.imul(I,K)|0,n=n+Math.imul(x,W)|0,i=(i=i+Math.imul(x,G)|0)+Math.imul(k,W)|0,o=o+Math.imul(k,G)|0,n=n+Math.imul(E,Z)|0,i=(i=i+Math.imul(E,X)|0)+Math.imul(S,Z)|0,o=o+Math.imul(S,X)|0,n=n+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(A,Y)|0,o=o+Math.imul(A,ee)|0,n=n+Math.imul(y,re)|0,i=(i=i+Math.imul(y,ne)|0)+Math.imul(b,re)|0,o=o+Math.imul(b,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,ae)|0)+Math.imul(m,oe)|0,o=o+Math.imul(m,ae)|0;var Ee=(u+(n=n+Math.imul(d,ce)|0)|0)+((8191&(i=(i=i+Math.imul(d,ue)|0)+Math.imul(l,ce)|0))<<13)|0;u=((o=o+Math.imul(l,ue)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(j,U),i=(i=Math.imul(j,L))+Math.imul(D,U)|0,o=Math.imul(D,L),n=n+Math.imul(N,H)|0,i=(i=i+Math.imul(N,K)|0)+Math.imul(O,H)|0,o=o+Math.imul(O,K)|0,n=n+Math.imul(C,W)|0,i=(i=i+Math.imul(C,G)|0)+Math.imul(I,W)|0,o=o+Math.imul(I,G)|0,n=n+Math.imul(x,Z)|0,i=(i=i+Math.imul(x,X)|0)+Math.imul(k,Z)|0,o=o+Math.imul(k,X)|0,n=n+Math.imul(E,Y)|0,i=(i=i+Math.imul(E,ee)|0)+Math.imul(S,Y)|0,o=o+Math.imul(S,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(A,re)|0,o=o+Math.imul(A,ne)|0,n=n+Math.imul(y,oe)|0,i=(i=i+Math.imul(y,ae)|0)+Math.imul(b,oe)|0,o=o+Math.imul(b,ae)|0,n=n+Math.imul(p,ce)|0,i=(i=i+Math.imul(p,ue)|0)+Math.imul(m,ce)|0,o=o+Math.imul(m,ue)|0;var Se=(u+(n=n+Math.imul(d,de)|0)|0)+((8191&(i=(i=i+Math.imul(d,le)|0)+Math.imul(l,de)|0))<<13)|0;u=((o=o+Math.imul(l,le)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(B,U),i=(i=Math.imul(B,L))+Math.imul(F,U)|0,o=Math.imul(F,L),n=n+Math.imul(j,H)|0,i=(i=i+Math.imul(j,K)|0)+Math.imul(D,H)|0,o=o+Math.imul(D,K)|0,n=n+Math.imul(N,W)|0,i=(i=i+Math.imul(N,G)|0)+Math.imul(O,W)|0,o=o+Math.imul(O,G)|0,n=n+Math.imul(C,Z)|0,i=(i=i+Math.imul(C,X)|0)+Math.imul(I,Z)|0,o=o+Math.imul(I,X)|0,n=n+Math.imul(x,Y)|0,i=(i=i+Math.imul(x,ee)|0)+Math.imul(k,Y)|0,o=o+Math.imul(k,ee)|0,n=n+Math.imul(E,re)|0,i=(i=i+Math.imul(E,ne)|0)+Math.imul(S,re)|0,o=o+Math.imul(S,ne)|0,n=n+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,ae)|0)+Math.imul(A,oe)|0,o=o+Math.imul(A,ae)|0,n=n+Math.imul(y,ce)|0,i=(i=i+Math.imul(y,ue)|0)+Math.imul(b,ce)|0,o=o+Math.imul(b,ue)|0,n=n+Math.imul(p,de)|0,i=(i=i+Math.imul(p,le)|0)+Math.imul(m,de)|0,o=o+Math.imul(m,le)|0;var Pe=(u+(n=n+Math.imul(d,pe)|0)|0)+((8191&(i=(i=i+Math.imul(d,me)|0)+Math.imul(l,pe)|0))<<13)|0;u=((o=o+Math.imul(l,me)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(B,H),i=(i=Math.imul(B,K))+Math.imul(F,H)|0,o=Math.imul(F,K),n=n+Math.imul(j,W)|0,i=(i=i+Math.imul(j,G)|0)+Math.imul(D,W)|0,o=o+Math.imul(D,G)|0,n=n+Math.imul(N,Z)|0,i=(i=i+Math.imul(N,X)|0)+Math.imul(O,Z)|0,o=o+Math.imul(O,X)|0,n=n+Math.imul(C,Y)|0,i=(i=i+Math.imul(C,ee)|0)+Math.imul(I,Y)|0,o=o+Math.imul(I,ee)|0,n=n+Math.imul(x,re)|0,i=(i=i+Math.imul(x,ne)|0)+Math.imul(k,re)|0,o=o+Math.imul(k,ne)|0,n=n+Math.imul(E,oe)|0,i=(i=i+Math.imul(E,ae)|0)+Math.imul(S,oe)|0,o=o+Math.imul(S,ae)|0,n=n+Math.imul(w,ce)|0,i=(i=i+Math.imul(w,ue)|0)+Math.imul(A,ce)|0,o=o+Math.imul(A,ue)|0,n=n+Math.imul(y,de)|0,i=(i=i+Math.imul(y,le)|0)+Math.imul(b,de)|0,o=o+Math.imul(b,le)|0;var xe=(u+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,me)|0)+Math.imul(m,pe)|0))<<13)|0;u=((o=o+Math.imul(m,me)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(B,W),i=(i=Math.imul(B,G))+Math.imul(F,W)|0,o=Math.imul(F,G),n=n+Math.imul(j,Z)|0,i=(i=i+Math.imul(j,X)|0)+Math.imul(D,Z)|0,o=o+Math.imul(D,X)|0,n=n+Math.imul(N,Y)|0,i=(i=i+Math.imul(N,ee)|0)+Math.imul(O,Y)|0,o=o+Math.imul(O,ee)|0,n=n+Math.imul(C,re)|0,i=(i=i+Math.imul(C,ne)|0)+Math.imul(I,re)|0,o=o+Math.imul(I,ne)|0,n=n+Math.imul(x,oe)|0,i=(i=i+Math.imul(x,ae)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,ae)|0,n=n+Math.imul(E,ce)|0,i=(i=i+Math.imul(E,ue)|0)+Math.imul(S,ce)|0,o=o+Math.imul(S,ue)|0,n=n+Math.imul(w,de)|0,i=(i=i+Math.imul(w,le)|0)+Math.imul(A,de)|0,o=o+Math.imul(A,le)|0;var ke=(u+(n=n+Math.imul(y,pe)|0)|0)+((8191&(i=(i=i+Math.imul(y,me)|0)+Math.imul(b,pe)|0))<<13)|0;u=((o=o+Math.imul(b,me)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(B,Z),i=(i=Math.imul(B,X))+Math.imul(F,Z)|0,o=Math.imul(F,X),n=n+Math.imul(j,Y)|0,i=(i=i+Math.imul(j,ee)|0)+Math.imul(D,Y)|0,o=o+Math.imul(D,ee)|0,n=n+Math.imul(N,re)|0,i=(i=i+Math.imul(N,ne)|0)+Math.imul(O,re)|0,o=o+Math.imul(O,ne)|0,n=n+Math.imul(C,oe)|0,i=(i=i+Math.imul(C,ae)|0)+Math.imul(I,oe)|0,o=o+Math.imul(I,ae)|0,n=n+Math.imul(x,ce)|0,i=(i=i+Math.imul(x,ue)|0)+Math.imul(k,ce)|0,o=o+Math.imul(k,ue)|0,n=n+Math.imul(E,de)|0,i=(i=i+Math.imul(E,le)|0)+Math.imul(S,de)|0,o=o+Math.imul(S,le)|0;var Me=(u+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,me)|0)+Math.imul(A,pe)|0))<<13)|0;u=((o=o+Math.imul(A,me)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(B,Y),i=(i=Math.imul(B,ee))+Math.imul(F,Y)|0,o=Math.imul(F,ee),n=n+Math.imul(j,re)|0,i=(i=i+Math.imul(j,ne)|0)+Math.imul(D,re)|0,o=o+Math.imul(D,ne)|0,n=n+Math.imul(N,oe)|0,i=(i=i+Math.imul(N,ae)|0)+Math.imul(O,oe)|0,o=o+Math.imul(O,ae)|0,n=n+Math.imul(C,ce)|0,i=(i=i+Math.imul(C,ue)|0)+Math.imul(I,ce)|0,o=o+Math.imul(I,ue)|0,n=n+Math.imul(x,de)|0,i=(i=i+Math.imul(x,le)|0)+Math.imul(k,de)|0,o=o+Math.imul(k,le)|0;var Ce=(u+(n=n+Math.imul(E,pe)|0)|0)+((8191&(i=(i=i+Math.imul(E,me)|0)+Math.imul(S,pe)|0))<<13)|0;u=((o=o+Math.imul(S,me)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(B,re),i=(i=Math.imul(B,ne))+Math.imul(F,re)|0,o=Math.imul(F,ne),n=n+Math.imul(j,oe)|0,i=(i=i+Math.imul(j,ae)|0)+Math.imul(D,oe)|0,o=o+Math.imul(D,ae)|0,n=n+Math.imul(N,ce)|0,i=(i=i+Math.imul(N,ue)|0)+Math.imul(O,ce)|0,o=o+Math.imul(O,ue)|0,n=n+Math.imul(C,de)|0,i=(i=i+Math.imul(C,le)|0)+Math.imul(I,de)|0,o=o+Math.imul(I,le)|0;var Ie=(u+(n=n+Math.imul(x,pe)|0)|0)+((8191&(i=(i=i+Math.imul(x,me)|0)+Math.imul(k,pe)|0))<<13)|0;u=((o=o+Math.imul(k,me)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(B,oe),i=(i=Math.imul(B,ae))+Math.imul(F,oe)|0,o=Math.imul(F,ae),n=n+Math.imul(j,ce)|0,i=(i=i+Math.imul(j,ue)|0)+Math.imul(D,ce)|0,o=o+Math.imul(D,ue)|0,n=n+Math.imul(N,de)|0,i=(i=i+Math.imul(N,le)|0)+Math.imul(O,de)|0,o=o+Math.imul(O,le)|0;var Re=(u+(n=n+Math.imul(C,pe)|0)|0)+((8191&(i=(i=i+Math.imul(C,me)|0)+Math.imul(I,pe)|0))<<13)|0;u=((o=o+Math.imul(I,me)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(B,ce),i=(i=Math.imul(B,ue))+Math.imul(F,ce)|0,o=Math.imul(F,ue),n=n+Math.imul(j,de)|0,i=(i=i+Math.imul(j,le)|0)+Math.imul(D,de)|0,o=o+Math.imul(D,le)|0;var Ne=(u+(n=n+Math.imul(N,pe)|0)|0)+((8191&(i=(i=i+Math.imul(N,me)|0)+Math.imul(O,pe)|0))<<13)|0;u=((o=o+Math.imul(O,me)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,n=Math.imul(B,de),i=(i=Math.imul(B,le))+Math.imul(F,de)|0,o=Math.imul(F,le);var Oe=(u+(n=n+Math.imul(j,pe)|0)|0)+((8191&(i=(i=i+Math.imul(j,me)|0)+Math.imul(D,pe)|0))<<13)|0;u=((o=o+Math.imul(D,me)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863;var Te=(u+(n=Math.imul(B,pe))|0)+((8191&(i=(i=Math.imul(B,me))+Math.imul(F,pe)|0))<<13)|0;return u=((o=Math.imul(F,me))+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,c[0]=ge,c[1]=ye,c[2]=be,c[3]=ve,c[4]=we,c[5]=Ae,c[6]=_e,c[7]=Ee,c[8]=Se,c[9]=Pe,c[10]=xe,c[11]=ke,c[12]=Me,c[13]=Ce,c[14]=Ie,c[15]=Re,c[16]=Ne,c[17]=Oe,c[18]=Te,0!==u&&(c[19]=u,r.length++),r};function y(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,a&=67108863}r.words[o]=s,n=a,a=i}return 0!==n?r.words[o]=n:r.length--,r._strip()}function b(e,t,r){return y(e,t,r)}Math.imul||(g=m),i.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?g(this,e,t):r<63?m(this,e,t):r<1024?y(this,e,t):b(this,e,t)},i.prototype.mul=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},i.prototype.mulf=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),b(this,e,t)},i.prototype.imul=function(e){return this.clone().mulTo(e,this)},i.prototype.imuln=function(e){var t=e<0;t&&(e=-e),r("number"==typeof e),r(e<67108864);for(var n=0,i=0;i>=26,n+=o/67108864|0,n+=a>>>26,this.words[i]=67108863&a}return 0!==n&&(this.words[i]=n,this.length++),t?this.ineg():this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>i&1}return t}(e);if(0===t.length)return new i(1);for(var r=this,n=0;n=0);var t,n=e%26,i=(e-n)/26,o=67108863>>>26-n<<26-n;if(0!==n){var a=0;for(t=0;t>>26-n}a&&(this.words[t]=a,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var o=e%26,a=Math.min((e-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,u=0;u=0&&(0!==f||u>=i);u--){var d=0|this.words[u];this.words[u]=f<<26-o|d>>>o,f=d&s}return c&&0!==f&&(c.words[c.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(e,t,n){return r(0===this.negative),this.iushrn(e,t,n)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){r("number"==typeof e&&e>=0);var t=e%26,n=(e-t)/26,i=1<=0);var t=e%26,n=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==t&&n++,this.length=Math.min(n,this.length),0!==t){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},i.prototype.isubn=function(e){if(r("number"==typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(c/67108864|0),this.words[i+n]=67108863&o}for(;i>26,this.words[i+n]=67108863&o;if(0===s)return this._strip();for(r(-1===s),s=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},i.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),o=e,a=0|o.words[o.length-1];0!==(r=26-this._countBits(a))&&(o=o.ushln(r),n.iushln(r),a=0|o.words[o.length-1]);var s,c=n.length-o.length;if("mod"!==t){(s=new i(null)).length=c+1,s.words=new Array(s.length);for(var u=0;u=0;d--){var l=67108864*(0|n.words[o.length+d])+(0|n.words[o.length+d-1]);for(l=Math.min(l/a|0,67108863),n._ishlnsubmul(o,l,d);0!==n.negative;)l--,n.negative=0,n._ishlnsubmul(o,1,d),n.isZero()||(n.negative^=1);s&&(s.words[d]=l)}return s&&s._strip(),n._strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},i.prototype.divmod=function(e,t,n){return r(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(o=s.div.neg()),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.iadd(e)),{div:o,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(o=s.div.neg()),{div:o,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modrn(e.words[0]))}:this._wordDiv(e,t);var o,a,s},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modrn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var n=(1<<26)%e,i=0,o=this.length-1;o>=0;o--)i=(n*i+(0|this.words[o]))%e;return t?-i:i},i.prototype.modn=function(e){return this.modrn(e)},i.prototype.idivn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var n=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*n;this.words[i]=o/e|0,n=o%e}return this._strip(),t?this.ineg():this},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o=new i(1),a=new i(0),s=new i(0),c=new i(1),u=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++u;for(var f=n.clone(),d=t.clone();!t.isZero();){for(var l=0,h=1;0==(t.words[0]&h)&&l<26;++l,h<<=1);if(l>0)for(t.iushrn(l);l-- >0;)(o.isOdd()||a.isOdd())&&(o.iadd(f),a.isub(d)),o.iushrn(1),a.iushrn(1);for(var p=0,m=1;0==(n.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(n.iushrn(p);p-- >0;)(s.isOdd()||c.isOdd())&&(s.iadd(f),c.isub(d)),s.iushrn(1),c.iushrn(1);t.cmp(n)>=0?(t.isub(n),o.isub(s),a.isub(c)):(n.isub(t),s.isub(o),c.isub(a))}return{a:s,b:c,gcd:n.iushln(u)}},i.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o,a=new i(1),s=new i(0),c=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(var u=0,f=1;0==(t.words[0]&f)&&u<26;++u,f<<=1);if(u>0)for(t.iushrn(u);u-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);for(var d=0,l=1;0==(n.words[0]&l)&&d<26;++d,l<<=1);if(d>0)for(n.iushrn(d);d-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);t.cmp(n)>=0?(t.isub(n),a.isub(s)):(n.isub(t),s.isub(a))}return(o=0===t.cmpn(1)?a:s).cmpn(0)<0&&o.iadd(e),o},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return 0==(1&this.words[0])},i.prototype.isOdd=function(){return 1==(1&this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){r("number"==typeof e);var t=e%26,n=(e-t)/26,i=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this._strip(),this.length>1)t=1;else{n&&(e=-e),r(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){ni&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new P(e)},i.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var v={k256:null,p224:null,p192:null,p25519:null};function w(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function A(){w.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function _(){w.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function E(){w.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function S(){w.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function P(e){if("string"==typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function x(e){P.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}w.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},w.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},w.prototype.split=function(e,t){e.iushrn(this.n,0,t)},w.prototype.imulK=function(e){return e.imul(this.k)},n(A,w),A.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i>>22,o=a}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},A.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(v[e])return v[e];var t;if("k256"===e)t=new A;else if("p224"===e)t=new _;else if("p192"===e)t=new E;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new S}return v[e]=t,t},P.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},P.prototype._verify2=function(e,t){r(0==(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},P.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(u(e,e.umod(this.m)._forceRed(this)),e)},P.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},P.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},P.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},P.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},P.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},P.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},P.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},P.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},P.prototype.isqr=function(e){return this.imul(e,e.clone())},P.prototype.sqr=function(e){return this.mul(e,e)},P.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2==1),3===t){var n=this.m.add(new i(1)).iushrn(2);return this.pow(e,n)}for(var o=this.m.subn(1),a=0;!o.isZero()&&0===o.andln(1);)a++,o.iushrn(1);r(!o.isZero());var s=new i(1).toRed(this),c=s.redNeg(),u=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new i(2*f*f).toRed(this);0!==this.pow(f,u).cmp(c);)f.redIAdd(c);for(var d=this.pow(f,o),l=this.pow(e,o.addn(1).iushrn(1)),h=this.pow(e,o),p=a;0!==h.cmp(s);){for(var m=h,g=0;0!==m.cmp(s);g++)m=m.redSqr();r(g=0;n--){for(var u=t.words[n],f=c-1;f>=0;f--){var d=u>>f&1;o!==r[0]&&(o=this.sqr(o)),0!==d||0!==a?(a<<=1,a|=d,(4===++s||0===n&&0===f)&&(o=this.mul(o,r[a]),s=0,a=0)):s=0}c=26}return o},P.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},P.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new x(e)},n(x,P),x.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},x.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},x.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},x.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(n).iushrn(this.shift),a=o;return o.cmp(this.m)>=0?a=o.isub(this.m):o.cmpn(0)<0&&(a=o.iadd(this.m)),a._forceRed(this)},x.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,s)}(ao);var so=c(ao.exports);let co=!1,uo=!1;const fo={debug:1,default:2,info:2,warning:3,error:4,off:5};let lo=fo.default,ho=null;const po=function(){try{const e=[];if(["NFD","NFC","NFKD","NFKC"].forEach((t=>{try{if("test"!=="test".normalize(t))throw new Error("bad normalize")}catch(r){e.push(t)}})),e.length)throw new Error("missing "+e.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(e){return e.message}return null}();var mo,go;!function(e){e.DEBUG="DEBUG",e.INFO="INFO",e.WARNING="WARNING",e.ERROR="ERROR",e.OFF="OFF"}(mo||(mo={})),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"}(go||(go={}));const yo="0123456789abcdef";class bo{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,t){const r=e.toLowerCase();null==fo[r]&&this.throwArgumentError("invalid log level name","logLevel",e),lo>fo[r]||console.log.apply(console,t)}debug(...e){this._log(bo.levels.DEBUG,e)}info(...e){this._log(bo.levels.INFO,e)}warn(...e){this._log(bo.levels.WARNING,e)}makeError(e,t,r){if(uo)return this.makeError("censored error",t,{});t||(t=bo.errors.UNKNOWN_ERROR),r||(r={});const n=[];Object.keys(r).forEach((e=>{const t=r[e];try{if(t instanceof Uint8Array){let r="";for(let e=0;e>4],r+=yo[15&t[e]];n.push(e+"=Uint8Array(0x"+r+")")}else n.push(e+"="+JSON.stringify(t))}catch(t){n.push(e+"="+JSON.stringify(r[e].toString()))}})),n.push(`code=${t}`),n.push(`version=${this.version}`);const i=e;let o="";switch(t){case go.NUMERIC_FAULT:{o="NUMERIC_FAULT";const t=e;switch(t){case"overflow":case"underflow":case"division-by-zero":o+="-"+t;break;case"negative-power":case"negative-width":o+="-unsupported";break;case"unbound-bitwise-result":o+="-unbound-result"}break}case go.CALL_EXCEPTION:case go.INSUFFICIENT_FUNDS:case go.MISSING_NEW:case go.NONCE_EXPIRED:case go.REPLACEMENT_UNDERPRICED:case go.TRANSACTION_REPLACED:case go.UNPREDICTABLE_GAS_LIMIT:o=t}o&&(e+=" [ See: https://links.ethers.org/v5-errors-"+o+" ]"),n.length&&(e+=" ("+n.join(", ")+")");const a=new Error(e);return a.reason=i,a.code=t,Object.keys(r).forEach((function(e){a[e]=r[e]})),a}throwError(e,t,r){throw this.makeError(e,t,r)}throwArgumentError(e,t,r){return this.throwError(e,bo.errors.INVALID_ARGUMENT,{argument:t,value:r})}assert(e,t,r,n){e||this.throwError(t,r,n)}assertArgument(e,t,r,n){e||this.throwArgumentError(t,r,n)}checkNormalize(e){po&&this.throwError("platform missing String.prototype.normalize",bo.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:po})}checkSafeUint53(e,t){"number"==typeof e&&(null==t&&(t="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(t,bo.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(t,bo.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,t,r){r=r?": "+r:"",et&&this.throwError("too many arguments"+r,bo.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:t})}checkNew(e,t){e!==Object&&null!=e||this.throwError("missing new",bo.errors.MISSING_NEW,{name:t.name})}checkAbstract(e,t){e===t?this.throwError("cannot instantiate abstract class "+JSON.stringify(t.name)+" directly; use a sub-class",bo.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):e!==Object&&null!=e||this.throwError("missing new",bo.errors.MISSING_NEW,{name:t.name})}static globalLogger(){return ho||(ho=new bo("logger/5.7.0")),ho}static setCensorship(e,t){if(!e&&t&&this.globalLogger().throwError("cannot permanently disable censorship",bo.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),co){if(!e)return;this.globalLogger().throwError("error censorship permanent",bo.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}uo=!!e,co=!!t}static setLogLevel(e){const t=fo[e.toLowerCase()];null!=t?lo=t:bo.globalLogger().warn("invalid log level - "+e)}static from(e){return new bo(e)}}bo.errors=go,bo.levels=mo;var vo=Object.freeze({__proto__:null,get ErrorCode(){return go},get LogLevel(){return mo},Logger:bo});const wo=new bo("bytes/5.7.0");function Ao(e){return!!e.toHexString}function _o(e){return e.slice||(e.slice=function(){const t=Array.prototype.slice.call(arguments);return _o(new Uint8Array(Array.prototype.slice.apply(e,t)))}),e}function Eo(e){return Io(e)&&!(e.length%2)||Po(e)}function So(e){return"number"==typeof e&&e==e&&e%1==0}function Po(e){if(null==e)return!1;if(e.constructor===Uint8Array)return!0;if("string"==typeof e)return!1;if(!So(e.length)||e.length<0)return!1;for(let t=0;t=256)return!1}return!0}function xo(e,t){if(t||(t={}),"number"==typeof e){wo.checkSafeUint53(e,"invalid arrayify value");const t=[];for(;e;)t.unshift(255&e),e=parseInt(String(e/256));return 0===t.length&&t.push(0),_o(new Uint8Array(t))}if(t.allowMissingPrefix&&"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),Ao(e)&&(e=e.toHexString()),Io(e)){let r=e.substring(2);r.length%2&&("left"===t.hexPad?r="0"+r:"right"===t.hexPad?r+="0":wo.throwArgumentError("hex data is odd-length","value",e));const n=[];for(let e=0;exo(e))),r=t.reduce(((e,t)=>e+t.length),0),n=new Uint8Array(r);return t.reduce(((e,t)=>(n.set(t,e),e+t.length)),0),_o(n)}function Mo(e){let t=xo(e);if(0===t.length)return t;let r=0;for(;rt&&wo.throwArgumentError("value out of range","value",arguments[0]);const r=new Uint8Array(t);return r.set(e,t-e.length),_o(r)}function Io(e,t){return!("string"!=typeof e||!e.match(/^0x[0-9A-Fa-f]*$/))&&(!t||e.length===2+2*t)}const Ro="0123456789abcdef";function No(e,t){if(t||(t={}),"number"==typeof e){wo.checkSafeUint53(e,"invalid hexlify value");let t="";for(;e;)t=Ro[15&e]+t,e=Math.floor(e/16);return t.length?(t.length%2&&(t="0"+t),"0x"+t):"0x00"}if("bigint"==typeof e)return(e=e.toString(16)).length%2?"0x0"+e:"0x"+e;if(t.allowMissingPrefix&&"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),Ao(e))return e.toHexString();if(Io(e))return e.length%2&&("left"===t.hexPad?e="0x0"+e.substring(2):"right"===t.hexPad?e+="0":wo.throwArgumentError("hex data is odd-length","value",e)),e.toLowerCase();if(Po(e)){let t="0x";for(let r=0;r>4]+Ro[15&n]}return t}return wo.throwArgumentError("invalid hexlify value","value",e)}function Oo(e){if("string"!=typeof e)e=No(e);else if(!Io(e)||e.length%2)return null;return(e.length-2)/2}function To(e,t,r){return"string"!=typeof e?e=No(e):(!Io(e)||e.length%2)&&wo.throwArgumentError("invalid hexData","value",e),t=2+2*t,null!=r?"0x"+e.substring(t,2+2*r):"0x"+e.substring(t)}function jo(e){let t="0x";return e.forEach((e=>{t+=No(e).substring(2)})),t}function Do(e){const t=$o(No(e,{hexPad:"left"}));return"0x"===t?"0x0":t}function $o(e){"string"!=typeof e&&(e=No(e)),Io(e)||wo.throwArgumentError("invalid hex string","value",e),e=e.substring(2);let t=0;for(;t2*t+2&&wo.throwArgumentError("value out of range","value",arguments[1]);e.length<2*t+2;)e="0x0"+e.substring(2);return e}function Fo(e){const t={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(Eo(e)){let r=xo(e);64===r.length?(t.v=27+(r[32]>>7),r[32]&=127,t.r=No(r.slice(0,32)),t.s=No(r.slice(32,64))):65===r.length?(t.r=No(r.slice(0,32)),t.s=No(r.slice(32,64)),t.v=r[64]):wo.throwArgumentError("invalid signature string","signature",e),t.v<27&&(0===t.v||1===t.v?t.v+=27:wo.throwArgumentError("signature invalid v byte","signature",e)),t.recoveryParam=1-t.v%2,t.recoveryParam&&(r[32]|=128),t._vs=No(r.slice(32,64))}else{if(t.r=e.r,t.s=e.s,t.v=e.v,t.recoveryParam=e.recoveryParam,t._vs=e._vs,null!=t._vs){const r=Co(xo(t._vs),32);t._vs=No(r);const n=r[0]>=128?1:0;null==t.recoveryParam?t.recoveryParam=n:t.recoveryParam!==n&&wo.throwArgumentError("signature recoveryParam mismatch _vs","signature",e),r[0]&=127;const i=No(r);null==t.s?t.s=i:t.s!==i&&wo.throwArgumentError("signature v mismatch _vs","signature",e)}if(null==t.recoveryParam)null==t.v?wo.throwArgumentError("signature missing v and recoveryParam","signature",e):0===t.v||1===t.v?t.recoveryParam=t.v:t.recoveryParam=1-t.v%2;else if(null==t.v)t.v=27+t.recoveryParam;else{const r=0===t.v||1===t.v?t.v:1-t.v%2;t.recoveryParam!==r&&wo.throwArgumentError("signature recoveryParam mismatch v","signature",e)}null!=t.r&&Io(t.r)?t.r=Bo(t.r,32):wo.throwArgumentError("signature missing or invalid r","signature",e),null!=t.s&&Io(t.s)?t.s=Bo(t.s,32):wo.throwArgumentError("signature missing or invalid s","signature",e);const r=xo(t.s);r[0]>=128&&wo.throwArgumentError("signature s out of range","signature",e),t.recoveryParam&&(r[0]|=128);const n=No(r);t._vs&&(Io(t._vs)||wo.throwArgumentError("signature invalid _vs","signature",e),t._vs=Bo(t._vs,32)),null==t._vs?t._vs=n:t._vs!==n&&wo.throwArgumentError("signature _vs mismatch v and s","signature",e)}return t.yParityAndS=t._vs,t.compact=t.r+t.yParityAndS.substring(2),t}function zo(e){return No(ko([(e=Fo(e)).r,e.s,e.recoveryParam?"0x1c":"0x1b"]))}var Uo=Object.freeze({__proto__:null,arrayify:xo,concat:ko,hexConcat:jo,hexDataLength:Oo,hexDataSlice:To,hexStripZeros:$o,hexValue:Do,hexZeroPad:Bo,hexlify:No,isBytes:Po,isBytesLike:Eo,isHexString:Io,joinSignature:zo,splitSignature:Fo,stripZeros:Mo,zeroPad:Co});const Lo="bignumber/5.7.0";var qo=so.BN;const Ho=new bo(Lo),Ko={},Jo=9007199254740991;let Wo=!1;class Go{constructor(e,t){e!==Ko&&Ho.throwError("cannot call constructor directly; use BigNumber.from",bo.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=t,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return Zo(Xo(this).fromTwos(e))}toTwos(e){return Zo(Xo(this).toTwos(e))}abs(){return"-"===this._hex[0]?Go.from(this._hex.substring(1)):this}add(e){return Zo(Xo(this).add(Xo(e)))}sub(e){return Zo(Xo(this).sub(Xo(e)))}div(e){return Go.from(e).isZero()&&Qo("division-by-zero","div"),Zo(Xo(this).div(Xo(e)))}mul(e){return Zo(Xo(this).mul(Xo(e)))}mod(e){const t=Xo(e);return t.isNeg()&&Qo("division-by-zero","mod"),Zo(Xo(this).umod(t))}pow(e){const t=Xo(e);return t.isNeg()&&Qo("negative-power","pow"),Zo(Xo(this).pow(t))}and(e){const t=Xo(e);return(this.isNegative()||t.isNeg())&&Qo("unbound-bitwise-result","and"),Zo(Xo(this).and(t))}or(e){const t=Xo(e);return(this.isNegative()||t.isNeg())&&Qo("unbound-bitwise-result","or"),Zo(Xo(this).or(t))}xor(e){const t=Xo(e);return(this.isNegative()||t.isNeg())&&Qo("unbound-bitwise-result","xor"),Zo(Xo(this).xor(t))}mask(e){return(this.isNegative()||e<0)&&Qo("negative-width","mask"),Zo(Xo(this).maskn(e))}shl(e){return(this.isNegative()||e<0)&&Qo("negative-width","shl"),Zo(Xo(this).shln(e))}shr(e){return(this.isNegative()||e<0)&&Qo("negative-width","shr"),Zo(Xo(this).shrn(e))}eq(e){return Xo(this).eq(Xo(e))}lt(e){return Xo(this).lt(Xo(e))}lte(e){return Xo(this).lte(Xo(e))}gt(e){return Xo(this).gt(Xo(e))}gte(e){return Xo(this).gte(Xo(e))}isNegative(){return"-"===this._hex[0]}isZero(){return Xo(this).isZero()}toNumber(){try{return Xo(this).toNumber()}catch(e){Qo("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch(e){}return Ho.throwError("this platform does not support BigInt",bo.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(10===arguments[0]?Wo||(Wo=!0,Ho.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?Ho.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",bo.errors.UNEXPECTED_ARGUMENT,{}):Ho.throwError("BigNumber.toString does not accept parameters",bo.errors.UNEXPECTED_ARGUMENT,{})),Xo(this).toString(10)}toHexString(){return this._hex}toJSON(e){return{type:"BigNumber",hex:this.toHexString()}}static from(e){if(e instanceof Go)return e;if("string"==typeof e)return e.match(/^-?0x[0-9a-f]+$/i)?new Go(Ko,Vo(e)):e.match(/^-?[0-9]+$/)?new Go(Ko,Vo(new qo(e))):Ho.throwArgumentError("invalid BigNumber string","value",e);if("number"==typeof e)return e%1&&Qo("underflow","BigNumber.from",e),(e>=Jo||e<=-Jo)&&Qo("overflow","BigNumber.from",e),Go.from(String(e));const t=e;if("bigint"==typeof t)return Go.from(t.toString());if(Po(t))return Go.from(No(t));if(t)if(t.toHexString){const e=t.toHexString();if("string"==typeof e)return Go.from(e)}else{let e=t._hex;if(null==e&&"BigNumber"===t.type&&(e=t.hex),"string"==typeof e&&(Io(e)||"-"===e[0]&&Io(e.substring(1))))return Go.from(e)}return Ho.throwArgumentError("invalid BigNumber value","value",e)}static isBigNumber(e){return!(!e||!e._isBigNumber)}}function Vo(e){if("string"!=typeof e)return Vo(e.toString(16));if("-"===e[0])return"-"===(e=e.substring(1))[0]&&Ho.throwArgumentError("invalid hex","value",e),"0x00"===(e=Vo(e))?e:"-"+e;if("0x"!==e.substring(0,2)&&(e="0x"+e),"0x"===e)return"0x00";for(e.length%2&&(e="0x0"+e.substring(2));e.length>4&&"0x00"===e.substring(0,4);)e="0x"+e.substring(4);return e}function Zo(e){return Go.from(Vo(e))}function Xo(e){const t=Go.from(e).toHexString();return"-"===t[0]?new qo("-"+t.substring(3),16):new qo(t.substring(2),16)}function Qo(e,t,r){const n={fault:e,operation:t};return null!=r&&(n.value=r),Ho.throwError(e,bo.errors.NUMERIC_FAULT,n)}const Yo=new bo(Lo),ea={},ta=Go.from(0),ra=Go.from(-1);function na(e,t,r,n){const i={fault:t,operation:r};return void 0!==n&&(i.value=n),Yo.throwError(e,bo.errors.NUMERIC_FAULT,i)}let ia="0";for(;ia.length<256;)ia+=ia;function oa(e){if("number"!=typeof e)try{e=Go.from(e).toNumber()}catch(e){}return"number"==typeof e&&e>=0&&e<=256&&!(e%1)?"1"+ia.substring(0,e):Yo.throwArgumentError("invalid decimal size","decimals",e)}function aa(e,t){null==t&&(t=0);const r=oa(t),n=(e=Go.from(e)).lt(ta);n&&(e=e.mul(ra));let i=e.mod(r).toString();for(;i.length2&&Yo.throwArgumentError("too many decimal points","value",e);let o=i[0],a=i[1];for(o||(o="0"),a||(a="0");"0"===a[a.length-1];)a=a.substring(0,a.length-1);for(a.length>r.length-1&&na("fractional component exceeds decimals","underflow","parseFixed"),""===a&&(a="0");a.lengthnull==e[t]?n:(typeof e[t]!==r&&Yo.throwArgumentError("invalid fixed format ("+t+" not "+r+")","format."+t,e[t]),e[t]);t=i("signed","boolean",t),r=i("width","number",r),n=i("decimals","number",n)}return r%8&&Yo.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",r),n>80&&Yo.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",n),new ca(ea,t,r,n)}}class ua{constructor(e,t,r,n){e!==ea&&Yo.throwError("cannot use FixedNumber constructor; use FixedNumber.from",bo.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=n,this._hex=t,this._value=r,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(e){this.format.name!==e.format.name&&Yo.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",e)}addUnsafe(e){this._checkFormat(e);const t=sa(this._value,this.format.decimals),r=sa(e._value,e.format.decimals);return ua.fromValue(t.add(r),this.format.decimals,this.format)}subUnsafe(e){this._checkFormat(e);const t=sa(this._value,this.format.decimals),r=sa(e._value,e.format.decimals);return ua.fromValue(t.sub(r),this.format.decimals,this.format)}mulUnsafe(e){this._checkFormat(e);const t=sa(this._value,this.format.decimals),r=sa(e._value,e.format.decimals);return ua.fromValue(t.mul(r).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(e){this._checkFormat(e);const t=sa(this._value,this.format.decimals),r=sa(e._value,e.format.decimals);return ua.fromValue(t.mul(this.format._multiplier).div(r),this.format.decimals,this.format)}floor(){const e=this.toString().split(".");1===e.length&&e.push("0");let t=ua.from(e[0],this.format);const r=!e[1].match(/^(0*)$/);return this.isNegative()&&r&&(t=t.subUnsafe(fa.toFormat(t.format))),t}ceiling(){const e=this.toString().split(".");1===e.length&&e.push("0");let t=ua.from(e[0],this.format);const r=!e[1].match(/^(0*)$/);return!this.isNegative()&&r&&(t=t.addUnsafe(fa.toFormat(t.format))),t}round(e){null==e&&(e=0);const t=this.toString().split(".");if(1===t.length&&t.push("0"),(e<0||e>80||e%1)&&Yo.throwArgumentError("invalid decimal count","decimals",e),t[1].length<=e)return this;const r=ua.from("1"+ia.substring(0,e),this.format),n=da.toFormat(this.format);return this.mulUnsafe(r).addUnsafe(n).floor().divUnsafe(r)}isZero(){return"0.0"===this._value||"0"===this._value}isNegative(){return"-"===this._value[0]}toString(){return this._value}toHexString(e){if(null==e)return this._hex;e%8&&Yo.throwArgumentError("invalid byte width","width",e);return Bo(Go.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString(),e/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return ua.fromString(this._value,e)}static fromValue(e,t,r){return null!=r||null==t||function(e){return null!=e&&(Go.isBigNumber(e)||"number"==typeof e&&e%1==0||"string"==typeof e&&!!e.match(/^-?[0-9]+$/)||Io(e)||"bigint"==typeof e||Po(e))}(t)||(r=t,t=null),null==t&&(t=0),null==r&&(r="fixed"),ua.fromString(aa(e,t),ca.from(r))}static fromString(e,t){null==t&&(t="fixed");const r=ca.from(t),n=sa(e,r.decimals);!r.signed&&n.lt(ta)&&na("unsigned value cannot be negative","overflow","value",e);let i=null;r.signed?i=n.toTwos(r.width).toHexString():(i=n.toHexString(),i=Bo(i,r.width/8));const o=aa(n,r.decimals);return new ua(ea,i,o,r)}static fromBytes(e,t){null==t&&(t="fixed");const r=ca.from(t);if(xo(e).length>r.width/8)throw new Error("overflow");let n=Go.from(e);r.signed&&(n=n.fromTwos(r.width));const i=n.toTwos((r.signed?0:1)+r.width).toHexString(),o=aa(n,r.decimals);return new ua(ea,i,o,r)}static from(e,t){if("string"==typeof e)return ua.fromString(e,t);if(Po(e))return ua.fromBytes(e,t);try{return ua.fromValue(e,0,t)}catch(e){if(e.code!==bo.errors.INVALID_ARGUMENT)throw e}return Yo.throwArgumentError("invalid FixedNumber value","value",e)}static isFixedNumber(e){return!(!e||!e._isFixedNumber)}}const fa=ua.from(1),da=ua.from("0.5");var la=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))};const ha=new bo("properties/5.7.0");function pa(e,t,r){Object.defineProperty(e,t,{enumerable:!0,value:r,writable:!1})}function ma(e,t){for(let r=0;r<32;r++){if(e[t])return e[t];if(!e.prototype||"object"!=typeof e.prototype)break;e=Object.getPrototypeOf(e.prototype).constructor}return null}function ga(e){return la(this,void 0,void 0,(function*(){const t=Object.keys(e).map((t=>{const r=e[t];return Promise.resolve(r).then((e=>({key:t,value:e})))}));return(yield Promise.all(t)).reduce(((e,t)=>(e[t.key]=t.value,e)),{})}))}function ya(e,t){e&&"object"==typeof e||ha.throwArgumentError("invalid object","object",e),Object.keys(e).forEach((r=>{t[r]||ha.throwArgumentError("invalid object key - "+r,"transaction:"+r,e)}))}function ba(e){const t={};for(const r in e)t[r]=e[r];return t}const va={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function wa(e){if(null==e||va[typeof e])return!0;if(Array.isArray(e)||"object"==typeof e){if(!Object.isFrozen(e))return!1;const t=Object.keys(e);for(let r=0;r_a(e))));if("object"==typeof e){const t={};for(const r in e){const n=e[r];void 0!==n&&pa(t,r,_a(n))}return t}return ha.throwArgumentError("Cannot deepCopy "+typeof e,"object",e)}function _a(e){return Aa(e)}class Ea{constructor(e){for(const t in e)this[t]=_a(e[t])}}var Sa=Object.freeze({__proto__:null,Description:Ea,checkProperties:ya,deepCopy:_a,defineReadOnly:pa,getStatic:ma,resolveProperties:ga,shallowCopy:ba});const Pa="abi/5.7.0",xa=new bo(Pa),ka={};let Ma={calldata:!0,memory:!0,storage:!0},Ca={calldata:!0,memory:!0};function Ia(e,t){if("bytes"===e||"string"===e){if(Ma[t])return!0}else if("address"===e){if("payable"===t)return!0}else if((e.indexOf("[")>=0||"tuple"===e)&&Ca[t])return!0;return(Ma[t]||"payable"===t)&&xa.throwArgumentError("invalid modifier","name",t),!1}function Ra(e,t){for(let r in t)pa(e,r,t[r])}const Na=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),Oa=new RegExp(/^(.*)\[([0-9]*)\]$/);class Ta{constructor(e,t){e!==ka&&xa.throwError("use fromString",bo.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),Ra(this,t);let r=this.type.match(Oa);Ra(this,r?{arrayLength:parseInt(r[2]||"-1"),arrayChildren:Ta.fromObject({type:r[1],components:this.components}),baseType:"array"}:{arrayLength:null,arrayChildren:null,baseType:null!=this.components?"tuple":this.type}),this._isParamType=!0,Object.freeze(this)}format(e){if(e||(e=Na.sighash),Na[e]||xa.throwArgumentError("invalid format type","format",e),e===Na.json){let t={type:"tuple"===this.baseType?"tuple":this.type,name:this.name||void 0};return"boolean"==typeof this.indexed&&(t.indexed=this.indexed),this.components&&(t.components=this.components.map((t=>JSON.parse(t.format(e))))),JSON.stringify(t)}let t="";return"array"===this.baseType?(t+=this.arrayChildren.format(e),t+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):"tuple"===this.baseType?(e!==Na.sighash&&(t+=this.type),t+="("+this.components.map((t=>t.format(e))).join(e===Na.full?", ":",")+")"):t+=this.type,e!==Na.sighash&&(!0===this.indexed&&(t+=" indexed"),e===Na.full&&this.name&&(t+=" "+this.name)),t}static from(e,t){return"string"==typeof e?Ta.fromString(e,t):Ta.fromObject(e)}static fromObject(e){return Ta.isParamType(e)?e:new Ta(ka,{name:e.name||null,type:Ka(e.type),indexed:null==e.indexed?null:!!e.indexed,components:e.components?e.components.map(Ta.fromObject):null})}static fromString(e,t){return r=function(e,t){let r=e;function n(t){xa.throwArgumentError(`unexpected character at position ${t}`,"param",e)}function i(e){let r={type:"",name:"",parent:e,state:{allowType:!0}};return t&&(r.indexed=!1),r}e=e.replace(/\s/g," ");let o={type:"",name:"",state:{allowType:!0}},a=o;for(let r=0;rTa.fromString(e,t)))}class Da{constructor(e,t){e!==ka&&xa.throwError("use a static from method",bo.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),Ra(this,t),this._isFragment=!0,Object.freeze(this)}static from(e){return Da.isFragment(e)?e:"string"==typeof e?Da.fromString(e):Da.fromObject(e)}static fromObject(e){if(Da.isFragment(e))return e;switch(e.type){case"function":return La.fromObject(e);case"event":return $a.fromObject(e);case"constructor":return Ua.fromObject(e);case"error":return Ha.fromObject(e);case"fallback":case"receive":return null}return xa.throwArgumentError("invalid fragment object","value",e)}static fromString(e){return"event"===(e=(e=(e=e.replace(/\s/g," ")).replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," ")).trim()).split(" ")[0]?$a.fromString(e.substring(5).trim()):"function"===e.split(" ")[0]?La.fromString(e.substring(8).trim()):"constructor"===e.split("(")[0].trim()?Ua.fromString(e.trim()):"error"===e.split(" ")[0]?Ha.fromString(e.substring(5).trim()):xa.throwArgumentError("unsupported fragment","value",e)}static isFragment(e){return!(!e||!e._isFragment)}}class $a extends Da{format(e){if(e||(e=Na.sighash),Na[e]||xa.throwArgumentError("invalid format type","format",e),e===Na.json)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==Na.sighash&&(t+="event "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===Na.full?", ":",")+") ",e!==Na.sighash&&this.anonymous&&(t+="anonymous "),t.trim()}static from(e){return"string"==typeof e?$a.fromString(e):$a.fromObject(e)}static fromObject(e){if($a.isEventFragment(e))return e;"event"!==e.type&&xa.throwArgumentError("invalid event object","value",e);const t={name:Wa(e.name),anonymous:e.anonymous,inputs:e.inputs?e.inputs.map(Ta.fromObject):[],type:"event"};return new $a(ka,t)}static fromString(e){let t=e.match(Ga);t||xa.throwArgumentError("invalid event string","value",e);let r=!1;return t[3].split(" ").forEach((e=>{switch(e.trim()){case"anonymous":r=!0;break;case"":break;default:xa.warn("unknown modifier: "+e)}})),$a.fromObject({name:t[1].trim(),anonymous:r,inputs:ja(t[2],!0),type:"event"})}static isEventFragment(e){return e&&e._isFragment&&"event"===e.type}}function Ba(e,t){t.gas=null;let r=e.split("@");return 1!==r.length?(r.length>2&&xa.throwArgumentError("invalid human-readable ABI signature","value",e),r[1].match(/^[0-9]+$/)||xa.throwArgumentError("invalid human-readable ABI signature gas","value",e),t.gas=Go.from(r[1]),r[0]):e}function Fa(e,t){t.constant=!1,t.payable=!1,t.stateMutability="nonpayable",e.split(" ").forEach((e=>{switch(e.trim()){case"constant":t.constant=!0;break;case"payable":t.payable=!0,t.stateMutability="payable";break;case"nonpayable":t.payable=!1,t.stateMutability="nonpayable";break;case"pure":t.constant=!0,t.stateMutability="pure";break;case"view":t.constant=!0,t.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+e)}}))}function za(e){let t={constant:!1,payable:!0,stateMutability:"payable"};return null!=e.stateMutability?(t.stateMutability=e.stateMutability,t.constant="view"===t.stateMutability||"pure"===t.stateMutability,null!=e.constant&&!!e.constant!==t.constant&&xa.throwArgumentError("cannot have constant function with mutability "+t.stateMutability,"value",e),t.payable="payable"===t.stateMutability,null!=e.payable&&!!e.payable!==t.payable&&xa.throwArgumentError("cannot have payable function with mutability "+t.stateMutability,"value",e)):null!=e.payable?(t.payable=!!e.payable,null!=e.constant||t.payable||"constructor"===e.type||xa.throwArgumentError("unable to determine stateMutability","value",e),t.constant=!!e.constant,t.constant?t.stateMutability="view":t.stateMutability=t.payable?"payable":"nonpayable",t.payable&&t.constant&&xa.throwArgumentError("cannot have constant payable function","value",e)):null!=e.constant?(t.constant=!!e.constant,t.payable=!t.constant,t.stateMutability=t.constant?"view":"payable"):"constructor"!==e.type&&xa.throwArgumentError("unable to determine stateMutability","value",e),t}class Ua extends Da{format(e){if(e||(e=Na.sighash),Na[e]||xa.throwArgumentError("invalid format type","format",e),e===Na.json)return JSON.stringify({type:"constructor",stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});e===Na.sighash&&xa.throwError("cannot format a constructor for sighash",bo.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});let t="constructor("+this.inputs.map((t=>t.format(e))).join(e===Na.full?", ":",")+") ";return this.stateMutability&&"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "),t.trim()}static from(e){return"string"==typeof e?Ua.fromString(e):Ua.fromObject(e)}static fromObject(e){if(Ua.isConstructorFragment(e))return e;"constructor"!==e.type&&xa.throwArgumentError("invalid constructor object","value",e);let t=za(e);t.constant&&xa.throwArgumentError("constructor cannot be constant","value",e);const r={name:null,type:e.type,inputs:e.inputs?e.inputs.map(Ta.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?Go.from(e.gas):null};return new Ua(ka,r)}static fromString(e){let t={type:"constructor"},r=(e=Ba(e,t)).match(Ga);return r&&"constructor"===r[1].trim()||xa.throwArgumentError("invalid constructor string","value",e),t.inputs=ja(r[2].trim(),!1),Fa(r[3].trim(),t),Ua.fromObject(t)}static isConstructorFragment(e){return e&&e._isFragment&&"constructor"===e.type}}class La extends Ua{format(e){if(e||(e=Na.sighash),Na[e]||xa.throwArgumentError("invalid format type","format",e),e===Na.json)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((t=>JSON.parse(t.format(e)))),outputs:this.outputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==Na.sighash&&(t+="function "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===Na.full?", ":",")+") ",e!==Na.sighash&&(this.stateMutability?"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "):this.constant&&(t+="view "),this.outputs&&this.outputs.length&&(t+="returns ("+this.outputs.map((t=>t.format(e))).join(", ")+") "),null!=this.gas&&(t+="@"+this.gas.toString()+" ")),t.trim()}static from(e){return"string"==typeof e?La.fromString(e):La.fromObject(e)}static fromObject(e){if(La.isFunctionFragment(e))return e;"function"!==e.type&&xa.throwArgumentError("invalid function object","value",e);let t=za(e);const r={type:e.type,name:Wa(e.name),constant:t.constant,inputs:e.inputs?e.inputs.map(Ta.fromObject):[],outputs:e.outputs?e.outputs.map(Ta.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?Go.from(e.gas):null};return new La(ka,r)}static fromString(e){let t={type:"function"},r=(e=Ba(e,t)).split(" returns ");r.length>2&&xa.throwArgumentError("invalid function string","value",e);let n=r[0].match(Ga);if(n||xa.throwArgumentError("invalid function signature","value",e),t.name=n[1].trim(),t.name&&Wa(t.name),t.inputs=ja(n[2],!1),Fa(n[3].trim(),t),r.length>1){let n=r[1].match(Ga);""==n[1].trim()&&""==n[3].trim()||xa.throwArgumentError("unexpected tokens","value",e),t.outputs=ja(n[2],!1)}else t.outputs=[];return La.fromObject(t)}static isFunctionFragment(e){return e&&e._isFragment&&"function"===e.type}}function qa(e){const t=e.format();return"Error(string)"!==t&&"Panic(uint256)"!==t||xa.throwArgumentError(`cannot specify user defined ${t} error`,"fragment",e),e}class Ha extends Da{format(e){if(e||(e=Na.sighash),Na[e]||xa.throwArgumentError("invalid format type","format",e),e===Na.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==Na.sighash&&(t+="error "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===Na.full?", ":",")+") ",t.trim()}static from(e){return"string"==typeof e?Ha.fromString(e):Ha.fromObject(e)}static fromObject(e){if(Ha.isErrorFragment(e))return e;"error"!==e.type&&xa.throwArgumentError("invalid error object","value",e);const t={type:e.type,name:Wa(e.name),inputs:e.inputs?e.inputs.map(Ta.fromObject):[]};return qa(new Ha(ka,t))}static fromString(e){let t={type:"error"},r=e.match(Ga);return r||xa.throwArgumentError("invalid error signature","value",e),t.name=r[1].trim(),t.name&&Wa(t.name),t.inputs=ja(r[2],!1),qa(Ha.fromObject(t))}static isErrorFragment(e){return e&&e._isFragment&&"error"===e.type}}function Ka(e){return e.match(/^uint($|[^1-9])/)?e="uint256"+e.substring(4):e.match(/^int($|[^1-9])/)&&(e="int256"+e.substring(3)),e}const Ja=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function Wa(e){return e&&e.match(Ja)||xa.throwArgumentError(`invalid identifier "${e}"`,"value",e),e}const Ga=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$");const Va=new bo(Pa);function Za(e){const t=[],r=function(e,n){if(Array.isArray(n))for(let i in n){const o=e.slice();o.push(i);try{r(o,n[i])}catch(e){t.push({path:o,error:e})}}};return r([],e),t}class Xa{constructor(e,t,r,n){this.name=e,this.type=t,this.localName=r,this.dynamic=n}_throwError(e,t){Va.throwArgumentError(e,this.localName,t)}}class Qa{constructor(e){pa(this,"wordSize",e||32),this._data=[],this._dataLength=0,this._padding=new Uint8Array(e)}get data(){return jo(this._data)}get length(){return this._dataLength}_writeData(e){return this._data.push(e),this._dataLength+=e.length,e.length}appendWriter(e){return this._writeData(ko(e._data))}writeBytes(e){let t=xo(e);const r=t.length%this.wordSize;return r&&(t=ko([t,this._padding.slice(r)])),this._writeData(t)}_getValue(e){let t=xo(Go.from(e));return t.length>this.wordSize&&Va.throwError("value out-of-bounds",bo.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:t.length}),t.length%this.wordSize&&(t=ko([this._padding.slice(t.length%this.wordSize),t])),t}writeValue(e){return this._writeData(this._getValue(e))}writeUpdatableValue(){const e=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,t=>{this._data[e]=this._getValue(t)}}}class Ya{constructor(e,t,r,n){pa(this,"_data",xo(e)),pa(this,"wordSize",t||32),pa(this,"_coerceFunc",r),pa(this,"allowLoose",n),this._offset=0}get data(){return No(this._data)}get consumed(){return this._offset}static coerce(e,t){let r=e.match("^u?int([0-9]+)$");return r&&parseInt(r[1])<=48&&(t=t.toNumber()),t}coerce(e,t){return this._coerceFunc?this._coerceFunc(e,t):Ya.coerce(e,t)}_peekBytes(e,t,r){let n=Math.ceil(t/this.wordSize)*this.wordSize;return this._offset+n>this._data.length&&(this.allowLoose&&r&&this._offset+t<=this._data.length?n=t:Va.throwError("data out-of-bounds",bo.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+n})),this._data.slice(this._offset,this._offset+n)}subReader(e){return new Ya(this._data.slice(this._offset+e),this.wordSize,this._coerceFunc,this.allowLoose)}readBytes(e,t){let r=this._peekBytes(0,e,!!t);return this._offset+=r.length,r.slice(0,e)}readValue(){return Go.from(this.readBytes(this.wordSize))}}var es={exports:{}}; +var nonRepudiationLibrary=function(e){"use strict";const t=e=>{const t=[];for(let r=0;rnew Uint8Array(atob(e).split("").map((e=>e.charCodeAt(0))));function n(e,r=!1,n=!0){let i="";{const r="string"==typeof e?(new TextEncoder).encode(e):new Uint8Array(e);i=t(r)}return r&&(i=function(e){return e.replace(/\+/g,"-").replace(/\//g,"_")}(i)),n||(i=i.replace(/=/g,"")),i}function i(e,t=!1){{let n=!1;if(/^[0-9a-zA-Z_-]+={0,2}$/.test(e))n=!0;else if(!/^[0-9a-zA-Z+/]*={0,2}$/.test(e))throw new Error("Not a valid base64 input");n&&(e=e.replace(/-/g,"+").replace(/_/g,"/").replace(/=/g,""));const i=r(e);return t?(new TextDecoder).decode(i):i}}function o(e,t=!1,r){const n=e.match(/^(0x)?([\da-fA-F]+)$/);if(null==n)throw new RangeError("input must be a hexadecimal string, e.g. '0x124fe3a' or '0214f1b2'");let i=n[2];if(void 0!==r){if(r{n+=i[e>>4]+i[15&e]})),o(n,t,r)}}function s(e,t=!1){let r=o(e);return r=o(e,!1,Math.ceil(r.length/2)),Uint8Array.from(r.match(/[\da-fA-F]{2}/g).map((e=>parseInt(e,16)))).buffer}function c(e,t=!1){if(e<1)throw new RangeError("byteLength MUST be > 0");return new Promise((function(r,n){{const n=new Uint8Array(e);if(e<=65536)self.crypto.getRandomValues(n);else for(let t=0;t=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function s(e,t,r){var n=a(e,r);return r-1>=t&&(n|=a(e,r-1)<<4),n}function c(e,t,r,n){for(var i=0,o=Math.min(e.length,r),a=t;a=49?s-49+10:s>=17?s-17+10:s}return i}i.isBN=function(e){return e instanceof i||null!==e&&"object"==typeof e&&e.constructor.wordSize===i.wordSize&&Array.isArray(e.words)},i.max=function(e,t){return e.cmp(t)>0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,n){if("number"==typeof e)return this._initNumber(e,t,n);if("object"==typeof e)return this._initArray(e,t,n);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)a=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===n)for(i=0,o=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this.strip()},i.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n=t;n-=2)i=s(e,t,n)<=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(n=(e.length-t)%2==0?t+1:t;n=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this.strip()},i.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,a=o%n,s=Math.min(o,o-a)+r,u=0,f=r;f1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?""};var u=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],f=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function l(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],a=i*o,s=67108863&a,c=a/67108864|0;r.words[0]=s;for(var u=1;u>>26,d=67108863&c,l=Math.min(u,t.length-1),h=Math.max(0,u-e.length+1);h<=l;h++){var p=u-h|0;f+=(a=(i=0|e.words[p])*(o=0|t.words[h])+d)/67108864|0,d=67108863&a}r.words[u]=0|d,c=0|f}return 0!==c?r.words[u]=0|c:r.length--,r.strip()}i.prototype.toString=function(e,t){var n;if(t=0|t||1,16===(e=e||10)||"hex"===e){n="";for(var i=0,o=0,a=0;a>>24-i&16777215)||a!==this.length-1?u[6-c.length]+c+n:c+n,(i+=2)>=26&&(i-=26,a--)}for(0!==o&&(n=o.toString(16)+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(e===(0|e)&&e>=2&&e<=36){var l=f[e],h=d[e];n="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(h).toString(e);n=(p=p.idivn(h)).isZero()?m+n:u[l-m.length]+m+n}for(this.isZero()&&(n="0"+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},i.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&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(e,t){return r(void 0!==o),this.toArrayLike(o,e,t)},i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},i.prototype.toArrayLike=function(e,t,n){var i=this.byteLength(),o=n||Math.max(1,i);r(i<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0"),this.strip();var a,s,c="le"===t,u=new e(o),f=this.clone();if(c){for(s=0;!f.isZero();s++)a=f.andln(255),f.iushrn(8),u[s]=a;for(;s=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){r("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),n>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-n),this.strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){r("number"==typeof e&&e>=0);var n=e/26|0,i=e%26;return this._expand(n+1),this.words[n]=t?this.words[n]|1<e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},i.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,a=0;a>26,this.words[a]=67108863&t;for(;0!==o&&a>26,this.words[a]=67108863&t;if(0===o&&a>>13,h=0|a[1],p=8191&h,m=h>>>13,g=0|a[2],y=8191&g,b=g>>>13,v=0|a[3],w=8191&v,A=v>>>13,_=0|a[4],E=8191&_,S=_>>>13,P=0|a[5],x=8191&P,k=P>>>13,M=0|a[6],C=8191&M,I=M>>>13,R=0|a[7],N=8191&R,O=R>>>13,T=0|a[8],j=8191&T,D=T>>>13,$=0|a[9],B=8191&$,F=$>>>13,z=0|s[0],U=8191&z,L=z>>>13,q=0|s[1],H=8191&q,K=q>>>13,J=0|s[2],W=8191&J,G=J>>>13,V=0|s[3],Z=8191&V,X=V>>>13,Q=0|s[4],Y=8191&Q,ee=Q>>>13,te=0|s[5],re=8191&te,ne=te>>>13,ie=0|s[6],oe=8191&ie,ae=ie>>>13,se=0|s[7],ce=8191&se,ue=se>>>13,fe=0|s[8],de=8191&fe,le=fe>>>13,he=0|s[9],pe=8191&he,me=he>>>13;r.negative=e.negative^t.negative,r.length=19;var ge=(u+(n=Math.imul(d,U))|0)+((8191&(i=(i=Math.imul(d,L))+Math.imul(l,U)|0))<<13)|0;u=((o=Math.imul(l,L))+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(p,U),i=(i=Math.imul(p,L))+Math.imul(m,U)|0,o=Math.imul(m,L);var ye=(u+(n=n+Math.imul(d,H)|0)|0)+((8191&(i=(i=i+Math.imul(d,K)|0)+Math.imul(l,H)|0))<<13)|0;u=((o=o+Math.imul(l,K)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(y,U),i=(i=Math.imul(y,L))+Math.imul(b,U)|0,o=Math.imul(b,L),n=n+Math.imul(p,H)|0,i=(i=i+Math.imul(p,K)|0)+Math.imul(m,H)|0,o=o+Math.imul(m,K)|0;var be=(u+(n=n+Math.imul(d,W)|0)|0)+((8191&(i=(i=i+Math.imul(d,G)|0)+Math.imul(l,W)|0))<<13)|0;u=((o=o+Math.imul(l,G)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(w,U),i=(i=Math.imul(w,L))+Math.imul(A,U)|0,o=Math.imul(A,L),n=n+Math.imul(y,H)|0,i=(i=i+Math.imul(y,K)|0)+Math.imul(b,H)|0,o=o+Math.imul(b,K)|0,n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(m,W)|0,o=o+Math.imul(m,G)|0;var ve=(u+(n=n+Math.imul(d,Z)|0)|0)+((8191&(i=(i=i+Math.imul(d,X)|0)+Math.imul(l,Z)|0))<<13)|0;u=((o=o+Math.imul(l,X)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(E,U),i=(i=Math.imul(E,L))+Math.imul(S,U)|0,o=Math.imul(S,L),n=n+Math.imul(w,H)|0,i=(i=i+Math.imul(w,K)|0)+Math.imul(A,H)|0,o=o+Math.imul(A,K)|0,n=n+Math.imul(y,W)|0,i=(i=i+Math.imul(y,G)|0)+Math.imul(b,W)|0,o=o+Math.imul(b,G)|0,n=n+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,X)|0;var we=(u+(n=n+Math.imul(d,Y)|0)|0)+((8191&(i=(i=i+Math.imul(d,ee)|0)+Math.imul(l,Y)|0))<<13)|0;u=((o=o+Math.imul(l,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(x,U),i=(i=Math.imul(x,L))+Math.imul(k,U)|0,o=Math.imul(k,L),n=n+Math.imul(E,H)|0,i=(i=i+Math.imul(E,K)|0)+Math.imul(S,H)|0,o=o+Math.imul(S,K)|0,n=n+Math.imul(w,W)|0,i=(i=i+Math.imul(w,G)|0)+Math.imul(A,W)|0,o=o+Math.imul(A,G)|0,n=n+Math.imul(y,Z)|0,i=(i=i+Math.imul(y,X)|0)+Math.imul(b,Z)|0,o=o+Math.imul(b,X)|0,n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(m,Y)|0,o=o+Math.imul(m,ee)|0;var Ae=(u+(n=n+Math.imul(d,re)|0)|0)+((8191&(i=(i=i+Math.imul(d,ne)|0)+Math.imul(l,re)|0))<<13)|0;u=((o=o+Math.imul(l,ne)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(C,U),i=(i=Math.imul(C,L))+Math.imul(I,U)|0,o=Math.imul(I,L),n=n+Math.imul(x,H)|0,i=(i=i+Math.imul(x,K)|0)+Math.imul(k,H)|0,o=o+Math.imul(k,K)|0,n=n+Math.imul(E,W)|0,i=(i=i+Math.imul(E,G)|0)+Math.imul(S,W)|0,o=o+Math.imul(S,G)|0,n=n+Math.imul(w,Z)|0,i=(i=i+Math.imul(w,X)|0)+Math.imul(A,Z)|0,o=o+Math.imul(A,X)|0,n=n+Math.imul(y,Y)|0,i=(i=i+Math.imul(y,ee)|0)+Math.imul(b,Y)|0,o=o+Math.imul(b,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(m,re)|0,o=o+Math.imul(m,ne)|0;var _e=(u+(n=n+Math.imul(d,oe)|0)|0)+((8191&(i=(i=i+Math.imul(d,ae)|0)+Math.imul(l,oe)|0))<<13)|0;u=((o=o+Math.imul(l,ae)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(N,U),i=(i=Math.imul(N,L))+Math.imul(O,U)|0,o=Math.imul(O,L),n=n+Math.imul(C,H)|0,i=(i=i+Math.imul(C,K)|0)+Math.imul(I,H)|0,o=o+Math.imul(I,K)|0,n=n+Math.imul(x,W)|0,i=(i=i+Math.imul(x,G)|0)+Math.imul(k,W)|0,o=o+Math.imul(k,G)|0,n=n+Math.imul(E,Z)|0,i=(i=i+Math.imul(E,X)|0)+Math.imul(S,Z)|0,o=o+Math.imul(S,X)|0,n=n+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(A,Y)|0,o=o+Math.imul(A,ee)|0,n=n+Math.imul(y,re)|0,i=(i=i+Math.imul(y,ne)|0)+Math.imul(b,re)|0,o=o+Math.imul(b,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,ae)|0)+Math.imul(m,oe)|0,o=o+Math.imul(m,ae)|0;var Ee=(u+(n=n+Math.imul(d,ce)|0)|0)+((8191&(i=(i=i+Math.imul(d,ue)|0)+Math.imul(l,ce)|0))<<13)|0;u=((o=o+Math.imul(l,ue)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(j,U),i=(i=Math.imul(j,L))+Math.imul(D,U)|0,o=Math.imul(D,L),n=n+Math.imul(N,H)|0,i=(i=i+Math.imul(N,K)|0)+Math.imul(O,H)|0,o=o+Math.imul(O,K)|0,n=n+Math.imul(C,W)|0,i=(i=i+Math.imul(C,G)|0)+Math.imul(I,W)|0,o=o+Math.imul(I,G)|0,n=n+Math.imul(x,Z)|0,i=(i=i+Math.imul(x,X)|0)+Math.imul(k,Z)|0,o=o+Math.imul(k,X)|0,n=n+Math.imul(E,Y)|0,i=(i=i+Math.imul(E,ee)|0)+Math.imul(S,Y)|0,o=o+Math.imul(S,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(A,re)|0,o=o+Math.imul(A,ne)|0,n=n+Math.imul(y,oe)|0,i=(i=i+Math.imul(y,ae)|0)+Math.imul(b,oe)|0,o=o+Math.imul(b,ae)|0,n=n+Math.imul(p,ce)|0,i=(i=i+Math.imul(p,ue)|0)+Math.imul(m,ce)|0,o=o+Math.imul(m,ue)|0;var Se=(u+(n=n+Math.imul(d,de)|0)|0)+((8191&(i=(i=i+Math.imul(d,le)|0)+Math.imul(l,de)|0))<<13)|0;u=((o=o+Math.imul(l,le)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(B,U),i=(i=Math.imul(B,L))+Math.imul(F,U)|0,o=Math.imul(F,L),n=n+Math.imul(j,H)|0,i=(i=i+Math.imul(j,K)|0)+Math.imul(D,H)|0,o=o+Math.imul(D,K)|0,n=n+Math.imul(N,W)|0,i=(i=i+Math.imul(N,G)|0)+Math.imul(O,W)|0,o=o+Math.imul(O,G)|0,n=n+Math.imul(C,Z)|0,i=(i=i+Math.imul(C,X)|0)+Math.imul(I,Z)|0,o=o+Math.imul(I,X)|0,n=n+Math.imul(x,Y)|0,i=(i=i+Math.imul(x,ee)|0)+Math.imul(k,Y)|0,o=o+Math.imul(k,ee)|0,n=n+Math.imul(E,re)|0,i=(i=i+Math.imul(E,ne)|0)+Math.imul(S,re)|0,o=o+Math.imul(S,ne)|0,n=n+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,ae)|0)+Math.imul(A,oe)|0,o=o+Math.imul(A,ae)|0,n=n+Math.imul(y,ce)|0,i=(i=i+Math.imul(y,ue)|0)+Math.imul(b,ce)|0,o=o+Math.imul(b,ue)|0,n=n+Math.imul(p,de)|0,i=(i=i+Math.imul(p,le)|0)+Math.imul(m,de)|0,o=o+Math.imul(m,le)|0;var Pe=(u+(n=n+Math.imul(d,pe)|0)|0)+((8191&(i=(i=i+Math.imul(d,me)|0)+Math.imul(l,pe)|0))<<13)|0;u=((o=o+Math.imul(l,me)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(B,H),i=(i=Math.imul(B,K))+Math.imul(F,H)|0,o=Math.imul(F,K),n=n+Math.imul(j,W)|0,i=(i=i+Math.imul(j,G)|0)+Math.imul(D,W)|0,o=o+Math.imul(D,G)|0,n=n+Math.imul(N,Z)|0,i=(i=i+Math.imul(N,X)|0)+Math.imul(O,Z)|0,o=o+Math.imul(O,X)|0,n=n+Math.imul(C,Y)|0,i=(i=i+Math.imul(C,ee)|0)+Math.imul(I,Y)|0,o=o+Math.imul(I,ee)|0,n=n+Math.imul(x,re)|0,i=(i=i+Math.imul(x,ne)|0)+Math.imul(k,re)|0,o=o+Math.imul(k,ne)|0,n=n+Math.imul(E,oe)|0,i=(i=i+Math.imul(E,ae)|0)+Math.imul(S,oe)|0,o=o+Math.imul(S,ae)|0,n=n+Math.imul(w,ce)|0,i=(i=i+Math.imul(w,ue)|0)+Math.imul(A,ce)|0,o=o+Math.imul(A,ue)|0,n=n+Math.imul(y,de)|0,i=(i=i+Math.imul(y,le)|0)+Math.imul(b,de)|0,o=o+Math.imul(b,le)|0;var xe=(u+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,me)|0)+Math.imul(m,pe)|0))<<13)|0;u=((o=o+Math.imul(m,me)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(B,W),i=(i=Math.imul(B,G))+Math.imul(F,W)|0,o=Math.imul(F,G),n=n+Math.imul(j,Z)|0,i=(i=i+Math.imul(j,X)|0)+Math.imul(D,Z)|0,o=o+Math.imul(D,X)|0,n=n+Math.imul(N,Y)|0,i=(i=i+Math.imul(N,ee)|0)+Math.imul(O,Y)|0,o=o+Math.imul(O,ee)|0,n=n+Math.imul(C,re)|0,i=(i=i+Math.imul(C,ne)|0)+Math.imul(I,re)|0,o=o+Math.imul(I,ne)|0,n=n+Math.imul(x,oe)|0,i=(i=i+Math.imul(x,ae)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,ae)|0,n=n+Math.imul(E,ce)|0,i=(i=i+Math.imul(E,ue)|0)+Math.imul(S,ce)|0,o=o+Math.imul(S,ue)|0,n=n+Math.imul(w,de)|0,i=(i=i+Math.imul(w,le)|0)+Math.imul(A,de)|0,o=o+Math.imul(A,le)|0;var ke=(u+(n=n+Math.imul(y,pe)|0)|0)+((8191&(i=(i=i+Math.imul(y,me)|0)+Math.imul(b,pe)|0))<<13)|0;u=((o=o+Math.imul(b,me)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(B,Z),i=(i=Math.imul(B,X))+Math.imul(F,Z)|0,o=Math.imul(F,X),n=n+Math.imul(j,Y)|0,i=(i=i+Math.imul(j,ee)|0)+Math.imul(D,Y)|0,o=o+Math.imul(D,ee)|0,n=n+Math.imul(N,re)|0,i=(i=i+Math.imul(N,ne)|0)+Math.imul(O,re)|0,o=o+Math.imul(O,ne)|0,n=n+Math.imul(C,oe)|0,i=(i=i+Math.imul(C,ae)|0)+Math.imul(I,oe)|0,o=o+Math.imul(I,ae)|0,n=n+Math.imul(x,ce)|0,i=(i=i+Math.imul(x,ue)|0)+Math.imul(k,ce)|0,o=o+Math.imul(k,ue)|0,n=n+Math.imul(E,de)|0,i=(i=i+Math.imul(E,le)|0)+Math.imul(S,de)|0,o=o+Math.imul(S,le)|0;var Me=(u+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,me)|0)+Math.imul(A,pe)|0))<<13)|0;u=((o=o+Math.imul(A,me)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(B,Y),i=(i=Math.imul(B,ee))+Math.imul(F,Y)|0,o=Math.imul(F,ee),n=n+Math.imul(j,re)|0,i=(i=i+Math.imul(j,ne)|0)+Math.imul(D,re)|0,o=o+Math.imul(D,ne)|0,n=n+Math.imul(N,oe)|0,i=(i=i+Math.imul(N,ae)|0)+Math.imul(O,oe)|0,o=o+Math.imul(O,ae)|0,n=n+Math.imul(C,ce)|0,i=(i=i+Math.imul(C,ue)|0)+Math.imul(I,ce)|0,o=o+Math.imul(I,ue)|0,n=n+Math.imul(x,de)|0,i=(i=i+Math.imul(x,le)|0)+Math.imul(k,de)|0,o=o+Math.imul(k,le)|0;var Ce=(u+(n=n+Math.imul(E,pe)|0)|0)+((8191&(i=(i=i+Math.imul(E,me)|0)+Math.imul(S,pe)|0))<<13)|0;u=((o=o+Math.imul(S,me)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(B,re),i=(i=Math.imul(B,ne))+Math.imul(F,re)|0,o=Math.imul(F,ne),n=n+Math.imul(j,oe)|0,i=(i=i+Math.imul(j,ae)|0)+Math.imul(D,oe)|0,o=o+Math.imul(D,ae)|0,n=n+Math.imul(N,ce)|0,i=(i=i+Math.imul(N,ue)|0)+Math.imul(O,ce)|0,o=o+Math.imul(O,ue)|0,n=n+Math.imul(C,de)|0,i=(i=i+Math.imul(C,le)|0)+Math.imul(I,de)|0,o=o+Math.imul(I,le)|0;var Ie=(u+(n=n+Math.imul(x,pe)|0)|0)+((8191&(i=(i=i+Math.imul(x,me)|0)+Math.imul(k,pe)|0))<<13)|0;u=((o=o+Math.imul(k,me)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(B,oe),i=(i=Math.imul(B,ae))+Math.imul(F,oe)|0,o=Math.imul(F,ae),n=n+Math.imul(j,ce)|0,i=(i=i+Math.imul(j,ue)|0)+Math.imul(D,ce)|0,o=o+Math.imul(D,ue)|0,n=n+Math.imul(N,de)|0,i=(i=i+Math.imul(N,le)|0)+Math.imul(O,de)|0,o=o+Math.imul(O,le)|0;var Re=(u+(n=n+Math.imul(C,pe)|0)|0)+((8191&(i=(i=i+Math.imul(C,me)|0)+Math.imul(I,pe)|0))<<13)|0;u=((o=o+Math.imul(I,me)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(B,ce),i=(i=Math.imul(B,ue))+Math.imul(F,ce)|0,o=Math.imul(F,ue),n=n+Math.imul(j,de)|0,i=(i=i+Math.imul(j,le)|0)+Math.imul(D,de)|0,o=o+Math.imul(D,le)|0;var Ne=(u+(n=n+Math.imul(N,pe)|0)|0)+((8191&(i=(i=i+Math.imul(N,me)|0)+Math.imul(O,pe)|0))<<13)|0;u=((o=o+Math.imul(O,me)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,n=Math.imul(B,de),i=(i=Math.imul(B,le))+Math.imul(F,de)|0,o=Math.imul(F,le);var Oe=(u+(n=n+Math.imul(j,pe)|0)|0)+((8191&(i=(i=i+Math.imul(j,me)|0)+Math.imul(D,pe)|0))<<13)|0;u=((o=o+Math.imul(D,me)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863;var Te=(u+(n=Math.imul(B,pe))|0)+((8191&(i=(i=Math.imul(B,me))+Math.imul(F,pe)|0))<<13)|0;return u=((o=Math.imul(F,me))+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,c[0]=ge,c[1]=ye,c[2]=be,c[3]=ve,c[4]=we,c[5]=Ae,c[6]=_e,c[7]=Ee,c[8]=Se,c[9]=Pe,c[10]=xe,c[11]=ke,c[12]=Me,c[13]=Ce,c[14]=Ie,c[15]=Re,c[16]=Ne,c[17]=Oe,c[18]=Te,0!==u&&(c[19]=u,r.length++),r};function p(e,t,r){return(new m).mulp(e,t,r)}function m(e,t){this.x=e,this.y=t}Math.imul||(h=l),i.prototype.mulTo=function(e,t){var r,n=this.length+e.length;return r=10===this.length&&10===e.length?h(this,e,t):n<63?l(this,e,t):n<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,a&=67108863}r.words[o]=s,n=a,a=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,e,t):p(this,e,t),r},m.prototype.makeRBT=function(e){for(var t=new Array(e),r=i.prototype._countBits(e)-1,n=0;n>=1;return n},m.prototype.permute=function(e,t,r,n,i,o){for(var a=0;a>>=1)i++;return 1<>>=13,n[2*a+1]=8191&o,o>>>=13;for(a=2*t;a>=26,t+=i/67108864|0,t+=o>>>26,this.words[n]=67108863&o}return 0!==t&&(this.words[n]=t,this.length++),this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>i}return t}(e);if(0===t.length)return new i(1);for(var r=this,n=0;n=0);var t,n=e%26,i=(e-n)/26,o=67108863>>>26-n<<26-n;if(0!==n){var a=0;for(t=0;t>>26-n}a&&(this.words[t]=a,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var o=e%26,a=Math.min((e-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,u=0;u=0&&(0!==f||u>=i);u--){var d=0|this.words[u];this.words[u]=f<<26-o|d>>>o,f=d&s}return c&&0!==f&&(c.words[c.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(e,t,n){return r(0===this.negative),this.iushrn(e,t,n)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){r("number"==typeof e&&e>=0);var t=e%26,n=(e-t)/26,i=1<=0);var t=e%26,n=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==t&&n++,this.length=Math.min(n,this.length),0!==t){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},i.prototype.isubn=function(e){if(r("number"==typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(c/67108864|0),this.words[i+n]=67108863&o}for(;i>26,this.words[i+n]=67108863&o;if(0===s)return this.strip();for(r(-1===s),s=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},i.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),o=e,a=0|o.words[o.length-1];0!=(r=26-this._countBits(a))&&(o=o.ushln(r),n.iushln(r),a=0|o.words[o.length-1]);var s,c=n.length-o.length;if("mod"!==t){(s=new i(null)).length=c+1,s.words=new Array(s.length);for(var u=0;u=0;d--){var l=67108864*(0|n.words[o.length+d])+(0|n.words[o.length+d-1]);for(l=Math.min(l/a|0,67108863),n._ishlnsubmul(o,l,d);0!==n.negative;)l--,n.negative=0,n._ishlnsubmul(o,1,d),n.isZero()||(n.negative^=1);s&&(s.words[d]=l)}return s&&s.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},i.prototype.divmod=function(e,t,n){return r(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(o=s.div.neg()),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.iadd(e)),{div:o,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(o=s.div.neg()),{div:o,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modn(e.words[0]))}:this._wordDiv(e,t);var o,a,s},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modn=function(e){r(e<=67108863);for(var t=(1<<26)%e,n=0,i=this.length-1;i>=0;i--)n=(t*n+(0|this.words[i]))%e;return n},i.prototype.idivn=function(e){r(e<=67108863);for(var t=0,n=this.length-1;n>=0;n--){var i=(0|this.words[n])+67108864*t;this.words[n]=i/e|0,t=i%e}return this.strip()},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o=new i(1),a=new i(0),s=new i(0),c=new i(1),u=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++u;for(var f=n.clone(),d=t.clone();!t.isZero();){for(var l=0,h=1;0==(t.words[0]&h)&&l<26;++l,h<<=1);if(l>0)for(t.iushrn(l);l-- >0;)(o.isOdd()||a.isOdd())&&(o.iadd(f),a.isub(d)),o.iushrn(1),a.iushrn(1);for(var p=0,m=1;0==(n.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(n.iushrn(p);p-- >0;)(s.isOdd()||c.isOdd())&&(s.iadd(f),c.isub(d)),s.iushrn(1),c.iushrn(1);t.cmp(n)>=0?(t.isub(n),o.isub(s),a.isub(c)):(n.isub(t),s.isub(o),c.isub(a))}return{a:s,b:c,gcd:n.iushln(u)}},i.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o,a=new i(1),s=new i(0),c=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(var u=0,f=1;0==(t.words[0]&f)&&u<26;++u,f<<=1);if(u>0)for(t.iushrn(u);u-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);for(var d=0,l=1;0==(n.words[0]&l)&&d<26;++d,l<<=1);if(d>0)for(n.iushrn(d);d-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);t.cmp(n)>=0?(t.isub(n),a.isub(s)):(n.isub(t),s.isub(a))}return(o=0===t.cmpn(1)?a:s).cmpn(0)<0&&o.iadd(e),o},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return 0==(1&this.words[0])},i.prototype.isOdd=function(){return 1==(1&this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){r("number"==typeof e);var t=e%26,n=(e-t)/26,i=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this.strip(),this.length>1)t=1;else{n&&(e=-e),r(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){ni&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new E(e)},i.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var y={k256:null,p224:null,p192:null,p25519:null};function b(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){b.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){b.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function A(){b.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){b.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function E(e){if("string"==typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function S(e){E.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(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)}b.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},b.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},b.prototype.split=function(e,t){e.iushrn(this.n,0,t)},b.prototype.imulK=function(e){return e.imul(this.k)},n(v,b),v.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i>>22,o=a}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},v.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(y[e])return y[e];var t;if("k256"===e)t=new v;else if("p224"===e)t=new w;else if("p192"===e)t=new A;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new _}return y[e]=t,t},E.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},E.prototype._verify2=function(e,t){r(0==(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},E.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},E.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},E.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},E.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},E.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},E.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},E.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},E.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},E.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},E.prototype.isqr=function(e){return this.imul(e,e.clone())},E.prototype.sqr=function(e){return this.mul(e,e)},E.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2==1),3===t){var n=this.m.add(new i(1)).iushrn(2);return this.pow(e,n)}for(var o=this.m.subn(1),a=0;!o.isZero()&&0===o.andln(1);)a++,o.iushrn(1);r(!o.isZero());var s=new i(1).toRed(this),c=s.redNeg(),u=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new i(2*f*f).toRed(this);0!==this.pow(f,u).cmp(c);)f.redIAdd(c);for(var d=this.pow(f,o),l=this.pow(e,o.addn(1).iushrn(1)),h=this.pow(e,o),p=a;0!==h.cmp(s);){for(var m=h,g=0;0!==m.cmp(s);g++)m=m.redSqr();r(g=0;n--){for(var u=t.words[n],f=c-1;f>=0;f--){var d=u>>f&1;o!==r[0]&&(o=this.sqr(o)),0!==d||0!==a?(a<<=1,a|=d,(4==++s||0===n&&0===f)&&(o=this.mul(o,r[a]),s=0,a=0)):s=0}c=26}return o},E.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},E.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new S(e)},n(S,E),S.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},S.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},S.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},S.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(n).iushrn(this.shift),a=o;return o.cmp(this.m)>=0?a=o.isub(this.m):o.cmpn(0)<0&&(a=o.iadd(this.m)),a._forceRed(this)},S.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}})(m,u);var y=m.exports,b=v;function v(e,t){if(!e)throw new Error(t||"Assertion failed")}v.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)};var w={};!function(e){var t=e;function r(e){return 1===e.length?"0"+e:e}function n(e){for(var t="",n=0;n>8,a=255&i;o?r.push(o,a):r.push(a)}return r},t.zero2=r,t.toHex=n,t.encode=function(e,t){return"hex"===t?n(e):e}}(w),function(e){var t=e,r=y,n=b,i=w;t.assert=n,t.toArray=i.toArray,t.zero2=i.zero2,t.toHex=i.toHex,t.encode=i.encode,t.getNAF=function(e,t,r){var n=new Array(Math.max(e.bitLength(),r)+1);n.fill(0);for(var i=1<(i>>1)-1?(i>>1)-c:c,o.isubn(s)):s=0,n[a]=s,o.iushrn(1)}return n},t.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n,i=0,o=0;e.cmpn(-i)>0||t.cmpn(-o)>0;){var a,s,c=e.andln(3)+i&3,u=t.andln(3)+o&3;3===c&&(c=-1),3===u&&(u=-1),a=0==(1&c)?0:3!==(n=e.andln(7)+i&7)&&5!==n||2!==u?c:-c,r[0].push(a),s=0==(1&u)?0:3!==(n=t.andln(7)+o&7)&&5!==n||2!==c?u:-u,r[1].push(s),2*i===a+1&&(i=1-i),2*o===s+1&&(o=1-o),e.iushrn(1),t.iushrn(1)}return r},t.cachedProperty=function(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},t.parseBytes=function(e){return"string"==typeof e?t.toArray(e,"hex"):e},t.intFromLE=function(e){return new r(e,"hex","le")}}(p);var A,_={exports:{}};function E(e){this.rand=e}if(_.exports=function(e){return A||(A=new E(null)),A.generate(e)},_.exports.Rand=E,E.prototype.generate=function(e){return this._rand(e)},E.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),r=0;r0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var O=N;function T(e,t){this.curve=e,this.type=t,this.precomputed=null}N.prototype.point=function(){throw new Error("Not implemented")},N.prototype.validate=function(){throw new Error("Not implemented")},N.prototype._fixedNafMul=function(e,t){R(e.precomputed);var r=e._getDoubles(),n=C(t,1,this._bitLength),i=(1<=o;c--)a=(a<<1)+n[c];s.push(a)}for(var u=this.jpoint(null,null,null),f=this.jpoint(null,null,null),d=i;d>0;d--){for(o=0;o=0;s--){for(var c=0;s>=0&&0===o[s];s--)c++;if(s>=0&&c++,a=a.dblp(c),s<0)break;var u=o[s];R(0!==u),a="affine"===e.type?u>0?a.mixedAdd(i[u-1>>1]):a.mixedAdd(i[-u-1>>1].neg()):u>0?a.add(i[u-1>>1]):a.add(i[-u-1>>1].neg())}return"affine"===e.type?a.toP():a},N.prototype._wnafMulAdd=function(e,t,r,n,i){var o,a,s,c=this._wnafT1,u=this._wnafT2,f=this._wnafT3,d=0;for(o=0;o=1;o-=2){var h=o-1,p=o;if(1===c[h]&&1===c[p]){var m=[t[h],null,null,t[p]];0===t[h].y.cmp(t[p].y)?(m[1]=t[h].add(t[p]),m[2]=t[h].toJ().mixedAdd(t[p].neg())):0===t[h].y.cmp(t[p].y.redNeg())?(m[1]=t[h].toJ().mixedAdd(t[p]),m[2]=t[h].add(t[p].neg())):(m[1]=t[h].toJ().mixedAdd(t[p]),m[2]=t[h].toJ().mixedAdd(t[p].neg()));var g=[-3,-1,-5,-7,0,7,5,1,3],y=I(r[h],r[p]);for(d=Math.max(y[0].length,d),f[h]=new Array(d),f[p]=new Array(d),a=0;a=0;o--){for(var _=0;o>=0;){var E=!0;for(a=0;a=0&&_++,w=w.dblp(_),o<0)break;for(a=0;a0?s=u[a][S-1>>1]:S<0&&(s=u[a][-S-1>>1].neg()),w="affine"===s.type?w.mixedAdd(s):w.add(s))}}for(o=0;o=Math.ceil((e.bitLength()+1)/t.step)},T.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i=0&&(o=t,a=r),n.negative&&(n=n.neg(),i=i.neg()),o.negative&&(o=o.neg(),a=a.neg()),[{a:n,b:i},{a:o,b:a}]},U.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],i=n.b.mul(e).divRound(this.n),o=r.b.neg().mul(e).divRound(this.n),a=i.mul(r.a),s=o.mul(n.a),c=i.mul(r.b),u=o.mul(n.b);return{k1:e.sub(a).sub(s),k2:c.add(u).neg()}},U.prototype.pointFromX=function(e,t){(e=new $(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var i=n.fromRed().isOdd();return(t&&!i||!t&&i)&&(n=n.redNeg()),this.point(e,n)},U.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},U.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o":""},q.prototype.isInfinity=function(){return this.inf},q.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},q.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),a=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)},q.prototype.getX=function(){return this.x.fromRed()},q.prototype.getY=function(){return this.y.fromRed()},q.prototype.mul=function(e){return e=new $(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)},q.prototype.mulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},q.prototype.jmulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},q.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))},q.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,n=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return t},q.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},B(H,F.BasePoint),U.prototype.jpoint=function(e,t,r){return new H(this,e,t,r)},H.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},H.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},H.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),i=e.x.redMul(r),o=this.y.redMul(t.redMul(e.z)),a=e.y.redMul(r.redMul(this.z)),s=n.redSub(i),c=o.redSub(a);if(0===s.cmpn(0))return 0!==c.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=s.redSqr(),f=u.redMul(s),d=n.redMul(u),l=c.redSqr().redIAdd(f).redISub(d).redISub(d),h=c.redMul(d.redISub(l)).redISub(o.redMul(f)),p=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(l,h,p)},H.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),i=this.y,o=e.y.redMul(t).redMul(this.z),a=r.redSub(n),s=i.redSub(o);if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=a.redSqr(),u=c.redMul(a),f=r.redMul(c),d=s.redSqr().redIAdd(u).redISub(f).redISub(f),l=s.redMul(f.redISub(d)).redISub(i.redMul(u)),h=this.z.redMul(a);return this.curve.jpoint(d,l,h)},H.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var r=this;for(t=0;t=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},H.prototype.inspect=function(){return this.isInfinity()?"":""},H.prototype.isInfinity=function(){return 0===this.z.cmpn(0)};var K=y,J=D,W=O,G=p;function V(e){W.call(this,"mont",e),this.a=new K(e.a,16).toRed(this.red),this.b=new K(e.b,16).toRed(this.red),this.i4=new K(4).toRed(this.red).redInvm(),this.two=new K(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}J(V,W);var Z=V;function X(e,t,r){W.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new K(t,16),this.z=new K(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}V.prototype.validate=function(e){var t=e.normalize().x,r=t.redSqr(),n=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t);return 0===n.redSqrt().redSqr().cmp(n)},J(X,W.BasePoint),V.prototype.decodePoint=function(e,t){return this.point(G.toArray(e,t),1)},V.prototype.point=function(e,t){return new X(this,e,t)},V.prototype.pointFromJSON=function(e){return X.fromJSON(this,e)},X.prototype.precompute=function(){},X.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},X.fromJSON=function(e,t){return new X(e,t[0],t[1]||e.one)},X.prototype.inspect=function(){return this.isInfinity()?"":""},X.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},X.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),r=e.redSub(t),n=e.redMul(t),i=r.redMul(t.redAdd(this.curve.a24.redMul(r)));return this.curve.point(n,i)},X.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},X.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=e.x.redAdd(e.z),o=e.x.redSub(e.z).redMul(r),a=i.redMul(n),s=t.z.redMul(o.redAdd(a).redSqr()),c=t.x.redMul(o.redISub(a).redSqr());return this.curve.point(s,c)},X.prototype.mul=function(e){for(var t=e.clone(),r=this,n=this.curve.point(null,null),i=[];0!==t.cmpn(0);t.iushrn(1))i.push(t.andln(1));for(var o=i.length-1;o>=0;o--)0===i[o]?(r=r.diffAdd(n,this),n=n.dbl()):(n=r.diffAdd(n,this),r=r.dbl());return n},X.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},X.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},X.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},X.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},X.prototype.getX=function(){return this.normalize(),this.x.fromRed()};var Q=y,Y=D,ee=O,te=p.assert;function re(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,ee.call(this,"edwards",e),this.a=new Q(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new Q(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new Q(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),te(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}Y(re,ee);var ne=re;function ie(e,t,r,n,i){ee.BasePoint.call(this,e,"projective"),null===t&&null===r&&null===n?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new Q(t,16),this.y=new Q(r,16),this.z=n?new Q(n,16):this.curve.one,this.t=i&&new Q(i,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}re.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},re.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},re.prototype.jpoint=function(e,t,r,n){return this.point(e,t,r,n)},re.prototype.pointFromX=function(e,t){(e=new Q(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=this.c2.redSub(this.a.redMul(r)),i=this.one.redSub(this.c2.redMul(this.d).redMul(r)),o=n.redMul(i.redInvm()),a=o.redSqrt();if(0!==a.redSqr().redSub(o).cmp(this.zero))throw new Error("invalid point");var s=a.fromRed().isOdd();return(t&&!s||!t&&s)&&(a=a.redNeg()),this.point(e,a)},re.prototype.pointFromY=function(e,t){(e=new Q(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=r.redSub(this.c2),i=r.redMul(this.d).redMul(this.c2).redSub(this.a),o=n.redMul(i.redInvm());if(0===o.cmp(this.zero)){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var a=o.redSqrt();if(0!==a.redSqr().redSub(o).cmp(this.zero))throw new Error("invalid point");return a.fromRed().isOdd()!==t&&(a=a.redNeg()),this.point(a,e)},re.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),r=e.y.redSqr(),n=t.redMul(this.a).redAdd(r),i=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(r)));return 0===n.cmp(i)},Y(ie,ee.BasePoint),re.prototype.pointFromJSON=function(e){return ie.fromJSON(this,e)},re.prototype.point=function(e,t,r,n){return new ie(this,e,t,r,n)},ie.fromJSON=function(e,t){return new ie(e,t[0],t[1],t[2])},ie.prototype.inspect=function(){return this.isInfinity()?"":""},ie.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},ie.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(e),i=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),o=n.redAdd(t),a=o.redSub(r),s=n.redSub(t),c=i.redMul(a),u=o.redMul(s),f=i.redMul(s),d=a.redMul(o);return this.curve.point(c,u,d,f)},ie.prototype._projDbl=function(){var e,t,r,n,i,o,a=this.x.redAdd(this.y).redSqr(),s=this.x.redSqr(),c=this.y.redSqr();if(this.curve.twisted){var u=(n=this.curve._mulA(s)).redAdd(c);this.zOne?(e=a.redSub(s).redSub(c).redMul(u.redSub(this.curve.two)),t=u.redMul(n.redSub(c)),r=u.redSqr().redSub(u).redSub(u)):(i=this.z.redSqr(),o=u.redSub(i).redISub(i),e=a.redSub(s).redISub(c).redMul(o),t=u.redMul(n.redSub(c)),r=u.redMul(o))}else n=s.redAdd(c),i=this.curve._mulC(this.z).redSqr(),o=n.redSub(i).redSub(i),e=this.curve._mulC(a.redISub(n)).redMul(o),t=this.curve._mulC(n).redMul(s.redISub(c)),r=n.redMul(o);return this.curve.point(e,t,r)},ie.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},ie.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),n=this.t.redMul(this.curve.dd).redMul(e.t),i=this.z.redMul(e.z.redAdd(e.z)),o=r.redSub(t),a=i.redSub(n),s=i.redAdd(n),c=r.redAdd(t),u=o.redMul(a),f=s.redMul(c),d=o.redMul(c),l=a.redMul(s);return this.curve.point(u,f,l,d)},ie.prototype._projAdd=function(e){var t,r,n=this.z.redMul(e.z),i=n.redSqr(),o=this.x.redMul(e.x),a=this.y.redMul(e.y),s=this.curve.d.redMul(o).redMul(a),c=i.redSub(s),u=i.redAdd(s),f=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(o).redISub(a),d=n.redMul(c).redMul(f);return this.curve.twisted?(t=n.redMul(u).redMul(a.redSub(this.curve._mulA(o))),r=c.redMul(u)):(t=n.redMul(u).redMul(a.redSub(o)),r=this.curve._mulC(c).redMul(u)),this.curve.point(d,t,r)},ie.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},ie.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},ie.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},ie.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},ie.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},ie.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},ie.prototype.getX=function(){return this.normalize(),this.x.fromRed()},ie.prototype.getY=function(){return this.normalize(),this.y.fromRed()},ie.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},ie.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var r=e.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(n),0===this.x.cmp(t))return!0}},ie.prototype.toP=ie.prototype.normalize,ie.prototype.mixedAdd=ie.prototype.add,function(e){var t=e;t.base=O,t.short=L,t.mont=Z,t.edwards=ne}(x);var oe={},ae={},se={},ce=b,ue=D;function fe(e,t){return 55296==(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1)))}function de(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function le(e){return 1===e.length?"0"+e:e}function he(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}se.inherits=ue,se.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),i=0;i>6|192,r[n++]=63&o|128):fe(e,i)?(o=65536+((1023&o)<<10)+(1023&e.charCodeAt(++i)),r[n++]=o>>18|240,r[n++]=o>>12&63|128,r[n++]=o>>6&63|128,r[n++]=63&o|128):(r[n++]=o>>12|224,r[n++]=o>>6&63|128,r[n++]=63&o|128)}else for(i=0;i>>0}return o},se.split32=function(e,t){for(var r=new Array(4*e.length),n=0,i=0;n>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}return r},se.rotr32=function(e,t){return e>>>t|e<<32-t},se.rotl32=function(e,t){return e<>>32-t},se.sum32=function(e,t){return e+t>>>0},se.sum32_3=function(e,t,r){return e+t+r>>>0},se.sum32_4=function(e,t,r,n){return e+t+r+n>>>0},se.sum32_5=function(e,t,r,n,i){return e+t+r+n+i>>>0},se.sum64=function(e,t,r,n){var i=e[t],o=n+e[t+1]>>>0,a=(o>>0,e[t+1]=o},se.sum64_hi=function(e,t,r,n){return(t+n>>>0>>0},se.sum64_lo=function(e,t,r,n){return t+n>>>0},se.sum64_4_hi=function(e,t,r,n,i,o,a,s){var c=0,u=t;return c+=(u=u+n>>>0)>>0)>>0)>>0},se.sum64_4_lo=function(e,t,r,n,i,o,a,s){return t+n+o+s>>>0},se.sum64_5_hi=function(e,t,r,n,i,o,a,s,c,u){var f=0,d=t;return f+=(d=d+n>>>0)>>0)>>0)>>0)>>0},se.sum64_5_lo=function(e,t,r,n,i,o,a,s,c,u){return t+n+o+s+u>>>0},se.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},se.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},se.shr64_hi=function(e,t,r){return e>>>r},se.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0};var pe={},me=se,ge=b;function ye(){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}pe.BlockHash=ye,ye.prototype.update=function(e,t){if(e=me.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=me.join32(e,0,e.length-r,this.endian);for(var n=0;n>>24&255,n[i++]=e>>>16&255,n[i++]=e>>>8&255,n[i++]=255&e}else for(n[i++]=255&e,n[i++]=e>>>8&255,n[i++]=e>>>16&255,n[i++]=e>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;o>>3},ve.g1_256=function(e){return we(e,17)^we(e,19)^e>>>10};var Se=se,Pe=pe,xe=ve,ke=Se.rotl32,Me=Se.sum32,Ce=Se.sum32_5,Ie=xe.ft_1,Re=Pe.BlockHash,Ne=[1518500249,1859775393,2400959708,3395469782];function Oe(){if(!(this instanceof Oe))return new Oe;Re.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}Se.inherits(Oe,Re);var Te=Oe;Oe.blockSize=512,Oe.outSize=160,Oe.hmacStrength=80,Oe.padLength=64,Oe.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;nthis.blockSize&&(e=(new this.Hash).update(e).digest()),Yt(e.length<=this.blockSize);for(var t=e.length;t=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}var ur=cr;cr.prototype._init=function(e,t,r){var n=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},cr.prototype.generate=function(e,t,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(n=r,r=t,t=null),r&&(r=ar.toArray(r,n||"hex"),this._update(r));for(var i=[];i.length"};var pr=y,mr=p,gr=mr.assert;function yr(e,t){if(e instanceof yr)return e;this._importDER(e,t)||(gr(e.r&&e.s,"Signature without r or s"),this.r=new pr(e.r,16),this.s=new pr(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}var br=yr;function vr(){this.place=0}function wr(e,t){var r=e[t.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var i=0,o=0,a=t.place;o>>=0;return!(i<=127)&&(t.place=a,i)}function Ar(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}yr.prototype._importDER=function(e,t){e=mr.toArray(e,t);var r=new vr;if(48!==e[r.place++])return!1;var n=wr(e,r);if(!1===n)return!1;if(n+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var i=wr(e,r);if(!1===i)return!1;var o=e.slice(r.place,i+r.place);if(r.place+=i,2!==e[r.place++])return!1;var a=wr(e,r);if(!1===a)return!1;if(e.length!==a+r.place)return!1;var s=e.slice(r.place,a+r.place);if(0===o[0]){if(!(128&o[1]))return!1;o=o.slice(1)}if(0===s[0]){if(!(128&s[1]))return!1;s=s.slice(1)}return this.r=new pr(o),this.s=new pr(s),this.recoveryParam=null,!0},yr.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=Ar(t),r=Ar(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];_r(n,t.length),(n=n.concat(t)).push(2),_r(n,r.length);var i=n.concat(r),o=[48];return _r(o,i.length),o=o.concat(i),mr.encode(o,e)};var Er=y,Sr=ur,Pr=oe,xr=P,kr=p.assert,Mr=hr,Cr=br;function Ir(e){if(!(this instanceof Ir))return new Ir(e);"string"==typeof e&&(kr(Object.prototype.hasOwnProperty.call(Pr,e),"Unknown curve "+e),e=Pr[e]),e instanceof Pr.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}var Rr=Ir;Ir.prototype.keyPair=function(e){return new Mr(this,e)},Ir.prototype.keyFromPrivate=function(e,t){return Mr.fromPrivate(this,e,t)},Ir.prototype.keyFromPublic=function(e,t){return Mr.fromPublic(this,e,t)},Ir.prototype.genKeyPair=function(e){e||(e={});for(var t=new Sr({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||xr(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),n=this.n.sub(new Er(2));;){var i=new Er(t.generate(r));if(!(i.cmp(n)>0))return i.iaddn(1),this.keyFromPrivate(i)}},Ir.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},Ir.prototype.sign=function(e,t,r,n){"object"==typeof r&&(n=r,r=null),n||(n={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new Er(e,16));for(var i=this.n.byteLength(),o=t.getPrivate().toArray("be",i),a=e.toArray("be",i),s=new Sr({hash:this.hash,entropy:o,nonce:a,pers:n.pers,persEnc:n.persEnc||"utf8"}),c=this.n.sub(new Er(1)),u=0;;u++){var f=n.k?n.k(u):new Er(s.generate(this.n.byteLength()));if(!((f=this._truncateToN(f,!0)).cmpn(1)<=0||f.cmp(c)>=0)){var d=this.g.mul(f);if(!d.isInfinity()){var l=d.getX(),h=l.umod(this.n);if(0!==h.cmpn(0)){var p=f.invm(this.n).mul(h.mul(t.getPrivate()).iadd(e));if(0!==(p=p.umod(this.n)).cmpn(0)){var m=(d.getY().isOdd()?1:0)|(0!==l.cmp(h)?2:0);return n.canonical&&p.cmp(this.nh)>0&&(p=this.n.sub(p),m^=1),new Cr({r:h,s:p,recoveryParam:m})}}}}}},Ir.prototype.verify=function(e,t,r,n){e=this._truncateToN(new Er(e,16)),r=this.keyFromPublic(r,n);var i=(t=new Cr(t,"hex")).r,o=t.s;if(i.cmpn(1)<0||i.cmp(this.n)>=0)return!1;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var a,s=o.invm(this.n),c=s.mul(e).umod(this.n),u=s.mul(i).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(c,r.getPublic(),u)).isInfinity()&&a.eqXToP(i):!(a=this.g.mulAdd(c,r.getPublic(),u)).isInfinity()&&0===a.getX().umod(this.n).cmp(i)},Ir.prototype.recoverPubKey=function(e,t,r,n){kr((3&r)===r,"The recovery param is more than two bits"),t=new Cr(t,n);var i=this.n,o=new Er(e),a=t.r,s=t.s,c=1&r,u=r>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&u)throw new Error("Unable to find sencond key candinate");a=u?this.curve.pointFromX(a.add(this.curve.n),c):this.curve.pointFromX(a,c);var f=t.r.invm(i),d=i.sub(o).mul(f).umod(i),l=s.mul(f).umod(i);return this.g.mulAdd(d,a,l)},Ir.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new Cr(t,n)).recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(e,t,i)}catch(e){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")};var Nr=p,Or=Nr.assert,Tr=Nr.parseBytes,jr=Nr.cachedProperty;function Dr(e,t){this.eddsa=e,this._secret=Tr(t.secret),e.isPoint(t.pub)?this._pub=t.pub:this._pubBytes=Tr(t.pub)}Dr.fromPublic=function(e,t){return t instanceof Dr?t:new Dr(e,{pub:t})},Dr.fromSecret=function(e,t){return t instanceof Dr?t:new Dr(e,{secret:t})},Dr.prototype.secret=function(){return this._secret},jr(Dr,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),jr(Dr,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),jr(Dr,"privBytes",(function(){var e=this.eddsa,t=this.hash(),r=e.encodingLength-1,n=t.slice(0,e.encodingLength);return n[0]&=248,n[r]&=127,n[r]|=64,n})),jr(Dr,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),jr(Dr,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),jr(Dr,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),Dr.prototype.sign=function(e){return Or(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},Dr.prototype.verify=function(e,t){return this.eddsa.verify(e,t,this)},Dr.prototype.getSecret=function(e){return Or(this._secret,"KeyPair is public only"),Nr.encode(this.secret(),e)},Dr.prototype.getPublic=function(e){return Nr.encode(this.pubBytes(),e)};var $r=Dr,Br=y,Fr=p,zr=Fr.assert,Ur=Fr.cachedProperty,Lr=Fr.parseBytes;function qr(e,t){this.eddsa=e,"object"!=typeof t&&(t=Lr(t)),Array.isArray(t)&&(t={R:t.slice(0,e.encodingLength),S:t.slice(e.encodingLength)}),zr(t.R&&t.S,"Signature without R or S"),e.isPoint(t.R)&&(this._R=t.R),t.S instanceof Br&&(this._S=t.S),this._Rencoded=Array.isArray(t.R)?t.R:t.Rencoded,this._Sencoded=Array.isArray(t.S)?t.S:t.Sencoded}Ur(qr,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),Ur(qr,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),Ur(qr,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),Ur(qr,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),qr.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},qr.prototype.toHex=function(){return Fr.encode(this.toBytes(),"hex").toUpperCase()};var Hr=qr,Kr=ae,Jr=oe,Wr=p,Gr=Wr.assert,Vr=Wr.parseBytes,Zr=$r,Xr=Hr;function Qr(e){if(Gr("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof Qr))return new Qr(e);e=Jr[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=Kr.sha512}var Yr=Qr;Qr.prototype.sign=function(e,t){e=Vr(e);var r=this.keyFromSecret(t),n=this.hashInt(r.messagePrefix(),e),i=this.g.mul(n),o=this.encodePoint(i),a=this.hashInt(o,r.pubBytes(),e).mul(r.priv()),s=n.add(a).umod(this.curve.n);return this.makeSignature({R:i,S:s,Rencoded:o})},Qr.prototype.verify=function(e,t,r){e=Vr(e),t=this.makeSignature(t);var n=this.keyFromPublic(r),i=this.hashInt(t.Rencoded(),n.pubBytes(),e),o=this.g.mul(t.S());return t.R().add(n.pub().mul(i)).eq(o)},Qr.prototype.hashInt=function(){for(var e=this.hash(),t=0;te instanceof CryptoKey,fn=async(e,t)=>{const r=`SHA-${e.slice(-3)}`;return new Uint8Array(await cn.subtle.digest(r,t))},dn=new TextEncoder,ln=new TextDecoder,hn=2**32;function pn(...e){const t=e.reduce(((e,{length:t})=>e+t),0),r=new Uint8Array(t);let n=0;return e.forEach((e=>{r.set(e,n),n+=e.length})),r}function mn(e,t,r){if(t<0||t>=hn)throw new RangeError(`value must be >= 0 and <= ${hn-1}. Received ${t}`);e.set([t>>>24,t>>>16,t>>>8,255&t],r)}function gn(e){const t=Math.floor(e/hn),r=e%hn,n=new Uint8Array(8);return mn(n,t,0),mn(n,r,4),n}function yn(e){const t=new Uint8Array(4);return mn(t,e),t}function bn(e){return pn(yn(e.length),e)}const vn=e=>(e=>{let t=e;"string"==typeof t&&(t=dn.encode(t));const r=[];for(let e=0;e{let t=e;t instanceof Uint8Array&&(t=ln.decode(t)),t=t.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"");try{return(e=>{const t=atob(e),r=new Uint8Array(t.length);for(let e=0;eRn(new Uint8Array(Nn(e)>>3));const Tn=(e,t)=>{if(t.length<<3!==Nn(e))throw new kn("Invalid Initialization Vector length")},jn=(e,t)=>{const r=e.byteLength<<3;if(r!==t)throw new kn(`Invalid Content Encryption Key length. Expected ${t} bits, got ${r} bits`)};function Dn(){return"undefined"!=typeof WebSocketPair||"undefined"!=typeof navigator&&"Cloudflare-Workers"===navigator.userAgent||"undefined"!=typeof EdgeRuntime&&"vercel"===EdgeRuntime}function $n(e,t="algorithm.name"){return new TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`)}function Bn(e,t){return e.name===t}function Fn(e){return parseInt(e.name.slice(4),10)}function zn(e,t){if(t.length&&!t.some((t=>e.usages.includes(t)))){let e="CryptoKey does not support this operation, its usages must include ";if(t.length>2){const r=t.pop();e+=`one of ${t.join(", ")}, or ${r}.`}else 2===t.length?e+=`one of ${t[0]} or ${t[1]}.`:e+=`${t[0]}.`;throw new TypeError(e)}}function Un(e,t,...r){switch(t){case"HS256":case"HS384":case"HS512":{if(!Bn(e.algorithm,"HMAC"))throw $n("HMAC");const r=parseInt(t.slice(2),10);if(Fn(e.algorithm.hash)!==r)throw $n(`SHA-${r}`,"algorithm.hash");break}case"RS256":case"RS384":case"RS512":{if(!Bn(e.algorithm,"RSASSA-PKCS1-v1_5"))throw $n("RSASSA-PKCS1-v1_5");const r=parseInt(t.slice(2),10);if(Fn(e.algorithm.hash)!==r)throw $n(`SHA-${r}`,"algorithm.hash");break}case"PS256":case"PS384":case"PS512":{if(!Bn(e.algorithm,"RSA-PSS"))throw $n("RSA-PSS");const r=parseInt(t.slice(2),10);if(Fn(e.algorithm.hash)!==r)throw $n(`SHA-${r}`,"algorithm.hash");break}case"EdDSA":if("Ed25519"!==e.algorithm.name&&"Ed448"!==e.algorithm.name){if(Dn()){if(Bn(e.algorithm,"NODE-ED25519"))break;throw $n("Ed25519, Ed448, or NODE-ED25519")}throw $n("Ed25519 or Ed448")}break;case"ES256":case"ES384":case"ES512":{if(!Bn(e.algorithm,"ECDSA"))throw $n("ECDSA");const r=function(e){switch(e){case"ES256":return"P-256";case"ES384":return"P-384";case"ES512":return"P-521";default:throw new Error("unreachable")}}(t);if(e.algorithm.namedCurve!==r)throw $n(r,"algorithm.namedCurve");break}default:throw new TypeError("CryptoKey does not support this operation")}zn(e,r)}function Ln(e,t,...r){switch(t){case"A128GCM":case"A192GCM":case"A256GCM":{if(!Bn(e.algorithm,"AES-GCM"))throw $n("AES-GCM");const r=parseInt(t.slice(1,4),10);if(e.algorithm.length!==r)throw $n(r,"algorithm.length");break}case"A128KW":case"A192KW":case"A256KW":{if(!Bn(e.algorithm,"AES-KW"))throw $n("AES-KW");const r=parseInt(t.slice(1,4),10);if(e.algorithm.length!==r)throw $n(r,"algorithm.length");break}case"ECDH":switch(e.algorithm.name){case"ECDH":case"X25519":case"X448":break;default:throw $n("ECDH, X25519, or X448")}break;case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":if(!Bn(e.algorithm,"PBKDF2"))throw $n("PBKDF2");break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":{if(!Bn(e.algorithm,"RSA-OAEP"))throw $n("RSA-OAEP");const r=parseInt(t.slice(9),10)||1;if(Fn(e.algorithm.hash)!==r)throw $n(`SHA-${r}`,"algorithm.hash");break}default:throw new TypeError("CryptoKey does not support this operation")}zn(e,r)}function qn(e,t,...r){if(r.length>2){const t=r.pop();e+=`one of type ${r.join(", ")}, or ${t}.`}else 2===r.length?e+=`one of type ${r[0]} or ${r[1]}.`:e+=`of type ${r[0]}.`;return null==t?e+=` Received ${t}`:"function"==typeof t&&t.name?e+=` Received function ${t.name}`:"object"==typeof t&&null!=t&&t.constructor&&t.constructor.name&&(e+=` Received an instance of ${t.constructor.name}`),e}var Hn=(e,...t)=>qn("Key must be ",e,...t);function Kn(e,t,...r){return qn(`Key for the ${e} algorithm must be `,t,...r)}var Jn=e=>un(e);const Wn=["CryptoKey"];async function Gn(e,t,r,n,i,o){if(!(t instanceof Uint8Array))throw new TypeError(Hn(t,"Uint8Array"));const a=parseInt(e.slice(1,4),10),s=await cn.subtle.importKey("raw",t.subarray(a>>3),"AES-CBC",!1,["decrypt"]),c=await cn.subtle.importKey("raw",t.subarray(0,a>>3),{hash:"SHA-"+(a<<1),name:"HMAC"},!1,["sign"]),u=pn(o,n,r,gn(o.length<<3)),f=new Uint8Array((await cn.subtle.sign("HMAC",c,u)).slice(0,a>>3));let d,l;try{d=((e,t)=>{if(!(e instanceof Uint8Array))throw new TypeError("First argument must be a buffer");if(!(t instanceof Uint8Array))throw new TypeError("Second argument must be a buffer");if(e.length!==t.length)throw new TypeError("Input buffers must have the same length");const r=e.length;let n=0,i=-1;for(;++i{if(!(un(t)||t instanceof Uint8Array))throw new TypeError(Hn(t,...Wn,"Uint8Array"));switch(Tn(e,n),e){case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return t instanceof Uint8Array&&jn(t,parseInt(e.slice(-3),10)),Gn(e,t,r,n,i,o);case"A128GCM":case"A192GCM":case"A256GCM":return t instanceof Uint8Array&&jn(t,parseInt(e.slice(1,4),10)),async function(e,t,r,n,i,o){let a;t instanceof Uint8Array?a=await cn.subtle.importKey("raw",t,"AES-GCM",!1,["decrypt"]):(Ln(t,e,"decrypt"),a=t);try{return new Uint8Array(await cn.subtle.decrypt({additionalData:o,iv:n,name:"AES-GCM",tagLength:128},a,pn(r,i)))}catch(e){throw new xn}}(e,t,r,n,i,o);default:throw new Pn("Unsupported JWE Content Encryption Algorithm")}},Zn=async()=>{throw new Pn('JWE "zip" (Compression Algorithm) Header Parameter is not supported by your javascript runtime. You need to use the `inflateRaw` decrypt option to provide Inflate Raw implementation.')},Xn=async()=>{throw new Pn('JWE "zip" (Compression Algorithm) Header Parameter is not supported by your javascript runtime. You need to use the `deflateRaw` encrypt option to provide Deflate Raw implementation.')},Qn=(...e)=>{const t=e.filter(Boolean);if(0===t.length||1===t.length)return!0;let r;for(const e of t){const t=Object.keys(e);if(r&&0!==r.size)for(const e of t){if(r.has(e))return!1;r.add(e)}else r=new Set(t)}return!0};function Yn(e){if("object"!=typeof(t=e)||null===t||"[object Object]"!==Object.prototype.toString.call(e))return!1;var t;if(null===Object.getPrototypeOf(e))return!0;let r=e;for(;null!==Object.getPrototypeOf(r);)r=Object.getPrototypeOf(r);return Object.getPrototypeOf(e)===r}const ei=[{hash:"SHA-256",name:"HMAC"},!0,["sign"]];function ti(e,t){if(e.algorithm.length!==parseInt(t.slice(1,4),10))throw new TypeError(`Invalid key size for alg: ${t}`)}function ri(e,t,r){if(un(e))return Ln(e,t,r),e;if(e instanceof Uint8Array)return cn.subtle.importKey("raw",e,"AES-KW",!0,[r]);throw new TypeError(Hn(e,...Wn,"Uint8Array"))}const ni=async(e,t,r)=>{const n=await ri(t,e,"wrapKey");ti(n,e);const i=await cn.subtle.importKey("raw",r,...ei);return new Uint8Array(await cn.subtle.wrapKey("raw",i,n,"AES-KW"))},ii=async(e,t,r)=>{const n=await ri(t,e,"unwrapKey");ti(n,e);const i=await cn.subtle.unwrapKey("raw",r,n,"AES-KW",...ei);return new Uint8Array(await cn.subtle.exportKey("raw",i))};async function oi(e,t,r,n,i=new Uint8Array(0),o=new Uint8Array(0)){if(!un(e))throw new TypeError(Hn(e,...Wn));if(Ln(e,"ECDH"),!un(t))throw new TypeError(Hn(t,...Wn));Ln(t,"ECDH","deriveBits");const a=pn(bn(dn.encode(r)),bn(i),bn(o),yn(n));let s;s="X25519"===e.algorithm.name?256:"X448"===e.algorithm.name?448:Math.ceil(parseInt(e.algorithm.namedCurve.substr(-3),10)/8)<<3;return async function(e,t,r){const n=Math.ceil((t>>3)/32),i=new Uint8Array(32*n);for(let t=0;t>3)}(new Uint8Array(await cn.subtle.deriveBits({name:e.algorithm.name,public:e},t,s)),n,a)}function ai(e){if(!un(e))throw new TypeError(Hn(e,...Wn));return["P-256","P-384","P-521"].includes(e.algorithm.namedCurve)||"X25519"===e.algorithm.name||"X448"===e.algorithm.name}async function si(e,t,r,n){!function(e){if(!(e instanceof Uint8Array)||e.length<8)throw new kn("PBES2 Salt Input must be 8 or more octets")}(e);const i=function(e,t){return pn(dn.encode(e),new Uint8Array([0]),t)}(t,e),o=parseInt(t.slice(13,16),10),a={hash:`SHA-${t.slice(8,11)}`,iterations:r,name:"PBKDF2",salt:i},s={length:o,name:"AES-KW"},c=await function(e,t){if(e instanceof Uint8Array)return cn.subtle.importKey("raw",e,"PBKDF2",!1,["deriveBits"]);if(un(e))return Ln(e,t,"deriveBits","deriveKey"),e;throw new TypeError(Hn(e,...Wn,"Uint8Array"))}(n,t);if(c.usages.includes("deriveBits"))return new Uint8Array(await cn.subtle.deriveBits(a,c,o));if(c.usages.includes("deriveKey"))return cn.subtle.deriveKey(a,c,s,!1,["wrapKey","unwrapKey"]);throw new TypeError('PBKDF2 key "usages" must include "deriveBits" or "deriveKey"')}const ci=async(e,t,r,n,i)=>{const o=await si(i,e,n,t);return ii(e.slice(-6),o,r)};function ui(e){switch(e){case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":return"RSA-OAEP";default:throw new Pn(`alg ${e} is not supported either by JOSE or your javascript runtime`)}}var fi=(e,t)=>{if(e.startsWith("RS")||e.startsWith("PS")){const{modulusLength:r}=t.algorithm;if("number"!=typeof r||r<2048)throw new TypeError(`${e} requires key modulusLength to be 2048 bits or larger`)}};const di=async(e,t,r)=>{if(!un(t))throw new TypeError(Hn(t,...Wn));if(Ln(t,e,"decrypt","unwrapKey"),fi(e,t),t.usages.includes("decrypt"))return new Uint8Array(await cn.subtle.decrypt(ui(e),t,r));if(t.usages.includes("unwrapKey")){const n=await cn.subtle.unwrapKey("raw",r,t,ui(e),...ei);return new Uint8Array(await cn.subtle.exportKey("raw",n))}throw new TypeError('RSA-OAEP key "usages" must include "decrypt" or "unwrapKey" for this operation')};function li(e){switch(e){case"A128GCM":return 128;case"A192GCM":return 192;case"A256GCM":case"A128CBC-HS256":return 256;case"A192CBC-HS384":return 384;case"A256CBC-HS512":return 512;default:throw new Pn(`Unsupported JWE Algorithm: ${e}`)}}var hi=e=>Rn(new Uint8Array(li(e)>>3));var pi=async e=>{var t,r;if(!e.alg)throw new TypeError('"alg" argument is required when "jwk.alg" is not present');const{algorithm:n,keyUsages:i}=function(e){let t,r;switch(e.kty){case"oct":switch(e.alg){case"HS256":case"HS384":case"HS512":t={name:"HMAC",hash:`SHA-${e.alg.slice(-3)}`},r=["sign","verify"];break;case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":throw new Pn(`${e.alg} keys cannot be imported as CryptoKey instances`);case"A128GCM":case"A192GCM":case"A256GCM":case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":t={name:"AES-GCM"},r=["encrypt","decrypt"];break;case"A128KW":case"A192KW":case"A256KW":t={name:"AES-KW"},r=["wrapKey","unwrapKey"];break;case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":t={name:"PBKDF2"},r=["deriveBits"];break;default:throw new Pn('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"RSA":switch(e.alg){case"PS256":case"PS384":case"PS512":t={name:"RSA-PSS",hash:`SHA-${e.alg.slice(-3)}`},r=e.d?["sign"]:["verify"];break;case"RS256":case"RS384":case"RS512":t={name:"RSASSA-PKCS1-v1_5",hash:`SHA-${e.alg.slice(-3)}`},r=e.d?["sign"]:["verify"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":t={name:"RSA-OAEP",hash:`SHA-${parseInt(e.alg.slice(-3),10)||1}`},r=e.d?["decrypt","unwrapKey"]:["encrypt","wrapKey"];break;default:throw new Pn('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"EC":switch(e.alg){case"ES256":t={name:"ECDSA",namedCurve:"P-256"},r=e.d?["sign"]:["verify"];break;case"ES384":t={name:"ECDSA",namedCurve:"P-384"},r=e.d?["sign"]:["verify"];break;case"ES512":t={name:"ECDSA",namedCurve:"P-521"},r=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":t={name:"ECDH",namedCurve:e.crv},r=e.d?["deriveBits"]:[];break;default:throw new Pn('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"OKP":switch(e.alg){case"EdDSA":t={name:e.crv},r=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":t={name:e.crv},r=e.d?["deriveBits"]:[];break;default:throw new Pn('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;default:throw new Pn('Invalid or unsupported JWK "kty" (Key Type) Parameter value')}return{algorithm:t,keyUsages:r}}(e),o=[n,null!==(t=e.ext)&&void 0!==t&&t,null!==(r=e.key_ops)&&void 0!==r?r:i];if("PBKDF2"===n.name)return cn.subtle.importKey("raw",wn(e.k),...o);const a={...e};delete a.alg,delete a.use;try{return await cn.subtle.importKey("jwk",a,...o)}catch(e){if("Ed25519"===n.name&&"NotSupportedError"===(null==e?void 0:e.name)&&Dn())return o[0]={name:"NODE-ED25519",namedCurve:"NODE-ED25519"},await cn.subtle.importKey("jwk",a,...o);throw e}};async function mi(e,t,r){var n;if(!Yn(e))throw new TypeError("JWK must be an object");switch(t||(t=e.alg),e.kty){case"oct":if("string"!=typeof e.k||!e.k)throw new TypeError('missing "k" (Key Value) Parameter value');return null!=r||(r=!0!==e.ext),r?pi({...e,alg:t,ext:null!==(n=e.ext)&&void 0!==n&&n}):wn(e.k);case"RSA":if(void 0!==e.oth)throw new Pn('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');case"EC":case"OKP":return pi({...e,alg:t});default:throw new Pn('Unsupported "kty" (Key Type) Parameter value')}}const gi=(e,t,r)=>{e.startsWith("HS")||"dir"===e||e.startsWith("PBES2")||/^A\d{3}(?:GCM)?KW$/.test(e)?((e,t)=>{if(!(t instanceof Uint8Array)){if(!Jn(t))throw new TypeError(Kn(e,t,...Wn,"Uint8Array"));if("secret"!==t.type)throw new TypeError(`${Wn.join(" or ")} instances for symmetric algorithms must be of type "secret"`)}})(e,t):((e,t,r)=>{if(!Jn(t))throw new TypeError(Kn(e,t,...Wn));if("secret"===t.type)throw new TypeError(`${Wn.join(" or ")} instances for asymmetric algorithms must not be of type "secret"`);if("sign"===r&&"public"===t.type)throw new TypeError(`${Wn.join(" or ")} instances for asymmetric algorithm signing must be of type "private"`);if("decrypt"===r&&"public"===t.type)throw new TypeError(`${Wn.join(" or ")} instances for asymmetric algorithm decryption must be of type "private"`);if(t.algorithm&&"verify"===r&&"private"===t.type)throw new TypeError(`${Wn.join(" or ")} instances for asymmetric algorithm verifying must be of type "public"`);if(t.algorithm&&"encrypt"===r&&"private"===t.type)throw new TypeError(`${Wn.join(" or ")} instances for asymmetric algorithm encryption must be of type "public"`)})(e,t,r)};const yi=async(e,t,r,n,i)=>{if(!(un(r)||r instanceof Uint8Array))throw new TypeError(Hn(r,...Wn,"Uint8Array"));switch(Tn(e,n),e){case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return r instanceof Uint8Array&&jn(r,parseInt(e.slice(-3),10)),async function(e,t,r,n,i){if(!(r instanceof Uint8Array))throw new TypeError(Hn(r,"Uint8Array"));const o=parseInt(e.slice(1,4),10),a=await cn.subtle.importKey("raw",r.subarray(o>>3),"AES-CBC",!1,["encrypt"]),s=await cn.subtle.importKey("raw",r.subarray(0,o>>3),{hash:"SHA-"+(o<<1),name:"HMAC"},!1,["sign"]),c=new Uint8Array(await cn.subtle.encrypt({iv:n,name:"AES-CBC"},a,t)),u=pn(i,n,c,gn(i.length<<3));return{ciphertext:c,tag:new Uint8Array((await cn.subtle.sign("HMAC",s,u)).slice(0,o>>3))}}(e,t,r,n,i);case"A128GCM":case"A192GCM":case"A256GCM":return r instanceof Uint8Array&&jn(r,parseInt(e.slice(1,4),10)),async function(e,t,r,n,i){let o;r instanceof Uint8Array?o=await cn.subtle.importKey("raw",r,"AES-GCM",!1,["encrypt"]):(Ln(r,e,"encrypt"),o=r);const a=new Uint8Array(await cn.subtle.encrypt({additionalData:i,iv:n,name:"AES-GCM",tagLength:128},o,t)),s=a.slice(-16);return{ciphertext:a.slice(0,-16),tag:s}}(e,t,r,n,i);default:throw new Pn("Unsupported JWE Content Encryption Algorithm")}};async function bi(e,t,r,n,i){switch(gi(e,t,"decrypt"),e){case"dir":if(void 0!==r)throw new kn("Encountered unexpected JWE Encrypted Key");return t;case"ECDH-ES":if(void 0!==r)throw new kn("Encountered unexpected JWE Encrypted Key");case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{if(!Yn(n.epk))throw new kn('JOSE Header "epk" (Ephemeral Public Key) missing or invalid');if(!ai(t))throw new Pn("ECDH with the provided key is not allowed or not supported by your javascript runtime");const i=await mi(n.epk,e);let o,a;if(void 0!==n.apu){if("string"!=typeof n.apu)throw new kn('JOSE Header "apu" (Agreement PartyUInfo) invalid');o=wn(n.apu)}if(void 0!==n.apv){if("string"!=typeof n.apv)throw new kn('JOSE Header "apv" (Agreement PartyVInfo) invalid');a=wn(n.apv)}const s=await oi(i,t,"ECDH-ES"===e?n.enc:e,"ECDH-ES"===e?li(n.enc):parseInt(e.slice(-5,-2),10),o,a);if("ECDH-ES"===e)return s;if(void 0===r)throw new kn("JWE Encrypted Key missing");return ii(e.slice(-6),s,r)}case"RSA1_5":case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":if(void 0===r)throw new kn("JWE Encrypted Key missing");return di(e,t,r);case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":{if(void 0===r)throw new kn("JWE Encrypted Key missing");if("number"!=typeof n.p2c)throw new kn('JOSE Header "p2c" (PBES2 Count) missing or invalid');const o=(null==i?void 0:i.maxPBES2Count)||1e4;if(n.p2c>o)throw new kn('JOSE Header "p2c" (PBES2 Count) out is of acceptable bounds');if("string"!=typeof n.p2s)throw new kn('JOSE Header "p2s" (PBES2 Salt) missing or invalid');return ci(e,t,r,n.p2c,wn(n.p2s))}case"A128KW":case"A192KW":case"A256KW":if(void 0===r)throw new kn("JWE Encrypted Key missing");return ii(e,t,r);case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":if(void 0===r)throw new kn("JWE Encrypted Key missing");if("string"!=typeof n.iv)throw new kn('JOSE Header "iv" (Initialization Vector) missing or invalid');if("string"!=typeof n.tag)throw new kn('JOSE Header "tag" (Authentication Tag) missing or invalid');return async function(e,t,r,n,i){const o=e.slice(0,7);return Vn(o,t,r,n,i,new Uint8Array(0))}(e,t,r,wn(n.iv),wn(n.tag));default:throw new Pn('Invalid or unsupported "alg" (JWE Algorithm) header value')}}function vi(e,t,r,n,i){if(void 0!==i.crit&&void 0===n.crit)throw new e('"crit" (Critical) Header Parameter MUST be integrity protected');if(!n||void 0===n.crit)return new Set;if(!Array.isArray(n.crit)||0===n.crit.length||n.crit.some((e=>"string"!=typeof e||0===e.length)))throw new e('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');let o;o=void 0!==r?new Map([...Object.entries(r),...t.entries()]):t;for(const t of n.crit){if(!o.has(t))throw new Pn(`Extension Header Parameter "${t}" is not recognized`);if(void 0===i[t])throw new e(`Extension Header Parameter "${t}" is missing`);if(o.get(t)&&void 0===n[t])throw new e(`Extension Header Parameter "${t}" MUST be integrity protected`)}return new Set(n.crit)}const wi=(e,t)=>{if(void 0!==t&&(!Array.isArray(t)||t.some((e=>"string"!=typeof e))))throw new TypeError(`"${e}" option must be an array of strings`);if(t)return new Set(t)};async function Ai(e,t,r){if(e instanceof Uint8Array&&(e=ln.decode(e)),"string"!=typeof e)throw new kn("Compact JWE must be a string or Uint8Array");const{0:n,1:i,2:o,3:a,4:s,length:c}=e.split(".");if(5!==c)throw new kn("Invalid Compact JWE");const u=await async function(e,t,r){var n;if(!Yn(e))throw new kn("Flattened JWE must be an object");if(void 0===e.protected&&void 0===e.header&&void 0===e.unprotected)throw new kn("JOSE Header missing");if("string"!=typeof e.iv)throw new kn("JWE Initialization Vector missing or incorrect type");if("string"!=typeof e.ciphertext)throw new kn("JWE Ciphertext missing or incorrect type");if("string"!=typeof e.tag)throw new kn("JWE Authentication Tag missing or incorrect type");if(void 0!==e.protected&&"string"!=typeof e.protected)throw new kn("JWE Protected Header incorrect type");if(void 0!==e.encrypted_key&&"string"!=typeof e.encrypted_key)throw new kn("JWE Encrypted Key incorrect type");if(void 0!==e.aad&&"string"!=typeof e.aad)throw new kn("JWE AAD incorrect type");if(void 0!==e.header&&!Yn(e.header))throw new kn("JWE Shared Unprotected Header incorrect type");if(void 0!==e.unprotected&&!Yn(e.unprotected))throw new kn("JWE Per-Recipient Unprotected Header incorrect type");let i;if(e.protected)try{const t=wn(e.protected);i=JSON.parse(ln.decode(t))}catch(e){throw new kn("JWE Protected Header is invalid")}if(!Qn(i,e.header,e.unprotected))throw new kn("JWE Protected, JWE Unprotected Header, and JWE Per-Recipient Unprotected Header Parameter names must be disjoint");const o={...i,...e.header,...e.unprotected};if(vi(kn,new Map,null==r?void 0:r.crit,i,o),void 0!==o.zip){if(!i||!i.zip)throw new kn('JWE "zip" (Compression Algorithm) Header MUST be integrity protected');if("DEF"!==o.zip)throw new Pn('Unsupported JWE "zip" (Compression Algorithm) Header Parameter value')}const{alg:a,enc:s}=o;if("string"!=typeof a||!a)throw new kn("missing JWE Algorithm (alg) in JWE Header");if("string"!=typeof s||!s)throw new kn("missing JWE Encryption Algorithm (enc) in JWE Header");const c=r&&wi("keyManagementAlgorithms",r.keyManagementAlgorithms),u=r&&wi("contentEncryptionAlgorithms",r.contentEncryptionAlgorithms);if(c&&!c.has(a))throw new Sn('"alg" (Algorithm) Header Parameter not allowed');if(u&&!u.has(s))throw new Sn('"enc" (Encryption Algorithm) Header Parameter not allowed');let f;void 0!==e.encrypted_key&&(f=wn(e.encrypted_key));let d,l=!1;"function"==typeof t&&(t=await t(i,e),l=!0);try{d=await bi(a,t,f,o,r)}catch(e){if(e instanceof TypeError||e instanceof kn||e instanceof Pn)throw e;d=hi(s)}const h=wn(e.iv),p=wn(e.tag),m=dn.encode(null!==(n=e.protected)&&void 0!==n?n:"");let g;g=void 0!==e.aad?pn(m,dn.encode("."),dn.encode(e.aad)):m;let y=await Vn(s,d,wn(e.ciphertext),h,p,g);"DEF"===o.zip&&(y=await((null==r?void 0:r.inflateRaw)||Zn)(y));const b={plaintext:y};return void 0!==e.protected&&(b.protectedHeader=i),void 0!==e.aad&&(b.additionalAuthenticatedData=wn(e.aad)),void 0!==e.unprotected&&(b.sharedUnprotectedHeader=e.unprotected),void 0!==e.header&&(b.unprotectedHeader=e.header),l?{...b,key:t}:b}({ciphertext:a,iv:o||void 0,protected:n||void 0,tag:s||void 0,encrypted_key:i||void 0},t,r),f={plaintext:u.plaintext,protectedHeader:u.protectedHeader};return"function"==typeof t?{...f,key:u.key}:f}var _i=async e=>{if(e instanceof Uint8Array)return{kty:"oct",k:vn(e)};if(!un(e))throw new TypeError(Hn(e,...Wn,"Uint8Array"));if(!e.extractable)throw new TypeError("non-extractable CryptoKey cannot be exported as a JWK");const{ext:t,key_ops:r,alg:n,use:i,...o}=await cn.subtle.exportKey("jwk",e);return o};async function Ei(e){return _i(e)}async function Si(e,t,r,n,i={}){let o,a,s;switch(gi(e,r,"encrypt"),e){case"dir":s=r;break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{if(!ai(r))throw new Pn("ECDH with the provided key is not allowed or not supported by your javascript runtime");const{apu:c,apv:u}=i;let{epk:f}=i;f||(f=(await async function(e){if(!un(e))throw new TypeError(Hn(e,...Wn));return cn.subtle.generateKey(e.algorithm,!0,["deriveBits"])}(r)).privateKey);const{x:d,y:l,crv:h,kty:p}=await Ei(f),m=await oi(r,f,"ECDH-ES"===e?t:e,"ECDH-ES"===e?li(t):parseInt(e.slice(-5,-2),10),c,u);if(a={epk:{x:d,crv:h,kty:p}},"EC"===p&&(a.epk.y=l),c&&(a.apu=vn(c)),u&&(a.apv=vn(u)),"ECDH-ES"===e){s=m;break}s=n||hi(t);const g=e.slice(-6);o=await ni(g,m,s);break}case"RSA1_5":case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":s=n||hi(t),o=await(async(e,t,r)=>{if(!un(t))throw new TypeError(Hn(t,...Wn));if(Ln(t,e,"encrypt","wrapKey"),fi(e,t),t.usages.includes("encrypt"))return new Uint8Array(await cn.subtle.encrypt(ui(e),t,r));if(t.usages.includes("wrapKey")){const n=await cn.subtle.importKey("raw",r,...ei);return new Uint8Array(await cn.subtle.wrapKey("raw",n,t,ui(e)))}throw new TypeError('RSA-OAEP key "usages" must include "encrypt" or "wrapKey" for this operation')})(e,r,s);break;case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":{s=n||hi(t);const{p2c:c,p2s:u}=i;({encryptedKey:o,...a}=await(async(e,t,r,n=2048,i=Rn(new Uint8Array(16)))=>{const o=await si(i,e,n,t);return{encryptedKey:await ni(e.slice(-6),o,r),p2c:n,p2s:vn(i)}})(e,r,s,c,u));break}case"A128KW":case"A192KW":case"A256KW":s=n||hi(t),o=await ni(e,r,s);break;case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":{s=n||hi(t);const{iv:c}=i;({encryptedKey:o,...a}=await async function(e,t,r,n){const i=e.slice(0,7);n||(n=On(i));const{ciphertext:o,tag:a}=await yi(i,r,t,n,new Uint8Array(0));return{encryptedKey:o,iv:vn(n),tag:vn(a)}}(e,r,s,c));break}default:throw new Pn('Invalid or unsupported "alg" (JWE Algorithm) header value')}return{cek:s,encryptedKey:o,parameters:a}}const Pi=Symbol();class xi{constructor(e){if(!(e instanceof Uint8Array))throw new TypeError("plaintext must be an instance of Uint8Array");this._plaintext=e}setKeyManagementParameters(e){if(this._keyManagementParameters)throw new TypeError("setKeyManagementParameters can only be called once");return this._keyManagementParameters=e,this}setProtectedHeader(e){if(this._protectedHeader)throw new TypeError("setProtectedHeader can only be called once");return this._protectedHeader=e,this}setSharedUnprotectedHeader(e){if(this._sharedUnprotectedHeader)throw new TypeError("setSharedUnprotectedHeader can only be called once");return this._sharedUnprotectedHeader=e,this}setUnprotectedHeader(e){if(this._unprotectedHeader)throw new TypeError("setUnprotectedHeader can only be called once");return this._unprotectedHeader=e,this}setAdditionalAuthenticatedData(e){return this._aad=e,this}setContentEncryptionKey(e){if(this._cek)throw new TypeError("setContentEncryptionKey can only be called once");return this._cek=e,this}setInitializationVector(e){if(this._iv)throw new TypeError("setInitializationVector can only be called once");return this._iv=e,this}async encrypt(e,t){if(!this._protectedHeader&&!this._unprotectedHeader&&!this._sharedUnprotectedHeader)throw new kn("either setProtectedHeader, setUnprotectedHeader, or sharedUnprotectedHeader must be called before #encrypt()");if(!Qn(this._protectedHeader,this._unprotectedHeader,this._sharedUnprotectedHeader))throw new kn("JWE Protected, JWE Shared Unprotected and JWE Per-Recipient Header Parameter names must be disjoint");const r={...this._protectedHeader,...this._unprotectedHeader,...this._sharedUnprotectedHeader};if(vi(kn,new Map,null==t?void 0:t.crit,this._protectedHeader,r),void 0!==r.zip){if(!this._protectedHeader||!this._protectedHeader.zip)throw new kn('JWE "zip" (Compression Algorithm) Header MUST be integrity protected');if("DEF"!==r.zip)throw new Pn('Unsupported JWE "zip" (Compression Algorithm) Header Parameter value')}const{alg:n,enc:i}=r;if("string"!=typeof n||!n)throw new kn('JWE "alg" (Algorithm) Header Parameter missing or invalid');if("string"!=typeof i||!i)throw new kn('JWE "enc" (Encryption Algorithm) Header Parameter missing or invalid');let o,a,s,c,u,f,d;if("dir"===n){if(this._cek)throw new TypeError("setContentEncryptionKey cannot be called when using Direct Encryption")}else if("ECDH-ES"===n&&this._cek)throw new TypeError("setContentEncryptionKey cannot be called when using Direct Key Agreement");{let r;({cek:a,encryptedKey:o,parameters:r}=await Si(n,i,e,this._cek,this._keyManagementParameters)),r&&(t&&Pi in t?this._unprotectedHeader?this._unprotectedHeader={...this._unprotectedHeader,...r}:this.setUnprotectedHeader(r):this._protectedHeader?this._protectedHeader={...this._protectedHeader,...r}:this.setProtectedHeader(r))}if(this._iv||(this._iv=On(i)),c=this._protectedHeader?dn.encode(vn(JSON.stringify(this._protectedHeader))):dn.encode(""),this._aad?(u=vn(this._aad),s=pn(c,dn.encode("."),dn.encode(u))):s=c,"DEF"===r.zip){const e=await((null==t?void 0:t.deflateRaw)||Xn)(this._plaintext);({ciphertext:f,tag:d}=await yi(i,e,a,this._iv,s))}else({ciphertext:f,tag:d}=await yi(i,this._plaintext,a,this._iv,s));const l={ciphertext:vn(f),iv:vn(this._iv),tag:vn(d)};return o&&(l.encrypted_key=vn(o)),u&&(l.aad=u),this._protectedHeader&&(l.protected=ln.decode(c)),this._sharedUnprotectedHeader&&(l.unprotected=this._sharedUnprotectedHeader),this._unprotectedHeader&&(l.header=this._unprotectedHeader),l}}function ki(e,t){const r=`SHA-${e.slice(-3)}`;switch(e){case"HS256":case"HS384":case"HS512":return{hash:r,name:"HMAC"};case"PS256":case"PS384":case"PS512":return{hash:r,name:"RSA-PSS",saltLength:e.slice(-3)>>3};case"RS256":case"RS384":case"RS512":return{hash:r,name:"RSASSA-PKCS1-v1_5"};case"ES256":case"ES384":case"ES512":return{hash:r,name:"ECDSA",namedCurve:t.namedCurve};case"EdDSA":return Dn()&&"NODE-ED25519"===t.name?{name:"NODE-ED25519",namedCurve:"NODE-ED25519"}:{name:t.name};default:throw new Pn(`alg ${e} is not supported either by JOSE or your javascript runtime`)}}function Mi(e,t,r){if(un(t))return Un(t,e,r),t;if(t instanceof Uint8Array){if(!e.startsWith("HS"))throw new TypeError(Hn(t,...Wn));return cn.subtle.importKey("raw",t,{hash:`SHA-${e.slice(-3)}`,name:"HMAC"},!1,[r])}throw new TypeError(Hn(t,...Wn,"Uint8Array"))}const Ci=async(e,t,r,n)=>{const i=await Mi(e,t,"verify");fi(e,i);const o=ki(e,i.algorithm);try{return await cn.subtle.verify(o,i,r,n)}catch(e){return!1}};async function Ii(e,t,r){var n;if(!Yn(e))throw new Mn("Flattened JWS must be an object");if(void 0===e.protected&&void 0===e.header)throw new Mn('Flattened JWS must have either of the "protected" or "header" members');if(void 0!==e.protected&&"string"!=typeof e.protected)throw new Mn("JWS Protected Header incorrect type");if(void 0===e.payload)throw new Mn("JWS Payload missing");if("string"!=typeof e.signature)throw new Mn("JWS Signature missing or incorrect type");if(void 0!==e.header&&!Yn(e.header))throw new Mn("JWS Unprotected Header incorrect type");let i={};if(e.protected)try{const t=wn(e.protected);i=JSON.parse(ln.decode(t))}catch(e){throw new Mn("JWS Protected Header is invalid")}if(!Qn(i,e.header))throw new Mn("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");const o={...i,...e.header};let a=!0;if(vi(Mn,new Map([["b64",!0]]),null==r?void 0:r.crit,i,o).has("b64")&&(a=i.b64,"boolean"!=typeof a))throw new Mn('The "b64" (base64url-encode payload) Header Parameter must be a boolean');const{alg:s}=o;if("string"!=typeof s||!s)throw new Mn('JWS "alg" (Algorithm) Header Parameter missing or invalid');const c=r&&wi("algorithms",r.algorithms);if(c&&!c.has(s))throw new Sn('"alg" (Algorithm) Header Parameter not allowed');if(a){if("string"!=typeof e.payload)throw new Mn("JWS Payload must be a string")}else if("string"!=typeof e.payload&&!(e.payload instanceof Uint8Array))throw new Mn("JWS Payload must be a string or an Uint8Array instance");let u=!1;"function"==typeof t&&(t=await t(i,e),u=!0),gi(s,t,"verify");const f=pn(dn.encode(null!==(n=e.protected)&&void 0!==n?n:""),dn.encode("."),"string"==typeof e.payload?dn.encode(e.payload):e.payload),d=wn(e.signature);if(!await Ci(s,t,d,f))throw new In;let l;l=a?wn(e.payload):"string"==typeof e.payload?dn.encode(e.payload):e.payload;const h={payload:l};return void 0!==e.protected&&(h.protectedHeader=i),void 0!==e.header&&(h.unprotectedHeader=e.header),u?{...h,key:t}:h}var Ri=e=>Math.floor(e.getTime()/1e3);const Ni=86400,Oi=/^(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)$/i;var Ti=e=>{const t=Oi.exec(e);if(!t)throw new TypeError("Invalid time period format");const r=parseFloat(t[1]);switch(t[2].toLowerCase()){case"sec":case"secs":case"second":case"seconds":case"s":return Math.round(r);case"minute":case"minutes":case"min":case"mins":case"m":return Math.round(60*r);case"hour":case"hours":case"hr":case"hrs":case"h":return Math.round(3600*r);case"day":case"days":case"d":return Math.round(r*Ni);case"week":case"weeks":case"w":return Math.round(604800*r);default:return Math.round(31557600*r)}};const ji=e=>e.toLowerCase().replace(/^application\//,"");var Di=(e,t,r={})=>{const{typ:n}=r;if(n&&("string"!=typeof e.typ||ji(e.typ)!==ji(n)))throw new _n('unexpected "typ" JWT header value',"typ","check_failed");let i;try{i=JSON.parse(ln.decode(t))}catch(e){}if(!Yn(i))throw new Cn("JWT Claims Set must be a top-level JSON object");const{issuer:o}=r;if(o&&!(Array.isArray(o)?o:[o]).includes(i.iss))throw new _n('unexpected "iss" claim value',"iss","check_failed");const{subject:a}=r;if(a&&i.sub!==a)throw new _n('unexpected "sub" claim value',"sub","check_failed");const{audience:s}=r;if(s&&(c=i.aud,u="string"==typeof s?[s]:s,!("string"==typeof c?u.includes(c):Array.isArray(c)&&u.some(Set.prototype.has.bind(new Set(c))))))throw new _n('unexpected "aud" claim value',"aud","check_failed");var c,u;let f;switch(typeof r.clockTolerance){case"string":f=Ti(r.clockTolerance);break;case"number":f=r.clockTolerance;break;case"undefined":f=0;break;default:throw new TypeError("Invalid clockTolerance option type")}const{currentDate:d}=r,l=Ri(d||new Date);if((void 0!==i.iat||r.maxTokenAge)&&"number"!=typeof i.iat)throw new _n('"iat" claim must be a number',"iat","invalid");if(void 0!==i.nbf){if("number"!=typeof i.nbf)throw new _n('"nbf" claim must be a number',"nbf","invalid");if(i.nbf>l+f)throw new _n('"nbf" claim timestamp check failed',"nbf","check_failed")}if(void 0!==i.exp){if("number"!=typeof i.exp)throw new _n('"exp" claim must be a number',"exp","invalid");if(i.exp<=l-f)throw new En('"exp" claim timestamp check failed',"exp","check_failed")}if(r.maxTokenAge){const e=l-i.iat;if(e-f>("number"==typeof r.maxTokenAge?r.maxTokenAge:Ti(r.maxTokenAge)))throw new En('"iat" claim timestamp check failed (too far in the past)',"iat","check_failed");if(e<0-f)throw new _n('"iat" claim timestamp check failed (it should be in the past)',"iat","check_failed")}return i};async function $i(e,t,r){var n;const i=await async function(e,t,r){if(e instanceof Uint8Array&&(e=ln.decode(e)),"string"!=typeof e)throw new Mn("Compact JWS must be a string or Uint8Array");const{0:n,1:i,2:o,length:a}=e.split(".");if(3!==a)throw new Mn("Invalid Compact JWS");const s=await Ii({payload:i,protected:n,signature:o},t,r),c={payload:s.payload,protectedHeader:s.protectedHeader};return"function"==typeof t?{...c,key:s.key}:c}(e,t,r);if((null===(n=i.protectedHeader.crit)||void 0===n?void 0:n.includes("b64"))&&!1===i.protectedHeader.b64)throw new Cn("JWTs MUST NOT use unencoded payload");const o={payload:Di(i.protectedHeader,i.payload,r),protectedHeader:i.protectedHeader};return"function"==typeof t?{...o,key:i.key}:o}class Bi{constructor(e){this._flattened=new xi(e)}setContentEncryptionKey(e){return this._flattened.setContentEncryptionKey(e),this}setInitializationVector(e){return this._flattened.setInitializationVector(e),this}setProtectedHeader(e){return this._flattened.setProtectedHeader(e),this}setKeyManagementParameters(e){return this._flattened.setKeyManagementParameters(e),this}async encrypt(e,t){const r=await this._flattened.encrypt(e,t);return[r.protected,r.encrypted_key,r.iv,r.ciphertext,r.tag].join(".")}}class Fi{constructor(e){if(!(e instanceof Uint8Array))throw new TypeError("payload must be an instance of Uint8Array");this._payload=e}setProtectedHeader(e){if(this._protectedHeader)throw new TypeError("setProtectedHeader can only be called once");return this._protectedHeader=e,this}setUnprotectedHeader(e){if(this._unprotectedHeader)throw new TypeError("setUnprotectedHeader can only be called once");return this._unprotectedHeader=e,this}async sign(e,t){if(!this._protectedHeader&&!this._unprotectedHeader)throw new Mn("either setProtectedHeader or setUnprotectedHeader must be called before #sign()");if(!Qn(this._protectedHeader,this._unprotectedHeader))throw new Mn("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");const r={...this._protectedHeader,...this._unprotectedHeader};let n=!0;if(vi(Mn,new Map([["b64",!0]]),null==t?void 0:t.crit,this._protectedHeader,r).has("b64")&&(n=this._protectedHeader.b64,"boolean"!=typeof n))throw new Mn('The "b64" (base64url-encode payload) Header Parameter must be a boolean');const{alg:i}=r;if("string"!=typeof i||!i)throw new Mn('JWS "alg" (Algorithm) Header Parameter missing or invalid');gi(i,e,"sign");let o,a=this._payload;n&&(a=dn.encode(vn(a))),o=this._protectedHeader?dn.encode(vn(JSON.stringify(this._protectedHeader))):dn.encode("");const s=pn(o,dn.encode("."),a),c=await(async(e,t,r)=>{const n=await Mi(e,t,"sign");fi(e,n);const i=await cn.subtle.sign(ki(e,n.algorithm),n,r);return new Uint8Array(i)})(i,e,s),u={signature:vn(c),payload:""};return n&&(u.payload=ln.decode(a)),this._unprotectedHeader&&(u.header=this._unprotectedHeader),this._protectedHeader&&(u.protected=ln.decode(o)),u}}class zi{constructor(e){this._flattened=new Fi(e)}setProtectedHeader(e){return this._flattened.setProtectedHeader(e),this}async sign(e,t){const r=await this._flattened.sign(e,t);if(void 0===r.payload)throw new TypeError("use the flattened module for creating JWS with b64: false");return`${r.protected}.${r.payload}.${r.signature}`}}class Ui{constructor(e,t,r){this.parent=e,this.key=t,this.options=r}setProtectedHeader(e){if(this.protectedHeader)throw new TypeError("setProtectedHeader can only be called once");return this.protectedHeader=e,this}setUnprotectedHeader(e){if(this.unprotectedHeader)throw new TypeError("setUnprotectedHeader can only be called once");return this.unprotectedHeader=e,this}addSignature(...e){return this.parent.addSignature(...e)}sign(...e){return this.parent.sign(...e)}done(){return this.parent}}class Li{constructor(e){this._signatures=[],this._payload=e}addSignature(e,t){const r=new Ui(this,e,t);return this._signatures.push(r),r}async sign(){if(!this._signatures.length)throw new Mn("at least one signature must be added");const e={signatures:[],payload:""};for(let t=0;t>3));case"A128KW":case"A192KW":case"A256KW":n=parseInt(e.slice(1,4),10),i={name:"AES-KW",length:n},o=["wrapKey","unwrapKey"];break;case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":case"A128GCM":case"A192GCM":case"A256GCM":n=parseInt(e.slice(1,4),10),i={name:"AES-GCM",length:n},o=["encrypt","decrypt"];break;default:throw new Pn('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}return cn.subtle.generateKey(i,null!==(r=null==t?void 0:t.extractable)&&void 0!==r&&r,o)}(e,t)}async function Wi(e,t){const r=void 0===t?e.alg:t,n=nn.concat(rn).concat(on);if(!n.includes(r))throw new an("invalid alg. Must be one of: "+n.join(","),["invalid algorithm"]);try{const r=await mi(e,t);if(null==r)throw new an(new Error("failed importing keys"),["invalid key"]);return r}catch(e){throw new an(e,["invalid key"])}}async function Gi(e,t,r){let n,i;const o={...t};if(nn.includes(t.alg))n="dir",i=void 0!==r?r:t.alg;else{if(!rn.concat(on).includes(t.alg))throw new an(`Not a valid symmetric or assymetric alg: ${t.alg}`,["encryption failed","invalid key","invalid algorithm"]);if(void 0===r)throw new an("An encryption algorith encAlg for content encryption should be provided. Allowed values are: "+nn.join(","),["encryption failed"]);i=r,n="ECDH-ES",o.alg=n}const a=await Wi(o);let s;try{return s=await new Bi(e).setProtectedHeader({alg:n,enc:i,kid:t.kid}).encrypt(a),s}catch(e){throw new an(e,["encryption failed"])}}async function Vi(e,t){try{const r={...t},{alg:n,enc:i}=function(e){let t;if("string"==typeof e){const r=e.split(".");3!==r.length&&5!==r.length||([t]=r)}else if("object"==typeof e&&e){if(!("protected"in e))throw new TypeError("Token does not contain a Protected Header");t=e.protected}try{if("string"!=typeof t||!t)throw new Error;const e=JSON.parse(ln.decode(Ki(t)));if(!Yn(e))throw new Error;return e}catch(e){throw new TypeError("Invalid Token or Protected Header formatting")}}(e);if(void 0===n||void 0===i)throw new an("missing enc or alg in jwe header",["invalid format"]);"ECDH-ES"===n&&(r.alg=n);const o=await Wi(r);return await Ai(e,o,{contentEncryptionAlgorithms:[i]})}catch(e){throw new an(e,["decryption failed"])}}async function Zi(e,t){const r=e.match(/^([a-zA-Z0-9_-]+)\.{1,2}([a-zA-Z0-9_-]+)\.([a-zA-Z0-9_-]+)$/);if(null===r)throw new an(new Error(`${e} is not a JWS`),["not a compact jws"]);let n,o;try{n=JSON.parse(i(r[1],!0)),o=JSON.parse(i(r[2],!0))}catch(e){throw new an(e,["invalid format","not a compact jws"])}if(void 0!==t){const r="function"==typeof t?await t(n,o):t,i=await Wi(r);try{const t=await $i(e,i);return{header:t.protectedHeader,payload:t.payload,signer:r}}catch(e){throw new an(e,["jws verification failed"])}}return{header:n,payload:o}}function Xi(e){if(nn.concat(tn).concat(rn).includes(e))return Number(e.match(/\d{3}/)[0])/8;throw new an("unsupported algorithm",["invalid algorithm"])}async function Qi(e,t,r){let n;if(!nn.includes(e))throw new an(new Error(`Invalid encAlg '${e}'. Supported values are: ${nn.toString()}`),["invalid algorithm"]);const c=Xi(e);if(void 0!==t){if("string"==typeof t)if(!0===r)n=i(t);else{const e=o(t,!1);if(e!==o(t,!1,c))throw new an(new RangeError(`Expected hex length ${2*c} does not meet provided one ${e.length/2}`),["invalid key"]);n=new Uint8Array(s(t))}else n=t;if(n.length!==c)throw new an(new RangeError(`Expected secret length ${c} does not meet provided one ${n.length}`),["invalid key"])}else try{n=await Ji(e,{extractable:!0})}catch(e){throw new an(e,["unexpected error"])}const u=await Ei(n);return u.alg=e,{jwk:u,hex:a(i(u.k),!1,c)}}async function Yi(e,t){if(void 0===e.alg||void 0===t.alg||e.alg!==t.alg)throw new Error("alg no present in either pubJwk or privJwk, or pubJWK.alg != privJWK.alg");const r=await Wi(e),n=await Wi(t);try{const e=await c(16),i=await new Li(e).addSignature(n).setProtectedHeader({alg:t.alg}).sign();await async function(e,t,r){if(!Yn(e))throw new Mn("General JWS must be an object");if(!Array.isArray(e.signatures)||!e.signatures.every(Yn))throw new Mn("JWS Signatures missing or incorrect type");for(const n of e.signatures)try{return await Ii({header:n.header,payload:e.payload,protected:n.protected,signature:n.signature},t,r)}catch(e){}throw new In}(i,r)}catch(e){throw new an(e,["unexpected error"])}}function eo(e){return null!=e&&"object"==typeof e&&!Array.isArray(e)}function to(e){return eo(e)||Array.isArray(e)?Array.isArray(e)?e.map((e=>Array.isArray(e)||eo(e)?to(e):e)):Object.keys(e).sort().map((t=>[t,to(e[t])])):e}function ro(e){return JSON.stringify(to(e))}function no(e,t,r,n=2e3){if(er+n)throw new an(new Error(`timestamp ${new Date(e).toTimeString()} after 'notAfter' ${new Date(r).toTimeString()} with tolerance of ${n/1e3}s`),["invalid timestamp"])}function io(e){return Array.isArray(e)?e.sort().map(io):(t=e,"[object Object]"===Object.prototype.toString.call(t)?Object.keys(e).sort().reduce((function(t,r){return t[r]=io(e[r]),t}),{}):e);var t}function oo(e,t=!1,r){try{return o(e,t,r)}catch(e){throw new an(e,["invalid format"])}}async function ao(e,t){try{await Wi(e,e.alg);const r=io(e);return t?JSON.stringify(r):r}catch(e){throw new an(e,["invalid key"])}}async function so(e,t){const r=tn;if(!r.includes(t))throw new an(new RangeError(`Valid hash algorith values are any of ${JSON.stringify(r)}`),["invalid algorithm"]);const n=new TextEncoder,i="string"==typeof e?n.encode(e).buffer:e;try{let e;return e=new Uint8Array(await crypto.subtle.digest(t,i)),e}catch(e){throw new an(e,["unexpected error"])}}var co={exports:{}};!function(e){!function(e,t){function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function n(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function i(e,t,r){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var o;"object"==typeof e?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:g.Buffer}catch(e){}function a(e,t){var n=e.charCodeAt(t);return n>=48&&n<=57?n-48:n>=65&&n<=70?n-55:n>=97&&n<=102?n-87:void r(!1,"Invalid character in "+e)}function s(e,t,r){var n=a(e,r);return r-1>=t&&(n|=a(e,r-1)<<4),n}function c(e,t,n,i){for(var o=0,a=0,s=Math.min(e.length,n),c=t;c=49?u-49+10:u>=17?u-17+10:u,r(u>=0&&a0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,n){if("number"==typeof e)return this._initNumber(e,t,n);if("object"==typeof e)return this._initArray(e,t,n);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)a=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===n)for(i=0,o=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this._strip()},i.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n=t;n-=2)i=s(e,t,n)<=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(n=(e.length-t)%2==0?t+1:t;n=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this._strip()},i.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,a=o%n,s=Math.min(o,o-a)+r,u=0,f=r;f1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=f}catch(e){i.prototype.inspect=f}else i.prototype.inspect=f;function f(){return(this.red?""}var d=["","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"],l=[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];i.prototype.toString=function(e,t){var n;if(t=0|t||1,16===(e=e||10)||"hex"===e){n="";for(var i=0,o=0,a=0;a>>24-i&16777215,(i+=2)>=26&&(i-=26,a--),n=0!==o||a!==this.length-1?d[6-c.length]+c+n:c+n}for(0!==o&&(n=o.toString(16)+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(e===(0|e)&&e>=2&&e<=36){var u=l[e],f=h[e];n="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modrn(f).toString(e);n=(p=p.idivn(f)).isZero()?m+n:d[u-m.length]+m+n}for(this.isZero()&&(n="0"+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},i.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&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16,2)},o&&(i.prototype.toBuffer=function(e,t){return this.toArrayLike(o,e,t)}),i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)};function p(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],a=i*o,s=67108863&a,c=a/67108864|0;r.words[0]=s;for(var u=1;u>>26,d=67108863&c,l=Math.min(u,t.length-1),h=Math.max(0,u-e.length+1);h<=l;h++){var p=u-h|0;f+=(a=(i=0|e.words[p])*(o=0|t.words[h])+d)/67108864|0,d=67108863&a}r.words[u]=0|d,c=0|f}return 0!==c?r.words[u]=0|c:r.length--,r._strip()}i.prototype.toArrayLike=function(e,t,n){this._strip();var i=this.byteLength(),o=n||Math.max(1,i);r(i<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0");var a=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,o);return this["_toArrayLike"+("le"===t?"LE":"BE")](a,i),a},i.prototype._toArrayLikeLE=function(e,t){for(var r=0,n=0,i=0,o=0;i>8&255),r>16&255),6===o?(r>24&255),n=0,o=0):(n=a>>>24,o+=2)}if(r=0&&(e[r--]=a>>8&255),r>=0&&(e[r--]=a>>16&255),6===o?(r>=0&&(e[r--]=a>>24&255),n=0,o=0):(n=a>>>24,o+=2)}if(r>=0)for(e[r--]=n;r>=0;)e[r--]=0},Math.clz32?i.prototype._countBits=function(e){return 32-Math.clz32(e)}:i.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){r("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),n>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-n),this._strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){r("number"==typeof e&&e>=0);var n=e/26|0,i=e%26;return this._expand(n+1),this.words[n]=t?this.words[n]|1<e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},i.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,a=0;a>26,this.words[a]=67108863&t;for(;0!==o&&a>26,this.words[a]=67108863&t;if(0===o&&a>>13,h=0|a[1],p=8191&h,m=h>>>13,g=0|a[2],y=8191&g,b=g>>>13,v=0|a[3],w=8191&v,A=v>>>13,_=0|a[4],E=8191&_,S=_>>>13,P=0|a[5],x=8191&P,k=P>>>13,M=0|a[6],C=8191&M,I=M>>>13,R=0|a[7],N=8191&R,O=R>>>13,T=0|a[8],j=8191&T,D=T>>>13,$=0|a[9],B=8191&$,F=$>>>13,z=0|s[0],U=8191&z,L=z>>>13,q=0|s[1],H=8191&q,K=q>>>13,J=0|s[2],W=8191&J,G=J>>>13,V=0|s[3],Z=8191&V,X=V>>>13,Q=0|s[4],Y=8191&Q,ee=Q>>>13,te=0|s[5],re=8191&te,ne=te>>>13,ie=0|s[6],oe=8191&ie,ae=ie>>>13,se=0|s[7],ce=8191&se,ue=se>>>13,fe=0|s[8],de=8191&fe,le=fe>>>13,he=0|s[9],pe=8191&he,me=he>>>13;r.negative=e.negative^t.negative,r.length=19;var ge=(u+(n=Math.imul(d,U))|0)+((8191&(i=(i=Math.imul(d,L))+Math.imul(l,U)|0))<<13)|0;u=((o=Math.imul(l,L))+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(p,U),i=(i=Math.imul(p,L))+Math.imul(m,U)|0,o=Math.imul(m,L);var ye=(u+(n=n+Math.imul(d,H)|0)|0)+((8191&(i=(i=i+Math.imul(d,K)|0)+Math.imul(l,H)|0))<<13)|0;u=((o=o+Math.imul(l,K)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(y,U),i=(i=Math.imul(y,L))+Math.imul(b,U)|0,o=Math.imul(b,L),n=n+Math.imul(p,H)|0,i=(i=i+Math.imul(p,K)|0)+Math.imul(m,H)|0,o=o+Math.imul(m,K)|0;var be=(u+(n=n+Math.imul(d,W)|0)|0)+((8191&(i=(i=i+Math.imul(d,G)|0)+Math.imul(l,W)|0))<<13)|0;u=((o=o+Math.imul(l,G)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(w,U),i=(i=Math.imul(w,L))+Math.imul(A,U)|0,o=Math.imul(A,L),n=n+Math.imul(y,H)|0,i=(i=i+Math.imul(y,K)|0)+Math.imul(b,H)|0,o=o+Math.imul(b,K)|0,n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(m,W)|0,o=o+Math.imul(m,G)|0;var ve=(u+(n=n+Math.imul(d,Z)|0)|0)+((8191&(i=(i=i+Math.imul(d,X)|0)+Math.imul(l,Z)|0))<<13)|0;u=((o=o+Math.imul(l,X)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(E,U),i=(i=Math.imul(E,L))+Math.imul(S,U)|0,o=Math.imul(S,L),n=n+Math.imul(w,H)|0,i=(i=i+Math.imul(w,K)|0)+Math.imul(A,H)|0,o=o+Math.imul(A,K)|0,n=n+Math.imul(y,W)|0,i=(i=i+Math.imul(y,G)|0)+Math.imul(b,W)|0,o=o+Math.imul(b,G)|0,n=n+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,X)|0;var we=(u+(n=n+Math.imul(d,Y)|0)|0)+((8191&(i=(i=i+Math.imul(d,ee)|0)+Math.imul(l,Y)|0))<<13)|0;u=((o=o+Math.imul(l,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(x,U),i=(i=Math.imul(x,L))+Math.imul(k,U)|0,o=Math.imul(k,L),n=n+Math.imul(E,H)|0,i=(i=i+Math.imul(E,K)|0)+Math.imul(S,H)|0,o=o+Math.imul(S,K)|0,n=n+Math.imul(w,W)|0,i=(i=i+Math.imul(w,G)|0)+Math.imul(A,W)|0,o=o+Math.imul(A,G)|0,n=n+Math.imul(y,Z)|0,i=(i=i+Math.imul(y,X)|0)+Math.imul(b,Z)|0,o=o+Math.imul(b,X)|0,n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(m,Y)|0,o=o+Math.imul(m,ee)|0;var Ae=(u+(n=n+Math.imul(d,re)|0)|0)+((8191&(i=(i=i+Math.imul(d,ne)|0)+Math.imul(l,re)|0))<<13)|0;u=((o=o+Math.imul(l,ne)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(C,U),i=(i=Math.imul(C,L))+Math.imul(I,U)|0,o=Math.imul(I,L),n=n+Math.imul(x,H)|0,i=(i=i+Math.imul(x,K)|0)+Math.imul(k,H)|0,o=o+Math.imul(k,K)|0,n=n+Math.imul(E,W)|0,i=(i=i+Math.imul(E,G)|0)+Math.imul(S,W)|0,o=o+Math.imul(S,G)|0,n=n+Math.imul(w,Z)|0,i=(i=i+Math.imul(w,X)|0)+Math.imul(A,Z)|0,o=o+Math.imul(A,X)|0,n=n+Math.imul(y,Y)|0,i=(i=i+Math.imul(y,ee)|0)+Math.imul(b,Y)|0,o=o+Math.imul(b,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(m,re)|0,o=o+Math.imul(m,ne)|0;var _e=(u+(n=n+Math.imul(d,oe)|0)|0)+((8191&(i=(i=i+Math.imul(d,ae)|0)+Math.imul(l,oe)|0))<<13)|0;u=((o=o+Math.imul(l,ae)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(N,U),i=(i=Math.imul(N,L))+Math.imul(O,U)|0,o=Math.imul(O,L),n=n+Math.imul(C,H)|0,i=(i=i+Math.imul(C,K)|0)+Math.imul(I,H)|0,o=o+Math.imul(I,K)|0,n=n+Math.imul(x,W)|0,i=(i=i+Math.imul(x,G)|0)+Math.imul(k,W)|0,o=o+Math.imul(k,G)|0,n=n+Math.imul(E,Z)|0,i=(i=i+Math.imul(E,X)|0)+Math.imul(S,Z)|0,o=o+Math.imul(S,X)|0,n=n+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(A,Y)|0,o=o+Math.imul(A,ee)|0,n=n+Math.imul(y,re)|0,i=(i=i+Math.imul(y,ne)|0)+Math.imul(b,re)|0,o=o+Math.imul(b,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,ae)|0)+Math.imul(m,oe)|0,o=o+Math.imul(m,ae)|0;var Ee=(u+(n=n+Math.imul(d,ce)|0)|0)+((8191&(i=(i=i+Math.imul(d,ue)|0)+Math.imul(l,ce)|0))<<13)|0;u=((o=o+Math.imul(l,ue)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(j,U),i=(i=Math.imul(j,L))+Math.imul(D,U)|0,o=Math.imul(D,L),n=n+Math.imul(N,H)|0,i=(i=i+Math.imul(N,K)|0)+Math.imul(O,H)|0,o=o+Math.imul(O,K)|0,n=n+Math.imul(C,W)|0,i=(i=i+Math.imul(C,G)|0)+Math.imul(I,W)|0,o=o+Math.imul(I,G)|0,n=n+Math.imul(x,Z)|0,i=(i=i+Math.imul(x,X)|0)+Math.imul(k,Z)|0,o=o+Math.imul(k,X)|0,n=n+Math.imul(E,Y)|0,i=(i=i+Math.imul(E,ee)|0)+Math.imul(S,Y)|0,o=o+Math.imul(S,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(A,re)|0,o=o+Math.imul(A,ne)|0,n=n+Math.imul(y,oe)|0,i=(i=i+Math.imul(y,ae)|0)+Math.imul(b,oe)|0,o=o+Math.imul(b,ae)|0,n=n+Math.imul(p,ce)|0,i=(i=i+Math.imul(p,ue)|0)+Math.imul(m,ce)|0,o=o+Math.imul(m,ue)|0;var Se=(u+(n=n+Math.imul(d,de)|0)|0)+((8191&(i=(i=i+Math.imul(d,le)|0)+Math.imul(l,de)|0))<<13)|0;u=((o=o+Math.imul(l,le)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(B,U),i=(i=Math.imul(B,L))+Math.imul(F,U)|0,o=Math.imul(F,L),n=n+Math.imul(j,H)|0,i=(i=i+Math.imul(j,K)|0)+Math.imul(D,H)|0,o=o+Math.imul(D,K)|0,n=n+Math.imul(N,W)|0,i=(i=i+Math.imul(N,G)|0)+Math.imul(O,W)|0,o=o+Math.imul(O,G)|0,n=n+Math.imul(C,Z)|0,i=(i=i+Math.imul(C,X)|0)+Math.imul(I,Z)|0,o=o+Math.imul(I,X)|0,n=n+Math.imul(x,Y)|0,i=(i=i+Math.imul(x,ee)|0)+Math.imul(k,Y)|0,o=o+Math.imul(k,ee)|0,n=n+Math.imul(E,re)|0,i=(i=i+Math.imul(E,ne)|0)+Math.imul(S,re)|0,o=o+Math.imul(S,ne)|0,n=n+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,ae)|0)+Math.imul(A,oe)|0,o=o+Math.imul(A,ae)|0,n=n+Math.imul(y,ce)|0,i=(i=i+Math.imul(y,ue)|0)+Math.imul(b,ce)|0,o=o+Math.imul(b,ue)|0,n=n+Math.imul(p,de)|0,i=(i=i+Math.imul(p,le)|0)+Math.imul(m,de)|0,o=o+Math.imul(m,le)|0;var Pe=(u+(n=n+Math.imul(d,pe)|0)|0)+((8191&(i=(i=i+Math.imul(d,me)|0)+Math.imul(l,pe)|0))<<13)|0;u=((o=o+Math.imul(l,me)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(B,H),i=(i=Math.imul(B,K))+Math.imul(F,H)|0,o=Math.imul(F,K),n=n+Math.imul(j,W)|0,i=(i=i+Math.imul(j,G)|0)+Math.imul(D,W)|0,o=o+Math.imul(D,G)|0,n=n+Math.imul(N,Z)|0,i=(i=i+Math.imul(N,X)|0)+Math.imul(O,Z)|0,o=o+Math.imul(O,X)|0,n=n+Math.imul(C,Y)|0,i=(i=i+Math.imul(C,ee)|0)+Math.imul(I,Y)|0,o=o+Math.imul(I,ee)|0,n=n+Math.imul(x,re)|0,i=(i=i+Math.imul(x,ne)|0)+Math.imul(k,re)|0,o=o+Math.imul(k,ne)|0,n=n+Math.imul(E,oe)|0,i=(i=i+Math.imul(E,ae)|0)+Math.imul(S,oe)|0,o=o+Math.imul(S,ae)|0,n=n+Math.imul(w,ce)|0,i=(i=i+Math.imul(w,ue)|0)+Math.imul(A,ce)|0,o=o+Math.imul(A,ue)|0,n=n+Math.imul(y,de)|0,i=(i=i+Math.imul(y,le)|0)+Math.imul(b,de)|0,o=o+Math.imul(b,le)|0;var xe=(u+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,me)|0)+Math.imul(m,pe)|0))<<13)|0;u=((o=o+Math.imul(m,me)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(B,W),i=(i=Math.imul(B,G))+Math.imul(F,W)|0,o=Math.imul(F,G),n=n+Math.imul(j,Z)|0,i=(i=i+Math.imul(j,X)|0)+Math.imul(D,Z)|0,o=o+Math.imul(D,X)|0,n=n+Math.imul(N,Y)|0,i=(i=i+Math.imul(N,ee)|0)+Math.imul(O,Y)|0,o=o+Math.imul(O,ee)|0,n=n+Math.imul(C,re)|0,i=(i=i+Math.imul(C,ne)|0)+Math.imul(I,re)|0,o=o+Math.imul(I,ne)|0,n=n+Math.imul(x,oe)|0,i=(i=i+Math.imul(x,ae)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,ae)|0,n=n+Math.imul(E,ce)|0,i=(i=i+Math.imul(E,ue)|0)+Math.imul(S,ce)|0,o=o+Math.imul(S,ue)|0,n=n+Math.imul(w,de)|0,i=(i=i+Math.imul(w,le)|0)+Math.imul(A,de)|0,o=o+Math.imul(A,le)|0;var ke=(u+(n=n+Math.imul(y,pe)|0)|0)+((8191&(i=(i=i+Math.imul(y,me)|0)+Math.imul(b,pe)|0))<<13)|0;u=((o=o+Math.imul(b,me)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(B,Z),i=(i=Math.imul(B,X))+Math.imul(F,Z)|0,o=Math.imul(F,X),n=n+Math.imul(j,Y)|0,i=(i=i+Math.imul(j,ee)|0)+Math.imul(D,Y)|0,o=o+Math.imul(D,ee)|0,n=n+Math.imul(N,re)|0,i=(i=i+Math.imul(N,ne)|0)+Math.imul(O,re)|0,o=o+Math.imul(O,ne)|0,n=n+Math.imul(C,oe)|0,i=(i=i+Math.imul(C,ae)|0)+Math.imul(I,oe)|0,o=o+Math.imul(I,ae)|0,n=n+Math.imul(x,ce)|0,i=(i=i+Math.imul(x,ue)|0)+Math.imul(k,ce)|0,o=o+Math.imul(k,ue)|0,n=n+Math.imul(E,de)|0,i=(i=i+Math.imul(E,le)|0)+Math.imul(S,de)|0,o=o+Math.imul(S,le)|0;var Me=(u+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,me)|0)+Math.imul(A,pe)|0))<<13)|0;u=((o=o+Math.imul(A,me)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(B,Y),i=(i=Math.imul(B,ee))+Math.imul(F,Y)|0,o=Math.imul(F,ee),n=n+Math.imul(j,re)|0,i=(i=i+Math.imul(j,ne)|0)+Math.imul(D,re)|0,o=o+Math.imul(D,ne)|0,n=n+Math.imul(N,oe)|0,i=(i=i+Math.imul(N,ae)|0)+Math.imul(O,oe)|0,o=o+Math.imul(O,ae)|0,n=n+Math.imul(C,ce)|0,i=(i=i+Math.imul(C,ue)|0)+Math.imul(I,ce)|0,o=o+Math.imul(I,ue)|0,n=n+Math.imul(x,de)|0,i=(i=i+Math.imul(x,le)|0)+Math.imul(k,de)|0,o=o+Math.imul(k,le)|0;var Ce=(u+(n=n+Math.imul(E,pe)|0)|0)+((8191&(i=(i=i+Math.imul(E,me)|0)+Math.imul(S,pe)|0))<<13)|0;u=((o=o+Math.imul(S,me)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(B,re),i=(i=Math.imul(B,ne))+Math.imul(F,re)|0,o=Math.imul(F,ne),n=n+Math.imul(j,oe)|0,i=(i=i+Math.imul(j,ae)|0)+Math.imul(D,oe)|0,o=o+Math.imul(D,ae)|0,n=n+Math.imul(N,ce)|0,i=(i=i+Math.imul(N,ue)|0)+Math.imul(O,ce)|0,o=o+Math.imul(O,ue)|0,n=n+Math.imul(C,de)|0,i=(i=i+Math.imul(C,le)|0)+Math.imul(I,de)|0,o=o+Math.imul(I,le)|0;var Ie=(u+(n=n+Math.imul(x,pe)|0)|0)+((8191&(i=(i=i+Math.imul(x,me)|0)+Math.imul(k,pe)|0))<<13)|0;u=((o=o+Math.imul(k,me)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(B,oe),i=(i=Math.imul(B,ae))+Math.imul(F,oe)|0,o=Math.imul(F,ae),n=n+Math.imul(j,ce)|0,i=(i=i+Math.imul(j,ue)|0)+Math.imul(D,ce)|0,o=o+Math.imul(D,ue)|0,n=n+Math.imul(N,de)|0,i=(i=i+Math.imul(N,le)|0)+Math.imul(O,de)|0,o=o+Math.imul(O,le)|0;var Re=(u+(n=n+Math.imul(C,pe)|0)|0)+((8191&(i=(i=i+Math.imul(C,me)|0)+Math.imul(I,pe)|0))<<13)|0;u=((o=o+Math.imul(I,me)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(B,ce),i=(i=Math.imul(B,ue))+Math.imul(F,ce)|0,o=Math.imul(F,ue),n=n+Math.imul(j,de)|0,i=(i=i+Math.imul(j,le)|0)+Math.imul(D,de)|0,o=o+Math.imul(D,le)|0;var Ne=(u+(n=n+Math.imul(N,pe)|0)|0)+((8191&(i=(i=i+Math.imul(N,me)|0)+Math.imul(O,pe)|0))<<13)|0;u=((o=o+Math.imul(O,me)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,n=Math.imul(B,de),i=(i=Math.imul(B,le))+Math.imul(F,de)|0,o=Math.imul(F,le);var Oe=(u+(n=n+Math.imul(j,pe)|0)|0)+((8191&(i=(i=i+Math.imul(j,me)|0)+Math.imul(D,pe)|0))<<13)|0;u=((o=o+Math.imul(D,me)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863;var Te=(u+(n=Math.imul(B,pe))|0)+((8191&(i=(i=Math.imul(B,me))+Math.imul(F,pe)|0))<<13)|0;return u=((o=Math.imul(F,me))+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,c[0]=ge,c[1]=ye,c[2]=be,c[3]=ve,c[4]=we,c[5]=Ae,c[6]=_e,c[7]=Ee,c[8]=Se,c[9]=Pe,c[10]=xe,c[11]=ke,c[12]=Me,c[13]=Ce,c[14]=Ie,c[15]=Re,c[16]=Ne,c[17]=Oe,c[18]=Te,0!==u&&(c[19]=u,r.length++),r};function y(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,a&=67108863}r.words[o]=s,n=a,a=i}return 0!==n?r.words[o]=n:r.length--,r._strip()}function b(e,t,r){return y(e,t,r)}Math.imul||(m=p),i.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?m(this,e,t):r<63?p(this,e,t):r<1024?y(this,e,t):b(this,e,t)},i.prototype.mul=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},i.prototype.mulf=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),b(this,e,t)},i.prototype.imul=function(e){return this.clone().mulTo(e,this)},i.prototype.imuln=function(e){var t=e<0;t&&(e=-e),r("number"==typeof e),r(e<67108864);for(var n=0,i=0;i>=26,n+=o/67108864|0,n+=a>>>26,this.words[i]=67108863&a}return 0!==n&&(this.words[i]=n,this.length++),t?this.ineg():this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>i&1}return t}(e);if(0===t.length)return new i(1);for(var r=this,n=0;n=0);var t,n=e%26,i=(e-n)/26,o=67108863>>>26-n<<26-n;if(0!==n){var a=0;for(t=0;t>>26-n}a&&(this.words[t]=a,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var o=e%26,a=Math.min((e-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,u=0;u=0&&(0!==f||u>=i);u--){var d=0|this.words[u];this.words[u]=f<<26-o|d>>>o,f=d&s}return c&&0!==f&&(c.words[c.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(e,t,n){return r(0===this.negative),this.iushrn(e,t,n)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){r("number"==typeof e&&e>=0);var t=e%26,n=(e-t)/26,i=1<=0);var t=e%26,n=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==t&&n++,this.length=Math.min(n,this.length),0!==t){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},i.prototype.isubn=function(e){if(r("number"==typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(c/67108864|0),this.words[i+n]=67108863&o}for(;i>26,this.words[i+n]=67108863&o;if(0===s)return this._strip();for(r(-1===s),s=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},i.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),o=e,a=0|o.words[o.length-1];0!==(r=26-this._countBits(a))&&(o=o.ushln(r),n.iushln(r),a=0|o.words[o.length-1]);var s,c=n.length-o.length;if("mod"!==t){(s=new i(null)).length=c+1,s.words=new Array(s.length);for(var u=0;u=0;d--){var l=67108864*(0|n.words[o.length+d])+(0|n.words[o.length+d-1]);for(l=Math.min(l/a|0,67108863),n._ishlnsubmul(o,l,d);0!==n.negative;)l--,n.negative=0,n._ishlnsubmul(o,1,d),n.isZero()||(n.negative^=1);s&&(s.words[d]=l)}return s&&s._strip(),n._strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},i.prototype.divmod=function(e,t,n){return r(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(o=s.div.neg()),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.iadd(e)),{div:o,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(o=s.div.neg()),{div:o,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modrn(e.words[0]))}:this._wordDiv(e,t);var o,a,s},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modrn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var n=(1<<26)%e,i=0,o=this.length-1;o>=0;o--)i=(n*i+(0|this.words[o]))%e;return t?-i:i},i.prototype.modn=function(e){return this.modrn(e)},i.prototype.idivn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var n=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*n;this.words[i]=o/e|0,n=o%e}return this._strip(),t?this.ineg():this},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o=new i(1),a=new i(0),s=new i(0),c=new i(1),u=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++u;for(var f=n.clone(),d=t.clone();!t.isZero();){for(var l=0,h=1;0==(t.words[0]&h)&&l<26;++l,h<<=1);if(l>0)for(t.iushrn(l);l-- >0;)(o.isOdd()||a.isOdd())&&(o.iadd(f),a.isub(d)),o.iushrn(1),a.iushrn(1);for(var p=0,m=1;0==(n.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(n.iushrn(p);p-- >0;)(s.isOdd()||c.isOdd())&&(s.iadd(f),c.isub(d)),s.iushrn(1),c.iushrn(1);t.cmp(n)>=0?(t.isub(n),o.isub(s),a.isub(c)):(n.isub(t),s.isub(o),c.isub(a))}return{a:s,b:c,gcd:n.iushln(u)}},i.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o,a=new i(1),s=new i(0),c=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(var u=0,f=1;0==(t.words[0]&f)&&u<26;++u,f<<=1);if(u>0)for(t.iushrn(u);u-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);for(var d=0,l=1;0==(n.words[0]&l)&&d<26;++d,l<<=1);if(d>0)for(n.iushrn(d);d-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);t.cmp(n)>=0?(t.isub(n),a.isub(s)):(n.isub(t),s.isub(a))}return(o=0===t.cmpn(1)?a:s).cmpn(0)<0&&o.iadd(e),o},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return 0==(1&this.words[0])},i.prototype.isOdd=function(){return 1==(1&this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){r("number"==typeof e);var t=e%26,n=(e-t)/26,i=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this._strip(),this.length>1)t=1;else{n&&(e=-e),r(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){ni&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new P(e)},i.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var v={k256:null,p224:null,p192:null,p25519:null};function w(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function A(){w.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function _(){w.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function E(){w.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function S(){w.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function P(e){if("string"==typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function x(e){P.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}w.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},w.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},w.prototype.split=function(e,t){e.iushrn(this.n,0,t)},w.prototype.imulK=function(e){return e.imul(this.k)},n(A,w),A.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i>>22,o=a}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},A.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(v[e])return v[e];var t;if("k256"===e)t=new A;else if("p224"===e)t=new _;else if("p192"===e)t=new E;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new S}return v[e]=t,t},P.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},P.prototype._verify2=function(e,t){r(0==(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},P.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(u(e,e.umod(this.m)._forceRed(this)),e)},P.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},P.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},P.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},P.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},P.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},P.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},P.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},P.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},P.prototype.isqr=function(e){return this.imul(e,e.clone())},P.prototype.sqr=function(e){return this.mul(e,e)},P.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2==1),3===t){var n=this.m.add(new i(1)).iushrn(2);return this.pow(e,n)}for(var o=this.m.subn(1),a=0;!o.isZero()&&0===o.andln(1);)a++,o.iushrn(1);r(!o.isZero());var s=new i(1).toRed(this),c=s.redNeg(),u=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new i(2*f*f).toRed(this);0!==this.pow(f,u).cmp(c);)f.redIAdd(c);for(var d=this.pow(f,o),l=this.pow(e,o.addn(1).iushrn(1)),h=this.pow(e,o),p=a;0!==h.cmp(s);){for(var m=h,g=0;0!==m.cmp(s);g++)m=m.redSqr();r(g=0;n--){for(var u=t.words[n],f=c-1;f>=0;f--){var d=u>>f&1;o!==r[0]&&(o=this.sqr(o)),0!==d||0!==a?(a<<=1,a|=d,(4===++s||0===n&&0===f)&&(o=this.mul(o,r[a]),s=0,a=0)):s=0}c=26}return o},P.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},P.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new x(e)},n(x,P),x.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},x.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},x.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},x.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(n).iushrn(this.shift),a=o;return o.cmp(this.m)>=0?a=o.isub(this.m):o.cmpn(0)<0&&(a=o.iadd(this.m)),a._forceRed(this)},x.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,u)}(co);var uo=f(co.exports);let fo=!1,lo=!1;const ho={debug:1,default:2,info:2,warning:3,error:4,off:5};let po=ho.default,mo=null;const go=function(){try{const e=[];if(["NFD","NFC","NFKD","NFKC"].forEach((t=>{try{if("test"!=="test".normalize(t))throw new Error("bad normalize")}catch(r){e.push(t)}})),e.length)throw new Error("missing "+e.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(e){return e.message}return null}();var yo,bo;!function(e){e.DEBUG="DEBUG",e.INFO="INFO",e.WARNING="WARNING",e.ERROR="ERROR",e.OFF="OFF"}(yo||(yo={})),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"}(bo||(bo={}));const vo="0123456789abcdef";class wo{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,t){const r=e.toLowerCase();null==ho[r]&&this.throwArgumentError("invalid log level name","logLevel",e),po>ho[r]||console.log.apply(console,t)}debug(...e){this._log(wo.levels.DEBUG,e)}info(...e){this._log(wo.levels.INFO,e)}warn(...e){this._log(wo.levels.WARNING,e)}makeError(e,t,r){if(lo)return this.makeError("censored error",t,{});t||(t=wo.errors.UNKNOWN_ERROR),r||(r={});const n=[];Object.keys(r).forEach((e=>{const t=r[e];try{if(t instanceof Uint8Array){let r="";for(let e=0;e>4],r+=vo[15&t[e]];n.push(e+"=Uint8Array(0x"+r+")")}else n.push(e+"="+JSON.stringify(t))}catch(t){n.push(e+"="+JSON.stringify(r[e].toString()))}})),n.push(`code=${t}`),n.push(`version=${this.version}`);const i=e;let o="";switch(t){case bo.NUMERIC_FAULT:{o="NUMERIC_FAULT";const t=e;switch(t){case"overflow":case"underflow":case"division-by-zero":o+="-"+t;break;case"negative-power":case"negative-width":o+="-unsupported";break;case"unbound-bitwise-result":o+="-unbound-result"}break}case bo.CALL_EXCEPTION:case bo.INSUFFICIENT_FUNDS:case bo.MISSING_NEW:case bo.NONCE_EXPIRED:case bo.REPLACEMENT_UNDERPRICED:case bo.TRANSACTION_REPLACED:case bo.UNPREDICTABLE_GAS_LIMIT:o=t}o&&(e+=" [ See: https://links.ethers.org/v5-errors-"+o+" ]"),n.length&&(e+=" ("+n.join(", ")+")");const a=new Error(e);return a.reason=i,a.code=t,Object.keys(r).forEach((function(e){a[e]=r[e]})),a}throwError(e,t,r){throw this.makeError(e,t,r)}throwArgumentError(e,t,r){return this.throwError(e,wo.errors.INVALID_ARGUMENT,{argument:t,value:r})}assert(e,t,r,n){e||this.throwError(t,r,n)}assertArgument(e,t,r,n){e||this.throwArgumentError(t,r,n)}checkNormalize(e){go&&this.throwError("platform missing String.prototype.normalize",wo.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:go})}checkSafeUint53(e,t){"number"==typeof e&&(null==t&&(t="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(t,wo.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(t,wo.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,t,r){r=r?": "+r:"",et&&this.throwError("too many arguments"+r,wo.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:t})}checkNew(e,t){e!==Object&&null!=e||this.throwError("missing new",wo.errors.MISSING_NEW,{name:t.name})}checkAbstract(e,t){e===t?this.throwError("cannot instantiate abstract class "+JSON.stringify(t.name)+" directly; use a sub-class",wo.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):e!==Object&&null!=e||this.throwError("missing new",wo.errors.MISSING_NEW,{name:t.name})}static globalLogger(){return mo||(mo=new wo("logger/5.7.0")),mo}static setCensorship(e,t){if(!e&&t&&this.globalLogger().throwError("cannot permanently disable censorship",wo.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),fo){if(!e)return;this.globalLogger().throwError("error censorship permanent",wo.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}lo=!!e,fo=!!t}static setLogLevel(e){const t=ho[e.toLowerCase()];null!=t?po=t:wo.globalLogger().warn("invalid log level - "+e)}static from(e){return new wo(e)}}wo.errors=bo,wo.levels=yo;var Ao=Object.freeze({__proto__:null,get ErrorCode(){return bo},get LogLevel(){return yo},Logger:wo});const _o=new wo("bytes/5.7.0");function Eo(e){return!!e.toHexString}function So(e){return e.slice||(e.slice=function(){const t=Array.prototype.slice.call(arguments);return So(new Uint8Array(Array.prototype.slice.apply(e,t)))}),e}function Po(e){return No(e)&&!(e.length%2)||ko(e)}function xo(e){return"number"==typeof e&&e==e&&e%1==0}function ko(e){if(null==e)return!1;if(e.constructor===Uint8Array)return!0;if("string"==typeof e)return!1;if(!xo(e.length)||e.length<0)return!1;for(let t=0;t=256)return!1}return!0}function Mo(e,t){if(t||(t={}),"number"==typeof e){_o.checkSafeUint53(e,"invalid arrayify value");const t=[];for(;e;)t.unshift(255&e),e=parseInt(String(e/256));return 0===t.length&&t.push(0),So(new Uint8Array(t))}if(t.allowMissingPrefix&&"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),Eo(e)&&(e=e.toHexString()),No(e)){let r=e.substring(2);r.length%2&&("left"===t.hexPad?r="0"+r:"right"===t.hexPad?r+="0":_o.throwArgumentError("hex data is odd-length","value",e));const n=[];for(let e=0;eMo(e))),r=t.reduce(((e,t)=>e+t.length),0),n=new Uint8Array(r);return t.reduce(((e,t)=>(n.set(t,e),e+t.length)),0),So(n)}function Io(e){let t=Mo(e);if(0===t.length)return t;let r=0;for(;rt&&_o.throwArgumentError("value out of range","value",arguments[0]);const r=new Uint8Array(t);return r.set(e,t-e.length),So(r)}function No(e,t){return!("string"!=typeof e||!e.match(/^0x[0-9A-Fa-f]*$/))&&(!t||e.length===2+2*t)}const Oo="0123456789abcdef";function To(e,t){if(t||(t={}),"number"==typeof e){_o.checkSafeUint53(e,"invalid hexlify value");let t="";for(;e;)t=Oo[15&e]+t,e=Math.floor(e/16);return t.length?(t.length%2&&(t="0"+t),"0x"+t):"0x00"}if("bigint"==typeof e)return(e=e.toString(16)).length%2?"0x0"+e:"0x"+e;if(t.allowMissingPrefix&&"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),Eo(e))return e.toHexString();if(No(e))return e.length%2&&("left"===t.hexPad?e="0x0"+e.substring(2):"right"===t.hexPad?e+="0":_o.throwArgumentError("hex data is odd-length","value",e)),e.toLowerCase();if(ko(e)){let t="0x";for(let r=0;r>4]+Oo[15&n]}return t}return _o.throwArgumentError("invalid hexlify value","value",e)}function jo(e){if("string"!=typeof e)e=To(e);else if(!No(e)||e.length%2)return null;return(e.length-2)/2}function Do(e,t,r){return"string"!=typeof e?e=To(e):(!No(e)||e.length%2)&&_o.throwArgumentError("invalid hexData","value",e),t=2+2*t,null!=r?"0x"+e.substring(t,2+2*r):"0x"+e.substring(t)}function $o(e){let t="0x";return e.forEach((e=>{t+=To(e).substring(2)})),t}function Bo(e){const t=Fo(To(e,{hexPad:"left"}));return"0x"===t?"0x0":t}function Fo(e){"string"!=typeof e&&(e=To(e)),No(e)||_o.throwArgumentError("invalid hex string","value",e),e=e.substring(2);let t=0;for(;t2*t+2&&_o.throwArgumentError("value out of range","value",arguments[1]);e.length<2*t+2;)e="0x0"+e.substring(2);return e}function Uo(e){const t={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(Po(e)){let r=Mo(e);64===r.length?(t.v=27+(r[32]>>7),r[32]&=127,t.r=To(r.slice(0,32)),t.s=To(r.slice(32,64))):65===r.length?(t.r=To(r.slice(0,32)),t.s=To(r.slice(32,64)),t.v=r[64]):_o.throwArgumentError("invalid signature string","signature",e),t.v<27&&(0===t.v||1===t.v?t.v+=27:_o.throwArgumentError("signature invalid v byte","signature",e)),t.recoveryParam=1-t.v%2,t.recoveryParam&&(r[32]|=128),t._vs=To(r.slice(32,64))}else{if(t.r=e.r,t.s=e.s,t.v=e.v,t.recoveryParam=e.recoveryParam,t._vs=e._vs,null!=t._vs){const r=Ro(Mo(t._vs),32);t._vs=To(r);const n=r[0]>=128?1:0;null==t.recoveryParam?t.recoveryParam=n:t.recoveryParam!==n&&_o.throwArgumentError("signature recoveryParam mismatch _vs","signature",e),r[0]&=127;const i=To(r);null==t.s?t.s=i:t.s!==i&&_o.throwArgumentError("signature v mismatch _vs","signature",e)}if(null==t.recoveryParam)null==t.v?_o.throwArgumentError("signature missing v and recoveryParam","signature",e):0===t.v||1===t.v?t.recoveryParam=t.v:t.recoveryParam=1-t.v%2;else if(null==t.v)t.v=27+t.recoveryParam;else{const r=0===t.v||1===t.v?t.v:1-t.v%2;t.recoveryParam!==r&&_o.throwArgumentError("signature recoveryParam mismatch v","signature",e)}null!=t.r&&No(t.r)?t.r=zo(t.r,32):_o.throwArgumentError("signature missing or invalid r","signature",e),null!=t.s&&No(t.s)?t.s=zo(t.s,32):_o.throwArgumentError("signature missing or invalid s","signature",e);const r=Mo(t.s);r[0]>=128&&_o.throwArgumentError("signature s out of range","signature",e),t.recoveryParam&&(r[0]|=128);const n=To(r);t._vs&&(No(t._vs)||_o.throwArgumentError("signature invalid _vs","signature",e),t._vs=zo(t._vs,32)),null==t._vs?t._vs=n:t._vs!==n&&_o.throwArgumentError("signature _vs mismatch v and s","signature",e)}return t.yParityAndS=t._vs,t.compact=t.r+t.yParityAndS.substring(2),t}function Lo(e){return To(Co([(e=Uo(e)).r,e.s,e.recoveryParam?"0x1c":"0x1b"]))}var qo=Object.freeze({__proto__:null,arrayify:Mo,concat:Co,hexConcat:$o,hexDataLength:jo,hexDataSlice:Do,hexStripZeros:Fo,hexValue:Bo,hexZeroPad:zo,hexlify:To,isBytes:ko,isBytesLike:Po,isHexString:No,joinSignature:Lo,splitSignature:Uo,stripZeros:Io,zeroPad:Ro});const Ho="bignumber/5.7.0";var Ko=uo.BN;const Jo=new wo(Ho),Wo={},Go=9007199254740991;let Vo=!1;class Zo{constructor(e,t){e!==Wo&&Jo.throwError("cannot call constructor directly; use BigNumber.from",wo.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=t,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return Qo(Yo(this).fromTwos(e))}toTwos(e){return Qo(Yo(this).toTwos(e))}abs(){return"-"===this._hex[0]?Zo.from(this._hex.substring(1)):this}add(e){return Qo(Yo(this).add(Yo(e)))}sub(e){return Qo(Yo(this).sub(Yo(e)))}div(e){return Zo.from(e).isZero()&&ea("division-by-zero","div"),Qo(Yo(this).div(Yo(e)))}mul(e){return Qo(Yo(this).mul(Yo(e)))}mod(e){const t=Yo(e);return t.isNeg()&&ea("division-by-zero","mod"),Qo(Yo(this).umod(t))}pow(e){const t=Yo(e);return t.isNeg()&&ea("negative-power","pow"),Qo(Yo(this).pow(t))}and(e){const t=Yo(e);return(this.isNegative()||t.isNeg())&&ea("unbound-bitwise-result","and"),Qo(Yo(this).and(t))}or(e){const t=Yo(e);return(this.isNegative()||t.isNeg())&&ea("unbound-bitwise-result","or"),Qo(Yo(this).or(t))}xor(e){const t=Yo(e);return(this.isNegative()||t.isNeg())&&ea("unbound-bitwise-result","xor"),Qo(Yo(this).xor(t))}mask(e){return(this.isNegative()||e<0)&&ea("negative-width","mask"),Qo(Yo(this).maskn(e))}shl(e){return(this.isNegative()||e<0)&&ea("negative-width","shl"),Qo(Yo(this).shln(e))}shr(e){return(this.isNegative()||e<0)&&ea("negative-width","shr"),Qo(Yo(this).shrn(e))}eq(e){return Yo(this).eq(Yo(e))}lt(e){return Yo(this).lt(Yo(e))}lte(e){return Yo(this).lte(Yo(e))}gt(e){return Yo(this).gt(Yo(e))}gte(e){return Yo(this).gte(Yo(e))}isNegative(){return"-"===this._hex[0]}isZero(){return Yo(this).isZero()}toNumber(){try{return Yo(this).toNumber()}catch(e){ea("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch(e){}return Jo.throwError("this platform does not support BigInt",wo.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(10===arguments[0]?Vo||(Vo=!0,Jo.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?Jo.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",wo.errors.UNEXPECTED_ARGUMENT,{}):Jo.throwError("BigNumber.toString does not accept parameters",wo.errors.UNEXPECTED_ARGUMENT,{})),Yo(this).toString(10)}toHexString(){return this._hex}toJSON(e){return{type:"BigNumber",hex:this.toHexString()}}static from(e){if(e instanceof Zo)return e;if("string"==typeof e)return e.match(/^-?0x[0-9a-f]+$/i)?new Zo(Wo,Xo(e)):e.match(/^-?[0-9]+$/)?new Zo(Wo,Xo(new Ko(e))):Jo.throwArgumentError("invalid BigNumber string","value",e);if("number"==typeof e)return e%1&&ea("underflow","BigNumber.from",e),(e>=Go||e<=-Go)&&ea("overflow","BigNumber.from",e),Zo.from(String(e));const t=e;if("bigint"==typeof t)return Zo.from(t.toString());if(ko(t))return Zo.from(To(t));if(t)if(t.toHexString){const e=t.toHexString();if("string"==typeof e)return Zo.from(e)}else{let e=t._hex;if(null==e&&"BigNumber"===t.type&&(e=t.hex),"string"==typeof e&&(No(e)||"-"===e[0]&&No(e.substring(1))))return Zo.from(e)}return Jo.throwArgumentError("invalid BigNumber value","value",e)}static isBigNumber(e){return!(!e||!e._isBigNumber)}}function Xo(e){if("string"!=typeof e)return Xo(e.toString(16));if("-"===e[0])return"-"===(e=e.substring(1))[0]&&Jo.throwArgumentError("invalid hex","value",e),"0x00"===(e=Xo(e))?e:"-"+e;if("0x"!==e.substring(0,2)&&(e="0x"+e),"0x"===e)return"0x00";for(e.length%2&&(e="0x0"+e.substring(2));e.length>4&&"0x00"===e.substring(0,4);)e="0x"+e.substring(4);return e}function Qo(e){return Zo.from(Xo(e))}function Yo(e){const t=Zo.from(e).toHexString();return"-"===t[0]?new Ko("-"+t.substring(3),16):new Ko(t.substring(2),16)}function ea(e,t,r){const n={fault:e,operation:t};return null!=r&&(n.value=r),Jo.throwError(e,wo.errors.NUMERIC_FAULT,n)}const ta=new wo(Ho),ra={},na=Zo.from(0),ia=Zo.from(-1);function oa(e,t,r,n){const i={fault:t,operation:r};return void 0!==n&&(i.value=n),ta.throwError(e,wo.errors.NUMERIC_FAULT,i)}let aa="0";for(;aa.length<256;)aa+=aa;function sa(e){if("number"!=typeof e)try{e=Zo.from(e).toNumber()}catch(e){}return"number"==typeof e&&e>=0&&e<=256&&!(e%1)?"1"+aa.substring(0,e):ta.throwArgumentError("invalid decimal size","decimals",e)}function ca(e,t){null==t&&(t=0);const r=sa(t),n=(e=Zo.from(e)).lt(na);n&&(e=e.mul(ia));let i=e.mod(r).toString();for(;i.length2&&ta.throwArgumentError("too many decimal points","value",e);let o=i[0],a=i[1];for(o||(o="0"),a||(a="0");"0"===a[a.length-1];)a=a.substring(0,a.length-1);for(a.length>r.length-1&&oa("fractional component exceeds decimals","underflow","parseFixed"),""===a&&(a="0");a.lengthnull==e[t]?n:(typeof e[t]!==r&&ta.throwArgumentError("invalid fixed format ("+t+" not "+r+")","format."+t,e[t]),e[t]);t=i("signed","boolean",t),r=i("width","number",r),n=i("decimals","number",n)}return r%8&&ta.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",r),n>80&&ta.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",n),new fa(ra,t,r,n)}}class da{constructor(e,t,r,n){e!==ra&&ta.throwError("cannot use FixedNumber constructor; use FixedNumber.from",wo.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=n,this._hex=t,this._value=r,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(e){this.format.name!==e.format.name&&ta.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",e)}addUnsafe(e){this._checkFormat(e);const t=ua(this._value,this.format.decimals),r=ua(e._value,e.format.decimals);return da.fromValue(t.add(r),this.format.decimals,this.format)}subUnsafe(e){this._checkFormat(e);const t=ua(this._value,this.format.decimals),r=ua(e._value,e.format.decimals);return da.fromValue(t.sub(r),this.format.decimals,this.format)}mulUnsafe(e){this._checkFormat(e);const t=ua(this._value,this.format.decimals),r=ua(e._value,e.format.decimals);return da.fromValue(t.mul(r).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(e){this._checkFormat(e);const t=ua(this._value,this.format.decimals),r=ua(e._value,e.format.decimals);return da.fromValue(t.mul(this.format._multiplier).div(r),this.format.decimals,this.format)}floor(){const e=this.toString().split(".");1===e.length&&e.push("0");let t=da.from(e[0],this.format);const r=!e[1].match(/^(0*)$/);return this.isNegative()&&r&&(t=t.subUnsafe(la.toFormat(t.format))),t}ceiling(){const e=this.toString().split(".");1===e.length&&e.push("0");let t=da.from(e[0],this.format);const r=!e[1].match(/^(0*)$/);return!this.isNegative()&&r&&(t=t.addUnsafe(la.toFormat(t.format))),t}round(e){null==e&&(e=0);const t=this.toString().split(".");if(1===t.length&&t.push("0"),(e<0||e>80||e%1)&&ta.throwArgumentError("invalid decimal count","decimals",e),t[1].length<=e)return this;const r=da.from("1"+aa.substring(0,e),this.format),n=ha.toFormat(this.format);return this.mulUnsafe(r).addUnsafe(n).floor().divUnsafe(r)}isZero(){return"0.0"===this._value||"0"===this._value}isNegative(){return"-"===this._value[0]}toString(){return this._value}toHexString(e){if(null==e)return this._hex;e%8&&ta.throwArgumentError("invalid byte width","width",e);return zo(Zo.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString(),e/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return da.fromString(this._value,e)}static fromValue(e,t,r){return null!=r||null==t||function(e){return null!=e&&(Zo.isBigNumber(e)||"number"==typeof e&&e%1==0||"string"==typeof e&&!!e.match(/^-?[0-9]+$/)||No(e)||"bigint"==typeof e||ko(e))}(t)||(r=t,t=null),null==t&&(t=0),null==r&&(r="fixed"),da.fromString(ca(e,t),fa.from(r))}static fromString(e,t){null==t&&(t="fixed");const r=fa.from(t),n=ua(e,r.decimals);!r.signed&&n.lt(na)&&oa("unsigned value cannot be negative","overflow","value",e);let i=null;r.signed?i=n.toTwos(r.width).toHexString():(i=n.toHexString(),i=zo(i,r.width/8));const o=ca(n,r.decimals);return new da(ra,i,o,r)}static fromBytes(e,t){null==t&&(t="fixed");const r=fa.from(t);if(Mo(e).length>r.width/8)throw new Error("overflow");let n=Zo.from(e);r.signed&&(n=n.fromTwos(r.width));const i=n.toTwos((r.signed?0:1)+r.width).toHexString(),o=ca(n,r.decimals);return new da(ra,i,o,r)}static from(e,t){if("string"==typeof e)return da.fromString(e,t);if(ko(e))return da.fromBytes(e,t);try{return da.fromValue(e,0,t)}catch(e){if(e.code!==wo.errors.INVALID_ARGUMENT)throw e}return ta.throwArgumentError("invalid FixedNumber value","value",e)}static isFixedNumber(e){return!(!e||!e._isFixedNumber)}}const la=da.from(1),ha=da.from("0.5");var pa=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))};const ma=new wo("properties/5.7.0");function ga(e,t,r){Object.defineProperty(e,t,{enumerable:!0,value:r,writable:!1})}function ya(e,t){for(let r=0;r<32;r++){if(e[t])return e[t];if(!e.prototype||"object"!=typeof e.prototype)break;e=Object.getPrototypeOf(e.prototype).constructor}return null}function ba(e){return pa(this,void 0,void 0,(function*(){const t=Object.keys(e).map((t=>{const r=e[t];return Promise.resolve(r).then((e=>({key:t,value:e})))}));return(yield Promise.all(t)).reduce(((e,t)=>(e[t.key]=t.value,e)),{})}))}function va(e,t){e&&"object"==typeof e||ma.throwArgumentError("invalid object","object",e),Object.keys(e).forEach((r=>{t[r]||ma.throwArgumentError("invalid object key - "+r,"transaction:"+r,e)}))}function wa(e){const t={};for(const r in e)t[r]=e[r];return t}const Aa={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function _a(e){if(null==e||Aa[typeof e])return!0;if(Array.isArray(e)||"object"==typeof e){if(!Object.isFrozen(e))return!1;const t=Object.keys(e);for(let r=0;rSa(e))));if("object"==typeof e){const t={};for(const r in e){const n=e[r];void 0!==n&&ga(t,r,Sa(n))}return t}return ma.throwArgumentError("Cannot deepCopy "+typeof e,"object",e)}function Sa(e){return Ea(e)}class Pa{constructor(e){for(const t in e)this[t]=Sa(e[t])}}var xa=Object.freeze({__proto__:null,Description:Pa,checkProperties:va,deepCopy:Sa,defineReadOnly:ga,getStatic:ya,resolveProperties:ba,shallowCopy:wa});const ka="abi/5.7.0",Ma=new wo(ka),Ca={};let Ia={calldata:!0,memory:!0,storage:!0},Ra={calldata:!0,memory:!0};function Na(e,t){if("bytes"===e||"string"===e){if(Ia[t])return!0}else if("address"===e){if("payable"===t)return!0}else if((e.indexOf("[")>=0||"tuple"===e)&&Ra[t])return!0;return(Ia[t]||"payable"===t)&&Ma.throwArgumentError("invalid modifier","name",t),!1}function Oa(e,t){for(let r in t)ga(e,r,t[r])}const Ta=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),ja=new RegExp(/^(.*)\[([0-9]*)\]$/);class Da{constructor(e,t){e!==Ca&&Ma.throwError("use fromString",wo.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),Oa(this,t);let r=this.type.match(ja);Oa(this,r?{arrayLength:parseInt(r[2]||"-1"),arrayChildren:Da.fromObject({type:r[1],components:this.components}),baseType:"array"}:{arrayLength:null,arrayChildren:null,baseType:null!=this.components?"tuple":this.type}),this._isParamType=!0,Object.freeze(this)}format(e){if(e||(e=Ta.sighash),Ta[e]||Ma.throwArgumentError("invalid format type","format",e),e===Ta.json){let t={type:"tuple"===this.baseType?"tuple":this.type,name:this.name||void 0};return"boolean"==typeof this.indexed&&(t.indexed=this.indexed),this.components&&(t.components=this.components.map((t=>JSON.parse(t.format(e))))),JSON.stringify(t)}let t="";return"array"===this.baseType?(t+=this.arrayChildren.format(e),t+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):"tuple"===this.baseType?(e!==Ta.sighash&&(t+=this.type),t+="("+this.components.map((t=>t.format(e))).join(e===Ta.full?", ":",")+")"):t+=this.type,e!==Ta.sighash&&(!0===this.indexed&&(t+=" indexed"),e===Ta.full&&this.name&&(t+=" "+this.name)),t}static from(e,t){return"string"==typeof e?Da.fromString(e,t):Da.fromObject(e)}static fromObject(e){return Da.isParamType(e)?e:new Da(Ca,{name:e.name||null,type:Wa(e.type),indexed:null==e.indexed?null:!!e.indexed,components:e.components?e.components.map(Da.fromObject):null})}static fromString(e,t){return r=function(e,t){let r=e;function n(t){Ma.throwArgumentError(`unexpected character at position ${t}`,"param",e)}function i(e){let r={type:"",name:"",parent:e,state:{allowType:!0}};return t&&(r.indexed=!1),r}e=e.replace(/\s/g," ");let o={type:"",name:"",state:{allowType:!0}},a=o;for(let r=0;rDa.fromString(e,t)))}class Ba{constructor(e,t){e!==Ca&&Ma.throwError("use a static from method",wo.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),Oa(this,t),this._isFragment=!0,Object.freeze(this)}static from(e){return Ba.isFragment(e)?e:"string"==typeof e?Ba.fromString(e):Ba.fromObject(e)}static fromObject(e){if(Ba.isFragment(e))return e;switch(e.type){case"function":return Ha.fromObject(e);case"event":return Fa.fromObject(e);case"constructor":return qa.fromObject(e);case"error":return Ja.fromObject(e);case"fallback":case"receive":return null}return Ma.throwArgumentError("invalid fragment object","value",e)}static fromString(e){return"event"===(e=(e=(e=e.replace(/\s/g," ")).replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," ")).trim()).split(" ")[0]?Fa.fromString(e.substring(5).trim()):"function"===e.split(" ")[0]?Ha.fromString(e.substring(8).trim()):"constructor"===e.split("(")[0].trim()?qa.fromString(e.trim()):"error"===e.split(" ")[0]?Ja.fromString(e.substring(5).trim()):Ma.throwArgumentError("unsupported fragment","value",e)}static isFragment(e){return!(!e||!e._isFragment)}}class Fa extends Ba{format(e){if(e||(e=Ta.sighash),Ta[e]||Ma.throwArgumentError("invalid format type","format",e),e===Ta.json)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==Ta.sighash&&(t+="event "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===Ta.full?", ":",")+") ",e!==Ta.sighash&&this.anonymous&&(t+="anonymous "),t.trim()}static from(e){return"string"==typeof e?Fa.fromString(e):Fa.fromObject(e)}static fromObject(e){if(Fa.isEventFragment(e))return e;"event"!==e.type&&Ma.throwArgumentError("invalid event object","value",e);const t={name:Va(e.name),anonymous:e.anonymous,inputs:e.inputs?e.inputs.map(Da.fromObject):[],type:"event"};return new Fa(Ca,t)}static fromString(e){let t=e.match(Za);t||Ma.throwArgumentError("invalid event string","value",e);let r=!1;return t[3].split(" ").forEach((e=>{switch(e.trim()){case"anonymous":r=!0;break;case"":break;default:Ma.warn("unknown modifier: "+e)}})),Fa.fromObject({name:t[1].trim(),anonymous:r,inputs:$a(t[2],!0),type:"event"})}static isEventFragment(e){return e&&e._isFragment&&"event"===e.type}}function za(e,t){t.gas=null;let r=e.split("@");return 1!==r.length?(r.length>2&&Ma.throwArgumentError("invalid human-readable ABI signature","value",e),r[1].match(/^[0-9]+$/)||Ma.throwArgumentError("invalid human-readable ABI signature gas","value",e),t.gas=Zo.from(r[1]),r[0]):e}function Ua(e,t){t.constant=!1,t.payable=!1,t.stateMutability="nonpayable",e.split(" ").forEach((e=>{switch(e.trim()){case"constant":t.constant=!0;break;case"payable":t.payable=!0,t.stateMutability="payable";break;case"nonpayable":t.payable=!1,t.stateMutability="nonpayable";break;case"pure":t.constant=!0,t.stateMutability="pure";break;case"view":t.constant=!0,t.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+e)}}))}function La(e){let t={constant:!1,payable:!0,stateMutability:"payable"};return null!=e.stateMutability?(t.stateMutability=e.stateMutability,t.constant="view"===t.stateMutability||"pure"===t.stateMutability,null!=e.constant&&!!e.constant!==t.constant&&Ma.throwArgumentError("cannot have constant function with mutability "+t.stateMutability,"value",e),t.payable="payable"===t.stateMutability,null!=e.payable&&!!e.payable!==t.payable&&Ma.throwArgumentError("cannot have payable function with mutability "+t.stateMutability,"value",e)):null!=e.payable?(t.payable=!!e.payable,null!=e.constant||t.payable||"constructor"===e.type||Ma.throwArgumentError("unable to determine stateMutability","value",e),t.constant=!!e.constant,t.constant?t.stateMutability="view":t.stateMutability=t.payable?"payable":"nonpayable",t.payable&&t.constant&&Ma.throwArgumentError("cannot have constant payable function","value",e)):null!=e.constant?(t.constant=!!e.constant,t.payable=!t.constant,t.stateMutability=t.constant?"view":"payable"):"constructor"!==e.type&&Ma.throwArgumentError("unable to determine stateMutability","value",e),t}class qa extends Ba{format(e){if(e||(e=Ta.sighash),Ta[e]||Ma.throwArgumentError("invalid format type","format",e),e===Ta.json)return JSON.stringify({type:"constructor",stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});e===Ta.sighash&&Ma.throwError("cannot format a constructor for sighash",wo.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});let t="constructor("+this.inputs.map((t=>t.format(e))).join(e===Ta.full?", ":",")+") ";return this.stateMutability&&"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "),t.trim()}static from(e){return"string"==typeof e?qa.fromString(e):qa.fromObject(e)}static fromObject(e){if(qa.isConstructorFragment(e))return e;"constructor"!==e.type&&Ma.throwArgumentError("invalid constructor object","value",e);let t=La(e);t.constant&&Ma.throwArgumentError("constructor cannot be constant","value",e);const r={name:null,type:e.type,inputs:e.inputs?e.inputs.map(Da.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?Zo.from(e.gas):null};return new qa(Ca,r)}static fromString(e){let t={type:"constructor"},r=(e=za(e,t)).match(Za);return r&&"constructor"===r[1].trim()||Ma.throwArgumentError("invalid constructor string","value",e),t.inputs=$a(r[2].trim(),!1),Ua(r[3].trim(),t),qa.fromObject(t)}static isConstructorFragment(e){return e&&e._isFragment&&"constructor"===e.type}}class Ha extends qa{format(e){if(e||(e=Ta.sighash),Ta[e]||Ma.throwArgumentError("invalid format type","format",e),e===Ta.json)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((t=>JSON.parse(t.format(e)))),outputs:this.outputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==Ta.sighash&&(t+="function "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===Ta.full?", ":",")+") ",e!==Ta.sighash&&(this.stateMutability?"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "):this.constant&&(t+="view "),this.outputs&&this.outputs.length&&(t+="returns ("+this.outputs.map((t=>t.format(e))).join(", ")+") "),null!=this.gas&&(t+="@"+this.gas.toString()+" ")),t.trim()}static from(e){return"string"==typeof e?Ha.fromString(e):Ha.fromObject(e)}static fromObject(e){if(Ha.isFunctionFragment(e))return e;"function"!==e.type&&Ma.throwArgumentError("invalid function object","value",e);let t=La(e);const r={type:e.type,name:Va(e.name),constant:t.constant,inputs:e.inputs?e.inputs.map(Da.fromObject):[],outputs:e.outputs?e.outputs.map(Da.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?Zo.from(e.gas):null};return new Ha(Ca,r)}static fromString(e){let t={type:"function"},r=(e=za(e,t)).split(" returns ");r.length>2&&Ma.throwArgumentError("invalid function string","value",e);let n=r[0].match(Za);if(n||Ma.throwArgumentError("invalid function signature","value",e),t.name=n[1].trim(),t.name&&Va(t.name),t.inputs=$a(n[2],!1),Ua(n[3].trim(),t),r.length>1){let n=r[1].match(Za);""==n[1].trim()&&""==n[3].trim()||Ma.throwArgumentError("unexpected tokens","value",e),t.outputs=$a(n[2],!1)}else t.outputs=[];return Ha.fromObject(t)}static isFunctionFragment(e){return e&&e._isFragment&&"function"===e.type}}function Ka(e){const t=e.format();return"Error(string)"!==t&&"Panic(uint256)"!==t||Ma.throwArgumentError(`cannot specify user defined ${t} error`,"fragment",e),e}class Ja extends Ba{format(e){if(e||(e=Ta.sighash),Ta[e]||Ma.throwArgumentError("invalid format type","format",e),e===Ta.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==Ta.sighash&&(t+="error "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===Ta.full?", ":",")+") ",t.trim()}static from(e){return"string"==typeof e?Ja.fromString(e):Ja.fromObject(e)}static fromObject(e){if(Ja.isErrorFragment(e))return e;"error"!==e.type&&Ma.throwArgumentError("invalid error object","value",e);const t={type:e.type,name:Va(e.name),inputs:e.inputs?e.inputs.map(Da.fromObject):[]};return Ka(new Ja(Ca,t))}static fromString(e){let t={type:"error"},r=e.match(Za);return r||Ma.throwArgumentError("invalid error signature","value",e),t.name=r[1].trim(),t.name&&Va(t.name),t.inputs=$a(r[2],!1),Ka(Ja.fromObject(t))}static isErrorFragment(e){return e&&e._isFragment&&"error"===e.type}}function Wa(e){return e.match(/^uint($|[^1-9])/)?e="uint256"+e.substring(4):e.match(/^int($|[^1-9])/)&&(e="int256"+e.substring(3)),e}const Ga=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function Va(e){return e&&e.match(Ga)||Ma.throwArgumentError(`invalid identifier "${e}"`,"value",e),e}const Za=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$");const Xa=new wo(ka);function Qa(e){const t=[],r=function(e,n){if(Array.isArray(n))for(let i in n){const o=e.slice();o.push(i);try{r(o,n[i])}catch(e){t.push({path:o,error:e})}}};return r([],e),t}class Ya{constructor(e,t,r,n){this.name=e,this.type=t,this.localName=r,this.dynamic=n}_throwError(e,t){Xa.throwArgumentError(e,this.localName,t)}}class es{constructor(e){ga(this,"wordSize",e||32),this._data=[],this._dataLength=0,this._padding=new Uint8Array(e)}get data(){return $o(this._data)}get length(){return this._dataLength}_writeData(e){return this._data.push(e),this._dataLength+=e.length,e.length}appendWriter(e){return this._writeData(Co(e._data))}writeBytes(e){let t=Mo(e);const r=t.length%this.wordSize;return r&&(t=Co([t,this._padding.slice(r)])),this._writeData(t)}_getValue(e){let t=Mo(Zo.from(e));return t.length>this.wordSize&&Xa.throwError("value out-of-bounds",wo.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:t.length}),t.length%this.wordSize&&(t=Co([this._padding.slice(t.length%this.wordSize),t])),t}writeValue(e){return this._writeData(this._getValue(e))}writeUpdatableValue(){const e=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,t=>{this._data[e]=this._getValue(t)}}}class ts{constructor(e,t,r,n){ga(this,"_data",Mo(e)),ga(this,"wordSize",t||32),ga(this,"_coerceFunc",r),ga(this,"allowLoose",n),this._offset=0}get data(){return To(this._data)}get consumed(){return this._offset}static coerce(e,t){let r=e.match("^u?int([0-9]+)$");return r&&parseInt(r[1])<=48&&(t=t.toNumber()),t}coerce(e,t){return this._coerceFunc?this._coerceFunc(e,t):ts.coerce(e,t)}_peekBytes(e,t,r){let n=Math.ceil(t/this.wordSize)*this.wordSize;return this._offset+n>this._data.length&&(this.allowLoose&&r&&this._offset+t<=this._data.length?n=t:Xa.throwError("data out-of-bounds",wo.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+n})),this._data.slice(this._offset,this._offset+n)}subReader(e){return new ts(this._data.slice(this._offset+e),this.wordSize,this._coerceFunc,this.allowLoose)}readBytes(e,t){let r=this._peekBytes(0,e,!!t);return this._offset+=r.length,r.slice(0,e)}readValue(){return Zo.from(this.readBytes(this.wordSize))}}var rs={exports:{}}; /** - * [js-sha3]{@link https://github.com/emn178/js-sha3} - * - * @version 0.8.0 - * @author Chen, Yi-Cyuan [emn178@gmail.com] - * @copyright Chen, Yi-Cyuan 2015-2018 - * @license MIT - */!function(e){!function(){var t="input is invalid type",r="object"==typeof window,n=r?window:{};n.JS_SHA3_NO_WINDOW&&(r=!1);var i=!r&&"object"==typeof self;!n.JS_SHA3_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node?n=s:i&&(n=self);var o=!n.JS_SHA3_NO_COMMON_JS&&e.exports,a=!n.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,c="0123456789abcdef".split(""),u=[4,1024,262144,67108864],f=[0,8,16,24],d=[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],l=[224,256,384,512],h=[128,256],p=["hex","buffer","arrayBuffer","array","digest"],m={128:168,256:136};!n.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!a||!n.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 g=function(e,t,r){return function(n){return new R(e,t,e).update(n)[r]()}},y=function(e,t,r){return function(n,i){return new R(e,t,i).update(n)[r]()}},b=function(e,t,r){return function(t,n,i,o){return E["cshake"+e].update(t,n,i,o)[r]()}},v=function(e,t,r){return function(t,n,i,o){return E["kmac"+e].update(t,n,i,o)[r]()}},w=function(e,t,r,n){for(var i=0;i>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var n=0;n<50;++n)this.s[n]=0}function N(e,t,r){R.call(this,e,t,r)}R.prototype.update=function(e){if(this.finalized)throw new Error("finalize already called");var r,n=typeof e;if("string"!==n){if("object"!==n)throw new Error(t);if(null===e)throw new Error(t);if(a&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||a&&ArrayBuffer.isView(e)))throw new Error(t);r=!0}for(var i,o,s=this.blocks,c=this.byteCount,u=e.length,d=this.blockCount,l=0,h=this.s;l>2]|=e[l]<>2]|=o<>2]|=(192|o>>6)<>2]|=(128|63&o)<=57344?(s[i>>2]|=(224|o>>12)<>2]|=(128|o>>6&63)<>2]|=(128|63&o)<>2]|=(240|o>>18)<>2]|=(128|o>>12&63)<>2]|=(128|o>>6&63)<>2]|=(128|63&o)<=c){for(this.start=i-c,this.block=s[d],i=0;i>=8);r>0;)i.unshift(r),r=255&(e>>=8),++n;return t?i.push(n):i.unshift(n),this.update(i),i.length},R.prototype.encodeString=function(e){var r,n=typeof e;if("string"!==n){if("object"!==n)throw new Error(t);if(null===e)throw new Error(t);if(a&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||a&&ArrayBuffer.isView(e)))throw new Error(t);r=!0}var i=0,o=e.length;if(r)i=o;else for(var s=0;s=57344?i+=3:(c=65536+((1023&c)<<10|1023&e.charCodeAt(++s)),i+=4)}return i+=this.encode(8*i),this.update(e),i},R.prototype.bytepad=function(e,t){for(var r=this.encode(t),n=0;n>2]|=this.padding[3&t],this.lastByteIndex===this.byteCount)for(e[0]=e[r],t=1;t>4&15]+c[15&e]+c[e>>12&15]+c[e>>8&15]+c[e>>20&15]+c[e>>16&15]+c[e>>28&15]+c[e>>24&15];a%t==0&&(O(r),o=0)}return i&&(e=r[o],s+=c[e>>4&15]+c[15&e],i>1&&(s+=c[e>>12&15]+c[e>>8&15]),i>2&&(s+=c[e>>20&15]+c[e>>16&15])),s},R.prototype.arrayBuffer=function(){this.finalize();var e,t=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,a=0,s=this.outputBits>>3;e=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(s);for(var c=new Uint32Array(e);a>8&255,c[e+2]=t>>16&255,c[e+3]=t>>24&255;s%r==0&&O(n)}return o&&(e=s<<2,t=n[a],c[e]=255&t,o>1&&(c[e+1]=t>>8&255),o>2&&(c[e+2]=t>>16&255)),c},N.prototype=new R,N.prototype.finalize=function(){return this.encode(this.outputBits,!0),R.prototype.finalize.call(this)};var O=function(e){var t,r,n,i,o,a,s,c,u,f,l,h,p,m,g,y,b,v,w,A,_,E,S,P,x,k,M,C,I,R,N,O,T,j,D,$,B,F,z,U,L,q,H,K,J,W,G,V,Z,X,Q,Y,ee,te,re,ne,ie,oe,ae,se,ce,ue,fe;for(n=0;n<48;n+=2)i=e[0]^e[10]^e[20]^e[30]^e[40],o=e[1]^e[11]^e[21]^e[31]^e[41],a=e[2]^e[12]^e[22]^e[32]^e[42],s=e[3]^e[13]^e[23]^e[33]^e[43],c=e[4]^e[14]^e[24]^e[34]^e[44],u=e[5]^e[15]^e[25]^e[35]^e[45],f=e[6]^e[16]^e[26]^e[36]^e[46],l=e[7]^e[17]^e[27]^e[37]^e[47],t=(h=e[8]^e[18]^e[28]^e[38]^e[48])^(a<<1|s>>>31),r=(p=e[9]^e[19]^e[29]^e[39]^e[49])^(s<<1|a>>>31),e[0]^=t,e[1]^=r,e[10]^=t,e[11]^=r,e[20]^=t,e[21]^=r,e[30]^=t,e[31]^=r,e[40]^=t,e[41]^=r,t=i^(c<<1|u>>>31),r=o^(u<<1|c>>>31),e[2]^=t,e[3]^=r,e[12]^=t,e[13]^=r,e[22]^=t,e[23]^=r,e[32]^=t,e[33]^=r,e[42]^=t,e[43]^=r,t=a^(f<<1|l>>>31),r=s^(l<<1|f>>>31),e[4]^=t,e[5]^=r,e[14]^=t,e[15]^=r,e[24]^=t,e[25]^=r,e[34]^=t,e[35]^=r,e[44]^=t,e[45]^=r,t=c^(h<<1|p>>>31),r=u^(p<<1|h>>>31),e[6]^=t,e[7]^=r,e[16]^=t,e[17]^=r,e[26]^=t,e[27]^=r,e[36]^=t,e[37]^=r,e[46]^=t,e[47]^=r,t=f^(i<<1|o>>>31),r=l^(o<<1|i>>>31),e[8]^=t,e[9]^=r,e[18]^=t,e[19]^=r,e[28]^=t,e[29]^=r,e[38]^=t,e[39]^=r,e[48]^=t,e[49]^=r,m=e[0],g=e[1],W=e[11]<<4|e[10]>>>28,G=e[10]<<4|e[11]>>>28,C=e[20]<<3|e[21]>>>29,I=e[21]<<3|e[20]>>>29,se=e[31]<<9|e[30]>>>23,ce=e[30]<<9|e[31]>>>23,q=e[40]<<18|e[41]>>>14,H=e[41]<<18|e[40]>>>14,j=e[2]<<1|e[3]>>>31,D=e[3]<<1|e[2]>>>31,y=e[13]<<12|e[12]>>>20,b=e[12]<<12|e[13]>>>20,V=e[22]<<10|e[23]>>>22,Z=e[23]<<10|e[22]>>>22,R=e[33]<<13|e[32]>>>19,N=e[32]<<13|e[33]>>>19,ue=e[42]<<2|e[43]>>>30,fe=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,re=e[4]<<30|e[5]>>>2,$=e[14]<<6|e[15]>>>26,B=e[15]<<6|e[14]>>>26,v=e[25]<<11|e[24]>>>21,w=e[24]<<11|e[25]>>>21,X=e[34]<<15|e[35]>>>17,Q=e[35]<<15|e[34]>>>17,O=e[45]<<29|e[44]>>>3,T=e[44]<<29|e[45]>>>3,P=e[6]<<28|e[7]>>>4,x=e[7]<<28|e[6]>>>4,ne=e[17]<<23|e[16]>>>9,ie=e[16]<<23|e[17]>>>9,F=e[26]<<25|e[27]>>>7,z=e[27]<<25|e[26]>>>7,A=e[36]<<21|e[37]>>>11,_=e[37]<<21|e[36]>>>11,Y=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,K=e[8]<<27|e[9]>>>5,J=e[9]<<27|e[8]>>>5,k=e[18]<<20|e[19]>>>12,M=e[19]<<20|e[18]>>>12,oe=e[29]<<7|e[28]>>>25,ae=e[28]<<7|e[29]>>>25,U=e[38]<<8|e[39]>>>24,L=e[39]<<8|e[38]>>>24,E=e[48]<<14|e[49]>>>18,S=e[49]<<14|e[48]>>>18,e[0]=m^~y&v,e[1]=g^~b&w,e[10]=P^~k&C,e[11]=x^~M&I,e[20]=j^~$&F,e[21]=D^~B&z,e[30]=K^~W&V,e[31]=J^~G&Z,e[40]=te^~ne&oe,e[41]=re^~ie&ae,e[2]=y^~v&A,e[3]=b^~w&_,e[12]=k^~C&R,e[13]=M^~I&N,e[22]=$^~F&U,e[23]=B^~z&L,e[32]=W^~V&X,e[33]=G^~Z&Q,e[42]=ne^~oe&se,e[43]=ie^~ae&ce,e[4]=v^~A&E,e[5]=w^~_&S,e[14]=C^~R&O,e[15]=I^~N&T,e[24]=F^~U&q,e[25]=z^~L&H,e[34]=V^~X&Y,e[35]=Z^~Q&ee,e[44]=oe^~se&ue,e[45]=ae^~ce&fe,e[6]=A^~E&m,e[7]=_^~S&g,e[16]=R^~O&P,e[17]=N^~T&x,e[26]=U^~q&j,e[27]=L^~H&D,e[36]=X^~Y&K,e[37]=Q^~ee&J,e[46]=se^~ue&te,e[47]=ce^~fe&re,e[8]=E^~m&y,e[9]=S^~g&b,e[18]=O^~P&k,e[19]=T^~x&M,e[28]=q^~j&$,e[29]=H^~D&B,e[38]=Y^~K&W,e[39]=ee^~J&G,e[48]=ue^~te&ne,e[49]=fe^~re&ie,e[0]^=d[n],e[1]^=d[n+1]};if(o)e.exports=E;else for(P=0;P>=8;return t}function as(e,t,r){let n=0;for(let i=0;it+1+n&&is.throwError("child data too short",bo.errors.BUFFER_OVERRUN,{})}return{consumed:1+n,result:i}}function fs(e,t){if(0===e.length&&is.throwError("data too short",bo.errors.BUFFER_OVERRUN,{}),e[t]>=248){const r=e[t]-247;t+1+r>e.length&&is.throwError("data short segment too short",bo.errors.BUFFER_OVERRUN,{});const n=as(e,t+1,r);return t+1+r+n>e.length&&is.throwError("data long segment too short",bo.errors.BUFFER_OVERRUN,{}),us(e,t,t+1+r,r+n)}if(e[t]>=192){const r=e[t]-192;return t+1+r>e.length&&is.throwError("data array too short",bo.errors.BUFFER_OVERRUN,{}),us(e,t,t+1,r)}if(e[t]>=184){const r=e[t]-183;t+1+r>e.length&&is.throwError("data array too short",bo.errors.BUFFER_OVERRUN,{});const n=as(e,t+1,r);t+1+r+n>e.length&&is.throwError("data array too short",bo.errors.BUFFER_OVERRUN,{});return{consumed:1+r+n,result:No(e.slice(t+1+r,t+1+r+n))}}if(e[t]>=128){const r=e[t]-128;t+1+r>e.length&&is.throwError("data too short",bo.errors.BUFFER_OVERRUN,{});return{consumed:1+r,result:No(e.slice(t+1,t+1+r))}}return{consumed:1,result:No(e[t])}}function ds(e){const t=xo(e),r=fs(t,0);return r.consumed!==t.length&&is.throwArgumentError("invalid rlp data","data",e),r.result}var ls=Object.freeze({__proto__:null,decode:ds,encode:cs});const hs=new bo("address/5.7.0");function ps(e){Io(e,20)||hs.throwArgumentError("invalid address","address",e);const t=(e=e.toLowerCase()).substring(2).split(""),r=new Uint8Array(40);for(let e=0;e<40;e++)r[e]=t[e].charCodeAt(0);const n=xo(rs(r));for(let e=0;e<40;e+=2)n[e>>1]>>4>=8&&(t[e]=t[e].toUpperCase()),(15&n[e>>1])>=8&&(t[e+1]=t[e+1].toUpperCase());return"0x"+t.join("")}const ms={};for(let e=0;e<10;e++)ms[String(e)]=String(e);for(let e=0;e<26;e++)ms[String.fromCharCode(65+e)]=String(10+e);const gs=Math.floor(function(e){return Math.log10?Math.log10(e):Math.log(e)/Math.LN10}(9007199254740991));function ys(e){let t=(e=(e=e.toUpperCase()).substring(4)+e.substring(0,2)+"00").split("").map((e=>ms[e])).join("");for(;t.length>=gs;){let e=t.substring(0,gs);t=parseInt(e,10)%97+t.substring(e.length)}let r=String(98-parseInt(t,10)%97);for(;r.length<2;)r="0"+r;return r}function bs(e){let t=null;if("string"!=typeof e&&hs.throwArgumentError("invalid address","address",e),e.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==e.substring(0,2)&&(e="0x"+e),t=ps(e),e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==e&&hs.throwArgumentError("bad address checksum","address",e);else if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(e.substring(2,4)!==ys(e)&&hs.throwArgumentError("bad icap checksum","address",e),r=e.substring(4),t=new qo(r,36).toString(16);t.length<40;)t="0"+t;t=ps("0x"+t)}else hs.throwArgumentError("invalid address","address",e);var r;return t}function vs(e){let t=null;try{t=bs(e.from)}catch(t){hs.throwArgumentError("missing from address","transaction",e)}return bs(To(rs(cs([t,Mo(xo(Go.from(e.nonce).toHexString()))])),12))}var ws=Object.freeze({__proto__:null,getAddress:bs,getContractAddress:vs,getCreate2Address:function(e,t,r){return 32!==Oo(t)&&hs.throwArgumentError("salt must be 32 bytes","salt",t),32!==Oo(r)&&hs.throwArgumentError("initCodeHash must be 32 bytes","initCodeHash",r),bs(To(rs(ko(["0xff",bs(e),t,r])),12))},getIcapAddress:function(e){let t=(r=bs(e).substring(2),new qo(r,16).toString(36)).toUpperCase();for(var r;t.length<30;)t="0"+t;return"XE"+ys("XE00"+t)+t},isAddress:function(e){try{return bs(e),!0}catch(e){}return!1}});class As extends Xa{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,t){try{t=bs(t)}catch(e){this._throwError(e.message,t)}return e.writeValue(t)}decode(e){return bs(Bo(e.readValue().toHexString(),20))}}class _s extends Xa{constructor(e){super(e.name,e.type,void 0,e.dynamic),this.coder=e}defaultValue(){return this.coder.defaultValue()}encode(e,t){return this.coder.encode(e,t)}decode(e){return this.coder.decode(e)}}const Es=new bo(Pa);function Ss(e,t,r){let n=null;if(Array.isArray(r))n=r;else if(r&&"object"==typeof r){let e={};n=t.map((t=>{const n=t.localName;return n||Es.throwError("cannot encode object for signature with missing names",bo.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:r}),e[n]&&Es.throwError("cannot encode object for signature with duplicate names",bo.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:r}),e[n]=!0,r[n]}))}else Es.throwArgumentError("invalid tuple value","tuple",r);t.length!==n.length&&Es.throwArgumentError("types/value length mismatch","tuple",r);let i=new Qa(e.wordSize),o=new Qa(e.wordSize),a=[];t.forEach(((e,t)=>{let r=n[t];if(e.dynamic){let t=o.length;e.encode(o,r);let n=i.writeUpdatableValue();a.push((e=>{n(e+t)}))}else e.encode(i,r)})),a.forEach((e=>{e(i.length)}));let s=e.appendWriter(i);return s+=e.appendWriter(o),s}function Ps(e,t){let r=[],n=e.subReader(0);t.forEach((t=>{let i=null;if(t.dynamic){let r=e.readValue(),o=n.subReader(r.toNumber());try{i=t.decode(o)}catch(e){if(e.code===bo.errors.BUFFER_OVERRUN)throw e;i=e,i.baseType=t.name,i.name=t.localName,i.type=t.type}}else try{i=t.decode(e)}catch(e){if(e.code===bo.errors.BUFFER_OVERRUN)throw e;i=e,i.baseType=t.name,i.name=t.localName,i.type=t.type}null!=i&&r.push(i)}));const i=t.reduce(((e,t)=>{const r=t.localName;return r&&(e[r]||(e[r]=0),e[r]++),e}),{});t.forEach(((e,t)=>{let n=e.localName;if(!n||1!==i[n])return;if("length"===n&&(n="_length"),null!=r[n])return;const o=r[t];o instanceof Error?Object.defineProperty(r,n,{enumerable:!0,get:()=>{throw o}}):r[n]=o}));for(let e=0;e{throw t}})}return Object.freeze(r)}class xs extends Xa{constructor(e,t,r){super("array",e.type+"["+(t>=0?t:"")+"]",r,-1===t||e.dynamic),this.coder=e,this.length=t}defaultValue(){const e=this.coder.defaultValue(),t=[];for(let r=0;re._data.length&&Es.throwError("insufficient data length",bo.errors.BUFFER_OVERRUN,{length:e._data.length,count:t}));let r=[];for(let e=0;e>6==2;n++)e++;return e}return e===zs.OVERRUN?r.length-t-1:0}!function(e){e.current="",e.NFC="NFC",e.NFD="NFD",e.NFKC="NFKC",e.NFKD="NFKD"}(Fs||(Fs={})),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"}(zs||(zs={}));const Ls=Object.freeze({error:function(e,t,r,n,i){return Bs.throwArgumentError(`invalid codepoint at offset ${t}; ${e}`,"bytes",r)},ignore:Us,replace:function(e,t,r,n,i){return e===zs.OVERLONG?(n.push(i),0):(n.push(65533),Us(e,t,r))}});function qs(e,t){null==t&&(t=Ls.error),e=xo(e);const r=[];let n=0;for(;n>7==0){r.push(i);continue}let o=null,a=null;if(192==(224&i))o=1,a=127;else if(224==(240&i))o=2,a=2047;else{if(240!=(248&i)){n+=t(128==(192&i)?zs.UNEXPECTED_CONTINUE:zs.BAD_PREFIX,n-1,e,r);continue}o=3,a=65535}if(n-1+o>=e.length){n+=t(zs.OVERRUN,n-1,e,r);continue}let s=i&(1<<8-o-1)-1;for(let i=0;i1114111?n+=t(zs.OUT_OF_RANGE,n-1-o,e,r,s):s>=55296&&s<=57343?n+=t(zs.UTF16_SURROGATE,n-1-o,e,r,s):s<=a?n+=t(zs.OVERLONG,n-1-o,e,r,s):r.push(s))}return r}function Hs(e,t=Fs.current){t!=Fs.current&&(Bs.checkNormalize(),e=e.normalize(t));let r=[];for(let t=0;t>6|192),r.push(63&n|128);else if(55296==(64512&n)){t++;const i=e.charCodeAt(t);if(t>=e.length||56320!=(64512&i))throw new Error("invalid utf-8 string");const o=65536+((1023&n)<<10)+(1023&i);r.push(o>>18|240),r.push(o>>12&63|128),r.push(o>>6&63|128),r.push(63&o|128)}else r.push(n>>12|224),r.push(n>>6&63|128),r.push(63&n|128)}return xo(r)}function Ks(e){const t="0000"+e.toString(16);return"\\u"+t.substring(t.length-4)}function Js(e){return e.map((e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10&1023),56320+(1023&e))))).join("")}function Ws(e,t){return Js(qs(e,t))}function Gs(e,t=Fs.current){return qs(Hs(e,t))}function Vs(e,t){t||(t=function(e){return[parseInt(e,16)]});let r=0,n={};return e.split(",").forEach((e=>{let i=e.split(":");r+=parseInt(i[0],16),n[r]=t(i[1])})),n}function Zs(e){let t=0;return e.split(",").map((e=>{let r=e.split("-");1===r.length?r[1]="0":""===r[1]&&(r[1]="1");let n=t+parseInt(r[0],16);return t=parseInt(r[1],16),{l:n,h:t}}))}function Xs(e,t){let r=0;for(let n=0;n=r&&e<=r+i.h&&(e-r)%(i.d||1)==0){if(i.e&&-1!==i.e.indexOf(e-r))continue;return i}}return null}const Qs=Zs("221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d"),Ys="ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map((e=>parseInt(e,16))),ec=[{h:25,s:32,l:65},{h:30,s:32,e:[23],l:127},{h:54,s:1,e:[48],l:64,d:2},{h:14,s:1,l:57,d:2},{h:44,s:1,l:17,d:2},{h:10,s:1,e:[2,6,8],l:61,d:2},{h:16,s:1,l:68,d:2},{h:84,s:1,e:[18,24,66],l:19,d:2},{h:26,s:32,e:[17],l:435},{h:22,s:1,l:71,d:2},{h:15,s:80,l:40},{h:31,s:32,l:16},{h:32,s:1,l:80,d:2},{h:52,s:1,l:42,d:2},{h:12,s:1,l:55,d:2},{h:40,s:1,e:[38],l:15,d:2},{h:14,s:1,l:48,d:2},{h:37,s:48,l:49},{h:148,s:1,l:6351,d:2},{h:88,s:1,l:160,d:2},{h:15,s:16,l:704},{h:25,s:26,l:854},{h:25,s:32,l:55915},{h:37,s:40,l:1247},{h:25,s:-119711,l:53248},{h:25,s:-119763,l:52},{h:25,s:-119815,l:52},{h:25,s:-119867,e:[1,4,5,7,8,11,12,17],l:52},{h:25,s:-119919,l:52},{h:24,s:-119971,e:[2,7,8,17],l:52},{h:24,s:-120023,e:[2,7,13,15,16,17],l:52},{h:25,s:-120075,l:52},{h:25,s:-120127,l:52},{h:25,s:-120179,l:52},{h:25,s:-120231,l:52},{h:25,s:-120283,l:52},{h:25,s:-120335,l:52},{h:24,s:-119543,e:[17],l:56},{h:24,s:-119601,e:[17],l:58},{h:24,s:-119659,e:[17],l:58},{h:24,s:-119717,e:[17],l:58},{h:24,s:-119775,e:[17],l:58}],tc=Vs("b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3"),rc=Vs("179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7"),nc=Vs("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D",(function(e){if(e.length%4!=0)throw new Error("bad data");let t=[];for(let r=0;r{if(e<256){switch(e){case 8:return"\\b";case 9:return"\\t";case 10:return"\\n";case 13:return"\\r";case 34:return'\\"';case 92:return"\\\\"}if(e>=32&&e<127)return String.fromCharCode(e)}return e<=65535?Ks(e):Ks(55296+((e-=65536)>>10&1023))+Ks(56320+(1023&e))})).join("")+'"'},formatBytes32String:function(e){const t=Hs(e);if(t.length>31)throw new Error("bytes32 string must be less than 32 bytes");return No(ko([t,Ds]).slice(0,32))},nameprep:function(e){if(e.match(/^[a-z0-9-]*$/i)&&e.length<=59)return e.toLowerCase();let t=Gs(e);var r;r=t.map((e=>{if(Ys.indexOf(e)>=0)return[];if(e>=65024&&e<=65039)return[];let t=function(e){let t=Xs(e,ec);if(t)return[e+t.s];let r=tc[e];if(r)return r;let n=rc[e];return n?[e+n[0]]:nc[e]||null}(e);return t||[e]})),t=r.reduce(((e,t)=>(t.forEach((t=>{e.push(t)})),e)),[]),t=Gs(Js(t),Fs.NFKC),t.forEach((e=>{if(Xs(e,ic))throw new Error("STRINGPREP_CONTAINS_PROHIBITED")})),t.forEach((e=>{if(Xs(e,Qs))throw new Error("STRINGPREP_CONTAINS_UNASSIGNED")}));let n=Js(t);if("-"===n.substring(0,1)||"--"===n.substring(2,4)||"-"===n.substring(n.length-1))throw new Error("invalid hyphen");return n},parseBytes32String:function(e){const t=xo(e);if(32!==t.length)throw new Error("invalid bytes32 - not 32 bytes long");if(0!==t[31])throw new Error("invalid bytes32 string - no null terminator");let r=31;for(;0===t[r-1];)r--;return Ws(t.slice(0,r))},toUtf8Bytes:Hs,toUtf8CodePoints:Gs,toUtf8String:Ws});class ac extends Ms{constructor(e){super("string",e)}defaultValue(){return""}encode(e,t){return super.encode(e,Hs(t))}decode(e){return Ws(super.decode(e))}}class sc extends Xa{constructor(e,t){let r=!1;const n=[];e.forEach((e=>{e.dynamic&&(r=!0),n.push(e.type)}));super("tuple","tuple("+n.join(",")+")",t,r),this.coders=e}defaultValue(){const e=[];this.coders.forEach((t=>{e.push(t.defaultValue())}));const t=this.coders.reduce(((e,t)=>{const r=t.localName;return r&&(e[r]||(e[r]=0),e[r]++),e}),{});return this.coders.forEach(((r,n)=>{let i=r.localName;i&&1===t[i]&&("length"===i&&(i="_length"),null==e[i]&&(e[i]=e[n]))})),Object.freeze(e)}encode(e,t){return Ss(e,this.coders,t)}decode(e){return e.coerce(this.name,Ps(e,this.coders))}}const cc=new bo(Pa),uc=new RegExp(/^bytes([0-9]*)$/),fc=new RegExp(/^(u?int)([0-9]*)$/);class dc{constructor(e){pa(this,"coerceFunc",e||null)}_getCoder(e){switch(e.baseType){case"address":return new As(e.name);case"bool":return new ks(e.name);case"string":return new ac(e.name);case"bytes":return new Cs(e.name);case"array":return new xs(this._getCoder(e.arrayChildren),e.arrayLength,e.name);case"tuple":return new sc((e.components||[]).map((e=>this._getCoder(e))),e.name);case"":return new Rs(e.name)}let t=e.type.match(fc);if(t){let r=parseInt(t[2]||"256");return(0===r||r>256||r%8!=0)&&cc.throwArgumentError("invalid "+t[1]+" bit length","param",e),new $s(r/8,"int"===t[1],e.name)}if(t=e.type.match(uc),t){let r=parseInt(t[1]);return(0===r||r>32)&&cc.throwArgumentError("invalid bytes length","param",e),new Is(r,e.name)}return cc.throwArgumentError("invalid type","type",e.type)}_getWordSize(){return 32}_getReader(e,t){return new Ya(e,this._getWordSize(),this.coerceFunc,t)}_getWriter(){return new Qa(this._getWordSize())}getDefaultValue(e){const t=e.map((e=>this._getCoder(Ta.from(e))));return new sc(t,"_").defaultValue()}encode(e,t){e.length!==t.length&&cc.throwError("types/values length mismatch",bo.errors.INVALID_ARGUMENT,{count:{types:e.length,values:t.length},value:{types:e,values:t}});const r=e.map((e=>this._getCoder(Ta.from(e)))),n=new sc(r,"_"),i=this._getWriter();return n.encode(i,t),i.data}decode(e,t,r){const n=e.map((e=>this._getCoder(Ta.from(e))));return new sc(n,"_").decode(this._getReader(xo(t),r))}}const lc=new dc;function hc(e){return rs(Hs(e))}const pc="hash/5.7.0";function mc(e){e=atob(e);const t=[];for(let r=0;r0&&Array.isArray(e)?i(e,t-1):r.push(e)}))};return i(e,t),r}function vc(e){return function(e){let t=0;return()=>e[t++]}(function(e){let t=0;function r(){return e[t++]<<8|e[t++]}let n=r(),i=1,o=[0,1];for(let e=1;e>--c&1}const d=Math.pow(2,31),l=d>>>1,h=l>>1,p=d-1;let m=0;for(let e=0;e<31;e++)m=m<<1|f();let g=[],y=0,b=d;for(;;){let e=Math.floor(((m-y+1)*i-1)/b),t=0,r=n;for(;r-t>1;){let n=t+r>>>1;e>>1|f(),a=a<<1^l,s=(s^l)<<1|l|1;y=a,b=1+s-a}let v=n-4;return g.map((t=>{switch(t-v){case 3:return v+65792+(e[s++]<<16|e[s++]<<8|e[s++]);case 2:return v+256+(e[s++]<<8|e[s++]);case 1:return v+e[s++];default:return t-1}}))}(e))}function wc(e){return 1&e?~e>>1:e>>1}function Ac(e,t){let r=Array(e);for(let n=0,i=-1;nt[e])):r}function Sc(e,t,r){let n=Array(e).fill(void 0).map((()=>[]));for(let i=0;in[t].push(e)));return n}function Pc(e,t){let r=1+t(),n=t(),i=function(e){let t=[];for(;;){let r=e();if(0==r)break;t.push(r)}return t}(t);return bc(Sc(i.length,1+e,t).map(((e,t)=>{const o=e[0],a=e.slice(1);return Array(i[t]).fill(void 0).map(((e,t)=>{let i=t*n;return[o+t*r,a.map((e=>e+i))]}))})))}function xc(e,t){return Sc(1+t(),1+e,t).map((e=>[e[0],e.slice(1)]))}const kc=vc(mc("AEQF2AO2DEsA2wIrAGsBRABxAN8AZwCcAEwAqgA0AGwAUgByADcATAAVAFYAIQAyACEAKAAYAFgAGwAjABQAMAAmADIAFAAfABQAKwATACoADg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M3NC4j6dS1+9Umr2oPavqiAydTZPLMNRGY23LO9zAVDly7jD+70G5TPPLdhRIl4WxcYjLnM+SNcJ26FOrkrISUtPObIz5Zb3AG612krnpy15RMW+1cQjlnWFI6538qky9axd2oJmHIHP08KyP0ubGO+TQNOYuv2uh17yCIvR8VcStw7o1g0NM60sk+8Tq7YfIBJrtp53GkvzXH7OA0p8/n/u1satf/VJhtR1l8Wa6Gmaug7haSpaCaYQax6ta0mkutlb+eAOSG1aobM81D9A4iS1RRlzBBoVX6tU1S6WE2N9ORY6DfeLRC4l9Rvr5h95XDWB2mR1d4WFudpsgVYwiTwT31ljskD8ZyDOlm5DkGh9N/UB/0AI5Xvb8ZBmai2hQ4BWMqFwYnzxwB26YHSOv9WgY3JXnvoN+2R4rqGVh/LLDMtpFP+SpMGJNWvbIl5SOodbCczW2RKleksPoUeGEzrjtKHVdtZA+kfqO+rVx/iclCqwoopepvJpSTDjT+b9GWylGRF8EDbGlw6eUzmJM95Ovoz+kwLX3c2fTjFeYEsE7vUZm3mqdGJuKh2w9/QGSaqRHs99aScGOdDqkFcACoqdbBoQqqjamhH6Q9ng39JCg3lrGJwd50Qk9ovnqBTr8MME7Ps2wiVfygUmPoUBJJfJWX5Nda0nuncbFkA==")),Mc=new Set(Ec(kc)),Cc=new Set(Ec(kc)),Ic=function(e){let t=[];for(;;){let r=e();if(0==r)break;t.push(Pc(r,e))}for(;;){let r=e()-1;if(r<0)break;t.push(xc(r,e))}return function(e){const t={};for(let r=0;re-t));return function r(){let n=[];for(;;){let i=Ec(e,t);if(0==i.length)break;n.push({set:new Set(i),node:r()})}n.sort(((e,t)=>t.set.size-e.set.size));let i=e(),o=i%3;i=i/3|0;let a=!!(1&i);return i>>=1,{branches:n,valid:o,fe0f:a,save:1==i,check:2==i}}()}(kc),Nc=45,Oc=95;function Tc(e){return Gs(e)}function jc(e){return e.filter((e=>65039!=e))}function Dc(e){for(let t of e.split(".")){let e=Tc(t);try{for(let t=e.lastIndexOf(Oc)-1;t>=0;t--)if(e[t]!==Oc)throw new Error("underscore only allowed at start");if(e.length>=4&&e.every((e=>e<128))&&e[2]===Nc&&e[3]===Nc)throw new Error("invalid label extension")}catch(e){throw new Error(`Invalid label "${t}": ${e.message}`)}}return e}function $c(e){return Dc(function(e,t){let r=Tc(e).reverse(),n=[];for(;r.length;){let e=Bc(r);if(e){n.push(...t(e));continue}let i=r.pop();if(Mc.has(i)){n.push(i);continue}if(Cc.has(i))continue;let o=Ic[i];if(!o)throw new Error(`Disallowed codepoint: 0x${i.toString(16).toUpperCase()}`);n.push(...o)}return Dc(function(e){return e.normalize("NFC")}(String.fromCodePoint(...n)))}(e,jc))}function Bc(e,t){var r;let n,i,o=Rc,a=[],s=e.length;for(t&&(t.length=0);s;){let c=e[--s];if(o=null===(r=o.branches.find((e=>e.set.has(c))))||void 0===r?void 0:r.node,!o)break;if(o.save)i=c;else if(o.check&&c===i)break;a.push(c),o.fe0f&&(a.push(65039),s>0&&65039==e[s-1]&&s--),o.valid&&(n=a.slice(),2==o.valid&&n.splice(1,1),t&&t.push(...e.slice(s).reverse()),e.length=s)}return n}const Fc=new bo(pc),zc=new Uint8Array(32);function Uc(e){if(0===e.length)throw new Error("invalid ENS name; empty component");return e}function Lc(e){const t=Hs($c(e)),r=[];if(0===e.length)return r;let n=0;for(let e=0;e=t.length)throw new Error("invalid ENS name; empty component");return r.push(Uc(t.slice(n))),r}function qc(e){"string"!=typeof e&&Fc.throwArgumentError("invalid ENS name; not a string","name",e);let t=zc;const r=Lc(e);for(;r.length;)t=rs(ko([t,rs(r.pop())]));return No(t)}function Hc(e){return No(ko(Lc(e).map((e=>{if(e.length>63)throw new Error("invalid DNS encoded entry; length exceeds 63 bytes");const t=new Uint8Array(e.length+1);return t.set(e,1),t[0]=t.length-1,t}))))+"00"}zc.fill(0);const Kc="Ethereum Signed Message:\n";function Jc(e){return"string"==typeof e&&(e=Hs(e)),rs(ko([Hs(Kc),Hs(String(e.length)),e]))}var Wc=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))};const Gc=new bo(pc),Vc=new Uint8Array(32);Vc.fill(0);const Zc=Go.from(-1),Xc=Go.from(0),Qc=Go.from(1),Yc=Go.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");const eu=Bo(Qc.toHexString(),32),tu=Bo(Xc.toHexString(),32),ru={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},nu=["name","version","chainId","verifyingContract","salt"];function iu(e){return function(t){return"string"!=typeof t&&Gc.throwArgumentError(`invalid domain value for ${JSON.stringify(e)}`,`domain.${e}`,t),t}}const ou={name:iu("name"),version:iu("version"),chainId:function(e){try{return Go.from(e).toString()}catch(e){}return Gc.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",e)},verifyingContract:function(e){try{return bs(e).toLowerCase()}catch(e){}return Gc.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",e)},salt:function(e){try{const t=xo(e);if(32!==t.length)throw new Error("bad length");return No(t)}catch(e){}return Gc.throwArgumentError('invalid domain value "salt"',"domain.salt",e)}};function au(e){{const t=e.match(/^(u?)int(\d*)$/);if(t){const r=""===t[1],n=parseInt(t[2]||"256");(n%8!=0||n>256||t[2]&&t[2]!==String(n))&&Gc.throwArgumentError("invalid numeric width","type",e);const i=Yc.mask(r?n-1:n),o=r?i.add(Qc).mul(Zc):Xc;return function(t){const r=Go.from(t);return(r.lt(o)||r.gt(i))&&Gc.throwArgumentError(`value out-of-bounds for ${e}`,"value",t),Bo(r.toTwos(256).toHexString(),32)}}}{const t=e.match(/^bytes(\d+)$/);if(t){const r=parseInt(t[1]);return(0===r||r>32||t[1]!==String(r))&&Gc.throwArgumentError("invalid bytes width","type",e),function(t){return xo(t).length!==r&&Gc.throwArgumentError(`invalid length for ${e}`,"value",t),function(e){const t=xo(e),r=t.length%32;return r?jo([t,Vc.slice(r)]):No(t)}(t)}}}switch(e){case"address":return function(e){return Bo(bs(e),32)};case"bool":return function(e){return e?eu:tu};case"bytes":return function(e){return rs(e)};case"string":return function(e){return hc(e)}}return null}function su(e,t){return`${e}(${t.map((({name:e,type:t})=>t+" "+e)).join(",")})`}class cu{constructor(e){pa(this,"types",Object.freeze(_a(e))),pa(this,"_encoderCache",{}),pa(this,"_types",{});const t={},r={},n={};Object.keys(e).forEach((e=>{t[e]={},r[e]=[],n[e]={}}));for(const n in e){const i={};e[n].forEach((o=>{i[o.name]&&Gc.throwArgumentError(`duplicate variable name ${JSON.stringify(o.name)} in ${JSON.stringify(n)}`,"types",e),i[o.name]=!0;const a=o.type.match(/^([^\x5b]*)(\x5b|$)/)[1];a===n&&Gc.throwArgumentError(`circular type reference to ${JSON.stringify(a)}`,"types",e);au(a)||(r[a]||Gc.throwArgumentError(`unknown type ${JSON.stringify(a)}`,"types",e),r[a].push(n),t[n][a]=!0)}))}const i=Object.keys(r).filter((e=>0===r[e].length));0===i.length?Gc.throwArgumentError("missing primary type","types",e):i.length>1&&Gc.throwArgumentError(`ambiguous primary types or unused types: ${i.map((e=>JSON.stringify(e))).join(", ")}`,"types",e),pa(this,"primaryType",i[0]),function i(o,a){a[o]&&Gc.throwArgumentError(`circular type reference to ${JSON.stringify(o)}`,"types",e),a[o]=!0,Object.keys(t[o]).forEach((e=>{r[e]&&(i(e,a),Object.keys(a).forEach((t=>{n[t][e]=!0})))})),delete a[o]}(this.primaryType,{});for(const t in n){const r=Object.keys(n[t]);r.sort(),this._types[t]=su(t,e[t])+r.map((t=>su(t,e[t]))).join("")}}getEncoder(e){let t=this._encoderCache[e];return t||(t=this._encoderCache[e]=this._getEncoder(e)),t}_getEncoder(e){{const t=au(e);if(t)return t}const t=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(t){const e=t[1],r=this.getEncoder(e),n=parseInt(t[3]);return t=>{n>=0&&t.length!==n&&Gc.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",t);let i=t.map(r);return this._types[e]&&(i=i.map(rs)),rs(jo(i))}}const r=this.types[e];if(r){const t=hc(this._types[e]);return e=>{const n=r.map((({name:t,type:r})=>{const n=this.getEncoder(r)(e[t]);return this._types[r]?rs(n):n}));return n.unshift(t),jo(n)}}return Gc.throwArgumentError(`unknown type: ${e}`,"type",e)}encodeType(e){const t=this._types[e];return t||Gc.throwArgumentError(`unknown type: ${JSON.stringify(e)}`,"name",e),t}encodeData(e,t){return this.getEncoder(e)(t)}hashStruct(e,t){return rs(this.encodeData(e,t))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,t,r){if(au(e))return r(e,t);const n=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(n){const e=n[1],i=parseInt(n[3]);return i>=0&&t.length!==i&&Gc.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",t),t.map((t=>this._visit(e,t,r)))}const i=this.types[e];return i?i.reduce(((e,{name:n,type:i})=>(e[n]=this._visit(i,t[n],r),e)),{}):Gc.throwArgumentError(`unknown type: ${e}`,"type",e)}visit(e,t){return this._visit(this.primaryType,e,t)}static from(e){return new cu(e)}static getPrimaryType(e){return cu.from(e).primaryType}static hashStruct(e,t,r){return cu.from(t).hashStruct(e,r)}static hashDomain(e){const t=[];for(const r in e){const n=ru[r];n||Gc.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(r)}`,"domain",e),t.push({name:r,type:n})}return t.sort(((e,t)=>nu.indexOf(e.name)-nu.indexOf(t.name))),cu.hashStruct("EIP712Domain",{EIP712Domain:t},e)}static encode(e,t,r){return jo(["0x1901",cu.hashDomain(e),cu.from(t).hash(r)])}static hash(e,t,r){return rs(cu.encode(e,t,r))}static resolveNames(e,t,r,n){return Wc(this,void 0,void 0,(function*(){e=ba(e);const i={};e.verifyingContract&&!Io(e.verifyingContract,20)&&(i[e.verifyingContract]="0x");const o=cu.from(t);o.visit(r,((e,t)=>("address"!==e||Io(t,20)||(i[t]="0x"),t)));for(const e in i)i[e]=yield n(e);return e.verifyingContract&&i[e.verifyingContract]&&(e.verifyingContract=i[e.verifyingContract]),r=o.visit(r,((e,t)=>"address"===e&&i[t]?i[t]:t)),{domain:e,value:r}}))}static getPayload(e,t,r){cu.hashDomain(e);const n={},i=[];nu.forEach((t=>{const r=e[t];null!=r&&(n[t]=ou[t](r),i.push({name:t,type:ru[t]}))}));const o=cu.from(t),a=ba(t);return a.EIP712Domain?Gc.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",t):a.EIP712Domain=i,o.encode(r),{types:a,domain:n,primaryType:o.primaryType,message:o.visit(r,((e,t)=>{if(e.match(/^bytes(\d*)/))return No(xo(t));if(e.match(/^u?int/))return Go.from(t).toString();switch(e){case"address":return t.toLowerCase();case"bool":return!!t;case"string":return"string"!=typeof t&&Gc.throwArgumentError("invalid string","value",t),t}return Gc.throwArgumentError("unsupported type","type",e)}))}}}var uu=Object.freeze({__proto__:null,_TypedDataEncoder:cu,dnsEncode:Hc,ensNormalize:function(e){return Lc(e).map((e=>Ws(e))).join(".")},hashMessage:Jc,id:hc,isValidName:function(e){try{return 0!==Lc(e).length}catch(e){}return!1},messagePrefix:Kc,namehash:qc});const fu=new bo(Pa);class du extends Ea{}class lu extends Ea{}class hu extends Ea{}class pu extends Ea{static isIndexed(e){return!(!e||!e._isIndexed)}}const mu={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function gu(e,t){const r=new Error(`deferred error during ABI decoding triggered accessing ${e}`);return r.error=t,r}class yu{constructor(e){let t=[];t="string"==typeof e?JSON.parse(e):e,pa(this,"fragments",t.map((e=>Da.from(e))).filter((e=>null!=e))),pa(this,"_abiCoder",ma(new.target,"getAbiCoder")()),pa(this,"functions",{}),pa(this,"errors",{}),pa(this,"events",{}),pa(this,"structs",{}),this.fragments.forEach((e=>{let t=null;switch(e.type){case"constructor":return this.deploy?void fu.warn("duplicate definition - constructor"):void pa(this,"deploy",e);case"function":t=this.functions;break;case"event":t=this.events;break;case"error":t=this.errors;break;default:return}let r=e.format();t[r]?fu.warn("duplicate definition - "+r):t[r]=e})),this.deploy||pa(this,"deploy",Ua.from({payable:!1,type:"constructor"})),pa(this,"_isInterface",!0)}format(e){e||(e=Na.full),e===Na.sighash&&fu.throwArgumentError("interface does not support formatting sighash","format",e);const t=this.fragments.map((t=>t.format(e)));return e===Na.json?JSON.stringify(t.map((e=>JSON.parse(e)))):t}static getAbiCoder(){return lc}static getAddress(e){return bs(e)}static getSighash(e){return To(hc(e.format()),0,4)}static getEventTopic(e){return hc(e.format())}getFunction(e){if(Io(e)){for(const t in this.functions)if(e===this.getSighash(t))return this.functions[t];fu.throwArgumentError("no matching function","sighash",e)}if(-1===e.indexOf("(")){const t=e.trim(),r=Object.keys(this.functions).filter((e=>e.split("(")[0]===t));return 0===r.length?fu.throwArgumentError("no matching function","name",t):r.length>1&&fu.throwArgumentError("multiple matching functions","name",t),this.functions[r[0]]}const t=this.functions[La.fromString(e).format()];return t||fu.throwArgumentError("no matching function","signature",e),t}getEvent(e){if(Io(e)){const t=e.toLowerCase();for(const e in this.events)if(t===this.getEventTopic(e))return this.events[e];fu.throwArgumentError("no matching event","topichash",t)}if(-1===e.indexOf("(")){const t=e.trim(),r=Object.keys(this.events).filter((e=>e.split("(")[0]===t));return 0===r.length?fu.throwArgumentError("no matching event","name",t):r.length>1&&fu.throwArgumentError("multiple matching events","name",t),this.events[r[0]]}const t=this.events[$a.fromString(e).format()];return t||fu.throwArgumentError("no matching event","signature",e),t}getError(e){if(Io(e)){const t=ma(this.constructor,"getSighash");for(const r in this.errors){if(e===t(this.errors[r]))return this.errors[r]}fu.throwArgumentError("no matching error","sighash",e)}if(-1===e.indexOf("(")){const t=e.trim(),r=Object.keys(this.errors).filter((e=>e.split("(")[0]===t));return 0===r.length?fu.throwArgumentError("no matching error","name",t):r.length>1&&fu.throwArgumentError("multiple matching errors","name",t),this.errors[r[0]]}const t=this.errors[La.fromString(e).format()];return t||fu.throwArgumentError("no matching error","signature",e),t}getSighash(e){if("string"==typeof e)try{e=this.getFunction(e)}catch(t){try{e=this.getError(e)}catch(e){throw t}}return ma(this.constructor,"getSighash")(e)}getEventTopic(e){return"string"==typeof e&&(e=this.getEvent(e)),ma(this.constructor,"getEventTopic")(e)}_decodeParams(e,t){return this._abiCoder.decode(e,t)}_encodeParams(e,t){return this._abiCoder.encode(e,t)}encodeDeploy(e){return this._encodeParams(this.deploy.inputs,e||[])}decodeErrorResult(e,t){"string"==typeof e&&(e=this.getError(e));const r=xo(t);return No(r.slice(0,4))!==this.getSighash(e)&&fu.throwArgumentError(`data signature does not match error ${e.name}.`,"data",No(r)),this._decodeParams(e.inputs,r.slice(4))}encodeErrorResult(e,t){return"string"==typeof e&&(e=this.getError(e)),No(ko([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}decodeFunctionData(e,t){"string"==typeof e&&(e=this.getFunction(e));const r=xo(t);return No(r.slice(0,4))!==this.getSighash(e)&&fu.throwArgumentError(`data signature does not match function ${e.name}.`,"data",No(r)),this._decodeParams(e.inputs,r.slice(4))}encodeFunctionData(e,t){return"string"==typeof e&&(e=this.getFunction(e)),No(ko([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}decodeFunctionResult(e,t){"string"==typeof e&&(e=this.getFunction(e));let r=xo(t),n=null,i="",o=null,a=null,s=null;switch(r.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(e.outputs,r)}catch(e){}break;case 4:{const e=No(r.slice(0,4)),t=mu[e];if(t)o=this._abiCoder.decode(t.inputs,r.slice(4)),a=t.name,s=t.signature,t.reason&&(n=o[0]),"Error"===a?i=`; VM Exception while processing transaction: reverted with reason string ${JSON.stringify(o[0])}`:"Panic"===a&&(i=`; VM Exception while processing transaction: reverted with panic code ${o[0]}`);else try{const t=this.getError(e);o=this._abiCoder.decode(t.inputs,r.slice(4)),a=t.name,s=t.format()}catch(e){}break}}return fu.throwError("call revert exception"+i,bo.errors.CALL_EXCEPTION,{method:e.format(),data:No(t),errorArgs:o,errorName:a,errorSignature:s,reason:n})}encodeFunctionResult(e,t){return"string"==typeof e&&(e=this.getFunction(e)),No(this._abiCoder.encode(e.outputs,t||[]))}encodeFilterTopics(e,t){"string"==typeof e&&(e=this.getEvent(e)),t.length>e.inputs.length&&fu.throwError("too many arguments for "+e.format(),bo.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:t});let r=[];e.anonymous||r.push(this.getEventTopic(e));const n=(e,t)=>"string"===e.type?hc(t):"bytes"===e.type?rs(No(t)):("bool"===e.type&&"boolean"==typeof t&&(t=t?"0x01":"0x00"),e.type.match(/^u?int/)&&(t=Go.from(t).toHexString()),"address"===e.type&&this._abiCoder.encode(["address"],[t]),Bo(No(t),32));for(t.forEach(((t,i)=>{let o=e.inputs[i];o.indexed?null==t?r.push(null):"array"===o.baseType||"tuple"===o.baseType?fu.throwArgumentError("filtering with tuples or arrays not supported","contract."+o.name,t):Array.isArray(t)?r.push(t.map((e=>n(o,e)))):r.push(n(o,t)):null!=t&&fu.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+o.name,t)}));r.length&&null===r[r.length-1];)r.pop();return r}encodeEventLog(e,t){"string"==typeof e&&(e=this.getEvent(e));const r=[],n=[],i=[];return e.anonymous||r.push(this.getEventTopic(e)),t.length!==e.inputs.length&&fu.throwArgumentError("event arguments/values mismatch","values",t),e.inputs.forEach(((e,o)=>{const a=t[o];if(e.indexed)if("string"===e.type)r.push(hc(a));else if("bytes"===e.type)r.push(rs(a));else{if("tuple"===e.baseType||"array"===e.baseType)throw new Error("not implemented");r.push(this._abiCoder.encode([e.type],[a]))}else n.push(e),i.push(a)})),{data:this._abiCoder.encode(n,i),topics:r}}decodeEventLog(e,t,r){if("string"==typeof e&&(e=this.getEvent(e)),null!=r&&!e.anonymous){let t=this.getEventTopic(e);Io(r[0],32)&&r[0].toLowerCase()===t||fu.throwError("fragment/topic mismatch",bo.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:t,value:r[0]}),r=r.slice(1)}let n=[],i=[],o=[];e.inputs.forEach(((e,t)=>{e.indexed?"string"===e.type||"bytes"===e.type||"tuple"===e.baseType||"array"===e.baseType?(n.push(Ta.fromObject({type:"bytes32",name:e.name})),o.push(!0)):(n.push(e),o.push(!1)):(i.push(e),o.push(!1))}));let a=null!=r?this._abiCoder.decode(n,ko(r)):null,s=this._abiCoder.decode(i,t,!0),c=[],u=0,f=0;e.inputs.forEach(((e,t)=>{if(e.indexed)if(null==a)c[t]=new pu({_isIndexed:!0,hash:null});else if(o[t])c[t]=new pu({_isIndexed:!0,hash:a[f++]});else try{c[t]=a[f++]}catch(e){c[t]=e}else try{c[t]=s[u++]}catch(e){c[t]=e}if(e.name&&null==c[e.name]){const r=c[t];r instanceof Error?Object.defineProperty(c,e.name,{enumerable:!0,get:()=>{throw gu(`property ${JSON.stringify(e.name)}`,r)}}):c[e.name]=r}}));for(let e=0;e{throw gu(`index ${e}`,t)}})}return Object.freeze(c)}parseTransaction(e){let t=this.getFunction(e.data.substring(0,10).toLowerCase());return t?new lu({args:this._abiCoder.decode(t.inputs,"0x"+e.data.substring(10)),functionFragment:t,name:t.name,signature:t.format(),sighash:this.getSighash(t),value:Go.from(e.value||"0")}):null}parseLog(e){let t=this.getEvent(e.topics[0]);return!t||t.anonymous?null:new du({eventFragment:t,name:t.name,signature:t.format(),topic:this.getEventTopic(t),args:this.decodeEventLog(t,e.data,e.topics)})}parseError(e){const t=No(e);let r=this.getError(t.substring(0,10).toLowerCase());return r?new hu({args:this._abiCoder.decode(r.inputs,"0x"+t.substring(10)),errorFragment:r,name:r.name,signature:r.format(),sighash:this.getSighash(r)}):null}static isInterface(e){return!(!e||!e._isInterface)}}var bu=Object.freeze({__proto__:null,AbiCoder:dc,ConstructorFragment:Ua,ErrorFragment:Ha,EventFragment:$a,FormatTypes:Na,Fragment:Da,FunctionFragment:La,Indexed:pu,Interface:yu,LogDescription:du,ParamType:Ta,TransactionDescription:lu,checkResultErrors:Za,defaultAbiCoder:lc});var vu=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))};const wu=new bo("abstract-provider/5.7.0");class Au extends Ea{static isForkEvent(e){return!(!e||!e._isForkEvent)}}class _u{constructor(){wu.checkAbstract(new.target,_u),pa(this,"_isProvider",!0)}getFeeData(){return vu(this,void 0,void 0,(function*(){const{block:e,gasPrice:t}=yield ga({block:this.getBlock("latest"),gasPrice:this.getGasPrice().catch((e=>null))});let r=null,n=null,i=null;return e&&e.baseFeePerGas&&(r=e.baseFeePerGas,i=Go.from("1500000000"),n=e.baseFeePerGas.mul(2).add(i)),{lastBaseFeePerGas:r,maxFeePerGas:n,maxPriorityFeePerGas:i,gasPrice:t}}))}addListener(e,t){return this.on(e,t)}removeListener(e,t){return this.off(e,t)}static isProvider(e){return!(!e||!e._isProvider)}}var Eu=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))};const Su=new bo("abstract-signer/5.7.0"),Pu=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],xu=[bo.errors.INSUFFICIENT_FUNDS,bo.errors.NONCE_EXPIRED,bo.errors.REPLACEMENT_UNDERPRICED];class ku{constructor(){Su.checkAbstract(new.target,ku),pa(this,"_isSigner",!0)}getBalance(e){return Eu(this,void 0,void 0,(function*(){return this._checkProvider("getBalance"),yield this.provider.getBalance(this.getAddress(),e)}))}getTransactionCount(e){return Eu(this,void 0,void 0,(function*(){return this._checkProvider("getTransactionCount"),yield this.provider.getTransactionCount(this.getAddress(),e)}))}estimateGas(e){return Eu(this,void 0,void 0,(function*(){this._checkProvider("estimateGas");const t=yield ga(this.checkTransaction(e));return yield this.provider.estimateGas(t)}))}call(e,t){return Eu(this,void 0,void 0,(function*(){this._checkProvider("call");const r=yield ga(this.checkTransaction(e));return yield this.provider.call(r,t)}))}sendTransaction(e){return Eu(this,void 0,void 0,(function*(){this._checkProvider("sendTransaction");const t=yield this.populateTransaction(e),r=yield this.signTransaction(t);return yield this.provider.sendTransaction(r)}))}getChainId(){return Eu(this,void 0,void 0,(function*(){this._checkProvider("getChainId");return(yield this.provider.getNetwork()).chainId}))}getGasPrice(){return Eu(this,void 0,void 0,(function*(){return this._checkProvider("getGasPrice"),yield this.provider.getGasPrice()}))}getFeeData(){return Eu(this,void 0,void 0,(function*(){return this._checkProvider("getFeeData"),yield this.provider.getFeeData()}))}resolveName(e){return Eu(this,void 0,void 0,(function*(){return this._checkProvider("resolveName"),yield this.provider.resolveName(e)}))}checkTransaction(e){for(const t in e)-1===Pu.indexOf(t)&&Su.throwArgumentError("invalid transaction key: "+t,"transaction",e);const t=ba(e);return null==t.from?t.from=this.getAddress():t.from=Promise.all([Promise.resolve(t.from),this.getAddress()]).then((t=>(t[0].toLowerCase()!==t[1].toLowerCase()&&Su.throwArgumentError("from address mismatch","transaction",e),t[0]))),t}populateTransaction(e){return Eu(this,void 0,void 0,(function*(){const t=yield ga(this.checkTransaction(e));null!=t.to&&(t.to=Promise.resolve(t.to).then((e=>Eu(this,void 0,void 0,(function*(){if(null==e)return null;const t=yield this.resolveName(e);return null==t&&Su.throwArgumentError("provided ENS name resolves to null","tx.to",e),t})))),t.to.catch((e=>{})));const r=null!=t.maxFeePerGas||null!=t.maxPriorityFeePerGas;if(null==t.gasPrice||2!==t.type&&!r?0!==t.type&&1!==t.type||!r||Su.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",e):Su.throwArgumentError("eip-1559 transaction do not support gasPrice","transaction",e),2!==t.type&&null!=t.type||null==t.maxFeePerGas||null==t.maxPriorityFeePerGas)if(0===t.type||1===t.type)null==t.gasPrice&&(t.gasPrice=this.getGasPrice());else{const e=yield this.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?(r&&Su.throwError("network does not support EIP-1559",bo.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),null==t.gasPrice&&(t.gasPrice=e.gasPrice),t.type=0):Su.throwError("failed to get consistent fee data",bo.errors.UNSUPPORTED_OPERATION,{operation:"signer.getFeeData"});else 2===t.type&&(null==t.maxFeePerGas&&(t.maxFeePerGas=e.maxFeePerGas),null==t.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=e.maxPriorityFeePerGas))}else t.type=2;return null==t.nonce&&(t.nonce=this.getTransactionCount("pending")),null==t.gasLimit&&(t.gasLimit=this.estimateGas(t).catch((e=>{if(xu.indexOf(e.code)>=0)throw e;return Su.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",bo.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,tx:t})}))),null==t.chainId?t.chainId=this.getChainId():t.chainId=Promise.all([Promise.resolve(t.chainId),this.getChainId()]).then((t=>(0!==t[1]&&t[0]!==t[1]&&Su.throwArgumentError("chainId address mismatch","transaction",e),t[0]))),yield ga(t)}))}_checkProvider(e){this.provider||Su.throwError("missing provider",bo.errors.UNSUPPORTED_OPERATION,{operation:e||"_checkProvider"})}static isSigner(e){return!(!e||!e._isSigner)}}class Mu extends ku{constructor(e,t){super(),pa(this,"address",e),pa(this,"provider",t||null)}getAddress(){return Promise.resolve(this.address)}_fail(e,t){return Promise.resolve().then((()=>{Su.throwError(e,bo.errors.UNSUPPORTED_OPERATION,{operation:t})}))}signMessage(e){return this._fail("VoidSigner cannot sign messages","signMessage")}signTransaction(e){return this._fail("VoidSigner cannot sign transactions","signTransaction")}_signTypedData(e,t,r){return this._fail("VoidSigner cannot sign typed data","signTypedData")}connect(e){return new Mu(this.address,e)}}function Cu(e,t,r){return r={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&r.path)}},e(r,r.exports),r.exports}var Iu=Ru;function Ru(e,t){if(!e)throw new Error(t||"Assertion failed")}Ru.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)};var Nu=Cu((function(e,t){var r=t;function n(e){return 1===e.length?"0"+e:e}function i(e){for(var t="",r=0;r>8,a=255&i;o?r.push(o,a):r.push(a)}return r},r.zero2=n,r.toHex=i,r.encode=function(e,t){return"hex"===t?i(e):e}})),Ou=Cu((function(e,t){var r=t;r.assert=Iu,r.toArray=Nu.toArray,r.zero2=Nu.zero2,r.toHex=Nu.toHex,r.encode=Nu.encode,r.getNAF=function(e,t,r){var n=new Array(Math.max(e.bitLength(),r)+1);n.fill(0);for(var i=1<(i>>1)-1?(i>>1)-c:c,o.isubn(s)):s=0,n[a]=s,o.iushrn(1)}return n},r.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n,i=0,o=0;e.cmpn(-i)>0||t.cmpn(-o)>0;){var a,s,c=e.andln(3)+i&3,u=t.andln(3)+o&3;3===c&&(c=-1),3===u&&(u=-1),a=0==(1&c)?0:3!==(n=e.andln(7)+i&7)&&5!==n||2!==u?c:-c,r[0].push(a),s=0==(1&u)?0:3!==(n=t.andln(7)+o&7)&&5!==n||2!==c?u:-u,r[1].push(s),2*i===a+1&&(i=1-i),2*o===s+1&&(o=1-o),e.iushrn(1),t.iushrn(1)}return r},r.cachedProperty=function(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},r.parseBytes=function(e){return"string"==typeof e?r.toArray(e,"hex"):e},r.intFromLE=function(e){return new so(e,"hex","le")}})),Tu=Ou.getNAF,ju=Ou.getJSF,Du=Ou.assert;function $u(e,t){this.type=e,this.p=new so(t.p,16),this.red=t.prime?so.red(t.prime):so.mont(this.p),this.zero=new so(0).toRed(this.red),this.one=new so(1).toRed(this.red),this.two=new so(2).toRed(this.red),this.n=t.n&&new so(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var Bu=$u;function Fu(e,t){this.curve=e,this.type=t,this.precomputed=null}$u.prototype.point=function(){throw new Error("Not implemented")},$u.prototype.validate=function(){throw new Error("Not implemented")},$u.prototype._fixedNafMul=function(e,t){Du(e.precomputed);var r=e._getDoubles(),n=Tu(t,1,this._bitLength),i=(1<=o;c--)a=(a<<1)+n[c];s.push(a)}for(var u=this.jpoint(null,null,null),f=this.jpoint(null,null,null),d=i;d>0;d--){for(o=0;o=0;s--){for(var c=0;s>=0&&0===o[s];s--)c++;if(s>=0&&c++,a=a.dblp(c),s<0)break;var u=o[s];Du(0!==u),a="affine"===e.type?u>0?a.mixedAdd(i[u-1>>1]):a.mixedAdd(i[-u-1>>1].neg()):u>0?a.add(i[u-1>>1]):a.add(i[-u-1>>1].neg())}return"affine"===e.type?a.toP():a},$u.prototype._wnafMulAdd=function(e,t,r,n,i){var o,a,s,c=this._wnafT1,u=this._wnafT2,f=this._wnafT3,d=0;for(o=0;o=1;o-=2){var h=o-1,p=o;if(1===c[h]&&1===c[p]){var m=[t[h],null,null,t[p]];0===t[h].y.cmp(t[p].y)?(m[1]=t[h].add(t[p]),m[2]=t[h].toJ().mixedAdd(t[p].neg())):0===t[h].y.cmp(t[p].y.redNeg())?(m[1]=t[h].toJ().mixedAdd(t[p]),m[2]=t[h].add(t[p].neg())):(m[1]=t[h].toJ().mixedAdd(t[p]),m[2]=t[h].toJ().mixedAdd(t[p].neg()));var g=[-3,-1,-5,-7,0,7,5,1,3],y=ju(r[h],r[p]);for(d=Math.max(y[0].length,d),f[h]=new Array(d),f[p]=new Array(d),a=0;a=0;o--){for(var _=0;o>=0;){var E=!0;for(a=0;a=0&&_++,w=w.dblp(_),o<0)break;for(a=0;a0?s=u[a][S-1>>1]:S<0&&(s=u[a][-S-1>>1].neg()),w="affine"===s.type?w.mixedAdd(s):w.add(s))}}for(o=0;o=Math.ceil((e.bitLength()+1)/t.step)},Fu.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i=0&&(o=t,a=r),n.negative&&(n=n.neg(),i=i.neg()),o.negative&&(o=o.neg(),a=a.neg()),[{a:n,b:i},{a:o,b:a}]},Lu.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],i=n.b.mul(e).divRound(this.n),o=r.b.neg().mul(e).divRound(this.n),a=i.mul(r.a),s=o.mul(n.a),c=i.mul(r.b),u=o.mul(n.b);return{k1:e.sub(a).sub(s),k2:c.add(u).neg()}},Lu.prototype.pointFromX=function(e,t){(e=new so(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var i=n.fromRed().isOdd();return(t&&!i||!t&&i)&&(n=n.redNeg()),this.point(e,n)},Lu.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},Lu.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o":""},Hu.prototype.isInfinity=function(){return this.inf},Hu.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},Hu.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),a=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)},Hu.prototype.getX=function(){return this.x.fromRed()},Hu.prototype.getY=function(){return this.y.fromRed()},Hu.prototype.mul=function(e){return e=new so(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)},Hu.prototype.mulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},Hu.prototype.jmulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},Hu.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))},Hu.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,n=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return t},Hu.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},zu(Ku,Bu.BasePoint),Lu.prototype.jpoint=function(e,t,r){return new Ku(this,e,t,r)},Ku.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},Ku.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},Ku.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),i=e.x.redMul(r),o=this.y.redMul(t.redMul(e.z)),a=e.y.redMul(r.redMul(this.z)),s=n.redSub(i),c=o.redSub(a);if(0===s.cmpn(0))return 0!==c.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=s.redSqr(),f=u.redMul(s),d=n.redMul(u),l=c.redSqr().redIAdd(f).redISub(d).redISub(d),h=c.redMul(d.redISub(l)).redISub(o.redMul(f)),p=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(l,h,p)},Ku.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),i=this.y,o=e.y.redMul(t).redMul(this.z),a=r.redSub(n),s=i.redSub(o);if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=a.redSqr(),u=c.redMul(a),f=r.redMul(c),d=s.redSqr().redIAdd(u).redISub(f).redISub(f),l=s.redMul(f.redISub(d)).redISub(i.redMul(u)),h=this.z.redMul(a);return this.curve.jpoint(d,l,h)},Ku.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var r=this;for(t=0;t=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},Ku.prototype.inspect=function(){return this.isInfinity()?"":""},Ku.prototype.isInfinity=function(){return 0===this.z.cmpn(0)};var Ju=Cu((function(e,t){var r=t;r.base=Bu,r.short=qu,r.mont=null,r.edwards=null})),Wu=Cu((function(e,t){var r,n=t,i=Ou.assert;function o(e){"short"===e.type?this.curve=new Ju.short(e):"edwards"===e.type?this.curve=new Ju.edwards(e):this.curve=new Ju.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,i(this.g.validate(),"Invalid curve"),i(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function a(e,t){Object.defineProperty(n,e,{configurable:!0,enumerable:!0,get:function(){var r=new o(t);return Object.defineProperty(n,e,{configurable:!0,enumerable:!0,value:r}),r}})}n.PresetCurve=o,a("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:rr.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),a("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:rr.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),a("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:rr.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),a("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:rr.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"]}),a("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:rr.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"]}),a("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:rr.sha256,gRed:!1,g:["9"]}),a("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:rr.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{r=null.crash()}catch(e){r=void 0}a("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:rr.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})}));function Gu(e){if(!(this instanceof Gu))return new Gu(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=Nu.toArray(e.entropy,e.entropyEnc||"hex"),r=Nu.toArray(e.nonce,e.nonceEnc||"hex"),n=Nu.toArray(e.pers,e.persEnc||"hex");Iu(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}var Vu=Gu;Gu.prototype._init=function(e,t,r){var n=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},Gu.prototype.generate=function(e,t,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(n=r,r=t,t=null),r&&(r=Nu.toArray(r,n||"hex"),this._update(r));for(var i=[];i.length"};var Yu=Ou.assert;function ef(e,t){if(e instanceof ef)return e;this._importDER(e,t)||(Yu(e.r&&e.s,"Signature without r or s"),this.r=new so(e.r,16),this.s=new so(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}var tf=ef;function rf(){this.place=0}function nf(e,t){var r=e[t.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var i=0,o=0,a=t.place;o>>=0;return!(i<=127)&&(t.place=a,i)}function of(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}ef.prototype._importDER=function(e,t){e=Ou.toArray(e,t);var r=new rf;if(48!==e[r.place++])return!1;var n=nf(e,r);if(!1===n)return!1;if(n+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var i=nf(e,r);if(!1===i)return!1;var o=e.slice(r.place,i+r.place);if(r.place+=i,2!==e[r.place++])return!1;var a=nf(e,r);if(!1===a)return!1;if(e.length!==a+r.place)return!1;var s=e.slice(r.place,a+r.place);if(0===o[0]){if(!(128&o[1]))return!1;o=o.slice(1)}if(0===s[0]){if(!(128&s[1]))return!1;s=s.slice(1)}return this.r=new so(o),this.s=new so(s),this.recoveryParam=null,!0},ef.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=of(t),r=of(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];af(n,t.length),(n=n.concat(t)).push(2),af(n,r.length);var i=n.concat(r),o=[48];return af(o,i.length),o=o.concat(i),Ou.encode(o,e)};var sf=function(){throw new Error("unsupported")},cf=Ou.assert;function uf(e){if(!(this instanceof uf))return new uf(e);"string"==typeof e&&(cf(Object.prototype.hasOwnProperty.call(Wu,e),"Unknown curve "+e),e=Wu[e]),e instanceof Wu.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}var ff=uf;uf.prototype.keyPair=function(e){return new Qu(this,e)},uf.prototype.keyFromPrivate=function(e,t){return Qu.fromPrivate(this,e,t)},uf.prototype.keyFromPublic=function(e,t){return Qu.fromPublic(this,e,t)},uf.prototype.genKeyPair=function(e){e||(e={});for(var t=new Vu({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||sf(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),n=this.n.sub(new so(2));;){var i=new so(t.generate(r));if(!(i.cmp(n)>0))return i.iaddn(1),this.keyFromPrivate(i)}},uf.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},uf.prototype.sign=function(e,t,r,n){"object"==typeof r&&(n=r,r=null),n||(n={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new so(e,16));for(var i=this.n.byteLength(),o=t.getPrivate().toArray("be",i),a=e.toArray("be",i),s=new Vu({hash:this.hash,entropy:o,nonce:a,pers:n.pers,persEnc:n.persEnc||"utf8"}),c=this.n.sub(new so(1)),u=0;;u++){var f=n.k?n.k(u):new so(s.generate(this.n.byteLength()));if(!((f=this._truncateToN(f,!0)).cmpn(1)<=0||f.cmp(c)>=0)){var d=this.g.mul(f);if(!d.isInfinity()){var l=d.getX(),h=l.umod(this.n);if(0!==h.cmpn(0)){var p=f.invm(this.n).mul(h.mul(t.getPrivate()).iadd(e));if(0!==(p=p.umod(this.n)).cmpn(0)){var m=(d.getY().isOdd()?1:0)|(0!==l.cmp(h)?2:0);return n.canonical&&p.cmp(this.nh)>0&&(p=this.n.sub(p),m^=1),new tf({r:h,s:p,recoveryParam:m})}}}}}},uf.prototype.verify=function(e,t,r,n){e=this._truncateToN(new so(e,16)),r=this.keyFromPublic(r,n);var i=(t=new tf(t,"hex")).r,o=t.s;if(i.cmpn(1)<0||i.cmp(this.n)>=0)return!1;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var a,s=o.invm(this.n),c=s.mul(e).umod(this.n),u=s.mul(i).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(c,r.getPublic(),u)).isInfinity()&&a.eqXToP(i):!(a=this.g.mulAdd(c,r.getPublic(),u)).isInfinity()&&0===a.getX().umod(this.n).cmp(i)},uf.prototype.recoverPubKey=function(e,t,r,n){cf((3&r)===r,"The recovery param is more than two bits"),t=new tf(t,n);var i=this.n,o=new so(e),a=t.r,s=t.s,c=1&r,u=r>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&u)throw new Error("Unable to find sencond key candinate");a=u?this.curve.pointFromX(a.add(this.curve.n),c):this.curve.pointFromX(a,c);var f=t.r.invm(i),d=i.sub(o).mul(f).umod(i),l=s.mul(f).umod(i);return this.g.mulAdd(d,a,l)},uf.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new tf(t,n)).recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(e,t,i)}catch(e){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")};var df=Cu((function(e,t){var r=t;r.version="6.5.4",r.utils=Ou,r.rand=function(){throw new Error("unsupported")},r.curve=Ju,r.curves=Wu,r.ec=ff,r.eddsa=null})),lf=df.ec;const hf=new bo("signing-key/5.7.0");let pf=null;function mf(){return pf||(pf=new lf("secp256k1")),pf}class gf{constructor(e){pa(this,"curve","secp256k1"),pa(this,"privateKey",No(e)),32!==Oo(this.privateKey)&&hf.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const t=mf().keyFromPrivate(xo(this.privateKey));pa(this,"publicKey","0x"+t.getPublic(!1,"hex")),pa(this,"compressedPublicKey","0x"+t.getPublic(!0,"hex")),pa(this,"_isSigningKey",!0)}_addPoint(e){const t=mf().keyFromPublic(xo(this.publicKey)),r=mf().keyFromPublic(xo(e));return"0x"+t.pub.add(r.pub).encodeCompressed("hex")}signDigest(e){const t=mf().keyFromPrivate(xo(this.privateKey)),r=xo(e);32!==r.length&&hf.throwArgumentError("bad digest length","digest",e);const n=t.sign(r,{canonical:!0});return Fo({recoveryParam:n.recoveryParam,r:Bo("0x"+n.r.toString(16),32),s:Bo("0x"+n.s.toString(16),32)})}computeSharedSecret(e){const t=mf().keyFromPrivate(xo(this.privateKey)),r=mf().keyFromPublic(xo(bf(e)));return Bo("0x"+t.derive(r.getPublic()).toString(16),32)}static isSigningKey(e){return!(!e||!e._isSigningKey)}}function yf(e,t){const r=Fo(t),n={r:xo(r.r),s:xo(r.s)};return"0x"+mf().recoverPubKey(xo(e),n,r.recoveryParam).encode("hex",!1)}function bf(e,t){const r=xo(e);if(32===r.length){const e=new gf(r);return t?"0x"+mf().keyFromPrivate(r).getPublic(!0,"hex"):e.publicKey}return 33===r.length?t?No(r):"0x"+mf().keyFromPublic(r).getPublic(!1,"hex"):65===r.length?t?"0x"+mf().keyFromPublic(r).getPublic(!0,"hex"):No(r):hf.throwArgumentError("invalid public or private key","key","[REDACTED]")}var vf=Object.freeze({__proto__:null,SigningKey:gf,computePublicKey:bf,recoverPublicKey:yf});const wf=new bo("transactions/5.7.0");var Af;function _f(e){return"0x"===e?null:bs(e)}function Ef(e){return"0x"===e?Os:Go.from(e)}!function(e){e[e.legacy=0]="legacy",e[e.eip2930=1]="eip2930",e[e.eip1559=2]="eip1559"}(Af||(Af={}));const Sf=[{name:"nonce",maxLength:32,numeric:!0},{name:"gasPrice",maxLength:32,numeric:!0},{name:"gasLimit",maxLength:32,numeric:!0},{name:"to",length:20},{name:"value",maxLength:32,numeric:!0},{name:"data"}],Pf={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,type:!0,value:!0};function xf(e){return bs(To(rs(To(bf(e),1)),12))}function kf(e,t){return xf(yf(xo(e),t))}function Mf(e,t){const r=Mo(Go.from(e).toHexString());return r.length>32&&wf.throwArgumentError("invalid length for "+t,"transaction:"+t,e),r}function Cf(e,t){return{address:bs(e),storageKeys:(t||[]).map(((t,r)=>(32!==Oo(t)&&wf.throwArgumentError("invalid access list storageKey",`accessList[${e}:${r}]`,t),t.toLowerCase())))}}function If(e){if(Array.isArray(e))return e.map(((e,t)=>Array.isArray(e)?(e.length>2&&wf.throwArgumentError("access list expected to be [ address, storageKeys[] ]",`value[${t}]`,e),Cf(e[0],e[1])):Cf(e.address,e.storageKeys)));const t=Object.keys(e).map((t=>{const r=e[t].reduce(((e,t)=>(e[t]=!0,e)),{});return Cf(t,Object.keys(r).sort())}));return t.sort(((e,t)=>e.address.localeCompare(t.address))),t}function Rf(e){return If(e).map((e=>[e.address,e.storageKeys]))}function Nf(e,t){if(null!=e.gasPrice){const t=Go.from(e.gasPrice),r=Go.from(e.maxFeePerGas||0);t.eq(r)||wf.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:t,maxFeePerGas:r})}const r=[Mf(e.chainId||0,"chainId"),Mf(e.nonce||0,"nonce"),Mf(e.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),Mf(e.maxFeePerGas||0,"maxFeePerGas"),Mf(e.gasLimit||0,"gasLimit"),null!=e.to?bs(e.to):"0x",Mf(e.value||0,"value"),e.data||"0x",Rf(e.accessList||[])];if(t){const e=Fo(t);r.push(Mf(e.recoveryParam,"recoveryParam")),r.push(Mo(e.r)),r.push(Mo(e.s))}return jo(["0x02",cs(r)])}function Of(e,t){const r=[Mf(e.chainId||0,"chainId"),Mf(e.nonce||0,"nonce"),Mf(e.gasPrice||0,"gasPrice"),Mf(e.gasLimit||0,"gasLimit"),null!=e.to?bs(e.to):"0x",Mf(e.value||0,"value"),e.data||"0x",Rf(e.accessList||[])];if(t){const e=Fo(t);r.push(Mf(e.recoveryParam,"recoveryParam")),r.push(Mo(e.r)),r.push(Mo(e.s))}return jo(["0x01",cs(r)])}function Tf(e,t){if(null==e.type||0===e.type)return null!=e.accessList&&wf.throwArgumentError("untyped transactions do not support accessList; include type: 1","transaction",e),function(e,t){ya(e,Pf);const r=[];Sf.forEach((function(t){let n=e[t.name]||[];const i={};t.numeric&&(i.hexPad="left"),n=xo(No(n,i)),t.length&&n.length!==t.length&&n.length>0&&wf.throwArgumentError("invalid length for "+t.name,"transaction:"+t.name,n),t.maxLength&&(n=Mo(n),n.length>t.maxLength&&wf.throwArgumentError("invalid length for "+t.name,"transaction:"+t.name,n)),r.push(No(n))}));let n=0;if(null!=e.chainId?(n=e.chainId,"number"!=typeof n&&wf.throwArgumentError("invalid transaction.chainId","transaction",e)):t&&!Eo(t)&&t.v>28&&(n=Math.floor((t.v-35)/2)),0!==n&&(r.push(No(n)),r.push("0x"),r.push("0x")),!t)return cs(r);const i=Fo(t);let o=27+i.recoveryParam;return 0!==n?(r.pop(),r.pop(),r.pop(),o+=2*n+8,i.v>28&&i.v!==o&&wf.throwArgumentError("transaction.chainId/signature.v mismatch","signature",t)):i.v!==o&&wf.throwArgumentError("transaction.chainId/signature.v mismatch","signature",t),r.push(No(o)),r.push(Mo(xo(i.r))),r.push(Mo(xo(i.s))),cs(r)}(e,t);switch(e.type){case 1:return Of(e,t);case 2:return Nf(e,t)}return wf.throwError(`unsupported transaction type: ${e.type}`,bo.errors.UNSUPPORTED_OPERATION,{operation:"serializeTransaction",transactionType:e.type})}function jf(e,t,r){try{const r=Ef(t[0]).toNumber();if(0!==r&&1!==r)throw new Error("bad recid");e.v=r}catch(e){wf.throwArgumentError("invalid v for transaction type: 1","v",t[0])}e.r=Bo(t[1],32),e.s=Bo(t[2],32);try{const t=rs(r(e));e.from=kf(t,{r:e.r,s:e.s,recoveryParam:e.v})}catch(e){}}function Df(e){const t=xo(e);if(t[0]>127)return function(e){const t=ds(e);9!==t.length&&6!==t.length&&wf.throwArgumentError("invalid raw transaction","rawTransaction",e);const r={nonce:Ef(t[0]).toNumber(),gasPrice:Ef(t[1]),gasLimit:Ef(t[2]),to:_f(t[3]),value:Ef(t[4]),data:t[5],chainId:0};if(6===t.length)return r;try{r.v=Go.from(t[6]).toNumber()}catch(e){return r}if(r.r=Bo(t[7],32),r.s=Bo(t[8],32),Go.from(r.r).isZero()&&Go.from(r.s).isZero())r.chainId=r.v,r.v=0;else{r.chainId=Math.floor((r.v-35)/2),r.chainId<0&&(r.chainId=0);let n=r.v-27;const i=t.slice(0,6);0!==r.chainId&&(i.push(No(r.chainId)),i.push("0x"),i.push("0x"),n-=2*r.chainId+8);const o=rs(cs(i));try{r.from=kf(o,{r:No(r.r),s:No(r.s),recoveryParam:n})}catch(e){}r.hash=rs(e)}return r.type=null,r}(t);switch(t[0]){case 1:return function(e){const t=ds(e.slice(1));8!==t.length&&11!==t.length&&wf.throwArgumentError("invalid component count for transaction type: 1","payload",No(e));const r={type:1,chainId:Ef(t[0]).toNumber(),nonce:Ef(t[1]).toNumber(),gasPrice:Ef(t[2]),gasLimit:Ef(t[3]),to:_f(t[4]),value:Ef(t[5]),data:t[6],accessList:If(t[7])};return 8===t.length||(r.hash=rs(e),jf(r,t.slice(8),Of)),r}(t);case 2:return function(e){const t=ds(e.slice(1));9!==t.length&&12!==t.length&&wf.throwArgumentError("invalid component count for transaction type: 2","payload",No(e));const r=Ef(t[2]),n=Ef(t[3]),i={type:2,chainId:Ef(t[0]).toNumber(),nonce:Ef(t[1]).toNumber(),maxPriorityFeePerGas:r,maxFeePerGas:n,gasPrice:null,gasLimit:Ef(t[4]),to:_f(t[5]),value:Ef(t[6]),data:t[7],accessList:If(t[8])};return 9===t.length||(i.hash=rs(e),jf(i,t.slice(9),Nf)),i}(t)}return wf.throwError(`unsupported transaction type: ${t[0]}`,bo.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:t[0]})}var $f=Object.freeze({__proto__:null,get TransactionTypes(){return Af},accessListify:If,computeAddress:xf,parse:Df,recoverAddress:kf,serialize:Tf});var Bf=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))};const Ff=new bo("contracts/5.7.0");function zf(e,t){return Bf(this,void 0,void 0,(function*(){const r=yield t;"string"!=typeof r&&Ff.throwArgumentError("invalid address or ENS name","name",r);try{return bs(r)}catch(e){}e||Ff.throwError("a provider or signer is needed to resolve ENS names",bo.errors.UNSUPPORTED_OPERATION,{operation:"resolveName"});const n=yield e.resolveName(r);return null==n&&Ff.throwArgumentError("resolver or addr is not configured for ENS name","name",r),n}))}function Uf(e,t,r){return Bf(this,void 0,void 0,(function*(){return Array.isArray(r)?yield Promise.all(r.map(((r,n)=>Uf(e,Array.isArray(t)?t[n]:t[r.name],r)))):"address"===r.type?yield zf(e,t):"tuple"===r.type?yield Uf(e,t,r.components):"array"===r.baseType?Array.isArray(t)?yield Promise.all(t.map((t=>Uf(e,t,r.arrayChildren)))):Promise.reject(Ff.makeError("invalid value for array",bo.errors.INVALID_ARGUMENT,{argument:"value",value:t})):t}))}function Lf(e,t,r){return Bf(this,void 0,void 0,(function*(){let n={};r.length===t.inputs.length+1&&"object"==typeof r[r.length-1]&&(n=ba(r.pop())),Ff.checkArgumentCount(r.length,t.inputs.length,"passed to contract"),e.signer?n.from?n.from=ga({override:zf(e.signer,n.from),signer:e.signer.getAddress()}).then((e=>Bf(this,void 0,void 0,(function*(){return bs(e.signer)!==e.override&&Ff.throwError("Contract with a Signer cannot override from",bo.errors.UNSUPPORTED_OPERATION,{operation:"overrides.from"}),e.override})))):n.from=e.signer.getAddress():n.from&&(n.from=zf(e.provider,n.from));const i=yield ga({args:Uf(e.signer||e.provider,r,t.inputs),address:e.resolvedAddress,overrides:ga(n)||{}}),o=e.interface.encodeFunctionData(t,i.args),a={data:o,to:i.address},s=i.overrides;if(null!=s.nonce&&(a.nonce=Go.from(s.nonce).toNumber()),null!=s.gasLimit&&(a.gasLimit=Go.from(s.gasLimit)),null!=s.gasPrice&&(a.gasPrice=Go.from(s.gasPrice)),null!=s.maxFeePerGas&&(a.maxFeePerGas=Go.from(s.maxFeePerGas)),null!=s.maxPriorityFeePerGas&&(a.maxPriorityFeePerGas=Go.from(s.maxPriorityFeePerGas)),null!=s.from&&(a.from=s.from),null!=s.type&&(a.type=s.type),null!=s.accessList&&(a.accessList=If(s.accessList)),null==a.gasLimit&&null!=t.gas){let e=21e3;const r=xo(o);for(let t=0;tnull!=n[e]));return c.length&&Ff.throwError(`cannot override ${c.map((e=>JSON.stringify(e))).join(",")}`,bo.errors.UNSUPPORTED_OPERATION,{operation:"overrides",overrides:c}),a}))}function qf(e,t,r){const n=e.signer||e.provider;return function(...i){return Bf(this,void 0,void 0,(function*(){let o;if(i.length===t.inputs.length+1&&"object"==typeof i[i.length-1]){const e=ba(i.pop());null!=e.blockTag&&(o=yield e.blockTag),delete e.blockTag,i.push(e)}null!=e.deployTransaction&&(yield e._deployed(o));const a=yield Lf(e,t,i),s=yield n.call(a,o);try{let n=e.interface.decodeFunctionResult(t,s);return r&&1===t.outputs.length&&(n=n[0]),n}catch(t){throw t.code===bo.errors.CALL_EXCEPTION&&(t.address=e.address,t.args=i,t.transaction=a),t}}))}}function Hf(e,t){return function(...r){return Bf(this,void 0,void 0,(function*(){e.signer||Ff.throwError("sending a transaction requires a signer",bo.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction"}),null!=e.deployTransaction&&(yield e._deployed());const n=yield Lf(e,t,r),i=yield e.signer.sendTransaction(n);return function(e,t){const r=t.wait.bind(t);t.wait=t=>r(t).then((t=>(t.events=t.logs.map((r=>{let n=_a(r),i=null;try{i=e.interface.parseLog(r)}catch(e){}return i&&(n.args=i.args,n.decode=(t,r)=>e.interface.decodeEventLog(i.eventFragment,t,r),n.event=i.name,n.eventSignature=i.signature),n.removeListener=()=>e.provider,n.getBlock=()=>e.provider.getBlock(t.blockHash),n.getTransaction=()=>e.provider.getTransaction(t.transactionHash),n.getTransactionReceipt=()=>Promise.resolve(t),n})),t)))}(e,i),i}))}}function Kf(e,t,r){return t.constant?qf(e,t,r):Hf(e,t)}function Jf(e){return!e.address||null!=e.topics&&0!==e.topics.length?(e.address||"*")+"@"+(e.topics?e.topics.map((e=>Array.isArray(e)?e.join("|"):e)).join(":"):""):"*"}class Wf{constructor(e,t){pa(this,"tag",e),pa(this,"filter",t),this._listeners=[]}addListener(e,t){this._listeners.push({listener:e,once:t})}removeListener(e){let t=!1;this._listeners=this._listeners.filter((r=>!(!t&&r.listener===e)||(t=!0,!1)))}removeAllListeners(){this._listeners=[]}listeners(){return this._listeners.map((e=>e.listener))}listenerCount(){return this._listeners.length}run(e){const t=this.listenerCount();return this._listeners=this._listeners.filter((t=>{const r=e.slice();return setTimeout((()=>{t.listener.apply(this,r)}),0),!t.once})),t}prepareEvent(e){}getEmit(e){return[e]}}class Gf extends Wf{constructor(){super("error",null)}}class Vf extends Wf{constructor(e,t,r,n){const i={address:e};let o=t.getEventTopic(r);n?(o!==n[0]&&Ff.throwArgumentError("topic mismatch","topics",n),i.topics=n.slice()):i.topics=[o],super(Jf(i),i),pa(this,"address",e),pa(this,"interface",t),pa(this,"fragment",r)}prepareEvent(e){super.prepareEvent(e),e.event=this.fragment.name,e.eventSignature=this.fragment.format(),e.decode=(e,t)=>this.interface.decodeEventLog(this.fragment,e,t);try{e.args=this.interface.decodeEventLog(this.fragment,e.data,e.topics)}catch(t){e.args=null,e.decodeError=t}}getEmit(e){const t=Za(e.args);if(t.length)throw t[0].error;const r=(e.args||[]).slice();return r.push(e),r}}class Zf extends Wf{constructor(e,t){super("*",{address:e}),pa(this,"address",e),pa(this,"interface",t)}prepareEvent(e){super.prepareEvent(e);try{const t=this.interface.parseLog(e);e.event=t.name,e.eventSignature=t.signature,e.decode=(e,r)=>this.interface.decodeEventLog(t.eventFragment,e,r),e.args=t.args}catch(e){}}}class Xf{constructor(e,t,r){pa(this,"interface",ma(new.target,"getInterface")(t)),null==r?(pa(this,"provider",null),pa(this,"signer",null)):ku.isSigner(r)?(pa(this,"provider",r.provider||null),pa(this,"signer",r)):_u.isProvider(r)?(pa(this,"provider",r),pa(this,"signer",null)):Ff.throwArgumentError("invalid signer or provider","signerOrProvider",r),pa(this,"callStatic",{}),pa(this,"estimateGas",{}),pa(this,"functions",{}),pa(this,"populateTransaction",{}),pa(this,"filters",{});{const e={};Object.keys(this.interface.events).forEach((t=>{const r=this.interface.events[t];pa(this.filters,t,((...e)=>({address:this.address,topics:this.interface.encodeFilterTopics(r,e)}))),e[r.name]||(e[r.name]=[]),e[r.name].push(t)})),Object.keys(e).forEach((t=>{const r=e[t];1===r.length?pa(this.filters,t,this.filters[r[0]]):Ff.warn(`Duplicate definition of ${t} (${r.join(", ")})`)}))}if(pa(this,"_runningEvents",{}),pa(this,"_wrappedEmits",{}),null==e&&Ff.throwArgumentError("invalid contract address or ENS name","addressOrName",e),pa(this,"address",e),this.provider)pa(this,"resolvedAddress",zf(this.provider,e));else try{pa(this,"resolvedAddress",Promise.resolve(bs(e)))}catch(e){Ff.throwError("provider is required to use ENS name as contract address",bo.errors.UNSUPPORTED_OPERATION,{operation:"new Contract"})}this.resolvedAddress.catch((e=>{}));const n={},i={};Object.keys(this.interface.functions).forEach((e=>{const t=this.interface.functions[e];if(i[e])Ff.warn(`Duplicate ABI entry for ${JSON.stringify(e)}`);else{i[e]=!0;{const r=t.name;n[`%${r}`]||(n[`%${r}`]=[]),n[`%${r}`].push(e)}null==this[e]&&pa(this,e,Kf(this,t,!0)),null==this.functions[e]&&pa(this.functions,e,Kf(this,t,!1)),null==this.callStatic[e]&&pa(this.callStatic,e,qf(this,t,!0)),null==this.populateTransaction[e]&&pa(this.populateTransaction,e,function(e,t){return function(...r){return Lf(e,t,r)}}(this,t)),null==this.estimateGas[e]&&pa(this.estimateGas,e,function(e,t){const r=e.signer||e.provider;return function(...n){return Bf(this,void 0,void 0,(function*(){r||Ff.throwError("estimate require a provider or signer",bo.errors.UNSUPPORTED_OPERATION,{operation:"estimateGas"});const i=yield Lf(e,t,n);return yield r.estimateGas(i)}))}}(this,t))}})),Object.keys(n).forEach((e=>{const t=n[e];if(t.length>1)return;e=e.substring(1);const r=t[0];try{null==this[e]&&pa(this,e,this[r])}catch(e){}null==this.functions[e]&&pa(this.functions,e,this.functions[r]),null==this.callStatic[e]&&pa(this.callStatic,e,this.callStatic[r]),null==this.populateTransaction[e]&&pa(this.populateTransaction,e,this.populateTransaction[r]),null==this.estimateGas[e]&&pa(this.estimateGas,e,this.estimateGas[r])}))}static getContractAddress(e){return vs(e)}static getInterface(e){return yu.isInterface(e)?e:new yu(e)}deployed(){return this._deployed()}_deployed(e){return this._deployedPromise||(this.deployTransaction?this._deployedPromise=this.deployTransaction.wait().then((()=>this)):this._deployedPromise=this.provider.getCode(this.address,e).then((e=>("0x"===e&&Ff.throwError("contract not deployed",bo.errors.UNSUPPORTED_OPERATION,{contractAddress:this.address,operation:"getDeployed"}),this)))),this._deployedPromise}fallback(e){this.signer||Ff.throwError("sending a transactions require a signer",bo.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction(fallback)"});const t=ba(e||{});return["from","to"].forEach((function(e){null!=t[e]&&Ff.throwError("cannot override "+e,bo.errors.UNSUPPORTED_OPERATION,{operation:e})})),t.to=this.resolvedAddress,this.deployed().then((()=>this.signer.sendTransaction(t)))}connect(e){"string"==typeof e&&(e=new Mu(e,this.provider));const t=new this.constructor(this.address,this.interface,e);return this.deployTransaction&&pa(t,"deployTransaction",this.deployTransaction),t}attach(e){return new this.constructor(e,this.interface,this.signer||this.provider)}static isIndexed(e){return pu.isIndexed(e)}_normalizeRunningEvent(e){return this._runningEvents[e.tag]?this._runningEvents[e.tag]:e}_getRunningEvent(e){if("string"==typeof e){if("error"===e)return this._normalizeRunningEvent(new Gf);if("event"===e)return this._normalizeRunningEvent(new Wf("event",null));if("*"===e)return this._normalizeRunningEvent(new Zf(this.address,this.interface));const t=this.interface.getEvent(e);return this._normalizeRunningEvent(new Vf(this.address,this.interface,t))}if(e.topics&&e.topics.length>0){try{const t=e.topics[0];if("string"!=typeof t)throw new Error("invalid topic");const r=this.interface.getEvent(t);return this._normalizeRunningEvent(new Vf(this.address,this.interface,r,e.topics))}catch(e){}const t={address:this.address,topics:e.topics};return this._normalizeRunningEvent(new Wf(Jf(t),t))}return this._normalizeRunningEvent(new Zf(this.address,this.interface))}_checkRunningEvents(e){if(0===e.listenerCount()){delete this._runningEvents[e.tag];const t=this._wrappedEmits[e.tag];t&&e.filter&&(this.provider.off(e.filter,t),delete this._wrappedEmits[e.tag])}}_wrapEvent(e,t,r){const n=_a(t);return n.removeListener=()=>{r&&(e.removeListener(r),this._checkRunningEvents(e))},n.getBlock=()=>this.provider.getBlock(t.blockHash),n.getTransaction=()=>this.provider.getTransaction(t.transactionHash),n.getTransactionReceipt=()=>this.provider.getTransactionReceipt(t.transactionHash),e.prepareEvent(n),n}_addEventListener(e,t,r){if(this.provider||Ff.throwError("events require a provider or a signer with a provider",bo.errors.UNSUPPORTED_OPERATION,{operation:"once"}),e.addListener(t,r),this._runningEvents[e.tag]=e,!this._wrappedEmits[e.tag]){const r=r=>{let n=this._wrapEvent(e,r,t);if(null==n.decodeError)try{const t=e.getEmit(n);this.emit(e.filter,...t)}catch(e){n.decodeError=e.error}null!=e.filter&&this.emit("event",n),null!=n.decodeError&&this.emit("error",n.decodeError,n)};this._wrappedEmits[e.tag]=r,null!=e.filter&&this.provider.on(e.filter,r)}}queryFilter(e,t,r){const n=this._getRunningEvent(e),i=ba(n.filter);return"string"==typeof t&&Io(t,32)?(null!=r&&Ff.throwArgumentError("cannot specify toBlock with blockhash","toBlock",r),i.blockHash=t):(i.fromBlock=null!=t?t:0,i.toBlock=null!=r?r:"latest"),this.provider.getLogs(i).then((e=>e.map((e=>this._wrapEvent(n,e,null)))))}on(e,t){return this._addEventListener(this._getRunningEvent(e),t,!1),this}once(e,t){return this._addEventListener(this._getRunningEvent(e),t,!0),this}emit(e,...t){if(!this.provider)return!1;const r=this._getRunningEvent(e),n=r.run(t)>0;return this._checkRunningEvents(r),n}listenerCount(e){return this.provider?null==e?Object.keys(this._runningEvents).reduce(((e,t)=>e+this._runningEvents[t].listenerCount()),0):this._getRunningEvent(e).listenerCount():0}listeners(e){if(!this.provider)return[];if(null==e){const e=[];for(let t in this._runningEvents)this._runningEvents[t].listeners().forEach((t=>{e.push(t)}));return e}return this._getRunningEvent(e).listeners()}removeAllListeners(e){if(!this.provider)return this;if(null==e){for(const e in this._runningEvents){const t=this._runningEvents[e];t.removeAllListeners(),this._checkRunningEvents(t)}return this}const t=this._getRunningEvent(e);return t.removeAllListeners(),this._checkRunningEvents(t),this}off(e,t){if(!this.provider)return this;const r=this._getRunningEvent(e);return r.removeListener(t),this._checkRunningEvents(r),this}removeListener(e,t){return this.off(e,t)}}class Qf extends Xf{}class Yf{constructor(e){pa(this,"alphabet",e),pa(this,"base",e.length),pa(this,"_alphabetMap",{}),pa(this,"_leader",e.charAt(0));for(let t=0;t0;)r.push(n%this.base),n=n/this.base|0}let n="";for(let e=0;0===t[e]&&e=0;--e)n+=this.alphabet[r[e]];return n}decode(e){if("string"!=typeof e)throw new TypeError("Expected String");let t=[];if(0===e.length)return new Uint8Array(t);t.push(0);for(let r=0;r>=8;for(;i>0;)t.push(255&i),i>>=8}for(let r=0;e[r]===this._leader&&r>24&255,c[t.length+1]=d>>16&255,c[t.length+2]=d>>8&255,c[t.length+3]=255&d;let l=xo(sd(i,e,c));o||(o=l.length,f=new Uint8Array(o),a=Math.ceil(n/o),u=n-(a-1)*o),f.set(l);for(let t=1;t=256)throw new Error("Depth too large!");return _d(ko([null!=this.privateKey?"0x0488ADE4":"0x0488B21E",No(this.depth),this.parentFingerprint,Bo(No(this.index),4),this.chainCode,null!=this.privateKey?ko(["0x00",this.privateKey]):this.publicKey]))}neuter(){return new xd(Sd,null,this.publicKey,this.parentFingerprint,this.chainCode,this.index,this.depth,this.path)}_derive(e){if(e>4294967295)throw new Error("invalid index - "+String(e));let t=this.path;t&&(t+="/"+(2147483647&e));const r=new Uint8Array(37);if(e&vd){if(!this.privateKey)throw new Error("cannot derive child of neutered node");r.set(xo(this.privateKey),1),t&&(t+="'")}else r.set(xo(this.publicKey));for(let t=24;t>=0;t-=8)r[33+(t>>3)]=e>>24-t&255;const n=xo(sd(rd.sha512,this.chainCode,r)),i=n.slice(0,32),o=n.slice(32);let a=null,s=null;if(this.privateKey)a=Ad(Go.from(i).add(this.privateKey).mod(yd));else{s=new gf(No(i))._addPoint(this.publicKey)}let c=t;const u=this.mnemonic;return u&&(c=Object.freeze({phrase:u.phrase,path:t,locale:u.locale||"en"})),new xd(Sd,a,s,this.fingerprint,Ad(o),e,this.depth+1,c)}derivePath(e){const t=e.split("/");if(0===t.length||"m"===t[0]&&0!==this.depth)throw new Error("invalid path - "+e);"m"===t[0]&&t.shift();let r=this;for(let e=0;e=vd)throw new Error("invalid path index - "+n);r=r._derive(vd+e)}else{if(!n.match(/^[0-9]+$/))throw new Error("invalid path component - "+n);{const e=parseInt(n);if(e>=vd)throw new Error("invalid path index - "+n);r=r._derive(e)}}}return r}static _fromSeed(e,t){const r=xo(e);if(r.length<16||r.length>64)throw new Error("invalid seed");const n=xo(sd(rd.sha512,bd,r));return new xd(Sd,Ad(n.slice(0,32)),null,"0x00000000",Ad(n.slice(32)),0,0,t)}static fromMnemonic(e,t,r){return e=Cd(Md(e,r=Ed(r)),r),xd._fromSeed(kd(e,t),{phrase:e,path:"m",locale:r.locale})}static fromSeed(e){return xd._fromSeed(e,null)}static fromExtendedKey(e){const t=td.decode(e);82===t.length&&_d(t.slice(0,78))===e||gd.throwArgumentError("invalid extended key","extendedKey","[REDACTED]");const r=t[4],n=No(t.slice(5,9)),i=parseInt(No(t.slice(9,13)).substring(2),16),o=No(t.slice(13,45)),a=t.slice(45,78);switch(No(t.slice(0,4))){case"0x0488b21e":case"0x043587cf":return new xd(Sd,null,No(a),n,o,i,r,null);case"0x0488ade4":case"0x04358394 ":if(0!==a[0])break;return new xd(Sd,No(a.slice(1)),null,n,o,i,r,null)}return gd.throwArgumentError("invalid extended key","extendedKey","[REDACTED]")}}function kd(e,t){t||(t="");const r=Hs("mnemonic"+t,Fs.NFKD);return ud(Hs(e,Fs.NFKD),r,2048,64,"sha512")}function Md(e,t){t=Ed(t),gd.checkNormalize();const r=t.split(e);if(r.length%3!=0)throw new Error("invalid mnemonic");const n=xo(new Uint8Array(Math.ceil(11*r.length/8)));let i=0;for(let e=0;e>3]|=1<<7-i%8),i++}const o=32*r.length/3,a=wd(r.length/3);if((xo(ad(n.slice(0,o/8)))[0]&a)!==(n[n.length-1]&a))throw new Error("invalid checksum");return No(n.slice(0,o/8))}function Cd(e,t){if(t=Ed(t),(e=xo(e)).length%4!=0||e.length<16||e.length>32)throw new Error("invalid entropy");const r=[0];let n=11;for(let t=0;t8?(r[r.length-1]<<=8,r[r.length-1]|=e[t],n-=8):(r[r.length-1]<<=n,r[r.length-1]|=e[t]>>8-n,r.push(e[t]&(1<<8-n)-1),n+=3);const i=e.length/4,o=xo(ad(e))[0]&wd(i);return r[r.length-1]<<=i,r[r.length-1]|=o>>8-i,t.join(r.map((e=>t.getWord(e))))}var Id=Object.freeze({__proto__:null,HDNode:xd,defaultPath:Pd,entropyToMnemonic:Cd,getAccountPath:function(e){return("number"!=typeof e||e<0||e>=vd||e%1)&&gd.throwArgumentError("invalid account index","index",e),`m/44'/60'/${e}'/0/0`},isValidMnemonic:function(e,t){try{return Md(e,t),!0}catch(e){}return!1},mnemonicToEntropy:Md,mnemonicToSeed:kd});const Rd=new bo("random/5.7.0");const Nd=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")}();let Od=Nd.crypto||Nd.msCrypto;function Td(e){(e<=0||e>1024||e%1||e!=e)&&Rd.throwArgumentError("invalid length","length",e);const t=new Uint8Array(e);return Od.getRandomValues(t),xo(t)}Od&&Od.getRandomValues||(Rd.warn("WARNING: Missing strong random number source"),Od={getRandomValues:function(e){return Rd.throwError("no secure random source avaialble",bo.errors.UNSUPPORTED_OPERATION,{operation:"crypto.getRandomValues"})}});var jd=Object.freeze({__proto__:null,randomBytes:Td,shuffled:function(e){for(let t=(e=e.slice()).length-1;t>0;t--){const r=Math.floor(Math.random()*(t+1)),n=e[t];e[t]=e[r],e[r]=n}return e}}),Dd={exports:{}};!function(e,t){!function(t){function r(e){return parseInt(e)===e}function n(e){if(!r(e.length))return!1;for(var t=0;t255)return!1;return!0}function i(e,t){if(e.buffer&&ArrayBuffer.isView(e)&&"Uint8Array"===e.name)return t&&(e=e.slice?e.slice():Array.prototype.slice.call(e)),e;if(Array.isArray(e)){if(!n(e))throw new Error("Array contains invalid value: "+e);return new Uint8Array(e)}if(r(e.length)&&n(e))return new Uint8Array(e);throw new Error("unsupported array-like object")}function o(e){return new Uint8Array(e)}function a(e,t,r,n,i){null==n&&null==i||(e=e.slice?e.slice(n,i):Array.prototype.slice.call(e,n,i)),t.set(e,r)}var s,c={toBytes:function(e){var t=[],r=0;for(e=encodeURI(e);r191&&n<224?(t.push(String.fromCharCode((31&n)<<6|63&e[r+1])),r+=2):(t.push(String.fromCharCode((15&n)<<12|(63&e[r+1])<<6|63&e[r+2])),r+=3)}return t.join("")}},u=(s="0123456789abcdef",{toBytes:function(e){for(var t=[],r=0;r>4]+s[15&n])}return t.join("")}}),f={16:10,24:12,32:14},d=[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],l=[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],h=[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],p=[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],m=[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],g=[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],y=[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],b=[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],v=[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],w=[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],A=[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],_=[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],E=[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],S=[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],P=[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 x(e){for(var t=[],r=0;r>2,this._Ke[r][t%4]=o[t],this._Kd[e-r][t%4]=o[t];for(var a,s=0,c=i;c>16&255]<<24^l[a>>8&255]<<16^l[255&a]<<8^l[a>>24&255]^d[s]<<24,s+=1,8!=i)for(t=1;t>8&255]<<8^l[a>>16&255]<<16^l[a>>24&255]<<24;for(t=i/2+1;t>2,h=c%4,this._Ke[u][h]=o[t],this._Kd[e-u][h]=o[t++],c++}for(var u=1;u>24&255]^E[a>>16&255]^S[a>>8&255]^P[255&a]},k.prototype.encrypt=function(e){if(16!=e.length)throw new Error("invalid plaintext size (must be 16 bytes)");for(var t=this._Ke.length-1,r=[0,0,0,0],n=x(e),i=0;i<4;i++)n[i]^=this._Ke[0][i];for(var a=1;a>24&255]^m[n[(i+1)%4]>>16&255]^g[n[(i+2)%4]>>8&255]^y[255&n[(i+3)%4]]^this._Ke[a][i];n=r.slice()}var s,c=o(16);for(i=0;i<4;i++)s=this._Ke[t][i],c[4*i]=255&(l[n[i]>>24&255]^s>>24),c[4*i+1]=255&(l[n[(i+1)%4]>>16&255]^s>>16),c[4*i+2]=255&(l[n[(i+2)%4]>>8&255]^s>>8),c[4*i+3]=255&(l[255&n[(i+3)%4]]^s);return c},k.prototype.decrypt=function(e){if(16!=e.length)throw new Error("invalid ciphertext size (must be 16 bytes)");for(var t=this._Kd.length-1,r=[0,0,0,0],n=x(e),i=0;i<4;i++)n[i]^=this._Kd[0][i];for(var a=1;a>24&255]^v[n[(i+3)%4]>>16&255]^w[n[(i+2)%4]>>8&255]^A[255&n[(i+1)%4]]^this._Kd[a][i];n=r.slice()}var s,c=o(16);for(i=0;i<4;i++)s=this._Kd[t][i],c[4*i]=255&(h[n[i]>>24&255]^s>>24),c[4*i+1]=255&(h[n[(i+3)%4]>>16&255]^s>>16),c[4*i+2]=255&(h[n[(i+2)%4]>>8&255]^s>>8),c[4*i+3]=255&(h[255&n[(i+1)%4]]^s);return c};var M=function(e){if(!(this instanceof M))throw Error("AES must be instanitated with `new`");this.description="Electronic Code Block",this.name="ecb",this._aes=new k(e)};M.prototype.encrypt=function(e){if((e=i(e)).length%16!=0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var t=o(e.length),r=o(16),n=0;n=0;--t)this._counter[t]=e%256,e>>=8},N.prototype.setBytes=function(e){if(16!=(e=i(e,!0)).length)throw new Error("invalid counter bytes size (must be 16 bytes)");this._counter=e},N.prototype.increment=function(){for(var e=15;e>=0;e--){if(255!==this._counter[e]){this._counter[e]++;break}this._counter[e]=0}};var O=function(e,t){if(!(this instanceof O))throw Error("AES must be instanitated with `new`");this.description="Counter",this.name="ctr",t instanceof N||(t=new N(t)),this._counter=t,this._remainingCounter=null,this._remainingCounterIndex=16,this._aes=new k(e)};O.prototype.encrypt=function(e){for(var t=i(e,!0),r=0;r16)throw new Error("PKCS#7 padding byte out of range");for(var r=e.length-t,n=0;n=64;){let h,p,m,g,y,b=r,v=n,w=i,A=o,_=a,E=s,S=c,P=u;for(p=0;p<16;p++)m=d+4*p,f[p]=(255&e[m])<<24|(255&e[m+1])<<16|(255&e[m+2])<<8|255&e[m+3];for(p=16;p<64;p++)h=f[p-2],g=(h>>>17|h<<15)^(h>>>19|h<<13)^h>>>10,h=f[p-15],y=(h>>>7|h<<25)^(h>>>18|h<<14)^h>>>3,f[p]=(g+f[p-7]|0)+(y+f[p-16]|0)|0;for(p=0;p<64;p++)g=(((_>>>6|_<<26)^(_>>>11|_<<21)^(_>>>25|_<<7))+(_&E^~_&S)|0)+(P+(t[p]+f[p]|0)|0)|0,y=((b>>>2|b<<30)^(b>>>13|b<<19)^(b>>>22|b<<10))+(b&v^b&w^v&w)|0,P=S,S=E,E=_,_=A+g|0,A=w,w=v,v=b,b=g+y|0;r=r+b|0,n=n+v|0,i=i+w|0,o=o+A|0,a=a+_|0,s=s+E|0,c=c+S|0,u=u+P|0,d+=64,l-=64}}d(e);let l,h=e.length%64,p=e.length/536870912|0,m=e.length<<3,g=h<56?56:120,y=e.slice(e.length-h,e.length);for(y.push(128),l=h+1;l>>24&255),y.push(p>>>16&255),y.push(p>>>8&255),y.push(p>>>0&255),y.push(m>>>24&255),y.push(m>>>16&255),y.push(m>>>8&255),y.push(m>>>0&255),d(y),[r>>>24&255,r>>>16&255,r>>>8&255,r>>>0&255,n>>>24&255,n>>>16&255,n>>>8&255,n>>>0&255,i>>>24&255,i>>>16&255,i>>>8&255,i>>>0&255,o>>>24&255,o>>>16&255,o>>>8&255,o>>>0&255,a>>>24&255,a>>>16&255,a>>>8&255,a>>>0&255,s>>>24&255,s>>>16&255,s>>>8&255,s>>>0&255,c>>>24&255,c>>>16&255,c>>>8&255,c>>>0&255,u>>>24&255,u>>>16&255,u>>>8&255,u>>>0&255]}function i(e,t,r){e=e.length<=64?e:n(e);const i=64+t.length+4,o=new Array(i),a=new Array(64);let s,c=[];for(s=0;s<64;s++)o[s]=54;for(s=0;s=i-4;e--){if(o[e]++,o[e]<=255)return;o[e]=0}}for(;r>=32;)u(),c=c.concat(n(a.concat(n(o)))),r-=32;return r>0&&(u(),c=c.concat(n(a.concat(n(o))).slice(0,r))),c}function o(e,t,r,n,i){let o;for(u(e,16*(2*r-1),i,0,16),o=0;o<2*r;o++)c(e,16*o,i,16),s(i,n),u(i,0,e,t+16*o,16);for(o=0;o>>32-t}function s(e,t){u(e,0,t,0,16);for(let e=8;e>0;e-=2)t[4]^=a(t[0]+t[12],7),t[8]^=a(t[4]+t[0],9),t[12]^=a(t[8]+t[4],13),t[0]^=a(t[12]+t[8],18),t[9]^=a(t[5]+t[1],7),t[13]^=a(t[9]+t[5],9),t[1]^=a(t[13]+t[9],13),t[5]^=a(t[1]+t[13],18),t[14]^=a(t[10]+t[6],7),t[2]^=a(t[14]+t[10],9),t[6]^=a(t[2]+t[14],13),t[10]^=a(t[6]+t[2],18),t[3]^=a(t[15]+t[11],7),t[7]^=a(t[3]+t[15],9),t[11]^=a(t[7]+t[3],13),t[15]^=a(t[11]+t[7],18),t[1]^=a(t[0]+t[3],7),t[2]^=a(t[1]+t[0],9),t[3]^=a(t[2]+t[1],13),t[0]^=a(t[3]+t[2],18),t[6]^=a(t[5]+t[4],7),t[7]^=a(t[6]+t[5],9),t[4]^=a(t[7]+t[6],13),t[5]^=a(t[4]+t[7],18),t[11]^=a(t[10]+t[9],7),t[8]^=a(t[11]+t[10],9),t[9]^=a(t[8]+t[11],13),t[10]^=a(t[9]+t[8],18),t[12]^=a(t[15]+t[14],7),t[13]^=a(t[12]+t[15],9),t[14]^=a(t[13]+t[12],13),t[15]^=a(t[14]+t[13],18);for(let r=0;r<16;++r)e[r]+=t[r]}function c(e,t,r,n){for(let i=0;i=256)return!1}return!0}function d(e,t){if("number"!=typeof e||e%1)throw new Error("invalid "+t);return e}function l(e,t,n,a,s,l,h){if(n=d(n,"N"),a=d(a,"r"),s=d(s,"p"),l=d(l,"dkLen"),0===n||0!=(n&n-1))throw new Error("N must be power of 2");if(n>r/128/a)throw new Error("N too large");if(a>r/128/s)throw new Error("r too large");if(!f(e))throw new Error("password must be an array or buffer");if(e=Array.prototype.slice.call(e),!f(t))throw new Error("salt must be an array or buffer");t=Array.prototype.slice.call(t);let p=i(e,t,128*s*a);const m=new Uint32Array(32*s*a);for(let e=0;eC&&(t=C);for(let e=0;eC&&(t=C);for(let e=0;e>0&255),p.push(m[e]>>8&255),p.push(m[e]>>16&255),p.push(m[e]>>24&255);const r=i(e,p,l);return h&&h(null,1,r),r}h&&I(R)};if(!h)for(;;){const e=R();if(null!=e)return e}R()}const h={scrypt:function(e,t,r,n,i,o,a){return new Promise((function(s,c){let u=0;a&&a(0),l(e,t,r,n,i,o,(function(e,t,r){if(e)c(e);else if(r)a&&1!==u&&a(1),s(new Uint8Array(r));else if(a&&t!==u)return u=t,a(t)}))}))},syncScrypt:function(e,t,r,n,i,o){return new Uint8Array(l(e,t,r,n,i,o))}};e.exports=h}()}(Vd);var Zd=c(Vd.exports),Xd=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))};const Qd=new bo(Bd);function Yd(e){return null!=e&&e.mnemonic&&e.mnemonic.phrase}class el extends Ea{isKeystoreAccount(e){return!(!e||!e._isKeystoreAccount)}}function tl(e,t){const r=Fd(Ld(e,"crypto/ciphertext"));if(No(rs(ko([t.slice(16,32),r]))).substring(2)!==Ld(e,"crypto/mac").toLowerCase())throw new Error("invalid password");const n=function(e,t,r){if("aes-128-ctr"===Ld(e,"crypto/cipher")){const n=Fd(Ld(e,"crypto/cipherparams/iv")),i=new $d.Counter(n);return xo(new $d.ModeOfOperation.ctr(t,i).decrypt(r))}return null}(e,t.slice(0,16),r);n||Qd.throwError("unsupported cipher",bo.errors.UNSUPPORTED_OPERATION,{operation:"decrypt"});const i=t.slice(32,64),o=xf(n);if(e.address){let t=e.address.toLowerCase();if("0x"!==t.substring(0,2)&&(t="0x"+t),bs(t)!==o)throw new Error("address mismatch")}const a={_isKeystoreAccount:!0,address:o,privateKey:No(n)};if("0.1"===Ld(e,"x-ethers/version")){const t=Fd(Ld(e,"x-ethers/mnemonicCiphertext")),r=Fd(Ld(e,"x-ethers/mnemonicCounter")),n=new $d.Counter(r),o=new $d.ModeOfOperation.ctr(i,n),s=Ld(e,"x-ethers/path")||Pd,c=Ld(e,"x-ethers/locale")||"en",u=xo(o.decrypt(t));try{const e=Cd(u,c),t=xd.fromMnemonic(e,null,c).derivePath(s);if(t.privateKey!=a.privateKey)throw new Error("mnemonic mismatch");a.mnemonic=t.mnemonic}catch(e){if(e.code!==bo.errors.INVALID_ARGUMENT||"wordlist"!==e.argument)throw e}}return new el(a)}function rl(e,t,r,n,i){return xo(ud(e,t,r,n,i))}function nl(e,t,r,n,i){return Promise.resolve(rl(e,t,r,n,i))}function il(e,t,r,n,i){const o=Ud(t),a=Ld(e,"crypto/kdf");if(a&&"string"==typeof a){const t=function(e,t){return Qd.throwArgumentError("invalid key-derivation function parameters",e,t)};if("scrypt"===a.toLowerCase()){const r=Fd(Ld(e,"crypto/kdfparams/salt")),s=parseInt(Ld(e,"crypto/kdfparams/n")),c=parseInt(Ld(e,"crypto/kdfparams/r")),u=parseInt(Ld(e,"crypto/kdfparams/p"));s&&c&&u||t("kdf",a),0!=(s&s-1)&&t("N",s);const f=parseInt(Ld(e,"crypto/kdfparams/dklen"));return 32!==f&&t("dklen",f),n(o,r,s,c,u,64,i)}if("pbkdf2"===a.toLowerCase()){const n=Fd(Ld(e,"crypto/kdfparams/salt"));let i=null;const a=Ld(e,"crypto/kdfparams/prf");"hmac-sha256"===a?i="sha256":"hmac-sha512"===a?i="sha512":t("prf",a);const s=parseInt(Ld(e,"crypto/kdfparams/c")),c=parseInt(Ld(e,"crypto/kdfparams/dklen"));return 32!==c&&t("dklen",c),r(o,n,s,c,i)}}return Qd.throwArgumentError("unsupported key-derivation function","kdf",a)}function ol(e,t){const r=JSON.parse(e);return tl(r,il(r,t,rl,Zd.syncScrypt))}function al(e,t,r){return Xd(this,void 0,void 0,(function*(){const n=JSON.parse(e);return tl(n,yield il(n,t,nl,Zd.scrypt,r))}))}function sl(e,t,r,n){try{if(bs(e.address)!==xf(e.privateKey))throw new Error("address/privateKey mismatch");if(Yd(e)){const t=e.mnemonic;if(xd.fromMnemonic(t.phrase,null,t.locale).derivePath(t.path||Pd).privateKey!=e.privateKey)throw new Error("mnemonic mismatch")}}catch(e){return Promise.reject(e)}"function"!=typeof r||n||(n=r,r={}),r||(r={});const i=xo(e.privateKey),o=Ud(t);let a=null,s=null,c=null;if(Yd(e)){const t=e.mnemonic;a=xo(Md(t.phrase,t.locale||"en")),s=t.path||Pd,c=t.locale||"en"}let u=r.client;u||(u="ethers.js");let f=null;f=r.salt?xo(r.salt):Td(32);let d=null;if(r.iv){if(d=xo(r.iv),16!==d.length)throw new Error("invalid iv")}else d=Td(16);let l=null;if(r.uuid){if(l=xo(r.uuid),16!==l.length)throw new Error("invalid uuid")}else l=Td(16);let h=1<<17,p=8,m=1;return r.scrypt&&(r.scrypt.N&&(h=r.scrypt.N),r.scrypt.r&&(p=r.scrypt.r),r.scrypt.p&&(m=r.scrypt.p)),Zd.scrypt(o,f,h,p,m,64,n).then((t=>{const r=(t=xo(t)).slice(0,16),n=t.slice(16,32),o=t.slice(32,64),g=new $d.Counter(d),y=xo(new $d.ModeOfOperation.ctr(r,g).encrypt(i)),b=rs(ko([n,y])),v={address:e.address.substring(2).toLowerCase(),id:qd(l),version:3,crypto:{cipher:"aes-128-ctr",cipherparams:{iv:No(d).substring(2)},ciphertext:No(y).substring(2),kdf:"scrypt",kdfparams:{salt:No(f).substring(2),n:h,dklen:32,p:m,r:p},mac:b.substring(2)}};if(a){const e=Td(16),t=new $d.Counter(e),r=xo(new $d.ModeOfOperation.ctr(o,t).encrypt(a)),n=new Date,i=n.getUTCFullYear()+"-"+zd(n.getUTCMonth()+1,2)+"-"+zd(n.getUTCDate(),2)+"T"+zd(n.getUTCHours(),2)+"-"+zd(n.getUTCMinutes(),2)+"-"+zd(n.getUTCSeconds(),2)+".0Z";v["x-ethers"]={client:u,gethFilename:"UTC--"+i+"--"+v.address,mnemonicCounter:No(e).substring(2),mnemonicCiphertext:No(r).substring(2),path:s,locale:c,version:"0.1"}}return JSON.stringify(v)}))}function cl(e,t,r){if(Wd(e)){r&&r(0);const n=Jd(e,t);return r&&r(1),Promise.resolve(n)}return Gd(e)?al(e,t,r):Promise.reject(new Error("invalid JSON wallet"))}function ul(e,t){if(Wd(e))return Jd(e,t);if(Gd(e))return ol(e,t);throw new Error("invalid JSON wallet")}var fl=Object.freeze({__proto__:null,decryptCrowdsale:Jd,decryptJsonWallet:cl,decryptJsonWalletSync:ul,decryptKeystore:al,decryptKeystoreSync:ol,encryptKeystore:sl,getJsonWalletAddress:function(e){if(Wd(e))try{return bs(JSON.parse(e).ethaddr)}catch(e){return null}if(Gd(e))try{return bs(JSON.parse(e).address)}catch(e){return null}return null},isCrowdsaleWallet:Wd,isKeystoreWallet:Gd});var dl=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))};const ll=new bo("wallet/5.7.0");class hl extends ku{constructor(e,t){if(super(),null!=(r=e)&&Io(r.privateKey,32)&&null!=r.address){const t=new gf(e.privateKey);if(pa(this,"_signingKey",(()=>t)),pa(this,"address",xf(this.publicKey)),this.address!==bs(e.address)&&ll.throwArgumentError("privateKey/address mismatch","privateKey","[REDACTED]"),function(e){const t=e.mnemonic;return t&&t.phrase}(e)){const t=e.mnemonic;pa(this,"_mnemonic",(()=>({phrase:t.phrase,path:t.path||Pd,locale:t.locale||"en"})));const r=this.mnemonic;xf(xd.fromMnemonic(r.phrase,null,r.locale).derivePath(r.path).privateKey)!==this.address&&ll.throwArgumentError("mnemonic/address mismatch","privateKey","[REDACTED]")}else pa(this,"_mnemonic",(()=>null))}else{if(gf.isSigningKey(e))"secp256k1"!==e.curve&&ll.throwArgumentError("unsupported curve; must be secp256k1","privateKey","[REDACTED]"),pa(this,"_signingKey",(()=>e));else{"string"==typeof e&&e.match(/^[0-9a-f]*$/i)&&64===e.length&&(e="0x"+e);const t=new gf(e);pa(this,"_signingKey",(()=>t))}pa(this,"_mnemonic",(()=>null)),pa(this,"address",xf(this.publicKey))}var r;t&&!_u.isProvider(t)&&ll.throwArgumentError("invalid provider","provider",t),pa(this,"provider",t||null)}get mnemonic(){return this._mnemonic()}get privateKey(){return this._signingKey().privateKey}get publicKey(){return this._signingKey().publicKey}getAddress(){return Promise.resolve(this.address)}connect(e){return new hl(this,e)}signTransaction(e){return ga(e).then((t=>{null!=t.from&&(bs(t.from)!==this.address&&ll.throwArgumentError("transaction from address mismatch","transaction.from",e.from),delete t.from);const r=this._signingKey().signDigest(rs(Tf(t)));return Tf(t,r)}))}signMessage(e){return dl(this,void 0,void 0,(function*(){return zo(this._signingKey().signDigest(Jc(e)))}))}_signTypedData(e,t,r){return dl(this,void 0,void 0,(function*(){const n=yield cu.resolveNames(e,t,r,(e=>(null==this.provider&&ll.throwError("cannot resolve ENS names without a provider",bo.errors.UNSUPPORTED_OPERATION,{operation:"resolveName",value:e}),this.provider.resolveName(e))));return zo(this._signingKey().signDigest(cu.hash(n.domain,t,n.value)))}))}encrypt(e,t,r){if("function"!=typeof t||r||(r=t,t={}),r&&"function"!=typeof r)throw new Error("invalid callback");return t||(t={}),sl(this,e,t,r)}static createRandom(e){let t=Td(16);e||(e={}),e.extraEntropy&&(t=xo(To(rs(ko([t,e.extraEntropy])),0,16)));const r=Cd(t,e.locale);return hl.fromMnemonic(r,e.path,e.locale)}static fromEncryptedJson(e,t,r){return cl(e,t,r).then((e=>new hl(e)))}static fromEncryptedJsonSync(e,t){return new hl(ul(e,t))}static fromMnemonic(e,t,r){return t||(t=Pd),new hl(xd.fromMnemonic(e,null,r).derivePath(t))}}var pl=Object.freeze({__proto__:null,Wallet:hl,verifyMessage:function(e,t){return kf(Jc(e),t)},verifyTypedData:function(e,t,r,n){return kf(cu.hash(e,t,r),n)}});const ml=new bo("networks/5.7.1");function gl(e){const t=function(t,r){null==r&&(r={});const n=[];if(t.InfuraProvider&&"-"!==r.infura)try{n.push(new t.InfuraProvider(e,r.infura))}catch(e){}if(t.EtherscanProvider&&"-"!==r.etherscan)try{n.push(new t.EtherscanProvider(e,r.etherscan))}catch(e){}if(t.AlchemyProvider&&"-"!==r.alchemy)try{n.push(new t.AlchemyProvider(e,r.alchemy))}catch(e){}if(t.PocketProvider&&"-"!==r.pocket){const i=["goerli","ropsten","rinkeby","sepolia"];try{const o=new t.PocketProvider(e,r.pocket);o.network&&-1===i.indexOf(o.network.name)&&n.push(o)}catch(e){}}if(t.CloudflareProvider&&"-"!==r.cloudflare)try{n.push(new t.CloudflareProvider(e))}catch(e){}if(t.AnkrProvider&&"-"!==r.ankr)try{const i=["ropsten"],o=new t.AnkrProvider(e,r.ankr);o.network&&-1===i.indexOf(o.network.name)&&n.push(o)}catch(e){}if(0===n.length)return null;if(t.FallbackProvider){let i=1;return null!=r.quorum?i=r.quorum:"homestead"===e&&(i=2),new t.FallbackProvider(n,i)}return n[0]};return t.renetwork=function(e){return gl(e)},t}function yl(e,t){const r=function(r,n){return r.JsonRpcProvider?new r.JsonRpcProvider(e,t):null};return r.renetwork=function(t){return yl(e,t)},r}const bl={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:gl("homestead")},vl={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:gl("ropsten")},wl={chainId:63,name:"classicMordor",_defaultProvider:yl("https://www.ethercluster.com/mordor","classicMordor")},Al={unspecified:{chainId:0,name:"unspecified"},homestead:bl,mainnet:bl,morden:{chainId:2,name:"morden"},ropsten:vl,testnet:vl,rinkeby:{chainId:4,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"rinkeby",_defaultProvider:gl("rinkeby")},kovan:{chainId:42,name:"kovan",_defaultProvider:gl("kovan")},goerli:{chainId:5,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"goerli",_defaultProvider:gl("goerli")},kintsugi:{chainId:1337702,name:"kintsugi"},sepolia:{chainId:11155111,name:"sepolia",_defaultProvider:gl("sepolia")},classic:{chainId:61,name:"classic",_defaultProvider:yl("https://www.ethercluster.com/etc","classic")},classicMorden:{chainId:62,name:"classicMorden"},classicMordor:wl,classicTestnet:wl,classicKotti:{chainId:6,name:"classicKotti",_defaultProvider:yl("https://www.ethercluster.com/kotti","classicKotti")},xdai:{chainId:100,name:"xdai"},matic:{chainId:137,name:"matic",_defaultProvider:gl("matic")},maticmum:{chainId:80001,name:"maticmum"},optimism:{chainId:10,name:"optimism",_defaultProvider:gl("optimism")},"optimism-kovan":{chainId:69,name:"optimism-kovan"},"optimism-goerli":{chainId:420,name:"optimism-goerli"},arbitrum:{chainId:42161,name:"arbitrum"},"arbitrum-rinkeby":{chainId:421611,name:"arbitrum-rinkeby"},"arbitrum-goerli":{chainId:421613,name:"arbitrum-goerli"},bnb:{chainId:56,name:"bnb"},bnbt:{chainId:97,name:"bnbt"}};var _l=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))};function El(e,t){return _l(this,void 0,void 0,(function*(){null==t&&(t={});const r={method:t.method||"GET",headers:t.headers||{},body:t.body||void 0};if(!0!==t.skipFetchSetup&&(r.mode="cors",r.cache="no-cache",r.credentials="same-origin",r.redirect="follow",r.referrer="client"),null!=t.fetchOptions){const e=t.fetchOptions;e.mode&&(r.mode=e.mode),e.cache&&(r.cache=e.cache),e.credentials&&(r.credentials=e.credentials),e.redirect&&(r.redirect=e.redirect),e.referrer&&(r.referrer=e.referrer)}const n=yield fetch(e,r),i=yield n.arrayBuffer(),o={};return n.headers.forEach?n.headers.forEach(((e,t)=>{o[t.toLowerCase()]=e})):n.headers.keys().forEach((e=>{o[e.toLowerCase()]=n.headers.get(e)})),{headers:o,statusCode:n.status,statusMessage:n.statusText,body:xo(new Uint8Array(i))}}))}var Sl=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))};const Pl=new bo("web/5.7.1");function xl(e){return new Promise((t=>{setTimeout(t,e)}))}function kl(e,t){if(null==e)return null;if("string"==typeof e)return e;if(Eo(e)){if(t&&("text"===t.split("/")[0]||"application/json"===t.split(";")[0].trim()))try{return Ws(e)}catch(e){}return No(e)}return e}function Ml(e,t,r){const n="object"==typeof e&&null!=e.throttleLimit?e.throttleLimit:12;Pl.assertArgument(n>0&&n%1==0,"invalid connection throttle limit","connection.throttleLimit",n);const i="object"==typeof e?e.throttleCallback:null,o="object"==typeof e&&"number"==typeof e.throttleSlotInterval?e.throttleSlotInterval:100;Pl.assertArgument(o>0&&o%1==0,"invalid connection throttle slot interval","connection.throttleSlotInterval",o);const a="object"==typeof e&&!!e.errorPassThrough,s={};let c=null;const u={method:"GET"};let f=!1,d=12e4;if("string"==typeof e)c=e;else if("object"==typeof e){if(null!=e&&null!=e.url||Pl.throwArgumentError("missing URL","connection.url",e),c=e.url,"number"==typeof e.timeout&&e.timeout>0&&(d=e.timeout),e.headers)for(const t in e.headers)s[t.toLowerCase()]={key:t,value:String(e.headers[t])},["if-none-match","if-modified-since"].indexOf(t.toLowerCase())>=0&&(f=!0);if(u.allowGzip=!!e.allowGzip,null!=e.user&&null!=e.password){"https:"!==c.substring(0,6)&&!0!==e.allowInsecureAuthentication&&Pl.throwError("basic authentication requires a secure https url",bo.errors.INVALID_ARGUMENT,{argument:"url",url:c,user:e.user,password:"[REDACTED]"});const t=e.user+":"+e.password;s.authorization={key:"Authorization",value:"Basic "+gc(Hs(t))}}null!=e.skipFetchSetup&&(u.skipFetchSetup=!!e.skipFetchSetup),null!=e.fetchOptions&&(u.fetchOptions=ba(e.fetchOptions))}const l=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),h=c?c.match(l):null;if(h)try{const e={statusCode:200,statusMessage:"OK",headers:{"content-type":h[1]||"text/plain"},body:h[2]?mc(h[3]):(p=h[3],Hs(p.replace(/%([0-9a-f][0-9a-f])/gi,((e,t)=>String.fromCharCode(parseInt(t,16))))))};let t=e.body;return r&&(t=r(e.body,e)),Promise.resolve(t)}catch(e){Pl.throwError("processing response error",bo.errors.SERVER_ERROR,{body:kl(h[1],h[2]),error:e,requestBody:null,requestMethod:"GET",url:c})}var p;t&&(u.method="POST",u.body=t,null==s["content-type"]&&(s["content-type"]={key:"Content-Type",value:"application/octet-stream"}),null==s["content-length"]&&(s["content-length"]={key:"Content-Length",value:String(t.length)}));const m={};Object.keys(s).forEach((e=>{const t=s[e];m[t.key]=t.value})),u.headers=m;const g=function(){let e=null;return{promise:new Promise((function(t,r){d&&(e=setTimeout((()=>{null!=e&&(e=null,r(Pl.makeError("timeout",bo.errors.TIMEOUT,{requestBody:kl(u.body,m["content-type"]),requestMethod:u.method,timeout:d,url:c})))}),d))})),cancel:function(){null!=e&&(clearTimeout(e),e=null)}}}(),y=function(){return Sl(this,void 0,void 0,(function*(){for(let e=0;e=300)&&(g.cancel(),Pl.throwError("bad response",bo.errors.SERVER_ERROR,{status:t.statusCode,headers:t.headers,body:kl(s,t.headers?t.headers["content-type"]:null),requestBody:kl(u.body,m["content-type"]),requestMethod:u.method,url:c})),r)try{const e=yield r(s,t);return g.cancel(),e}catch(r){if(r.throttleRetry&&e"content-type"===e.toLowerCase())).length||(r.headers=ba(r.headers),r.headers["content-type"]="application/json")}else r.headers={"content-type":"application/json"};e=r}return Ml(e,n,((e,t)=>{let n=null;if(null!=e)try{n=JSON.parse(Ws(e))}catch(t){Pl.throwError("invalid JSON",bo.errors.SERVER_ERROR,{body:e,error:t})}return r&&(n=r(n,t)),n}))}function Il(e,t){return t||(t={}),null==(t=ba(t)).floor&&(t.floor=0),null==t.ceiling&&(t.ceiling=1e4),null==t.interval&&(t.interval=250),new Promise((function(r,n){let i=null,o=!1;const a=()=>!o&&(o=!0,i&&clearTimeout(i),!0);t.timeout&&(i=setTimeout((()=>{a()&&n(new Error("timeout"))}),t.timeout));const s=t.retryLimit;let c=0;!function i(){return e().then((function(e){if(void 0!==e)a()&&r(e);else if(t.oncePoll)t.oncePoll.once("poll",i);else if(t.onceBlock)t.onceBlock.once("block",i);else if(!o){if(c++,c>s)return void(a()&&n(new Error("retry limit reached")));let e=t.interval*parseInt(String(Math.random()*Math.pow(2,c)));et.ceiling&&(e=t.ceiling),setTimeout(i,e)}return null}),(function(e){a()&&n(e)}))}()}))}for(var Rl=Object.freeze({__proto__:null,_fetchData:Ml,fetchJson:Cl,poll:Il}),Nl="qpzry9x8gf2tvdw0s3jn54khce6mua7l",Ol={},Tl=0;Tl>25;return(33554431&e)<<5^996825010&-(t>>0&1)^642813549&-(t>>1&1)^513874426&-(t>>2&1)^1027748829&-(t>>3&1)^705979059&-(t>>4&1)}function $l(e){for(var t=1,r=0;r126)return"Invalid prefix ("+e+")";t=Dl(t)^n>>5}for(t=Dl(t),r=0;rt)return"Exceeds length limit";var r=e.toLowerCase(),n=e.toUpperCase();if(e!==r&&e!==n)return"Mixed-case string "+e;var i=(e=r).lastIndexOf("1");if(-1===i)return"No separator character for "+e;if(0===i)return"Missing prefix for "+e;var o=e.slice(0,i),a=e.slice(i+1);if(a.length<6)return"Data too short";var s=$l(o);if("string"==typeof s)return s;for(var c=[],u=0;u=a.length||c.push(d)}return 1!==s?"Invalid checksum for "+e:{prefix:o,words:c}}function Fl(e,t,r,n){for(var i=0,o=0,a=(1<=r;)o-=r,s.push(i>>o&a);if(n)o>0&&s.push(i<=t)return"Excess padding";if(i<r)throw new TypeError("Exceeds length limit");var n=$l(e=e.toLowerCase());if("string"==typeof n)throw new Error(n);for(var i=e+"1",o=0;o>5!=0)throw new Error("Non 5-bit word");n=Dl(n)^a,i+=Nl.charAt(a)}for(o=0;o<6;++o)n=Dl(n);for(n^=1,o=0;o<6;++o){i+=Nl.charAt(n>>5*(5-o)&31)}return i},toWordsUnsafe:function(e){var t=Fl(e,8,5,!0);if(Array.isArray(t))return t},toWords:function(e){var t=Fl(e,8,5,!0);if(Array.isArray(t))return t;throw new Error(t)},fromWordsUnsafe:function(e){var t=Fl(e,5,8,!1);if(Array.isArray(t))return t},fromWords:function(e){var t=Fl(e,5,8,!1);if(Array.isArray(t))return t;throw new Error(t)}},Ul=c(zl);const Ll="providers/5.7.2",ql=new bo(Ll);class Hl{constructor(){this.formats=this.getDefaultFormats()}getDefaultFormats(){const e={},t=this.address.bind(this),r=this.bigNumber.bind(this),n=this.blockTag.bind(this),i=this.data.bind(this),o=this.hash.bind(this),a=this.hex.bind(this),s=this.number.bind(this),c=this.type.bind(this);return e.transaction={hash:o,type:c,accessList:Hl.allowNull(this.accessList.bind(this),null),blockHash:Hl.allowNull(o,null),blockNumber:Hl.allowNull(s,null),transactionIndex:Hl.allowNull(s,null),confirmations:Hl.allowNull(s,null),from:t,gasPrice:Hl.allowNull(r),maxPriorityFeePerGas:Hl.allowNull(r),maxFeePerGas:Hl.allowNull(r),gasLimit:r,to:Hl.allowNull(t,null),value:r,nonce:s,data:i,r:Hl.allowNull(this.uint256),s:Hl.allowNull(this.uint256),v:Hl.allowNull(s),creates:Hl.allowNull(t,null),raw:Hl.allowNull(i)},e.transactionRequest={from:Hl.allowNull(t),nonce:Hl.allowNull(s),gasLimit:Hl.allowNull(r),gasPrice:Hl.allowNull(r),maxPriorityFeePerGas:Hl.allowNull(r),maxFeePerGas:Hl.allowNull(r),to:Hl.allowNull(t),value:Hl.allowNull(r),data:Hl.allowNull((e=>this.data(e,!0))),type:Hl.allowNull(s),accessList:Hl.allowNull(this.accessList.bind(this),null)},e.receiptLog={transactionIndex:s,blockNumber:s,transactionHash:o,address:t,topics:Hl.arrayOf(o),data:i,logIndex:s,blockHash:o},e.receipt={to:Hl.allowNull(this.address,null),from:Hl.allowNull(this.address,null),contractAddress:Hl.allowNull(t,null),transactionIndex:s,root:Hl.allowNull(a),gasUsed:r,logsBloom:Hl.allowNull(i),blockHash:o,transactionHash:o,logs:Hl.arrayOf(this.receiptLog.bind(this)),blockNumber:s,confirmations:Hl.allowNull(s,null),cumulativeGasUsed:r,effectiveGasPrice:Hl.allowNull(r),status:Hl.allowNull(s),type:c},e.block={hash:Hl.allowNull(o),parentHash:o,number:s,timestamp:s,nonce:Hl.allowNull(a),difficulty:this.difficulty.bind(this),gasLimit:r,gasUsed:r,miner:Hl.allowNull(t),extraData:i,transactions:Hl.allowNull(Hl.arrayOf(o)),baseFeePerGas:Hl.allowNull(r)},e.blockWithTransactions=ba(e.block),e.blockWithTransactions.transactions=Hl.allowNull(Hl.arrayOf(this.transactionResponse.bind(this))),e.filter={fromBlock:Hl.allowNull(n,void 0),toBlock:Hl.allowNull(n,void 0),blockHash:Hl.allowNull(o,void 0),address:Hl.allowNull(t,void 0),topics:Hl.allowNull(this.topics.bind(this),void 0)},e.filterLog={blockNumber:Hl.allowNull(s),blockHash:Hl.allowNull(o),transactionIndex:s,removed:Hl.allowNull(this.boolean.bind(this)),address:t,data:Hl.allowFalsish(i,"0x"),topics:Hl.arrayOf(o),transactionHash:o,logIndex:s},e}accessList(e){return If(e||[])}number(e){return"0x"===e?0:Go.from(e).toNumber()}type(e){return"0x"===e||null==e?0:Go.from(e).toNumber()}bigNumber(e){return Go.from(e)}boolean(e){if("boolean"==typeof e)return e;if("string"==typeof e){if("true"===(e=e.toLowerCase()))return!0;if("false"===e)return!1}throw new Error("invalid boolean - "+e)}hex(e,t){return"string"==typeof e&&(t||"0x"===e.substring(0,2)||(e="0x"+e),Io(e))?e.toLowerCase():ql.throwArgumentError("invalid hash","value",e)}data(e,t){const r=this.hex(e,t);if(r.length%2!=0)throw new Error("invalid data; odd-length - "+e);return r}address(e){return bs(e)}callAddress(e){if(!Io(e,32))return null;const t=bs(To(e,12));return"0x0000000000000000000000000000000000000000"===t?null:t}contractAddress(e){return vs(e)}blockTag(e){if(null==e)return"latest";if("earliest"===e)return"0x0";switch(e){case"earliest":return"0x0";case"latest":case"pending":case"safe":case"finalized":return e}if("number"==typeof e||Io(e))return Do(e);throw new Error("invalid blockTag")}hash(e,t){const r=this.hex(e,t);return 32!==Oo(r)?ql.throwArgumentError("invalid hash","value",e):r}difficulty(e){if(null==e)return null;const t=Go.from(e);try{return t.toNumber()}catch(e){}return null}uint256(e){if(!Io(e))throw new Error("invalid uint256");return Bo(e,32)}_block(e,t){null!=e.author&&null==e.miner&&(e.miner=e.author);const r=null!=e._difficulty?e._difficulty:e.difficulty,n=Hl.check(t,e);return n._difficulty=null==r?null:Go.from(r),n}block(e){return this._block(e,this.formats.block)}blockWithTransactions(e){return this._block(e,this.formats.blockWithTransactions)}transactionRequest(e){return Hl.check(this.formats.transactionRequest,e)}transactionResponse(e){null!=e.gas&&null==e.gasLimit&&(e.gasLimit=e.gas),e.to&&Go.from(e.to).isZero()&&(e.to="0x0000000000000000000000000000000000000000"),null!=e.input&&null==e.data&&(e.data=e.input),null==e.to&&null==e.creates&&(e.creates=this.contractAddress(e)),1!==e.type&&2!==e.type||null!=e.accessList||(e.accessList=[]);const t=Hl.check(this.formats.transaction,e);if(null!=e.chainId){let r=e.chainId;Io(r)&&(r=Go.from(r).toNumber()),t.chainId=r}else{let r=e.networkId;null==r&&null==t.v&&(r=e.chainId),Io(r)&&(r=Go.from(r).toNumber()),"number"!=typeof r&&null!=t.v&&(r=(t.v-35)/2,r<0&&(r=0),r=parseInt(r)),"number"!=typeof r&&(r=0),t.chainId=r}return t.blockHash&&"x"===t.blockHash.replace(/0/g,"")&&(t.blockHash=null),t}transaction(e){return Df(e)}receiptLog(e){return Hl.check(this.formats.receiptLog,e)}receipt(e){const t=Hl.check(this.formats.receipt,e);if(null!=t.root)if(t.root.length<=4){const e=Go.from(t.root).toNumber();0===e||1===e?(null!=t.status&&t.status!==e&&ql.throwArgumentError("alt-root-status/status mismatch","value",{root:t.root,status:t.status}),t.status=e,delete t.root):ql.throwArgumentError("invalid alt-root-status","value.root",t.root)}else 66!==t.root.length&&ql.throwArgumentError("invalid root hash","value.root",t.root);return null!=t.status&&(t.byzantium=!0),t}topics(e){return Array.isArray(e)?e.map((e=>this.topics(e))):null!=e?this.hash(e,!0):null}filter(e){return Hl.check(this.formats.filter,e)}filterLog(e){return Hl.check(this.formats.filterLog,e)}static check(e,t){const r={};for(const n in e)try{const i=e[n](t[n]);void 0!==i&&(r[n]=i)}catch(e){throw e.checkKey=n,e.checkValue=t[n],e}return r}static allowNull(e,t){return function(r){return null==r?t:e(r)}}static allowFalsish(e,t){return function(r){return r?e(r):t}}static arrayOf(e){return function(t){if(!Array.isArray(t))throw new Error("not an array");const r=[];return t.forEach((function(t){r.push(e(t))})),r}}}var Kl=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))};const Jl=new bo(Ll);function Wl(e){return null==e?"null":(32!==Oo(e)&&Jl.throwArgumentError("invalid topic","topic",e),e.toLowerCase())}function Gl(e){for(e=e.slice();e.length>0&&null==e[e.length-1];)e.pop();return e.map((e=>{if(Array.isArray(e)){const t={};e.forEach((e=>{t[Wl(e)]=!0}));const r=Object.keys(t);return r.sort(),r.join("|")}return Wl(e)})).join("&")}function Vl(e){if("string"==typeof e){if(32===Oo(e=e.toLowerCase()))return"tx:"+e;if(-1===e.indexOf(":"))return e}else{if(Array.isArray(e))return"filter:*:"+Gl(e);if(Au.isForkEvent(e))throw Jl.warn("not implemented"),new Error("not implemented");if(e&&"object"==typeof e)return"filter:"+(e.address||"*")+":"+Gl(e.topics||[])}throw new Error("invalid event - "+e)}function Zl(){return(new Date).getTime()}function Xl(e){return new Promise((t=>{setTimeout(t,e)}))}const Ql=["block","network","pending","poll"];class Yl{constructor(e,t,r){pa(this,"tag",e),pa(this,"listener",t),pa(this,"once",r),this._lastBlockNumber=-2,this._inflight=!1}get event(){switch(this.type){case"tx":return this.hash;case"filter":return this.filter}return this.tag}get type(){return this.tag.split(":")[0]}get hash(){const e=this.tag.split(":");return"tx"!==e[0]?null:e[1]}get filter(){const e=this.tag.split(":");if("filter"!==e[0])return null;const t=e[1],r=""===(n=e[2])?[]:n.split(/&/g).map((e=>{if(""===e)return[];const t=e.split("|").map((e=>"null"===e?null:e));return 1===t.length?t[0]:t}));var n;const i={};return r.length>0&&(i.topics=r),t&&"*"!==t&&(i.address=t),i}pollable(){return this.tag.indexOf(":")>=0||Ql.indexOf(this.tag)>=0}}const eh={0:{symbol:"btc",p2pkh:0,p2sh:5,prefix:"bc"},2:{symbol:"ltc",p2pkh:48,p2sh:50,prefix:"ltc"},3:{symbol:"doge",p2pkh:30,p2sh:22},60:{symbol:"eth",ilk:"eth"},61:{symbol:"etc",ilk:"eth"},700:{symbol:"xdai",ilk:"eth"}};function th(e){return Bo(Go.from(e).toHexString(),32)}function rh(e){return td.encode(ko([e,To(ad(ad(e)),0,4)]))}const nh=new RegExp("^(ipfs)://(.*)$","i"),ih=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),nh,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function oh(e,t){try{return Ws(ah(e,t))}catch(e){}return null}function ah(e,t){if("0x"===e)return null;const r=Go.from(To(e,t,t+32)).toNumber(),n=Go.from(To(e,r,r+32)).toNumber();return To(e,r+32,r+32+n)}function sh(e){return e.match(/^ipfs:\/\/ipfs\//i)?e=e.substring(12):e.match(/^ipfs:\/\//i)?e=e.substring(7):Jl.throwArgumentError("unsupported IPFS format","link",e),`https://gateway.ipfs.io/ipfs/${e}`}function ch(e){const t=xo(e);if(t.length>32)throw new Error("internal; should not happen");const r=new Uint8Array(32);return r.set(t,32-t.length),r}function uh(e){if(e.length%32==0)return e;const t=new Uint8Array(32*Math.ceil(e.length/32));return t.set(e),t}function fh(e){const t=[];let r=0;for(let n=0;nGo.from(e).eq(1))).catch((e=>{if(e.code===bo.errors.CALL_EXCEPTION)return!1;throw this._supportsEip2544=null,e}))),this._supportsEip2544}_fetch(e,t){return Kl(this,void 0,void 0,(function*(){const r={to:this.address,ccipReadEnabled:!0,data:jo([e,qc(this.name),t||"0x"])};let n=!1;(yield this.supportsWildcard())&&(n=!0,r.data=jo(["0x9061b923",fh([Hc(this.name),r.data])]));try{let e=yield this.provider.call(r);return xo(e).length%32==4&&Jl.throwError("resolver threw error",bo.errors.CALL_EXCEPTION,{transaction:r,data:e}),n&&(e=ah(e,0)),e}catch(e){if(e.code===bo.errors.CALL_EXCEPTION)return null;throw e}}))}_fetchBytes(e,t){return Kl(this,void 0,void 0,(function*(){const r=yield this._fetch(e,t);return null!=r?ah(r,0):null}))}_getAddress(e,t){const r=eh[String(e)];if(null==r&&Jl.throwError(`unsupported coin type: ${e}`,bo.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`}),"eth"===r.ilk)return this.provider.formatter.address(t);const n=xo(t);if(null!=r.p2pkh){const e=t.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);if(e){const t=parseInt(e[1],16);if(e[2].length===2*t&&t>=1&&t<=75)return rh(ko([[r.p2pkh],"0x"+e[2]]))}}if(null!=r.p2sh){const e=t.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(e){const t=parseInt(e[1],16);if(e[2].length===2*t&&t>=1&&t<=75)return rh(ko([[r.p2sh],"0x"+e[2]]))}}if(null!=r.prefix){const e=n[1];let t=n[0];if(0===t?20!==e&&32!==e&&(t=-1):t=-1,t>=0&&n.length===2+e&&e>=1&&e<=75){const e=Ul.toWords(n.slice(2));return e.unshift(t),Ul.encode(r.prefix,e)}}return null}getAddress(e){return Kl(this,void 0,void 0,(function*(){if(null==e&&(e=60),60===e)try{const e=yield this._fetch("0x3b3b57de");return"0x"===e||e===Ds?null:this.provider.formatter.callAddress(e)}catch(e){if(e.code===bo.errors.CALL_EXCEPTION)return null;throw e}const t=yield this._fetchBytes("0xf1cb7e06",th(e));if(null==t||"0x"===t)return null;const r=this._getAddress(e,t);return null==r&&Jl.throwError("invalid or unsupported coin data",bo.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`,coinType:e,data:t}),r}))}getAvatar(){return Kl(this,void 0,void 0,(function*(){const e=[{type:"name",content:this.name}];try{const t=yield this.getText("avatar");if(null==t)return null;for(let r=0;re[t]))}return Jl.throwError("invalid or unsupported content hash data",bo.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:e})}))}getText(e){return Kl(this,void 0,void 0,(function*(){let t=Hs(e);t=ko([th(64),th(t.length),t]),t.length%32!=0&&(t=ko([t,Bo("0x",32-e.length%32)]));const r=yield this._fetchBytes("0x59d1d43c",No(t));return null==r||"0x"===r?null:Ws(r)}))}}let lh=null,hh=1;class ph extends _u{constructor(e){if(super(),this._events=[],this._emitted={block:-2},this.disableCcipRead=!1,this.formatter=new.target.getFormatter(),pa(this,"anyNetwork","any"===e),this.anyNetwork&&(e=this.detectNetwork()),e instanceof Promise)this._networkPromise=e,e.catch((e=>{})),this._ready().catch((e=>{}));else{const t=ma(new.target,"getNetwork")(e);t?(pa(this,"_network",t),this.emit("network",t,null)):Jl.throwArgumentError("invalid network","network",e)}this._maxInternalBlockNumber=-1024,this._lastBlockNumber=-2,this._maxFilterBlockRange=10,this._pollingInterval=4e3,this._fastQueryDate=0}_ready(){return Kl(this,void 0,void 0,(function*(){if(null==this._network){let e=null;if(this._networkPromise)try{e=yield this._networkPromise}catch(e){}null==e&&(e=yield this.detectNetwork()),e||Jl.throwError("no network detected",bo.errors.UNKNOWN_ERROR,{}),null==this._network&&(this.anyNetwork?this._network=e:pa(this,"_network",e),this.emit("network",e,null))}return this._network}))}get ready(){return Il((()=>this._ready().then((e=>e),(e=>{if(e.code!==bo.errors.NETWORK_ERROR||"noNetwork"!==e.event)throw e}))))}static getFormatter(){return null==lh&&(lh=new Hl),lh}static getNetwork(e){return function(e){if(null==e)return null;if("number"==typeof e){for(const t in Al){const r=Al[t];if(r.chainId===e)return{name:r.name,chainId:r.chainId,ensAddress:r.ensAddress||null,_defaultProvider:r._defaultProvider||null}}return{chainId:e,name:"unknown"}}if("string"==typeof e){const t=Al[e];return null==t?null:{name:t.name,chainId:t.chainId,ensAddress:t.ensAddress,_defaultProvider:t._defaultProvider||null}}const t=Al[e.name];if(!t)return"number"!=typeof e.chainId&&ml.throwArgumentError("invalid network chainId","network",e),e;0!==e.chainId&&e.chainId!==t.chainId&&ml.throwArgumentError("network chainId mismatch","network",e);let r=e._defaultProvider||null;var n;return null==r&&t._defaultProvider&&(r=(n=t._defaultProvider)&&"function"==typeof n.renetwork?t._defaultProvider.renetwork(e):t._defaultProvider),{name:e.name,chainId:t.chainId,ensAddress:e.ensAddress||t.ensAddress||null,_defaultProvider:r}}(null==e?"homestead":e)}ccipReadFetch(e,t,r){return Kl(this,void 0,void 0,(function*(){if(this.disableCcipRead||0===r.length)return null;const n=e.to.toLowerCase(),i=t.toLowerCase(),o=[];for(let e=0;e=0?null:JSON.stringify({data:i,sender:n}),c=yield Cl({url:a,errorPassThrough:!0},s,((e,t)=>(e.status=t.statusCode,e)));if(c.data)return c.data;const u=c.message||"unknown error";if(c.status>=400&&c.status<500)return Jl.throwError(`response not found during CCIP fetch: ${u}`,bo.errors.SERVER_ERROR,{url:t,errorMessage:u});o.push(u)}return Jl.throwError(`error encountered during CCIP fetch: ${o.map((e=>JSON.stringify(e))).join(", ")}`,bo.errors.SERVER_ERROR,{urls:r,errorMessages:o})}))}_getInternalBlockNumber(e){return Kl(this,void 0,void 0,(function*(){if(yield this._ready(),e>0)for(;this._internalBlockNumber;){const t=this._internalBlockNumber;try{const r=yield t;if(Zl()-r.respTime<=e)return r.blockNumber;break}catch(e){if(this._internalBlockNumber===t)break}}const t=Zl(),r=ga({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then((e=>null),(e=>e))}).then((({blockNumber:e,networkError:n})=>{if(n)throw this._internalBlockNumber===r&&(this._internalBlockNumber=null),n;const i=Zl();return(e=Go.from(e).toNumber()){this._internalBlockNumber===r&&(this._internalBlockNumber=null)})),(yield r).blockNumber}))}poll(){return Kl(this,void 0,void 0,(function*(){const e=hh++,t=[];let r=null;try{r=yield this._getInternalBlockNumber(100+this.pollingInterval/2)}catch(e){return void this.emit("error",e)}if(this._setFastBlockNumber(r),this.emit("poll",e,r),r!==this._lastBlockNumber){if(-2===this._emitted.block&&(this._emitted.block=r-1),Math.abs(this._emitted.block-r)>1e3)Jl.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${r})`),this.emit("error",Jl.makeError("network block skew detected",bo.errors.NETWORK_ERROR,{blockNumber:r,event:"blockSkew",previousBlockNumber:this._emitted.block})),this.emit("block",r);else for(let e=this._emitted.block+1;e<=r;e++)this.emit("block",e);this._emitted.block!==r&&(this._emitted.block=r,Object.keys(this._emitted).forEach((e=>{if("block"===e)return;const t=this._emitted[e];"pending"!==t&&r-t>12&&delete this._emitted[e]}))),-2===this._lastBlockNumber&&(this._lastBlockNumber=r-1),this._events.forEach((e=>{switch(e.type){case"tx":{const r=e.hash;let n=this.getTransactionReceipt(r).then((e=>e&&null!=e.blockNumber?(this._emitted["t:"+r]=e.blockNumber,this.emit(r,e),null):null)).catch((e=>{this.emit("error",e)}));t.push(n);break}case"filter":if(!e._inflight){e._inflight=!0,-2===e._lastBlockNumber&&(e._lastBlockNumber=r-1);const n=e.filter;n.fromBlock=e._lastBlockNumber+1,n.toBlock=r;const i=n.toBlock-this._maxFilterBlockRange;i>n.fromBlock&&(n.fromBlock=i),n.fromBlock<0&&(n.fromBlock=0);const o=this.getLogs(n).then((t=>{e._inflight=!1,0!==t.length&&t.forEach((t=>{t.blockNumber>e._lastBlockNumber&&(e._lastBlockNumber=t.blockNumber),this._emitted["b:"+t.blockHash]=t.blockNumber,this._emitted["t:"+t.transactionHash]=t.blockNumber,this.emit(n,t)}))})).catch((t=>{this.emit("error",t),e._inflight=!1}));t.push(o)}}})),this._lastBlockNumber=r,Promise.all(t).then((()=>{this.emit("didPoll",e)})).catch((e=>{this.emit("error",e)}))}else this.emit("didPoll",e)}))}resetEventsBlock(e){this._lastBlockNumber=e-1,this.polling&&this.poll()}get network(){return this._network}detectNetwork(){return Kl(this,void 0,void 0,(function*(){return Jl.throwError("provider does not support network detection",bo.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"})}))}getNetwork(){return Kl(this,void 0,void 0,(function*(){const e=yield this._ready(),t=yield this.detectNetwork();if(e.chainId!==t.chainId){if(this.anyNetwork)return this._network=t,this._lastBlockNumber=-2,this._fastBlockNumber=null,this._fastBlockNumberPromise=null,this._fastQueryDate=0,this._emitted.block=-2,this._maxInternalBlockNumber=-1024,this._internalBlockNumber=null,this.emit("network",t,e),yield Xl(0),this._network;const r=Jl.makeError("underlying network changed",bo.errors.NETWORK_ERROR,{event:"changed",network:e,detectedNetwork:t});throw this.emit("error",r),r}return e}))}get blockNumber(){return this._getInternalBlockNumber(100+this.pollingInterval/2).then((e=>{this._setFastBlockNumber(e)}),(e=>{})),null!=this._fastBlockNumber?this._fastBlockNumber:-1}get polling(){return null!=this._poller}set polling(e){e&&!this._poller?(this._poller=setInterval((()=>{this.poll()}),this.pollingInterval),this._bootstrapPoll||(this._bootstrapPoll=setTimeout((()=>{this.poll(),this._bootstrapPoll=setTimeout((()=>{this._poller||this.poll(),this._bootstrapPoll=null}),this.pollingInterval)}),0))):!e&&this._poller&&(clearInterval(this._poller),this._poller=null)}get pollingInterval(){return this._pollingInterval}set pollingInterval(e){if("number"!=typeof e||e<=0||parseInt(String(e))!=e)throw new Error("invalid polling interval");this._pollingInterval=e,this._poller&&(clearInterval(this._poller),this._poller=setInterval((()=>{this.poll()}),this._pollingInterval))}_getFastBlockNumber(){const e=Zl();return e-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=e,this._fastBlockNumberPromise=this.getBlockNumber().then((e=>((null==this._fastBlockNumber||e>this._fastBlockNumber)&&(this._fastBlockNumber=e),this._fastBlockNumber)))),this._fastBlockNumberPromise}_setFastBlockNumber(e){null!=this._fastBlockNumber&&ethis._fastBlockNumber)&&(this._fastBlockNumber=e,this._fastBlockNumberPromise=Promise.resolve(e)))}waitForTransaction(e,t,r){return Kl(this,void 0,void 0,(function*(){return this._waitForTransaction(e,null==t?1:t,r||0,null)}))}_waitForTransaction(e,t,r,n){return Kl(this,void 0,void 0,(function*(){const i=yield this.getTransactionReceipt(e);return(i?i.confirmations:0)>=t?i:new Promise(((i,o)=>{const a=[];let s=!1;const c=function(){return!!s||(s=!0,a.forEach((e=>{e()})),!1)},u=e=>{e.confirmations{this.removeListener(e,u)})),n){let r=n.startBlock,i=null;const u=a=>Kl(this,void 0,void 0,(function*(){s||(yield Xl(1e3),this.getTransactionCount(n.from).then((f=>Kl(this,void 0,void 0,(function*(){if(!s){if(f<=n.nonce)r=a;else{{const t=yield this.getTransaction(e);if(t&&null!=t.blockNumber)return}for(null==i&&(i=r-3,i{s||this.once("block",u)})))}));if(s)return;this.once("block",u),a.push((()=>{this.removeListener("block",u)}))}if("number"==typeof r&&r>0){const e=setTimeout((()=>{c()||o(Jl.makeError("timeout exceeded",bo.errors.TIMEOUT,{timeout:r}))}),r);e.unref&&e.unref(),a.push((()=>{clearTimeout(e)}))}}))}))}getBlockNumber(){return Kl(this,void 0,void 0,(function*(){return this._getInternalBlockNumber(0)}))}getGasPrice(){return Kl(this,void 0,void 0,(function*(){yield this.getNetwork();const e=yield this.perform("getGasPrice",{});try{return Go.from(e)}catch(t){return Jl.throwError("bad result from backend",bo.errors.SERVER_ERROR,{method:"getGasPrice",result:e,error:t})}}))}getBalance(e,t){return Kl(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield ga({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),n=yield this.perform("getBalance",r);try{return Go.from(n)}catch(e){return Jl.throwError("bad result from backend",bo.errors.SERVER_ERROR,{method:"getBalance",params:r,result:n,error:e})}}))}getTransactionCount(e,t){return Kl(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield ga({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),n=yield this.perform("getTransactionCount",r);try{return Go.from(n).toNumber()}catch(e){return Jl.throwError("bad result from backend",bo.errors.SERVER_ERROR,{method:"getTransactionCount",params:r,result:n,error:e})}}))}getCode(e,t){return Kl(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield ga({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),n=yield this.perform("getCode",r);try{return No(n)}catch(e){return Jl.throwError("bad result from backend",bo.errors.SERVER_ERROR,{method:"getCode",params:r,result:n,error:e})}}))}getStorageAt(e,t,r){return Kl(this,void 0,void 0,(function*(){yield this.getNetwork();const n=yield ga({address:this._getAddress(e),blockTag:this._getBlockTag(r),position:Promise.resolve(t).then((e=>Do(e)))}),i=yield this.perform("getStorageAt",n);try{return No(i)}catch(e){return Jl.throwError("bad result from backend",bo.errors.SERVER_ERROR,{method:"getStorageAt",params:n,result:i,error:e})}}))}_wrapTransaction(e,t,r){if(null!=t&&32!==Oo(t))throw new Error("invalid response - sendTransaction");const n=e;return null!=t&&e.hash!==t&&Jl.throwError("Transaction hash mismatch from Provider.sendTransaction.",bo.errors.UNKNOWN_ERROR,{expectedHash:e.hash,returnedHash:t}),n.wait=(t,n)=>Kl(this,void 0,void 0,(function*(){let i;null==t&&(t=1),null==n&&(n=0),0!==t&&null!=r&&(i={data:e.data,from:e.from,nonce:e.nonce,to:e.to,value:e.value,startBlock:r});const o=yield this._waitForTransaction(e.hash,t,n,i);return null==o&&0===t?null:(this._emitted["t:"+e.hash]=o.blockNumber,0===o.status&&Jl.throwError("transaction failed",bo.errors.CALL_EXCEPTION,{transactionHash:e.hash,transaction:e,receipt:o}),o)})),n}sendTransaction(e){return Kl(this,void 0,void 0,(function*(){yield this.getNetwork();const t=yield Promise.resolve(e).then((e=>No(e))),r=this.formatter.transaction(e);null==r.confirmations&&(r.confirmations=0);const n=yield this._getInternalBlockNumber(100+2*this.pollingInterval);try{const e=yield this.perform("sendTransaction",{signedTransaction:t});return this._wrapTransaction(r,e,n)}catch(e){throw e.transaction=r,e.transactionHash=r.hash,e}}))}_getTransactionRequest(e){return Kl(this,void 0,void 0,(function*(){const t=yield e,r={};return["from","to"].forEach((e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then((e=>e?this._getAddress(e):null)))})),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach((e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then((e=>e?Go.from(e):null)))})),["type"].forEach((e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then((e=>null!=e?e:null)))})),t.accessList&&(r.accessList=this.formatter.accessList(t.accessList)),["data"].forEach((e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then((e=>e?No(e):null)))})),this.formatter.transactionRequest(yield ga(r))}))}_getFilter(e){return Kl(this,void 0,void 0,(function*(){e=yield e;const t={};return null!=e.address&&(t.address=this._getAddress(e.address)),["blockHash","topics"].forEach((r=>{null!=e[r]&&(t[r]=e[r])})),["fromBlock","toBlock"].forEach((r=>{null!=e[r]&&(t[r]=this._getBlockTag(e[r]))})),this.formatter.filter(yield ga(t))}))}_call(e,t,r){return Kl(this,void 0,void 0,(function*(){r>=10&&Jl.throwError("CCIP read exceeded maximum redirections",bo.errors.SERVER_ERROR,{redirects:r,transaction:e});const n=e.to,i=yield this.perform("call",{transaction:e,blockTag:t});if(r>=0&&"latest"===t&&null!=n&&"0x556f1830"===i.substring(0,10)&&Oo(i)%32==4)try{const o=To(i,4),a=To(o,0,32);Go.from(a).eq(n)||Jl.throwError("CCIP Read sender did not match",bo.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:i});const s=[],c=Go.from(To(o,32,64)).toNumber(),u=Go.from(To(o,c,c+32)).toNumber(),f=To(o,c+32);for(let t=0;tKl(this,void 0,void 0,(function*(){const e=yield this.perform("getBlock",n);if(null==e)return null!=n.blockHash&&null==this._emitted["b:"+n.blockHash]||null!=n.blockTag&&r>this._emitted.block?null:void 0;if(t){let t=null;for(let r=0;rthis._wrapTransaction(e))),r}return this.formatter.block(e)}))),{oncePoll:this})}))}getBlock(e){return this._getBlock(e,!1)}getBlockWithTransactions(e){return this._getBlock(e,!0)}getTransaction(e){return Kl(this,void 0,void 0,(function*(){yield this.getNetwork(),e=yield e;const t={transactionHash:this.formatter.hash(e,!0)};return Il((()=>Kl(this,void 0,void 0,(function*(){const r=yield this.perform("getTransaction",t);if(null==r)return null==this._emitted["t:"+e]?null:void 0;const n=this.formatter.transactionResponse(r);if(null==n.blockNumber)n.confirmations=0;else if(null==n.confirmations){let e=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-n.blockNumber+1;e<=0&&(e=1),n.confirmations=e}return this._wrapTransaction(n)}))),{oncePoll:this})}))}getTransactionReceipt(e){return Kl(this,void 0,void 0,(function*(){yield this.getNetwork(),e=yield e;const t={transactionHash:this.formatter.hash(e,!0)};return Il((()=>Kl(this,void 0,void 0,(function*(){const r=yield this.perform("getTransactionReceipt",t);if(null==r)return null==this._emitted["t:"+e]?null:void 0;if(null==r.blockHash)return;const n=this.formatter.receipt(r);if(null==n.blockNumber)n.confirmations=0;else if(null==n.confirmations){let e=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-n.blockNumber+1;e<=0&&(e=1),n.confirmations=e}return n}))),{oncePoll:this})}))}getLogs(e){return Kl(this,void 0,void 0,(function*(){yield this.getNetwork();const t=yield ga({filter:this._getFilter(e)}),r=yield this.perform("getLogs",t);return r.forEach((e=>{null==e.removed&&(e.removed=!1)})),Hl.arrayOf(this.formatter.filterLog.bind(this.formatter))(r)}))}getEtherPrice(){return Kl(this,void 0,void 0,(function*(){return yield this.getNetwork(),this.perform("getEtherPrice",{})}))}_getBlockTag(e){return Kl(this,void 0,void 0,(function*(){if("number"==typeof(e=yield e)&&e<0){e%1&&Jl.throwArgumentError("invalid BlockTag","blockTag",e);let t=yield this._getInternalBlockNumber(100+2*this.pollingInterval);return t+=e,t<0&&(t=0),this.formatter.blockTag(t)}return this.formatter.blockTag(e)}))}getResolver(e){return Kl(this,void 0,void 0,(function*(){let t=e;for(;;){if(""===t||"."===t)return null;if("eth"!==e&&"eth"===t)return null;const r=yield this._getResolver(t,"getResolver");if(null!=r){const n=new dh(this,r,e);return t===e||(yield n.supportsWildcard())?n:null}t=t.split(".").slice(1).join(".")}}))}_getResolver(e,t){return Kl(this,void 0,void 0,(function*(){null==t&&(t="ENS");const r=yield this.getNetwork();r.ensAddress||Jl.throwError("network does not support ENS",bo.errors.UNSUPPORTED_OPERATION,{operation:t,network:r.name});try{const t=yield this.call({to:r.ensAddress,data:"0x0178b8bf"+qc(e).substring(2)});return this.formatter.callAddress(t)}catch(e){}return null}))}resolveName(e){return Kl(this,void 0,void 0,(function*(){e=yield e;try{return Promise.resolve(this.formatter.address(e))}catch(t){if(Io(e))throw t}"string"!=typeof e&&Jl.throwArgumentError("invalid ENS name","name",e);const t=yield this.getResolver(e);return t?yield t.getAddress():null}))}lookupAddress(e){return Kl(this,void 0,void 0,(function*(){e=yield e;const t=(e=this.formatter.address(e)).substring(2).toLowerCase()+".addr.reverse",r=yield this._getResolver(t,"lookupAddress");if(null==r)return null;const n=oh(yield this.call({to:r,data:"0x691f3431"+qc(t).substring(2)}),0);return(yield this.resolveName(n))!=e?null:n}))}getAvatar(e){return Kl(this,void 0,void 0,(function*(){let t=null;if(Io(e)){const r=this.formatter.address(e).substring(2).toLowerCase()+".addr.reverse",n=yield this._getResolver(r,"getAvatar");if(!n)return null;t=new dh(this,n,r);try{const e=yield t.getAvatar();if(e)return e.url}catch(e){if(e.code!==bo.errors.CALL_EXCEPTION)throw e}try{const e=oh(yield this.call({to:n,data:"0x691f3431"+qc(r).substring(2)}),0);t=yield this.getResolver(e)}catch(e){if(e.code!==bo.errors.CALL_EXCEPTION)throw e;return null}}else if(t=yield this.getResolver(e),!t)return null;const r=yield t.getAvatar();return null==r?null:r.url}))}perform(e,t){return Jl.throwError(e+" not implemented",bo.errors.NOT_IMPLEMENTED,{operation:e})}_startEvent(e){this.polling=this._events.filter((e=>e.pollable())).length>0}_stopEvent(e){this.polling=this._events.filter((e=>e.pollable())).length>0}_addEventListener(e,t,r){const n=new Yl(Vl(e),t,r);return this._events.push(n),this._startEvent(n),this}on(e,t){return this._addEventListener(e,t,!1)}once(e,t){return this._addEventListener(e,t,!0)}emit(e,...t){let r=!1,n=[],i=Vl(e);return this._events=this._events.filter((e=>e.tag!==i||(setTimeout((()=>{e.listener.apply(this,t)}),0),r=!0,!e.once||(n.push(e),!1)))),n.forEach((e=>{this._stopEvent(e)})),r}listenerCount(e){if(!e)return this._events.length;let t=Vl(e);return this._events.filter((e=>e.tag===t)).length}listeners(e){if(null==e)return this._events.map((e=>e.listener));let t=Vl(e);return this._events.filter((e=>e.tag===t)).map((e=>e.listener))}off(e,t){if(null==t)return this.removeAllListeners(e);const r=[];let n=!1,i=Vl(e);return this._events=this._events.filter((e=>e.tag!==i||e.listener!=t||(!!n||(n=!0,r.push(e),!1)))),r.forEach((e=>{this._stopEvent(e)})),this}removeAllListeners(e){let t=[];if(null==e)t=this._events,this._events=[];else{const r=Vl(e);this._events=this._events.filter((e=>e.tag!==r||(t.push(e),!1)))}return t.forEach((e=>{this._stopEvent(e)})),this}}var mh=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))};const gh=new bo(Ll),yh=["call","estimateGas"];function bh(e,t){if(null==e)return null;if("string"==typeof e.message&&e.message.match("reverted")){const r=Io(e.data)?e.data:null;if(!t||r)return{message:e.message,data:r}}if("object"==typeof e){for(const r in e){const n=bh(e[r],t);if(n)return n}return null}if("string"==typeof e)try{return bh(JSON.parse(e),t)}catch(e){}return null}function vh(e,t,r){const n=r.transaction||r.signedTransaction;if("call"===e){const e=bh(t,!0);if(e)return e.data;gh.throwError("missing revert data in call exception; Transaction reverted without a reason string",bo.errors.CALL_EXCEPTION,{data:"0x",transaction:n,error:t})}if("estimateGas"===e){let r=bh(t.body,!1);null==r&&(r=bh(t,!1)),r&&gh.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",bo.errors.UNPREDICTABLE_GAS_LIMIT,{reason:r.message,method:e,transaction:n,error:t})}let i=t.message;throw t.code===bo.errors.SERVER_ERROR&&t.error&&"string"==typeof t.error.message?i=t.error.message:"string"==typeof t.body?i=t.body:"string"==typeof t.responseText&&(i=t.responseText),i=(i||"").toLowerCase(),i.match(/insufficient funds|base fee exceeds gas limit|InsufficientFunds/i)&&gh.throwError("insufficient funds for intrinsic transaction cost",bo.errors.INSUFFICIENT_FUNDS,{error:t,method:e,transaction:n}),i.match(/nonce (is )?too low/i)&&gh.throwError("nonce has already been used",bo.errors.NONCE_EXPIRED,{error:t,method:e,transaction:n}),i.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&gh.throwError("replacement fee too low",bo.errors.REPLACEMENT_UNDERPRICED,{error:t,method:e,transaction:n}),i.match(/only replay-protected/i)&&gh.throwError("legacy pre-eip-155 transactions not supported",bo.errors.UNSUPPORTED_OPERATION,{error:t,method:e,transaction:n}),yh.indexOf(e)>=0&&i.match(/gas required exceeds allowance|always failing transaction|execution reverted|revert/)&&gh.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",bo.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,method:e,transaction:n}),t}function wh(e){return new Promise((function(t){setTimeout(t,e)}))}function Ah(e){if(e.error){const t=new Error(e.error.message);throw t.code=e.error.code,t.data=e.error.data,t}return e.result}function _h(e){return e?e.toLowerCase():e}const Eh={};class Sh extends ku{constructor(e,t,r){if(super(),e!==Eh)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");pa(this,"provider",t),null==r&&(r=0),"string"==typeof r?(pa(this,"_address",this.provider.formatter.address(r)),pa(this,"_index",null)):"number"==typeof r?(pa(this,"_index",r),pa(this,"_address",null)):gh.throwArgumentError("invalid address or index","addressOrIndex",r)}connect(e){return gh.throwError("cannot alter JSON-RPC Signer connection",bo.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}connectUnchecked(){return new Ph(Eh,this.provider,this._address||this._index)}getAddress(){return this._address?Promise.resolve(this._address):this.provider.send("eth_accounts",[]).then((e=>(e.length<=this._index&&gh.throwError("unknown account #"+this._index,bo.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),this.provider.formatter.address(e[this._index]))))}sendUncheckedTransaction(e){e=ba(e);const t=this.getAddress().then((e=>(e&&(e=e.toLowerCase()),e)));if(null==e.gasLimit){const r=ba(e);r.from=t,e.gasLimit=this.provider.estimateGas(r)}return null!=e.to&&(e.to=Promise.resolve(e.to).then((e=>mh(this,void 0,void 0,(function*(){if(null==e)return null;const t=yield this.provider.resolveName(e);return null==t&&gh.throwArgumentError("provided ENS name resolves to null","tx.to",e),t}))))),ga({tx:ga(e),sender:t}).then((({tx:t,sender:r})=>{null!=t.from?t.from.toLowerCase()!==r&&gh.throwArgumentError("from address mismatch","transaction",e):t.from=r;const n=this.provider.constructor.hexlifyTransaction(t,{from:!0});return this.provider.send("eth_sendTransaction",[n]).then((e=>e),(e=>("string"==typeof e.message&&e.message.match(/user denied/i)&&gh.throwError("user rejected transaction",bo.errors.ACTION_REJECTED,{action:"sendTransaction",transaction:t}),vh("sendTransaction",e,n))))}))}signTransaction(e){return gh.throwError("signing transactions is unsupported",bo.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}sendTransaction(e){return mh(this,void 0,void 0,(function*(){const t=yield this.provider._getInternalBlockNumber(100+2*this.provider.pollingInterval),r=yield this.sendUncheckedTransaction(e);try{return yield Il((()=>mh(this,void 0,void 0,(function*(){const e=yield this.provider.getTransaction(r);if(null!==e)return this.provider._wrapTransaction(e,r,t)}))),{oncePoll:this.provider})}catch(e){throw e.transactionHash=r,e}}))}signMessage(e){return mh(this,void 0,void 0,(function*(){const t="string"==typeof e?Hs(e):e,r=yield this.getAddress();try{return yield this.provider.send("personal_sign",[No(t),r.toLowerCase()])}catch(t){throw"string"==typeof t.message&&t.message.match(/user denied/i)&&gh.throwError("user rejected signing",bo.errors.ACTION_REJECTED,{action:"signMessage",from:r,messageData:e}),t}}))}_legacySignMessage(e){return mh(this,void 0,void 0,(function*(){const t="string"==typeof e?Hs(e):e,r=yield this.getAddress();try{return yield this.provider.send("eth_sign",[r.toLowerCase(),No(t)])}catch(t){throw"string"==typeof t.message&&t.message.match(/user denied/i)&&gh.throwError("user rejected signing",bo.errors.ACTION_REJECTED,{action:"_legacySignMessage",from:r,messageData:e}),t}}))}_signTypedData(e,t,r){return mh(this,void 0,void 0,(function*(){const n=yield cu.resolveNames(e,t,r,(e=>this.provider.resolveName(e))),i=yield this.getAddress();try{return yield this.provider.send("eth_signTypedData_v4",[i.toLowerCase(),JSON.stringify(cu.getPayload(n.domain,t,n.value))])}catch(e){throw"string"==typeof e.message&&e.message.match(/user denied/i)&&gh.throwError("user rejected signing",bo.errors.ACTION_REJECTED,{action:"_signTypedData",from:i,messageData:{domain:n.domain,types:t,value:n.value}}),e}}))}unlock(e){return mh(this,void 0,void 0,(function*(){const t=this.provider,r=yield this.getAddress();return t.send("personal_unlockAccount",[r.toLowerCase(),e,null])}))}}class Ph extends Sh{sendTransaction(e){return this.sendUncheckedTransaction(e).then((e=>({hash:e,nonce:null,gasLimit:null,gasPrice:null,data:null,value:null,chainId:null,confirmations:0,from:null,wait:t=>this.provider.waitForTransaction(e,t)})))}}const xh={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0};class kh extends ph{constructor(e,t){let r=t;null==r&&(r=new Promise(((e,t)=>{setTimeout((()=>{this.detectNetwork().then((t=>{e(t)}),(e=>{t(e)}))}),0)}))),super(r),e||(e=ma(this.constructor,"defaultUrl")()),pa(this,"connection","string"==typeof e?Object.freeze({url:e}):Object.freeze(ba(e))),this._nextId=42}get _cache(){return null==this._eventLoopCache&&(this._eventLoopCache={}),this._eventLoopCache}static defaultUrl(){return"http://localhost:8545"}detectNetwork(){return this._cache.detectNetwork||(this._cache.detectNetwork=this._uncachedDetectNetwork(),setTimeout((()=>{this._cache.detectNetwork=null}),0)),this._cache.detectNetwork}_uncachedDetectNetwork(){return mh(this,void 0,void 0,(function*(){yield wh(0);let e=null;try{e=yield this.send("eth_chainId",[])}catch(t){try{e=yield this.send("net_version",[])}catch(e){}}if(null!=e){const t=ma(this.constructor,"getNetwork");try{return t(Go.from(e).toNumber())}catch(t){return gh.throwError("could not detect network",bo.errors.NETWORK_ERROR,{chainId:e,event:"invalidNetwork",serverError:t})}}return gh.throwError("could not detect network",bo.errors.NETWORK_ERROR,{event:"noNetwork"})}))}getSigner(e){return new Sh(Eh,this,e)}getUncheckedSigner(e){return this.getSigner(e).connectUnchecked()}listAccounts(){return this.send("eth_accounts",[]).then((e=>e.map((e=>this.formatter.address(e)))))}send(e,t){const r={method:e,params:t,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:_a(r),provider:this});const n=["eth_chainId","eth_blockNumber"].indexOf(e)>=0;if(n&&this._cache[e])return this._cache[e];const i=Cl(this.connection,JSON.stringify(r),Ah).then((e=>(this.emit("debug",{action:"response",request:r,response:e,provider:this}),e)),(e=>{throw this.emit("debug",{action:"response",error:e,request:r,provider:this}),e}));return n&&(this._cache[e]=i,setTimeout((()=>{this._cache[e]=null}),0)),i}prepareRequest(e,t){switch(e){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[_h(t.address),t.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[_h(t.address),t.blockTag]];case"getCode":return["eth_getCode",[_h(t.address),t.blockTag]];case"getStorageAt":return["eth_getStorageAt",[_h(t.address),Bo(t.position,32),t.blockTag]];case"sendTransaction":return["eth_sendRawTransaction",[t.signedTransaction]];case"getBlock":return t.blockTag?["eth_getBlockByNumber",[t.blockTag,!!t.includeTransactions]]:t.blockHash?["eth_getBlockByHash",[t.blockHash,!!t.includeTransactions]]:null;case"getTransaction":return["eth_getTransactionByHash",[t.transactionHash]];case"getTransactionReceipt":return["eth_getTransactionReceipt",[t.transactionHash]];case"call":return["eth_call",[ma(this.constructor,"hexlifyTransaction")(t.transaction,{from:!0}),t.blockTag]];case"estimateGas":return["eth_estimateGas",[ma(this.constructor,"hexlifyTransaction")(t.transaction,{from:!0})]];case"getLogs":return t.filter&&null!=t.filter.address&&(t.filter.address=_h(t.filter.address)),["eth_getLogs",[t.filter]]}return null}perform(e,t){return mh(this,void 0,void 0,(function*(){if("call"===e||"estimateGas"===e){const e=t.transaction;if(e&&null!=e.type&&Go.from(e.type).isZero()&&null==e.maxFeePerGas&&null==e.maxPriorityFeePerGas){const r=yield this.getFeeData();null==r.maxFeePerGas&&null==r.maxPriorityFeePerGas&&((t=ba(t)).transaction=ba(e),delete t.transaction.type)}}const r=this.prepareRequest(e,t);null==r&&gh.throwError(e+" not implemented",bo.errors.NOT_IMPLEMENTED,{operation:e});try{return yield this.send(r[0],r[1])}catch(r){return vh(e,r,t)}}))}_startEvent(e){"pending"===e.tag&&this._startPending(),super._startEvent(e)}_startPending(){if(null!=this._pendingFilter)return;const e=this,t=this.send("eth_newPendingTransactionFilter",[]);this._pendingFilter=t,t.then((function(r){return function n(){e.send("eth_getFilterChanges",[r]).then((function(r){if(e._pendingFilter!=t)return null;let n=Promise.resolve();return r.forEach((function(t){e._emitted["t:"+t.toLowerCase()]="pending",n=n.then((function(){return e.getTransaction(t).then((function(t){return e.emit("pending",t),null}))}))})),n.then((function(){return wh(1e3)}))})).then((function(){if(e._pendingFilter==t)return setTimeout((function(){n()}),0),null;e.send("eth_uninstallFilter",[r])})).catch((e=>{}))}(),r})).catch((e=>{}))}_stopEvent(e){"pending"===e.tag&&0===this.listenerCount("pending")&&(this._pendingFilter=null),super._stopEvent(e)}static hexlifyTransaction(e,t){const r=ba(xh);if(t)for(const e in t)t[e]&&(r[e]=!0);ya(e,r);const n={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach((function(t){if(null==e[t])return;const r=Do(Go.from(e[t]));"gasLimit"===t&&(t="gas"),n[t]=r})),["from","to","data"].forEach((function(t){null!=e[t]&&(n[t]=No(e[t]))})),e.accessList&&(n.accessList=If(e.accessList)),n}}const Mh=new RegExp("^bytes([0-9]+)$"),Ch=new RegExp("^(u?int)([0-9]*)$"),Ih=new RegExp("^(.*)\\[([0-9]*)\\]$"),Rh="0000000000000000000000000000000000000000000000000000000000000000",Nh=new bo("solidity/5.7.0");function Oh(e,t,r){switch(e){case"address":return r?Co(t,32):xo(t);case"string":return Hs(t);case"bytes":return xo(t);case"bool":return t=t?"0x01":"0x00",r?Co(t,32):xo(t)}let n=e.match(Ch);if(n){let i=parseInt(n[2]||"256");return(n[2]&&String(i)!==n[2]||i%8!=0||0===i||i>256)&&Nh.throwArgumentError("invalid number type","type",e),r&&(i=256),Co(t=Go.from(t).toTwos(i),i/8)}if(n=e.match(Mh),n){const i=parseInt(n[1]);return(String(i)!==n[1]||0===i||i>32)&&Nh.throwArgumentError("invalid bytes type","type",e),xo(t).byteLength!==i&&Nh.throwArgumentError(`invalid value for ${e}`,"value",t),r?xo((t+Rh).substring(0,66)):t}if(n=e.match(Ih),n&&Array.isArray(t)){const r=n[1];parseInt(n[2]||String(t.length))!=t.length&&Nh.throwArgumentError(`invalid array length for ${e}`,"value",t);const i=[];return t.forEach((function(e){i.push(Oh(r,e,!0))})),ko(i)}return Nh.throwArgumentError("invalid type","type",e)}function Th(e,t){e.length!=t.length&&Nh.throwArgumentError("wrong number of values; expected ${ types.length }","values",t);const r=[];return e.forEach((function(e,n){r.push(Oh(e,t[n]))})),No(ko(r))}var jh=Object.freeze({__proto__:null,keccak256:function(e,t){return rs(Th(e,t))},pack:Th,sha256:function(e,t){return ad(Th(e,t))}});const Dh=new bo("units/5.7.0"),$h=["wei","kwei","mwei","gwei","szabo","finney","ether"];function Bh(e,t){if("string"==typeof t){const e=$h.indexOf(t);-1!==e&&(t=3*e)}return aa(e,null!=t?t:18)}function Fh(e,t){if("string"!=typeof e&&Dh.throwArgumentError("value must be a string","value",e),"string"==typeof t){const e=$h.indexOf(t);-1!==e&&(t=3*e)}return sa(e,null!=t?t:18)}var zh=Object.freeze({__proto__:null,commify:function(e){const t=String(e).split(".");(t.length>2||!t[0].match(/^-?[0-9]*$/)||t[1]&&!t[1].match(/^[0-9]*$/)||"."===e||"-."===e)&&Dh.throwArgumentError("invalid value","value",e);let r=t[0],n="";for("-"===r.substring(0,1)&&(n="-",r=r.substring(1));"0"===r.substring(0,1);)r=r.substring(1);""===r&&(r="0");let i="";for(2===t.length&&(i="."+(t[1]||"0"));i.length>2&&"0"===i[i.length-1];)i=i.substring(0,i.length-1);const o=[];for(;r.length;){if(r.length<=3){o.unshift(r);break}{const e=r.length-3;o.unshift(r.substring(e)),r=r.substring(0,e)}}return n+o.join(",")+i},formatEther:function(e){return Bh(e,18)},formatUnits:Bh,parseEther:function(e){return Fh(e,18)},parseUnits:Fh});function Uh(e){if(null==e.match(/^(0x)?([\da-fA-F]{40})$/))throw new RangeError("incorrect address format");try{return bs(no(e,!0,20))}catch(e){throw new nn(e,["invalid EIP-55 address"])}}async function Lh(e){return t(await oo(eo(e),"SHA-256"),!0,!1)}async function qh(e,t){if(void 0===e.iss)throw new Error('Payload iss should be set to either "orig" or "dest"');const r=JSON.parse(e.exchange[e.iss]);await Xi(r,t);const n=await Ki(t),i=t.alg,o={...e,iat:Math.floor(Date.now()/1e3)};return{jws:await new Li(o).setProtectedHeader({alg:i}).setIssuedAt(o.iat).sign(n),payload:o}}async function Hh(e,t,r){const n=JSON.parse(t.exchange[t.iss]),i=await Gi(e,n);if(void 0===i.payload.iss)throw new Error('Property "iss" missing');if(void 0===i.payload.iat)throw new Error("Property claim iat missing");if(void 0!==r){to("iat"===r.timestamp?1e3*i.payload.iat:r.timestamp,"iat"===r.notBefore?1e3*i.payload.iat:r.notBefore,"iat"===r.notAfter?1e3*i.payload.iat:r.notAfter,r.tolerance)}const o=i.payload,a=o.exchange[o.iss];if(eo(n)!==eo(JSON.parse(a)))throw new Error(`The proof is issued by ${a} instead of ${JSON.stringify(n)}`);const s=t;for(const e in s){if(void 0===o[e])throw new Error(`Expected key '${e}' not found in proof`);if("exchange"===e){const e=t.exchange;Kh(o.exchange,e)}else if(""!==s[e]&&eo(s[e])!==eo(o[e]))throw new Error(`Proof's ${e}: ${JSON.stringify(o[e],void 0,2)} does not meet provided value ${JSON.stringify(s[e],void 0,2)}`)}return i}function Kh(e,t){const r=["id","orig","dest","hashAlg","cipherblockDgst","blockCommitment","blockCommitment","secretCommitment","schema"];for(const t of r)if("schema"!==t&&(void 0===e[t]||""===e[t]))throw new Error(`${t} is missing on dataExchange.\ndataExchange: ${JSON.stringify(e,void 0,2)}`);for(const r in t)if(""!==t[r]&&eo(t[r])!==eo(e[r]))throw new Error(`dataExchange's ${r}: ${JSON.stringify(e[r],void 0,2)} does not meet expected value ${JSON.stringify(t[r],void 0,2)}`)}async function Jh(e,t,r=10){const{payload:n}=await Gi(e),i=n.exchange,o={...i};delete o.id;if(await Lh(o)!==i.id)throw new nn(new Error("data exchange integrity failed"),["dataExchange integrity violated"]);const a=JSON.parse(i.dest),s=JSON.parse(i.orig);let c,u,f;try{c=(await Hh(n.poo,{iss:"orig",proofType:"PoO",exchange:i})).payload}catch(e){throw new nn(e,["invalid poo"])}try{await Hh(e,{iss:"dest",proofType:"PoR",exchange:i},{timestamp:"iat",notBefore:1e3*c.iat,notAfter:1e3*c.iat+i.pooToPorDelay})}catch(e){throw new nn(e,["invalid por"])}try{const e=await t.getSecretFromLedger(Vi(i.encAlg),i.ledgerSignerAddress,i.id,r);u=e.hex,f=e.iat}catch(e){throw new nn(e,["cannot verify"])}try{to(1e3*f,1e3*n.iat,1e3*c.iat+i.pooToSecretDelay)}catch(e){throw new nn(`Although the secret has been obtained (and you could try to decrypt the cipherblock), it's been published later than agreed: ${new Date(1e3*f).toUTCString()} > ${new Date(1e3*c.iat+i.pooToSecretDelay).toUTCString()}`,["secret not published in time"])}return{pooPayload:c,porPayload:n,secretHex:u,destPublicJwk:a,origPublicJwk:s}}async function Wh(e,t,r=10){let n,i,o,a,s;try{n=(await Gi(e)).payload}catch(e){throw new nn(e,["invalid verification request"])}try{const e=await Jh(n.por,t,r);i=e.destPublicJwk,o=e.origPublicJwk,a=e.pooPayload,s=e.porPayload}catch(e){throw new nn(e,["invalid por","invalid verification request"])}try{await Gi(e,"dest"===n.iss?i:o)}catch(e){throw new nn(e,["invalid verification request"])}return{pooPayload:a,porPayload:s,vrPayload:n,destPublicJwk:i,origPublicJwk:o}}async function Gh(e,r){const{payload:n}=await Gi(e),{destPublicJwk:i,origPublicJwk:o,secretHex:a,pooPayload:s,porPayload:c}=await Jh(n.por,r);try{await Gi(e,i)}catch(e){throw e instanceof nn&&e.add("invalid dispute request"),e}if(t(await oo(n.cipherblock,c.exchange.hashAlg),!0,!1)!==c.exchange.cipherblockDgst)throw new nn(new Error("cipherblock does not meet the committed (and already accepted) one"),["invalid dispute request"]);return await Wi(n.cipherblock,(await Zi(c.exchange.encAlg,a)).jwk),{pooPayload:s,porPayload:c,drPayload:n,destPublicJwk:i,origPublicJwk:o}}async function Vh(e,t,r,n){const i={proofType:"request",iss:e,dataExchangeId:t,por:r,type:"verificationRequest",iat:Math.floor(Date.now()/1e3)},o=await hi(n);return await new Li(i).setProtectedHeader({alg:n.alg}).setIssuedAt(i.iat).sign(o)}var Zh=Object.freeze({__proto__:null,ConflictResolver:class{constructor(e,t){this.jwkPair=e,this.dltAgent=t,this.initialized=new Promise(((e,t)=>{this.init().then((()=>{e(!0)})).catch((e=>{t(e)}))}))}async init(){await Xi(this.jwkPair.publicJwk,this.jwkPair.privateJwk)}async resolveCompleteness(e){await this.initialized;const{payload:t}=await Gi(e);let r;try{r=(await Gi(t.por)).payload}catch(e){throw new nn(e,["invalid por"])}const n={...await this._resolution(t.dataExchangeId,r.exchange[t.iss]),resolution:"not completed",type:"verification"};try{await Wh(e,this.dltAgent),n.resolution="completed"}catch(e){if(!(e instanceof nn)||e.nrErrors.includes("invalid verification request")||e.nrErrors.includes("unexpected error"))throw e}const i=await hi(this.jwkPair.privateJwk);return await new Li(n).setProtectedHeader({alg:this.jwkPair.privateJwk.alg}).setIssuedAt(n.iat).sign(i)}async resolveDispute(e){await this.initialized;const{payload:t}=await Gi(e);let r;try{r=(await Gi(t.por)).payload}catch(e){throw new nn(e,["invalid por"])}const n={...await this._resolution(t.dataExchangeId,r.exchange[t.iss]),resolution:"denied",type:"dispute"};try{await Gh(e,this.dltAgent)}catch(e){if(!(e instanceof nn&&e.nrErrors.includes("decryption failed")))throw new nn(e,["cannot verify"]);n.resolution="accepted"}const i=await hi(this.jwkPair.privateJwk);return await new Li(n).setProtectedHeader({alg:this.jwkPair.privateJwk.alg}).setIssuedAt(n.iat).sign(i)}async _resolution(e,t){return{proofType:"resolution",dataExchangeId:e,iat:Math.floor(Date.now()/1e3),iss:await io(this.jwkPair.publicJwk,!0),sub:t}}},checkCompleteness:Wh,checkDecryption:Gh,generateVerificationRequest:Vh,verifyPor:Jh,verifyResolution:async function(e,t){return await Gi(e,t??((e,t)=>JSON.parse(t.iss)))}});const Xh={gasLimit:125e5,contract:{address:"0x8d407A1722633bDD1dcf221474be7a44C05d7c2F",abi:[{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"sender",type:"address"},{indexed:!1,internalType:"uint256",name:"dataExchangeId",type:"uint256"},{indexed:!1,internalType:"uint256",name:"timestamp",type:"uint256"},{indexed:!1,internalType:"uint256",name:"secret",type:"uint256"}],name:"Registration",type:"event"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"uint256",name:"",type:"uint256"}],name:"registry",outputs:[{internalType:"uint256",name:"timestamp",type:"uint256"},{internalType:"uint256",name:"secret",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"_dataExchangeId",type:"uint256"},{internalType:"uint256",name:"_secret",type:"uint256"}],name:"setRegistry",outputs:[],stateMutability:"nonpayable",type:"function"}],transactionHash:"0x6a3828f8fe232819dc40ca66f93930b3bd1619db31a67ec34b44446b3e7c8289",receipt:{to:null,from:"0x17bd12C2134AfC1f6E9302a532eFE30C19B9E903",contractAddress:"0x8d407A1722633bDD1dcf221474be7a44C05d7c2F",transactionIndex:0,gasUsed:"253928",logsBloom:"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",blockHash:"0x0118672bb9b27679e616831d056d36291dd20cfe88c3ee2abd8f2dfce579cad4",transactionHash:"0x6a3828f8fe232819dc40ca66f93930b3bd1619db31a67ec34b44446b3e7c8289",logs:[],blockNumber:119389,cumulativeGasUsed:"253928",status:1,byzantium:!0},args:[],solcInputHash:"c528a37588793ef74285d75e08d6b8eb",metadata:'{"compiler":{"version":"0.8.4+commit.c7e474f2"},"language":"Solidity","output":{"abi":[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"dataExchangeId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"secret","type":"uint256"}],"name":"Registration","type":"event"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"registry","outputs":[{"internalType":"uint256","name":"timestamp","type":"uint256"},{"internalType":"uint256","name":"secret","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_dataExchangeId","type":"uint256"},{"internalType":"uint256","name":"_secret","type":"uint256"}],"name":"setRegistry","outputs":[],"stateMutability":"nonpayable","type":"function"}],"devdoc":{"kind":"dev","methods":{},"version":1},"userdoc":{"kind":"user","methods":{},"version":1}},"settings":{"compilationTarget":{"contracts/NonRepudiation.sol":"NonRepudiation"},"evmVersion":"istanbul","libraries":{},"metadata":{"bytecodeHash":"ipfs","useLiteralContent":true},"optimizer":{"enabled":false,"runs":200},"remappings":[]},"sources":{"contracts/NonRepudiation.sol":{"content":"//SPDX-License-Identifier: Unlicense\\npragma solidity ^0.8.0;\\n\\ncontract NonRepudiation {\\n struct Proof {\\n uint256 timestamp;\\n uint256 secret;\\n }\\n mapping(address => mapping (uint256 => Proof)) public registry;\\n event Registration(address sender, uint256 dataExchangeId, uint256 timestamp, uint256 secret);\\n\\n function setRegistry(uint256 _dataExchangeId, uint256 _secret) public {\\n require(registry[msg.sender][_dataExchangeId].secret == 0);\\n registry[msg.sender][_dataExchangeId] = Proof(block.timestamp, _secret);\\n emit Registration(msg.sender, _dataExchangeId, block.timestamp, _secret);\\n }\\n}\\n","keccak256":"0x8d371257a9b03c9102f158323e61f56ce49dd8489bd92c5a7d8abc3d9f6f8399","license":"Unlicense"}},"version":1}',bytecode:"0x608060405234801561001057600080fd5b506103a2806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c8063032439371461003b578063d05cb54514610057575b600080fd5b6100556004803603810190610050919061023a565b610088565b005b610071600480360381019061006c91906101fe565b6101a3565b60405161007f9291906102d9565b60405180910390f35b60008060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002060010154146100e757600080fd5b6040518060400160405280428152602001828152506000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002060008201518160000155602082015181600101559050507faa58599838af2e5e0f3251cfbb4eac5d5d447ded49f6b0ac28d6b44098224e63338342846040516101979493929190610294565b60405180910390a15050565b6000602052816000526040600020602052806000526040600020600091509150508060000154908060010154905082565b6000813590506101e38161033e565b92915050565b6000813590506101f881610355565b92915050565b6000806040838503121561021157600080fd5b600061021f858286016101d4565b9250506020610230858286016101e9565b9150509250929050565b6000806040838503121561024d57600080fd5b600061025b858286016101e9565b925050602061026c858286016101e9565b9150509250929050565b61027f81610302565b82525050565b61028e81610334565b82525050565b60006080820190506102a96000830187610276565b6102b66020830186610285565b6102c36040830185610285565b6102d06060830184610285565b95945050505050565b60006040820190506102ee6000830185610285565b6102fb6020830184610285565b9392505050565b600061030d82610314565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b61034781610302565b811461035257600080fd5b50565b61035e81610334565b811461036957600080fd5b5056fea26469706673582212204fd0fc653fb487221da9a14a4ca5d5499f9e9bc7b27ac8ab0f8d397fd6e3148564736f6c63430008040033",deployedBytecode:"0x608060405234801561001057600080fd5b50600436106100365760003560e01c8063032439371461003b578063d05cb54514610057575b600080fd5b6100556004803603810190610050919061023a565b610088565b005b610071600480360381019061006c91906101fe565b6101a3565b60405161007f9291906102d9565b60405180910390f35b60008060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002060010154146100e757600080fd5b6040518060400160405280428152602001828152506000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002060008201518160000155602082015181600101559050507faa58599838af2e5e0f3251cfbb4eac5d5d447ded49f6b0ac28d6b44098224e63338342846040516101979493929190610294565b60405180910390a15050565b6000602052816000526040600020602052806000526040600020600091509150508060000154908060010154905082565b6000813590506101e38161033e565b92915050565b6000813590506101f881610355565b92915050565b6000806040838503121561021157600080fd5b600061021f858286016101d4565b9250506020610230858286016101e9565b9150509250929050565b6000806040838503121561024d57600080fd5b600061025b858286016101e9565b925050602061026c858286016101e9565b9150509250929050565b61027f81610302565b82525050565b61028e81610334565b82525050565b60006080820190506102a96000830187610276565b6102b66020830186610285565b6102c36040830185610285565b6102d06060830184610285565b95945050505050565b60006040820190506102ee6000830185610285565b6102fb6020830184610285565b9392505050565b600061030d82610314565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b61034781610302565b811461035257600080fd5b50565b61035e81610334565b811461036957600080fd5b5056fea26469706673582212204fd0fc653fb487221da9a14a4ca5d5499f9e9bc7b27ac8ab0f8d397fd6e3148564736f6c63430008040033",devdoc:{kind:"dev",methods:{},version:1},userdoc:{kind:"user",methods:{},version:1},storageLayout:{storage:[{astId:13,contract:"contracts/NonRepudiation.sol:NonRepudiation",label:"registry",offset:0,slot:"0",type:"t_mapping(t_address,t_mapping(t_uint256,t_struct(Proof)6_storage))"}],types:{t_address:{encoding:"inplace",label:"address",numberOfBytes:"20"},"t_mapping(t_address,t_mapping(t_uint256,t_struct(Proof)6_storage))":{encoding:"mapping",key:"t_address",label:"mapping(address => mapping(uint256 => struct NonRepudiation.Proof))",numberOfBytes:"32",value:"t_mapping(t_uint256,t_struct(Proof)6_storage)"},"t_mapping(t_uint256,t_struct(Proof)6_storage)":{encoding:"mapping",key:"t_uint256",label:"mapping(uint256 => struct NonRepudiation.Proof)",numberOfBytes:"32",value:"t_struct(Proof)6_storage"},"t_struct(Proof)6_storage":{encoding:"inplace",label:"struct NonRepudiation.Proof",members:[{astId:3,contract:"contracts/NonRepudiation.sol:NonRepudiation",label:"timestamp",offset:0,slot:"0",type:"t_uint256"},{astId:5,contract:"contracts/NonRepudiation.sol:NonRepudiation",label:"secret",offset:0,slot:"1",type:"t_uint256"}],numberOfBytes:"64"},t_uint256:{encoding:"inplace",label:"uint256",numberOfBytes:"32"}}}}};async function Qh(e,t,n,o,a){let s=Go.from(0),c=Go.from(0);const u=no(i(r(n)),!0);let f=0;do{try{({secret:s,timestamp:c}=await e.registry(no(t,!0),u))}catch(e){throw new nn(e,["cannot contact the ledger"])}s.isZero()&&(f++,await new Promise((e=>setTimeout(e,1e3))))}while(s.isZero()&&f{null!==e&&"object"==typeof e&&"function"==typeof e.then?e.then((e=>{this.dltConfig={...Xh,...e},this.provider=new kh(this.dltConfig.rpcProviderUrl),this.contract=new Qf(this.dltConfig.contract.address,this.dltConfig.contract.abi,this.provider),t(!0)})).catch((e=>r(e))):(this.dltConfig={...Xh,...e},this.provider=new kh(this.dltConfig.rpcProviderUrl),this.contract=new Qf(this.dltConfig.contract.address,this.dltConfig.contract.abi,this.provider),t(!0))}))}async getContractAddress(){return await this.initialized,this.contract.address}}class rp extends tp{async getSecretFromLedger(e,t,r,n){return await this.initialized,await Qh(this.contract,t,r,n,e)}}class np extends tp{constructor(e,t,r){const n=new Promise(((t,n)=>{e.providerinfo.get().then((e=>{const i=e.rpcUrl;void 0===i?n(new Error("wallet is not connected to RPC endpoint")):t({...r,rpcProviderUrl:"string"==typeof i?i:i[0]})})).catch((e=>{n(e)}))}));super(n),this.wallet=e,this.did=t}}class ip extends np{async getSecretFromLedger(e,t,r,n){return await this.initialized,await Qh(this.contract,t,r,n,e)}}class op extends tp{constructor(e,t,r){const n=new Promise(((t,n)=>{e.providerinfoGet().then((e=>{const i=e.rpcUrl;void 0===i?n(new Error("wallet is not connected to RPC endpoint")):t({...r,rpcProviderUrl:"string"==typeof i?i:i[0]})})).catch((e=>{n(e)}))}));super(n),this.wallet=e,this.did=t}}class ap extends op{async getSecretFromLedger(e,t,r,n){return await this.initialized,await Qh(this.contract,t,r,n,e)}}var sp={},cp=u(bu),up=u(ws),fp=u(yc),dp=u(nd),lp=u(Uo),hp=u(uu),pp=u(Id),mp=u(fl),gp=u(ns),yp=u(vo),bp=u(cd),vp=u(jh),wp=u(jd),Ap=u(Sa),_p=u(ls),Ep=u(vf),Sp=u(oc),Pp=u($f),xp=u(zh),kp=u(pl),Mp=u(Rl);!function(e){var t=s&&s.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),r=s&&s.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=s&&s.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&t(n,e,i);return r(n,e),n};Object.defineProperty(e,"__esModule",{value:!0}),e.formatBytes32String=e.Utf8ErrorFuncs=e.toUtf8String=e.toUtf8CodePoints=e.toUtf8Bytes=e._toEscapedUtf8String=e.nameprep=e.hexDataSlice=e.hexDataLength=e.hexZeroPad=e.hexValue=e.hexStripZeros=e.hexConcat=e.isHexString=e.hexlify=e.base64=e.base58=e.TransactionDescription=e.LogDescription=e.Interface=e.SigningKey=e.HDNode=e.defaultPath=e.isBytesLike=e.isBytes=e.zeroPad=e.stripZeros=e.concat=e.arrayify=e.shallowCopy=e.resolveProperties=e.getStatic=e.defineReadOnly=e.deepCopy=e.checkProperties=e.poll=e.fetchJson=e._fetchData=e.RLP=e.Logger=e.checkResultErrors=e.FormatTypes=e.ParamType=e.FunctionFragment=e.EventFragment=e.ErrorFragment=e.ConstructorFragment=e.Fragment=e.defaultAbiCoder=e.AbiCoder=void 0,e.Indexed=e.Utf8ErrorReason=e.UnicodeNormalizationForm=e.SupportedAlgorithm=e.mnemonicToSeed=e.isValidMnemonic=e.entropyToMnemonic=e.mnemonicToEntropy=e.getAccountPath=e.verifyTypedData=e.verifyMessage=e.recoverPublicKey=e.computePublicKey=e.recoverAddress=e.computeAddress=e.getJsonWalletAddress=e.TransactionTypes=e.serializeTransaction=e.parseTransaction=e.accessListify=e.joinSignature=e.splitSignature=e.soliditySha256=e.solidityKeccak256=e.solidityPack=e.shuffled=e.randomBytes=e.sha512=e.sha256=e.ripemd160=e.keccak256=e.computeHmac=e.commify=e.parseUnits=e.formatUnits=e.parseEther=e.formatEther=e.isAddress=e.getCreate2Address=e.getContractAddress=e.getIcapAddress=e.getAddress=e._TypedDataEncoder=e.id=e.isValidName=e.namehash=e.hashMessage=e.dnsEncode=e.parseBytes32String=void 0;var i=cp;Object.defineProperty(e,"AbiCoder",{enumerable:!0,get:function(){return i.AbiCoder}}),Object.defineProperty(e,"checkResultErrors",{enumerable:!0,get:function(){return i.checkResultErrors}}),Object.defineProperty(e,"ConstructorFragment",{enumerable:!0,get:function(){return i.ConstructorFragment}}),Object.defineProperty(e,"defaultAbiCoder",{enumerable:!0,get:function(){return i.defaultAbiCoder}}),Object.defineProperty(e,"ErrorFragment",{enumerable:!0,get:function(){return i.ErrorFragment}}),Object.defineProperty(e,"EventFragment",{enumerable:!0,get:function(){return i.EventFragment}}),Object.defineProperty(e,"FormatTypes",{enumerable:!0,get:function(){return i.FormatTypes}}),Object.defineProperty(e,"Fragment",{enumerable:!0,get:function(){return i.Fragment}}),Object.defineProperty(e,"FunctionFragment",{enumerable:!0,get:function(){return i.FunctionFragment}}),Object.defineProperty(e,"Indexed",{enumerable:!0,get:function(){return i.Indexed}}),Object.defineProperty(e,"Interface",{enumerable:!0,get:function(){return i.Interface}}),Object.defineProperty(e,"LogDescription",{enumerable:!0,get:function(){return i.LogDescription}}),Object.defineProperty(e,"ParamType",{enumerable:!0,get:function(){return i.ParamType}}),Object.defineProperty(e,"TransactionDescription",{enumerable:!0,get:function(){return i.TransactionDescription}});var o=up;Object.defineProperty(e,"getAddress",{enumerable:!0,get:function(){return o.getAddress}}),Object.defineProperty(e,"getCreate2Address",{enumerable:!0,get:function(){return o.getCreate2Address}}),Object.defineProperty(e,"getContractAddress",{enumerable:!0,get:function(){return o.getContractAddress}}),Object.defineProperty(e,"getIcapAddress",{enumerable:!0,get:function(){return o.getIcapAddress}}),Object.defineProperty(e,"isAddress",{enumerable:!0,get:function(){return o.isAddress}});var a=n(fp);e.base64=a;var c=dp;Object.defineProperty(e,"base58",{enumerable:!0,get:function(){return c.Base58}});var u=lp;Object.defineProperty(e,"arrayify",{enumerable:!0,get:function(){return u.arrayify}}),Object.defineProperty(e,"concat",{enumerable:!0,get:function(){return u.concat}}),Object.defineProperty(e,"hexConcat",{enumerable:!0,get:function(){return u.hexConcat}}),Object.defineProperty(e,"hexDataSlice",{enumerable:!0,get:function(){return u.hexDataSlice}}),Object.defineProperty(e,"hexDataLength",{enumerable:!0,get:function(){return u.hexDataLength}}),Object.defineProperty(e,"hexlify",{enumerable:!0,get:function(){return u.hexlify}}),Object.defineProperty(e,"hexStripZeros",{enumerable:!0,get:function(){return u.hexStripZeros}}),Object.defineProperty(e,"hexValue",{enumerable:!0,get:function(){return u.hexValue}}),Object.defineProperty(e,"hexZeroPad",{enumerable:!0,get:function(){return u.hexZeroPad}}),Object.defineProperty(e,"isBytes",{enumerable:!0,get:function(){return u.isBytes}}),Object.defineProperty(e,"isBytesLike",{enumerable:!0,get:function(){return u.isBytesLike}}),Object.defineProperty(e,"isHexString",{enumerable:!0,get:function(){return u.isHexString}}),Object.defineProperty(e,"joinSignature",{enumerable:!0,get:function(){return u.joinSignature}}),Object.defineProperty(e,"zeroPad",{enumerable:!0,get:function(){return u.zeroPad}}),Object.defineProperty(e,"splitSignature",{enumerable:!0,get:function(){return u.splitSignature}}),Object.defineProperty(e,"stripZeros",{enumerable:!0,get:function(){return u.stripZeros}});var f=hp;Object.defineProperty(e,"_TypedDataEncoder",{enumerable:!0,get:function(){return f._TypedDataEncoder}}),Object.defineProperty(e,"dnsEncode",{enumerable:!0,get:function(){return f.dnsEncode}}),Object.defineProperty(e,"hashMessage",{enumerable:!0,get:function(){return f.hashMessage}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return f.id}}),Object.defineProperty(e,"isValidName",{enumerable:!0,get:function(){return f.isValidName}}),Object.defineProperty(e,"namehash",{enumerable:!0,get:function(){return f.namehash}});var d=pp;Object.defineProperty(e,"defaultPath",{enumerable:!0,get:function(){return d.defaultPath}}),Object.defineProperty(e,"entropyToMnemonic",{enumerable:!0,get:function(){return d.entropyToMnemonic}}),Object.defineProperty(e,"getAccountPath",{enumerable:!0,get:function(){return d.getAccountPath}}),Object.defineProperty(e,"HDNode",{enumerable:!0,get:function(){return d.HDNode}}),Object.defineProperty(e,"isValidMnemonic",{enumerable:!0,get:function(){return d.isValidMnemonic}}),Object.defineProperty(e,"mnemonicToEntropy",{enumerable:!0,get:function(){return d.mnemonicToEntropy}}),Object.defineProperty(e,"mnemonicToSeed",{enumerable:!0,get:function(){return d.mnemonicToSeed}});var l=mp;Object.defineProperty(e,"getJsonWalletAddress",{enumerable:!0,get:function(){return l.getJsonWalletAddress}});var h=gp;Object.defineProperty(e,"keccak256",{enumerable:!0,get:function(){return h.keccak256}});var p=yp;Object.defineProperty(e,"Logger",{enumerable:!0,get:function(){return p.Logger}});var m=bp;Object.defineProperty(e,"computeHmac",{enumerable:!0,get:function(){return m.computeHmac}}),Object.defineProperty(e,"ripemd160",{enumerable:!0,get:function(){return m.ripemd160}}),Object.defineProperty(e,"sha256",{enumerable:!0,get:function(){return m.sha256}}),Object.defineProperty(e,"sha512",{enumerable:!0,get:function(){return m.sha512}});var g=vp;Object.defineProperty(e,"solidityKeccak256",{enumerable:!0,get:function(){return g.keccak256}}),Object.defineProperty(e,"solidityPack",{enumerable:!0,get:function(){return g.pack}}),Object.defineProperty(e,"soliditySha256",{enumerable:!0,get:function(){return g.sha256}});var y=wp;Object.defineProperty(e,"randomBytes",{enumerable:!0,get:function(){return y.randomBytes}}),Object.defineProperty(e,"shuffled",{enumerable:!0,get:function(){return y.shuffled}});var b=Ap;Object.defineProperty(e,"checkProperties",{enumerable:!0,get:function(){return b.checkProperties}}),Object.defineProperty(e,"deepCopy",{enumerable:!0,get:function(){return b.deepCopy}}),Object.defineProperty(e,"defineReadOnly",{enumerable:!0,get:function(){return b.defineReadOnly}}),Object.defineProperty(e,"getStatic",{enumerable:!0,get:function(){return b.getStatic}}),Object.defineProperty(e,"resolveProperties",{enumerable:!0,get:function(){return b.resolveProperties}}),Object.defineProperty(e,"shallowCopy",{enumerable:!0,get:function(){return b.shallowCopy}});var v=n(_p);e.RLP=v;var w=Ep;Object.defineProperty(e,"computePublicKey",{enumerable:!0,get:function(){return w.computePublicKey}}),Object.defineProperty(e,"recoverPublicKey",{enumerable:!0,get:function(){return w.recoverPublicKey}}),Object.defineProperty(e,"SigningKey",{enumerable:!0,get:function(){return w.SigningKey}});var A=Sp;Object.defineProperty(e,"formatBytes32String",{enumerable:!0,get:function(){return A.formatBytes32String}}),Object.defineProperty(e,"nameprep",{enumerable:!0,get:function(){return A.nameprep}}),Object.defineProperty(e,"parseBytes32String",{enumerable:!0,get:function(){return A.parseBytes32String}}),Object.defineProperty(e,"_toEscapedUtf8String",{enumerable:!0,get:function(){return A._toEscapedUtf8String}}),Object.defineProperty(e,"toUtf8Bytes",{enumerable:!0,get:function(){return A.toUtf8Bytes}}),Object.defineProperty(e,"toUtf8CodePoints",{enumerable:!0,get:function(){return A.toUtf8CodePoints}}),Object.defineProperty(e,"toUtf8String",{enumerable:!0,get:function(){return A.toUtf8String}}),Object.defineProperty(e,"Utf8ErrorFuncs",{enumerable:!0,get:function(){return A.Utf8ErrorFuncs}});var _=Pp;Object.defineProperty(e,"accessListify",{enumerable:!0,get:function(){return _.accessListify}}),Object.defineProperty(e,"computeAddress",{enumerable:!0,get:function(){return _.computeAddress}}),Object.defineProperty(e,"parseTransaction",{enumerable:!0,get:function(){return _.parse}}),Object.defineProperty(e,"recoverAddress",{enumerable:!0,get:function(){return _.recoverAddress}}),Object.defineProperty(e,"serializeTransaction",{enumerable:!0,get:function(){return _.serialize}}),Object.defineProperty(e,"TransactionTypes",{enumerable:!0,get:function(){return _.TransactionTypes}});var E=xp;Object.defineProperty(e,"commify",{enumerable:!0,get:function(){return E.commify}}),Object.defineProperty(e,"formatEther",{enumerable:!0,get:function(){return E.formatEther}}),Object.defineProperty(e,"parseEther",{enumerable:!0,get:function(){return E.parseEther}}),Object.defineProperty(e,"formatUnits",{enumerable:!0,get:function(){return E.formatUnits}}),Object.defineProperty(e,"parseUnits",{enumerable:!0,get:function(){return E.parseUnits}});var S=kp;Object.defineProperty(e,"verifyMessage",{enumerable:!0,get:function(){return S.verifyMessage}}),Object.defineProperty(e,"verifyTypedData",{enumerable:!0,get:function(){return S.verifyTypedData}});var P=Mp;Object.defineProperty(e,"_fetchData",{enumerable:!0,get:function(){return P._fetchData}}),Object.defineProperty(e,"fetchJson",{enumerable:!0,get:function(){return P.fetchJson}}),Object.defineProperty(e,"poll",{enumerable:!0,get:function(){return P.poll}});var x=bp;Object.defineProperty(e,"SupportedAlgorithm",{enumerable:!0,get:function(){return x.SupportedAlgorithm}});var k=Sp;Object.defineProperty(e,"UnicodeNormalizationForm",{enumerable:!0,get:function(){return k.UnicodeNormalizationForm}}),Object.defineProperty(e,"Utf8ErrorReason",{enumerable:!0,get:function(){return k.Utf8ErrorReason}})}(sp);class Cp extends tp{constructor(e,t){let r;super(e),this.count=-1,r=void 0===t?function(e,t=!1){if(e<1)throw new RangeError("byteLength MUST be > 0");{const r=new Uint8Array(e);if(e<=65536)self.crypto.getRandomValues(r);else for(let t=0;tthis.count&&(this.count=e),this.count}}class Ip extends np{constructor(){super(...arguments),this.count=-1}async deploySecret(e,t){await this.initialized;const r=await Yh(e,t,this),n=(await this.wallet.identities.sign({did:this.did},{type:"Transaction",data:r})).signature,i=await this.provider.sendTransaction(n);return this.count=this.count+1,i.hash}async getAddress(){await this.initialized;const e=await this.wallet.identities.info({did:this.did});if(void 0===e.addresses)throw new nn(new Error("no addresses for did "+this.did),["unexpected error"]);return e.addresses[0]}async nextNonce(){await this.initialized;const e=await this.provider.getTransactionCount(await this.getAddress(),"pending");return e>this.count&&(this.count=e),this.count}}class Rp extends op{constructor(){super(...arguments),this.count=-1}async deploySecret(e,t){await this.initialized;const r=await Yh(e,t,this),n=(await this.wallet.identitySign({did:this.did},{type:"Transaction",data:r})).signature,i=await this.provider.sendTransaction(n);return this.count=this.count+1,i.hash}async getAddress(){await this.initialized;const e=await this.wallet.identityInfo({did:this.did});if(void 0===e.addresses)throw new nn(`Can't get address for did: ${this.did}`,["unexpected error"]);return e.addresses[0]}async nextNonce(){await this.initialized;const e=await this.provider.getTransactionCount(await this.getAddress(),"pending");return e>this.count&&(this.count=e),this.count}}var Np=Object.freeze({__proto__:null,EthersIoAgentDest:rp,EthersIoAgentOrig:Cp,I3mServerWalletAgentDest:ap,I3mServerWalletAgentOrig:Rp,I3mWalletAgentDest:ip,I3mWalletAgentOrig:Ip}),Op={schemas:{IdentitySelectOutput:{title:"IdentitySelectOutput",type:"object",properties:{did:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},required:["did"]},SignInput:{title:"SignInput",oneOf:[{title:"SignTransaction",type:"object",properties:{type:{enum:["Transaction"]},data:{title:"Transaction",type:"object",additionalProperties:!0,properties:{from:{type:"string"},to:{type:"string"},nonce:{type:"number"}}}},required:["type","data"]},{title:"SignRaw",type:"object",properties:{type:{enum:["Raw"]},data:{type:"object",properties:{payload:{description:"Base64Url encoded data to sign",type:"string",pattern:"^[A-Za-z0-9_-]+$"}},required:["payload"]}},required:["type","data"]},{title:"SignJWT",type:"object",properties:{type:{enum:["JWT"]},data:{type:"object",properties:{header:{description:'header fields to be added to the JWS header. "alg" and "kid" will be ignored since they are automatically added by the wallet.',type:"object",additionalProperties:!0},payload:{description:"A JSON object to be signed by the wallet. It will become the payload of the generated JWS. 'iss' (issuer) and 'iat' (issued at) will be automatically added by the wallet and will override provided values.",type:"object",additionalProperties:!0}},required:["payload"]}},required:["type","data"]}]},SignRaw:{title:"SignRaw",type:"object",properties:{type:{enum:["Raw"]},data:{type:"object",properties:{payload:{description:"Base64Url encoded data to sign",type:"string",pattern:"^[A-Za-z0-9_-]+$"}},required:["payload"]}},required:["type","data"]},SignTransaction:{title:"SignTransaction",type:"object",properties:{type:{enum:["Transaction"]},data:{title:"Transaction",type:"object",additionalProperties:!0,properties:{from:{type:"string"},to:{type:"string"},nonce:{type:"number"}}}},required:["type","data"]},SignJWT:{title:"SignJWT",type:"object",properties:{type:{enum:["JWT"]},data:{type:"object",properties:{header:{description:'header fields to be added to the JWS header. "alg" and "kid" will be ignored since they are automatically added by the wallet.',type:"object",additionalProperties:!0},payload:{description:"A JSON object to be signed by the wallet. It will become the payload of the generated JWS. 'iss' (issuer) and 'iat' (issued at) will be automatically added by the wallet and will override provided values.",type:"object",additionalProperties:!0}},required:["payload"]}},required:["type","data"]},Transaction:{title:"Transaction",type:"object",additionalProperties:!0,properties:{from:{type:"string"},to:{type:"string"},nonce:{type:"number"}}},SignOutput:{title:"SignOutput",type:"object",properties:{signature:{type:"string"}},required:["signature"]},Receipt:{title:"Receipt",type:"object",properties:{receipt:{type:"string"}},required:["receipt"]},SignTypes:{title:"SignTypes",type:"string",enum:["Transaction","Raw","JWT"]},IdentityListInput:{title:"IdentityListInput",description:"A list of DIDs",type:"array",items:{type:"object",properties:{did:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},required:["did"]}},IdentityCreateInput:{title:"IdentityCreateInput",description:'Besides the here defined options, provider specific properties should be added here if necessary, e.g. "path" for BIP21 wallets, or the key algorithm (if the wallet supports multiple algorithm).\n',type:"object",properties:{alias:{type:"string"}},additionalProperties:!0},IdentityCreateOutput:{title:"IdentityCreateOutput",description:"It returns the account id and type\n",type:"object",properties:{did:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},additionalProperties:!0,required:["did"]},ResourceListOutput:{title:"ResourceListOutput",description:"A list of resources",type:"array",items:{title:"Resource",anyOf:[{title:"VerifiableCredential",type:"object",properties:{type:{example:"VerifiableCredential",enum:["VerifiableCredential"]},name:{type:"string",example:"Resource name"},resource:{type:"object",properties:{"@context":{type:"array",items:{type:"string"},example:["https://www.w3.org/2018/credentials/v1"]},id:{type:"string",example:"http://example.edu/credentials/1872"},type:{type:"array",items:{type:"string"},example:["VerifiableCredential"]},issuer:{type:"object",properties:{id:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},additionalProperties:!0,required:["id"]},issuanceDate:{type:"string",format:"date-time",example:"2021-06-10T19:07:28.000Z"},credentialSubject:{type:"object",properties:{id:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},required:["id"],additionalProperties:!0},proof:{type:"object",properties:{type:{type:"string",enum:["JwtProof2020"]}},required:["type"],additionalProperties:!0}},additionalProperties:!0,required:["@context","type","issuer","issuanceDate","credentialSubject","proof"]}},required:["type","resource"]},{title:"ObjectResource",type:"object",properties:{type:{example:"Object",enum:["Object"]},name:{type:"string",example:"Resource name"},parentResource:{type:"string"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",additionalProperties:!0}},required:["type","resource"]},{title:"JWK pair",type:"object",properties:{type:{example:"KeyPair",enum:["KeyPair"]},name:{type:"string",example:"Resource name"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",properties:{keyPair:{type:"object",properties:{privateJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents a private key (complementary to `publicJwk`)\n",example:'{"alg":"ES256","crv":"P-256","d":"rQp_3eZzvXwt1sK7WWsRhVYipqNGblzYDKKaYirlqs0","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'},publicJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents the public key (complementary to `privateJwk`).\n",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'}},required:["privateJwk","publicJwk"]}},required:["keyPair"]}},required:["type","resource"]},{title:"Contract",type:"object",properties:{type:{example:"Contract",enum:["Contract"]},name:{type:"string",example:"Resource name"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",properties:{dataSharingAgreement:{type:"object",required:["dataOfferingDescription","parties","purpose","duration","intendedUse","licenseGrant","dataStream","personalData","pricingModel","dataExchangeAgreement","signatures"],properties:{dataOfferingDescription:{type:"object",required:["dataOfferingId","version","active"],properties:{dataOfferingId:{type:"string"},version:{type:"integer"},category:{type:"string"},active:{type:"boolean"},title:{type:"string"}}},parties:{type:"object",required:["providerDid","consumerDid"],properties:{providerDid:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},consumerDid:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}}},purpose:{type:"string"},duration:{type:"object",required:["creationDate","startDate","endDate"],properties:{creationDate:{type:"integer"},startDate:{type:"integer"},endDate:{type:"integer"}}},intendedUse:{type:"object",required:["processData","shareDataWithThirdParty","editData"],properties:{processData:{type:"boolean"},shareDataWithThirdParty:{type:"boolean"},editData:{type:"boolean"}}},licenseGrant:{type:"object",required:["transferable","exclusiveness","paidUp","revocable","processing","modifying","analyzing","storingData","storingCopy","reproducing","distributing","loaning","selling","renting","furtherLicensing","leasing"],properties:{transferable:{type:"boolean"},exclusiveness:{type:"boolean"},paidUp:{type:"boolean"},revocable:{type:"boolean"},processing:{type:"boolean"},modifying:{type:"boolean"},analyzing:{type:"boolean"},storingData:{type:"boolean"},storingCopy:{type:"boolean"},reproducing:{type:"boolean"},distributing:{type:"boolean"},loaning:{type:"boolean"},selling:{type:"boolean"},renting:{type:"boolean"},furtherLicensing:{type:"boolean"},leasing:{type:"boolean"}}},dataStream:{type:"boolean"},personalData:{type:"boolean"},pricingModel:{type:"object",required:["basicPrice","currency","hasFreePrice"],properties:{paymentType:{type:"string"},pricingModelName:{type:"string"},basicPrice:{type:"number",format:"float"},currency:{type:"string"},fee:{type:"number",format:"float"},hasPaymentOnSubscription:{type:"object",properties:{paymentOnSubscriptionName:{type:"string"},paymentType:{type:"string"},timeDuration:{type:"string"},description:{type:"string"},repeat:{type:"string"},hasSubscriptionPrice:{type:"number"}}},hasFreePrice:{type:"object",properties:{hasPriceFree:{type:"boolean"}}}}},dataExchangeAgreement:{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},signatures:{type:"object",required:["providerSignature","consumerSignature"],properties:{providerSignature:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"},consumerSignature:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"}}}}},keyPair:{type:"object",properties:{privateJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents a private key (complementary to `publicJwk`)\n",example:'{"alg":"ES256","crv":"P-256","d":"rQp_3eZzvXwt1sK7WWsRhVYipqNGblzYDKKaYirlqs0","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'},publicJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents the public key (complementary to `privateJwk`).\n",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'}},required:["privateJwk","publicJwk"]}},required:["dataSharingAgreement"]}},required:["type","resource"]},{title:"NonRepudiationProof",type:"object",properties:{type:{example:"NonRepudiationProof",enum:["NonRepudiationProof"]},name:{type:"string",example:"Resource name"},resource:{description:"a non-repudiation proof (either a PoO, a PoR or a PoP) as a compact JWS"}},required:["type","resource"]},{title:"DataExchangeResource",type:"object",properties:{type:{example:"DataExchange",enum:["DataExchange"]},name:{type:"string",example:"Resource name"},resource:{allOf:[{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},{type:"object",properties:{cipherblockDgst:{type:"string",description:"hash of the cipherblock in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"},blockCommitment:{type:"string",description:"hash of the plaintext block in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"},secretCommitment:{type:"string",description:"ash of the secret that can be used to decrypt the block in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"}},required:["cipherblockDgst","blockCommitment","secretCommitment"]}]}},required:["type","resource"]}]}},Resource:{title:"Resource",anyOf:[{title:"VerifiableCredential",type:"object",properties:{type:{example:"VerifiableCredential",enum:["VerifiableCredential"]},name:{type:"string",example:"Resource name"},resource:{type:"object",properties:{"@context":{type:"array",items:{type:"string"},example:["https://www.w3.org/2018/credentials/v1"]},id:{type:"string",example:"http://example.edu/credentials/1872"},type:{type:"array",items:{type:"string"},example:["VerifiableCredential"]},issuer:{type:"object",properties:{id:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},additionalProperties:!0,required:["id"]},issuanceDate:{type:"string",format:"date-time",example:"2021-06-10T19:07:28.000Z"},credentialSubject:{type:"object",properties:{id:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},required:["id"],additionalProperties:!0},proof:{type:"object",properties:{type:{type:"string",enum:["JwtProof2020"]}},required:["type"],additionalProperties:!0}},additionalProperties:!0,required:["@context","type","issuer","issuanceDate","credentialSubject","proof"]}},required:["type","resource"]},{title:"ObjectResource",type:"object",properties:{type:{example:"Object",enum:["Object"]},name:{type:"string",example:"Resource name"},parentResource:{type:"string"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",additionalProperties:!0}},required:["type","resource"]},{title:"JWK pair",type:"object",properties:{type:{example:"KeyPair",enum:["KeyPair"]},name:{type:"string",example:"Resource name"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",properties:{keyPair:{type:"object",properties:{privateJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents a private key (complementary to `publicJwk`)\n",example:'{"alg":"ES256","crv":"P-256","d":"rQp_3eZzvXwt1sK7WWsRhVYipqNGblzYDKKaYirlqs0","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'},publicJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents the public key (complementary to `privateJwk`).\n",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'}},required:["privateJwk","publicJwk"]}},required:["keyPair"]}},required:["type","resource"]},{title:"Contract",type:"object",properties:{type:{example:"Contract",enum:["Contract"]},name:{type:"string",example:"Resource name"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",properties:{dataSharingAgreement:{type:"object",required:["dataOfferingDescription","parties","purpose","duration","intendedUse","licenseGrant","dataStream","personalData","pricingModel","dataExchangeAgreement","signatures"],properties:{dataOfferingDescription:{type:"object",required:["dataOfferingId","version","active"],properties:{dataOfferingId:{type:"string"},version:{type:"integer"},category:{type:"string"},active:{type:"boolean"},title:{type:"string"}}},parties:{type:"object",required:["providerDid","consumerDid"],properties:{providerDid:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},consumerDid:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}}},purpose:{type:"string"},duration:{type:"object",required:["creationDate","startDate","endDate"],properties:{creationDate:{type:"integer"},startDate:{type:"integer"},endDate:{type:"integer"}}},intendedUse:{type:"object",required:["processData","shareDataWithThirdParty","editData"],properties:{processData:{type:"boolean"},shareDataWithThirdParty:{type:"boolean"},editData:{type:"boolean"}}},licenseGrant:{type:"object",required:["transferable","exclusiveness","paidUp","revocable","processing","modifying","analyzing","storingData","storingCopy","reproducing","distributing","loaning","selling","renting","furtherLicensing","leasing"],properties:{transferable:{type:"boolean"},exclusiveness:{type:"boolean"},paidUp:{type:"boolean"},revocable:{type:"boolean"},processing:{type:"boolean"},modifying:{type:"boolean"},analyzing:{type:"boolean"},storingData:{type:"boolean"},storingCopy:{type:"boolean"},reproducing:{type:"boolean"},distributing:{type:"boolean"},loaning:{type:"boolean"},selling:{type:"boolean"},renting:{type:"boolean"},furtherLicensing:{type:"boolean"},leasing:{type:"boolean"}}},dataStream:{type:"boolean"},personalData:{type:"boolean"},pricingModel:{type:"object",required:["basicPrice","currency","hasFreePrice"],properties:{paymentType:{type:"string"},pricingModelName:{type:"string"},basicPrice:{type:"number",format:"float"},currency:{type:"string"},fee:{type:"number",format:"float"},hasPaymentOnSubscription:{type:"object",properties:{paymentOnSubscriptionName:{type:"string"},paymentType:{type:"string"},timeDuration:{type:"string"},description:{type:"string"},repeat:{type:"string"},hasSubscriptionPrice:{type:"number"}}},hasFreePrice:{type:"object",properties:{hasPriceFree:{type:"boolean"}}}}},dataExchangeAgreement:{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},signatures:{type:"object",required:["providerSignature","consumerSignature"],properties:{providerSignature:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"},consumerSignature:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"}}}}},keyPair:{type:"object",properties:{privateJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents a private key (complementary to `publicJwk`)\n",example:'{"alg":"ES256","crv":"P-256","d":"rQp_3eZzvXwt1sK7WWsRhVYipqNGblzYDKKaYirlqs0","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'},publicJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents the public key (complementary to `privateJwk`).\n",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'}},required:["privateJwk","publicJwk"]}},required:["dataSharingAgreement"]}},required:["type","resource"]},{title:"NonRepudiationProof",type:"object",properties:{type:{example:"NonRepudiationProof",enum:["NonRepudiationProof"]},name:{type:"string",example:"Resource name"},resource:{description:"a non-repudiation proof (either a PoO, a PoR or a PoP) as a compact JWS"}},required:["type","resource"]},{title:"DataExchangeResource",type:"object",properties:{type:{example:"DataExchange",enum:["DataExchange"]},name:{type:"string",example:"Resource name"},resource:{allOf:[{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},{type:"object",properties:{cipherblockDgst:{type:"string",description:"hash of the cipherblock in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"},blockCommitment:{type:"string",description:"hash of the plaintext block in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"},secretCommitment:{type:"string",description:"ash of the secret that can be used to decrypt the block in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"}},required:["cipherblockDgst","blockCommitment","secretCommitment"]}]}},required:["type","resource"]}]},VerifiableCredential:{title:"VerifiableCredential",type:"object",properties:{type:{example:"VerifiableCredential",enum:["VerifiableCredential"]},name:{type:"string",example:"Resource name"},resource:{type:"object",properties:{"@context":{type:"array",items:{type:"string"},example:["https://www.w3.org/2018/credentials/v1"]},id:{type:"string",example:"http://example.edu/credentials/1872"},type:{type:"array",items:{type:"string"},example:["VerifiableCredential"]},issuer:{type:"object",properties:{id:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},additionalProperties:!0,required:["id"]},issuanceDate:{type:"string",format:"date-time",example:"2021-06-10T19:07:28.000Z"},credentialSubject:{type:"object",properties:{id:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},required:["id"],additionalProperties:!0},proof:{type:"object",properties:{type:{type:"string",enum:["JwtProof2020"]}},required:["type"],additionalProperties:!0}},additionalProperties:!0,required:["@context","type","issuer","issuanceDate","credentialSubject","proof"]}},required:["type","resource"]},ObjectResource:{title:"ObjectResource",type:"object",properties:{type:{example:"Object",enum:["Object"]},name:{type:"string",example:"Resource name"},parentResource:{type:"string"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",additionalProperties:!0}},required:["type","resource"]},KeyPair:{title:"JWK pair",type:"object",properties:{type:{example:"KeyPair",enum:["KeyPair"]},name:{type:"string",example:"Resource name"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",properties:{keyPair:{type:"object",properties:{privateJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents a private key (complementary to `publicJwk`)\n",example:'{"alg":"ES256","crv":"P-256","d":"rQp_3eZzvXwt1sK7WWsRhVYipqNGblzYDKKaYirlqs0","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'},publicJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents the public key (complementary to `privateJwk`).\n",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'}},required:["privateJwk","publicJwk"]}},required:["keyPair"]}},required:["type","resource"]},Contract:{title:"Contract",type:"object",properties:{type:{example:"Contract",enum:["Contract"]},name:{type:"string",example:"Resource name"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",properties:{dataSharingAgreement:{type:"object",required:["dataOfferingDescription","parties","purpose","duration","intendedUse","licenseGrant","dataStream","personalData","pricingModel","dataExchangeAgreement","signatures"],properties:{dataOfferingDescription:{type:"object",required:["dataOfferingId","version","active"],properties:{dataOfferingId:{type:"string"},version:{type:"integer"},category:{type:"string"},active:{type:"boolean"},title:{type:"string"}}},parties:{type:"object",required:["providerDid","consumerDid"],properties:{providerDid:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},consumerDid:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}}},purpose:{type:"string"},duration:{type:"object",required:["creationDate","startDate","endDate"],properties:{creationDate:{type:"integer"},startDate:{type:"integer"},endDate:{type:"integer"}}},intendedUse:{type:"object",required:["processData","shareDataWithThirdParty","editData"],properties:{processData:{type:"boolean"},shareDataWithThirdParty:{type:"boolean"},editData:{type:"boolean"}}},licenseGrant:{type:"object",required:["transferable","exclusiveness","paidUp","revocable","processing","modifying","analyzing","storingData","storingCopy","reproducing","distributing","loaning","selling","renting","furtherLicensing","leasing"],properties:{transferable:{type:"boolean"},exclusiveness:{type:"boolean"},paidUp:{type:"boolean"},revocable:{type:"boolean"},processing:{type:"boolean"},modifying:{type:"boolean"},analyzing:{type:"boolean"},storingData:{type:"boolean"},storingCopy:{type:"boolean"},reproducing:{type:"boolean"},distributing:{type:"boolean"},loaning:{type:"boolean"},selling:{type:"boolean"},renting:{type:"boolean"},furtherLicensing:{type:"boolean"},leasing:{type:"boolean"}}},dataStream:{type:"boolean"},personalData:{type:"boolean"},pricingModel:{type:"object",required:["basicPrice","currency","hasFreePrice"],properties:{paymentType:{type:"string"},pricingModelName:{type:"string"},basicPrice:{type:"number",format:"float"},currency:{type:"string"},fee:{type:"number",format:"float"},hasPaymentOnSubscription:{type:"object",properties:{paymentOnSubscriptionName:{type:"string"},paymentType:{type:"string"},timeDuration:{type:"string"},description:{type:"string"},repeat:{type:"string"},hasSubscriptionPrice:{type:"number"}}},hasFreePrice:{type:"object",properties:{hasPriceFree:{type:"boolean"}}}}},dataExchangeAgreement:{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},signatures:{type:"object",required:["providerSignature","consumerSignature"],properties:{providerSignature:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"},consumerSignature:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"}}}}},keyPair:{type:"object",properties:{privateJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents a private key (complementary to `publicJwk`)\n",example:'{"alg":"ES256","crv":"P-256","d":"rQp_3eZzvXwt1sK7WWsRhVYipqNGblzYDKKaYirlqs0","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'},publicJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents the public key (complementary to `privateJwk`).\n",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'}},required:["privateJwk","publicJwk"]}},required:["dataSharingAgreement"]}},required:["type","resource"]},DataExchangeResource:{title:"DataExchangeResource",type:"object",properties:{type:{example:"DataExchange",enum:["DataExchange"]},name:{type:"string",example:"Resource name"},resource:{allOf:[{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},{type:"object",properties:{cipherblockDgst:{type:"string",description:"hash of the cipherblock in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"},blockCommitment:{type:"string",description:"hash of the plaintext block in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"},secretCommitment:{type:"string",description:"ash of the secret that can be used to decrypt the block in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"}},required:["cipherblockDgst","blockCommitment","secretCommitment"]}]}},required:["type","resource"]},NonRepudiationProof:{title:"NonRepudiationProof",type:"object",properties:{type:{example:"NonRepudiationProof",enum:["NonRepudiationProof"]},name:{type:"string",example:"Resource name"},resource:{description:"a non-repudiation proof (either a PoO, a PoR or a PoP) as a compact JWS"}},required:["type","resource"]},ResourceId:{type:"object",properties:{id:{type:"string"}},required:["id"]},ResourceType:{type:"string",enum:["VerifiableCredential","Object","KeyPair","Contract","DataExchange","NonRepudiationProof"]},SignedTransaction:{title:"SignedTransaction",description:"A list of resources",type:"object",properties:{transaction:{type:"string",pattern:"^0x(?:[A-Fa-f0-9])+$"}}},DecodedJwt:{title:"JwtPayload",type:"object",properties:{header:{type:"object",properties:{typ:{type:"string",enum:["JWT"]},alg:{type:"string",enum:["ES256K"]}},required:["typ","alg"],additionalProperties:!0},payload:{type:"object",properties:{iss:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},required:["iss"],additionalProperties:!0},signature:{type:"string",format:"^[A-Za-z0-9_-]+$"},data:{type:"string",format:"^[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+$",description:"."}},required:["signature","data"]},VerificationOutput:{title:"VerificationOutput",type:"object",properties:{verification:{type:"string",enum:["success","failed"],description:"whether verification has been successful or has failed"},error:{type:"string",description:"error message if verification failed"},decodedJwt:{description:"the decoded JWT"}},required:["verification"]},ProviderData:{title:"ProviderData",description:"A JSON object with information of the DLT provider currently in use.",type:"object",properties:{provider:{type:"string",example:"did:ethr:i3m"},network:{type:"string",example:"i3m"},rpcUrl:{oneOf:[{type:"string",example:"http://95.211.3.250:8545"},{type:"array",items:{type:"string"},uniqueItems:!0,example:["http://95.211.3.249:8545","http://95.211.3.250:8545"]}]}},additionalProperties:!0},EthereumAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},did:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},IdentityData:{title:"Identity Data",type:"object",properties:{did:{type:"string",example:"did:ethr:i3m:0x03142f480f831e835822fc0cd35726844a7069d28df58fb82037f1598812e1ade8"},alias:{type:"string",example:"identity1"},provider:{type:"string",example:"did:ethr:i3m"},addresses:{type:"array",items:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},example:["0x8646cAcF516de1292be1D30AB68E7Ea51e9B1BE7"]}},required:["did"]},ApiError:{type:"object",title:"Error",required:["code","message"],properties:{code:{type:"integer",format:"int32"},message:{type:"string"}}},JwkPair:{type:"object",properties:{privateJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents a private key (complementary to `publicJwk`)\n",example:'{"alg":"ES256","crv":"P-256","d":"rQp_3eZzvXwt1sK7WWsRhVYipqNGblzYDKKaYirlqs0","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'},publicJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents the public key (complementary to `privateJwk`).\n",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'}},required:["privateJwk","publicJwk"]},CompactJWS:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"},DataExchangeAgreement:{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},DataSharingAgreement:{type:"object",required:["dataOfferingDescription","parties","purpose","duration","intendedUse","licenseGrant","dataStream","personalData","pricingModel","dataExchangeAgreement","signatures"],properties:{dataOfferingDescription:{type:"object",required:["dataOfferingId","version","active"],properties:{dataOfferingId:{type:"string"},version:{type:"integer"},category:{type:"string"},active:{type:"boolean"},title:{type:"string"}}},parties:{type:"object",required:["providerDid","consumerDid"],properties:{providerDid:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},consumerDid:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}}},purpose:{type:"string"},duration:{type:"object",required:["creationDate","startDate","endDate"],properties:{creationDate:{type:"integer"},startDate:{type:"integer"},endDate:{type:"integer"}}},intendedUse:{type:"object",required:["processData","shareDataWithThirdParty","editData"],properties:{processData:{type:"boolean"},shareDataWithThirdParty:{type:"boolean"},editData:{type:"boolean"}}},licenseGrant:{type:"object",required:["transferable","exclusiveness","paidUp","revocable","processing","modifying","analyzing","storingData","storingCopy","reproducing","distributing","loaning","selling","renting","furtherLicensing","leasing"],properties:{transferable:{type:"boolean"},exclusiveness:{type:"boolean"},paidUp:{type:"boolean"},revocable:{type:"boolean"},processing:{type:"boolean"},modifying:{type:"boolean"},analyzing:{type:"boolean"},storingData:{type:"boolean"},storingCopy:{type:"boolean"},reproducing:{type:"boolean"},distributing:{type:"boolean"},loaning:{type:"boolean"},selling:{type:"boolean"},renting:{type:"boolean"},furtherLicensing:{type:"boolean"},leasing:{type:"boolean"}}},dataStream:{type:"boolean"},personalData:{type:"boolean"},pricingModel:{type:"object",required:["basicPrice","currency","hasFreePrice"],properties:{paymentType:{type:"string"},pricingModelName:{type:"string"},basicPrice:{type:"number",format:"float"},currency:{type:"string"},fee:{type:"number",format:"float"},hasPaymentOnSubscription:{type:"object",properties:{paymentOnSubscriptionName:{type:"string"},paymentType:{type:"string"},timeDuration:{type:"string"},description:{type:"string"},repeat:{type:"string"},hasSubscriptionPrice:{type:"number"}}},hasFreePrice:{type:"object",properties:{hasPriceFree:{type:"boolean"}}}}},dataExchangeAgreement:{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},signatures:{type:"object",required:["providerSignature","consumerSignature"],properties:{providerSignature:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"},consumerSignature:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"}}}}},DataExchange:{allOf:[{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},{type:"object",properties:{cipherblockDgst:{type:"string",description:"hash of the cipherblock in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"},blockCommitment:{type:"string",description:"hash of the plaintext block in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"},secretCommitment:{type:"string",description:"ash of the secret that can be used to decrypt the block in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"}},required:["cipherblockDgst","blockCommitment","secretCommitment"]}]}}},Tp={exports:{}},jp={},Dp={},$p={},Bp={},Fp={},zp={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;class t{}e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class r extends t{constructor(t){if(super(),!e.IDENTIFIER.test(t))throw new Error("CodeGen: name must be a valid identifier");this.str=t}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=r;class n 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,t)=>`${e}${t}`),"")}get names(){var e;return null!==(e=this._names)&&void 0!==e?e:this._names=this._items.reduce(((e,t)=>(t instanceof r&&(e[t.str]=(e[t.str]||0)+1),e)),{})}}function i(e,...t){const r=[e[0]];let i=0;for(;i{if(void 0===r.scopePath)throw new Error(`CodeGen: name "${r}" has no value`);return t._`${e}${r.scopePath}`}))}scopeCode(e=this._values,t,r){return this._reduceValues(e,(e=>{if(void 0===e.value)throw new Error(`CodeGen: name "${e}" has no value`);return e.value.code}),t,r)}_reduceValues(i,o,a={},s){let c=t.nil;for(const u in i){const f=i[u];if(!f)continue;const d=a[u]=a[u]||new Map;f.forEach((i=>{if(d.has(i))return;d.set(i,n.Started);let a=o(i);if(a){const r=this.opts.es5?e.varKinds.var:e.varKinds.const;c=t._`${c}${r} ${i} = ${a};${this.opts._n}`}else{if(!(a=null==s?void 0:s(i)))throw new r(i);c=t._`${c}${a}${this.opts._n}`}d.set(i,n.Completed)}))}return c}}}(Up),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;const t=zp,r=Up;var n=zp;Object.defineProperty(e,"_",{enumerable:!0,get:function(){return n._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return n.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return n.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return n.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return n.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return n.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return n.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return n.Name}});var i=Up;Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return i.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return i.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return i.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return i.varKinds}}),e.operators={GT:new t._Code(">"),GTE:new t._Code(">="),LT:new t._Code("<"),LTE:new t._Code("<="),EQ:new t._Code("==="),NEQ:new t._Code("!=="),NOT:new t._Code("!"),OR:new t._Code("||"),AND:new t._Code("&&"),ADD:new t._Code("+")};class o{optimizeNodes(){return this}optimizeNames(e,t){return this}}class a extends o{constructor(e,t,r){super(),this.varKind=e,this.name=t,this.rhs=r}render({es5:e,_n:t}){const n=e?r.varKinds.var:this.varKind,i=void 0===this.rhs?"":` = ${this.rhs}`;return`${n} ${this.name}${i};`+t}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&(this.rhs=C(this.rhs,e,t)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class s extends o{constructor(e,t,r){super(),this.lhs=e,this.rhs=t,this.sideEffects=r}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof t.Name)||e[this.lhs.str]||this.sideEffects)return this.rhs=C(this.rhs,e,r),this}get names(){return M(this.lhs instanceof t.Name?{}:{...this.lhs.names},this.rhs)}}class c extends s{constructor(e,t,r,n){super(e,r,n),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class u extends o{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class f extends o{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class d extends o{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class l extends o{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=C(this.code,e,t),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class h extends o{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce(((t,r)=>t+r.render(e)),"")}optimizeNodes(){const{nodes:e}=this;let t=e.length;for(;t--;){const r=e[t].optimizeNodes();Array.isArray(r)?e.splice(t,1,...r):r?e[t]=r:e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){const{nodes:r}=this;let n=r.length;for(;n--;){const i=r[n];i.optimizeNames(e,t)||(I(e,i.names),r.splice(n,1))}return r.length>0?this:void 0}get names(){return this.nodes.reduce(((e,t)=>k(e,t.names)),{})}}class p extends h{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class m extends h{}class g extends p{}g.kind="else";class y extends p{constructor(e,t){super(t),this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);return this.else&&(t+="else "+this.else.render(e)),t}optimizeNodes(){super.optimizeNodes();const e=this.condition;if(!0===e)return this.nodes;let t=this.else;if(t){const e=t.optimizeNodes();t=this.else=Array.isArray(e)?new g(e):e}return t?!1===e?t instanceof y?t:t.nodes:this.nodes.length?this:new y(R(e),t instanceof y?[t]:t.nodes):!1!==e&&this.nodes.length?this:void 0}optimizeNames(e,t){var r;if(this.else=null===(r=this.else)||void 0===r?void 0:r.optimizeNames(e,t),super.optimizeNames(e,t)||this.else)return this.condition=C(this.condition,e,t),this}get names(){const e=super.names;return M(e,this.condition),this.else&&k(e,this.else.names),e}}y.kind="if";class b extends p{}b.kind="for";class v extends b{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iteration=C(this.iteration,e,t),this}get names(){return k(super.names,this.iteration.names)}}class w extends b{constructor(e,t,r,n){super(),this.varKind=e,this.name=t,this.from=r,this.to=n}render(e){const t=e.es5?r.varKinds.var:this.varKind,{name:n,from:i,to:o}=this;return`for(${t} ${n}=${i}; ${n}<${o}; ${n}++)`+super.render(e)}get names(){const e=M(super.names,this.from);return M(e,this.to)}}class A extends b{constructor(e,t,r,n){super(),this.loop=e,this.varKind=t,this.name=r,this.iterable=n}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iterable=C(this.iterable,e,t),this}get names(){return k(super.names,this.iterable.names)}}class _ extends p{constructor(e,t,r){super(),this.name=e,this.args=t,this.async=r}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}}_.kind="func";class E extends h{render(e){return"return "+super.render(e)}}E.kind="return";class S extends p{render(e){let t="try"+super.render(e);return this.catch&&(t+=this.catch.render(e)),this.finally&&(t+=this.finally.render(e)),t}optimizeNodes(){var e,t;return super.optimizeNodes(),null===(e=this.catch)||void 0===e||e.optimizeNodes(),null===(t=this.finally)||void 0===t||t.optimizeNodes(),this}optimizeNames(e,t){var r,n;return super.optimizeNames(e,t),null===(r=this.catch)||void 0===r||r.optimizeNames(e,t),null===(n=this.finally)||void 0===n||n.optimizeNames(e,t),this}get names(){const e=super.names;return this.catch&&k(e,this.catch.names),this.finally&&k(e,this.finally.names),e}}class P extends p{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}P.kind="catch";class x extends p{render(e){return"finally"+super.render(e)}}x.kind="finally";function k(e,t){for(const r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function M(e,r){return r instanceof t._CodeOrName?k(e,r.names):e}function C(e,r,n){return e instanceof t.Name?i(e):function(e){return e instanceof t._Code&&e._items.some((e=>e instanceof t.Name&&1===r[e.str]&&void 0!==n[e.str]))}(e)?new t._Code(e._items.reduce(((e,r)=>(r instanceof t.Name&&(r=i(r)),r instanceof t._Code?e.push(...r._items):e.push(r),e)),[])):e;function i(e){const t=n[e.str];return void 0===t||1!==r[e.str]?e:(delete r[e.str],t)}}function I(e,t){for(const r in t)e[r]=(e[r]||0)-(t[r]||0)}function R(e){return"boolean"==typeof e||"number"==typeof e||null===e?!e:t._`!${j(e)}`}e.CodeGen=class{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?"\n":""},this._extScope=e,this._scope=new r.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,t){const r=this._extScope.value(e,t);return(this._values[r.prefix]||(this._values[r.prefix]=new Set)).add(r),r}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,r,n){const i=this._scope.toName(t);return void 0!==r&&n&&(this._constants[i.str]=r),this._leafNode(new a(e,i,r)),i}const(e,t,n){return this._def(r.varKinds.const,e,t,n)}let(e,t,n){return this._def(r.varKinds.let,e,t,n)}var(e,t,n){return this._def(r.varKinds.var,e,t,n)}assign(e,t,r){return this._leafNode(new s(e,t,r))}add(t,r){return this._leafNode(new c(t,e.operators.ADD,r))}code(e){return"function"==typeof e?e():e!==t.nil&&this._leafNode(new l(e)),this}object(...e){const r=["{"];for(const[n,i]of e)r.length>1&&r.push(","),r.push(n),(n!==i||this.opts.es5)&&(r.push(":"),(0,t.addCodeArg)(r,i));return r.push("}"),new t._Code(r)}if(e,t,r){if(this._blockNode(new y(e)),t&&r)this.code(t).else().code(r).endIf();else if(t)this.code(t).endIf();else if(r)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new y(e))}else(){return this._elseNode(new g)}endIf(){return this._endBlockNode(y,g)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new v(e),t)}forRange(e,t,n,i,o=(this.opts.es5?r.varKinds.var:r.varKinds.let)){const a=this._scope.toName(e);return this._for(new w(o,a,t,n),(()=>i(a)))}forOf(e,n,i,o=r.varKinds.const){const a=this._scope.toName(e);if(this.opts.es5){const e=n instanceof t.Name?n:this.var("_arr",n);return this.forRange("_i",0,t._`${e}.length`,(r=>{this.var(a,t._`${e}[${r}]`),i(a)}))}return this._for(new A("of",o,a,n),(()=>i(a)))}forIn(e,n,i,o=(this.opts.es5?r.varKinds.var:r.varKinds.const)){if(this.opts.ownProperties)return this.forOf(e,t._`Object.keys(${n})`,i);const a=this._scope.toName(e);return this._for(new A("in",o,a,n),(()=>i(a)))}endFor(){return this._endBlockNode(b)}label(e){return this._leafNode(new u(e))}break(e){return this._leafNode(new f(e))}return(e){const t=new E;if(this._blockNode(t),this.code(e),1!==t.nodes.length)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(E)}try(e,t,r){if(!t&&!r)throw new Error('CodeGen: "try" without "catch" and "finally"');const n=new S;if(this._blockNode(n),this.code(e),t){const e=this.name("e");this._currNode=n.catch=new P(e),t(e)}return r&&(this._currNode=n.finally=new x,this.code(r)),this._endBlockNode(P,x)}throw(e){return this._leafNode(new d(e))}block(e,t){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(t),this}endBlock(e){const t=this._blockStarts.pop();if(void 0===t)throw new Error("CodeGen: not in self-balancing block");const r=this._nodes.length-t;if(r<0||void 0!==e&&r!==e)throw new Error(`CodeGen: wrong number of nodes: ${r} vs ${e} expected`);return this._nodes.length=t,this}func(e,r=t.nil,n,i){return this._blockNode(new _(e,r,n)),i&&this.code(i).endFunc(),this}endFunc(){return this._endBlockNode(_)}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,t){const r=this._currNode;if(r instanceof e||t&&r instanceof t)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){const t=this._currNode;if(!(t instanceof y))throw new Error('CodeGen: "else" without "if"');return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){const e=this._nodes;return e[e.length-1]}set _currNode(e){const t=this._nodes;t[t.length-1]=e}},e.not=R;const N=T(e.operators.AND);e.and=function(...e){return e.reduce(N)};const O=T(e.operators.OR);function T(e){return(r,n)=>r===t.nil?n:n===t.nil?r:t._`${j(r)} ${e} ${j(n)}`}function j(e){return e instanceof t.Name?e:t._`(${e})`}e.or=function(...e){return e.reduce(O)}}(Fp);var Lp={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.checkStrictMode=e.getErrorPath=e.Type=e.useFunc=e.setEvaluated=e.evaluatedPropsToName=e.mergeEvaluated=e.eachItem=e.unescapeJsonPointer=e.escapeJsonPointer=e.escapeFragment=e.unescapeFragment=e.schemaRefOrVal=e.schemaHasRulesButRef=e.schemaHasRules=e.checkUnknownRules=e.alwaysValidSchema=e.toHash=void 0;const t=Fp,r=zp;function n(e,t=e.schema){const{opts:r,self:n}=e;if(!r.strictSchema)return;if("boolean"==typeof t)return;const i=n.RULES.keywords;for(const r in t)i[r]||l(e,`unknown keyword: "${r}"`)}function i(e,t){if("boolean"==typeof e)return!e;for(const r in e)if(t[r])return!0;return!1}function o(e){return"number"==typeof e?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}function a(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function s({mergeNames:e,mergeToName:r,mergeValues:n,resultToName:i}){return(o,a,s,c)=>{const u=void 0===s?a:s instanceof t.Name?(a instanceof t.Name?e(o,a,s):r(o,a,s),s):a instanceof t.Name?(r(o,s,a),a):n(a,s);return c!==t.Name||u instanceof t.Name?u:i(o,u)}}function c(e,r){if(!0===r)return e.var("props",!0);const n=e.var("props",t._`{}`);return void 0!==r&&u(e,n,r),n}function u(e,r,n){Object.keys(n).forEach((n=>e.assign(t._`${r}${(0,t.getProperty)(n)}`,!0)))}e.toHash=function(e){const t={};for(const r of e)t[r]=!0;return t},e.alwaysValidSchema=function(e,t){return"boolean"==typeof t?t:0===Object.keys(t).length||(n(e,t),!i(t,e.self.RULES.all))},e.checkUnknownRules=n,e.schemaHasRules=i,e.schemaHasRulesButRef=function(e,t){if("boolean"==typeof e)return!e;for(const r in e)if("$ref"!==r&&t.all[r])return!0;return!1},e.schemaRefOrVal=function({topSchemaRef:e,schemaPath:r},n,i,o){if(!o){if("number"==typeof n||"boolean"==typeof n)return n;if("string"==typeof n)return t._`${n}`}return t._`${e}${r}${(0,t.getProperty)(i)}`},e.unescapeFragment=function(e){return a(decodeURIComponent(e))},e.escapeFragment=function(e){return encodeURIComponent(o(e))},e.escapeJsonPointer=o,e.unescapeJsonPointer=a,e.eachItem=function(e,t){if(Array.isArray(e))for(const r of e)t(r);else t(e)},e.mergeEvaluated={props:s({mergeNames:(e,r,n)=>e.if(t._`${n} !== true && ${r} !== undefined`,(()=>{e.if(t._`${r} === true`,(()=>e.assign(n,!0)),(()=>e.assign(n,t._`${n} || {}`).code(t._`Object.assign(${n}, ${r})`)))})),mergeToName:(e,r,n)=>e.if(t._`${n} !== true`,(()=>{!0===r?e.assign(n,!0):(e.assign(n,t._`${n} || {}`),u(e,n,r))})),mergeValues:(e,t)=>!0===e||{...e,...t},resultToName:c}),items:s({mergeNames:(e,r,n)=>e.if(t._`${n} !== true && ${r} !== undefined`,(()=>e.assign(n,t._`${r} === true ? true : ${n} > ${r} ? ${n} : ${r}`))),mergeToName:(e,r,n)=>e.if(t._`${n} !== true`,(()=>e.assign(n,!0===r||t._`${n} > ${r} ? ${n} : ${r}`))),mergeValues:(e,t)=>!0===e||Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})},e.evaluatedPropsToName=c,e.setEvaluated=u;const f={};var d;function l(e,t,r=e.opts.strictSchema){if(r){if(t=`strict mode: ${t}`,!0===r)throw new Error(t);e.self.logger.warn(t)}}e.useFunc=function(e,t){return e.scopeValue("func",{ref:t,code:f[t.code]||(f[t.code]=new r._Code(t.code))})},function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"}(d=e.Type||(e.Type={})),e.getErrorPath=function(e,r,n){if(e instanceof t.Name){const i=r===d.Num;return n?i?t._`"[" + ${e} + "]"`:t._`"['" + ${e} + "']"`:i?t._`"/" + ${e}`:t._`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return n?(0,t.getProperty)(e).toString():"/"+o(e)},e.checkStrictMode=l}(Lp);var qp={};Object.defineProperty(qp,"__esModule",{value:!0});const Hp=Fp,Kp={data:new Hp.Name("data"),valCxt:new Hp.Name("valCxt"),instancePath:new Hp.Name("instancePath"),parentData:new Hp.Name("parentData"),parentDataProperty:new Hp.Name("parentDataProperty"),rootData:new Hp.Name("rootData"),dynamicAnchors:new Hp.Name("dynamicAnchors"),vErrors:new Hp.Name("vErrors"),errors:new Hp.Name("errors"),this:new Hp.Name("this"),self:new Hp.Name("self"),scope:new Hp.Name("scope"),json:new Hp.Name("json"),jsonPos:new Hp.Name("jsonPos"),jsonLen:new Hp.Name("jsonLen"),jsonPart:new Hp.Name("jsonPart")};qp.default=Kp,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;const t=Fp,r=Lp,n=qp;function i(e,r){const i=e.const("err",r);e.if(t._`${n.default.vErrors} === null`,(()=>e.assign(n.default.vErrors,t._`[${i}]`)),t._`${n.default.vErrors}.push(${i})`),e.code(t._`${n.default.errors}++`)}function o(e,r){const{gen:n,validateName:i,schemaEnv:o}=e;o.$async?n.throw(t._`new ${e.ValidationError}(${r})`):(n.assign(t._`${i}.errors`,r),n.return(!1))}e.keywordError={message:({keyword:e})=>t.str`must pass "${e}" keyword validation`},e.keyword$DataError={message:({keyword:e,schemaType:r})=>r?t.str`"${e}" keyword must be ${r} ($data)`:t.str`"${e}" keyword is invalid ($data)`},e.reportError=function(r,n=e.keywordError,a,c){const{it:u}=r,{gen:f,compositeRule:d,allErrors:l}=u,h=s(r,n,a);(null!=c?c:d||l)?i(f,h):o(u,t._`[${h}]`)},e.reportExtraError=function(t,r=e.keywordError,a){const{it:c}=t,{gen:u,compositeRule:f,allErrors:d}=c;i(u,s(t,r,a)),f||d||o(c,n.default.vErrors)},e.resetErrorsCount=function(e,r){e.assign(n.default.errors,r),e.if(t._`${n.default.vErrors} !== null`,(()=>e.if(r,(()=>e.assign(t._`${n.default.vErrors}.length`,r)),(()=>e.assign(n.default.vErrors,null)))))},e.extendErrors=function({gen:e,keyword:r,schemaValue:i,data:o,errsCount:a,it:s}){if(void 0===a)throw new Error("ajv implementation error");const c=e.name("err");e.forRange("i",a,n.default.errors,(a=>{e.const(c,t._`${n.default.vErrors}[${a}]`),e.if(t._`${c}.instancePath === undefined`,(()=>e.assign(t._`${c}.instancePath`,(0,t.strConcat)(n.default.instancePath,s.errorPath)))),e.assign(t._`${c}.schemaPath`,t.str`${s.errSchemaPath}/${r}`),s.opts.verbose&&(e.assign(t._`${c}.schema`,i),e.assign(t._`${c}.data`,o))}))};const a={keyword:new t.Name("keyword"),schemaPath:new t.Name("schemaPath"),params:new t.Name("params"),propertyName:new t.Name("propertyName"),message:new t.Name("message"),schema:new t.Name("schema"),parentSchema:new t.Name("parentSchema")};function s(e,r,i){const{createErrors:o}=e.it;return!1===o?t._`{}`:function(e,r,i={}){const{gen:o,it:s}=e,f=[c(s,i),u(e,i)];return function(e,{params:r,message:i},o){const{keyword:s,data:c,schemaValue:u,it:f}=e,{opts:d,propertyName:l,topSchemaRef:h,schemaPath:p}=f;o.push([a.keyword,s],[a.params,"function"==typeof r?r(e):r||t._`{}`]),d.messages&&o.push([a.message,"function"==typeof i?i(e):i]);d.verbose&&o.push([a.schema,u],[a.parentSchema,t._`${h}${p}`],[n.default.data,c]);l&&o.push([a.propertyName,l])}(e,r,f),o.object(...f)}(e,r,i)}function c({errorPath:e},{instancePath:i}){const o=i?t.str`${e}${(0,r.getErrorPath)(i,r.Type.Str)}`:e;return[n.default.instancePath,(0,t.strConcat)(n.default.instancePath,o)]}function u({keyword:e,it:{errSchemaPath:n}},{schemaPath:i,parentSchema:o}){let s=o?n:t.str`${n}/${e}`;return i&&(s=t.str`${s}${(0,r.getErrorPath)(i,r.Type.Str)}`),[a.schemaPath,s]}}(Bp),Object.defineProperty($p,"__esModule",{value:!0}),$p.boolOrEmptySchema=$p.topBoolOrEmptySchema=void 0;const Jp=Bp,Wp=Fp,Gp=qp,Vp={message:"boolean schema is false"};function Zp(e,t){const{gen:r,data:n}=e,i={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,Jp.reportError)(i,Vp,void 0,t)}$p.topBoolOrEmptySchema=function(e){const{gen:t,schema:r,validateName:n}=e;!1===r?Zp(e,!1):"object"==typeof r&&!0===r.$async?t.return(Gp.default.data):(t.assign(Wp._`${n}.errors`,null),t.return(!0))},$p.boolOrEmptySchema=function(e,t){const{gen:r,schema:n}=e;!1===n?(r.var(t,!1),Zp(e)):r.var(t,!0)};var Xp={},Qp={};Object.defineProperty(Qp,"__esModule",{value:!0}),Qp.getRules=Qp.isJSONType=void 0;const Yp=new Set(["string","number","integer","boolean","null","object","array"]);Qp.isJSONType=function(e){return"string"==typeof e&&Yp.has(e)},Qp.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:{}}};var em={};function tm(e,t){return t.rules.some((t=>rm(e,t)))}function rm(e,t){var r;return void 0!==e[t.keyword]||(null===(r=t.definition.implements)||void 0===r?void 0:r.some((t=>void 0!==e[t])))}Object.defineProperty(em,"__esModule",{value:!0}),em.shouldUseRule=em.shouldUseGroup=em.schemaHasRulesForType=void 0,em.schemaHasRulesForType=function({schema:e,self:t},r){const n=t.RULES.types[r];return n&&!0!==n&&tm(e,n)},em.shouldUseGroup=tm,em.shouldUseRule=rm,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.reportTypeError=e.checkDataTypes=e.checkDataType=e.coerceAndCheckDataType=e.getJSONTypes=e.getSchemaTypes=e.DataType=void 0;const t=Qp,r=em,n=Bp,i=Fp,o=Lp;var a;function s(e){const r=Array.isArray(e)?e:e?[e]:[];if(r.every(t.isJSONType))return r;throw new Error("type must be JSONType or JSONType[]: "+r.join(","))}!function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"}(a=e.DataType||(e.DataType={})),e.getSchemaTypes=function(e){const t=s(e.type);if(t.includes("null")){if(!1===e.nullable)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&void 0!==e.nullable)throw new Error('"nullable" cannot be used without "type"');!0===e.nullable&&t.push("null")}return t},e.getJSONTypes=s,e.coerceAndCheckDataType=function(e,t){const{gen:n,data:o,opts:s}=e,u=function(e,t){return t?e.filter((e=>c.has(e)||"array"===t&&"array"===e)):[]}(t,s.coerceTypes),d=t.length>0&&!(0===u.length&&1===t.length&&(0,r.schemaHasRulesForType)(e,t[0]));if(d){const r=f(t,o,s.strictNumbers,a.Wrong);n.if(r,(()=>{u.length?function(e,t,r){const{gen:n,data:o,opts:a}=e,s=n.let("dataType",i._`typeof ${o}`),u=n.let("coerced",i._`undefined`);"array"===a.coerceTypes&&n.if(i._`${s} == 'object' && Array.isArray(${o}) && ${o}.length == 1`,(()=>n.assign(o,i._`${o}[0]`).assign(s,i._`typeof ${o}`).if(f(t,o,a.strictNumbers),(()=>n.assign(u,o)))));n.if(i._`${u} !== undefined`);for(const e of r)(c.has(e)||"array"===e&&"array"===a.coerceTypes)&&d(e);function d(e){switch(e){case"string":return void n.elseIf(i._`${s} == "number" || ${s} == "boolean"`).assign(u,i._`"" + ${o}`).elseIf(i._`${o} === null`).assign(u,i._`""`);case"number":return void n.elseIf(i._`${s} == "boolean" || ${o} === null + * [js-sha3]{@link https://github.com/emn178/js-sha3} + * + * @version 0.8.0 + * @author Chen, Yi-Cyuan [emn178@gmail.com] + * @copyright Chen, Yi-Cyuan 2015-2018 + * @license MIT + */!function(e){!function(){var t="input is invalid type",r="object"==typeof window,n=r?window:{};n.JS_SHA3_NO_WINDOW&&(r=!1);var i=!r&&"object"==typeof self;!n.JS_SHA3_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node?n=u:i&&(n=self);var o=!n.JS_SHA3_NO_COMMON_JS&&e.exports,a=!n.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,s="0123456789abcdef".split(""),c=[4,1024,262144,67108864],f=[0,8,16,24],d=[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],l=[224,256,384,512],h=[128,256],p=["hex","buffer","arrayBuffer","array","digest"],m={128:168,256:136};!n.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!a||!n.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 g=function(e,t,r){return function(n){return new R(e,t,e).update(n)[r]()}},y=function(e,t,r){return function(n,i){return new R(e,t,i).update(n)[r]()}},b=function(e,t,r){return function(t,n,i,o){return E["cshake"+e].update(t,n,i,o)[r]()}},v=function(e,t,r){return function(t,n,i,o){return E["kmac"+e].update(t,n,i,o)[r]()}},w=function(e,t,r,n){for(var i=0;i>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var n=0;n<50;++n)this.s[n]=0}function N(e,t,r){R.call(this,e,t,r)}R.prototype.update=function(e){if(this.finalized)throw new Error("finalize already called");var r,n=typeof e;if("string"!==n){if("object"!==n)throw new Error(t);if(null===e)throw new Error(t);if(a&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||a&&ArrayBuffer.isView(e)))throw new Error(t);r=!0}for(var i,o,s=this.blocks,c=this.byteCount,u=e.length,d=this.blockCount,l=0,h=this.s;l>2]|=e[l]<>2]|=o<>2]|=(192|o>>6)<>2]|=(128|63&o)<=57344?(s[i>>2]|=(224|o>>12)<>2]|=(128|o>>6&63)<>2]|=(128|63&o)<>2]|=(240|o>>18)<>2]|=(128|o>>12&63)<>2]|=(128|o>>6&63)<>2]|=(128|63&o)<=c){for(this.start=i-c,this.block=s[d],i=0;i>=8);r>0;)i.unshift(r),r=255&(e>>=8),++n;return t?i.push(n):i.unshift(n),this.update(i),i.length},R.prototype.encodeString=function(e){var r,n=typeof e;if("string"!==n){if("object"!==n)throw new Error(t);if(null===e)throw new Error(t);if(a&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||a&&ArrayBuffer.isView(e)))throw new Error(t);r=!0}var i=0,o=e.length;if(r)i=o;else for(var s=0;s=57344?i+=3:(c=65536+((1023&c)<<10|1023&e.charCodeAt(++s)),i+=4)}return i+=this.encode(8*i),this.update(e),i},R.prototype.bytepad=function(e,t){for(var r=this.encode(t),n=0;n>2]|=this.padding[3&t],this.lastByteIndex===this.byteCount)for(e[0]=e[r],t=1;t>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];a%t==0&&(O(r),o=0)}return i&&(e=r[o],c+=s[e>>4&15]+s[15&e],i>1&&(c+=s[e>>12&15]+s[e>>8&15]),i>2&&(c+=s[e>>20&15]+s[e>>16&15])),c},R.prototype.arrayBuffer=function(){this.finalize();var e,t=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,a=0,s=this.outputBits>>3;e=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(s);for(var c=new Uint32Array(e);a>8&255,c[e+2]=t>>16&255,c[e+3]=t>>24&255;s%r==0&&O(n)}return o&&(e=s<<2,t=n[a],c[e]=255&t,o>1&&(c[e+1]=t>>8&255),o>2&&(c[e+2]=t>>16&255)),c},N.prototype=new R,N.prototype.finalize=function(){return this.encode(this.outputBits,!0),R.prototype.finalize.call(this)};var O=function(e){var t,r,n,i,o,a,s,c,u,f,l,h,p,m,g,y,b,v,w,A,_,E,S,P,x,k,M,C,I,R,N,O,T,j,D,$,B,F,z,U,L,q,H,K,J,W,G,V,Z,X,Q,Y,ee,te,re,ne,ie,oe,ae,se,ce,ue,fe;for(n=0;n<48;n+=2)i=e[0]^e[10]^e[20]^e[30]^e[40],o=e[1]^e[11]^e[21]^e[31]^e[41],a=e[2]^e[12]^e[22]^e[32]^e[42],s=e[3]^e[13]^e[23]^e[33]^e[43],c=e[4]^e[14]^e[24]^e[34]^e[44],u=e[5]^e[15]^e[25]^e[35]^e[45],f=e[6]^e[16]^e[26]^e[36]^e[46],l=e[7]^e[17]^e[27]^e[37]^e[47],t=(h=e[8]^e[18]^e[28]^e[38]^e[48])^(a<<1|s>>>31),r=(p=e[9]^e[19]^e[29]^e[39]^e[49])^(s<<1|a>>>31),e[0]^=t,e[1]^=r,e[10]^=t,e[11]^=r,e[20]^=t,e[21]^=r,e[30]^=t,e[31]^=r,e[40]^=t,e[41]^=r,t=i^(c<<1|u>>>31),r=o^(u<<1|c>>>31),e[2]^=t,e[3]^=r,e[12]^=t,e[13]^=r,e[22]^=t,e[23]^=r,e[32]^=t,e[33]^=r,e[42]^=t,e[43]^=r,t=a^(f<<1|l>>>31),r=s^(l<<1|f>>>31),e[4]^=t,e[5]^=r,e[14]^=t,e[15]^=r,e[24]^=t,e[25]^=r,e[34]^=t,e[35]^=r,e[44]^=t,e[45]^=r,t=c^(h<<1|p>>>31),r=u^(p<<1|h>>>31),e[6]^=t,e[7]^=r,e[16]^=t,e[17]^=r,e[26]^=t,e[27]^=r,e[36]^=t,e[37]^=r,e[46]^=t,e[47]^=r,t=f^(i<<1|o>>>31),r=l^(o<<1|i>>>31),e[8]^=t,e[9]^=r,e[18]^=t,e[19]^=r,e[28]^=t,e[29]^=r,e[38]^=t,e[39]^=r,e[48]^=t,e[49]^=r,m=e[0],g=e[1],W=e[11]<<4|e[10]>>>28,G=e[10]<<4|e[11]>>>28,C=e[20]<<3|e[21]>>>29,I=e[21]<<3|e[20]>>>29,se=e[31]<<9|e[30]>>>23,ce=e[30]<<9|e[31]>>>23,q=e[40]<<18|e[41]>>>14,H=e[41]<<18|e[40]>>>14,j=e[2]<<1|e[3]>>>31,D=e[3]<<1|e[2]>>>31,y=e[13]<<12|e[12]>>>20,b=e[12]<<12|e[13]>>>20,V=e[22]<<10|e[23]>>>22,Z=e[23]<<10|e[22]>>>22,R=e[33]<<13|e[32]>>>19,N=e[32]<<13|e[33]>>>19,ue=e[42]<<2|e[43]>>>30,fe=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,re=e[4]<<30|e[5]>>>2,$=e[14]<<6|e[15]>>>26,B=e[15]<<6|e[14]>>>26,v=e[25]<<11|e[24]>>>21,w=e[24]<<11|e[25]>>>21,X=e[34]<<15|e[35]>>>17,Q=e[35]<<15|e[34]>>>17,O=e[45]<<29|e[44]>>>3,T=e[44]<<29|e[45]>>>3,P=e[6]<<28|e[7]>>>4,x=e[7]<<28|e[6]>>>4,ne=e[17]<<23|e[16]>>>9,ie=e[16]<<23|e[17]>>>9,F=e[26]<<25|e[27]>>>7,z=e[27]<<25|e[26]>>>7,A=e[36]<<21|e[37]>>>11,_=e[37]<<21|e[36]>>>11,Y=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,K=e[8]<<27|e[9]>>>5,J=e[9]<<27|e[8]>>>5,k=e[18]<<20|e[19]>>>12,M=e[19]<<20|e[18]>>>12,oe=e[29]<<7|e[28]>>>25,ae=e[28]<<7|e[29]>>>25,U=e[38]<<8|e[39]>>>24,L=e[39]<<8|e[38]>>>24,E=e[48]<<14|e[49]>>>18,S=e[49]<<14|e[48]>>>18,e[0]=m^~y&v,e[1]=g^~b&w,e[10]=P^~k&C,e[11]=x^~M&I,e[20]=j^~$&F,e[21]=D^~B&z,e[30]=K^~W&V,e[31]=J^~G&Z,e[40]=te^~ne&oe,e[41]=re^~ie&ae,e[2]=y^~v&A,e[3]=b^~w&_,e[12]=k^~C&R,e[13]=M^~I&N,e[22]=$^~F&U,e[23]=B^~z&L,e[32]=W^~V&X,e[33]=G^~Z&Q,e[42]=ne^~oe&se,e[43]=ie^~ae&ce,e[4]=v^~A&E,e[5]=w^~_&S,e[14]=C^~R&O,e[15]=I^~N&T,e[24]=F^~U&q,e[25]=z^~L&H,e[34]=V^~X&Y,e[35]=Z^~Q&ee,e[44]=oe^~se&ue,e[45]=ae^~ce&fe,e[6]=A^~E&m,e[7]=_^~S&g,e[16]=R^~O&P,e[17]=N^~T&x,e[26]=U^~q&j,e[27]=L^~H&D,e[36]=X^~Y&K,e[37]=Q^~ee&J,e[46]=se^~ue&te,e[47]=ce^~fe&re,e[8]=E^~m&y,e[9]=S^~g&b,e[18]=O^~P&k,e[19]=T^~x&M,e[28]=q^~j&$,e[29]=H^~D&B,e[38]=Y^~K&W,e[39]=ee^~J&G,e[48]=ue^~te&ne,e[49]=fe^~re&ie,e[0]^=d[n],e[1]^=d[n+1]};if(o)e.exports=E;else for(P=0;P>=8;return t}function cs(e,t,r){let n=0;for(let i=0;it+1+n&&as.throwError("child data too short",wo.errors.BUFFER_OVERRUN,{})}return{consumed:1+n,result:i}}function ls(e,t){if(0===e.length&&as.throwError("data too short",wo.errors.BUFFER_OVERRUN,{}),e[t]>=248){const r=e[t]-247;t+1+r>e.length&&as.throwError("data short segment too short",wo.errors.BUFFER_OVERRUN,{});const n=cs(e,t+1,r);return t+1+r+n>e.length&&as.throwError("data long segment too short",wo.errors.BUFFER_OVERRUN,{}),ds(e,t,t+1+r,r+n)}if(e[t]>=192){const r=e[t]-192;return t+1+r>e.length&&as.throwError("data array too short",wo.errors.BUFFER_OVERRUN,{}),ds(e,t,t+1,r)}if(e[t]>=184){const r=e[t]-183;t+1+r>e.length&&as.throwError("data array too short",wo.errors.BUFFER_OVERRUN,{});const n=cs(e,t+1,r);t+1+r+n>e.length&&as.throwError("data array too short",wo.errors.BUFFER_OVERRUN,{});return{consumed:1+r+n,result:To(e.slice(t+1+r,t+1+r+n))}}if(e[t]>=128){const r=e[t]-128;t+1+r>e.length&&as.throwError("data too short",wo.errors.BUFFER_OVERRUN,{});return{consumed:1+r,result:To(e.slice(t+1,t+1+r))}}return{consumed:1,result:To(e[t])}}function hs(e){const t=Mo(e),r=ls(t,0);return r.consumed!==t.length&&as.throwArgumentError("invalid rlp data","data",e),r.result}var ps=Object.freeze({__proto__:null,decode:hs,encode:fs});const ms=new wo("address/5.7.0");function gs(e){No(e,20)||ms.throwArgumentError("invalid address","address",e);const t=(e=e.toLowerCase()).substring(2).split(""),r=new Uint8Array(40);for(let e=0;e<40;e++)r[e]=t[e].charCodeAt(0);const n=Mo(is(r));for(let e=0;e<40;e+=2)n[e>>1]>>4>=8&&(t[e]=t[e].toUpperCase()),(15&n[e>>1])>=8&&(t[e+1]=t[e+1].toUpperCase());return"0x"+t.join("")}const ys={};for(let e=0;e<10;e++)ys[String(e)]=String(e);for(let e=0;e<26;e++)ys[String.fromCharCode(65+e)]=String(10+e);const bs=Math.floor(function(e){return Math.log10?Math.log10(e):Math.log(e)/Math.LN10}(9007199254740991));function vs(e){let t=(e=(e=e.toUpperCase()).substring(4)+e.substring(0,2)+"00").split("").map((e=>ys[e])).join("");for(;t.length>=bs;){let e=t.substring(0,bs);t=parseInt(e,10)%97+t.substring(e.length)}let r=String(98-parseInt(t,10)%97);for(;r.length<2;)r="0"+r;return r}function ws(e){let t=null;if("string"!=typeof e&&ms.throwArgumentError("invalid address","address",e),e.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==e.substring(0,2)&&(e="0x"+e),t=gs(e),e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==e&&ms.throwArgumentError("bad address checksum","address",e);else if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(e.substring(2,4)!==vs(e)&&ms.throwArgumentError("bad icap checksum","address",e),r=e.substring(4),t=new Ko(r,36).toString(16);t.length<40;)t="0"+t;t=gs("0x"+t)}else ms.throwArgumentError("invalid address","address",e);var r;return t}function As(e){let t=null;try{t=ws(e.from)}catch(t){ms.throwArgumentError("missing from address","transaction",e)}return ws(Do(is(fs([t,Io(Mo(Zo.from(e.nonce).toHexString()))])),12))}var _s=Object.freeze({__proto__:null,getAddress:ws,getContractAddress:As,getCreate2Address:function(e,t,r){return 32!==jo(t)&&ms.throwArgumentError("salt must be 32 bytes","salt",t),32!==jo(r)&&ms.throwArgumentError("initCodeHash must be 32 bytes","initCodeHash",r),ws(Do(is(Co(["0xff",ws(e),t,r])),12))},getIcapAddress:function(e){let t=(r=ws(e).substring(2),new Ko(r,16).toString(36)).toUpperCase();for(var r;t.length<30;)t="0"+t;return"XE"+vs("XE00"+t)+t},isAddress:function(e){try{return ws(e),!0}catch(e){}return!1}});class Es extends Ya{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,t){try{t=ws(t)}catch(e){this._throwError(e.message,t)}return e.writeValue(t)}decode(e){return ws(zo(e.readValue().toHexString(),20))}}class Ss extends Ya{constructor(e){super(e.name,e.type,void 0,e.dynamic),this.coder=e}defaultValue(){return this.coder.defaultValue()}encode(e,t){return this.coder.encode(e,t)}decode(e){return this.coder.decode(e)}}const Ps=new wo(ka);function xs(e,t,r){let n=null;if(Array.isArray(r))n=r;else if(r&&"object"==typeof r){let e={};n=t.map((t=>{const n=t.localName;return n||Ps.throwError("cannot encode object for signature with missing names",wo.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:r}),e[n]&&Ps.throwError("cannot encode object for signature with duplicate names",wo.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:r}),e[n]=!0,r[n]}))}else Ps.throwArgumentError("invalid tuple value","tuple",r);t.length!==n.length&&Ps.throwArgumentError("types/value length mismatch","tuple",r);let i=new es(e.wordSize),o=new es(e.wordSize),a=[];t.forEach(((e,t)=>{let r=n[t];if(e.dynamic){let t=o.length;e.encode(o,r);let n=i.writeUpdatableValue();a.push((e=>{n(e+t)}))}else e.encode(i,r)})),a.forEach((e=>{e(i.length)}));let s=e.appendWriter(i);return s+=e.appendWriter(o),s}function ks(e,t){let r=[],n=e.subReader(0);t.forEach((t=>{let i=null;if(t.dynamic){let r=e.readValue(),o=n.subReader(r.toNumber());try{i=t.decode(o)}catch(e){if(e.code===wo.errors.BUFFER_OVERRUN)throw e;i=e,i.baseType=t.name,i.name=t.localName,i.type=t.type}}else try{i=t.decode(e)}catch(e){if(e.code===wo.errors.BUFFER_OVERRUN)throw e;i=e,i.baseType=t.name,i.name=t.localName,i.type=t.type}null!=i&&r.push(i)}));const i=t.reduce(((e,t)=>{const r=t.localName;return r&&(e[r]||(e[r]=0),e[r]++),e}),{});t.forEach(((e,t)=>{let n=e.localName;if(!n||1!==i[n])return;if("length"===n&&(n="_length"),null!=r[n])return;const o=r[t];o instanceof Error?Object.defineProperty(r,n,{enumerable:!0,get:()=>{throw o}}):r[n]=o}));for(let e=0;e{throw t}})}return Object.freeze(r)}class Ms extends Ya{constructor(e,t,r){super("array",e.type+"["+(t>=0?t:"")+"]",r,-1===t||e.dynamic),this.coder=e,this.length=t}defaultValue(){const e=this.coder.defaultValue(),t=[];for(let r=0;re._data.length&&Ps.throwError("insufficient data length",wo.errors.BUFFER_OVERRUN,{length:e._data.length,count:t}));let r=[];for(let e=0;e>6==2;n++)e++;return e}return e===Ls.OVERRUN?r.length-t-1:0}!function(e){e.current="",e.NFC="NFC",e.NFD="NFD",e.NFKC="NFKC",e.NFKD="NFKD"}(Us||(Us={})),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"}(Ls||(Ls={}));const Hs=Object.freeze({error:function(e,t,r,n,i){return zs.throwArgumentError(`invalid codepoint at offset ${t}; ${e}`,"bytes",r)},ignore:qs,replace:function(e,t,r,n,i){return e===Ls.OVERLONG?(n.push(i),0):(n.push(65533),qs(e,t,r))}});function Ks(e,t){null==t&&(t=Hs.error),e=Mo(e);const r=[];let n=0;for(;n>7==0){r.push(i);continue}let o=null,a=null;if(192==(224&i))o=1,a=127;else if(224==(240&i))o=2,a=2047;else{if(240!=(248&i)){n+=t(128==(192&i)?Ls.UNEXPECTED_CONTINUE:Ls.BAD_PREFIX,n-1,e,r);continue}o=3,a=65535}if(n-1+o>=e.length){n+=t(Ls.OVERRUN,n-1,e,r);continue}let s=i&(1<<8-o-1)-1;for(let i=0;i1114111?n+=t(Ls.OUT_OF_RANGE,n-1-o,e,r,s):s>=55296&&s<=57343?n+=t(Ls.UTF16_SURROGATE,n-1-o,e,r,s):s<=a?n+=t(Ls.OVERLONG,n-1-o,e,r,s):r.push(s))}return r}function Js(e,t=Us.current){t!=Us.current&&(zs.checkNormalize(),e=e.normalize(t));let r=[];for(let t=0;t>6|192),r.push(63&n|128);else if(55296==(64512&n)){t++;const i=e.charCodeAt(t);if(t>=e.length||56320!=(64512&i))throw new Error("invalid utf-8 string");const o=65536+((1023&n)<<10)+(1023&i);r.push(o>>18|240),r.push(o>>12&63|128),r.push(o>>6&63|128),r.push(63&o|128)}else r.push(n>>12|224),r.push(n>>6&63|128),r.push(63&n|128)}return Mo(r)}function Ws(e){const t="0000"+e.toString(16);return"\\u"+t.substring(t.length-4)}function Gs(e){return e.map((e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10&1023),56320+(1023&e))))).join("")}function Vs(e,t){return Gs(Ks(e,t))}function Zs(e,t=Us.current){return Ks(Js(e,t))}function Xs(e,t){t||(t=function(e){return[parseInt(e,16)]});let r=0,n={};return e.split(",").forEach((e=>{let i=e.split(":");r+=parseInt(i[0],16),n[r]=t(i[1])})),n}function Qs(e){let t=0;return e.split(",").map((e=>{let r=e.split("-");1===r.length?r[1]="0":""===r[1]&&(r[1]="1");let n=t+parseInt(r[0],16);return t=parseInt(r[1],16),{l:n,h:t}}))}function Ys(e,t){let r=0;for(let n=0;n=r&&e<=r+i.h&&(e-r)%(i.d||1)==0){if(i.e&&-1!==i.e.indexOf(e-r))continue;return i}}return null}const ec=Qs("221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d"),tc="ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map((e=>parseInt(e,16))),rc=[{h:25,s:32,l:65},{h:30,s:32,e:[23],l:127},{h:54,s:1,e:[48],l:64,d:2},{h:14,s:1,l:57,d:2},{h:44,s:1,l:17,d:2},{h:10,s:1,e:[2,6,8],l:61,d:2},{h:16,s:1,l:68,d:2},{h:84,s:1,e:[18,24,66],l:19,d:2},{h:26,s:32,e:[17],l:435},{h:22,s:1,l:71,d:2},{h:15,s:80,l:40},{h:31,s:32,l:16},{h:32,s:1,l:80,d:2},{h:52,s:1,l:42,d:2},{h:12,s:1,l:55,d:2},{h:40,s:1,e:[38],l:15,d:2},{h:14,s:1,l:48,d:2},{h:37,s:48,l:49},{h:148,s:1,l:6351,d:2},{h:88,s:1,l:160,d:2},{h:15,s:16,l:704},{h:25,s:26,l:854},{h:25,s:32,l:55915},{h:37,s:40,l:1247},{h:25,s:-119711,l:53248},{h:25,s:-119763,l:52},{h:25,s:-119815,l:52},{h:25,s:-119867,e:[1,4,5,7,8,11,12,17],l:52},{h:25,s:-119919,l:52},{h:24,s:-119971,e:[2,7,8,17],l:52},{h:24,s:-120023,e:[2,7,13,15,16,17],l:52},{h:25,s:-120075,l:52},{h:25,s:-120127,l:52},{h:25,s:-120179,l:52},{h:25,s:-120231,l:52},{h:25,s:-120283,l:52},{h:25,s:-120335,l:52},{h:24,s:-119543,e:[17],l:56},{h:24,s:-119601,e:[17],l:58},{h:24,s:-119659,e:[17],l:58},{h:24,s:-119717,e:[17],l:58},{h:24,s:-119775,e:[17],l:58}],nc=Xs("b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3"),ic=Xs("179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7"),oc=Xs("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D",(function(e){if(e.length%4!=0)throw new Error("bad data");let t=[];for(let r=0;r{if(e<256){switch(e){case 8:return"\\b";case 9:return"\\t";case 10:return"\\n";case 13:return"\\r";case 34:return'\\"';case 92:return"\\\\"}if(e>=32&&e<127)return String.fromCharCode(e)}return e<=65535?Ws(e):Ws(55296+((e-=65536)>>10&1023))+Ws(56320+(1023&e))})).join("")+'"'},formatBytes32String:function(e){const t=Js(e);if(t.length>31)throw new Error("bytes32 string must be less than 32 bytes");return To(Co([t,Bs]).slice(0,32))},nameprep:function(e){if(e.match(/^[a-z0-9-]*$/i)&&e.length<=59)return e.toLowerCase();let t=Zs(e);var r;r=t.map((e=>{if(tc.indexOf(e)>=0)return[];if(e>=65024&&e<=65039)return[];let t=function(e){let t=Ys(e,rc);if(t)return[e+t.s];let r=nc[e];if(r)return r;let n=ic[e];return n?[e+n[0]]:oc[e]||null}(e);return t||[e]})),t=r.reduce(((e,t)=>(t.forEach((t=>{e.push(t)})),e)),[]),t=Zs(Gs(t),Us.NFKC),t.forEach((e=>{if(Ys(e,ac))throw new Error("STRINGPREP_CONTAINS_PROHIBITED")})),t.forEach((e=>{if(Ys(e,ec))throw new Error("STRINGPREP_CONTAINS_UNASSIGNED")}));let n=Gs(t);if("-"===n.substring(0,1)||"--"===n.substring(2,4)||"-"===n.substring(n.length-1))throw new Error("invalid hyphen");return n},parseBytes32String:function(e){const t=Mo(e);if(32!==t.length)throw new Error("invalid bytes32 - not 32 bytes long");if(0!==t[31])throw new Error("invalid bytes32 string - no null terminator");let r=31;for(;0===t[r-1];)r--;return Vs(t.slice(0,r))},toUtf8Bytes:Js,toUtf8CodePoints:Zs,toUtf8String:Vs});class cc extends Is{constructor(e){super("string",e)}defaultValue(){return""}encode(e,t){return super.encode(e,Js(t))}decode(e){return Vs(super.decode(e))}}class uc extends Ya{constructor(e,t){let r=!1;const n=[];e.forEach((e=>{e.dynamic&&(r=!0),n.push(e.type)}));super("tuple","tuple("+n.join(",")+")",t,r),this.coders=e}defaultValue(){const e=[];this.coders.forEach((t=>{e.push(t.defaultValue())}));const t=this.coders.reduce(((e,t)=>{const r=t.localName;return r&&(e[r]||(e[r]=0),e[r]++),e}),{});return this.coders.forEach(((r,n)=>{let i=r.localName;i&&1===t[i]&&("length"===i&&(i="_length"),null==e[i]&&(e[i]=e[n]))})),Object.freeze(e)}encode(e,t){return xs(e,this.coders,t)}decode(e){return e.coerce(this.name,ks(e,this.coders))}}const fc=new wo(ka),dc=new RegExp(/^bytes([0-9]*)$/),lc=new RegExp(/^(u?int)([0-9]*)$/);class hc{constructor(e){ga(this,"coerceFunc",e||null)}_getCoder(e){switch(e.baseType){case"address":return new Es(e.name);case"bool":return new Cs(e.name);case"string":return new cc(e.name);case"bytes":return new Rs(e.name);case"array":return new Ms(this._getCoder(e.arrayChildren),e.arrayLength,e.name);case"tuple":return new uc((e.components||[]).map((e=>this._getCoder(e))),e.name);case"":return new Os(e.name)}let t=e.type.match(lc);if(t){let r=parseInt(t[2]||"256");return(0===r||r>256||r%8!=0)&&fc.throwArgumentError("invalid "+t[1]+" bit length","param",e),new Fs(r/8,"int"===t[1],e.name)}if(t=e.type.match(dc),t){let r=parseInt(t[1]);return(0===r||r>32)&&fc.throwArgumentError("invalid bytes length","param",e),new Ns(r,e.name)}return fc.throwArgumentError("invalid type","type",e.type)}_getWordSize(){return 32}_getReader(e,t){return new ts(e,this._getWordSize(),this.coerceFunc,t)}_getWriter(){return new es(this._getWordSize())}getDefaultValue(e){const t=e.map((e=>this._getCoder(Da.from(e))));return new uc(t,"_").defaultValue()}encode(e,t){e.length!==t.length&&fc.throwError("types/values length mismatch",wo.errors.INVALID_ARGUMENT,{count:{types:e.length,values:t.length},value:{types:e,values:t}});const r=e.map((e=>this._getCoder(Da.from(e)))),n=new uc(r,"_"),i=this._getWriter();return n.encode(i,t),i.data}decode(e,t,r){const n=e.map((e=>this._getCoder(Da.from(e))));return new uc(n,"_").decode(this._getReader(Mo(t),r))}}const pc=new hc;function mc(e){return is(Js(e))}const gc="hash/5.7.0";function yc(e){e=atob(e);const t=[];for(let r=0;r0&&Array.isArray(e)?i(e,t-1):r.push(e)}))};return i(e,t),r}function Ac(e){return function(e){let t=0;return()=>e[t++]}(function(e){let t=0;function r(){return e[t++]<<8|e[t++]}let n=r(),i=1,o=[0,1];for(let e=1;e>--c&1}const d=Math.pow(2,31),l=d>>>1,h=l>>1,p=d-1;let m=0;for(let e=0;e<31;e++)m=m<<1|f();let g=[],y=0,b=d;for(;;){let e=Math.floor(((m-y+1)*i-1)/b),t=0,r=n;for(;r-t>1;){let n=t+r>>>1;e>>1|f(),a=a<<1^l,s=(s^l)<<1|l|1;y=a,b=1+s-a}let v=n-4;return g.map((t=>{switch(t-v){case 3:return v+65792+(e[s++]<<16|e[s++]<<8|e[s++]);case 2:return v+256+(e[s++]<<8|e[s++]);case 1:return v+e[s++];default:return t-1}}))}(e))}function _c(e){return 1&e?~e>>1:e>>1}function Ec(e,t){let r=Array(e);for(let n=0,i=-1;nt[e])):r}function xc(e,t,r){let n=Array(e).fill(void 0).map((()=>[]));for(let i=0;in[t].push(e)));return n}function kc(e,t){let r=1+t(),n=t(),i=function(e){let t=[];for(;;){let r=e();if(0==r)break;t.push(r)}return t}(t);return wc(xc(i.length,1+e,t).map(((e,t)=>{const o=e[0],a=e.slice(1);return Array(i[t]).fill(void 0).map(((e,t)=>{let i=t*n;return[o+t*r,a.map((e=>e+i))]}))})))}function Mc(e,t){return xc(1+t(),1+e,t).map((e=>[e[0],e.slice(1)]))}const Cc=Ac(yc("AEQF2AO2DEsA2wIrAGsBRABxAN8AZwCcAEwAqgA0AGwAUgByADcATAAVAFYAIQAyACEAKAAYAFgAGwAjABQAMAAmADIAFAAfABQAKwATACoADgAbAA8AHQAYABoAGQAxADgALAAoADwAEwA9ABMAGgARAA4ADwAWABMAFgAIAA8AHgQXBYMA5BHJAS8JtAYoAe4AExozi0UAH21tAaMnBT8CrnIyhrMDhRgDygIBUAEHcoFHUPe8AXBjAewCjgDQR8IICIcEcQLwATXCDgzvHwBmBoHNAqsBdBcUAykgDhAMShskMgo8AY8jqAQfAUAfHw8BDw87MioGlCIPBwZCa4ELatMAAMspJVgsDl8AIhckSg8XAHdvTwBcIQEiDT4OPhUqbyECAEoAS34Aej8Ybx83JgT/Xw8gHxZ/7w8RICxPHA9vBw+Pfw8PHwAPFv+fAsAvCc8vEr8ivwD/EQ8Bol8OEBa/A78hrwAPCU8vESNvvwWfHwNfAVoDHr+ZAAED34YaAdJPAK7PLwSEgDLHAGo1Pz8Pvx9fUwMrpb8O/58VTzAPIBoXIyQJNF8hpwIVAT8YGAUADDNBaX3RAMomJCg9EhUeA29MABsZBTMNJipjOhc19gcIDR8bBwQHEggCWi6DIgLuAQYA+BAFCha3A5XiAEsqM7UFFgFLhAMjFTMYE1Klnw74nRVBG/ASCm0BYRN/BrsU3VoWy+S0vV8LQx+vN8gF2AC2AK5EAWwApgYDKmAAroQ0NDQ0AT+OCg7wAAIHRAbpNgVcBV0APTA5BfbPFgMLzcYL/QqqA82eBALKCjQCjqYCht0/k2+OAsXQAoP3ASTK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let r=e();if(0==r)break;t.push(kc(r,e))}for(;;){let r=e()-1;if(r<0)break;t.push(Mc(r,e))}return function(e){const t={};for(let r=0;re-t));return function r(){let n=[];for(;;){let i=Pc(e,t);if(0==i.length)break;n.push({set:new Set(i),node:r()})}n.sort(((e,t)=>t.set.size-e.set.size));let i=e(),o=i%3;i=i/3|0;let a=!!(1&i);return i>>=1,{branches:n,valid:o,fe0f:a,save:1==i,check:2==i}}()}(Cc),Tc=45,jc=95;function Dc(e){return Zs(e)}function $c(e){return e.filter((e=>65039!=e))}function Bc(e){for(let t of e.split(".")){let e=Dc(t);try{for(let t=e.lastIndexOf(jc)-1;t>=0;t--)if(e[t]!==jc)throw new Error("underscore only allowed at start");if(e.length>=4&&e.every((e=>e<128))&&e[2]===Tc&&e[3]===Tc)throw new Error("invalid label extension")}catch(e){throw new Error(`Invalid label "${t}": ${e.message}`)}}return e}function Fc(e){return Bc(function(e,t){let r=Dc(e).reverse(),n=[];for(;r.length;){let e=zc(r);if(e){n.push(...t(e));continue}let i=r.pop();if(Ic.has(i)){n.push(i);continue}if(Rc.has(i))continue;let o=Nc[i];if(!o)throw new Error(`Disallowed codepoint: 0x${i.toString(16).toUpperCase()}`);n.push(...o)}return Bc(function(e){return e.normalize("NFC")}(String.fromCodePoint(...n)))}(e,$c))}function zc(e,t){var r;let n,i,o=Oc,a=[],s=e.length;for(t&&(t.length=0);s;){let c=e[--s];if(o=null===(r=o.branches.find((e=>e.set.has(c))))||void 0===r?void 0:r.node,!o)break;if(o.save)i=c;else if(o.check&&c===i)break;a.push(c),o.fe0f&&(a.push(65039),s>0&&65039==e[s-1]&&s--),o.valid&&(n=a.slice(),2==o.valid&&n.splice(1,1),t&&t.push(...e.slice(s).reverse()),e.length=s)}return n}const Uc=new wo(gc),Lc=new Uint8Array(32);function qc(e){if(0===e.length)throw new Error("invalid ENS name; empty component");return e}function Hc(e){const t=Js(Fc(e)),r=[];if(0===e.length)return r;let n=0;for(let e=0;e=t.length)throw new Error("invalid ENS name; empty component");return r.push(qc(t.slice(n))),r}function Kc(e){"string"!=typeof e&&Uc.throwArgumentError("invalid ENS name; not a string","name",e);let t=Lc;const r=Hc(e);for(;r.length;)t=is(Co([t,is(r.pop())]));return To(t)}function Jc(e){return To(Co(Hc(e).map((e=>{if(e.length>63)throw new Error("invalid DNS encoded entry; length exceeds 63 bytes");const t=new Uint8Array(e.length+1);return t.set(e,1),t[0]=t.length-1,t}))))+"00"}Lc.fill(0);const Wc="Ethereum Signed Message:\n";function Gc(e){return"string"==typeof e&&(e=Js(e)),is(Co([Js(Wc),Js(String(e.length)),e]))}var Vc=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))};const Zc=new wo(gc),Xc=new Uint8Array(32);Xc.fill(0);const Qc=Zo.from(-1),Yc=Zo.from(0),eu=Zo.from(1),tu=Zo.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");const ru=zo(eu.toHexString(),32),nu=zo(Yc.toHexString(),32),iu={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},ou=["name","version","chainId","verifyingContract","salt"];function au(e){return function(t){return"string"!=typeof t&&Zc.throwArgumentError(`invalid domain value for ${JSON.stringify(e)}`,`domain.${e}`,t),t}}const su={name:au("name"),version:au("version"),chainId:function(e){try{return Zo.from(e).toString()}catch(e){}return Zc.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",e)},verifyingContract:function(e){try{return ws(e).toLowerCase()}catch(e){}return Zc.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",e)},salt:function(e){try{const t=Mo(e);if(32!==t.length)throw new Error("bad length");return To(t)}catch(e){}return Zc.throwArgumentError('invalid domain value "salt"',"domain.salt",e)}};function cu(e){{const t=e.match(/^(u?)int(\d*)$/);if(t){const r=""===t[1],n=parseInt(t[2]||"256");(n%8!=0||n>256||t[2]&&t[2]!==String(n))&&Zc.throwArgumentError("invalid numeric width","type",e);const i=tu.mask(r?n-1:n),o=r?i.add(eu).mul(Qc):Yc;return function(t){const r=Zo.from(t);return(r.lt(o)||r.gt(i))&&Zc.throwArgumentError(`value out-of-bounds for ${e}`,"value",t),zo(r.toTwos(256).toHexString(),32)}}}{const t=e.match(/^bytes(\d+)$/);if(t){const r=parseInt(t[1]);return(0===r||r>32||t[1]!==String(r))&&Zc.throwArgumentError("invalid bytes width","type",e),function(t){return Mo(t).length!==r&&Zc.throwArgumentError(`invalid length for ${e}`,"value",t),function(e){const t=Mo(e),r=t.length%32;return r?$o([t,Xc.slice(r)]):To(t)}(t)}}}switch(e){case"address":return function(e){return zo(ws(e),32)};case"bool":return function(e){return e?ru:nu};case"bytes":return function(e){return is(e)};case"string":return function(e){return mc(e)}}return null}function uu(e,t){return`${e}(${t.map((({name:e,type:t})=>t+" "+e)).join(",")})`}class fu{constructor(e){ga(this,"types",Object.freeze(Sa(e))),ga(this,"_encoderCache",{}),ga(this,"_types",{});const t={},r={},n={};Object.keys(e).forEach((e=>{t[e]={},r[e]=[],n[e]={}}));for(const n in e){const i={};e[n].forEach((o=>{i[o.name]&&Zc.throwArgumentError(`duplicate variable name ${JSON.stringify(o.name)} in ${JSON.stringify(n)}`,"types",e),i[o.name]=!0;const a=o.type.match(/^([^\x5b]*)(\x5b|$)/)[1];a===n&&Zc.throwArgumentError(`circular type reference to ${JSON.stringify(a)}`,"types",e);cu(a)||(r[a]||Zc.throwArgumentError(`unknown type ${JSON.stringify(a)}`,"types",e),r[a].push(n),t[n][a]=!0)}))}const i=Object.keys(r).filter((e=>0===r[e].length));0===i.length?Zc.throwArgumentError("missing primary type","types",e):i.length>1&&Zc.throwArgumentError(`ambiguous primary types or unused types: ${i.map((e=>JSON.stringify(e))).join(", ")}`,"types",e),ga(this,"primaryType",i[0]),function i(o,a){a[o]&&Zc.throwArgumentError(`circular type reference to ${JSON.stringify(o)}`,"types",e),a[o]=!0,Object.keys(t[o]).forEach((e=>{r[e]&&(i(e,a),Object.keys(a).forEach((t=>{n[t][e]=!0})))})),delete a[o]}(this.primaryType,{});for(const t in n){const r=Object.keys(n[t]);r.sort(),this._types[t]=uu(t,e[t])+r.map((t=>uu(t,e[t]))).join("")}}getEncoder(e){let t=this._encoderCache[e];return t||(t=this._encoderCache[e]=this._getEncoder(e)),t}_getEncoder(e){{const t=cu(e);if(t)return t}const t=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(t){const e=t[1],r=this.getEncoder(e),n=parseInt(t[3]);return t=>{n>=0&&t.length!==n&&Zc.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",t);let i=t.map(r);return this._types[e]&&(i=i.map(is)),is($o(i))}}const r=this.types[e];if(r){const t=mc(this._types[e]);return e=>{const n=r.map((({name:t,type:r})=>{const n=this.getEncoder(r)(e[t]);return this._types[r]?is(n):n}));return n.unshift(t),$o(n)}}return Zc.throwArgumentError(`unknown type: ${e}`,"type",e)}encodeType(e){const t=this._types[e];return t||Zc.throwArgumentError(`unknown type: ${JSON.stringify(e)}`,"name",e),t}encodeData(e,t){return this.getEncoder(e)(t)}hashStruct(e,t){return is(this.encodeData(e,t))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,t,r){if(cu(e))return r(e,t);const n=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(n){const e=n[1],i=parseInt(n[3]);return i>=0&&t.length!==i&&Zc.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",t),t.map((t=>this._visit(e,t,r)))}const i=this.types[e];return i?i.reduce(((e,{name:n,type:i})=>(e[n]=this._visit(i,t[n],r),e)),{}):Zc.throwArgumentError(`unknown type: ${e}`,"type",e)}visit(e,t){return this._visit(this.primaryType,e,t)}static from(e){return new fu(e)}static getPrimaryType(e){return fu.from(e).primaryType}static hashStruct(e,t,r){return fu.from(t).hashStruct(e,r)}static hashDomain(e){const t=[];for(const r in e){const n=iu[r];n||Zc.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(r)}`,"domain",e),t.push({name:r,type:n})}return t.sort(((e,t)=>ou.indexOf(e.name)-ou.indexOf(t.name))),fu.hashStruct("EIP712Domain",{EIP712Domain:t},e)}static encode(e,t,r){return $o(["0x1901",fu.hashDomain(e),fu.from(t).hash(r)])}static hash(e,t,r){return is(fu.encode(e,t,r))}static resolveNames(e,t,r,n){return Vc(this,void 0,void 0,(function*(){e=wa(e);const i={};e.verifyingContract&&!No(e.verifyingContract,20)&&(i[e.verifyingContract]="0x");const o=fu.from(t);o.visit(r,((e,t)=>("address"!==e||No(t,20)||(i[t]="0x"),t)));for(const e in i)i[e]=yield n(e);return e.verifyingContract&&i[e.verifyingContract]&&(e.verifyingContract=i[e.verifyingContract]),r=o.visit(r,((e,t)=>"address"===e&&i[t]?i[t]:t)),{domain:e,value:r}}))}static getPayload(e,t,r){fu.hashDomain(e);const n={},i=[];ou.forEach((t=>{const r=e[t];null!=r&&(n[t]=su[t](r),i.push({name:t,type:iu[t]}))}));const o=fu.from(t),a=wa(t);return a.EIP712Domain?Zc.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",t):a.EIP712Domain=i,o.encode(r),{types:a,domain:n,primaryType:o.primaryType,message:o.visit(r,((e,t)=>{if(e.match(/^bytes(\d*)/))return To(Mo(t));if(e.match(/^u?int/))return Zo.from(t).toString();switch(e){case"address":return t.toLowerCase();case"bool":return!!t;case"string":return"string"!=typeof t&&Zc.throwArgumentError("invalid string","value",t),t}return Zc.throwArgumentError("unsupported type","type",e)}))}}}var du=Object.freeze({__proto__:null,_TypedDataEncoder:fu,dnsEncode:Jc,ensNormalize:function(e){return Hc(e).map((e=>Vs(e))).join(".")},hashMessage:Gc,id:mc,isValidName:function(e){try{return 0!==Hc(e).length}catch(e){}return!1},messagePrefix:Wc,namehash:Kc});const lu=new wo(ka);class hu extends Pa{}class pu extends Pa{}class mu extends Pa{}class gu extends Pa{static isIndexed(e){return!(!e||!e._isIndexed)}}const yu={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function bu(e,t){const r=new Error(`deferred error during ABI decoding triggered accessing ${e}`);return r.error=t,r}class vu{constructor(e){let t=[];t="string"==typeof e?JSON.parse(e):e,ga(this,"fragments",t.map((e=>Ba.from(e))).filter((e=>null!=e))),ga(this,"_abiCoder",ya(new.target,"getAbiCoder")()),ga(this,"functions",{}),ga(this,"errors",{}),ga(this,"events",{}),ga(this,"structs",{}),this.fragments.forEach((e=>{let t=null;switch(e.type){case"constructor":return this.deploy?void lu.warn("duplicate definition - constructor"):void ga(this,"deploy",e);case"function":t=this.functions;break;case"event":t=this.events;break;case"error":t=this.errors;break;default:return}let r=e.format();t[r]?lu.warn("duplicate definition - "+r):t[r]=e})),this.deploy||ga(this,"deploy",qa.from({payable:!1,type:"constructor"})),ga(this,"_isInterface",!0)}format(e){e||(e=Ta.full),e===Ta.sighash&&lu.throwArgumentError("interface does not support formatting sighash","format",e);const t=this.fragments.map((t=>t.format(e)));return e===Ta.json?JSON.stringify(t.map((e=>JSON.parse(e)))):t}static getAbiCoder(){return pc}static getAddress(e){return ws(e)}static getSighash(e){return Do(mc(e.format()),0,4)}static getEventTopic(e){return mc(e.format())}getFunction(e){if(No(e)){for(const t in this.functions)if(e===this.getSighash(t))return this.functions[t];lu.throwArgumentError("no matching function","sighash",e)}if(-1===e.indexOf("(")){const t=e.trim(),r=Object.keys(this.functions).filter((e=>e.split("(")[0]===t));return 0===r.length?lu.throwArgumentError("no matching function","name",t):r.length>1&&lu.throwArgumentError("multiple matching functions","name",t),this.functions[r[0]]}const t=this.functions[Ha.fromString(e).format()];return t||lu.throwArgumentError("no matching function","signature",e),t}getEvent(e){if(No(e)){const t=e.toLowerCase();for(const e in this.events)if(t===this.getEventTopic(e))return this.events[e];lu.throwArgumentError("no matching event","topichash",t)}if(-1===e.indexOf("(")){const t=e.trim(),r=Object.keys(this.events).filter((e=>e.split("(")[0]===t));return 0===r.length?lu.throwArgumentError("no matching event","name",t):r.length>1&&lu.throwArgumentError("multiple matching events","name",t),this.events[r[0]]}const t=this.events[Fa.fromString(e).format()];return t||lu.throwArgumentError("no matching event","signature",e),t}getError(e){if(No(e)){const t=ya(this.constructor,"getSighash");for(const r in this.errors){if(e===t(this.errors[r]))return this.errors[r]}lu.throwArgumentError("no matching error","sighash",e)}if(-1===e.indexOf("(")){const t=e.trim(),r=Object.keys(this.errors).filter((e=>e.split("(")[0]===t));return 0===r.length?lu.throwArgumentError("no matching error","name",t):r.length>1&&lu.throwArgumentError("multiple matching errors","name",t),this.errors[r[0]]}const t=this.errors[Ha.fromString(e).format()];return t||lu.throwArgumentError("no matching error","signature",e),t}getSighash(e){if("string"==typeof e)try{e=this.getFunction(e)}catch(t){try{e=this.getError(e)}catch(e){throw t}}return ya(this.constructor,"getSighash")(e)}getEventTopic(e){return"string"==typeof e&&(e=this.getEvent(e)),ya(this.constructor,"getEventTopic")(e)}_decodeParams(e,t){return this._abiCoder.decode(e,t)}_encodeParams(e,t){return this._abiCoder.encode(e,t)}encodeDeploy(e){return this._encodeParams(this.deploy.inputs,e||[])}decodeErrorResult(e,t){"string"==typeof e&&(e=this.getError(e));const r=Mo(t);return To(r.slice(0,4))!==this.getSighash(e)&&lu.throwArgumentError(`data signature does not match error ${e.name}.`,"data",To(r)),this._decodeParams(e.inputs,r.slice(4))}encodeErrorResult(e,t){return"string"==typeof e&&(e=this.getError(e)),To(Co([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}decodeFunctionData(e,t){"string"==typeof e&&(e=this.getFunction(e));const r=Mo(t);return To(r.slice(0,4))!==this.getSighash(e)&&lu.throwArgumentError(`data signature does not match function ${e.name}.`,"data",To(r)),this._decodeParams(e.inputs,r.slice(4))}encodeFunctionData(e,t){return"string"==typeof e&&(e=this.getFunction(e)),To(Co([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}decodeFunctionResult(e,t){"string"==typeof e&&(e=this.getFunction(e));let r=Mo(t),n=null,i="",o=null,a=null,s=null;switch(r.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(e.outputs,r)}catch(e){}break;case 4:{const e=To(r.slice(0,4)),t=yu[e];if(t)o=this._abiCoder.decode(t.inputs,r.slice(4)),a=t.name,s=t.signature,t.reason&&(n=o[0]),"Error"===a?i=`; VM Exception while processing transaction: reverted with reason string ${JSON.stringify(o[0])}`:"Panic"===a&&(i=`; VM Exception while processing transaction: reverted with panic code ${o[0]}`);else try{const t=this.getError(e);o=this._abiCoder.decode(t.inputs,r.slice(4)),a=t.name,s=t.format()}catch(e){}break}}return lu.throwError("call revert exception"+i,wo.errors.CALL_EXCEPTION,{method:e.format(),data:To(t),errorArgs:o,errorName:a,errorSignature:s,reason:n})}encodeFunctionResult(e,t){return"string"==typeof e&&(e=this.getFunction(e)),To(this._abiCoder.encode(e.outputs,t||[]))}encodeFilterTopics(e,t){"string"==typeof e&&(e=this.getEvent(e)),t.length>e.inputs.length&&lu.throwError("too many arguments for "+e.format(),wo.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:t});let r=[];e.anonymous||r.push(this.getEventTopic(e));const n=(e,t)=>"string"===e.type?mc(t):"bytes"===e.type?is(To(t)):("bool"===e.type&&"boolean"==typeof t&&(t=t?"0x01":"0x00"),e.type.match(/^u?int/)&&(t=Zo.from(t).toHexString()),"address"===e.type&&this._abiCoder.encode(["address"],[t]),zo(To(t),32));for(t.forEach(((t,i)=>{let o=e.inputs[i];o.indexed?null==t?r.push(null):"array"===o.baseType||"tuple"===o.baseType?lu.throwArgumentError("filtering with tuples or arrays not supported","contract."+o.name,t):Array.isArray(t)?r.push(t.map((e=>n(o,e)))):r.push(n(o,t)):null!=t&&lu.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+o.name,t)}));r.length&&null===r[r.length-1];)r.pop();return r}encodeEventLog(e,t){"string"==typeof e&&(e=this.getEvent(e));const r=[],n=[],i=[];return e.anonymous||r.push(this.getEventTopic(e)),t.length!==e.inputs.length&&lu.throwArgumentError("event arguments/values mismatch","values",t),e.inputs.forEach(((e,o)=>{const a=t[o];if(e.indexed)if("string"===e.type)r.push(mc(a));else if("bytes"===e.type)r.push(is(a));else{if("tuple"===e.baseType||"array"===e.baseType)throw new Error("not implemented");r.push(this._abiCoder.encode([e.type],[a]))}else n.push(e),i.push(a)})),{data:this._abiCoder.encode(n,i),topics:r}}decodeEventLog(e,t,r){if("string"==typeof e&&(e=this.getEvent(e)),null!=r&&!e.anonymous){let t=this.getEventTopic(e);No(r[0],32)&&r[0].toLowerCase()===t||lu.throwError("fragment/topic mismatch",wo.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:t,value:r[0]}),r=r.slice(1)}let n=[],i=[],o=[];e.inputs.forEach(((e,t)=>{e.indexed?"string"===e.type||"bytes"===e.type||"tuple"===e.baseType||"array"===e.baseType?(n.push(Da.fromObject({type:"bytes32",name:e.name})),o.push(!0)):(n.push(e),o.push(!1)):(i.push(e),o.push(!1))}));let a=null!=r?this._abiCoder.decode(n,Co(r)):null,s=this._abiCoder.decode(i,t,!0),c=[],u=0,f=0;e.inputs.forEach(((e,t)=>{if(e.indexed)if(null==a)c[t]=new gu({_isIndexed:!0,hash:null});else if(o[t])c[t]=new gu({_isIndexed:!0,hash:a[f++]});else try{c[t]=a[f++]}catch(e){c[t]=e}else try{c[t]=s[u++]}catch(e){c[t]=e}if(e.name&&null==c[e.name]){const r=c[t];r instanceof Error?Object.defineProperty(c,e.name,{enumerable:!0,get:()=>{throw bu(`property ${JSON.stringify(e.name)}`,r)}}):c[e.name]=r}}));for(let e=0;e{throw bu(`index ${e}`,t)}})}return Object.freeze(c)}parseTransaction(e){let t=this.getFunction(e.data.substring(0,10).toLowerCase());return t?new pu({args:this._abiCoder.decode(t.inputs,"0x"+e.data.substring(10)),functionFragment:t,name:t.name,signature:t.format(),sighash:this.getSighash(t),value:Zo.from(e.value||"0")}):null}parseLog(e){let t=this.getEvent(e.topics[0]);return!t||t.anonymous?null:new hu({eventFragment:t,name:t.name,signature:t.format(),topic:this.getEventTopic(t),args:this.decodeEventLog(t,e.data,e.topics)})}parseError(e){const t=To(e);let r=this.getError(t.substring(0,10).toLowerCase());return r?new mu({args:this._abiCoder.decode(r.inputs,"0x"+t.substring(10)),errorFragment:r,name:r.name,signature:r.format(),sighash:this.getSighash(r)}):null}static isInterface(e){return!(!e||!e._isInterface)}}var wu=Object.freeze({__proto__:null,AbiCoder:hc,ConstructorFragment:qa,ErrorFragment:Ja,EventFragment:Fa,FormatTypes:Ta,Fragment:Ba,FunctionFragment:Ha,Indexed:gu,Interface:vu,LogDescription:hu,ParamType:Da,TransactionDescription:pu,checkResultErrors:Qa,defaultAbiCoder:pc});var Au=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))};const _u=new wo("abstract-provider/5.7.0");class Eu extends Pa{static isForkEvent(e){return!(!e||!e._isForkEvent)}}class Su{constructor(){_u.checkAbstract(new.target,Su),ga(this,"_isProvider",!0)}getFeeData(){return Au(this,void 0,void 0,(function*(){const{block:e,gasPrice:t}=yield ba({block:this.getBlock("latest"),gasPrice:this.getGasPrice().catch((e=>null))});let r=null,n=null,i=null;return e&&e.baseFeePerGas&&(r=e.baseFeePerGas,i=Zo.from("1500000000"),n=e.baseFeePerGas.mul(2).add(i)),{lastBaseFeePerGas:r,maxFeePerGas:n,maxPriorityFeePerGas:i,gasPrice:t}}))}addListener(e,t){return this.on(e,t)}removeListener(e,t){return this.off(e,t)}static isProvider(e){return!(!e||!e._isProvider)}}var Pu=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))};const xu=new wo("abstract-signer/5.7.0"),ku=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],Mu=[wo.errors.INSUFFICIENT_FUNDS,wo.errors.NONCE_EXPIRED,wo.errors.REPLACEMENT_UNDERPRICED];class Cu{constructor(){xu.checkAbstract(new.target,Cu),ga(this,"_isSigner",!0)}getBalance(e){return Pu(this,void 0,void 0,(function*(){return this._checkProvider("getBalance"),yield this.provider.getBalance(this.getAddress(),e)}))}getTransactionCount(e){return Pu(this,void 0,void 0,(function*(){return this._checkProvider("getTransactionCount"),yield this.provider.getTransactionCount(this.getAddress(),e)}))}estimateGas(e){return Pu(this,void 0,void 0,(function*(){this._checkProvider("estimateGas");const t=yield ba(this.checkTransaction(e));return yield this.provider.estimateGas(t)}))}call(e,t){return Pu(this,void 0,void 0,(function*(){this._checkProvider("call");const r=yield ba(this.checkTransaction(e));return yield this.provider.call(r,t)}))}sendTransaction(e){return Pu(this,void 0,void 0,(function*(){this._checkProvider("sendTransaction");const t=yield this.populateTransaction(e),r=yield this.signTransaction(t);return yield this.provider.sendTransaction(r)}))}getChainId(){return Pu(this,void 0,void 0,(function*(){this._checkProvider("getChainId");return(yield this.provider.getNetwork()).chainId}))}getGasPrice(){return Pu(this,void 0,void 0,(function*(){return this._checkProvider("getGasPrice"),yield this.provider.getGasPrice()}))}getFeeData(){return Pu(this,void 0,void 0,(function*(){return this._checkProvider("getFeeData"),yield this.provider.getFeeData()}))}resolveName(e){return Pu(this,void 0,void 0,(function*(){return this._checkProvider("resolveName"),yield this.provider.resolveName(e)}))}checkTransaction(e){for(const t in e)-1===ku.indexOf(t)&&xu.throwArgumentError("invalid transaction key: "+t,"transaction",e);const t=wa(e);return null==t.from?t.from=this.getAddress():t.from=Promise.all([Promise.resolve(t.from),this.getAddress()]).then((t=>(t[0].toLowerCase()!==t[1].toLowerCase()&&xu.throwArgumentError("from address mismatch","transaction",e),t[0]))),t}populateTransaction(e){return Pu(this,void 0,void 0,(function*(){const t=yield ba(this.checkTransaction(e));null!=t.to&&(t.to=Promise.resolve(t.to).then((e=>Pu(this,void 0,void 0,(function*(){if(null==e)return null;const t=yield this.resolveName(e);return null==t&&xu.throwArgumentError("provided ENS name resolves to null","tx.to",e),t})))),t.to.catch((e=>{})));const r=null!=t.maxFeePerGas||null!=t.maxPriorityFeePerGas;if(null==t.gasPrice||2!==t.type&&!r?0!==t.type&&1!==t.type||!r||xu.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",e):xu.throwArgumentError("eip-1559 transaction do not support gasPrice","transaction",e),2!==t.type&&null!=t.type||null==t.maxFeePerGas||null==t.maxPriorityFeePerGas)if(0===t.type||1===t.type)null==t.gasPrice&&(t.gasPrice=this.getGasPrice());else{const e=yield this.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?(r&&xu.throwError("network does not support EIP-1559",wo.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),null==t.gasPrice&&(t.gasPrice=e.gasPrice),t.type=0):xu.throwError("failed to get consistent fee data",wo.errors.UNSUPPORTED_OPERATION,{operation:"signer.getFeeData"});else 2===t.type&&(null==t.maxFeePerGas&&(t.maxFeePerGas=e.maxFeePerGas),null==t.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=e.maxPriorityFeePerGas))}else t.type=2;return null==t.nonce&&(t.nonce=this.getTransactionCount("pending")),null==t.gasLimit&&(t.gasLimit=this.estimateGas(t).catch((e=>{if(Mu.indexOf(e.code)>=0)throw e;return xu.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",wo.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,tx:t})}))),null==t.chainId?t.chainId=this.getChainId():t.chainId=Promise.all([Promise.resolve(t.chainId),this.getChainId()]).then((t=>(0!==t[1]&&t[0]!==t[1]&&xu.throwArgumentError("chainId address mismatch","transaction",e),t[0]))),yield ba(t)}))}_checkProvider(e){this.provider||xu.throwError("missing provider",wo.errors.UNSUPPORTED_OPERATION,{operation:e||"_checkProvider"})}static isSigner(e){return!(!e||!e._isSigner)}}class Iu extends Cu{constructor(e,t){super(),ga(this,"address",e),ga(this,"provider",t||null)}getAddress(){return Promise.resolve(this.address)}_fail(e,t){return Promise.resolve().then((()=>{xu.throwError(e,wo.errors.UNSUPPORTED_OPERATION,{operation:t})}))}signMessage(e){return this._fail("VoidSigner cannot sign messages","signMessage")}signTransaction(e){return this._fail("VoidSigner cannot sign transactions","signTransaction")}_signTypedData(e,t,r){return this._fail("VoidSigner cannot sign typed data","signTypedData")}connect(e){return new Iu(this.address,e)}}function Ru(e,t,r){return r={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&r.path)}},e(r,r.exports),r.exports}var Nu=Ou;function Ou(e,t){if(!e)throw new Error(t||"Assertion failed")}Ou.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)};var Tu=Ru((function(e,t){var r=t;function n(e){return 1===e.length?"0"+e:e}function i(e){for(var t="",r=0;r>8,a=255&i;o?r.push(o,a):r.push(a)}return r},r.zero2=n,r.toHex=i,r.encode=function(e,t){return"hex"===t?i(e):e}})),ju=Ru((function(e,t){var r=t;r.assert=Nu,r.toArray=Tu.toArray,r.zero2=Tu.zero2,r.toHex=Tu.toHex,r.encode=Tu.encode,r.getNAF=function(e,t,r){var n=new Array(Math.max(e.bitLength(),r)+1);n.fill(0);for(var i=1<(i>>1)-1?(i>>1)-c:c,o.isubn(s)):s=0,n[a]=s,o.iushrn(1)}return n},r.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n,i=0,o=0;e.cmpn(-i)>0||t.cmpn(-o)>0;){var a,s,c=e.andln(3)+i&3,u=t.andln(3)+o&3;3===c&&(c=-1),3===u&&(u=-1),a=0==(1&c)?0:3!==(n=e.andln(7)+i&7)&&5!==n||2!==u?c:-c,r[0].push(a),s=0==(1&u)?0:3!==(n=t.andln(7)+o&7)&&5!==n||2!==c?u:-u,r[1].push(s),2*i===a+1&&(i=1-i),2*o===s+1&&(o=1-o),e.iushrn(1),t.iushrn(1)}return r},r.cachedProperty=function(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},r.parseBytes=function(e){return"string"==typeof e?r.toArray(e,"hex"):e},r.intFromLE=function(e){return new uo(e,"hex","le")}})),Du=ju.getNAF,$u=ju.getJSF,Bu=ju.assert;function Fu(e,t){this.type=e,this.p=new uo(t.p,16),this.red=t.prime?uo.red(t.prime):uo.mont(this.p),this.zero=new uo(0).toRed(this.red),this.one=new uo(1).toRed(this.red),this.two=new uo(2).toRed(this.red),this.n=t.n&&new uo(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var zu=Fu;function Uu(e,t){this.curve=e,this.type=t,this.precomputed=null}Fu.prototype.point=function(){throw new Error("Not implemented")},Fu.prototype.validate=function(){throw new Error("Not implemented")},Fu.prototype._fixedNafMul=function(e,t){Bu(e.precomputed);var r=e._getDoubles(),n=Du(t,1,this._bitLength),i=(1<=o;c--)a=(a<<1)+n[c];s.push(a)}for(var u=this.jpoint(null,null,null),f=this.jpoint(null,null,null),d=i;d>0;d--){for(o=0;o=0;s--){for(var c=0;s>=0&&0===o[s];s--)c++;if(s>=0&&c++,a=a.dblp(c),s<0)break;var u=o[s];Bu(0!==u),a="affine"===e.type?u>0?a.mixedAdd(i[u-1>>1]):a.mixedAdd(i[-u-1>>1].neg()):u>0?a.add(i[u-1>>1]):a.add(i[-u-1>>1].neg())}return"affine"===e.type?a.toP():a},Fu.prototype._wnafMulAdd=function(e,t,r,n,i){var o,a,s,c=this._wnafT1,u=this._wnafT2,f=this._wnafT3,d=0;for(o=0;o=1;o-=2){var h=o-1,p=o;if(1===c[h]&&1===c[p]){var m=[t[h],null,null,t[p]];0===t[h].y.cmp(t[p].y)?(m[1]=t[h].add(t[p]),m[2]=t[h].toJ().mixedAdd(t[p].neg())):0===t[h].y.cmp(t[p].y.redNeg())?(m[1]=t[h].toJ().mixedAdd(t[p]),m[2]=t[h].add(t[p].neg())):(m[1]=t[h].toJ().mixedAdd(t[p]),m[2]=t[h].toJ().mixedAdd(t[p].neg()));var g=[-3,-1,-5,-7,0,7,5,1,3],y=$u(r[h],r[p]);for(d=Math.max(y[0].length,d),f[h]=new Array(d),f[p]=new Array(d),a=0;a=0;o--){for(var _=0;o>=0;){var E=!0;for(a=0;a=0&&_++,w=w.dblp(_),o<0)break;for(a=0;a0?s=u[a][S-1>>1]:S<0&&(s=u[a][-S-1>>1].neg()),w="affine"===s.type?w.mixedAdd(s):w.add(s))}}for(o=0;o=Math.ceil((e.bitLength()+1)/t.step)},Uu.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i=0&&(o=t,a=r),n.negative&&(n=n.neg(),i=i.neg()),o.negative&&(o=o.neg(),a=a.neg()),[{a:n,b:i},{a:o,b:a}]},Hu.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],i=n.b.mul(e).divRound(this.n),o=r.b.neg().mul(e).divRound(this.n),a=i.mul(r.a),s=o.mul(n.a),c=i.mul(r.b),u=o.mul(n.b);return{k1:e.sub(a).sub(s),k2:c.add(u).neg()}},Hu.prototype.pointFromX=function(e,t){(e=new uo(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var i=n.fromRed().isOdd();return(t&&!i||!t&&i)&&(n=n.redNeg()),this.point(e,n)},Hu.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},Hu.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o":""},Ju.prototype.isInfinity=function(){return this.inf},Ju.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},Ju.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),a=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)},Ju.prototype.getX=function(){return this.x.fromRed()},Ju.prototype.getY=function(){return this.y.fromRed()},Ju.prototype.mul=function(e){return e=new uo(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)},Ju.prototype.mulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},Ju.prototype.jmulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},Ju.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))},Ju.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,n=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return t},Ju.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},Lu(Wu,zu.BasePoint),Hu.prototype.jpoint=function(e,t,r){return new Wu(this,e,t,r)},Wu.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},Wu.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},Wu.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),i=e.x.redMul(r),o=this.y.redMul(t.redMul(e.z)),a=e.y.redMul(r.redMul(this.z)),s=n.redSub(i),c=o.redSub(a);if(0===s.cmpn(0))return 0!==c.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=s.redSqr(),f=u.redMul(s),d=n.redMul(u),l=c.redSqr().redIAdd(f).redISub(d).redISub(d),h=c.redMul(d.redISub(l)).redISub(o.redMul(f)),p=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(l,h,p)},Wu.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),i=this.y,o=e.y.redMul(t).redMul(this.z),a=r.redSub(n),s=i.redSub(o);if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=a.redSqr(),u=c.redMul(a),f=r.redMul(c),d=s.redSqr().redIAdd(u).redISub(f).redISub(f),l=s.redMul(f.redISub(d)).redISub(i.redMul(u)),h=this.z.redMul(a);return this.curve.jpoint(d,l,h)},Wu.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var r=this;for(t=0;t=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},Wu.prototype.inspect=function(){return this.isInfinity()?"":""},Wu.prototype.isInfinity=function(){return 0===this.z.cmpn(0)};var Gu=Ru((function(e,t){var r=t;r.base=zu,r.short=Ku,r.mont=null,r.edwards=null})),Vu=Ru((function(e,t){var r,n=t,i=ju.assert;function o(e){"short"===e.type?this.curve=new Gu.short(e):"edwards"===e.type?this.curve=new Gu.edwards(e):this.curve=new Gu.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,i(this.g.validate(),"Invalid curve"),i(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function a(e,t){Object.defineProperty(n,e,{configurable:!0,enumerable:!0,get:function(){var r=new o(t);return Object.defineProperty(n,e,{configurable:!0,enumerable:!0,value:r}),r}})}n.PresetCurve=o,a("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:ir.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),a("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:ir.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),a("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:ir.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),a("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:ir.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"]}),a("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:ir.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"]}),a("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:ir.sha256,gRed:!1,g:["9"]}),a("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:ir.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{r=null.crash()}catch(e){r=void 0}a("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:ir.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})}));function Zu(e){if(!(this instanceof Zu))return new Zu(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=Tu.toArray(e.entropy,e.entropyEnc||"hex"),r=Tu.toArray(e.nonce,e.nonceEnc||"hex"),n=Tu.toArray(e.pers,e.persEnc||"hex");Nu(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}var Xu=Zu;Zu.prototype._init=function(e,t,r){var n=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},Zu.prototype.generate=function(e,t,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(n=r,r=t,t=null),r&&(r=Tu.toArray(r,n||"hex"),this._update(r));for(var i=[];i.length"};var tf=ju.assert;function rf(e,t){if(e instanceof rf)return e;this._importDER(e,t)||(tf(e.r&&e.s,"Signature without r or s"),this.r=new uo(e.r,16),this.s=new uo(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}var nf=rf;function of(){this.place=0}function af(e,t){var r=e[t.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var i=0,o=0,a=t.place;o>>=0;return!(i<=127)&&(t.place=a,i)}function sf(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}rf.prototype._importDER=function(e,t){e=ju.toArray(e,t);var r=new of;if(48!==e[r.place++])return!1;var n=af(e,r);if(!1===n)return!1;if(n+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var i=af(e,r);if(!1===i)return!1;var o=e.slice(r.place,i+r.place);if(r.place+=i,2!==e[r.place++])return!1;var a=af(e,r);if(!1===a)return!1;if(e.length!==a+r.place)return!1;var s=e.slice(r.place,a+r.place);if(0===o[0]){if(!(128&o[1]))return!1;o=o.slice(1)}if(0===s[0]){if(!(128&s[1]))return!1;s=s.slice(1)}return this.r=new uo(o),this.s=new uo(s),this.recoveryParam=null,!0},rf.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=sf(t),r=sf(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];cf(n,t.length),(n=n.concat(t)).push(2),cf(n,r.length);var i=n.concat(r),o=[48];return cf(o,i.length),o=o.concat(i),ju.encode(o,e)};var uf=function(){throw new Error("unsupported")},ff=ju.assert;function df(e){if(!(this instanceof df))return new df(e);"string"==typeof e&&(ff(Object.prototype.hasOwnProperty.call(Vu,e),"Unknown curve "+e),e=Vu[e]),e instanceof Vu.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}var lf=df;df.prototype.keyPair=function(e){return new ef(this,e)},df.prototype.keyFromPrivate=function(e,t){return ef.fromPrivate(this,e,t)},df.prototype.keyFromPublic=function(e,t){return ef.fromPublic(this,e,t)},df.prototype.genKeyPair=function(e){e||(e={});for(var t=new Xu({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||uf(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),n=this.n.sub(new uo(2));;){var i=new uo(t.generate(r));if(!(i.cmp(n)>0))return i.iaddn(1),this.keyFromPrivate(i)}},df.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},df.prototype.sign=function(e,t,r,n){"object"==typeof r&&(n=r,r=null),n||(n={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new uo(e,16));for(var i=this.n.byteLength(),o=t.getPrivate().toArray("be",i),a=e.toArray("be",i),s=new Xu({hash:this.hash,entropy:o,nonce:a,pers:n.pers,persEnc:n.persEnc||"utf8"}),c=this.n.sub(new uo(1)),u=0;;u++){var f=n.k?n.k(u):new uo(s.generate(this.n.byteLength()));if(!((f=this._truncateToN(f,!0)).cmpn(1)<=0||f.cmp(c)>=0)){var d=this.g.mul(f);if(!d.isInfinity()){var l=d.getX(),h=l.umod(this.n);if(0!==h.cmpn(0)){var p=f.invm(this.n).mul(h.mul(t.getPrivate()).iadd(e));if(0!==(p=p.umod(this.n)).cmpn(0)){var m=(d.getY().isOdd()?1:0)|(0!==l.cmp(h)?2:0);return n.canonical&&p.cmp(this.nh)>0&&(p=this.n.sub(p),m^=1),new nf({r:h,s:p,recoveryParam:m})}}}}}},df.prototype.verify=function(e,t,r,n){e=this._truncateToN(new uo(e,16)),r=this.keyFromPublic(r,n);var i=(t=new nf(t,"hex")).r,o=t.s;if(i.cmpn(1)<0||i.cmp(this.n)>=0)return!1;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var a,s=o.invm(this.n),c=s.mul(e).umod(this.n),u=s.mul(i).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(c,r.getPublic(),u)).isInfinity()&&a.eqXToP(i):!(a=this.g.mulAdd(c,r.getPublic(),u)).isInfinity()&&0===a.getX().umod(this.n).cmp(i)},df.prototype.recoverPubKey=function(e,t,r,n){ff((3&r)===r,"The recovery param is more than two bits"),t=new nf(t,n);var i=this.n,o=new uo(e),a=t.r,s=t.s,c=1&r,u=r>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&u)throw new Error("Unable to find sencond key candinate");a=u?this.curve.pointFromX(a.add(this.curve.n),c):this.curve.pointFromX(a,c);var f=t.r.invm(i),d=i.sub(o).mul(f).umod(i),l=s.mul(f).umod(i);return this.g.mulAdd(d,a,l)},df.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new nf(t,n)).recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(e,t,i)}catch(e){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")};var hf=Ru((function(e,t){var r=t;r.version="6.5.4",r.utils=ju,r.rand=function(){throw new Error("unsupported")},r.curve=Gu,r.curves=Vu,r.ec=lf,r.eddsa=null})),pf=hf.ec;const mf=new wo("signing-key/5.7.0");let gf=null;function yf(){return gf||(gf=new pf("secp256k1")),gf}class bf{constructor(e){ga(this,"curve","secp256k1"),ga(this,"privateKey",To(e)),32!==jo(this.privateKey)&&mf.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const t=yf().keyFromPrivate(Mo(this.privateKey));ga(this,"publicKey","0x"+t.getPublic(!1,"hex")),ga(this,"compressedPublicKey","0x"+t.getPublic(!0,"hex")),ga(this,"_isSigningKey",!0)}_addPoint(e){const t=yf().keyFromPublic(Mo(this.publicKey)),r=yf().keyFromPublic(Mo(e));return"0x"+t.pub.add(r.pub).encodeCompressed("hex")}signDigest(e){const t=yf().keyFromPrivate(Mo(this.privateKey)),r=Mo(e);32!==r.length&&mf.throwArgumentError("bad digest length","digest",e);const n=t.sign(r,{canonical:!0});return Uo({recoveryParam:n.recoveryParam,r:zo("0x"+n.r.toString(16),32),s:zo("0x"+n.s.toString(16),32)})}computeSharedSecret(e){const t=yf().keyFromPrivate(Mo(this.privateKey)),r=yf().keyFromPublic(Mo(wf(e)));return zo("0x"+t.derive(r.getPublic()).toString(16),32)}static isSigningKey(e){return!(!e||!e._isSigningKey)}}function vf(e,t){const r=Uo(t),n={r:Mo(r.r),s:Mo(r.s)};return"0x"+yf().recoverPubKey(Mo(e),n,r.recoveryParam).encode("hex",!1)}function wf(e,t){const r=Mo(e);if(32===r.length){const e=new bf(r);return t?"0x"+yf().keyFromPrivate(r).getPublic(!0,"hex"):e.publicKey}return 33===r.length?t?To(r):"0x"+yf().keyFromPublic(r).getPublic(!1,"hex"):65===r.length?t?"0x"+yf().keyFromPublic(r).getPublic(!0,"hex"):To(r):mf.throwArgumentError("invalid public or private key","key","[REDACTED]")}var Af=Object.freeze({__proto__:null,SigningKey:bf,computePublicKey:wf,recoverPublicKey:vf});const _f=new wo("transactions/5.7.0");var Ef;function Sf(e){return"0x"===e?null:ws(e)}function Pf(e){return"0x"===e?js:Zo.from(e)}!function(e){e[e.legacy=0]="legacy",e[e.eip2930=1]="eip2930",e[e.eip1559=2]="eip1559"}(Ef||(Ef={}));const xf=[{name:"nonce",maxLength:32,numeric:!0},{name:"gasPrice",maxLength:32,numeric:!0},{name:"gasLimit",maxLength:32,numeric:!0},{name:"to",length:20},{name:"value",maxLength:32,numeric:!0},{name:"data"}],kf={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,type:!0,value:!0};function Mf(e){return ws(Do(is(Do(wf(e),1)),12))}function Cf(e,t){return Mf(vf(Mo(e),t))}function If(e,t){const r=Io(Zo.from(e).toHexString());return r.length>32&&_f.throwArgumentError("invalid length for "+t,"transaction:"+t,e),r}function Rf(e,t){return{address:ws(e),storageKeys:(t||[]).map(((t,r)=>(32!==jo(t)&&_f.throwArgumentError("invalid access list storageKey",`accessList[${e}:${r}]`,t),t.toLowerCase())))}}function Nf(e){if(Array.isArray(e))return e.map(((e,t)=>Array.isArray(e)?(e.length>2&&_f.throwArgumentError("access list expected to be [ address, storageKeys[] ]",`value[${t}]`,e),Rf(e[0],e[1])):Rf(e.address,e.storageKeys)));const t=Object.keys(e).map((t=>{const r=e[t].reduce(((e,t)=>(e[t]=!0,e)),{});return Rf(t,Object.keys(r).sort())}));return t.sort(((e,t)=>e.address.localeCompare(t.address))),t}function Of(e){return Nf(e).map((e=>[e.address,e.storageKeys]))}function Tf(e,t){if(null!=e.gasPrice){const t=Zo.from(e.gasPrice),r=Zo.from(e.maxFeePerGas||0);t.eq(r)||_f.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:t,maxFeePerGas:r})}const r=[If(e.chainId||0,"chainId"),If(e.nonce||0,"nonce"),If(e.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),If(e.maxFeePerGas||0,"maxFeePerGas"),If(e.gasLimit||0,"gasLimit"),null!=e.to?ws(e.to):"0x",If(e.value||0,"value"),e.data||"0x",Of(e.accessList||[])];if(t){const e=Uo(t);r.push(If(e.recoveryParam,"recoveryParam")),r.push(Io(e.r)),r.push(Io(e.s))}return $o(["0x02",fs(r)])}function jf(e,t){const r=[If(e.chainId||0,"chainId"),If(e.nonce||0,"nonce"),If(e.gasPrice||0,"gasPrice"),If(e.gasLimit||0,"gasLimit"),null!=e.to?ws(e.to):"0x",If(e.value||0,"value"),e.data||"0x",Of(e.accessList||[])];if(t){const e=Uo(t);r.push(If(e.recoveryParam,"recoveryParam")),r.push(Io(e.r)),r.push(Io(e.s))}return $o(["0x01",fs(r)])}function Df(e,t){if(null==e.type||0===e.type)return null!=e.accessList&&_f.throwArgumentError("untyped transactions do not support accessList; include type: 1","transaction",e),function(e,t){va(e,kf);const r=[];xf.forEach((function(t){let n=e[t.name]||[];const i={};t.numeric&&(i.hexPad="left"),n=Mo(To(n,i)),t.length&&n.length!==t.length&&n.length>0&&_f.throwArgumentError("invalid length for "+t.name,"transaction:"+t.name,n),t.maxLength&&(n=Io(n),n.length>t.maxLength&&_f.throwArgumentError("invalid length for "+t.name,"transaction:"+t.name,n)),r.push(To(n))}));let n=0;if(null!=e.chainId?(n=e.chainId,"number"!=typeof n&&_f.throwArgumentError("invalid transaction.chainId","transaction",e)):t&&!Po(t)&&t.v>28&&(n=Math.floor((t.v-35)/2)),0!==n&&(r.push(To(n)),r.push("0x"),r.push("0x")),!t)return fs(r);const i=Uo(t);let o=27+i.recoveryParam;return 0!==n?(r.pop(),r.pop(),r.pop(),o+=2*n+8,i.v>28&&i.v!==o&&_f.throwArgumentError("transaction.chainId/signature.v mismatch","signature",t)):i.v!==o&&_f.throwArgumentError("transaction.chainId/signature.v mismatch","signature",t),r.push(To(o)),r.push(Io(Mo(i.r))),r.push(Io(Mo(i.s))),fs(r)}(e,t);switch(e.type){case 1:return jf(e,t);case 2:return Tf(e,t)}return _f.throwError(`unsupported transaction type: ${e.type}`,wo.errors.UNSUPPORTED_OPERATION,{operation:"serializeTransaction",transactionType:e.type})}function $f(e,t,r){try{const r=Pf(t[0]).toNumber();if(0!==r&&1!==r)throw new Error("bad recid");e.v=r}catch(e){_f.throwArgumentError("invalid v for transaction type: 1","v",t[0])}e.r=zo(t[1],32),e.s=zo(t[2],32);try{const t=is(r(e));e.from=Cf(t,{r:e.r,s:e.s,recoveryParam:e.v})}catch(e){}}function Bf(e){const t=Mo(e);if(t[0]>127)return function(e){const t=hs(e);9!==t.length&&6!==t.length&&_f.throwArgumentError("invalid raw transaction","rawTransaction",e);const r={nonce:Pf(t[0]).toNumber(),gasPrice:Pf(t[1]),gasLimit:Pf(t[2]),to:Sf(t[3]),value:Pf(t[4]),data:t[5],chainId:0};if(6===t.length)return r;try{r.v=Zo.from(t[6]).toNumber()}catch(e){return r}if(r.r=zo(t[7],32),r.s=zo(t[8],32),Zo.from(r.r).isZero()&&Zo.from(r.s).isZero())r.chainId=r.v,r.v=0;else{r.chainId=Math.floor((r.v-35)/2),r.chainId<0&&(r.chainId=0);let n=r.v-27;const i=t.slice(0,6);0!==r.chainId&&(i.push(To(r.chainId)),i.push("0x"),i.push("0x"),n-=2*r.chainId+8);const o=is(fs(i));try{r.from=Cf(o,{r:To(r.r),s:To(r.s),recoveryParam:n})}catch(e){}r.hash=is(e)}return r.type=null,r}(t);switch(t[0]){case 1:return function(e){const t=hs(e.slice(1));8!==t.length&&11!==t.length&&_f.throwArgumentError("invalid component count for transaction type: 1","payload",To(e));const r={type:1,chainId:Pf(t[0]).toNumber(),nonce:Pf(t[1]).toNumber(),gasPrice:Pf(t[2]),gasLimit:Pf(t[3]),to:Sf(t[4]),value:Pf(t[5]),data:t[6],accessList:Nf(t[7])};return 8===t.length||(r.hash=is(e),$f(r,t.slice(8),jf)),r}(t);case 2:return function(e){const t=hs(e.slice(1));9!==t.length&&12!==t.length&&_f.throwArgumentError("invalid component count for transaction type: 2","payload",To(e));const r=Pf(t[2]),n=Pf(t[3]),i={type:2,chainId:Pf(t[0]).toNumber(),nonce:Pf(t[1]).toNumber(),maxPriorityFeePerGas:r,maxFeePerGas:n,gasPrice:null,gasLimit:Pf(t[4]),to:Sf(t[5]),value:Pf(t[6]),data:t[7],accessList:Nf(t[8])};return 9===t.length||(i.hash=is(e),$f(i,t.slice(9),Tf)),i}(t)}return _f.throwError(`unsupported transaction type: ${t[0]}`,wo.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:t[0]})}var Ff=Object.freeze({__proto__:null,get TransactionTypes(){return Ef},accessListify:Nf,computeAddress:Mf,parse:Bf,recoverAddress:Cf,serialize:Df});var zf=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))};const Uf=new wo("contracts/5.7.0");function Lf(e,t){return zf(this,void 0,void 0,(function*(){const r=yield t;"string"!=typeof r&&Uf.throwArgumentError("invalid address or ENS name","name",r);try{return ws(r)}catch(e){}e||Uf.throwError("a provider or signer is needed to resolve ENS names",wo.errors.UNSUPPORTED_OPERATION,{operation:"resolveName"});const n=yield e.resolveName(r);return null==n&&Uf.throwArgumentError("resolver or addr is not configured for ENS name","name",r),n}))}function qf(e,t,r){return zf(this,void 0,void 0,(function*(){return Array.isArray(r)?yield Promise.all(r.map(((r,n)=>qf(e,Array.isArray(t)?t[n]:t[r.name],r)))):"address"===r.type?yield Lf(e,t):"tuple"===r.type?yield qf(e,t,r.components):"array"===r.baseType?Array.isArray(t)?yield Promise.all(t.map((t=>qf(e,t,r.arrayChildren)))):Promise.reject(Uf.makeError("invalid value for array",wo.errors.INVALID_ARGUMENT,{argument:"value",value:t})):t}))}function Hf(e,t,r){return zf(this,void 0,void 0,(function*(){let n={};r.length===t.inputs.length+1&&"object"==typeof r[r.length-1]&&(n=wa(r.pop())),Uf.checkArgumentCount(r.length,t.inputs.length,"passed to contract"),e.signer?n.from?n.from=ba({override:Lf(e.signer,n.from),signer:e.signer.getAddress()}).then((e=>zf(this,void 0,void 0,(function*(){return ws(e.signer)!==e.override&&Uf.throwError("Contract with a Signer cannot override from",wo.errors.UNSUPPORTED_OPERATION,{operation:"overrides.from"}),e.override})))):n.from=e.signer.getAddress():n.from&&(n.from=Lf(e.provider,n.from));const i=yield ba({args:qf(e.signer||e.provider,r,t.inputs),address:e.resolvedAddress,overrides:ba(n)||{}}),o=e.interface.encodeFunctionData(t,i.args),a={data:o,to:i.address},s=i.overrides;if(null!=s.nonce&&(a.nonce=Zo.from(s.nonce).toNumber()),null!=s.gasLimit&&(a.gasLimit=Zo.from(s.gasLimit)),null!=s.gasPrice&&(a.gasPrice=Zo.from(s.gasPrice)),null!=s.maxFeePerGas&&(a.maxFeePerGas=Zo.from(s.maxFeePerGas)),null!=s.maxPriorityFeePerGas&&(a.maxPriorityFeePerGas=Zo.from(s.maxPriorityFeePerGas)),null!=s.from&&(a.from=s.from),null!=s.type&&(a.type=s.type),null!=s.accessList&&(a.accessList=Nf(s.accessList)),null==a.gasLimit&&null!=t.gas){let e=21e3;const r=Mo(o);for(let t=0;tnull!=n[e]));return c.length&&Uf.throwError(`cannot override ${c.map((e=>JSON.stringify(e))).join(",")}`,wo.errors.UNSUPPORTED_OPERATION,{operation:"overrides",overrides:c}),a}))}function Kf(e,t,r){const n=e.signer||e.provider;return function(...i){return zf(this,void 0,void 0,(function*(){let o;if(i.length===t.inputs.length+1&&"object"==typeof i[i.length-1]){const e=wa(i.pop());null!=e.blockTag&&(o=yield e.blockTag),delete e.blockTag,i.push(e)}null!=e.deployTransaction&&(yield e._deployed(o));const a=yield Hf(e,t,i),s=yield n.call(a,o);try{let n=e.interface.decodeFunctionResult(t,s);return r&&1===t.outputs.length&&(n=n[0]),n}catch(t){throw t.code===wo.errors.CALL_EXCEPTION&&(t.address=e.address,t.args=i,t.transaction=a),t}}))}}function Jf(e,t){return function(...r){return zf(this,void 0,void 0,(function*(){e.signer||Uf.throwError("sending a transaction requires a signer",wo.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction"}),null!=e.deployTransaction&&(yield e._deployed());const n=yield Hf(e,t,r),i=yield e.signer.sendTransaction(n);return function(e,t){const r=t.wait.bind(t);t.wait=t=>r(t).then((t=>(t.events=t.logs.map((r=>{let n=Sa(r),i=null;try{i=e.interface.parseLog(r)}catch(e){}return i&&(n.args=i.args,n.decode=(t,r)=>e.interface.decodeEventLog(i.eventFragment,t,r),n.event=i.name,n.eventSignature=i.signature),n.removeListener=()=>e.provider,n.getBlock=()=>e.provider.getBlock(t.blockHash),n.getTransaction=()=>e.provider.getTransaction(t.transactionHash),n.getTransactionReceipt=()=>Promise.resolve(t),n})),t)))}(e,i),i}))}}function Wf(e,t,r){return t.constant?Kf(e,t,r):Jf(e,t)}function Gf(e){return!e.address||null!=e.topics&&0!==e.topics.length?(e.address||"*")+"@"+(e.topics?e.topics.map((e=>Array.isArray(e)?e.join("|"):e)).join(":"):""):"*"}class Vf{constructor(e,t){ga(this,"tag",e),ga(this,"filter",t),this._listeners=[]}addListener(e,t){this._listeners.push({listener:e,once:t})}removeListener(e){let t=!1;this._listeners=this._listeners.filter((r=>!(!t&&r.listener===e)||(t=!0,!1)))}removeAllListeners(){this._listeners=[]}listeners(){return this._listeners.map((e=>e.listener))}listenerCount(){return this._listeners.length}run(e){const t=this.listenerCount();return this._listeners=this._listeners.filter((t=>{const r=e.slice();return setTimeout((()=>{t.listener.apply(this,r)}),0),!t.once})),t}prepareEvent(e){}getEmit(e){return[e]}}class Zf extends Vf{constructor(){super("error",null)}}class Xf extends Vf{constructor(e,t,r,n){const i={address:e};let o=t.getEventTopic(r);n?(o!==n[0]&&Uf.throwArgumentError("topic mismatch","topics",n),i.topics=n.slice()):i.topics=[o],super(Gf(i),i),ga(this,"address",e),ga(this,"interface",t),ga(this,"fragment",r)}prepareEvent(e){super.prepareEvent(e),e.event=this.fragment.name,e.eventSignature=this.fragment.format(),e.decode=(e,t)=>this.interface.decodeEventLog(this.fragment,e,t);try{e.args=this.interface.decodeEventLog(this.fragment,e.data,e.topics)}catch(t){e.args=null,e.decodeError=t}}getEmit(e){const t=Qa(e.args);if(t.length)throw t[0].error;const r=(e.args||[]).slice();return r.push(e),r}}class Qf extends Vf{constructor(e,t){super("*",{address:e}),ga(this,"address",e),ga(this,"interface",t)}prepareEvent(e){super.prepareEvent(e);try{const t=this.interface.parseLog(e);e.event=t.name,e.eventSignature=t.signature,e.decode=(e,r)=>this.interface.decodeEventLog(t.eventFragment,e,r),e.args=t.args}catch(e){}}}class Yf{constructor(e,t,r){ga(this,"interface",ya(new.target,"getInterface")(t)),null==r?(ga(this,"provider",null),ga(this,"signer",null)):Cu.isSigner(r)?(ga(this,"provider",r.provider||null),ga(this,"signer",r)):Su.isProvider(r)?(ga(this,"provider",r),ga(this,"signer",null)):Uf.throwArgumentError("invalid signer or provider","signerOrProvider",r),ga(this,"callStatic",{}),ga(this,"estimateGas",{}),ga(this,"functions",{}),ga(this,"populateTransaction",{}),ga(this,"filters",{});{const e={};Object.keys(this.interface.events).forEach((t=>{const r=this.interface.events[t];ga(this.filters,t,((...e)=>({address:this.address,topics:this.interface.encodeFilterTopics(r,e)}))),e[r.name]||(e[r.name]=[]),e[r.name].push(t)})),Object.keys(e).forEach((t=>{const r=e[t];1===r.length?ga(this.filters,t,this.filters[r[0]]):Uf.warn(`Duplicate definition of ${t} (${r.join(", ")})`)}))}if(ga(this,"_runningEvents",{}),ga(this,"_wrappedEmits",{}),null==e&&Uf.throwArgumentError("invalid contract address or ENS name","addressOrName",e),ga(this,"address",e),this.provider)ga(this,"resolvedAddress",Lf(this.provider,e));else try{ga(this,"resolvedAddress",Promise.resolve(ws(e)))}catch(e){Uf.throwError("provider is required to use ENS name as contract address",wo.errors.UNSUPPORTED_OPERATION,{operation:"new Contract"})}this.resolvedAddress.catch((e=>{}));const n={},i={};Object.keys(this.interface.functions).forEach((e=>{const t=this.interface.functions[e];if(i[e])Uf.warn(`Duplicate ABI entry for ${JSON.stringify(e)}`);else{i[e]=!0;{const r=t.name;n[`%${r}`]||(n[`%${r}`]=[]),n[`%${r}`].push(e)}null==this[e]&&ga(this,e,Wf(this,t,!0)),null==this.functions[e]&&ga(this.functions,e,Wf(this,t,!1)),null==this.callStatic[e]&&ga(this.callStatic,e,Kf(this,t,!0)),null==this.populateTransaction[e]&&ga(this.populateTransaction,e,function(e,t){return function(...r){return Hf(e,t,r)}}(this,t)),null==this.estimateGas[e]&&ga(this.estimateGas,e,function(e,t){const r=e.signer||e.provider;return function(...n){return zf(this,void 0,void 0,(function*(){r||Uf.throwError("estimate require a provider or signer",wo.errors.UNSUPPORTED_OPERATION,{operation:"estimateGas"});const i=yield Hf(e,t,n);return yield r.estimateGas(i)}))}}(this,t))}})),Object.keys(n).forEach((e=>{const t=n[e];if(t.length>1)return;e=e.substring(1);const r=t[0];try{null==this[e]&&ga(this,e,this[r])}catch(e){}null==this.functions[e]&&ga(this.functions,e,this.functions[r]),null==this.callStatic[e]&&ga(this.callStatic,e,this.callStatic[r]),null==this.populateTransaction[e]&&ga(this.populateTransaction,e,this.populateTransaction[r]),null==this.estimateGas[e]&&ga(this.estimateGas,e,this.estimateGas[r])}))}static getContractAddress(e){return As(e)}static getInterface(e){return vu.isInterface(e)?e:new vu(e)}deployed(){return this._deployed()}_deployed(e){return this._deployedPromise||(this.deployTransaction?this._deployedPromise=this.deployTransaction.wait().then((()=>this)):this._deployedPromise=this.provider.getCode(this.address,e).then((e=>("0x"===e&&Uf.throwError("contract not deployed",wo.errors.UNSUPPORTED_OPERATION,{contractAddress:this.address,operation:"getDeployed"}),this)))),this._deployedPromise}fallback(e){this.signer||Uf.throwError("sending a transactions require a signer",wo.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction(fallback)"});const t=wa(e||{});return["from","to"].forEach((function(e){null!=t[e]&&Uf.throwError("cannot override "+e,wo.errors.UNSUPPORTED_OPERATION,{operation:e})})),t.to=this.resolvedAddress,this.deployed().then((()=>this.signer.sendTransaction(t)))}connect(e){"string"==typeof e&&(e=new Iu(e,this.provider));const t=new this.constructor(this.address,this.interface,e);return this.deployTransaction&&ga(t,"deployTransaction",this.deployTransaction),t}attach(e){return new this.constructor(e,this.interface,this.signer||this.provider)}static isIndexed(e){return gu.isIndexed(e)}_normalizeRunningEvent(e){return this._runningEvents[e.tag]?this._runningEvents[e.tag]:e}_getRunningEvent(e){if("string"==typeof e){if("error"===e)return this._normalizeRunningEvent(new Zf);if("event"===e)return this._normalizeRunningEvent(new Vf("event",null));if("*"===e)return this._normalizeRunningEvent(new Qf(this.address,this.interface));const t=this.interface.getEvent(e);return this._normalizeRunningEvent(new Xf(this.address,this.interface,t))}if(e.topics&&e.topics.length>0){try{const t=e.topics[0];if("string"!=typeof t)throw new Error("invalid topic");const r=this.interface.getEvent(t);return this._normalizeRunningEvent(new Xf(this.address,this.interface,r,e.topics))}catch(e){}const t={address:this.address,topics:e.topics};return this._normalizeRunningEvent(new Vf(Gf(t),t))}return this._normalizeRunningEvent(new Qf(this.address,this.interface))}_checkRunningEvents(e){if(0===e.listenerCount()){delete this._runningEvents[e.tag];const t=this._wrappedEmits[e.tag];t&&e.filter&&(this.provider.off(e.filter,t),delete this._wrappedEmits[e.tag])}}_wrapEvent(e,t,r){const n=Sa(t);return n.removeListener=()=>{r&&(e.removeListener(r),this._checkRunningEvents(e))},n.getBlock=()=>this.provider.getBlock(t.blockHash),n.getTransaction=()=>this.provider.getTransaction(t.transactionHash),n.getTransactionReceipt=()=>this.provider.getTransactionReceipt(t.transactionHash),e.prepareEvent(n),n}_addEventListener(e,t,r){if(this.provider||Uf.throwError("events require a provider or a signer with a provider",wo.errors.UNSUPPORTED_OPERATION,{operation:"once"}),e.addListener(t,r),this._runningEvents[e.tag]=e,!this._wrappedEmits[e.tag]){const r=r=>{let n=this._wrapEvent(e,r,t);if(null==n.decodeError)try{const t=e.getEmit(n);this.emit(e.filter,...t)}catch(e){n.decodeError=e.error}null!=e.filter&&this.emit("event",n),null!=n.decodeError&&this.emit("error",n.decodeError,n)};this._wrappedEmits[e.tag]=r,null!=e.filter&&this.provider.on(e.filter,r)}}queryFilter(e,t,r){const n=this._getRunningEvent(e),i=wa(n.filter);return"string"==typeof t&&No(t,32)?(null!=r&&Uf.throwArgumentError("cannot specify toBlock with blockhash","toBlock",r),i.blockHash=t):(i.fromBlock=null!=t?t:0,i.toBlock=null!=r?r:"latest"),this.provider.getLogs(i).then((e=>e.map((e=>this._wrapEvent(n,e,null)))))}on(e,t){return this._addEventListener(this._getRunningEvent(e),t,!1),this}once(e,t){return this._addEventListener(this._getRunningEvent(e),t,!0),this}emit(e,...t){if(!this.provider)return!1;const r=this._getRunningEvent(e),n=r.run(t)>0;return this._checkRunningEvents(r),n}listenerCount(e){return this.provider?null==e?Object.keys(this._runningEvents).reduce(((e,t)=>e+this._runningEvents[t].listenerCount()),0):this._getRunningEvent(e).listenerCount():0}listeners(e){if(!this.provider)return[];if(null==e){const e=[];for(let t in this._runningEvents)this._runningEvents[t].listeners().forEach((t=>{e.push(t)}));return e}return this._getRunningEvent(e).listeners()}removeAllListeners(e){if(!this.provider)return this;if(null==e){for(const e in this._runningEvents){const t=this._runningEvents[e];t.removeAllListeners(),this._checkRunningEvents(t)}return this}const t=this._getRunningEvent(e);return t.removeAllListeners(),this._checkRunningEvents(t),this}off(e,t){if(!this.provider)return this;const r=this._getRunningEvent(e);return r.removeListener(t),this._checkRunningEvents(r),this}removeListener(e,t){return this.off(e,t)}}class ed extends Yf{}class td{constructor(e){ga(this,"alphabet",e),ga(this,"base",e.length),ga(this,"_alphabetMap",{}),ga(this,"_leader",e.charAt(0));for(let t=0;t0;)r.push(n%this.base),n=n/this.base|0}let n="";for(let e=0;0===t[e]&&e=0;--e)n+=this.alphabet[r[e]];return n}decode(e){if("string"!=typeof e)throw new TypeError("Expected String");let t=[];if(0===e.length)return new Uint8Array(t);t.push(0);for(let r=0;r>=8;for(;i>0;)t.push(255&i),i>>=8}for(let r=0;e[r]===this._leader&&r>24&255,c[t.length+1]=d>>16&255,c[t.length+2]=d>>8&255,c[t.length+3]=255&d;let l=Mo(ud(i,e,c));o||(o=l.length,f=new Uint8Array(o),a=Math.ceil(n/o),u=n-(a-1)*o),f.set(l);for(let t=1;t=256)throw new Error("Depth too large!");return Sd(Co([null!=this.privateKey?"0x0488ADE4":"0x0488B21E",To(this.depth),this.parentFingerprint,zo(To(this.index),4),this.chainCode,null!=this.privateKey?Co(["0x00",this.privateKey]):this.publicKey]))}neuter(){return new Md(xd,null,this.publicKey,this.parentFingerprint,this.chainCode,this.index,this.depth,this.path)}_derive(e){if(e>4294967295)throw new Error("invalid index - "+String(e));let t=this.path;t&&(t+="/"+(2147483647&e));const r=new Uint8Array(37);if(e&Ad){if(!this.privateKey)throw new Error("cannot derive child of neutered node");r.set(Mo(this.privateKey),1),t&&(t+="'")}else r.set(Mo(this.publicKey));for(let t=24;t>=0;t-=8)r[33+(t>>3)]=e>>24-t&255;const n=Mo(ud(id.sha512,this.chainCode,r)),i=n.slice(0,32),o=n.slice(32);let a=null,s=null;if(this.privateKey)a=Ed(Zo.from(i).add(this.privateKey).mod(vd));else{s=new bf(To(i))._addPoint(this.publicKey)}let c=t;const u=this.mnemonic;return u&&(c=Object.freeze({phrase:u.phrase,path:t,locale:u.locale||"en"})),new Md(xd,a,s,this.fingerprint,Ed(o),e,this.depth+1,c)}derivePath(e){const t=e.split("/");if(0===t.length||"m"===t[0]&&0!==this.depth)throw new Error("invalid path - "+e);"m"===t[0]&&t.shift();let r=this;for(let e=0;e=Ad)throw new Error("invalid path index - "+n);r=r._derive(Ad+e)}else{if(!n.match(/^[0-9]+$/))throw new Error("invalid path component - "+n);{const e=parseInt(n);if(e>=Ad)throw new Error("invalid path index - "+n);r=r._derive(e)}}}return r}static _fromSeed(e,t){const r=Mo(e);if(r.length<16||r.length>64)throw new Error("invalid seed");const n=Mo(ud(id.sha512,wd,r));return new Md(xd,Ed(n.slice(0,32)),null,"0x00000000",Ed(n.slice(32)),0,0,t)}static fromMnemonic(e,t,r){return e=Rd(Id(e,r=Pd(r)),r),Md._fromSeed(Cd(e,t),{phrase:e,path:"m",locale:r.locale})}static fromSeed(e){return Md._fromSeed(e,null)}static fromExtendedKey(e){const t=nd.decode(e);82===t.length&&Sd(t.slice(0,78))===e||bd.throwArgumentError("invalid extended key","extendedKey","[REDACTED]");const r=t[4],n=To(t.slice(5,9)),i=parseInt(To(t.slice(9,13)).substring(2),16),o=To(t.slice(13,45)),a=t.slice(45,78);switch(To(t.slice(0,4))){case"0x0488b21e":case"0x043587cf":return new Md(xd,null,To(a),n,o,i,r,null);case"0x0488ade4":case"0x04358394 ":if(0!==a[0])break;return new Md(xd,To(a.slice(1)),null,n,o,i,r,null)}return bd.throwArgumentError("invalid extended key","extendedKey","[REDACTED]")}}function Cd(e,t){t||(t="");const r=Js("mnemonic"+t,Us.NFKD);return dd(Js(e,Us.NFKD),r,2048,64,"sha512")}function Id(e,t){t=Pd(t),bd.checkNormalize();const r=t.split(e);if(r.length%3!=0)throw new Error("invalid mnemonic");const n=Mo(new Uint8Array(Math.ceil(11*r.length/8)));let i=0;for(let e=0;e>3]|=1<<7-i%8),i++}const o=32*r.length/3,a=_d(r.length/3);if((Mo(cd(n.slice(0,o/8)))[0]&a)!==(n[n.length-1]&a))throw new Error("invalid checksum");return To(n.slice(0,o/8))}function Rd(e,t){if(t=Pd(t),(e=Mo(e)).length%4!=0||e.length<16||e.length>32)throw new Error("invalid entropy");const r=[0];let n=11;for(let t=0;t8?(r[r.length-1]<<=8,r[r.length-1]|=e[t],n-=8):(r[r.length-1]<<=n,r[r.length-1]|=e[t]>>8-n,r.push(e[t]&(1<<8-n)-1),n+=3);const i=e.length/4,o=Mo(cd(e))[0]&_d(i);return r[r.length-1]<<=i,r[r.length-1]|=o>>8-i,t.join(r.map((e=>t.getWord(e))))}var Nd=Object.freeze({__proto__:null,HDNode:Md,defaultPath:kd,entropyToMnemonic:Rd,getAccountPath:function(e){return("number"!=typeof e||e<0||e>=Ad||e%1)&&bd.throwArgumentError("invalid account index","index",e),`m/44'/60'/${e}'/0/0`},isValidMnemonic:function(e,t){try{return Id(e,t),!0}catch(e){}return!1},mnemonicToEntropy:Id,mnemonicToSeed:Cd});const Od=new wo("random/5.7.0");const Td=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")}();let jd=Td.crypto||Td.msCrypto;function Dd(e){(e<=0||e>1024||e%1||e!=e)&&Od.throwArgumentError("invalid length","length",e);const t=new Uint8Array(e);return jd.getRandomValues(t),Mo(t)}jd&&jd.getRandomValues||(Od.warn("WARNING: Missing strong random number source"),jd={getRandomValues:function(e){return Od.throwError("no secure random source avaialble",wo.errors.UNSUPPORTED_OPERATION,{operation:"crypto.getRandomValues"})}});var $d=Object.freeze({__proto__:null,randomBytes:Dd,shuffled:function(e){for(let t=(e=e.slice()).length-1;t>0;t--){const r=Math.floor(Math.random()*(t+1)),n=e[t];e[t]=e[r],e[r]=n}return e}}),Bd={exports:{}};!function(e,t){!function(t){function r(e){return parseInt(e)===e}function n(e){if(!r(e.length))return!1;for(var t=0;t255)return!1;return!0}function i(e,t){if(e.buffer&&ArrayBuffer.isView(e)&&"Uint8Array"===e.name)return t&&(e=e.slice?e.slice():Array.prototype.slice.call(e)),e;if(Array.isArray(e)){if(!n(e))throw new Error("Array contains invalid value: "+e);return new Uint8Array(e)}if(r(e.length)&&n(e))return new Uint8Array(e);throw new Error("unsupported array-like object")}function o(e){return new Uint8Array(e)}function a(e,t,r,n,i){null==n&&null==i||(e=e.slice?e.slice(n,i):Array.prototype.slice.call(e,n,i)),t.set(e,r)}var s,c={toBytes:function(e){var t=[],r=0;for(e=encodeURI(e);r191&&n<224?(t.push(String.fromCharCode((31&n)<<6|63&e[r+1])),r+=2):(t.push(String.fromCharCode((15&n)<<12|(63&e[r+1])<<6|63&e[r+2])),r+=3)}return t.join("")}},u=(s="0123456789abcdef",{toBytes:function(e){for(var t=[],r=0;r>4]+s[15&n])}return t.join("")}}),f={16:10,24:12,32:14},d=[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],l=[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],h=[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],p=[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],m=[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],g=[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],y=[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],b=[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],v=[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],w=[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],A=[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],_=[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],E=[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],S=[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],P=[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 x(e){for(var t=[],r=0;r>2,this._Ke[r][t%4]=o[t],this._Kd[e-r][t%4]=o[t];for(var a,s=0,c=i;c>16&255]<<24^l[a>>8&255]<<16^l[255&a]<<8^l[a>>24&255]^d[s]<<24,s+=1,8!=i)for(t=1;t>8&255]<<8^l[a>>16&255]<<16^l[a>>24&255]<<24;for(t=i/2+1;t>2,h=c%4,this._Ke[u][h]=o[t],this._Kd[e-u][h]=o[t++],c++}for(var u=1;u>24&255]^E[a>>16&255]^S[a>>8&255]^P[255&a]},k.prototype.encrypt=function(e){if(16!=e.length)throw new Error("invalid plaintext size (must be 16 bytes)");for(var t=this._Ke.length-1,r=[0,0,0,0],n=x(e),i=0;i<4;i++)n[i]^=this._Ke[0][i];for(var a=1;a>24&255]^m[n[(i+1)%4]>>16&255]^g[n[(i+2)%4]>>8&255]^y[255&n[(i+3)%4]]^this._Ke[a][i];n=r.slice()}var s,c=o(16);for(i=0;i<4;i++)s=this._Ke[t][i],c[4*i]=255&(l[n[i]>>24&255]^s>>24),c[4*i+1]=255&(l[n[(i+1)%4]>>16&255]^s>>16),c[4*i+2]=255&(l[n[(i+2)%4]>>8&255]^s>>8),c[4*i+3]=255&(l[255&n[(i+3)%4]]^s);return c},k.prototype.decrypt=function(e){if(16!=e.length)throw new Error("invalid ciphertext size (must be 16 bytes)");for(var t=this._Kd.length-1,r=[0,0,0,0],n=x(e),i=0;i<4;i++)n[i]^=this._Kd[0][i];for(var a=1;a>24&255]^v[n[(i+3)%4]>>16&255]^w[n[(i+2)%4]>>8&255]^A[255&n[(i+1)%4]]^this._Kd[a][i];n=r.slice()}var s,c=o(16);for(i=0;i<4;i++)s=this._Kd[t][i],c[4*i]=255&(h[n[i]>>24&255]^s>>24),c[4*i+1]=255&(h[n[(i+3)%4]>>16&255]^s>>16),c[4*i+2]=255&(h[n[(i+2)%4]>>8&255]^s>>8),c[4*i+3]=255&(h[255&n[(i+1)%4]]^s);return c};var M=function(e){if(!(this instanceof M))throw Error("AES must be instanitated with `new`");this.description="Electronic Code Block",this.name="ecb",this._aes=new k(e)};M.prototype.encrypt=function(e){if((e=i(e)).length%16!=0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var t=o(e.length),r=o(16),n=0;n=0;--t)this._counter[t]=e%256,e>>=8},N.prototype.setBytes=function(e){if(16!=(e=i(e,!0)).length)throw new Error("invalid counter bytes size (must be 16 bytes)");this._counter=e},N.prototype.increment=function(){for(var e=15;e>=0;e--){if(255!==this._counter[e]){this._counter[e]++;break}this._counter[e]=0}};var O=function(e,t){if(!(this instanceof O))throw Error("AES must be instanitated with `new`");this.description="Counter",this.name="ctr",t instanceof N||(t=new N(t)),this._counter=t,this._remainingCounter=null,this._remainingCounterIndex=16,this._aes=new k(e)};O.prototype.encrypt=function(e){for(var t=i(e,!0),r=0;r16)throw new Error("PKCS#7 padding byte out of range");for(var r=e.length-t,n=0;n=64;){let h,p,m,g,y,b=r,v=n,w=i,A=o,_=a,E=s,S=c,P=u;for(p=0;p<16;p++)m=d+4*p,f[p]=(255&e[m])<<24|(255&e[m+1])<<16|(255&e[m+2])<<8|255&e[m+3];for(p=16;p<64;p++)h=f[p-2],g=(h>>>17|h<<15)^(h>>>19|h<<13)^h>>>10,h=f[p-15],y=(h>>>7|h<<25)^(h>>>18|h<<14)^h>>>3,f[p]=(g+f[p-7]|0)+(y+f[p-16]|0)|0;for(p=0;p<64;p++)g=(((_>>>6|_<<26)^(_>>>11|_<<21)^(_>>>25|_<<7))+(_&E^~_&S)|0)+(P+(t[p]+f[p]|0)|0)|0,y=((b>>>2|b<<30)^(b>>>13|b<<19)^(b>>>22|b<<10))+(b&v^b&w^v&w)|0,P=S,S=E,E=_,_=A+g|0,A=w,w=v,v=b,b=g+y|0;r=r+b|0,n=n+v|0,i=i+w|0,o=o+A|0,a=a+_|0,s=s+E|0,c=c+S|0,u=u+P|0,d+=64,l-=64}}d(e);let l,h=e.length%64,p=e.length/536870912|0,m=e.length<<3,g=h<56?56:120,y=e.slice(e.length-h,e.length);for(y.push(128),l=h+1;l>>24&255),y.push(p>>>16&255),y.push(p>>>8&255),y.push(p>>>0&255),y.push(m>>>24&255),y.push(m>>>16&255),y.push(m>>>8&255),y.push(m>>>0&255),d(y),[r>>>24&255,r>>>16&255,r>>>8&255,r>>>0&255,n>>>24&255,n>>>16&255,n>>>8&255,n>>>0&255,i>>>24&255,i>>>16&255,i>>>8&255,i>>>0&255,o>>>24&255,o>>>16&255,o>>>8&255,o>>>0&255,a>>>24&255,a>>>16&255,a>>>8&255,a>>>0&255,s>>>24&255,s>>>16&255,s>>>8&255,s>>>0&255,c>>>24&255,c>>>16&255,c>>>8&255,c>>>0&255,u>>>24&255,u>>>16&255,u>>>8&255,u>>>0&255]}function i(e,t,r){e=e.length<=64?e:n(e);const i=64+t.length+4,o=new Array(i),a=new Array(64);let s,c=[];for(s=0;s<64;s++)o[s]=54;for(s=0;s=i-4;e--){if(o[e]++,o[e]<=255)return;o[e]=0}}for(;r>=32;)u(),c=c.concat(n(a.concat(n(o)))),r-=32;return r>0&&(u(),c=c.concat(n(a.concat(n(o))).slice(0,r))),c}function o(e,t,r,n,i){let o;for(u(e,16*(2*r-1),i,0,16),o=0;o<2*r;o++)c(e,16*o,i,16),s(i,n),u(i,0,e,t+16*o,16);for(o=0;o>>32-t}function s(e,t){u(e,0,t,0,16);for(let e=8;e>0;e-=2)t[4]^=a(t[0]+t[12],7),t[8]^=a(t[4]+t[0],9),t[12]^=a(t[8]+t[4],13),t[0]^=a(t[12]+t[8],18),t[9]^=a(t[5]+t[1],7),t[13]^=a(t[9]+t[5],9),t[1]^=a(t[13]+t[9],13),t[5]^=a(t[1]+t[13],18),t[14]^=a(t[10]+t[6],7),t[2]^=a(t[14]+t[10],9),t[6]^=a(t[2]+t[14],13),t[10]^=a(t[6]+t[2],18),t[3]^=a(t[15]+t[11],7),t[7]^=a(t[3]+t[15],9),t[11]^=a(t[7]+t[3],13),t[15]^=a(t[11]+t[7],18),t[1]^=a(t[0]+t[3],7),t[2]^=a(t[1]+t[0],9),t[3]^=a(t[2]+t[1],13),t[0]^=a(t[3]+t[2],18),t[6]^=a(t[5]+t[4],7),t[7]^=a(t[6]+t[5],9),t[4]^=a(t[7]+t[6],13),t[5]^=a(t[4]+t[7],18),t[11]^=a(t[10]+t[9],7),t[8]^=a(t[11]+t[10],9),t[9]^=a(t[8]+t[11],13),t[10]^=a(t[9]+t[8],18),t[12]^=a(t[15]+t[14],7),t[13]^=a(t[12]+t[15],9),t[14]^=a(t[13]+t[12],13),t[15]^=a(t[14]+t[13],18);for(let r=0;r<16;++r)e[r]+=t[r]}function c(e,t,r,n){for(let i=0;i=256)return!1}return!0}function d(e,t){if("number"!=typeof e||e%1)throw new Error("invalid "+t);return e}function l(e,t,n,a,s,l,h){if(n=d(n,"N"),a=d(a,"r"),s=d(s,"p"),l=d(l,"dkLen"),0===n||0!=(n&n-1))throw new Error("N must be power of 2");if(n>r/128/a)throw new Error("N too large");if(a>r/128/s)throw new Error("r too large");if(!f(e))throw new Error("password must be an array or buffer");if(e=Array.prototype.slice.call(e),!f(t))throw new Error("salt must be an array or buffer");t=Array.prototype.slice.call(t);let p=i(e,t,128*s*a);const m=new Uint32Array(32*s*a);for(let e=0;eC&&(t=C);for(let e=0;eC&&(t=C);for(let e=0;e>0&255),p.push(m[e]>>8&255),p.push(m[e]>>16&255),p.push(m[e]>>24&255);const r=i(e,p,l);return h&&h(null,1,r),r}h&&I(R)};if(!h)for(;;){const e=R();if(null!=e)return e}R()}const h={scrypt:function(e,t,r,n,i,o,a){return new Promise((function(s,c){let u=0;a&&a(0),l(e,t,r,n,i,o,(function(e,t,r){if(e)c(e);else if(r)a&&1!==u&&a(1),s(new Uint8Array(r));else if(a&&t!==u)return u=t,a(t)}))}))},syncScrypt:function(e,t,r,n,i,o){return new Uint8Array(l(e,t,r,n,i,o))}};e.exports=h}()}(Xd);var Qd=f(Xd.exports),Yd=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))};const el=new wo(zd);function tl(e){return null!=e&&e.mnemonic&&e.mnemonic.phrase}class rl extends Pa{isKeystoreAccount(e){return!(!e||!e._isKeystoreAccount)}}function nl(e,t){const r=Ud(Hd(e,"crypto/ciphertext"));if(To(is(Co([t.slice(16,32),r]))).substring(2)!==Hd(e,"crypto/mac").toLowerCase())throw new Error("invalid password");const n=function(e,t,r){if("aes-128-ctr"===Hd(e,"crypto/cipher")){const n=Ud(Hd(e,"crypto/cipherparams/iv")),i=new Fd.Counter(n);return Mo(new Fd.ModeOfOperation.ctr(t,i).decrypt(r))}return null}(e,t.slice(0,16),r);n||el.throwError("unsupported cipher",wo.errors.UNSUPPORTED_OPERATION,{operation:"decrypt"});const i=t.slice(32,64),o=Mf(n);if(e.address){let t=e.address.toLowerCase();if("0x"!==t.substring(0,2)&&(t="0x"+t),ws(t)!==o)throw new Error("address mismatch")}const a={_isKeystoreAccount:!0,address:o,privateKey:To(n)};if("0.1"===Hd(e,"x-ethers/version")){const t=Ud(Hd(e,"x-ethers/mnemonicCiphertext")),r=Ud(Hd(e,"x-ethers/mnemonicCounter")),n=new Fd.Counter(r),o=new Fd.ModeOfOperation.ctr(i,n),s=Hd(e,"x-ethers/path")||kd,c=Hd(e,"x-ethers/locale")||"en",u=Mo(o.decrypt(t));try{const e=Rd(u,c),t=Md.fromMnemonic(e,null,c).derivePath(s);if(t.privateKey!=a.privateKey)throw new Error("mnemonic mismatch");a.mnemonic=t.mnemonic}catch(e){if(e.code!==wo.errors.INVALID_ARGUMENT||"wordlist"!==e.argument)throw e}}return new rl(a)}function il(e,t,r,n,i){return Mo(dd(e,t,r,n,i))}function ol(e,t,r,n,i){return Promise.resolve(il(e,t,r,n,i))}function al(e,t,r,n,i){const o=qd(t),a=Hd(e,"crypto/kdf");if(a&&"string"==typeof a){const t=function(e,t){return el.throwArgumentError("invalid key-derivation function parameters",e,t)};if("scrypt"===a.toLowerCase()){const r=Ud(Hd(e,"crypto/kdfparams/salt")),s=parseInt(Hd(e,"crypto/kdfparams/n")),c=parseInt(Hd(e,"crypto/kdfparams/r")),u=parseInt(Hd(e,"crypto/kdfparams/p"));s&&c&&u||t("kdf",a),0!=(s&s-1)&&t("N",s);const f=parseInt(Hd(e,"crypto/kdfparams/dklen"));return 32!==f&&t("dklen",f),n(o,r,s,c,u,64,i)}if("pbkdf2"===a.toLowerCase()){const n=Ud(Hd(e,"crypto/kdfparams/salt"));let i=null;const a=Hd(e,"crypto/kdfparams/prf");"hmac-sha256"===a?i="sha256":"hmac-sha512"===a?i="sha512":t("prf",a);const s=parseInt(Hd(e,"crypto/kdfparams/c")),c=parseInt(Hd(e,"crypto/kdfparams/dklen"));return 32!==c&&t("dklen",c),r(o,n,s,c,i)}}return el.throwArgumentError("unsupported key-derivation function","kdf",a)}function sl(e,t){const r=JSON.parse(e);return nl(r,al(r,t,il,Qd.syncScrypt))}function cl(e,t,r){return Yd(this,void 0,void 0,(function*(){const n=JSON.parse(e);return nl(n,yield al(n,t,ol,Qd.scrypt,r))}))}function ul(e,t,r,n){try{if(ws(e.address)!==Mf(e.privateKey))throw new Error("address/privateKey mismatch");if(tl(e)){const t=e.mnemonic;if(Md.fromMnemonic(t.phrase,null,t.locale).derivePath(t.path||kd).privateKey!=e.privateKey)throw new Error("mnemonic mismatch")}}catch(e){return Promise.reject(e)}"function"!=typeof r||n||(n=r,r={}),r||(r={});const i=Mo(e.privateKey),o=qd(t);let a=null,s=null,c=null;if(tl(e)){const t=e.mnemonic;a=Mo(Id(t.phrase,t.locale||"en")),s=t.path||kd,c=t.locale||"en"}let u=r.client;u||(u="ethers.js");let f=null;f=r.salt?Mo(r.salt):Dd(32);let d=null;if(r.iv){if(d=Mo(r.iv),16!==d.length)throw new Error("invalid iv")}else d=Dd(16);let l=null;if(r.uuid){if(l=Mo(r.uuid),16!==l.length)throw new Error("invalid uuid")}else l=Dd(16);let h=1<<17,p=8,m=1;return r.scrypt&&(r.scrypt.N&&(h=r.scrypt.N),r.scrypt.r&&(p=r.scrypt.r),r.scrypt.p&&(m=r.scrypt.p)),Qd.scrypt(o,f,h,p,m,64,n).then((t=>{const r=(t=Mo(t)).slice(0,16),n=t.slice(16,32),o=t.slice(32,64),g=new Fd.Counter(d),y=Mo(new Fd.ModeOfOperation.ctr(r,g).encrypt(i)),b=is(Co([n,y])),v={address:e.address.substring(2).toLowerCase(),id:Kd(l),version:3,crypto:{cipher:"aes-128-ctr",cipherparams:{iv:To(d).substring(2)},ciphertext:To(y).substring(2),kdf:"scrypt",kdfparams:{salt:To(f).substring(2),n:h,dklen:32,p:m,r:p},mac:b.substring(2)}};if(a){const e=Dd(16),t=new Fd.Counter(e),r=Mo(new Fd.ModeOfOperation.ctr(o,t).encrypt(a)),n=new Date,i=n.getUTCFullYear()+"-"+Ld(n.getUTCMonth()+1,2)+"-"+Ld(n.getUTCDate(),2)+"T"+Ld(n.getUTCHours(),2)+"-"+Ld(n.getUTCMinutes(),2)+"-"+Ld(n.getUTCSeconds(),2)+".0Z";v["x-ethers"]={client:u,gethFilename:"UTC--"+i+"--"+v.address,mnemonicCounter:To(e).substring(2),mnemonicCiphertext:To(r).substring(2),path:s,locale:c,version:"0.1"}}return JSON.stringify(v)}))}function fl(e,t,r){if(Vd(e)){r&&r(0);const n=Gd(e,t);return r&&r(1),Promise.resolve(n)}return Zd(e)?cl(e,t,r):Promise.reject(new Error("invalid JSON wallet"))}function dl(e,t){if(Vd(e))return Gd(e,t);if(Zd(e))return sl(e,t);throw new Error("invalid JSON wallet")}var ll=Object.freeze({__proto__:null,decryptCrowdsale:Gd,decryptJsonWallet:fl,decryptJsonWalletSync:dl,decryptKeystore:cl,decryptKeystoreSync:sl,encryptKeystore:ul,getJsonWalletAddress:function(e){if(Vd(e))try{return ws(JSON.parse(e).ethaddr)}catch(e){return null}if(Zd(e))try{return ws(JSON.parse(e).address)}catch(e){return null}return null},isCrowdsaleWallet:Vd,isKeystoreWallet:Zd});var hl=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))};const pl=new wo("wallet/5.7.0");class ml extends Cu{constructor(e,t){if(super(),null!=(r=e)&&No(r.privateKey,32)&&null!=r.address){const t=new bf(e.privateKey);if(ga(this,"_signingKey",(()=>t)),ga(this,"address",Mf(this.publicKey)),this.address!==ws(e.address)&&pl.throwArgumentError("privateKey/address mismatch","privateKey","[REDACTED]"),function(e){const t=e.mnemonic;return t&&t.phrase}(e)){const t=e.mnemonic;ga(this,"_mnemonic",(()=>({phrase:t.phrase,path:t.path||kd,locale:t.locale||"en"})));const r=this.mnemonic;Mf(Md.fromMnemonic(r.phrase,null,r.locale).derivePath(r.path).privateKey)!==this.address&&pl.throwArgumentError("mnemonic/address mismatch","privateKey","[REDACTED]")}else ga(this,"_mnemonic",(()=>null))}else{if(bf.isSigningKey(e))"secp256k1"!==e.curve&&pl.throwArgumentError("unsupported curve; must be secp256k1","privateKey","[REDACTED]"),ga(this,"_signingKey",(()=>e));else{"string"==typeof e&&e.match(/^[0-9a-f]*$/i)&&64===e.length&&(e="0x"+e);const t=new bf(e);ga(this,"_signingKey",(()=>t))}ga(this,"_mnemonic",(()=>null)),ga(this,"address",Mf(this.publicKey))}var r;t&&!Su.isProvider(t)&&pl.throwArgumentError("invalid provider","provider",t),ga(this,"provider",t||null)}get mnemonic(){return this._mnemonic()}get privateKey(){return this._signingKey().privateKey}get publicKey(){return this._signingKey().publicKey}getAddress(){return Promise.resolve(this.address)}connect(e){return new ml(this,e)}signTransaction(e){return ba(e).then((t=>{null!=t.from&&(ws(t.from)!==this.address&&pl.throwArgumentError("transaction from address mismatch","transaction.from",e.from),delete t.from);const r=this._signingKey().signDigest(is(Df(t)));return Df(t,r)}))}signMessage(e){return hl(this,void 0,void 0,(function*(){return Lo(this._signingKey().signDigest(Gc(e)))}))}_signTypedData(e,t,r){return hl(this,void 0,void 0,(function*(){const n=yield fu.resolveNames(e,t,r,(e=>(null==this.provider&&pl.throwError("cannot resolve ENS names without a provider",wo.errors.UNSUPPORTED_OPERATION,{operation:"resolveName",value:e}),this.provider.resolveName(e))));return Lo(this._signingKey().signDigest(fu.hash(n.domain,t,n.value)))}))}encrypt(e,t,r){if("function"!=typeof t||r||(r=t,t={}),r&&"function"!=typeof r)throw new Error("invalid callback");return t||(t={}),ul(this,e,t,r)}static createRandom(e){let t=Dd(16);e||(e={}),e.extraEntropy&&(t=Mo(Do(is(Co([t,e.extraEntropy])),0,16)));const r=Rd(t,e.locale);return ml.fromMnemonic(r,e.path,e.locale)}static fromEncryptedJson(e,t,r){return fl(e,t,r).then((e=>new ml(e)))}static fromEncryptedJsonSync(e,t){return new ml(dl(e,t))}static fromMnemonic(e,t,r){return t||(t=kd),new ml(Md.fromMnemonic(e,null,r).derivePath(t))}}var gl=Object.freeze({__proto__:null,Wallet:ml,verifyMessage:function(e,t){return Cf(Gc(e),t)},verifyTypedData:function(e,t,r,n){return Cf(fu.hash(e,t,r),n)}});const yl=new wo("networks/5.7.1");function bl(e){const t=function(t,r){null==r&&(r={});const n=[];if(t.InfuraProvider&&"-"!==r.infura)try{n.push(new t.InfuraProvider(e,r.infura))}catch(e){}if(t.EtherscanProvider&&"-"!==r.etherscan)try{n.push(new t.EtherscanProvider(e,r.etherscan))}catch(e){}if(t.AlchemyProvider&&"-"!==r.alchemy)try{n.push(new t.AlchemyProvider(e,r.alchemy))}catch(e){}if(t.PocketProvider&&"-"!==r.pocket){const i=["goerli","ropsten","rinkeby","sepolia"];try{const o=new t.PocketProvider(e,r.pocket);o.network&&-1===i.indexOf(o.network.name)&&n.push(o)}catch(e){}}if(t.CloudflareProvider&&"-"!==r.cloudflare)try{n.push(new t.CloudflareProvider(e))}catch(e){}if(t.AnkrProvider&&"-"!==r.ankr)try{const i=["ropsten"],o=new t.AnkrProvider(e,r.ankr);o.network&&-1===i.indexOf(o.network.name)&&n.push(o)}catch(e){}if(0===n.length)return null;if(t.FallbackProvider){let i=1;return null!=r.quorum?i=r.quorum:"homestead"===e&&(i=2),new t.FallbackProvider(n,i)}return n[0]};return t.renetwork=function(e){return bl(e)},t}function vl(e,t){const r=function(r,n){return r.JsonRpcProvider?new r.JsonRpcProvider(e,t):null};return r.renetwork=function(t){return vl(e,t)},r}const wl={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:bl("homestead")},Al={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:bl("ropsten")},_l={chainId:63,name:"classicMordor",_defaultProvider:vl("https://www.ethercluster.com/mordor","classicMordor")},El={unspecified:{chainId:0,name:"unspecified"},homestead:wl,mainnet:wl,morden:{chainId:2,name:"morden"},ropsten:Al,testnet:Al,rinkeby:{chainId:4,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"rinkeby",_defaultProvider:bl("rinkeby")},kovan:{chainId:42,name:"kovan",_defaultProvider:bl("kovan")},goerli:{chainId:5,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"goerli",_defaultProvider:bl("goerli")},kintsugi:{chainId:1337702,name:"kintsugi"},sepolia:{chainId:11155111,name:"sepolia",_defaultProvider:bl("sepolia")},classic:{chainId:61,name:"classic",_defaultProvider:vl("https://www.ethercluster.com/etc","classic")},classicMorden:{chainId:62,name:"classicMorden"},classicMordor:_l,classicTestnet:_l,classicKotti:{chainId:6,name:"classicKotti",_defaultProvider:vl("https://www.ethercluster.com/kotti","classicKotti")},xdai:{chainId:100,name:"xdai"},matic:{chainId:137,name:"matic",_defaultProvider:bl("matic")},maticmum:{chainId:80001,name:"maticmum"},optimism:{chainId:10,name:"optimism",_defaultProvider:bl("optimism")},"optimism-kovan":{chainId:69,name:"optimism-kovan"},"optimism-goerli":{chainId:420,name:"optimism-goerli"},arbitrum:{chainId:42161,name:"arbitrum"},"arbitrum-rinkeby":{chainId:421611,name:"arbitrum-rinkeby"},"arbitrum-goerli":{chainId:421613,name:"arbitrum-goerli"},bnb:{chainId:56,name:"bnb"},bnbt:{chainId:97,name:"bnbt"}};var Sl=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))};function Pl(e,t){return Sl(this,void 0,void 0,(function*(){null==t&&(t={});const r={method:t.method||"GET",headers:t.headers||{},body:t.body||void 0};if(!0!==t.skipFetchSetup&&(r.mode="cors",r.cache="no-cache",r.credentials="same-origin",r.redirect="follow",r.referrer="client"),null!=t.fetchOptions){const e=t.fetchOptions;e.mode&&(r.mode=e.mode),e.cache&&(r.cache=e.cache),e.credentials&&(r.credentials=e.credentials),e.redirect&&(r.redirect=e.redirect),e.referrer&&(r.referrer=e.referrer)}const n=yield fetch(e,r),i=yield n.arrayBuffer(),o={};return n.headers.forEach?n.headers.forEach(((e,t)=>{o[t.toLowerCase()]=e})):n.headers.keys().forEach((e=>{o[e.toLowerCase()]=n.headers.get(e)})),{headers:o,statusCode:n.status,statusMessage:n.statusText,body:Mo(new Uint8Array(i))}}))}var xl=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))};const kl=new wo("web/5.7.1");function Ml(e){return new Promise((t=>{setTimeout(t,e)}))}function Cl(e,t){if(null==e)return null;if("string"==typeof e)return e;if(Po(e)){if(t&&("text"===t.split("/")[0]||"application/json"===t.split(";")[0].trim()))try{return Vs(e)}catch(e){}return To(e)}return e}function Il(e,t,r){const n="object"==typeof e&&null!=e.throttleLimit?e.throttleLimit:12;kl.assertArgument(n>0&&n%1==0,"invalid connection throttle limit","connection.throttleLimit",n);const i="object"==typeof e?e.throttleCallback:null,o="object"==typeof e&&"number"==typeof e.throttleSlotInterval?e.throttleSlotInterval:100;kl.assertArgument(o>0&&o%1==0,"invalid connection throttle slot interval","connection.throttleSlotInterval",o);const a="object"==typeof e&&!!e.errorPassThrough,s={};let c=null;const u={method:"GET"};let f=!1,d=12e4;if("string"==typeof e)c=e;else if("object"==typeof e){if(null!=e&&null!=e.url||kl.throwArgumentError("missing URL","connection.url",e),c=e.url,"number"==typeof e.timeout&&e.timeout>0&&(d=e.timeout),e.headers)for(const t in e.headers)s[t.toLowerCase()]={key:t,value:String(e.headers[t])},["if-none-match","if-modified-since"].indexOf(t.toLowerCase())>=0&&(f=!0);if(u.allowGzip=!!e.allowGzip,null!=e.user&&null!=e.password){"https:"!==c.substring(0,6)&&!0!==e.allowInsecureAuthentication&&kl.throwError("basic authentication requires a secure https url",wo.errors.INVALID_ARGUMENT,{argument:"url",url:c,user:e.user,password:"[REDACTED]"});const t=e.user+":"+e.password;s.authorization={key:"Authorization",value:"Basic "+bc(Js(t))}}null!=e.skipFetchSetup&&(u.skipFetchSetup=!!e.skipFetchSetup),null!=e.fetchOptions&&(u.fetchOptions=wa(e.fetchOptions))}const l=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),h=c?c.match(l):null;if(h)try{const e={statusCode:200,statusMessage:"OK",headers:{"content-type":h[1]||"text/plain"},body:h[2]?yc(h[3]):(p=h[3],Js(p.replace(/%([0-9a-f][0-9a-f])/gi,((e,t)=>String.fromCharCode(parseInt(t,16))))))};let t=e.body;return r&&(t=r(e.body,e)),Promise.resolve(t)}catch(e){kl.throwError("processing response error",wo.errors.SERVER_ERROR,{body:Cl(h[1],h[2]),error:e,requestBody:null,requestMethod:"GET",url:c})}var p;t&&(u.method="POST",u.body=t,null==s["content-type"]&&(s["content-type"]={key:"Content-Type",value:"application/octet-stream"}),null==s["content-length"]&&(s["content-length"]={key:"Content-Length",value:String(t.length)}));const m={};Object.keys(s).forEach((e=>{const t=s[e];m[t.key]=t.value})),u.headers=m;const g=function(){let e=null;return{promise:new Promise((function(t,r){d&&(e=setTimeout((()=>{null!=e&&(e=null,r(kl.makeError("timeout",wo.errors.TIMEOUT,{requestBody:Cl(u.body,m["content-type"]),requestMethod:u.method,timeout:d,url:c})))}),d))})),cancel:function(){null!=e&&(clearTimeout(e),e=null)}}}(),y=function(){return xl(this,void 0,void 0,(function*(){for(let e=0;e=300)&&(g.cancel(),kl.throwError("bad response",wo.errors.SERVER_ERROR,{status:t.statusCode,headers:t.headers,body:Cl(s,t.headers?t.headers["content-type"]:null),requestBody:Cl(u.body,m["content-type"]),requestMethod:u.method,url:c})),r)try{const e=yield r(s,t);return g.cancel(),e}catch(r){if(r.throttleRetry&&e"content-type"===e.toLowerCase())).length||(r.headers=wa(r.headers),r.headers["content-type"]="application/json")}else r.headers={"content-type":"application/json"};e=r}return Il(e,n,((e,t)=>{let n=null;if(null!=e)try{n=JSON.parse(Vs(e))}catch(t){kl.throwError("invalid JSON",wo.errors.SERVER_ERROR,{body:e,error:t})}return r&&(n=r(n,t)),n}))}function Nl(e,t){return t||(t={}),null==(t=wa(t)).floor&&(t.floor=0),null==t.ceiling&&(t.ceiling=1e4),null==t.interval&&(t.interval=250),new Promise((function(r,n){let i=null,o=!1;const a=()=>!o&&(o=!0,i&&clearTimeout(i),!0);t.timeout&&(i=setTimeout((()=>{a()&&n(new Error("timeout"))}),t.timeout));const s=t.retryLimit;let c=0;!function i(){return e().then((function(e){if(void 0!==e)a()&&r(e);else if(t.oncePoll)t.oncePoll.once("poll",i);else if(t.onceBlock)t.onceBlock.once("block",i);else if(!o){if(c++,c>s)return void(a()&&n(new Error("retry limit reached")));let e=t.interval*parseInt(String(Math.random()*Math.pow(2,c)));et.ceiling&&(e=t.ceiling),setTimeout(i,e)}return null}),(function(e){a()&&n(e)}))}()}))}for(var Ol=Object.freeze({__proto__:null,_fetchData:Il,fetchJson:Rl,poll:Nl}),Tl="qpzry9x8gf2tvdw0s3jn54khce6mua7l",jl={},Dl=0;Dl>25;return(33554431&e)<<5^996825010&-(t>>0&1)^642813549&-(t>>1&1)^513874426&-(t>>2&1)^1027748829&-(t>>3&1)^705979059&-(t>>4&1)}function Fl(e){for(var t=1,r=0;r126)return"Invalid prefix ("+e+")";t=Bl(t)^n>>5}for(t=Bl(t),r=0;rt)return"Exceeds length limit";var r=e.toLowerCase(),n=e.toUpperCase();if(e!==r&&e!==n)return"Mixed-case string "+e;var i=(e=r).lastIndexOf("1");if(-1===i)return"No separator character for "+e;if(0===i)return"Missing prefix for "+e;var o=e.slice(0,i),a=e.slice(i+1);if(a.length<6)return"Data too short";var s=Fl(o);if("string"==typeof s)return s;for(var c=[],u=0;u=a.length||c.push(d)}return 1!==s?"Invalid checksum for "+e:{prefix:o,words:c}}function Ul(e,t,r,n){for(var i=0,o=0,a=(1<=r;)o-=r,s.push(i>>o&a);if(n)o>0&&s.push(i<=t)return"Excess padding";if(i<r)throw new TypeError("Exceeds length limit");var n=Fl(e=e.toLowerCase());if("string"==typeof n)throw new Error(n);for(var i=e+"1",o=0;o>5!=0)throw new Error("Non 5-bit word");n=Bl(n)^a,i+=Tl.charAt(a)}for(o=0;o<6;++o)n=Bl(n);for(n^=1,o=0;o<6;++o){i+=Tl.charAt(n>>5*(5-o)&31)}return i},toWordsUnsafe:function(e){var t=Ul(e,8,5,!0);if(Array.isArray(t))return t},toWords:function(e){var t=Ul(e,8,5,!0);if(Array.isArray(t))return t;throw new Error(t)},fromWordsUnsafe:function(e){var t=Ul(e,5,8,!1);if(Array.isArray(t))return t},fromWords:function(e){var t=Ul(e,5,8,!1);if(Array.isArray(t))return t;throw new Error(t)}},ql=f(Ll);const Hl="providers/5.7.2",Kl=new wo(Hl);class Jl{constructor(){this.formats=this.getDefaultFormats()}getDefaultFormats(){const e={},t=this.address.bind(this),r=this.bigNumber.bind(this),n=this.blockTag.bind(this),i=this.data.bind(this),o=this.hash.bind(this),a=this.hex.bind(this),s=this.number.bind(this),c=this.type.bind(this);return e.transaction={hash:o,type:c,accessList:Jl.allowNull(this.accessList.bind(this),null),blockHash:Jl.allowNull(o,null),blockNumber:Jl.allowNull(s,null),transactionIndex:Jl.allowNull(s,null),confirmations:Jl.allowNull(s,null),from:t,gasPrice:Jl.allowNull(r),maxPriorityFeePerGas:Jl.allowNull(r),maxFeePerGas:Jl.allowNull(r),gasLimit:r,to:Jl.allowNull(t,null),value:r,nonce:s,data:i,r:Jl.allowNull(this.uint256),s:Jl.allowNull(this.uint256),v:Jl.allowNull(s),creates:Jl.allowNull(t,null),raw:Jl.allowNull(i)},e.transactionRequest={from:Jl.allowNull(t),nonce:Jl.allowNull(s),gasLimit:Jl.allowNull(r),gasPrice:Jl.allowNull(r),maxPriorityFeePerGas:Jl.allowNull(r),maxFeePerGas:Jl.allowNull(r),to:Jl.allowNull(t),value:Jl.allowNull(r),data:Jl.allowNull((e=>this.data(e,!0))),type:Jl.allowNull(s),accessList:Jl.allowNull(this.accessList.bind(this),null)},e.receiptLog={transactionIndex:s,blockNumber:s,transactionHash:o,address:t,topics:Jl.arrayOf(o),data:i,logIndex:s,blockHash:o},e.receipt={to:Jl.allowNull(this.address,null),from:Jl.allowNull(this.address,null),contractAddress:Jl.allowNull(t,null),transactionIndex:s,root:Jl.allowNull(a),gasUsed:r,logsBloom:Jl.allowNull(i),blockHash:o,transactionHash:o,logs:Jl.arrayOf(this.receiptLog.bind(this)),blockNumber:s,confirmations:Jl.allowNull(s,null),cumulativeGasUsed:r,effectiveGasPrice:Jl.allowNull(r),status:Jl.allowNull(s),type:c},e.block={hash:Jl.allowNull(o),parentHash:o,number:s,timestamp:s,nonce:Jl.allowNull(a),difficulty:this.difficulty.bind(this),gasLimit:r,gasUsed:r,miner:Jl.allowNull(t),extraData:i,transactions:Jl.allowNull(Jl.arrayOf(o)),baseFeePerGas:Jl.allowNull(r)},e.blockWithTransactions=wa(e.block),e.blockWithTransactions.transactions=Jl.allowNull(Jl.arrayOf(this.transactionResponse.bind(this))),e.filter={fromBlock:Jl.allowNull(n,void 0),toBlock:Jl.allowNull(n,void 0),blockHash:Jl.allowNull(o,void 0),address:Jl.allowNull(t,void 0),topics:Jl.allowNull(this.topics.bind(this),void 0)},e.filterLog={blockNumber:Jl.allowNull(s),blockHash:Jl.allowNull(o),transactionIndex:s,removed:Jl.allowNull(this.boolean.bind(this)),address:t,data:Jl.allowFalsish(i,"0x"),topics:Jl.arrayOf(o),transactionHash:o,logIndex:s},e}accessList(e){return Nf(e||[])}number(e){return"0x"===e?0:Zo.from(e).toNumber()}type(e){return"0x"===e||null==e?0:Zo.from(e).toNumber()}bigNumber(e){return Zo.from(e)}boolean(e){if("boolean"==typeof e)return e;if("string"==typeof e){if("true"===(e=e.toLowerCase()))return!0;if("false"===e)return!1}throw new Error("invalid boolean - "+e)}hex(e,t){return"string"==typeof e&&(t||"0x"===e.substring(0,2)||(e="0x"+e),No(e))?e.toLowerCase():Kl.throwArgumentError("invalid hash","value",e)}data(e,t){const r=this.hex(e,t);if(r.length%2!=0)throw new Error("invalid data; odd-length - "+e);return r}address(e){return ws(e)}callAddress(e){if(!No(e,32))return null;const t=ws(Do(e,12));return"0x0000000000000000000000000000000000000000"===t?null:t}contractAddress(e){return As(e)}blockTag(e){if(null==e)return"latest";if("earliest"===e)return"0x0";switch(e){case"earliest":return"0x0";case"latest":case"pending":case"safe":case"finalized":return e}if("number"==typeof e||No(e))return Bo(e);throw new Error("invalid blockTag")}hash(e,t){const r=this.hex(e,t);return 32!==jo(r)?Kl.throwArgumentError("invalid hash","value",e):r}difficulty(e){if(null==e)return null;const t=Zo.from(e);try{return t.toNumber()}catch(e){}return null}uint256(e){if(!No(e))throw new Error("invalid uint256");return zo(e,32)}_block(e,t){null!=e.author&&null==e.miner&&(e.miner=e.author);const r=null!=e._difficulty?e._difficulty:e.difficulty,n=Jl.check(t,e);return n._difficulty=null==r?null:Zo.from(r),n}block(e){return this._block(e,this.formats.block)}blockWithTransactions(e){return this._block(e,this.formats.blockWithTransactions)}transactionRequest(e){return Jl.check(this.formats.transactionRequest,e)}transactionResponse(e){null!=e.gas&&null==e.gasLimit&&(e.gasLimit=e.gas),e.to&&Zo.from(e.to).isZero()&&(e.to="0x0000000000000000000000000000000000000000"),null!=e.input&&null==e.data&&(e.data=e.input),null==e.to&&null==e.creates&&(e.creates=this.contractAddress(e)),1!==e.type&&2!==e.type||null!=e.accessList||(e.accessList=[]);const t=Jl.check(this.formats.transaction,e);if(null!=e.chainId){let r=e.chainId;No(r)&&(r=Zo.from(r).toNumber()),t.chainId=r}else{let r=e.networkId;null==r&&null==t.v&&(r=e.chainId),No(r)&&(r=Zo.from(r).toNumber()),"number"!=typeof r&&null!=t.v&&(r=(t.v-35)/2,r<0&&(r=0),r=parseInt(r)),"number"!=typeof r&&(r=0),t.chainId=r}return t.blockHash&&"x"===t.blockHash.replace(/0/g,"")&&(t.blockHash=null),t}transaction(e){return Bf(e)}receiptLog(e){return Jl.check(this.formats.receiptLog,e)}receipt(e){const t=Jl.check(this.formats.receipt,e);if(null!=t.root)if(t.root.length<=4){const e=Zo.from(t.root).toNumber();0===e||1===e?(null!=t.status&&t.status!==e&&Kl.throwArgumentError("alt-root-status/status mismatch","value",{root:t.root,status:t.status}),t.status=e,delete t.root):Kl.throwArgumentError("invalid alt-root-status","value.root",t.root)}else 66!==t.root.length&&Kl.throwArgumentError("invalid root hash","value.root",t.root);return null!=t.status&&(t.byzantium=!0),t}topics(e){return Array.isArray(e)?e.map((e=>this.topics(e))):null!=e?this.hash(e,!0):null}filter(e){return Jl.check(this.formats.filter,e)}filterLog(e){return Jl.check(this.formats.filterLog,e)}static check(e,t){const r={};for(const n in e)try{const i=e[n](t[n]);void 0!==i&&(r[n]=i)}catch(e){throw e.checkKey=n,e.checkValue=t[n],e}return r}static allowNull(e,t){return function(r){return null==r?t:e(r)}}static allowFalsish(e,t){return function(r){return r?e(r):t}}static arrayOf(e){return function(t){if(!Array.isArray(t))throw new Error("not an array");const r=[];return t.forEach((function(t){r.push(e(t))})),r}}}var Wl=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))};const Gl=new wo(Hl);function Vl(e){return null==e?"null":(32!==jo(e)&&Gl.throwArgumentError("invalid topic","topic",e),e.toLowerCase())}function Zl(e){for(e=e.slice();e.length>0&&null==e[e.length-1];)e.pop();return e.map((e=>{if(Array.isArray(e)){const t={};e.forEach((e=>{t[Vl(e)]=!0}));const r=Object.keys(t);return r.sort(),r.join("|")}return Vl(e)})).join("&")}function Xl(e){if("string"==typeof e){if(32===jo(e=e.toLowerCase()))return"tx:"+e;if(-1===e.indexOf(":"))return e}else{if(Array.isArray(e))return"filter:*:"+Zl(e);if(Eu.isForkEvent(e))throw Gl.warn("not implemented"),new Error("not implemented");if(e&&"object"==typeof e)return"filter:"+(e.address||"*")+":"+Zl(e.topics||[])}throw new Error("invalid event - "+e)}function Ql(){return(new Date).getTime()}function Yl(e){return new Promise((t=>{setTimeout(t,e)}))}const eh=["block","network","pending","poll"];class th{constructor(e,t,r){ga(this,"tag",e),ga(this,"listener",t),ga(this,"once",r),this._lastBlockNumber=-2,this._inflight=!1}get event(){switch(this.type){case"tx":return this.hash;case"filter":return this.filter}return this.tag}get type(){return this.tag.split(":")[0]}get hash(){const e=this.tag.split(":");return"tx"!==e[0]?null:e[1]}get filter(){const e=this.tag.split(":");if("filter"!==e[0])return null;const t=e[1],r=""===(n=e[2])?[]:n.split(/&/g).map((e=>{if(""===e)return[];const t=e.split("|").map((e=>"null"===e?null:e));return 1===t.length?t[0]:t}));var n;const i={};return r.length>0&&(i.topics=r),t&&"*"!==t&&(i.address=t),i}pollable(){return this.tag.indexOf(":")>=0||eh.indexOf(this.tag)>=0}}const rh={0:{symbol:"btc",p2pkh:0,p2sh:5,prefix:"bc"},2:{symbol:"ltc",p2pkh:48,p2sh:50,prefix:"ltc"},3:{symbol:"doge",p2pkh:30,p2sh:22},60:{symbol:"eth",ilk:"eth"},61:{symbol:"etc",ilk:"eth"},700:{symbol:"xdai",ilk:"eth"}};function nh(e){return zo(Zo.from(e).toHexString(),32)}function ih(e){return nd.encode(Co([e,Do(cd(cd(e)),0,4)]))}const oh=new RegExp("^(ipfs)://(.*)$","i"),ah=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),oh,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function sh(e,t){try{return Vs(ch(e,t))}catch(e){}return null}function ch(e,t){if("0x"===e)return null;const r=Zo.from(Do(e,t,t+32)).toNumber(),n=Zo.from(Do(e,r,r+32)).toNumber();return Do(e,r+32,r+32+n)}function uh(e){return e.match(/^ipfs:\/\/ipfs\//i)?e=e.substring(12):e.match(/^ipfs:\/\//i)?e=e.substring(7):Gl.throwArgumentError("unsupported IPFS format","link",e),`https://gateway.ipfs.io/ipfs/${e}`}function fh(e){const t=Mo(e);if(t.length>32)throw new Error("internal; should not happen");const r=new Uint8Array(32);return r.set(t,32-t.length),r}function dh(e){if(e.length%32==0)return e;const t=new Uint8Array(32*Math.ceil(e.length/32));return t.set(e),t}function lh(e){const t=[];let r=0;for(let n=0;nZo.from(e).eq(1))).catch((e=>{if(e.code===wo.errors.CALL_EXCEPTION)return!1;throw this._supportsEip2544=null,e}))),this._supportsEip2544}_fetch(e,t){return Wl(this,void 0,void 0,(function*(){const r={to:this.address,ccipReadEnabled:!0,data:$o([e,Kc(this.name),t||"0x"])};let n=!1;(yield this.supportsWildcard())&&(n=!0,r.data=$o(["0x9061b923",lh([Jc(this.name),r.data])]));try{let e=yield this.provider.call(r);return Mo(e).length%32==4&&Gl.throwError("resolver threw error",wo.errors.CALL_EXCEPTION,{transaction:r,data:e}),n&&(e=ch(e,0)),e}catch(e){if(e.code===wo.errors.CALL_EXCEPTION)return null;throw e}}))}_fetchBytes(e,t){return Wl(this,void 0,void 0,(function*(){const r=yield this._fetch(e,t);return null!=r?ch(r,0):null}))}_getAddress(e,t){const r=rh[String(e)];if(null==r&&Gl.throwError(`unsupported coin type: ${e}`,wo.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`}),"eth"===r.ilk)return this.provider.formatter.address(t);const n=Mo(t);if(null!=r.p2pkh){const e=t.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);if(e){const t=parseInt(e[1],16);if(e[2].length===2*t&&t>=1&&t<=75)return ih(Co([[r.p2pkh],"0x"+e[2]]))}}if(null!=r.p2sh){const e=t.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(e){const t=parseInt(e[1],16);if(e[2].length===2*t&&t>=1&&t<=75)return ih(Co([[r.p2sh],"0x"+e[2]]))}}if(null!=r.prefix){const e=n[1];let t=n[0];if(0===t?20!==e&&32!==e&&(t=-1):t=-1,t>=0&&n.length===2+e&&e>=1&&e<=75){const e=ql.toWords(n.slice(2));return e.unshift(t),ql.encode(r.prefix,e)}}return null}getAddress(e){return Wl(this,void 0,void 0,(function*(){if(null==e&&(e=60),60===e)try{const e=yield this._fetch("0x3b3b57de");return"0x"===e||e===Bs?null:this.provider.formatter.callAddress(e)}catch(e){if(e.code===wo.errors.CALL_EXCEPTION)return null;throw e}const t=yield this._fetchBytes("0xf1cb7e06",nh(e));if(null==t||"0x"===t)return null;const r=this._getAddress(e,t);return null==r&&Gl.throwError("invalid or unsupported coin data",wo.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`,coinType:e,data:t}),r}))}getAvatar(){return Wl(this,void 0,void 0,(function*(){const e=[{type:"name",content:this.name}];try{const t=yield this.getText("avatar");if(null==t)return null;for(let r=0;re[t]))}return Gl.throwError("invalid or unsupported content hash data",wo.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:e})}))}getText(e){return Wl(this,void 0,void 0,(function*(){let t=Js(e);t=Co([nh(64),nh(t.length),t]),t.length%32!=0&&(t=Co([t,zo("0x",32-e.length%32)]));const r=yield this._fetchBytes("0x59d1d43c",To(t));return null==r||"0x"===r?null:Vs(r)}))}}let ph=null,mh=1;class gh extends Su{constructor(e){if(super(),this._events=[],this._emitted={block:-2},this.disableCcipRead=!1,this.formatter=new.target.getFormatter(),ga(this,"anyNetwork","any"===e),this.anyNetwork&&(e=this.detectNetwork()),e instanceof Promise)this._networkPromise=e,e.catch((e=>{})),this._ready().catch((e=>{}));else{const t=ya(new.target,"getNetwork")(e);t?(ga(this,"_network",t),this.emit("network",t,null)):Gl.throwArgumentError("invalid network","network",e)}this._maxInternalBlockNumber=-1024,this._lastBlockNumber=-2,this._maxFilterBlockRange=10,this._pollingInterval=4e3,this._fastQueryDate=0}_ready(){return Wl(this,void 0,void 0,(function*(){if(null==this._network){let e=null;if(this._networkPromise)try{e=yield this._networkPromise}catch(e){}null==e&&(e=yield this.detectNetwork()),e||Gl.throwError("no network detected",wo.errors.UNKNOWN_ERROR,{}),null==this._network&&(this.anyNetwork?this._network=e:ga(this,"_network",e),this.emit("network",e,null))}return this._network}))}get ready(){return Nl((()=>this._ready().then((e=>e),(e=>{if(e.code!==wo.errors.NETWORK_ERROR||"noNetwork"!==e.event)throw e}))))}static getFormatter(){return null==ph&&(ph=new Jl),ph}static getNetwork(e){return function(e){if(null==e)return null;if("number"==typeof e){for(const t in El){const r=El[t];if(r.chainId===e)return{name:r.name,chainId:r.chainId,ensAddress:r.ensAddress||null,_defaultProvider:r._defaultProvider||null}}return{chainId:e,name:"unknown"}}if("string"==typeof e){const t=El[e];return null==t?null:{name:t.name,chainId:t.chainId,ensAddress:t.ensAddress,_defaultProvider:t._defaultProvider||null}}const t=El[e.name];if(!t)return"number"!=typeof e.chainId&&yl.throwArgumentError("invalid network chainId","network",e),e;0!==e.chainId&&e.chainId!==t.chainId&&yl.throwArgumentError("network chainId mismatch","network",e);let r=e._defaultProvider||null;var n;return null==r&&t._defaultProvider&&(r=(n=t._defaultProvider)&&"function"==typeof n.renetwork?t._defaultProvider.renetwork(e):t._defaultProvider),{name:e.name,chainId:t.chainId,ensAddress:e.ensAddress||t.ensAddress||null,_defaultProvider:r}}(null==e?"homestead":e)}ccipReadFetch(e,t,r){return Wl(this,void 0,void 0,(function*(){if(this.disableCcipRead||0===r.length)return null;const n=e.to.toLowerCase(),i=t.toLowerCase(),o=[];for(let e=0;e=0?null:JSON.stringify({data:i,sender:n}),c=yield Rl({url:a,errorPassThrough:!0},s,((e,t)=>(e.status=t.statusCode,e)));if(c.data)return c.data;const u=c.message||"unknown error";if(c.status>=400&&c.status<500)return Gl.throwError(`response not found during CCIP fetch: ${u}`,wo.errors.SERVER_ERROR,{url:t,errorMessage:u});o.push(u)}return Gl.throwError(`error encountered during CCIP fetch: ${o.map((e=>JSON.stringify(e))).join(", ")}`,wo.errors.SERVER_ERROR,{urls:r,errorMessages:o})}))}_getInternalBlockNumber(e){return Wl(this,void 0,void 0,(function*(){if(yield this._ready(),e>0)for(;this._internalBlockNumber;){const t=this._internalBlockNumber;try{const r=yield t;if(Ql()-r.respTime<=e)return r.blockNumber;break}catch(e){if(this._internalBlockNumber===t)break}}const t=Ql(),r=ba({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then((e=>null),(e=>e))}).then((({blockNumber:e,networkError:n})=>{if(n)throw this._internalBlockNumber===r&&(this._internalBlockNumber=null),n;const i=Ql();return(e=Zo.from(e).toNumber()){this._internalBlockNumber===r&&(this._internalBlockNumber=null)})),(yield r).blockNumber}))}poll(){return Wl(this,void 0,void 0,(function*(){const e=mh++,t=[];let r=null;try{r=yield this._getInternalBlockNumber(100+this.pollingInterval/2)}catch(e){return void this.emit("error",e)}if(this._setFastBlockNumber(r),this.emit("poll",e,r),r!==this._lastBlockNumber){if(-2===this._emitted.block&&(this._emitted.block=r-1),Math.abs(this._emitted.block-r)>1e3)Gl.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${r})`),this.emit("error",Gl.makeError("network block skew detected",wo.errors.NETWORK_ERROR,{blockNumber:r,event:"blockSkew",previousBlockNumber:this._emitted.block})),this.emit("block",r);else for(let e=this._emitted.block+1;e<=r;e++)this.emit("block",e);this._emitted.block!==r&&(this._emitted.block=r,Object.keys(this._emitted).forEach((e=>{if("block"===e)return;const t=this._emitted[e];"pending"!==t&&r-t>12&&delete this._emitted[e]}))),-2===this._lastBlockNumber&&(this._lastBlockNumber=r-1),this._events.forEach((e=>{switch(e.type){case"tx":{const r=e.hash;let n=this.getTransactionReceipt(r).then((e=>e&&null!=e.blockNumber?(this._emitted["t:"+r]=e.blockNumber,this.emit(r,e),null):null)).catch((e=>{this.emit("error",e)}));t.push(n);break}case"filter":if(!e._inflight){e._inflight=!0,-2===e._lastBlockNumber&&(e._lastBlockNumber=r-1);const n=e.filter;n.fromBlock=e._lastBlockNumber+1,n.toBlock=r;const i=n.toBlock-this._maxFilterBlockRange;i>n.fromBlock&&(n.fromBlock=i),n.fromBlock<0&&(n.fromBlock=0);const o=this.getLogs(n).then((t=>{e._inflight=!1,0!==t.length&&t.forEach((t=>{t.blockNumber>e._lastBlockNumber&&(e._lastBlockNumber=t.blockNumber),this._emitted["b:"+t.blockHash]=t.blockNumber,this._emitted["t:"+t.transactionHash]=t.blockNumber,this.emit(n,t)}))})).catch((t=>{this.emit("error",t),e._inflight=!1}));t.push(o)}}})),this._lastBlockNumber=r,Promise.all(t).then((()=>{this.emit("didPoll",e)})).catch((e=>{this.emit("error",e)}))}else this.emit("didPoll",e)}))}resetEventsBlock(e){this._lastBlockNumber=e-1,this.polling&&this.poll()}get network(){return this._network}detectNetwork(){return Wl(this,void 0,void 0,(function*(){return Gl.throwError("provider does not support network detection",wo.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"})}))}getNetwork(){return Wl(this,void 0,void 0,(function*(){const e=yield this._ready(),t=yield this.detectNetwork();if(e.chainId!==t.chainId){if(this.anyNetwork)return this._network=t,this._lastBlockNumber=-2,this._fastBlockNumber=null,this._fastBlockNumberPromise=null,this._fastQueryDate=0,this._emitted.block=-2,this._maxInternalBlockNumber=-1024,this._internalBlockNumber=null,this.emit("network",t,e),yield Yl(0),this._network;const r=Gl.makeError("underlying network changed",wo.errors.NETWORK_ERROR,{event:"changed",network:e,detectedNetwork:t});throw this.emit("error",r),r}return e}))}get blockNumber(){return this._getInternalBlockNumber(100+this.pollingInterval/2).then((e=>{this._setFastBlockNumber(e)}),(e=>{})),null!=this._fastBlockNumber?this._fastBlockNumber:-1}get polling(){return null!=this._poller}set polling(e){e&&!this._poller?(this._poller=setInterval((()=>{this.poll()}),this.pollingInterval),this._bootstrapPoll||(this._bootstrapPoll=setTimeout((()=>{this.poll(),this._bootstrapPoll=setTimeout((()=>{this._poller||this.poll(),this._bootstrapPoll=null}),this.pollingInterval)}),0))):!e&&this._poller&&(clearInterval(this._poller),this._poller=null)}get pollingInterval(){return this._pollingInterval}set pollingInterval(e){if("number"!=typeof e||e<=0||parseInt(String(e))!=e)throw new Error("invalid polling interval");this._pollingInterval=e,this._poller&&(clearInterval(this._poller),this._poller=setInterval((()=>{this.poll()}),this._pollingInterval))}_getFastBlockNumber(){const e=Ql();return e-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=e,this._fastBlockNumberPromise=this.getBlockNumber().then((e=>((null==this._fastBlockNumber||e>this._fastBlockNumber)&&(this._fastBlockNumber=e),this._fastBlockNumber)))),this._fastBlockNumberPromise}_setFastBlockNumber(e){null!=this._fastBlockNumber&&ethis._fastBlockNumber)&&(this._fastBlockNumber=e,this._fastBlockNumberPromise=Promise.resolve(e)))}waitForTransaction(e,t,r){return Wl(this,void 0,void 0,(function*(){return this._waitForTransaction(e,null==t?1:t,r||0,null)}))}_waitForTransaction(e,t,r,n){return Wl(this,void 0,void 0,(function*(){const i=yield this.getTransactionReceipt(e);return(i?i.confirmations:0)>=t?i:new Promise(((i,o)=>{const a=[];let s=!1;const c=function(){return!!s||(s=!0,a.forEach((e=>{e()})),!1)},u=e=>{e.confirmations{this.removeListener(e,u)})),n){let r=n.startBlock,i=null;const u=a=>Wl(this,void 0,void 0,(function*(){s||(yield Yl(1e3),this.getTransactionCount(n.from).then((f=>Wl(this,void 0,void 0,(function*(){if(!s){if(f<=n.nonce)r=a;else{{const t=yield this.getTransaction(e);if(t&&null!=t.blockNumber)return}for(null==i&&(i=r-3,i{s||this.once("block",u)})))}));if(s)return;this.once("block",u),a.push((()=>{this.removeListener("block",u)}))}if("number"==typeof r&&r>0){const e=setTimeout((()=>{c()||o(Gl.makeError("timeout exceeded",wo.errors.TIMEOUT,{timeout:r}))}),r);e.unref&&e.unref(),a.push((()=>{clearTimeout(e)}))}}))}))}getBlockNumber(){return Wl(this,void 0,void 0,(function*(){return this._getInternalBlockNumber(0)}))}getGasPrice(){return Wl(this,void 0,void 0,(function*(){yield this.getNetwork();const e=yield this.perform("getGasPrice",{});try{return Zo.from(e)}catch(t){return Gl.throwError("bad result from backend",wo.errors.SERVER_ERROR,{method:"getGasPrice",result:e,error:t})}}))}getBalance(e,t){return Wl(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield ba({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),n=yield this.perform("getBalance",r);try{return Zo.from(n)}catch(e){return Gl.throwError("bad result from backend",wo.errors.SERVER_ERROR,{method:"getBalance",params:r,result:n,error:e})}}))}getTransactionCount(e,t){return Wl(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield ba({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),n=yield this.perform("getTransactionCount",r);try{return Zo.from(n).toNumber()}catch(e){return Gl.throwError("bad result from backend",wo.errors.SERVER_ERROR,{method:"getTransactionCount",params:r,result:n,error:e})}}))}getCode(e,t){return Wl(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield ba({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),n=yield this.perform("getCode",r);try{return To(n)}catch(e){return Gl.throwError("bad result from backend",wo.errors.SERVER_ERROR,{method:"getCode",params:r,result:n,error:e})}}))}getStorageAt(e,t,r){return Wl(this,void 0,void 0,(function*(){yield this.getNetwork();const n=yield ba({address:this._getAddress(e),blockTag:this._getBlockTag(r),position:Promise.resolve(t).then((e=>Bo(e)))}),i=yield this.perform("getStorageAt",n);try{return To(i)}catch(e){return Gl.throwError("bad result from backend",wo.errors.SERVER_ERROR,{method:"getStorageAt",params:n,result:i,error:e})}}))}_wrapTransaction(e,t,r){if(null!=t&&32!==jo(t))throw new Error("invalid response - sendTransaction");const n=e;return null!=t&&e.hash!==t&&Gl.throwError("Transaction hash mismatch from Provider.sendTransaction.",wo.errors.UNKNOWN_ERROR,{expectedHash:e.hash,returnedHash:t}),n.wait=(t,n)=>Wl(this,void 0,void 0,(function*(){let i;null==t&&(t=1),null==n&&(n=0),0!==t&&null!=r&&(i={data:e.data,from:e.from,nonce:e.nonce,to:e.to,value:e.value,startBlock:r});const o=yield this._waitForTransaction(e.hash,t,n,i);return null==o&&0===t?null:(this._emitted["t:"+e.hash]=o.blockNumber,0===o.status&&Gl.throwError("transaction failed",wo.errors.CALL_EXCEPTION,{transactionHash:e.hash,transaction:e,receipt:o}),o)})),n}sendTransaction(e){return Wl(this,void 0,void 0,(function*(){yield this.getNetwork();const t=yield Promise.resolve(e).then((e=>To(e))),r=this.formatter.transaction(e);null==r.confirmations&&(r.confirmations=0);const n=yield this._getInternalBlockNumber(100+2*this.pollingInterval);try{const e=yield this.perform("sendTransaction",{signedTransaction:t});return this._wrapTransaction(r,e,n)}catch(e){throw e.transaction=r,e.transactionHash=r.hash,e}}))}_getTransactionRequest(e){return Wl(this,void 0,void 0,(function*(){const t=yield e,r={};return["from","to"].forEach((e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then((e=>e?this._getAddress(e):null)))})),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach((e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then((e=>e?Zo.from(e):null)))})),["type"].forEach((e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then((e=>null!=e?e:null)))})),t.accessList&&(r.accessList=this.formatter.accessList(t.accessList)),["data"].forEach((e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then((e=>e?To(e):null)))})),this.formatter.transactionRequest(yield ba(r))}))}_getFilter(e){return Wl(this,void 0,void 0,(function*(){e=yield e;const t={};return null!=e.address&&(t.address=this._getAddress(e.address)),["blockHash","topics"].forEach((r=>{null!=e[r]&&(t[r]=e[r])})),["fromBlock","toBlock"].forEach((r=>{null!=e[r]&&(t[r]=this._getBlockTag(e[r]))})),this.formatter.filter(yield ba(t))}))}_call(e,t,r){return Wl(this,void 0,void 0,(function*(){r>=10&&Gl.throwError("CCIP read exceeded maximum redirections",wo.errors.SERVER_ERROR,{redirects:r,transaction:e});const n=e.to,i=yield this.perform("call",{transaction:e,blockTag:t});if(r>=0&&"latest"===t&&null!=n&&"0x556f1830"===i.substring(0,10)&&jo(i)%32==4)try{const o=Do(i,4),a=Do(o,0,32);Zo.from(a).eq(n)||Gl.throwError("CCIP Read sender did not match",wo.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:i});const s=[],c=Zo.from(Do(o,32,64)).toNumber(),u=Zo.from(Do(o,c,c+32)).toNumber(),f=Do(o,c+32);for(let t=0;tWl(this,void 0,void 0,(function*(){const e=yield this.perform("getBlock",n);if(null==e)return null!=n.blockHash&&null==this._emitted["b:"+n.blockHash]||null!=n.blockTag&&r>this._emitted.block?null:void 0;if(t){let t=null;for(let r=0;rthis._wrapTransaction(e))),r}return this.formatter.block(e)}))),{oncePoll:this})}))}getBlock(e){return this._getBlock(e,!1)}getBlockWithTransactions(e){return this._getBlock(e,!0)}getTransaction(e){return Wl(this,void 0,void 0,(function*(){yield this.getNetwork(),e=yield e;const t={transactionHash:this.formatter.hash(e,!0)};return Nl((()=>Wl(this,void 0,void 0,(function*(){const r=yield this.perform("getTransaction",t);if(null==r)return null==this._emitted["t:"+e]?null:void 0;const n=this.formatter.transactionResponse(r);if(null==n.blockNumber)n.confirmations=0;else if(null==n.confirmations){let e=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-n.blockNumber+1;e<=0&&(e=1),n.confirmations=e}return this._wrapTransaction(n)}))),{oncePoll:this})}))}getTransactionReceipt(e){return Wl(this,void 0,void 0,(function*(){yield this.getNetwork(),e=yield e;const t={transactionHash:this.formatter.hash(e,!0)};return Nl((()=>Wl(this,void 0,void 0,(function*(){const r=yield this.perform("getTransactionReceipt",t);if(null==r)return null==this._emitted["t:"+e]?null:void 0;if(null==r.blockHash)return;const n=this.formatter.receipt(r);if(null==n.blockNumber)n.confirmations=0;else if(null==n.confirmations){let e=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-n.blockNumber+1;e<=0&&(e=1),n.confirmations=e}return n}))),{oncePoll:this})}))}getLogs(e){return Wl(this,void 0,void 0,(function*(){yield this.getNetwork();const t=yield ba({filter:this._getFilter(e)}),r=yield this.perform("getLogs",t);return r.forEach((e=>{null==e.removed&&(e.removed=!1)})),Jl.arrayOf(this.formatter.filterLog.bind(this.formatter))(r)}))}getEtherPrice(){return Wl(this,void 0,void 0,(function*(){return yield this.getNetwork(),this.perform("getEtherPrice",{})}))}_getBlockTag(e){return Wl(this,void 0,void 0,(function*(){if("number"==typeof(e=yield e)&&e<0){e%1&&Gl.throwArgumentError("invalid BlockTag","blockTag",e);let t=yield this._getInternalBlockNumber(100+2*this.pollingInterval);return t+=e,t<0&&(t=0),this.formatter.blockTag(t)}return this.formatter.blockTag(e)}))}getResolver(e){return Wl(this,void 0,void 0,(function*(){let t=e;for(;;){if(""===t||"."===t)return null;if("eth"!==e&&"eth"===t)return null;const r=yield this._getResolver(t,"getResolver");if(null!=r){const n=new hh(this,r,e);return t===e||(yield n.supportsWildcard())?n:null}t=t.split(".").slice(1).join(".")}}))}_getResolver(e,t){return Wl(this,void 0,void 0,(function*(){null==t&&(t="ENS");const r=yield this.getNetwork();r.ensAddress||Gl.throwError("network does not support ENS",wo.errors.UNSUPPORTED_OPERATION,{operation:t,network:r.name});try{const t=yield this.call({to:r.ensAddress,data:"0x0178b8bf"+Kc(e).substring(2)});return this.formatter.callAddress(t)}catch(e){}return null}))}resolveName(e){return Wl(this,void 0,void 0,(function*(){e=yield e;try{return Promise.resolve(this.formatter.address(e))}catch(t){if(No(e))throw t}"string"!=typeof e&&Gl.throwArgumentError("invalid ENS name","name",e);const t=yield this.getResolver(e);return t?yield t.getAddress():null}))}lookupAddress(e){return Wl(this,void 0,void 0,(function*(){e=yield e;const t=(e=this.formatter.address(e)).substring(2).toLowerCase()+".addr.reverse",r=yield this._getResolver(t,"lookupAddress");if(null==r)return null;const n=sh(yield this.call({to:r,data:"0x691f3431"+Kc(t).substring(2)}),0);return(yield this.resolveName(n))!=e?null:n}))}getAvatar(e){return Wl(this,void 0,void 0,(function*(){let t=null;if(No(e)){const r=this.formatter.address(e).substring(2).toLowerCase()+".addr.reverse",n=yield this._getResolver(r,"getAvatar");if(!n)return null;t=new hh(this,n,r);try{const e=yield t.getAvatar();if(e)return e.url}catch(e){if(e.code!==wo.errors.CALL_EXCEPTION)throw e}try{const e=sh(yield this.call({to:n,data:"0x691f3431"+Kc(r).substring(2)}),0);t=yield this.getResolver(e)}catch(e){if(e.code!==wo.errors.CALL_EXCEPTION)throw e;return null}}else if(t=yield this.getResolver(e),!t)return null;const r=yield t.getAvatar();return null==r?null:r.url}))}perform(e,t){return Gl.throwError(e+" not implemented",wo.errors.NOT_IMPLEMENTED,{operation:e})}_startEvent(e){this.polling=this._events.filter((e=>e.pollable())).length>0}_stopEvent(e){this.polling=this._events.filter((e=>e.pollable())).length>0}_addEventListener(e,t,r){const n=new th(Xl(e),t,r);return this._events.push(n),this._startEvent(n),this}on(e,t){return this._addEventListener(e,t,!1)}once(e,t){return this._addEventListener(e,t,!0)}emit(e,...t){let r=!1,n=[],i=Xl(e);return this._events=this._events.filter((e=>e.tag!==i||(setTimeout((()=>{e.listener.apply(this,t)}),0),r=!0,!e.once||(n.push(e),!1)))),n.forEach((e=>{this._stopEvent(e)})),r}listenerCount(e){if(!e)return this._events.length;let t=Xl(e);return this._events.filter((e=>e.tag===t)).length}listeners(e){if(null==e)return this._events.map((e=>e.listener));let t=Xl(e);return this._events.filter((e=>e.tag===t)).map((e=>e.listener))}off(e,t){if(null==t)return this.removeAllListeners(e);const r=[];let n=!1,i=Xl(e);return this._events=this._events.filter((e=>e.tag!==i||e.listener!=t||(!!n||(n=!0,r.push(e),!1)))),r.forEach((e=>{this._stopEvent(e)})),this}removeAllListeners(e){let t=[];if(null==e)t=this._events,this._events=[];else{const r=Xl(e);this._events=this._events.filter((e=>e.tag!==r||(t.push(e),!1)))}return t.forEach((e=>{this._stopEvent(e)})),this}}var yh=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))};const bh=new wo(Hl),vh=["call","estimateGas"];function wh(e,t){if(null==e)return null;if("string"==typeof e.message&&e.message.match("reverted")){const r=No(e.data)?e.data:null;if(!t||r)return{message:e.message,data:r}}if("object"==typeof e){for(const r in e){const n=wh(e[r],t);if(n)return n}return null}if("string"==typeof e)try{return wh(JSON.parse(e),t)}catch(e){}return null}function Ah(e,t,r){const n=r.transaction||r.signedTransaction;if("call"===e){const e=wh(t,!0);if(e)return e.data;bh.throwError("missing revert data in call exception; Transaction reverted without a reason string",wo.errors.CALL_EXCEPTION,{data:"0x",transaction:n,error:t})}if("estimateGas"===e){let r=wh(t.body,!1);null==r&&(r=wh(t,!1)),r&&bh.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",wo.errors.UNPREDICTABLE_GAS_LIMIT,{reason:r.message,method:e,transaction:n,error:t})}let i=t.message;throw t.code===wo.errors.SERVER_ERROR&&t.error&&"string"==typeof t.error.message?i=t.error.message:"string"==typeof t.body?i=t.body:"string"==typeof t.responseText&&(i=t.responseText),i=(i||"").toLowerCase(),i.match(/insufficient funds|base fee exceeds gas limit|InsufficientFunds/i)&&bh.throwError("insufficient funds for intrinsic transaction cost",wo.errors.INSUFFICIENT_FUNDS,{error:t,method:e,transaction:n}),i.match(/nonce (is )?too low/i)&&bh.throwError("nonce has already been used",wo.errors.NONCE_EXPIRED,{error:t,method:e,transaction:n}),i.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&bh.throwError("replacement fee too low",wo.errors.REPLACEMENT_UNDERPRICED,{error:t,method:e,transaction:n}),i.match(/only replay-protected/i)&&bh.throwError("legacy pre-eip-155 transactions not supported",wo.errors.UNSUPPORTED_OPERATION,{error:t,method:e,transaction:n}),vh.indexOf(e)>=0&&i.match(/gas required exceeds allowance|always failing transaction|execution reverted|revert/)&&bh.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",wo.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,method:e,transaction:n}),t}function _h(e){return new Promise((function(t){setTimeout(t,e)}))}function Eh(e){if(e.error){const t=new Error(e.error.message);throw t.code=e.error.code,t.data=e.error.data,t}return e.result}function Sh(e){return e?e.toLowerCase():e}const Ph={};class xh extends Cu{constructor(e,t,r){if(super(),e!==Ph)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");ga(this,"provider",t),null==r&&(r=0),"string"==typeof r?(ga(this,"_address",this.provider.formatter.address(r)),ga(this,"_index",null)):"number"==typeof r?(ga(this,"_index",r),ga(this,"_address",null)):bh.throwArgumentError("invalid address or index","addressOrIndex",r)}connect(e){return bh.throwError("cannot alter JSON-RPC Signer connection",wo.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}connectUnchecked(){return new kh(Ph,this.provider,this._address||this._index)}getAddress(){return this._address?Promise.resolve(this._address):this.provider.send("eth_accounts",[]).then((e=>(e.length<=this._index&&bh.throwError("unknown account #"+this._index,wo.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),this.provider.formatter.address(e[this._index]))))}sendUncheckedTransaction(e){e=wa(e);const t=this.getAddress().then((e=>(e&&(e=e.toLowerCase()),e)));if(null==e.gasLimit){const r=wa(e);r.from=t,e.gasLimit=this.provider.estimateGas(r)}return null!=e.to&&(e.to=Promise.resolve(e.to).then((e=>yh(this,void 0,void 0,(function*(){if(null==e)return null;const t=yield this.provider.resolveName(e);return null==t&&bh.throwArgumentError("provided ENS name resolves to null","tx.to",e),t}))))),ba({tx:ba(e),sender:t}).then((({tx:t,sender:r})=>{null!=t.from?t.from.toLowerCase()!==r&&bh.throwArgumentError("from address mismatch","transaction",e):t.from=r;const n=this.provider.constructor.hexlifyTransaction(t,{from:!0});return this.provider.send("eth_sendTransaction",[n]).then((e=>e),(e=>("string"==typeof e.message&&e.message.match(/user denied/i)&&bh.throwError("user rejected transaction",wo.errors.ACTION_REJECTED,{action:"sendTransaction",transaction:t}),Ah("sendTransaction",e,n))))}))}signTransaction(e){return bh.throwError("signing transactions is unsupported",wo.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}sendTransaction(e){return yh(this,void 0,void 0,(function*(){const t=yield this.provider._getInternalBlockNumber(100+2*this.provider.pollingInterval),r=yield this.sendUncheckedTransaction(e);try{return yield Nl((()=>yh(this,void 0,void 0,(function*(){const e=yield this.provider.getTransaction(r);if(null!==e)return this.provider._wrapTransaction(e,r,t)}))),{oncePoll:this.provider})}catch(e){throw e.transactionHash=r,e}}))}signMessage(e){return yh(this,void 0,void 0,(function*(){const t="string"==typeof e?Js(e):e,r=yield this.getAddress();try{return yield this.provider.send("personal_sign",[To(t),r.toLowerCase()])}catch(t){throw"string"==typeof t.message&&t.message.match(/user denied/i)&&bh.throwError("user rejected signing",wo.errors.ACTION_REJECTED,{action:"signMessage",from:r,messageData:e}),t}}))}_legacySignMessage(e){return yh(this,void 0,void 0,(function*(){const t="string"==typeof e?Js(e):e,r=yield this.getAddress();try{return yield this.provider.send("eth_sign",[r.toLowerCase(),To(t)])}catch(t){throw"string"==typeof t.message&&t.message.match(/user denied/i)&&bh.throwError("user rejected signing",wo.errors.ACTION_REJECTED,{action:"_legacySignMessage",from:r,messageData:e}),t}}))}_signTypedData(e,t,r){return yh(this,void 0,void 0,(function*(){const n=yield fu.resolveNames(e,t,r,(e=>this.provider.resolveName(e))),i=yield this.getAddress();try{return yield this.provider.send("eth_signTypedData_v4",[i.toLowerCase(),JSON.stringify(fu.getPayload(n.domain,t,n.value))])}catch(e){throw"string"==typeof e.message&&e.message.match(/user denied/i)&&bh.throwError("user rejected signing",wo.errors.ACTION_REJECTED,{action:"_signTypedData",from:i,messageData:{domain:n.domain,types:t,value:n.value}}),e}}))}unlock(e){return yh(this,void 0,void 0,(function*(){const t=this.provider,r=yield this.getAddress();return t.send("personal_unlockAccount",[r.toLowerCase(),e,null])}))}}class kh extends xh{sendTransaction(e){return this.sendUncheckedTransaction(e).then((e=>({hash:e,nonce:null,gasLimit:null,gasPrice:null,data:null,value:null,chainId:null,confirmations:0,from:null,wait:t=>this.provider.waitForTransaction(e,t)})))}}const Mh={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0};class Ch extends gh{constructor(e,t){let r=t;null==r&&(r=new Promise(((e,t)=>{setTimeout((()=>{this.detectNetwork().then((t=>{e(t)}),(e=>{t(e)}))}),0)}))),super(r),e||(e=ya(this.constructor,"defaultUrl")()),ga(this,"connection","string"==typeof e?Object.freeze({url:e}):Object.freeze(wa(e))),this._nextId=42}get _cache(){return null==this._eventLoopCache&&(this._eventLoopCache={}),this._eventLoopCache}static defaultUrl(){return"http://localhost:8545"}detectNetwork(){return this._cache.detectNetwork||(this._cache.detectNetwork=this._uncachedDetectNetwork(),setTimeout((()=>{this._cache.detectNetwork=null}),0)),this._cache.detectNetwork}_uncachedDetectNetwork(){return yh(this,void 0,void 0,(function*(){yield _h(0);let e=null;try{e=yield this.send("eth_chainId",[])}catch(t){try{e=yield this.send("net_version",[])}catch(e){}}if(null!=e){const t=ya(this.constructor,"getNetwork");try{return t(Zo.from(e).toNumber())}catch(t){return bh.throwError("could not detect network",wo.errors.NETWORK_ERROR,{chainId:e,event:"invalidNetwork",serverError:t})}}return bh.throwError("could not detect network",wo.errors.NETWORK_ERROR,{event:"noNetwork"})}))}getSigner(e){return new xh(Ph,this,e)}getUncheckedSigner(e){return this.getSigner(e).connectUnchecked()}listAccounts(){return this.send("eth_accounts",[]).then((e=>e.map((e=>this.formatter.address(e)))))}send(e,t){const r={method:e,params:t,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:Sa(r),provider:this});const n=["eth_chainId","eth_blockNumber"].indexOf(e)>=0;if(n&&this._cache[e])return this._cache[e];const i=Rl(this.connection,JSON.stringify(r),Eh).then((e=>(this.emit("debug",{action:"response",request:r,response:e,provider:this}),e)),(e=>{throw this.emit("debug",{action:"response",error:e,request:r,provider:this}),e}));return n&&(this._cache[e]=i,setTimeout((()=>{this._cache[e]=null}),0)),i}prepareRequest(e,t){switch(e){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[Sh(t.address),t.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[Sh(t.address),t.blockTag]];case"getCode":return["eth_getCode",[Sh(t.address),t.blockTag]];case"getStorageAt":return["eth_getStorageAt",[Sh(t.address),zo(t.position,32),t.blockTag]];case"sendTransaction":return["eth_sendRawTransaction",[t.signedTransaction]];case"getBlock":return t.blockTag?["eth_getBlockByNumber",[t.blockTag,!!t.includeTransactions]]:t.blockHash?["eth_getBlockByHash",[t.blockHash,!!t.includeTransactions]]:null;case"getTransaction":return["eth_getTransactionByHash",[t.transactionHash]];case"getTransactionReceipt":return["eth_getTransactionReceipt",[t.transactionHash]];case"call":return["eth_call",[ya(this.constructor,"hexlifyTransaction")(t.transaction,{from:!0}),t.blockTag]];case"estimateGas":return["eth_estimateGas",[ya(this.constructor,"hexlifyTransaction")(t.transaction,{from:!0})]];case"getLogs":return t.filter&&null!=t.filter.address&&(t.filter.address=Sh(t.filter.address)),["eth_getLogs",[t.filter]]}return null}perform(e,t){return yh(this,void 0,void 0,(function*(){if("call"===e||"estimateGas"===e){const e=t.transaction;if(e&&null!=e.type&&Zo.from(e.type).isZero()&&null==e.maxFeePerGas&&null==e.maxPriorityFeePerGas){const r=yield this.getFeeData();null==r.maxFeePerGas&&null==r.maxPriorityFeePerGas&&((t=wa(t)).transaction=wa(e),delete t.transaction.type)}}const r=this.prepareRequest(e,t);null==r&&bh.throwError(e+" not implemented",wo.errors.NOT_IMPLEMENTED,{operation:e});try{return yield this.send(r[0],r[1])}catch(r){return Ah(e,r,t)}}))}_startEvent(e){"pending"===e.tag&&this._startPending(),super._startEvent(e)}_startPending(){if(null!=this._pendingFilter)return;const e=this,t=this.send("eth_newPendingTransactionFilter",[]);this._pendingFilter=t,t.then((function(r){return function n(){e.send("eth_getFilterChanges",[r]).then((function(r){if(e._pendingFilter!=t)return null;let n=Promise.resolve();return r.forEach((function(t){e._emitted["t:"+t.toLowerCase()]="pending",n=n.then((function(){return e.getTransaction(t).then((function(t){return e.emit("pending",t),null}))}))})),n.then((function(){return _h(1e3)}))})).then((function(){if(e._pendingFilter==t)return setTimeout((function(){n()}),0),null;e.send("eth_uninstallFilter",[r])})).catch((e=>{}))}(),r})).catch((e=>{}))}_stopEvent(e){"pending"===e.tag&&0===this.listenerCount("pending")&&(this._pendingFilter=null),super._stopEvent(e)}static hexlifyTransaction(e,t){const r=wa(Mh);if(t)for(const e in t)t[e]&&(r[e]=!0);va(e,r);const n={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach((function(t){if(null==e[t])return;const r=Bo(Zo.from(e[t]));"gasLimit"===t&&(t="gas"),n[t]=r})),["from","to","data"].forEach((function(t){null!=e[t]&&(n[t]=To(e[t]))})),e.accessList&&(n.accessList=Nf(e.accessList)),n}}const Ih=new RegExp("^bytes([0-9]+)$"),Rh=new RegExp("^(u?int)([0-9]*)$"),Nh=new RegExp("^(.*)\\[([0-9]*)\\]$"),Oh="0000000000000000000000000000000000000000000000000000000000000000",Th=new wo("solidity/5.7.0");function jh(e,t,r){switch(e){case"address":return r?Ro(t,32):Mo(t);case"string":return Js(t);case"bytes":return Mo(t);case"bool":return t=t?"0x01":"0x00",r?Ro(t,32):Mo(t)}let n=e.match(Rh);if(n){let i=parseInt(n[2]||"256");return(n[2]&&String(i)!==n[2]||i%8!=0||0===i||i>256)&&Th.throwArgumentError("invalid number type","type",e),r&&(i=256),Ro(t=Zo.from(t).toTwos(i),i/8)}if(n=e.match(Ih),n){const i=parseInt(n[1]);return(String(i)!==n[1]||0===i||i>32)&&Th.throwArgumentError("invalid bytes type","type",e),Mo(t).byteLength!==i&&Th.throwArgumentError(`invalid value for ${e}`,"value",t),r?Mo((t+Oh).substring(0,66)):t}if(n=e.match(Nh),n&&Array.isArray(t)){const r=n[1];parseInt(n[2]||String(t.length))!=t.length&&Th.throwArgumentError(`invalid array length for ${e}`,"value",t);const i=[];return t.forEach((function(e){i.push(jh(r,e,!0))})),Co(i)}return Th.throwArgumentError("invalid type","type",e)}function Dh(e,t){e.length!=t.length&&Th.throwArgumentError("wrong number of values; expected ${ types.length }","values",t);const r=[];return e.forEach((function(e,n){r.push(jh(e,t[n]))})),To(Co(r))}var $h=Object.freeze({__proto__:null,keccak256:function(e,t){return is(Dh(e,t))},pack:Dh,sha256:function(e,t){return cd(Dh(e,t))}});const Bh=new wo("units/5.7.0"),Fh=["wei","kwei","mwei","gwei","szabo","finney","ether"];function zh(e,t){if("string"==typeof t){const e=Fh.indexOf(t);-1!==e&&(t=3*e)}return ca(e,null!=t?t:18)}function Uh(e,t){if("string"!=typeof e&&Bh.throwArgumentError("value must be a string","value",e),"string"==typeof t){const e=Fh.indexOf(t);-1!==e&&(t=3*e)}return ua(e,null!=t?t:18)}var Lh=Object.freeze({__proto__:null,commify:function(e){const t=String(e).split(".");(t.length>2||!t[0].match(/^-?[0-9]*$/)||t[1]&&!t[1].match(/^[0-9]*$/)||"."===e||"-."===e)&&Bh.throwArgumentError("invalid value","value",e);let r=t[0],n="";for("-"===r.substring(0,1)&&(n="-",r=r.substring(1));"0"===r.substring(0,1);)r=r.substring(1);""===r&&(r="0");let i="";for(2===t.length&&(i="."+(t[1]||"0"));i.length>2&&"0"===i[i.length-1];)i=i.substring(0,i.length-1);const o=[];for(;r.length;){if(r.length<=3){o.unshift(r);break}{const e=r.length-3;o.unshift(r.substring(e)),r=r.substring(0,e)}}return n+o.join(",")+i},formatEther:function(e){return zh(e,18)},formatUnits:zh,parseEther:function(e){return Uh(e,18)},parseUnits:Uh});function qh(e){if(null==e.match(/^(0x)?([\da-fA-F]{40})$/))throw new RangeError("incorrect address format");try{return ws(oo(e,!0,20))}catch(e){throw new an(e,["invalid EIP-55 address"])}}async function Hh(e){return n(await so(ro(e),"SHA-256"),!0,!1)}async function Kh(e,t){if(void 0===e.iss)throw new Error('Payload iss should be set to either "orig" or "dest"');const r=JSON.parse(e.exchange[e.iss]);await Yi(r,t);const n=await Wi(t),i=t.alg,o={...e,iat:Math.floor(Date.now()/1e3)};return{jws:await new Hi(o).setProtectedHeader({alg:i}).setIssuedAt(o.iat).sign(n),payload:o}}async function Jh(e,t,r){const n=JSON.parse(t.exchange[t.iss]),i=await Zi(e,n);if(void 0===i.payload.iss)throw new Error('Property "iss" missing');if(void 0===i.payload.iat)throw new Error("Property claim iat missing");if(void 0!==r){no("iat"===r.timestamp?1e3*i.payload.iat:r.timestamp,"iat"===r.notBefore?1e3*i.payload.iat:r.notBefore,"iat"===r.notAfter?1e3*i.payload.iat:r.notAfter,r.tolerance)}const o=i.payload,a=o.exchange[o.iss];if(ro(n)!==ro(JSON.parse(a)))throw new Error(`The proof is issued by ${a} instead of ${JSON.stringify(n)}`);const s=t;for(const e in s){if(void 0===o[e])throw new Error(`Expected key '${e}' not found in proof`);if("exchange"===e){const e=t.exchange;Wh(o.exchange,e)}else if(""!==s[e]&&ro(s[e])!==ro(o[e]))throw new Error(`Proof's ${e}: ${JSON.stringify(o[e],void 0,2)} does not meet provided value ${JSON.stringify(s[e],void 0,2)}`)}return i}function Wh(e,t){const r=["id","orig","dest","hashAlg","cipherblockDgst","blockCommitment","blockCommitment","secretCommitment","schema"];for(const t of r)if("schema"!==t&&(void 0===e[t]||""===e[t]))throw new Error(`${t} is missing on dataExchange.\ndataExchange: ${JSON.stringify(e,void 0,2)}`);for(const r in t)if(""!==t[r]&&ro(t[r])!==ro(e[r]))throw new Error(`dataExchange's ${r}: ${JSON.stringify(e[r],void 0,2)} does not meet expected value ${JSON.stringify(t[r],void 0,2)}`)}async function Gh(e,t,r=10){const{payload:n}=await Zi(e),i=n.exchange,o={...i};delete o.id;if(await Hh(o)!==i.id)throw new an(new Error("data exchange integrity failed"),["dataExchange integrity violated"]);const a=JSON.parse(i.dest),s=JSON.parse(i.orig);let c,u,f;try{c=(await Jh(n.poo,{iss:"orig",proofType:"PoO",exchange:i})).payload}catch(e){throw new an(e,["invalid poo"])}try{await Jh(e,{iss:"dest",proofType:"PoR",exchange:i},{timestamp:"iat",notBefore:1e3*c.iat,notAfter:1e3*c.iat+i.pooToPorDelay})}catch(e){throw new an(e,["invalid por"])}try{const e=await t.getSecretFromLedger(Xi(i.encAlg),i.ledgerSignerAddress,i.id,r);u=e.hex,f=e.iat}catch(e){throw new an(e,["cannot verify"])}try{no(1e3*f,1e3*n.iat,1e3*c.iat+i.pooToSecretDelay)}catch(e){throw new an(`Although the secret has been obtained (and you could try to decrypt the cipherblock), it's been published later than agreed: ${new Date(1e3*f).toUTCString()} > ${new Date(1e3*c.iat+i.pooToSecretDelay).toUTCString()}`,["secret not published in time"])}return{pooPayload:c,porPayload:n,secretHex:u,destPublicJwk:a,origPublicJwk:s}}async function Vh(e,t,r=10){let n,i,o,a,s;try{n=(await Zi(e)).payload}catch(e){throw new an(e,["invalid verification request"])}try{const e=await Gh(n.por,t,r);i=e.destPublicJwk,o=e.origPublicJwk,a=e.pooPayload,s=e.porPayload}catch(e){throw new an(e,["invalid por","invalid verification request"])}try{await Zi(e,"dest"===n.iss?i:o)}catch(e){throw new an(e,["invalid verification request"])}return{pooPayload:a,porPayload:s,vrPayload:n,destPublicJwk:i,origPublicJwk:o}}async function Zh(e,t){const{payload:r}=await Zi(e),{destPublicJwk:i,origPublicJwk:o,secretHex:a,pooPayload:s,porPayload:c}=await Gh(r.por,t);try{await Zi(e,i)}catch(e){throw e instanceof an&&e.add("invalid dispute request"),e}if(n(await so(r.cipherblock,c.exchange.hashAlg),!0,!1)!==c.exchange.cipherblockDgst)throw new an(new Error("cipherblock does not meet the committed (and already accepted) one"),["invalid dispute request"]);return await Vi(r.cipherblock,(await Qi(c.exchange.encAlg,a)).jwk),{pooPayload:s,porPayload:c,drPayload:r,destPublicJwk:i,origPublicJwk:o}}async function Xh(e,t,r,n){const i={proofType:"request",iss:e,dataExchangeId:t,por:r,type:"verificationRequest",iat:Math.floor(Date.now()/1e3)},o=await mi(n);return await new Hi(i).setProtectedHeader({alg:n.alg}).setIssuedAt(i.iat).sign(o)}var Qh=Object.freeze({__proto__:null,ConflictResolver:class{constructor(e,t){this.jwkPair=e,this.dltAgent=t,this.initialized=new Promise(((e,t)=>{this.init().then((()=>{e(!0)})).catch((e=>{t(e)}))}))}async init(){await Yi(this.jwkPair.publicJwk,this.jwkPair.privateJwk)}async resolveCompleteness(e){await this.initialized;const{payload:t}=await Zi(e);let r;try{r=(await Zi(t.por)).payload}catch(e){throw new an(e,["invalid por"])}const n={...await this._resolution(t.dataExchangeId,r.exchange[t.iss]),resolution:"not completed",type:"verification"};try{await Vh(e,this.dltAgent),n.resolution="completed"}catch(e){if(!(e instanceof an)||e.nrErrors.includes("invalid verification request")||e.nrErrors.includes("unexpected error"))throw e}const i=await mi(this.jwkPair.privateJwk);return await new Hi(n).setProtectedHeader({alg:this.jwkPair.privateJwk.alg}).setIssuedAt(n.iat).sign(i)}async resolveDispute(e){await this.initialized;const{payload:t}=await Zi(e);let r;try{r=(await Zi(t.por)).payload}catch(e){throw new an(e,["invalid por"])}const n={...await this._resolution(t.dataExchangeId,r.exchange[t.iss]),resolution:"denied",type:"dispute"};try{await Zh(e,this.dltAgent)}catch(e){if(!(e instanceof an&&e.nrErrors.includes("decryption failed")))throw new an(e,["cannot verify"]);n.resolution="accepted"}const i=await mi(this.jwkPair.privateJwk);return await new Hi(n).setProtectedHeader({alg:this.jwkPair.privateJwk.alg}).setIssuedAt(n.iat).sign(i)}async _resolution(e,t){return{proofType:"resolution",dataExchangeId:e,iat:Math.floor(Date.now()/1e3),iss:await ao(this.jwkPair.publicJwk,!0),sub:t}}},checkCompleteness:Vh,checkDecryption:Zh,generateVerificationRequest:Xh,verifyPor:Gh,verifyResolution:async function(e,t){return await Zi(e,t??((e,t)=>JSON.parse(t.iss)))}});const Yh={gasLimit:125e5,contract:{address:"0x8d407A1722633bDD1dcf221474be7a44C05d7c2F",abi:[{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"sender",type:"address"},{indexed:!1,internalType:"uint256",name:"dataExchangeId",type:"uint256"},{indexed:!1,internalType:"uint256",name:"timestamp",type:"uint256"},{indexed:!1,internalType:"uint256",name:"secret",type:"uint256"}],name:"Registration",type:"event"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"uint256",name:"",type:"uint256"}],name:"registry",outputs:[{internalType:"uint256",name:"timestamp",type:"uint256"},{internalType:"uint256",name:"secret",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"_dataExchangeId",type:"uint256"},{internalType:"uint256",name:"_secret",type:"uint256"}],name:"setRegistry",outputs:[],stateMutability:"nonpayable",type:"function"}],transactionHash:"0x6a3828f8fe232819dc40ca66f93930b3bd1619db31a67ec34b44446b3e7c8289",receipt:{to:null,from:"0x17bd12C2134AfC1f6E9302a532eFE30C19B9E903",contractAddress:"0x8d407A1722633bDD1dcf221474be7a44C05d7c2F",transactionIndex:0,gasUsed:"253928",logsBloom:"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",blockHash:"0x0118672bb9b27679e616831d056d36291dd20cfe88c3ee2abd8f2dfce579cad4",transactionHash:"0x6a3828f8fe232819dc40ca66f93930b3bd1619db31a67ec34b44446b3e7c8289",logs:[],blockNumber:119389,cumulativeGasUsed:"253928",status:1,byzantium:!0},args:[],solcInputHash:"c528a37588793ef74285d75e08d6b8eb",metadata:'{"compiler":{"version":"0.8.4+commit.c7e474f2"},"language":"Solidity","output":{"abi":[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"dataExchangeId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"secret","type":"uint256"}],"name":"Registration","type":"event"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"registry","outputs":[{"internalType":"uint256","name":"timestamp","type":"uint256"},{"internalType":"uint256","name":"secret","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_dataExchangeId","type":"uint256"},{"internalType":"uint256","name":"_secret","type":"uint256"}],"name":"setRegistry","outputs":[],"stateMutability":"nonpayable","type":"function"}],"devdoc":{"kind":"dev","methods":{},"version":1},"userdoc":{"kind":"user","methods":{},"version":1}},"settings":{"compilationTarget":{"contracts/NonRepudiation.sol":"NonRepudiation"},"evmVersion":"istanbul","libraries":{},"metadata":{"bytecodeHash":"ipfs","useLiteralContent":true},"optimizer":{"enabled":false,"runs":200},"remappings":[]},"sources":{"contracts/NonRepudiation.sol":{"content":"//SPDX-License-Identifier: Unlicense\\npragma solidity ^0.8.0;\\n\\ncontract NonRepudiation {\\n struct Proof {\\n uint256 timestamp;\\n uint256 secret;\\n }\\n mapping(address => mapping (uint256 => Proof)) public registry;\\n event Registration(address sender, uint256 dataExchangeId, uint256 timestamp, uint256 secret);\\n\\n function setRegistry(uint256 _dataExchangeId, uint256 _secret) public {\\n require(registry[msg.sender][_dataExchangeId].secret == 0);\\n registry[msg.sender][_dataExchangeId] = Proof(block.timestamp, _secret);\\n emit Registration(msg.sender, _dataExchangeId, block.timestamp, _secret);\\n }\\n}\\n","keccak256":"0x8d371257a9b03c9102f158323e61f56ce49dd8489bd92c5a7d8abc3d9f6f8399","license":"Unlicense"}},"version":1}',bytecode:"0x608060405234801561001057600080fd5b506103a2806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c8063032439371461003b578063d05cb54514610057575b600080fd5b6100556004803603810190610050919061023a565b610088565b005b610071600480360381019061006c91906101fe565b6101a3565b60405161007f9291906102d9565b60405180910390f35b60008060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002060010154146100e757600080fd5b6040518060400160405280428152602001828152506000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002060008201518160000155602082015181600101559050507faa58599838af2e5e0f3251cfbb4eac5d5d447ded49f6b0ac28d6b44098224e63338342846040516101979493929190610294565b60405180910390a15050565b6000602052816000526040600020602052806000526040600020600091509150508060000154908060010154905082565b6000813590506101e38161033e565b92915050565b6000813590506101f881610355565b92915050565b6000806040838503121561021157600080fd5b600061021f858286016101d4565b9250506020610230858286016101e9565b9150509250929050565b6000806040838503121561024d57600080fd5b600061025b858286016101e9565b925050602061026c858286016101e9565b9150509250929050565b61027f81610302565b82525050565b61028e81610334565b82525050565b60006080820190506102a96000830187610276565b6102b66020830186610285565b6102c36040830185610285565b6102d06060830184610285565b95945050505050565b60006040820190506102ee6000830185610285565b6102fb6020830184610285565b9392505050565b600061030d82610314565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b61034781610302565b811461035257600080fd5b50565b61035e81610334565b811461036957600080fd5b5056fea26469706673582212204fd0fc653fb487221da9a14a4ca5d5499f9e9bc7b27ac8ab0f8d397fd6e3148564736f6c63430008040033",deployedBytecode:"0x608060405234801561001057600080fd5b50600436106100365760003560e01c8063032439371461003b578063d05cb54514610057575b600080fd5b6100556004803603810190610050919061023a565b610088565b005b610071600480360381019061006c91906101fe565b6101a3565b60405161007f9291906102d9565b60405180910390f35b60008060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002060010154146100e757600080fd5b6040518060400160405280428152602001828152506000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002060008201518160000155602082015181600101559050507faa58599838af2e5e0f3251cfbb4eac5d5d447ded49f6b0ac28d6b44098224e63338342846040516101979493929190610294565b60405180910390a15050565b6000602052816000526040600020602052806000526040600020600091509150508060000154908060010154905082565b6000813590506101e38161033e565b92915050565b6000813590506101f881610355565b92915050565b6000806040838503121561021157600080fd5b600061021f858286016101d4565b9250506020610230858286016101e9565b9150509250929050565b6000806040838503121561024d57600080fd5b600061025b858286016101e9565b925050602061026c858286016101e9565b9150509250929050565b61027f81610302565b82525050565b61028e81610334565b82525050565b60006080820190506102a96000830187610276565b6102b66020830186610285565b6102c36040830185610285565b6102d06060830184610285565b95945050505050565b60006040820190506102ee6000830185610285565b6102fb6020830184610285565b9392505050565b600061030d82610314565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b61034781610302565b811461035257600080fd5b50565b61035e81610334565b811461036957600080fd5b5056fea26469706673582212204fd0fc653fb487221da9a14a4ca5d5499f9e9bc7b27ac8ab0f8d397fd6e3148564736f6c63430008040033",devdoc:{kind:"dev",methods:{},version:1},userdoc:{kind:"user",methods:{},version:1},storageLayout:{storage:[{astId:13,contract:"contracts/NonRepudiation.sol:NonRepudiation",label:"registry",offset:0,slot:"0",type:"t_mapping(t_address,t_mapping(t_uint256,t_struct(Proof)6_storage))"}],types:{t_address:{encoding:"inplace",label:"address",numberOfBytes:"20"},"t_mapping(t_address,t_mapping(t_uint256,t_struct(Proof)6_storage))":{encoding:"mapping",key:"t_address",label:"mapping(address => mapping(uint256 => struct NonRepudiation.Proof))",numberOfBytes:"32",value:"t_mapping(t_uint256,t_struct(Proof)6_storage)"},"t_mapping(t_uint256,t_struct(Proof)6_storage)":{encoding:"mapping",key:"t_uint256",label:"mapping(uint256 => struct NonRepudiation.Proof)",numberOfBytes:"32",value:"t_struct(Proof)6_storage"},"t_struct(Proof)6_storage":{encoding:"inplace",label:"struct NonRepudiation.Proof",members:[{astId:3,contract:"contracts/NonRepudiation.sol:NonRepudiation",label:"timestamp",offset:0,slot:"0",type:"t_uint256"},{astId:5,contract:"contracts/NonRepudiation.sol:NonRepudiation",label:"secret",offset:0,slot:"1",type:"t_uint256"}],numberOfBytes:"64"},t_uint256:{encoding:"inplace",label:"uint256",numberOfBytes:"32"}}}}};async function ep(e,t,r,n,o){let s=Zo.from(0),c=Zo.from(0);const u=oo(a(i(r)),!0);let f=0;do{try{({secret:s,timestamp:c}=await e.registry(oo(t,!0),u))}catch(e){throw new an(e,["cannot contact the ledger"])}s.isZero()&&(f++,await new Promise((e=>setTimeout(e,1e3))))}while(s.isZero()&&f{null!==e&&"object"==typeof e&&"function"==typeof e.then?e.then((e=>{this.dltConfig={...Yh,...e},this.provider=new Ch(this.dltConfig.rpcProviderUrl),this.contract=new ed(this.dltConfig.contract.address,this.dltConfig.contract.abi,this.provider),t(!0)})).catch((e=>r(e))):(this.dltConfig={...Yh,...e},this.provider=new Ch(this.dltConfig.rpcProviderUrl),this.contract=new ed(this.dltConfig.contract.address,this.dltConfig.contract.abi,this.provider),t(!0))}))}async getContractAddress(){return await this.initialized,this.contract.address}}class ip extends np{async getSecretFromLedger(e,t,r,n){return await this.initialized,await ep(this.contract,t,r,n,e)}}class op extends np{constructor(e,t,r){const n=new Promise(((t,n)=>{e.providerinfo.get().then((e=>{const i=e.rpcUrl;void 0===i?n(new Error("wallet is not connected to RPC endpoint")):t({...r,rpcProviderUrl:"string"==typeof i?i:i[0]})})).catch((e=>{n(e)}))}));super(n),this.wallet=e,this.did=t}}class ap extends op{async getSecretFromLedger(e,t,r,n){return await this.initialized,await ep(this.contract,t,r,n,e)}}class sp extends np{constructor(e,t,r){const n=new Promise(((t,n)=>{e.providerinfoGet().then((e=>{const i=e.rpcUrl;void 0===i?n(new Error("wallet is not connected to RPC endpoint")):t({...r,rpcProviderUrl:"string"==typeof i?i:i[0]})})).catch((e=>{n(e)}))}));super(n),this.wallet=e,this.did=t}}class cp extends sp{async getSecretFromLedger(e,t,r,n){return await this.initialized,await ep(this.contract,t,r,n,e)}}var up={},fp=d(wu),dp=d(_s),lp=d(vc),hp=d(od),pp=d(qo),mp=d(du),gp=d(Nd),yp=d(ll),bp=d(os),vp=d(Ao),wp=d(fd),Ap=d($h),_p=d($d),Ep=d(xa),Sp=d(ps),Pp=d(Af),xp=d(sc),kp=d(Ff),Mp=d(Lh),Cp=d(gl),Ip=d(Ol);!function(e){var t=u&&u.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),r=u&&u.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=u&&u.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&t(n,e,i);return r(n,e),n};Object.defineProperty(e,"__esModule",{value:!0}),e.formatBytes32String=e.Utf8ErrorFuncs=e.toUtf8String=e.toUtf8CodePoints=e.toUtf8Bytes=e._toEscapedUtf8String=e.nameprep=e.hexDataSlice=e.hexDataLength=e.hexZeroPad=e.hexValue=e.hexStripZeros=e.hexConcat=e.isHexString=e.hexlify=e.base64=e.base58=e.TransactionDescription=e.LogDescription=e.Interface=e.SigningKey=e.HDNode=e.defaultPath=e.isBytesLike=e.isBytes=e.zeroPad=e.stripZeros=e.concat=e.arrayify=e.shallowCopy=e.resolveProperties=e.getStatic=e.defineReadOnly=e.deepCopy=e.checkProperties=e.poll=e.fetchJson=e._fetchData=e.RLP=e.Logger=e.checkResultErrors=e.FormatTypes=e.ParamType=e.FunctionFragment=e.EventFragment=e.ErrorFragment=e.ConstructorFragment=e.Fragment=e.defaultAbiCoder=e.AbiCoder=void 0,e.Indexed=e.Utf8ErrorReason=e.UnicodeNormalizationForm=e.SupportedAlgorithm=e.mnemonicToSeed=e.isValidMnemonic=e.entropyToMnemonic=e.mnemonicToEntropy=e.getAccountPath=e.verifyTypedData=e.verifyMessage=e.recoverPublicKey=e.computePublicKey=e.recoverAddress=e.computeAddress=e.getJsonWalletAddress=e.TransactionTypes=e.serializeTransaction=e.parseTransaction=e.accessListify=e.joinSignature=e.splitSignature=e.soliditySha256=e.solidityKeccak256=e.solidityPack=e.shuffled=e.randomBytes=e.sha512=e.sha256=e.ripemd160=e.keccak256=e.computeHmac=e.commify=e.parseUnits=e.formatUnits=e.parseEther=e.formatEther=e.isAddress=e.getCreate2Address=e.getContractAddress=e.getIcapAddress=e.getAddress=e._TypedDataEncoder=e.id=e.isValidName=e.namehash=e.hashMessage=e.dnsEncode=e.parseBytes32String=void 0;var i=fp;Object.defineProperty(e,"AbiCoder",{enumerable:!0,get:function(){return i.AbiCoder}}),Object.defineProperty(e,"checkResultErrors",{enumerable:!0,get:function(){return i.checkResultErrors}}),Object.defineProperty(e,"ConstructorFragment",{enumerable:!0,get:function(){return i.ConstructorFragment}}),Object.defineProperty(e,"defaultAbiCoder",{enumerable:!0,get:function(){return i.defaultAbiCoder}}),Object.defineProperty(e,"ErrorFragment",{enumerable:!0,get:function(){return i.ErrorFragment}}),Object.defineProperty(e,"EventFragment",{enumerable:!0,get:function(){return i.EventFragment}}),Object.defineProperty(e,"FormatTypes",{enumerable:!0,get:function(){return i.FormatTypes}}),Object.defineProperty(e,"Fragment",{enumerable:!0,get:function(){return i.Fragment}}),Object.defineProperty(e,"FunctionFragment",{enumerable:!0,get:function(){return i.FunctionFragment}}),Object.defineProperty(e,"Indexed",{enumerable:!0,get:function(){return i.Indexed}}),Object.defineProperty(e,"Interface",{enumerable:!0,get:function(){return i.Interface}}),Object.defineProperty(e,"LogDescription",{enumerable:!0,get:function(){return i.LogDescription}}),Object.defineProperty(e,"ParamType",{enumerable:!0,get:function(){return i.ParamType}}),Object.defineProperty(e,"TransactionDescription",{enumerable:!0,get:function(){return i.TransactionDescription}});var o=dp;Object.defineProperty(e,"getAddress",{enumerable:!0,get:function(){return o.getAddress}}),Object.defineProperty(e,"getCreate2Address",{enumerable:!0,get:function(){return o.getCreate2Address}}),Object.defineProperty(e,"getContractAddress",{enumerable:!0,get:function(){return o.getContractAddress}}),Object.defineProperty(e,"getIcapAddress",{enumerable:!0,get:function(){return o.getIcapAddress}}),Object.defineProperty(e,"isAddress",{enumerable:!0,get:function(){return o.isAddress}});var a=n(lp);e.base64=a;var s=hp;Object.defineProperty(e,"base58",{enumerable:!0,get:function(){return s.Base58}});var c=pp;Object.defineProperty(e,"arrayify",{enumerable:!0,get:function(){return c.arrayify}}),Object.defineProperty(e,"concat",{enumerable:!0,get:function(){return c.concat}}),Object.defineProperty(e,"hexConcat",{enumerable:!0,get:function(){return c.hexConcat}}),Object.defineProperty(e,"hexDataSlice",{enumerable:!0,get:function(){return c.hexDataSlice}}),Object.defineProperty(e,"hexDataLength",{enumerable:!0,get:function(){return c.hexDataLength}}),Object.defineProperty(e,"hexlify",{enumerable:!0,get:function(){return c.hexlify}}),Object.defineProperty(e,"hexStripZeros",{enumerable:!0,get:function(){return c.hexStripZeros}}),Object.defineProperty(e,"hexValue",{enumerable:!0,get:function(){return c.hexValue}}),Object.defineProperty(e,"hexZeroPad",{enumerable:!0,get:function(){return c.hexZeroPad}}),Object.defineProperty(e,"isBytes",{enumerable:!0,get:function(){return c.isBytes}}),Object.defineProperty(e,"isBytesLike",{enumerable:!0,get:function(){return c.isBytesLike}}),Object.defineProperty(e,"isHexString",{enumerable:!0,get:function(){return c.isHexString}}),Object.defineProperty(e,"joinSignature",{enumerable:!0,get:function(){return c.joinSignature}}),Object.defineProperty(e,"zeroPad",{enumerable:!0,get:function(){return c.zeroPad}}),Object.defineProperty(e,"splitSignature",{enumerable:!0,get:function(){return c.splitSignature}}),Object.defineProperty(e,"stripZeros",{enumerable:!0,get:function(){return c.stripZeros}});var f=mp;Object.defineProperty(e,"_TypedDataEncoder",{enumerable:!0,get:function(){return f._TypedDataEncoder}}),Object.defineProperty(e,"dnsEncode",{enumerable:!0,get:function(){return f.dnsEncode}}),Object.defineProperty(e,"hashMessage",{enumerable:!0,get:function(){return f.hashMessage}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return f.id}}),Object.defineProperty(e,"isValidName",{enumerable:!0,get:function(){return f.isValidName}}),Object.defineProperty(e,"namehash",{enumerable:!0,get:function(){return f.namehash}});var d=gp;Object.defineProperty(e,"defaultPath",{enumerable:!0,get:function(){return d.defaultPath}}),Object.defineProperty(e,"entropyToMnemonic",{enumerable:!0,get:function(){return d.entropyToMnemonic}}),Object.defineProperty(e,"getAccountPath",{enumerable:!0,get:function(){return d.getAccountPath}}),Object.defineProperty(e,"HDNode",{enumerable:!0,get:function(){return d.HDNode}}),Object.defineProperty(e,"isValidMnemonic",{enumerable:!0,get:function(){return d.isValidMnemonic}}),Object.defineProperty(e,"mnemonicToEntropy",{enumerable:!0,get:function(){return d.mnemonicToEntropy}}),Object.defineProperty(e,"mnemonicToSeed",{enumerable:!0,get:function(){return d.mnemonicToSeed}});var l=yp;Object.defineProperty(e,"getJsonWalletAddress",{enumerable:!0,get:function(){return l.getJsonWalletAddress}});var h=bp;Object.defineProperty(e,"keccak256",{enumerable:!0,get:function(){return h.keccak256}});var p=vp;Object.defineProperty(e,"Logger",{enumerable:!0,get:function(){return p.Logger}});var m=wp;Object.defineProperty(e,"computeHmac",{enumerable:!0,get:function(){return m.computeHmac}}),Object.defineProperty(e,"ripemd160",{enumerable:!0,get:function(){return m.ripemd160}}),Object.defineProperty(e,"sha256",{enumerable:!0,get:function(){return m.sha256}}),Object.defineProperty(e,"sha512",{enumerable:!0,get:function(){return m.sha512}});var g=Ap;Object.defineProperty(e,"solidityKeccak256",{enumerable:!0,get:function(){return g.keccak256}}),Object.defineProperty(e,"solidityPack",{enumerable:!0,get:function(){return g.pack}}),Object.defineProperty(e,"soliditySha256",{enumerable:!0,get:function(){return g.sha256}});var y=_p;Object.defineProperty(e,"randomBytes",{enumerable:!0,get:function(){return y.randomBytes}}),Object.defineProperty(e,"shuffled",{enumerable:!0,get:function(){return y.shuffled}});var b=Ep;Object.defineProperty(e,"checkProperties",{enumerable:!0,get:function(){return b.checkProperties}}),Object.defineProperty(e,"deepCopy",{enumerable:!0,get:function(){return b.deepCopy}}),Object.defineProperty(e,"defineReadOnly",{enumerable:!0,get:function(){return b.defineReadOnly}}),Object.defineProperty(e,"getStatic",{enumerable:!0,get:function(){return b.getStatic}}),Object.defineProperty(e,"resolveProperties",{enumerable:!0,get:function(){return b.resolveProperties}}),Object.defineProperty(e,"shallowCopy",{enumerable:!0,get:function(){return b.shallowCopy}});var v=n(Sp);e.RLP=v;var w=Pp;Object.defineProperty(e,"computePublicKey",{enumerable:!0,get:function(){return w.computePublicKey}}),Object.defineProperty(e,"recoverPublicKey",{enumerable:!0,get:function(){return w.recoverPublicKey}}),Object.defineProperty(e,"SigningKey",{enumerable:!0,get:function(){return w.SigningKey}});var A=xp;Object.defineProperty(e,"formatBytes32String",{enumerable:!0,get:function(){return A.formatBytes32String}}),Object.defineProperty(e,"nameprep",{enumerable:!0,get:function(){return A.nameprep}}),Object.defineProperty(e,"parseBytes32String",{enumerable:!0,get:function(){return A.parseBytes32String}}),Object.defineProperty(e,"_toEscapedUtf8String",{enumerable:!0,get:function(){return A._toEscapedUtf8String}}),Object.defineProperty(e,"toUtf8Bytes",{enumerable:!0,get:function(){return A.toUtf8Bytes}}),Object.defineProperty(e,"toUtf8CodePoints",{enumerable:!0,get:function(){return A.toUtf8CodePoints}}),Object.defineProperty(e,"toUtf8String",{enumerable:!0,get:function(){return A.toUtf8String}}),Object.defineProperty(e,"Utf8ErrorFuncs",{enumerable:!0,get:function(){return A.Utf8ErrorFuncs}});var _=kp;Object.defineProperty(e,"accessListify",{enumerable:!0,get:function(){return _.accessListify}}),Object.defineProperty(e,"computeAddress",{enumerable:!0,get:function(){return _.computeAddress}}),Object.defineProperty(e,"parseTransaction",{enumerable:!0,get:function(){return _.parse}}),Object.defineProperty(e,"recoverAddress",{enumerable:!0,get:function(){return _.recoverAddress}}),Object.defineProperty(e,"serializeTransaction",{enumerable:!0,get:function(){return _.serialize}}),Object.defineProperty(e,"TransactionTypes",{enumerable:!0,get:function(){return _.TransactionTypes}});var E=Mp;Object.defineProperty(e,"commify",{enumerable:!0,get:function(){return E.commify}}),Object.defineProperty(e,"formatEther",{enumerable:!0,get:function(){return E.formatEther}}),Object.defineProperty(e,"parseEther",{enumerable:!0,get:function(){return E.parseEther}}),Object.defineProperty(e,"formatUnits",{enumerable:!0,get:function(){return E.formatUnits}}),Object.defineProperty(e,"parseUnits",{enumerable:!0,get:function(){return E.parseUnits}});var S=Cp;Object.defineProperty(e,"verifyMessage",{enumerable:!0,get:function(){return S.verifyMessage}}),Object.defineProperty(e,"verifyTypedData",{enumerable:!0,get:function(){return S.verifyTypedData}});var P=Ip;Object.defineProperty(e,"_fetchData",{enumerable:!0,get:function(){return P._fetchData}}),Object.defineProperty(e,"fetchJson",{enumerable:!0,get:function(){return P.fetchJson}}),Object.defineProperty(e,"poll",{enumerable:!0,get:function(){return P.poll}});var x=wp;Object.defineProperty(e,"SupportedAlgorithm",{enumerable:!0,get:function(){return x.SupportedAlgorithm}});var k=xp;Object.defineProperty(e,"UnicodeNormalizationForm",{enumerable:!0,get:function(){return k.UnicodeNormalizationForm}}),Object.defineProperty(e,"Utf8ErrorReason",{enumerable:!0,get:function(){return k.Utf8ErrorReason}})}(up);class Rp extends np{constructor(e,t){let r;super(e),this.count=-1,r=void 0===t?function(e,t=!1){if(e<1)throw new RangeError("byteLength MUST be > 0");{const r=new Uint8Array(e);if(e<=65536)self.crypto.getRandomValues(r);else for(let t=0;tthis.count&&(this.count=e),this.count}}class Np extends op{constructor(){super(...arguments),this.count=-1}async deploySecret(e,t){await this.initialized;const r=await tp(e,t,this),n=(await this.wallet.identities.sign({did:this.did},{type:"Transaction",data:r})).signature,i=await this.provider.sendTransaction(n);return this.count=this.count+1,i.hash}async getAddress(){await this.initialized;const e=await this.wallet.identities.info({did:this.did});if(void 0===e.addresses)throw new an(new Error("no addresses for did "+this.did),["unexpected error"]);return e.addresses[0]}async nextNonce(){await this.initialized;const e=await this.provider.getTransactionCount(await this.getAddress(),"pending");return e>this.count&&(this.count=e),this.count}}class Op extends sp{constructor(){super(...arguments),this.count=-1}async deploySecret(e,t){await this.initialized;const r=await tp(e,t,this),n=(await this.wallet.identitySign({did:this.did},{type:"Transaction",data:r})).signature,i=await this.provider.sendTransaction(n);return this.count=this.count+1,i.hash}async getAddress(){await this.initialized;const e=await this.wallet.identityInfo({did:this.did});if(void 0===e.addresses)throw new an(`Can't get address for did: ${this.did}`,["unexpected error"]);return e.addresses[0]}async nextNonce(){await this.initialized;const e=await this.provider.getTransactionCount(await this.getAddress(),"pending");return e>this.count&&(this.count=e),this.count}}var Tp=Object.freeze({__proto__:null,EthersIoAgentDest:ip,EthersIoAgentOrig:Rp,I3mServerWalletAgentDest:cp,I3mServerWalletAgentOrig:Op,I3mWalletAgentDest:ap,I3mWalletAgentOrig:Np}),jp={schemas:{IdentitySelectOutput:{title:"IdentitySelectOutput",type:"object",properties:{did:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},required:["did"]},SignInput:{title:"SignInput",oneOf:[{title:"SignTransaction",type:"object",properties:{type:{enum:["Transaction"]},data:{title:"Transaction",type:"object",additionalProperties:!0,properties:{from:{type:"string"},to:{type:"string"},nonce:{type:"number"}}}},required:["type","data"]},{title:"SignRaw",type:"object",properties:{type:{enum:["Raw"]},data:{type:"object",properties:{payload:{description:"Base64Url encoded data to sign",type:"string",pattern:"^[A-Za-z0-9_-]+$"}},required:["payload"]}},required:["type","data"]},{title:"SignJWT",type:"object",properties:{type:{enum:["JWT"]},data:{type:"object",properties:{header:{description:'header fields to be added to the JWS header. "alg" and "kid" will be ignored since they are automatically added by the wallet.',type:"object",additionalProperties:!0},payload:{description:"A JSON object to be signed by the wallet. It will become the payload of the generated JWS. 'iss' (issuer) and 'iat' (issued at) will be automatically added by the wallet and will override provided values.",type:"object",additionalProperties:!0}},required:["payload"]}},required:["type","data"]}]},SignRaw:{title:"SignRaw",type:"object",properties:{type:{enum:["Raw"]},data:{type:"object",properties:{payload:{description:"Base64Url encoded data to sign",type:"string",pattern:"^[A-Za-z0-9_-]+$"}},required:["payload"]}},required:["type","data"]},SignTransaction:{title:"SignTransaction",type:"object",properties:{type:{enum:["Transaction"]},data:{title:"Transaction",type:"object",additionalProperties:!0,properties:{from:{type:"string"},to:{type:"string"},nonce:{type:"number"}}}},required:["type","data"]},SignJWT:{title:"SignJWT",type:"object",properties:{type:{enum:["JWT"]},data:{type:"object",properties:{header:{description:'header fields to be added to the JWS header. "alg" and "kid" will be ignored since they are automatically added by the wallet.',type:"object",additionalProperties:!0},payload:{description:"A JSON object to be signed by the wallet. It will become the payload of the generated JWS. 'iss' (issuer) and 'iat' (issued at) will be automatically added by the wallet and will override provided values.",type:"object",additionalProperties:!0}},required:["payload"]}},required:["type","data"]},Transaction:{title:"Transaction",type:"object",additionalProperties:!0,properties:{from:{type:"string"},to:{type:"string"},nonce:{type:"number"}}},SignOutput:{title:"SignOutput",type:"object",properties:{signature:{type:"string"}},required:["signature"]},Receipt:{title:"Receipt",type:"object",properties:{receipt:{type:"string"}},required:["receipt"]},SignTypes:{title:"SignTypes",type:"string",enum:["Transaction","Raw","JWT"]},IdentityListInput:{title:"IdentityListInput",description:"A list of DIDs",type:"array",items:{type:"object",properties:{did:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},required:["did"]}},IdentityCreateInput:{title:"IdentityCreateInput",description:'Besides the here defined options, provider specific properties should be added here if necessary, e.g. "path" for BIP21 wallets, or the key algorithm (if the wallet supports multiple algorithm).\n',type:"object",properties:{alias:{type:"string"}},additionalProperties:!0},IdentityCreateOutput:{title:"IdentityCreateOutput",description:"It returns the account id and type\n",type:"object",properties:{did:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},additionalProperties:!0,required:["did"]},ResourceListOutput:{title:"ResourceListOutput",description:"A list of resources",type:"array",items:{title:"Resource",anyOf:[{title:"VerifiableCredential",type:"object",properties:{type:{example:"VerifiableCredential",enum:["VerifiableCredential"]},name:{type:"string",example:"Resource name"},resource:{type:"object",properties:{"@context":{type:"array",items:{type:"string"},example:["https://www.w3.org/2018/credentials/v1"]},id:{type:"string",example:"http://example.edu/credentials/1872"},type:{type:"array",items:{type:"string"},example:["VerifiableCredential"]},issuer:{type:"object",properties:{id:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},additionalProperties:!0,required:["id"]},issuanceDate:{type:"string",format:"date-time",example:"2021-06-10T19:07:28.000Z"},credentialSubject:{type:"object",properties:{id:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},required:["id"],additionalProperties:!0},proof:{type:"object",properties:{type:{type:"string",enum:["JwtProof2020"]}},required:["type"],additionalProperties:!0}},additionalProperties:!0,required:["@context","type","issuer","issuanceDate","credentialSubject","proof"]}},required:["type","resource"]},{title:"ObjectResource",type:"object",properties:{type:{example:"Object",enum:["Object"]},name:{type:"string",example:"Resource name"},parentResource:{type:"string"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",additionalProperties:!0}},required:["type","resource"]},{title:"JWK pair",type:"object",properties:{type:{example:"KeyPair",enum:["KeyPair"]},name:{type:"string",example:"Resource name"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",properties:{keyPair:{type:"object",properties:{privateJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents a private key (complementary to `publicJwk`)\n",example:'{"alg":"ES256","crv":"P-256","d":"rQp_3eZzvXwt1sK7WWsRhVYipqNGblzYDKKaYirlqs0","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'},publicJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents the public key (complementary to `privateJwk`).\n",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'}},required:["privateJwk","publicJwk"]}},required:["keyPair"]}},required:["type","resource"]},{title:"Contract",type:"object",properties:{type:{example:"Contract",enum:["Contract"]},name:{type:"string",example:"Resource name"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",properties:{dataSharingAgreement:{type:"object",required:["dataOfferingDescription","parties","purpose","duration","intendedUse","licenseGrant","dataStream","personalData","pricingModel","dataExchangeAgreement","signatures"],properties:{dataOfferingDescription:{type:"object",required:["dataOfferingId","version","active"],properties:{dataOfferingId:{type:"string"},version:{type:"integer"},category:{type:"string"},active:{type:"boolean"},title:{type:"string"}}},parties:{type:"object",required:["providerDid","consumerDid"],properties:{providerDid:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},consumerDid:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}}},purpose:{type:"string"},duration:{type:"object",required:["creationDate","startDate","endDate"],properties:{creationDate:{type:"integer"},startDate:{type:"integer"},endDate:{type:"integer"}}},intendedUse:{type:"object",required:["processData","shareDataWithThirdParty","editData"],properties:{processData:{type:"boolean"},shareDataWithThirdParty:{type:"boolean"},editData:{type:"boolean"}}},licenseGrant:{type:"object",required:["transferable","exclusiveness","paidUp","revocable","processing","modifying","analyzing","storingData","storingCopy","reproducing","distributing","loaning","selling","renting","furtherLicensing","leasing"],properties:{transferable:{type:"boolean"},exclusiveness:{type:"boolean"},paidUp:{type:"boolean"},revocable:{type:"boolean"},processing:{type:"boolean"},modifying:{type:"boolean"},analyzing:{type:"boolean"},storingData:{type:"boolean"},storingCopy:{type:"boolean"},reproducing:{type:"boolean"},distributing:{type:"boolean"},loaning:{type:"boolean"},selling:{type:"boolean"},renting:{type:"boolean"},furtherLicensing:{type:"boolean"},leasing:{type:"boolean"}}},dataStream:{type:"boolean"},personalData:{type:"boolean"},pricingModel:{type:"object",required:["basicPrice","currency","hasFreePrice"],properties:{paymentType:{type:"string"},pricingModelName:{type:"string"},basicPrice:{type:"number",format:"float"},currency:{type:"string"},fee:{type:"number",format:"float"},hasPaymentOnSubscription:{type:"object",properties:{paymentOnSubscriptionName:{type:"string"},paymentType:{type:"string"},timeDuration:{type:"string"},description:{type:"string"},repeat:{type:"string"},hasSubscriptionPrice:{type:"number"}}},hasFreePrice:{type:"object",properties:{hasPriceFree:{type:"boolean"}}}}},dataExchangeAgreement:{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},signatures:{type:"object",required:["providerSignature","consumerSignature"],properties:{providerSignature:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"},consumerSignature:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"}}}}},keyPair:{type:"object",properties:{privateJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents a private key (complementary to `publicJwk`)\n",example:'{"alg":"ES256","crv":"P-256","d":"rQp_3eZzvXwt1sK7WWsRhVYipqNGblzYDKKaYirlqs0","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'},publicJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents the public key (complementary to `privateJwk`).\n",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'}},required:["privateJwk","publicJwk"]}},required:["dataSharingAgreement"]}},required:["type","resource"]},{title:"NonRepudiationProof",type:"object",properties:{type:{example:"NonRepudiationProof",enum:["NonRepudiationProof"]},name:{type:"string",example:"Resource name"},resource:{description:"a non-repudiation proof (either a PoO, a PoR or a PoP) as a compact JWS"}},required:["type","resource"]},{title:"DataExchangeResource",type:"object",properties:{type:{example:"DataExchange",enum:["DataExchange"]},name:{type:"string",example:"Resource name"},resource:{allOf:[{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},{type:"object",properties:{cipherblockDgst:{type:"string",description:"hash of the cipherblock in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"},blockCommitment:{type:"string",description:"hash of the plaintext block in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"},secretCommitment:{type:"string",description:"ash of the secret that can be used to decrypt the block in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"}},required:["cipherblockDgst","blockCommitment","secretCommitment"]}]}},required:["type","resource"]}]}},Resource:{title:"Resource",anyOf:[{title:"VerifiableCredential",type:"object",properties:{type:{example:"VerifiableCredential",enum:["VerifiableCredential"]},name:{type:"string",example:"Resource name"},resource:{type:"object",properties:{"@context":{type:"array",items:{type:"string"},example:["https://www.w3.org/2018/credentials/v1"]},id:{type:"string",example:"http://example.edu/credentials/1872"},type:{type:"array",items:{type:"string"},example:["VerifiableCredential"]},issuer:{type:"object",properties:{id:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},additionalProperties:!0,required:["id"]},issuanceDate:{type:"string",format:"date-time",example:"2021-06-10T19:07:28.000Z"},credentialSubject:{type:"object",properties:{id:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},required:["id"],additionalProperties:!0},proof:{type:"object",properties:{type:{type:"string",enum:["JwtProof2020"]}},required:["type"],additionalProperties:!0}},additionalProperties:!0,required:["@context","type","issuer","issuanceDate","credentialSubject","proof"]}},required:["type","resource"]},{title:"ObjectResource",type:"object",properties:{type:{example:"Object",enum:["Object"]},name:{type:"string",example:"Resource name"},parentResource:{type:"string"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",additionalProperties:!0}},required:["type","resource"]},{title:"JWK pair",type:"object",properties:{type:{example:"KeyPair",enum:["KeyPair"]},name:{type:"string",example:"Resource name"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",properties:{keyPair:{type:"object",properties:{privateJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents a private key (complementary to `publicJwk`)\n",example:'{"alg":"ES256","crv":"P-256","d":"rQp_3eZzvXwt1sK7WWsRhVYipqNGblzYDKKaYirlqs0","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'},publicJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents the public key (complementary to `privateJwk`).\n",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'}},required:["privateJwk","publicJwk"]}},required:["keyPair"]}},required:["type","resource"]},{title:"Contract",type:"object",properties:{type:{example:"Contract",enum:["Contract"]},name:{type:"string",example:"Resource name"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",properties:{dataSharingAgreement:{type:"object",required:["dataOfferingDescription","parties","purpose","duration","intendedUse","licenseGrant","dataStream","personalData","pricingModel","dataExchangeAgreement","signatures"],properties:{dataOfferingDescription:{type:"object",required:["dataOfferingId","version","active"],properties:{dataOfferingId:{type:"string"},version:{type:"integer"},category:{type:"string"},active:{type:"boolean"},title:{type:"string"}}},parties:{type:"object",required:["providerDid","consumerDid"],properties:{providerDid:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},consumerDid:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}}},purpose:{type:"string"},duration:{type:"object",required:["creationDate","startDate","endDate"],properties:{creationDate:{type:"integer"},startDate:{type:"integer"},endDate:{type:"integer"}}},intendedUse:{type:"object",required:["processData","shareDataWithThirdParty","editData"],properties:{processData:{type:"boolean"},shareDataWithThirdParty:{type:"boolean"},editData:{type:"boolean"}}},licenseGrant:{type:"object",required:["transferable","exclusiveness","paidUp","revocable","processing","modifying","analyzing","storingData","storingCopy","reproducing","distributing","loaning","selling","renting","furtherLicensing","leasing"],properties:{transferable:{type:"boolean"},exclusiveness:{type:"boolean"},paidUp:{type:"boolean"},revocable:{type:"boolean"},processing:{type:"boolean"},modifying:{type:"boolean"},analyzing:{type:"boolean"},storingData:{type:"boolean"},storingCopy:{type:"boolean"},reproducing:{type:"boolean"},distributing:{type:"boolean"},loaning:{type:"boolean"},selling:{type:"boolean"},renting:{type:"boolean"},furtherLicensing:{type:"boolean"},leasing:{type:"boolean"}}},dataStream:{type:"boolean"},personalData:{type:"boolean"},pricingModel:{type:"object",required:["basicPrice","currency","hasFreePrice"],properties:{paymentType:{type:"string"},pricingModelName:{type:"string"},basicPrice:{type:"number",format:"float"},currency:{type:"string"},fee:{type:"number",format:"float"},hasPaymentOnSubscription:{type:"object",properties:{paymentOnSubscriptionName:{type:"string"},paymentType:{type:"string"},timeDuration:{type:"string"},description:{type:"string"},repeat:{type:"string"},hasSubscriptionPrice:{type:"number"}}},hasFreePrice:{type:"object",properties:{hasPriceFree:{type:"boolean"}}}}},dataExchangeAgreement:{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},signatures:{type:"object",required:["providerSignature","consumerSignature"],properties:{providerSignature:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"},consumerSignature:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"}}}}},keyPair:{type:"object",properties:{privateJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents a private key (complementary to `publicJwk`)\n",example:'{"alg":"ES256","crv":"P-256","d":"rQp_3eZzvXwt1sK7WWsRhVYipqNGblzYDKKaYirlqs0","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'},publicJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents the public key (complementary to `privateJwk`).\n",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'}},required:["privateJwk","publicJwk"]}},required:["dataSharingAgreement"]}},required:["type","resource"]},{title:"NonRepudiationProof",type:"object",properties:{type:{example:"NonRepudiationProof",enum:["NonRepudiationProof"]},name:{type:"string",example:"Resource name"},resource:{description:"a non-repudiation proof (either a PoO, a PoR or a PoP) as a compact JWS"}},required:["type","resource"]},{title:"DataExchangeResource",type:"object",properties:{type:{example:"DataExchange",enum:["DataExchange"]},name:{type:"string",example:"Resource name"},resource:{allOf:[{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},{type:"object",properties:{cipherblockDgst:{type:"string",description:"hash of the cipherblock in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"},blockCommitment:{type:"string",description:"hash of the plaintext block in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"},secretCommitment:{type:"string",description:"ash of the secret that can be used to decrypt the block in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"}},required:["cipherblockDgst","blockCommitment","secretCommitment"]}]}},required:["type","resource"]}]},VerifiableCredential:{title:"VerifiableCredential",type:"object",properties:{type:{example:"VerifiableCredential",enum:["VerifiableCredential"]},name:{type:"string",example:"Resource name"},resource:{type:"object",properties:{"@context":{type:"array",items:{type:"string"},example:["https://www.w3.org/2018/credentials/v1"]},id:{type:"string",example:"http://example.edu/credentials/1872"},type:{type:"array",items:{type:"string"},example:["VerifiableCredential"]},issuer:{type:"object",properties:{id:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},additionalProperties:!0,required:["id"]},issuanceDate:{type:"string",format:"date-time",example:"2021-06-10T19:07:28.000Z"},credentialSubject:{type:"object",properties:{id:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},required:["id"],additionalProperties:!0},proof:{type:"object",properties:{type:{type:"string",enum:["JwtProof2020"]}},required:["type"],additionalProperties:!0}},additionalProperties:!0,required:["@context","type","issuer","issuanceDate","credentialSubject","proof"]}},required:["type","resource"]},ObjectResource:{title:"ObjectResource",type:"object",properties:{type:{example:"Object",enum:["Object"]},name:{type:"string",example:"Resource name"},parentResource:{type:"string"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",additionalProperties:!0}},required:["type","resource"]},KeyPair:{title:"JWK pair",type:"object",properties:{type:{example:"KeyPair",enum:["KeyPair"]},name:{type:"string",example:"Resource name"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",properties:{keyPair:{type:"object",properties:{privateJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents a private key (complementary to `publicJwk`)\n",example:'{"alg":"ES256","crv":"P-256","d":"rQp_3eZzvXwt1sK7WWsRhVYipqNGblzYDKKaYirlqs0","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'},publicJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents the public key (complementary to `privateJwk`).\n",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'}},required:["privateJwk","publicJwk"]}},required:["keyPair"]}},required:["type","resource"]},Contract:{title:"Contract",type:"object",properties:{type:{example:"Contract",enum:["Contract"]},name:{type:"string",example:"Resource name"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",properties:{dataSharingAgreement:{type:"object",required:["dataOfferingDescription","parties","purpose","duration","intendedUse","licenseGrant","dataStream","personalData","pricingModel","dataExchangeAgreement","signatures"],properties:{dataOfferingDescription:{type:"object",required:["dataOfferingId","version","active"],properties:{dataOfferingId:{type:"string"},version:{type:"integer"},category:{type:"string"},active:{type:"boolean"},title:{type:"string"}}},parties:{type:"object",required:["providerDid","consumerDid"],properties:{providerDid:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},consumerDid:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}}},purpose:{type:"string"},duration:{type:"object",required:["creationDate","startDate","endDate"],properties:{creationDate:{type:"integer"},startDate:{type:"integer"},endDate:{type:"integer"}}},intendedUse:{type:"object",required:["processData","shareDataWithThirdParty","editData"],properties:{processData:{type:"boolean"},shareDataWithThirdParty:{type:"boolean"},editData:{type:"boolean"}}},licenseGrant:{type:"object",required:["transferable","exclusiveness","paidUp","revocable","processing","modifying","analyzing","storingData","storingCopy","reproducing","distributing","loaning","selling","renting","furtherLicensing","leasing"],properties:{transferable:{type:"boolean"},exclusiveness:{type:"boolean"},paidUp:{type:"boolean"},revocable:{type:"boolean"},processing:{type:"boolean"},modifying:{type:"boolean"},analyzing:{type:"boolean"},storingData:{type:"boolean"},storingCopy:{type:"boolean"},reproducing:{type:"boolean"},distributing:{type:"boolean"},loaning:{type:"boolean"},selling:{type:"boolean"},renting:{type:"boolean"},furtherLicensing:{type:"boolean"},leasing:{type:"boolean"}}},dataStream:{type:"boolean"},personalData:{type:"boolean"},pricingModel:{type:"object",required:["basicPrice","currency","hasFreePrice"],properties:{paymentType:{type:"string"},pricingModelName:{type:"string"},basicPrice:{type:"number",format:"float"},currency:{type:"string"},fee:{type:"number",format:"float"},hasPaymentOnSubscription:{type:"object",properties:{paymentOnSubscriptionName:{type:"string"},paymentType:{type:"string"},timeDuration:{type:"string"},description:{type:"string"},repeat:{type:"string"},hasSubscriptionPrice:{type:"number"}}},hasFreePrice:{type:"object",properties:{hasPriceFree:{type:"boolean"}}}}},dataExchangeAgreement:{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},signatures:{type:"object",required:["providerSignature","consumerSignature"],properties:{providerSignature:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"},consumerSignature:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"}}}}},keyPair:{type:"object",properties:{privateJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents a private key (complementary to `publicJwk`)\n",example:'{"alg":"ES256","crv":"P-256","d":"rQp_3eZzvXwt1sK7WWsRhVYipqNGblzYDKKaYirlqs0","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'},publicJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents the public key (complementary to `privateJwk`).\n",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'}},required:["privateJwk","publicJwk"]}},required:["dataSharingAgreement"]}},required:["type","resource"]},DataExchangeResource:{title:"DataExchangeResource",type:"object",properties:{type:{example:"DataExchange",enum:["DataExchange"]},name:{type:"string",example:"Resource name"},resource:{allOf:[{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},{type:"object",properties:{cipherblockDgst:{type:"string",description:"hash of the cipherblock in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"},blockCommitment:{type:"string",description:"hash of the plaintext block in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"},secretCommitment:{type:"string",description:"ash of the secret that can be used to decrypt the block in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"}},required:["cipherblockDgst","blockCommitment","secretCommitment"]}]}},required:["type","resource"]},NonRepudiationProof:{title:"NonRepudiationProof",type:"object",properties:{type:{example:"NonRepudiationProof",enum:["NonRepudiationProof"]},name:{type:"string",example:"Resource name"},resource:{description:"a non-repudiation proof (either a PoO, a PoR or a PoP) as a compact JWS"}},required:["type","resource"]},ResourceId:{type:"object",properties:{id:{type:"string"}},required:["id"]},ResourceType:{type:"string",enum:["VerifiableCredential","Object","KeyPair","Contract","DataExchange","NonRepudiationProof"]},SignedTransaction:{title:"SignedTransaction",description:"A list of resources",type:"object",properties:{transaction:{type:"string",pattern:"^0x(?:[A-Fa-f0-9])+$"}}},DecodedJwt:{title:"JwtPayload",type:"object",properties:{header:{type:"object",properties:{typ:{type:"string",enum:["JWT"]},alg:{type:"string",enum:["ES256K"]}},required:["typ","alg"],additionalProperties:!0},payload:{type:"object",properties:{iss:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},required:["iss"],additionalProperties:!0},signature:{type:"string",format:"^[A-Za-z0-9_-]+$"},data:{type:"string",format:"^[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+$",description:"."}},required:["signature","data"]},VerificationOutput:{title:"VerificationOutput",type:"object",properties:{verification:{type:"string",enum:["success","failed"],description:"whether verification has been successful or has failed"},error:{type:"string",description:"error message if verification failed"},decodedJwt:{description:"the decoded JWT"}},required:["verification"]},ProviderData:{title:"ProviderData",description:"A JSON object with information of the DLT provider currently in use.",type:"object",properties:{provider:{type:"string",example:"did:ethr:i3m"},network:{type:"string",example:"i3m"},rpcUrl:{type:"string",example:"http://95.211.3.250:8545"}},additionalProperties:!0},EthereumAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},did:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},IdentityData:{title:"Identity Data",type:"object",properties:{did:{type:"string",example:"did:ethr:i3m:0x03142f480f831e835822fc0cd35726844a7069d28df58fb82037f1598812e1ade8"},alias:{type:"string",example:"identity1"},provider:{type:"string",example:"did:ethr:i3m"},addresses:{type:"array",items:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},example:["0x8646cAcF516de1292be1D30AB68E7Ea51e9B1BE7"]}},required:["did"]},ApiError:{type:"object",title:"Error",required:["code","message"],properties:{code:{type:"integer",format:"int32"},message:{type:"string"}}},JwkPair:{type:"object",properties:{privateJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents a private key (complementary to `publicJwk`)\n",example:'{"alg":"ES256","crv":"P-256","d":"rQp_3eZzvXwt1sK7WWsRhVYipqNGblzYDKKaYirlqs0","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'},publicJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents the public key (complementary to `privateJwk`).\n",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'}},required:["privateJwk","publicJwk"]},CompactJWS:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"},DataExchangeAgreement:{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},DataSharingAgreement:{type:"object",required:["dataOfferingDescription","parties","purpose","duration","intendedUse","licenseGrant","dataStream","personalData","pricingModel","dataExchangeAgreement","signatures"],properties:{dataOfferingDescription:{type:"object",required:["dataOfferingId","version","active"],properties:{dataOfferingId:{type:"string"},version:{type:"integer"},category:{type:"string"},active:{type:"boolean"},title:{type:"string"}}},parties:{type:"object",required:["providerDid","consumerDid"],properties:{providerDid:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},consumerDid:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}}},purpose:{type:"string"},duration:{type:"object",required:["creationDate","startDate","endDate"],properties:{creationDate:{type:"integer"},startDate:{type:"integer"},endDate:{type:"integer"}}},intendedUse:{type:"object",required:["processData","shareDataWithThirdParty","editData"],properties:{processData:{type:"boolean"},shareDataWithThirdParty:{type:"boolean"},editData:{type:"boolean"}}},licenseGrant:{type:"object",required:["transferable","exclusiveness","paidUp","revocable","processing","modifying","analyzing","storingData","storingCopy","reproducing","distributing","loaning","selling","renting","furtherLicensing","leasing"],properties:{transferable:{type:"boolean"},exclusiveness:{type:"boolean"},paidUp:{type:"boolean"},revocable:{type:"boolean"},processing:{type:"boolean"},modifying:{type:"boolean"},analyzing:{type:"boolean"},storingData:{type:"boolean"},storingCopy:{type:"boolean"},reproducing:{type:"boolean"},distributing:{type:"boolean"},loaning:{type:"boolean"},selling:{type:"boolean"},renting:{type:"boolean"},furtherLicensing:{type:"boolean"},leasing:{type:"boolean"}}},dataStream:{type:"boolean"},personalData:{type:"boolean"},pricingModel:{type:"object",required:["basicPrice","currency","hasFreePrice"],properties:{paymentType:{type:"string"},pricingModelName:{type:"string"},basicPrice:{type:"number",format:"float"},currency:{type:"string"},fee:{type:"number",format:"float"},hasPaymentOnSubscription:{type:"object",properties:{paymentOnSubscriptionName:{type:"string"},paymentType:{type:"string"},timeDuration:{type:"string"},description:{type:"string"},repeat:{type:"string"},hasSubscriptionPrice:{type:"number"}}},hasFreePrice:{type:"object",properties:{hasPriceFree:{type:"boolean"}}}}},dataExchangeAgreement:{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},signatures:{type:"object",required:["providerSignature","consumerSignature"],properties:{providerSignature:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"},consumerSignature:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"}}}}},DataExchange:{allOf:[{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},{type:"object",properties:{cipherblockDgst:{type:"string",description:"hash of the cipherblock in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"},blockCommitment:{type:"string",description:"hash of the plaintext block in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"},secretCommitment:{type:"string",description:"ash of the secret that can be used to decrypt the block in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"}},required:["cipherblockDgst","blockCommitment","secretCommitment"]}]}}},Dp={exports:{}},$p={},Bp={},Fp={},zp={},Up={},Lp={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;class t{}e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class r extends t{constructor(t){if(super(),!e.IDENTIFIER.test(t))throw new Error("CodeGen: name must be a valid identifier");this.str=t}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=r;class n 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,t)=>`${e}${t}`),"")}get names(){var e;return null!==(e=this._names)&&void 0!==e?e:this._names=this._items.reduce(((e,t)=>(t instanceof r&&(e[t.str]=(e[t.str]||0)+1),e)),{})}}function i(e,...t){const r=[e[0]];let i=0;for(;i{if(void 0===r.scopePath)throw new Error(`CodeGen: name "${r}" has no value`);return t._`${e}${r.scopePath}`}))}scopeCode(e=this._values,t,r){return this._reduceValues(e,(e=>{if(void 0===e.value)throw new Error(`CodeGen: name "${e}" has no value`);return e.value.code}),t,r)}_reduceValues(i,o,a={},s){let c=t.nil;for(const u in i){const f=i[u];if(!f)continue;const d=a[u]=a[u]||new Map;f.forEach((i=>{if(d.has(i))return;d.set(i,n.Started);let a=o(i);if(a){const r=this.opts.es5?e.varKinds.var:e.varKinds.const;c=t._`${c}${r} ${i} = ${a};${this.opts._n}`}else{if(!(a=null==s?void 0:s(i)))throw new r(i);c=t._`${c}${a}${this.opts._n}`}d.set(i,n.Completed)}))}return c}}}(qp),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;const t=Lp,r=qp;var n=Lp;Object.defineProperty(e,"_",{enumerable:!0,get:function(){return n._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return n.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return n.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return n.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return n.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return n.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return n.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return n.Name}});var i=qp;Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return i.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return i.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return i.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return i.varKinds}}),e.operators={GT:new t._Code(">"),GTE:new t._Code(">="),LT:new t._Code("<"),LTE:new t._Code("<="),EQ:new t._Code("==="),NEQ:new t._Code("!=="),NOT:new t._Code("!"),OR:new t._Code("||"),AND:new t._Code("&&"),ADD:new t._Code("+")};class o{optimizeNodes(){return this}optimizeNames(e,t){return this}}class a extends o{constructor(e,t,r){super(),this.varKind=e,this.name=t,this.rhs=r}render({es5:e,_n:t}){const n=e?r.varKinds.var:this.varKind,i=void 0===this.rhs?"":` = ${this.rhs}`;return`${n} ${this.name}${i};`+t}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&(this.rhs=C(this.rhs,e,t)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class s extends o{constructor(e,t,r){super(),this.lhs=e,this.rhs=t,this.sideEffects=r}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof t.Name)||e[this.lhs.str]||this.sideEffects)return this.rhs=C(this.rhs,e,r),this}get names(){return M(this.lhs instanceof t.Name?{}:{...this.lhs.names},this.rhs)}}class c extends s{constructor(e,t,r,n){super(e,r,n),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class u extends o{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class f extends o{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class d extends o{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class l extends o{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=C(this.code,e,t),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class h extends o{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce(((t,r)=>t+r.render(e)),"")}optimizeNodes(){const{nodes:e}=this;let t=e.length;for(;t--;){const r=e[t].optimizeNodes();Array.isArray(r)?e.splice(t,1,...r):r?e[t]=r:e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){const{nodes:r}=this;let n=r.length;for(;n--;){const i=r[n];i.optimizeNames(e,t)||(I(e,i.names),r.splice(n,1))}return r.length>0?this:void 0}get names(){return this.nodes.reduce(((e,t)=>k(e,t.names)),{})}}class p extends h{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class m extends h{}class g extends p{}g.kind="else";class y extends p{constructor(e,t){super(t),this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);return this.else&&(t+="else "+this.else.render(e)),t}optimizeNodes(){super.optimizeNodes();const e=this.condition;if(!0===e)return this.nodes;let t=this.else;if(t){const e=t.optimizeNodes();t=this.else=Array.isArray(e)?new g(e):e}return t?!1===e?t instanceof y?t:t.nodes:this.nodes.length?this:new y(R(e),t instanceof y?[t]:t.nodes):!1!==e&&this.nodes.length?this:void 0}optimizeNames(e,t){var r;if(this.else=null===(r=this.else)||void 0===r?void 0:r.optimizeNames(e,t),super.optimizeNames(e,t)||this.else)return this.condition=C(this.condition,e,t),this}get names(){const e=super.names;return M(e,this.condition),this.else&&k(e,this.else.names),e}}y.kind="if";class b extends p{}b.kind="for";class v extends b{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iteration=C(this.iteration,e,t),this}get names(){return k(super.names,this.iteration.names)}}class w extends b{constructor(e,t,r,n){super(),this.varKind=e,this.name=t,this.from=r,this.to=n}render(e){const t=e.es5?r.varKinds.var:this.varKind,{name:n,from:i,to:o}=this;return`for(${t} ${n}=${i}; ${n}<${o}; ${n}++)`+super.render(e)}get names(){const e=M(super.names,this.from);return M(e,this.to)}}class A extends b{constructor(e,t,r,n){super(),this.loop=e,this.varKind=t,this.name=r,this.iterable=n}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iterable=C(this.iterable,e,t),this}get names(){return k(super.names,this.iterable.names)}}class _ extends p{constructor(e,t,r){super(),this.name=e,this.args=t,this.async=r}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}}_.kind="func";class E extends h{render(e){return"return "+super.render(e)}}E.kind="return";class S extends p{render(e){let t="try"+super.render(e);return this.catch&&(t+=this.catch.render(e)),this.finally&&(t+=this.finally.render(e)),t}optimizeNodes(){var e,t;return super.optimizeNodes(),null===(e=this.catch)||void 0===e||e.optimizeNodes(),null===(t=this.finally)||void 0===t||t.optimizeNodes(),this}optimizeNames(e,t){var r,n;return super.optimizeNames(e,t),null===(r=this.catch)||void 0===r||r.optimizeNames(e,t),null===(n=this.finally)||void 0===n||n.optimizeNames(e,t),this}get names(){const e=super.names;return this.catch&&k(e,this.catch.names),this.finally&&k(e,this.finally.names),e}}class P extends p{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}P.kind="catch";class x extends p{render(e){return"finally"+super.render(e)}}x.kind="finally";function k(e,t){for(const r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function M(e,r){return r instanceof t._CodeOrName?k(e,r.names):e}function C(e,r,n){return e instanceof t.Name?o(e):(i=e)instanceof t._Code&&i._items.some((e=>e instanceof t.Name&&1===r[e.str]&&void 0!==n[e.str]))?new t._Code(e._items.reduce(((e,r)=>(r instanceof t.Name&&(r=o(r)),r instanceof t._Code?e.push(...r._items):e.push(r),e)),[])):e;var i;function o(e){const t=n[e.str];return void 0===t||1!==r[e.str]?e:(delete r[e.str],t)}}function I(e,t){for(const r in t)e[r]=(e[r]||0)-(t[r]||0)}function R(e){return"boolean"==typeof e||"number"==typeof e||null===e?!e:t._`!${j(e)}`}e.CodeGen=class{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?"\n":""},this._extScope=e,this._scope=new r.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,t){const r=this._extScope.value(e,t);return(this._values[r.prefix]||(this._values[r.prefix]=new Set)).add(r),r}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,r,n){const i=this._scope.toName(t);return void 0!==r&&n&&(this._constants[i.str]=r),this._leafNode(new a(e,i,r)),i}const(e,t,n){return this._def(r.varKinds.const,e,t,n)}let(e,t,n){return this._def(r.varKinds.let,e,t,n)}var(e,t,n){return this._def(r.varKinds.var,e,t,n)}assign(e,t,r){return this._leafNode(new s(e,t,r))}add(t,r){return this._leafNode(new c(t,e.operators.ADD,r))}code(e){return"function"==typeof e?e():e!==t.nil&&this._leafNode(new l(e)),this}object(...e){const r=["{"];for(const[n,i]of e)r.length>1&&r.push(","),r.push(n),(n!==i||this.opts.es5)&&(r.push(":"),(0,t.addCodeArg)(r,i));return r.push("}"),new t._Code(r)}if(e,t,r){if(this._blockNode(new y(e)),t&&r)this.code(t).else().code(r).endIf();else if(t)this.code(t).endIf();else if(r)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new y(e))}else(){return this._elseNode(new g)}endIf(){return this._endBlockNode(y,g)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new v(e),t)}forRange(e,t,n,i,o=(this.opts.es5?r.varKinds.var:r.varKinds.let)){const a=this._scope.toName(e);return this._for(new w(o,a,t,n),(()=>i(a)))}forOf(e,n,i,o=r.varKinds.const){const a=this._scope.toName(e);if(this.opts.es5){const e=n instanceof t.Name?n:this.var("_arr",n);return this.forRange("_i",0,t._`${e}.length`,(r=>{this.var(a,t._`${e}[${r}]`),i(a)}))}return this._for(new A("of",o,a,n),(()=>i(a)))}forIn(e,n,i,o=(this.opts.es5?r.varKinds.var:r.varKinds.const)){if(this.opts.ownProperties)return this.forOf(e,t._`Object.keys(${n})`,i);const a=this._scope.toName(e);return this._for(new A("in",o,a,n),(()=>i(a)))}endFor(){return this._endBlockNode(b)}label(e){return this._leafNode(new u(e))}break(e){return this._leafNode(new f(e))}return(e){const t=new E;if(this._blockNode(t),this.code(e),1!==t.nodes.length)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(E)}try(e,t,r){if(!t&&!r)throw new Error('CodeGen: "try" without "catch" and "finally"');const n=new S;if(this._blockNode(n),this.code(e),t){const e=this.name("e");this._currNode=n.catch=new P(e),t(e)}return r&&(this._currNode=n.finally=new x,this.code(r)),this._endBlockNode(P,x)}throw(e){return this._leafNode(new d(e))}block(e,t){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(t),this}endBlock(e){const t=this._blockStarts.pop();if(void 0===t)throw new Error("CodeGen: not in self-balancing block");const r=this._nodes.length-t;if(r<0||void 0!==e&&r!==e)throw new Error(`CodeGen: wrong number of nodes: ${r} vs ${e} expected`);return this._nodes.length=t,this}func(e,r=t.nil,n,i){return this._blockNode(new _(e,r,n)),i&&this.code(i).endFunc(),this}endFunc(){return this._endBlockNode(_)}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,t){const r=this._currNode;if(r instanceof e||t&&r instanceof t)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){const t=this._currNode;if(!(t instanceof y))throw new Error('CodeGen: "else" without "if"');return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){const e=this._nodes;return e[e.length-1]}set _currNode(e){const t=this._nodes;t[t.length-1]=e}},e.not=R;const N=T(e.operators.AND);e.and=function(...e){return e.reduce(N)};const O=T(e.operators.OR);function T(e){return(r,n)=>r===t.nil?n:n===t.nil?r:t._`${j(r)} ${e} ${j(n)}`}function j(e){return e instanceof t.Name?e:t._`(${e})`}e.or=function(...e){return e.reduce(O)}}(Up);var Hp={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.checkStrictMode=e.getErrorPath=e.Type=e.useFunc=e.setEvaluated=e.evaluatedPropsToName=e.mergeEvaluated=e.eachItem=e.unescapeJsonPointer=e.escapeJsonPointer=e.escapeFragment=e.unescapeFragment=e.schemaRefOrVal=e.schemaHasRulesButRef=e.schemaHasRules=e.checkUnknownRules=e.alwaysValidSchema=e.toHash=void 0;const t=Up,r=Lp;function n(e,t=e.schema){const{opts:r,self:n}=e;if(!r.strictSchema)return;if("boolean"==typeof t)return;const i=n.RULES.keywords;for(const r in t)i[r]||l(e,`unknown keyword: "${r}"`)}function i(e,t){if("boolean"==typeof e)return!e;for(const r in e)if(t[r])return!0;return!1}function o(e){return"number"==typeof e?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}function a(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function s({mergeNames:e,mergeToName:r,mergeValues:n,resultToName:i}){return(o,a,s,c)=>{const u=void 0===s?a:s instanceof t.Name?(a instanceof t.Name?e(o,a,s):r(o,a,s),s):a instanceof t.Name?(r(o,s,a),a):n(a,s);return c!==t.Name||u instanceof t.Name?u:i(o,u)}}function c(e,r){if(!0===r)return e.var("props",!0);const n=e.var("props",t._`{}`);return void 0!==r&&u(e,n,r),n}function u(e,r,n){Object.keys(n).forEach((n=>e.assign(t._`${r}${(0,t.getProperty)(n)}`,!0)))}e.toHash=function(e){const t={};for(const r of e)t[r]=!0;return t},e.alwaysValidSchema=function(e,t){return"boolean"==typeof t?t:0===Object.keys(t).length||(n(e,t),!i(t,e.self.RULES.all))},e.checkUnknownRules=n,e.schemaHasRules=i,e.schemaHasRulesButRef=function(e,t){if("boolean"==typeof e)return!e;for(const r in e)if("$ref"!==r&&t.all[r])return!0;return!1},e.schemaRefOrVal=function({topSchemaRef:e,schemaPath:r},n,i,o){if(!o){if("number"==typeof n||"boolean"==typeof n)return n;if("string"==typeof n)return t._`${n}`}return t._`${e}${r}${(0,t.getProperty)(i)}`},e.unescapeFragment=function(e){return a(decodeURIComponent(e))},e.escapeFragment=function(e){return encodeURIComponent(o(e))},e.escapeJsonPointer=o,e.unescapeJsonPointer=a,e.eachItem=function(e,t){if(Array.isArray(e))for(const r of e)t(r);else t(e)},e.mergeEvaluated={props:s({mergeNames:(e,r,n)=>e.if(t._`${n} !== true && ${r} !== undefined`,(()=>{e.if(t._`${r} === true`,(()=>e.assign(n,!0)),(()=>e.assign(n,t._`${n} || {}`).code(t._`Object.assign(${n}, ${r})`)))})),mergeToName:(e,r,n)=>e.if(t._`${n} !== true`,(()=>{!0===r?e.assign(n,!0):(e.assign(n,t._`${n} || {}`),u(e,n,r))})),mergeValues:(e,t)=>!0===e||{...e,...t},resultToName:c}),items:s({mergeNames:(e,r,n)=>e.if(t._`${n} !== true && ${r} !== undefined`,(()=>e.assign(n,t._`${r} === true ? true : ${n} > ${r} ? ${n} : ${r}`))),mergeToName:(e,r,n)=>e.if(t._`${n} !== true`,(()=>e.assign(n,!0===r||t._`${n} > ${r} ? ${n} : ${r}`))),mergeValues:(e,t)=>!0===e||Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})},e.evaluatedPropsToName=c,e.setEvaluated=u;const f={};var d;function l(e,t,r=e.opts.strictSchema){if(r){if(t=`strict mode: ${t}`,!0===r)throw new Error(t);e.self.logger.warn(t)}}e.useFunc=function(e,t){return e.scopeValue("func",{ref:t,code:f[t.code]||(f[t.code]=new r._Code(t.code))})},function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"}(d=e.Type||(e.Type={})),e.getErrorPath=function(e,r,n){if(e instanceof t.Name){const i=r===d.Num;return n?i?t._`"[" + ${e} + "]"`:t._`"['" + ${e} + "']"`:i?t._`"/" + ${e}`:t._`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return n?(0,t.getProperty)(e).toString():"/"+o(e)},e.checkStrictMode=l}(Hp);var Kp={};Object.defineProperty(Kp,"__esModule",{value:!0});const Jp=Up,Wp={data:new Jp.Name("data"),valCxt:new Jp.Name("valCxt"),instancePath:new Jp.Name("instancePath"),parentData:new Jp.Name("parentData"),parentDataProperty:new Jp.Name("parentDataProperty"),rootData:new Jp.Name("rootData"),dynamicAnchors:new Jp.Name("dynamicAnchors"),vErrors:new Jp.Name("vErrors"),errors:new Jp.Name("errors"),this:new Jp.Name("this"),self:new Jp.Name("self"),scope:new Jp.Name("scope"),json:new Jp.Name("json"),jsonPos:new Jp.Name("jsonPos"),jsonLen:new Jp.Name("jsonLen"),jsonPart:new Jp.Name("jsonPart")};Kp.default=Wp,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;const t=Up,r=Hp,n=Kp;function i(e,r){const i=e.const("err",r);e.if(t._`${n.default.vErrors} === null`,(()=>e.assign(n.default.vErrors,t._`[${i}]`)),t._`${n.default.vErrors}.push(${i})`),e.code(t._`${n.default.errors}++`)}function o(e,r){const{gen:n,validateName:i,schemaEnv:o}=e;o.$async?n.throw(t._`new ${e.ValidationError}(${r})`):(n.assign(t._`${i}.errors`,r),n.return(!1))}e.keywordError={message:({keyword:e})=>t.str`must pass "${e}" keyword validation`},e.keyword$DataError={message:({keyword:e,schemaType:r})=>r?t.str`"${e}" keyword must be ${r} ($data)`:t.str`"${e}" keyword is invalid ($data)`},e.reportError=function(r,n=e.keywordError,a,c){const{it:u}=r,{gen:f,compositeRule:d,allErrors:l}=u,h=s(r,n,a);(null!=c?c:d||l)?i(f,h):o(u,t._`[${h}]`)},e.reportExtraError=function(t,r=e.keywordError,a){const{it:c}=t,{gen:u,compositeRule:f,allErrors:d}=c;i(u,s(t,r,a)),f||d||o(c,n.default.vErrors)},e.resetErrorsCount=function(e,r){e.assign(n.default.errors,r),e.if(t._`${n.default.vErrors} !== null`,(()=>e.if(r,(()=>e.assign(t._`${n.default.vErrors}.length`,r)),(()=>e.assign(n.default.vErrors,null)))))},e.extendErrors=function({gen:e,keyword:r,schemaValue:i,data:o,errsCount:a,it:s}){if(void 0===a)throw new Error("ajv implementation error");const c=e.name("err");e.forRange("i",a,n.default.errors,(a=>{e.const(c,t._`${n.default.vErrors}[${a}]`),e.if(t._`${c}.instancePath === undefined`,(()=>e.assign(t._`${c}.instancePath`,(0,t.strConcat)(n.default.instancePath,s.errorPath)))),e.assign(t._`${c}.schemaPath`,t.str`${s.errSchemaPath}/${r}`),s.opts.verbose&&(e.assign(t._`${c}.schema`,i),e.assign(t._`${c}.data`,o))}))};const a={keyword:new t.Name("keyword"),schemaPath:new t.Name("schemaPath"),params:new t.Name("params"),propertyName:new t.Name("propertyName"),message:new t.Name("message"),schema:new t.Name("schema"),parentSchema:new t.Name("parentSchema")};function s(e,r,i){const{createErrors:o}=e.it;return!1===o?t._`{}`:function(e,r,i={}){const{gen:o,it:s}=e,f=[c(s,i),u(e,i)];return function(e,{params:r,message:i},o){const{keyword:s,data:c,schemaValue:u,it:f}=e,{opts:d,propertyName:l,topSchemaRef:h,schemaPath:p}=f;o.push([a.keyword,s],[a.params,"function"==typeof r?r(e):r||t._`{}`]),d.messages&&o.push([a.message,"function"==typeof i?i(e):i]);d.verbose&&o.push([a.schema,u],[a.parentSchema,t._`${h}${p}`],[n.default.data,c]);l&&o.push([a.propertyName,l])}(e,r,f),o.object(...f)}(e,r,i)}function c({errorPath:e},{instancePath:i}){const o=i?t.str`${e}${(0,r.getErrorPath)(i,r.Type.Str)}`:e;return[n.default.instancePath,(0,t.strConcat)(n.default.instancePath,o)]}function u({keyword:e,it:{errSchemaPath:n}},{schemaPath:i,parentSchema:o}){let s=o?n:t.str`${n}/${e}`;return i&&(s=t.str`${s}${(0,r.getErrorPath)(i,r.Type.Str)}`),[a.schemaPath,s]}}(zp),Object.defineProperty(Fp,"__esModule",{value:!0}),Fp.boolOrEmptySchema=Fp.topBoolOrEmptySchema=void 0;const Gp=zp,Vp=Up,Zp=Kp,Xp={message:"boolean schema is false"};function Qp(e,t){const{gen:r,data:n}=e,i={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,Gp.reportError)(i,Xp,void 0,t)}Fp.topBoolOrEmptySchema=function(e){const{gen:t,schema:r,validateName:n}=e;!1===r?Qp(e,!1):"object"==typeof r&&!0===r.$async?t.return(Zp.default.data):(t.assign(Vp._`${n}.errors`,null),t.return(!0))},Fp.boolOrEmptySchema=function(e,t){const{gen:r,schema:n}=e;!1===n?(r.var(t,!1),Qp(e)):r.var(t,!0)};var Yp={},em={};Object.defineProperty(em,"__esModule",{value:!0}),em.getRules=em.isJSONType=void 0;const tm=new Set(["string","number","integer","boolean","null","object","array"]);em.isJSONType=function(e){return"string"==typeof e&&tm.has(e)},em.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:{}}};var rm={};function nm(e,t){return t.rules.some((t=>im(e,t)))}function im(e,t){var r;return void 0!==e[t.keyword]||(null===(r=t.definition.implements)||void 0===r?void 0:r.some((t=>void 0!==e[t])))}Object.defineProperty(rm,"__esModule",{value:!0}),rm.shouldUseRule=rm.shouldUseGroup=rm.schemaHasRulesForType=void 0,rm.schemaHasRulesForType=function({schema:e,self:t},r){const n=t.RULES.types[r];return n&&!0!==n&&nm(e,n)},rm.shouldUseGroup=nm,rm.shouldUseRule=im,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.reportTypeError=e.checkDataTypes=e.checkDataType=e.coerceAndCheckDataType=e.getJSONTypes=e.getSchemaTypes=e.DataType=void 0;const t=em,r=rm,n=zp,i=Up,o=Hp;var a;function s(e){const r=Array.isArray(e)?e:e?[e]:[];if(r.every(t.isJSONType))return r;throw new Error("type must be JSONType or JSONType[]: "+r.join(","))}!function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"}(a=e.DataType||(e.DataType={})),e.getSchemaTypes=function(e){const t=s(e.type);if(t.includes("null")){if(!1===e.nullable)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&void 0!==e.nullable)throw new Error('"nullable" cannot be used without "type"');!0===e.nullable&&t.push("null")}return t},e.getJSONTypes=s,e.coerceAndCheckDataType=function(e,t){const{gen:n,data:o,opts:s}=e,u=function(e,t){return t?e.filter((e=>c.has(e)||"array"===t&&"array"===e)):[]}(t,s.coerceTypes),d=t.length>0&&!(0===u.length&&1===t.length&&(0,r.schemaHasRulesForType)(e,t[0]));if(d){const r=f(t,o,s.strictNumbers,a.Wrong);n.if(r,(()=>{u.length?function(e,t,r){const{gen:n,data:o,opts:a}=e,s=n.let("dataType",i._`typeof ${o}`),u=n.let("coerced",i._`undefined`);"array"===a.coerceTypes&&n.if(i._`${s} == 'object' && Array.isArray(${o}) && ${o}.length == 1`,(()=>n.assign(o,i._`${o}[0]`).assign(s,i._`typeof ${o}`).if(f(t,o,a.strictNumbers),(()=>n.assign(u,o)))));n.if(i._`${u} !== undefined`);for(const e of r)(c.has(e)||"array"===e&&"array"===a.coerceTypes)&&d(e);function d(e){switch(e){case"string":return void n.elseIf(i._`${s} == "number" || ${s} == "boolean"`).assign(u,i._`"" + ${o}`).elseIf(i._`${o} === null`).assign(u,i._`""`);case"number":return void n.elseIf(i._`${s} == "boolean" || ${o} === null || (${s} == "string" && ${o} && ${o} == +${o})`).assign(u,i._`+${o}`);case"integer":return void n.elseIf(i._`${s} === "boolean" || ${o} === null || (${s} === "string" && ${o} && ${o} == +${o} && !(${o} % 1))`).assign(u,i._`+${o}`);case"boolean":return void n.elseIf(i._`${o} === "false" || ${o} === 0 || ${o} === null`).assign(u,!1).elseIf(i._`${o} === "true" || ${o} === 1`).assign(u,!0);case"null":return n.elseIf(i._`${o} === "" || ${o} === 0 || ${o} === false`),void n.assign(u,null);case"array":n.elseIf(i._`${s} === "string" || ${s} === "number" - || ${s} === "boolean" || ${o} === null`).assign(u,i._`[${o}]`)}}n.else(),l(e),n.endIf(),n.if(i._`${u} !== undefined`,(()=>{n.assign(o,u),function({gen:e,parentData:t,parentDataProperty:r},n){e.if(i._`${t} !== undefined`,(()=>e.assign(i._`${t}[${r}]`,n)))}(e,u)}))}(e,t,u):l(e)}))}return d};const c=new Set(["string","number","integer","boolean","null"]);function u(e,t,r,n=a.Correct){const o=n===a.Correct?i.operators.EQ:i.operators.NEQ;let s;switch(e){case"null":return i._`${t} ${o} null`;case"array":s=i._`Array.isArray(${t})`;break;case"object":s=i._`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":s=c(i._`!(${t} % 1) && !isNaN(${t})`);break;case"number":s=c();break;default:return i._`typeof ${t} ${o} ${e}`}return n===a.Correct?s:(0,i.not)(s);function c(e=i.nil){return(0,i.and)(i._`typeof ${t} == "number"`,e,r?i._`isFinite(${t})`:i.nil)}}function f(e,t,r,n){if(1===e.length)return u(e[0],t,r,n);let a;const s=(0,o.toHash)(e);if(s.array&&s.object){const e=i._`typeof ${t} != "object"`;a=s.null?e:i._`!${t} || ${e}`,delete s.null,delete s.array,delete s.object}else a=i.nil;s.number&&delete s.integer;for(const e in s)a=(0,i.and)(a,u(e,t,r,n));return a}e.checkDataType=u,e.checkDataTypes=f;const d={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>"string"==typeof e?i._`{type: ${e}}`:i._`{type: ${t}}`};function l(e){const t=function(e){const{gen:t,data:r,schema:n}=e,i=(0,o.schemaRefOrVal)(e,n,"type");return{gen:t,keyword:"type",data:r,schema:n.type,schemaCode:i,schemaValue:i,parentSchema:n,params:{},it:e}}(e);(0,n.reportError)(t,d)}e.reportTypeError=l}(Xp);var nm={};Object.defineProperty(nm,"__esModule",{value:!0}),nm.assignDefaults=void 0;const im=Fp,om=Lp;function am(e,t,r){const{gen:n,compositeRule:i,data:o,opts:a}=e;if(void 0===r)return;const s=im._`${o}${(0,im.getProperty)(t)}`;if(i)return void(0,om.checkStrictMode)(e,`default is ignored for: ${s}`);let c=im._`${s} === undefined`;"empty"===a.useDefaults&&(c=im._`${c} || ${s} === null || ${s} === ""`),n.if(c,im._`${s} = ${(0,im.stringify)(r)}`)}nm.assignDefaults=function(e,t){const{properties:r,items:n}=e.schema;if("object"===t&&r)for(const t in r)am(e,t,r[t].default);else"array"===t&&Array.isArray(n)&&n.forEach(((t,r)=>am(e,r,t.default)))};var sm={},cm={};Object.defineProperty(cm,"__esModule",{value:!0}),cm.validateUnion=cm.validateArray=cm.usePattern=cm.callValidateCode=cm.schemaProperties=cm.allSchemaProperties=cm.noPropertyInData=cm.propertyInData=cm.isOwnProperty=cm.hasPropFunc=cm.reportMissingProp=cm.checkMissingProp=cm.checkReportMissingProp=void 0;const um=Fp,fm=Lp,dm=qp,lm=Lp;function hm(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:um._`Object.prototype.hasOwnProperty`})}function pm(e,t,r){return um._`${hm(e)}.call(${t}, ${r})`}function mm(e,t,r,n){const i=um._`${t}${(0,um.getProperty)(r)} === undefined`;return n?(0,um.or)(i,(0,um.not)(pm(e,t,r))):i}function gm(e){return e?Object.keys(e).filter((e=>"__proto__"!==e)):[]}cm.checkReportMissingProp=function(e,t){const{gen:r,data:n,it:i}=e;r.if(mm(r,n,t,i.opts.ownProperties),(()=>{e.setParams({missingProperty:um._`${t}`},!0),e.error()}))},cm.checkMissingProp=function({gen:e,data:t,it:{opts:r}},n,i){return(0,um.or)(...n.map((n=>(0,um.and)(mm(e,t,n,r.ownProperties),um._`${i} = ${n}`))))},cm.reportMissingProp=function(e,t){e.setParams({missingProperty:t},!0),e.error()},cm.hasPropFunc=hm,cm.isOwnProperty=pm,cm.propertyInData=function(e,t,r,n){const i=um._`${t}${(0,um.getProperty)(r)} !== undefined`;return n?um._`${i} && ${pm(e,t,r)}`:i},cm.noPropertyInData=mm,cm.allSchemaProperties=gm,cm.schemaProperties=function(e,t){return gm(t).filter((r=>!(0,fm.alwaysValidSchema)(e,t[r])))},cm.callValidateCode=function({schemaCode:e,data:t,it:{gen:r,topSchemaRef:n,schemaPath:i,errorPath:o},it:a},s,c,u){const f=u?um._`${e}, ${t}, ${n}${i}`:t,d=[[dm.default.instancePath,(0,um.strConcat)(dm.default.instancePath,o)],[dm.default.parentData,a.parentData],[dm.default.parentDataProperty,a.parentDataProperty],[dm.default.rootData,dm.default.rootData]];a.opts.dynamicRef&&d.push([dm.default.dynamicAnchors,dm.default.dynamicAnchors]);const l=um._`${f}, ${r.object(...d)}`;return c!==um.nil?um._`${s}.call(${c}, ${l})`:um._`${s}(${l})`};const ym=um._`new RegExp`;cm.usePattern=function({gen:e,it:{opts:t}},r){const n=t.unicodeRegExp?"u":"",{regExp:i}=t.code,o=i(r,n);return e.scopeValue("pattern",{key:o.toString(),ref:o,code:um._`${"new RegExp"===i.code?ym:(0,lm.useFunc)(e,i)}(${r}, ${n})`})},cm.validateArray=function(e){const{gen:t,data:r,keyword:n,it:i}=e,o=t.name("valid");if(i.allErrors){const e=t.let("valid",!0);return a((()=>t.assign(e,!1))),e}return t.var(o,!0),a((()=>t.break())),o;function a(i){const a=t.const("len",um._`${r}.length`);t.forRange("i",0,a,(r=>{e.subschema({keyword:n,dataProp:r,dataPropType:fm.Type.Num},o),t.if((0,um.not)(o),i)}))}},cm.validateUnion=function(e){const{gen:t,schema:r,keyword:n,it:i}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some((e=>(0,fm.alwaysValidSchema)(i,e)))&&!i.opts.unevaluated)return;const o=t.let("valid",!1),a=t.name("_valid");t.block((()=>r.forEach(((r,i)=>{const s=e.subschema({keyword:n,schemaProp:i,compositeRule:!0},a);t.assign(o,um._`${o} || ${a}`);e.mergeValidEvaluated(s,a)||t.if((0,um.not)(o))})))),e.result(o,(()=>e.reset()),(()=>e.error(!0)))},Object.defineProperty(sm,"__esModule",{value:!0}),sm.validateKeywordUsage=sm.validSchemaType=sm.funcKeywordCode=sm.macroKeywordCode=void 0;const bm=Fp,vm=qp,wm=cm,Am=Bp;function _m(e){const{gen:t,data:r,it:n}=e;t.if(n.parentData,(()=>t.assign(r,bm._`${n.parentData}[${n.parentDataProperty}]`)))}function Em(e,t,r){if(void 0===r)throw new Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword","function"==typeof r?{ref:r}:{ref:r,code:(0,bm.stringify)(r)})}sm.macroKeywordCode=function(e,t){const{gen:r,keyword:n,schema:i,parentSchema:o,it:a}=e,s=t.macro.call(a.self,i,o,a),c=Em(r,n,s);!1!==a.opts.validateSchema&&a.self.validateSchema(s,!0);const u=r.name("valid");e.subschema({schema:s,schemaPath:bm.nil,errSchemaPath:`${a.errSchemaPath}/${n}`,topSchemaRef:c,compositeRule:!0},u),e.pass(u,(()=>e.error(!0)))},sm.funcKeywordCode=function(e,t){var r;const{gen:n,keyword:i,schema:o,parentSchema:a,$data:s,it:c}=e;!function({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}(c,t);const u=!s&&t.compile?t.compile.call(c.self,o,a,c):t.validate,f=Em(n,i,u),d=n.let("valid");function l(r=(t.async?bm._`await `:bm.nil)){const i=c.opts.passContext?vm.default.this:vm.default.self,o=!("compile"in t&&!s||!1===t.schema);n.assign(d,bm._`${r}${(0,wm.callValidateCode)(e,f,i,o)}`,t.modifying)}function h(e){var r;n.if((0,bm.not)(null!==(r=t.valid)&&void 0!==r?r:d),e)}e.block$data(d,(function(){if(!1===t.errors)l(),t.modifying&&_m(e),h((()=>e.error()));else{const r=t.async?function(){const e=n.let("ruleErrs",null);return n.try((()=>l(bm._`await `)),(t=>n.assign(d,!1).if(bm._`${t} instanceof ${c.ValidationError}`,(()=>n.assign(e,bm._`${t}.errors`)),(()=>n.throw(t))))),e}():function(){const e=bm._`${f}.errors`;return n.assign(e,null),l(bm.nil),e}();t.modifying&&_m(e),h((()=>function(e,t){const{gen:r}=e;r.if(bm._`Array.isArray(${t})`,(()=>{r.assign(vm.default.vErrors,bm._`${vm.default.vErrors} === null ? ${t} : ${vm.default.vErrors}.concat(${t})`).assign(vm.default.errors,bm._`${vm.default.vErrors}.length`),(0,Am.extendErrors)(e)}),(()=>e.error()))}(e,r)))}})),e.ok(null!==(r=t.valid)&&void 0!==r?r:d)},sm.validSchemaType=function(e,t,r=!1){return!t.length||t.some((t=>"array"===t?Array.isArray(e):"object"===t?e&&"object"==typeof e&&!Array.isArray(e):typeof e==t||r&&void 0===e))},sm.validateKeywordUsage=function({schema:e,opts:t,self:r,errSchemaPath:n},i,o){if(Array.isArray(i.keyword)?!i.keyword.includes(o):i.keyword!==o)throw new Error("ajv implementation error");const a=i.dependencies;if(null==a?void 0:a.some((t=>!Object.prototype.hasOwnProperty.call(e,t))))throw new Error(`parent schema must have dependencies of ${o}: ${a.join(",")}`);if(i.validateSchema){if(!i.validateSchema(e[o])){const e=`keyword "${o}" value is invalid at path "${n}": `+r.errorsText(i.validateSchema.errors);if("log"!==t.validateSchema)throw new Error(e);r.logger.error(e)}}};var Sm={};Object.defineProperty(Sm,"__esModule",{value:!0}),Sm.extendSubschemaMode=Sm.extendSubschemaData=Sm.getSubschema=void 0;const Pm=Fp,xm=Lp;Sm.getSubschema=function(e,{keyword:t,schemaProp:r,schema:n,schemaPath:i,errSchemaPath:o,topSchemaRef:a}){if(void 0!==t&&void 0!==n)throw new Error('both "keyword" and "schema" passed, only one allowed');if(void 0!==t){const n=e.schema[t];return void 0===r?{schema:n,schemaPath:Pm._`${e.schemaPath}${(0,Pm.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:n[r],schemaPath:Pm._`${e.schemaPath}${(0,Pm.getProperty)(t)}${(0,Pm.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,xm.escapeFragment)(r)}`}}if(void 0!==n){if(void 0===i||void 0===o||void 0===a)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:i,topSchemaRef:a,errSchemaPath:o}}throw new Error('either "keyword" or "schema" must be passed')},Sm.extendSubschemaData=function(e,t,{dataProp:r,dataPropType:n,data:i,dataTypes:o,propertyName:a}){if(void 0!==i&&void 0!==r)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:s}=t;if(void 0!==r){const{errorPath:i,dataPathArr:o,opts:a}=t;c(s.let("data",Pm._`${t.data}${(0,Pm.getProperty)(r)}`,!0)),e.errorPath=Pm.str`${i}${(0,xm.getErrorPath)(r,n,a.jsPropertySyntax)}`,e.parentDataProperty=Pm._`${r}`,e.dataPathArr=[...o,e.parentDataProperty]}if(void 0!==i){c(i instanceof Pm.Name?i:s.let("data",i,!0)),void 0!==a&&(e.propertyName=a)}function c(r){e.data=r,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,r]}o&&(e.dataTypes=o)},Sm.extendSubschemaMode=function(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:n,createErrors:i,allErrors:o}){void 0!==n&&(e.compositeRule=n),void 0!==i&&(e.createErrors=i),void 0!==o&&(e.allErrors=o),e.jtdDiscriminator=t,e.jtdMetadata=r};var km={},Mm=function e(t,r){if(t===r)return!0;if(t&&r&&"object"==typeof t&&"object"==typeof r){if(t.constructor!==r.constructor)return!1;var n,i,o;if(Array.isArray(t)){if((n=t.length)!=r.length)return!1;for(i=n;0!=i--;)if(!e(t[i],r[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if((n=(o=Object.keys(t)).length)!==Object.keys(r).length)return!1;for(i=n;0!=i--;)if(!Object.prototype.hasOwnProperty.call(r,o[i]))return!1;for(i=n;0!=i--;){var a=o[i];if(!e(t[a],r[a]))return!1}return!0}return t!=t&&r!=r},Cm={exports:{}},Im=Cm.exports=function(e,t,r){"function"==typeof t&&(r=t,t={}),Rm(t,"function"==typeof(r=t.cb||r)?r:r.pre||function(){},r.post||function(){},e,"",e)};function Rm(e,t,r,n,i,o,a,s,c,u){if(n&&"object"==typeof n&&!Array.isArray(n)){for(var f in t(n,i,o,a,s,c,u),n){var d=n[f];if(Array.isArray(d)){if(f in Im.arrayKeywords)for(var l=0;lt+=Fm(e))),t===1/0))return 1/0}return t}function zm(e,t="",r){!1!==r&&(t=qm(t));const n=e.parse(t);return Um(e,n)}function Um(e,t){return e.serialize(t).split("#")[0]+"#"}km.getFullPath=zm,km._getFullPath=Um;const Lm=/#\/?$/;function qm(e){return e?e.replace(Lm,""):""}km.normalizeId=qm,km.resolveUrl=function(e,t,r){return r=qm(r),e.resolve(t,r)};const Hm=/^[a-z_][-a-z0-9._]*$/i;km.getSchemaRefs=function(e,t){if("boolean"==typeof e)return{};const{schemaId:r,uriResolver:n}=this.opts,i=qm(e[r]||t),o={"":i},a=zm(n,i,!1),s={},c=new Set;return jm(e,{allKeys:!0},((e,t,n,i)=>{if(void 0===i)return;const d=a+t;let l=o[i];function h(t){const r=this.opts.uriResolver.resolve;if(t=qm(l?r(l,t):t),c.has(t))throw f(t);c.add(t);let n=this.refs[t];return"string"==typeof n&&(n=this.refs[n]),"object"==typeof n?u(e,n.schema,t):t!==qm(d)&&("#"===t[0]?(u(e,s[t],t),s[t]=e):this.refs[t]=d),t}function p(e){if("string"==typeof e){if(!Hm.test(e))throw new Error(`invalid anchor "${e}"`);h.call(this,`#${e}`)}}"string"==typeof e[r]&&(l=h.call(this,e[r])),p.call(this,e.$anchor),p.call(this,e.$dynamicAnchor),o[t]=l})),s;function u(e,t,r){if(void 0!==t&&!Tm(e,t))throw f(r)}function f(e){return new Error(`reference "${e}" resolves to more than one schema`)}},Object.defineProperty(Dp,"__esModule",{value:!0}),Dp.getData=Dp.KeywordCxt=Dp.validateFunctionCode=void 0;const Km=$p,Jm=Xp,Wm=em,Gm=Xp,Vm=nm,Zm=sm,Xm=Sm,Qm=Fp,Ym=qp,eg=km,tg=Lp,rg=Bp;function ng({gen:e,validateName:t,schema:r,schemaEnv:n,opts:i},o){i.code.es5?e.func(t,Qm._`${Ym.default.data}, ${Ym.default.valCxt}`,n.$async,(()=>{e.code(Qm._`"use strict"; ${ig(r,i)}`),function(e,t){e.if(Ym.default.valCxt,(()=>{e.var(Ym.default.instancePath,Qm._`${Ym.default.valCxt}.${Ym.default.instancePath}`),e.var(Ym.default.parentData,Qm._`${Ym.default.valCxt}.${Ym.default.parentData}`),e.var(Ym.default.parentDataProperty,Qm._`${Ym.default.valCxt}.${Ym.default.parentDataProperty}`),e.var(Ym.default.rootData,Qm._`${Ym.default.valCxt}.${Ym.default.rootData}`),t.dynamicRef&&e.var(Ym.default.dynamicAnchors,Qm._`${Ym.default.valCxt}.${Ym.default.dynamicAnchors}`)}),(()=>{e.var(Ym.default.instancePath,Qm._`""`),e.var(Ym.default.parentData,Qm._`undefined`),e.var(Ym.default.parentDataProperty,Qm._`undefined`),e.var(Ym.default.rootData,Ym.default.data),t.dynamicRef&&e.var(Ym.default.dynamicAnchors,Qm._`{}`)}))}(e,i),e.code(o)})):e.func(t,Qm._`${Ym.default.data}, ${function(e){return Qm._`{${Ym.default.instancePath}="", ${Ym.default.parentData}, ${Ym.default.parentDataProperty}, ${Ym.default.rootData}=${Ym.default.data}${e.dynamicRef?Qm._`, ${Ym.default.dynamicAnchors}={}`:Qm.nil}}={}`}(i)}`,n.$async,(()=>e.code(ig(r,i)).code(o)))}function ig(e,t){const r="object"==typeof e&&e[t.schemaId];return r&&(t.code.source||t.code.process)?Qm._`/*# sourceURL=${r} */`:Qm.nil}function og(e,t){sg(e)&&(cg(e),ag(e))?function(e,t){const{schema:r,gen:n,opts:i}=e;i.$comment&&r.$comment&&fg(e);(function(e){const t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,eg.resolveUrl)(e.opts.uriResolver,e.baseId,t))})(e),function(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}(e);const o=n.const("_errs",Ym.default.errors);ug(e,o),n.var(t,Qm._`${o} === ${Ym.default.errors}`)}(e,t):(0,Km.boolOrEmptySchema)(e,t)}function ag({schema:e,self:t}){if("boolean"==typeof e)return!e;for(const r in e)if(t.RULES.all[r])return!0;return!1}function sg(e){return"boolean"!=typeof e.schema}function cg(e){(0,tg.checkUnknownRules)(e),function(e){const{schema:t,errSchemaPath:r,opts:n,self:i}=e;t.$ref&&n.ignoreKeywordsWithRef&&(0,tg.schemaHasRulesButRef)(t,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}(e)}function ug(e,t){if(e.opts.jtd)return dg(e,[],!1,t);const r=(0,Jm.getSchemaTypes)(e.schema);dg(e,r,!(0,Jm.coerceAndCheckDataType)(e,r),t)}function fg({gen:e,schemaEnv:t,schema:r,errSchemaPath:n,opts:i}){const o=r.$comment;if(!0===i.$comment)e.code(Qm._`${Ym.default.self}.logger.log(${o})`);else if("function"==typeof i.$comment){const r=Qm.str`${n}/$comment`,i=e.scopeValue("root",{ref:t.root});e.code(Qm._`${Ym.default.self}.opts.$comment(${o}, ${r}, ${i}.schema)`)}}function dg(e,t,r,n){const{gen:i,schema:o,data:a,allErrors:s,opts:c,self:u}=e,{RULES:f}=u;function d(u){(0,Wm.shouldUseGroup)(o,u)&&(u.type?(i.if((0,Gm.checkDataType)(u.type,a,c.strictNumbers)),lg(e,u),1===t.length&&t[0]===u.type&&r&&(i.else(),(0,Gm.reportTypeError)(e)),i.endIf()):lg(e,u),s||i.if(Qm._`${Ym.default.errors} === ${n||0}`))}!o.$ref||!c.ignoreKeywordsWithRef&&(0,tg.schemaHasRulesButRef)(o,f)?(c.jtd||function(e,t){if(e.schemaEnv.meta||!e.opts.strictTypes)return;(function(e,t){if(!t.length)return;if(!e.dataTypes.length)return void(e.dataTypes=t);t.forEach((t=>{pg(e.dataTypes,t)||mg(e,`type "${t}" not allowed by context "${e.dataTypes.join(",")}"`)})),function(e,t){const r=[];for(const n of e.dataTypes)pg(t,n)?r.push(n):t.includes("integer")&&"number"===n&&r.push("integer");e.dataTypes=r}(e,t)})(e,t),e.opts.allowUnionTypes||function(e,t){t.length>1&&(2!==t.length||!t.includes("null"))&&mg(e,"use allowUnionTypes to allow union type keyword")}(e,t);!function(e,t){const r=e.self.RULES.all;for(const n in r){const i=r[n];if("object"==typeof i&&(0,Wm.shouldUseRule)(e.schema,i)){const{type:r}=i.definition;r.length&&!r.some((e=>hg(t,e)))&&mg(e,`missing type "${r.join(",")}" for keyword "${n}"`)}}}(e,e.dataTypes)}(e,t),i.block((()=>{for(const e of f.rules)d(e);d(f.post)}))):i.block((()=>yg(e,"$ref",f.all.$ref.definition)))}function lg(e,t){const{gen:r,schema:n,opts:{useDefaults:i}}=e;i&&(0,Vm.assignDefaults)(e,t.type),r.block((()=>{for(const r of t.rules)(0,Wm.shouldUseRule)(n,r)&&yg(e,r.keyword,r.definition,t.type)}))}function hg(e,t){return e.includes(t)||"number"===t&&e.includes("integer")}function pg(e,t){return e.includes(t)||"integer"===t&&e.includes("number")}function mg(e,t){t+=` at "${e.schemaEnv.baseId+e.errSchemaPath}" (strictTypes)`,(0,tg.checkStrictMode)(e,t,e.opts.strictTypes)}Dp.validateFunctionCode=function(e){sg(e)&&(cg(e),ag(e))?function(e){const{schema:t,opts:r,gen:n}=e;ng(e,(()=>{r.$comment&&t.$comment&&fg(e),function(e){const{schema:t,opts:r}=e;void 0!==t.default&&r.useDefaults&&r.strictSchema&&(0,tg.checkStrictMode)(e,"default is ignored in the schema root")}(e),n.let(Ym.default.vErrors,null),n.let(Ym.default.errors,0),r.unevaluated&&function(e){const{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",Qm._`${r}.evaluated`),t.if(Qm._`${e.evaluated}.dynamicProps`,(()=>t.assign(Qm._`${e.evaluated}.props`,Qm._`undefined`))),t.if(Qm._`${e.evaluated}.dynamicItems`,(()=>t.assign(Qm._`${e.evaluated}.items`,Qm._`undefined`)))}(e),ug(e),function(e){const{gen:t,schemaEnv:r,validateName:n,ValidationError:i,opts:o}=e;r.$async?t.if(Qm._`${Ym.default.errors} === 0`,(()=>t.return(Ym.default.data)),(()=>t.throw(Qm._`new ${i}(${Ym.default.vErrors})`))):(t.assign(Qm._`${n}.errors`,Ym.default.vErrors),o.unevaluated&&function({gen:e,evaluated:t,props:r,items:n}){r instanceof Qm.Name&&e.assign(Qm._`${t}.props`,r);n instanceof Qm.Name&&e.assign(Qm._`${t}.items`,n)}(e),t.return(Qm._`${Ym.default.errors} === 0`))}(e)}))}(e):ng(e,(()=>(0,Km.topBoolOrEmptySchema)(e)))};class gg{constructor(e,t,r){if((0,Zm.validateKeywordUsage)(e,t,r),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=r,this.data=e.data,this.schema=e.schema[r],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,tg.schemaRefOrVal)(e,this.schema,r,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const("vSchema",wg(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,Zm.validSchemaType)(this.schema,t.schemaType,t.allowUndefined))throw new Error(`${r} value must be ${JSON.stringify(t.schemaType)}`);("code"in t?t.trackErrors:!1!==t.errors)&&(this.errsCount=e.gen.const("_errs",Ym.default.errors))}result(e,t,r){this.failResult((0,Qm.not)(e),t,r)}failResult(e,t,r){this.gen.if(e),r?r():this.error(),t?(this.gen.else(),t(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,t){this.failResult((0,Qm.not)(e),void 0,t)}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:t}=this;this.fail(Qm._`${t} !== undefined && (${(0,Qm.or)(this.invalid$data(),e)})`)}error(e,t,r){if(t)return this.setParams(t),this._error(e,r),void this.setParams({});this._error(e,r)}_error(e,t){(e?rg.reportExtraError:rg.reportError)(this,this.def.error,t)}$dataError(){(0,rg.reportError)(this,this.def.$dataError||rg.keyword$DataError)}reset(){if(void 0===this.errsCount)throw new Error('add "trackErrors" to keyword definition');(0,rg.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,t){t?Object.assign(this.params,e):this.params=e}block$data(e,t,r=Qm.nil){this.gen.block((()=>{this.check$data(e,r),t()}))}check$data(e=Qm.nil,t=Qm.nil){if(!this.$data)return;const{gen:r,schemaCode:n,schemaType:i,def:o}=this;r.if((0,Qm.or)(Qm._`${n} === undefined`,t)),e!==Qm.nil&&r.assign(e,!0),(i.length||o.validateSchema)&&(r.elseIf(this.invalid$data()),this.$dataError(),e!==Qm.nil&&r.assign(e,!1)),r.else()}invalid$data(){const{gen:e,schemaCode:t,schemaType:r,def:n,it:i}=this;return(0,Qm.or)(function(){if(r.length){if(!(t instanceof Qm.Name))throw new Error("ajv implementation error");const e=Array.isArray(r)?r:[r];return Qm._`${(0,Gm.checkDataTypes)(e,t,i.opts.strictNumbers,Gm.DataType.Wrong)}`}return Qm.nil}(),function(){if(n.validateSchema){const r=e.scopeValue("validate$data",{ref:n.validateSchema});return Qm._`!${r}(${t})`}return Qm.nil}())}subschema(e,t){const r=(0,Xm.getSubschema)(this.it,e);(0,Xm.extendSubschemaData)(r,this.it,e),(0,Xm.extendSubschemaMode)(r,e);const n={...this.it,...r,items:void 0,props:void 0};return og(n,t),n}mergeEvaluated(e,t){const{it:r,gen:n}=this;r.opts.unevaluated&&(!0!==r.props&&void 0!==e.props&&(r.props=tg.mergeEvaluated.props(n,e.props,r.props,t)),!0!==r.items&&void 0!==e.items&&(r.items=tg.mergeEvaluated.items(n,e.items,r.items,t)))}mergeValidEvaluated(e,t){const{it:r,gen:n}=this;if(r.opts.unevaluated&&(!0!==r.props||!0!==r.items))return n.if(t,(()=>this.mergeEvaluated(e,Qm.Name))),!0}}function yg(e,t,r,n){const i=new gg(e,r,t);"code"in r?r.code(i,n):i.$data&&r.validate?(0,Zm.funcKeywordCode)(i,r):"macro"in r?(0,Zm.macroKeywordCode)(i,r):(r.compile||r.validate)&&(0,Zm.funcKeywordCode)(i,r)}Dp.KeywordCxt=gg;const bg=/^\/(?:[^~]|~0|~1)*$/,vg=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function wg(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let i,o;if(""===e)return Ym.default.rootData;if("/"===e[0]){if(!bg.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);i=e,o=Ym.default.rootData}else{const a=vg.exec(e);if(!a)throw new Error(`Invalid JSON-pointer: ${e}`);const s=+a[1];if(i=a[2],"#"===i){if(s>=t)throw new Error(c("property/index",s));return n[t-s]}if(s>t)throw new Error(c("data",s));if(o=r[t-s],!i)return o}let a=o;const s=i.split("/");for(const e of s)e&&(o=Qm._`${o}${(0,Qm.getProperty)((0,tg.unescapeJsonPointer)(e))}`,a=Qm._`${a} && ${o}`);return a;function c(e,r){return`Cannot access ${e} ${r} levels up, current level is ${t}`}}Dp.getData=wg;var Ag={};Object.defineProperty(Ag,"__esModule",{value:!0});class _g extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}}Ag.default=_g;var Eg={};Object.defineProperty(Eg,"__esModule",{value:!0});const Sg=km;class Pg extends Error{constructor(e,t,r,n){super(n||`can't resolve reference ${r} from id ${t}`),this.missingRef=(0,Sg.resolveUrl)(e,t,r),this.missingSchema=(0,Sg.normalizeId)((0,Sg.getFullPath)(e,this.missingRef))}}Eg.default=Pg;var xg={};Object.defineProperty(xg,"__esModule",{value:!0}),xg.resolveSchema=xg.getCompilingSchema=xg.resolveRef=xg.compileSchema=xg.SchemaEnv=void 0;const kg=Fp,Mg=Ag,Cg=qp,Ig=km,Rg=Lp,Ng=Dp;class Og{constructor(e){var t;let r;this.refs={},this.dynamicAnchors={},"object"==typeof e.schema&&(r=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=null!==(t=e.baseId)&&void 0!==t?t:(0,Ig.normalizeId)(null==r?void 0:r[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=null==r?void 0:r.$async,this.refs={}}}function Tg(e){const t=Dg.call(this,e);if(t)return t;const r=(0,Ig.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:n,lines:i}=this.opts.code,{ownProperties:o}=this.opts,a=new kg.CodeGen(this.scope,{es5:n,lines:i,ownProperties:o});let s;e.$async&&(s=a.scopeValue("Error",{ref:Mg.default,code:kg._`require("ajv/dist/runtime/validation_error").default`}));const c=a.scopeName("validate");e.validateName=c;const u={gen:a,allErrors:this.opts.allErrors,data:Cg.default.data,parentData:Cg.default.parentData,parentDataProperty:Cg.default.parentDataProperty,dataNames:[Cg.default.data],dataPathArr:[kg.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:a.scopeValue("schema",!0===this.opts.code.source?{ref:e.schema,code:(0,kg.stringify)(e.schema)}:{ref:e.schema}),validateName:c,ValidationError:s,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:kg.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:kg._`""`,opts:this.opts,self:this};let f;try{this._compilations.add(e),(0,Ng.validateFunctionCode)(u),a.optimize(this.opts.code.optimize);const t=a.toString();f=`${a.scopeRefs(Cg.default.scope)}return ${t}`,this.opts.code.process&&(f=this.opts.code.process(f,e));const r=new Function(`${Cg.default.self}`,`${Cg.default.scope}`,f)(this,this.scope.get());if(this.scope.value(c,{ref:r}),r.errors=null,r.schema=e.schema,r.schemaEnv=e,e.$async&&(r.$async=!0),!0===this.opts.code.source&&(r.source={validateName:c,validateCode:t,scopeValues:a._values}),this.opts.unevaluated){const{props:e,items:t}=u;r.evaluated={props:e instanceof kg.Name?void 0:e,items:t instanceof kg.Name?void 0:t,dynamicProps:e instanceof kg.Name,dynamicItems:t instanceof kg.Name},r.source&&(r.source.evaluated=(0,kg.stringify)(r.evaluated))}return e.validate=r,e}catch(t){throw delete e.validate,delete e.validateName,f&&this.logger.error("Error compiling schema, function code:",f),t}finally{this._compilations.delete(e)}}function jg(e){return(0,Ig.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:Tg.call(this,e)}function Dg(e){for(const n of this._compilations)if(r=e,(t=n).schema===r.schema&&t.root===r.root&&t.baseId===r.baseId)return n;var t,r}function $g(e,t){let r;for(;"string"==typeof(r=this.refs[t]);)t=r;return r||this.schemas[t]||Bg.call(this,e,t)}function Bg(e,t){const r=this.opts.uriResolver.parse(t),n=(0,Ig._getFullPath)(this.opts.uriResolver,r);let i=(0,Ig.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===i)return zg.call(this,r,e);const o=(0,Ig.normalizeId)(n),a=this.refs[o]||this.schemas[o];if("string"==typeof a){const t=Bg.call(this,e,a);if("object"!=typeof(null==t?void 0:t.schema))return;return zg.call(this,r,t)}if("object"==typeof(null==a?void 0:a.schema)){if(a.validate||Tg.call(this,a),o===(0,Ig.normalizeId)(t)){const{schema:t}=a,{schemaId:r}=this.opts,n=t[r];return n&&(i=(0,Ig.resolveUrl)(this.opts.uriResolver,i,n)),new Og({schema:t,schemaId:r,root:e,baseId:i})}return zg.call(this,r,a)}}xg.SchemaEnv=Og,xg.compileSchema=Tg,xg.resolveRef=function(e,t,r){var n;r=(0,Ig.resolveUrl)(this.opts.uriResolver,t,r);const i=e.refs[r];if(i)return i;let o=$g.call(this,e,r);if(void 0===o){const i=null===(n=e.localRefs)||void 0===n?void 0:n[r],{schemaId:a}=this.opts;i&&(o=new Og({schema:i,schemaId:a,root:e,baseId:t}))}return void 0!==o?e.refs[r]=jg.call(this,o):void 0},xg.getCompilingSchema=Dg,xg.resolveSchema=Bg;const Fg=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function zg(e,{baseId:t,schema:r,root:n}){var i;if("/"!==(null===(i=e.fragment)||void 0===i?void 0:i[0]))return;for(const n of e.fragment.slice(1).split("/")){if("boolean"==typeof r)return;const e=r[(0,Rg.unescapeFragment)(n)];if(void 0===e)return;const i="object"==typeof(r=e)&&r[this.opts.schemaId];!Fg.has(n)&&i&&(t=(0,Ig.resolveUrl)(this.opts.uriResolver,t,i))}let o;if("boolean"!=typeof r&&r.$ref&&!(0,Rg.schemaHasRulesButRef)(r,this.RULES)){const e=(0,Ig.resolveUrl)(this.opts.uriResolver,t,r.$ref);o=Bg.call(this,n,e)}const{schemaId:a}=this.opts;return o=o||new Og({schema:r,schemaId:a,root:n,baseId:t}),o.schema!==o.root.schema?o:void 0}var Ug={$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:!1},Lg={},qg={exports:{}}; + || ${s} === "boolean" || ${o} === null`).assign(u,i._`[${o}]`)}}n.else(),l(e),n.endIf(),n.if(i._`${u} !== undefined`,(()=>{n.assign(o,u),function({gen:e,parentData:t,parentDataProperty:r},n){e.if(i._`${t} !== undefined`,(()=>e.assign(i._`${t}[${r}]`,n)))}(e,u)}))}(e,t,u):l(e)}))}return d};const c=new Set(["string","number","integer","boolean","null"]);function u(e,t,r,n=a.Correct){const o=n===a.Correct?i.operators.EQ:i.operators.NEQ;let s;switch(e){case"null":return i._`${t} ${o} null`;case"array":s=i._`Array.isArray(${t})`;break;case"object":s=i._`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":s=c(i._`!(${t} % 1) && !isNaN(${t})`);break;case"number":s=c();break;default:return i._`typeof ${t} ${o} ${e}`}return n===a.Correct?s:(0,i.not)(s);function c(e=i.nil){return(0,i.and)(i._`typeof ${t} == "number"`,e,r?i._`isFinite(${t})`:i.nil)}}function f(e,t,r,n){if(1===e.length)return u(e[0],t,r,n);let a;const s=(0,o.toHash)(e);if(s.array&&s.object){const e=i._`typeof ${t} != "object"`;a=s.null?e:i._`!${t} || ${e}`,delete s.null,delete s.array,delete s.object}else a=i.nil;s.number&&delete s.integer;for(const e in s)a=(0,i.and)(a,u(e,t,r,n));return a}e.checkDataType=u,e.checkDataTypes=f;const d={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>"string"==typeof e?i._`{type: ${e}}`:i._`{type: ${t}}`};function l(e){const t=function(e){const{gen:t,data:r,schema:n}=e,i=(0,o.schemaRefOrVal)(e,n,"type");return{gen:t,keyword:"type",data:r,schema:n.type,schemaCode:i,schemaValue:i,parentSchema:n,params:{},it:e}}(e);(0,n.reportError)(t,d)}e.reportTypeError=l}(Yp);var om={};Object.defineProperty(om,"__esModule",{value:!0}),om.assignDefaults=void 0;const am=Up,sm=Hp;function cm(e,t,r){const{gen:n,compositeRule:i,data:o,opts:a}=e;if(void 0===r)return;const s=am._`${o}${(0,am.getProperty)(t)}`;if(i)return void(0,sm.checkStrictMode)(e,`default is ignored for: ${s}`);let c=am._`${s} === undefined`;"empty"===a.useDefaults&&(c=am._`${c} || ${s} === null || ${s} === ""`),n.if(c,am._`${s} = ${(0,am.stringify)(r)}`)}om.assignDefaults=function(e,t){const{properties:r,items:n}=e.schema;if("object"===t&&r)for(const t in r)cm(e,t,r[t].default);else"array"===t&&Array.isArray(n)&&n.forEach(((t,r)=>cm(e,r,t.default)))};var um={},fm={};Object.defineProperty(fm,"__esModule",{value:!0}),fm.validateUnion=fm.validateArray=fm.usePattern=fm.callValidateCode=fm.schemaProperties=fm.allSchemaProperties=fm.noPropertyInData=fm.propertyInData=fm.isOwnProperty=fm.hasPropFunc=fm.reportMissingProp=fm.checkMissingProp=fm.checkReportMissingProp=void 0;const dm=Up,lm=Hp,hm=Kp,pm=Hp;function mm(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:dm._`Object.prototype.hasOwnProperty`})}function gm(e,t,r){return dm._`${mm(e)}.call(${t}, ${r})`}function ym(e,t,r,n){const i=dm._`${t}${(0,dm.getProperty)(r)} === undefined`;return n?(0,dm.or)(i,(0,dm.not)(gm(e,t,r))):i}function bm(e){return e?Object.keys(e).filter((e=>"__proto__"!==e)):[]}fm.checkReportMissingProp=function(e,t){const{gen:r,data:n,it:i}=e;r.if(ym(r,n,t,i.opts.ownProperties),(()=>{e.setParams({missingProperty:dm._`${t}`},!0),e.error()}))},fm.checkMissingProp=function({gen:e,data:t,it:{opts:r}},n,i){return(0,dm.or)(...n.map((n=>(0,dm.and)(ym(e,t,n,r.ownProperties),dm._`${i} = ${n}`))))},fm.reportMissingProp=function(e,t){e.setParams({missingProperty:t},!0),e.error()},fm.hasPropFunc=mm,fm.isOwnProperty=gm,fm.propertyInData=function(e,t,r,n){const i=dm._`${t}${(0,dm.getProperty)(r)} !== undefined`;return n?dm._`${i} && ${gm(e,t,r)}`:i},fm.noPropertyInData=ym,fm.allSchemaProperties=bm,fm.schemaProperties=function(e,t){return bm(t).filter((r=>!(0,lm.alwaysValidSchema)(e,t[r])))},fm.callValidateCode=function({schemaCode:e,data:t,it:{gen:r,topSchemaRef:n,schemaPath:i,errorPath:o},it:a},s,c,u){const f=u?dm._`${e}, ${t}, ${n}${i}`:t,d=[[hm.default.instancePath,(0,dm.strConcat)(hm.default.instancePath,o)],[hm.default.parentData,a.parentData],[hm.default.parentDataProperty,a.parentDataProperty],[hm.default.rootData,hm.default.rootData]];a.opts.dynamicRef&&d.push([hm.default.dynamicAnchors,hm.default.dynamicAnchors]);const l=dm._`${f}, ${r.object(...d)}`;return c!==dm.nil?dm._`${s}.call(${c}, ${l})`:dm._`${s}(${l})`};const vm=dm._`new RegExp`;fm.usePattern=function({gen:e,it:{opts:t}},r){const n=t.unicodeRegExp?"u":"",{regExp:i}=t.code,o=i(r,n);return e.scopeValue("pattern",{key:o.toString(),ref:o,code:dm._`${"new RegExp"===i.code?vm:(0,pm.useFunc)(e,i)}(${r}, ${n})`})},fm.validateArray=function(e){const{gen:t,data:r,keyword:n,it:i}=e,o=t.name("valid");if(i.allErrors){const e=t.let("valid",!0);return a((()=>t.assign(e,!1))),e}return t.var(o,!0),a((()=>t.break())),o;function a(i){const a=t.const("len",dm._`${r}.length`);t.forRange("i",0,a,(r=>{e.subschema({keyword:n,dataProp:r,dataPropType:lm.Type.Num},o),t.if((0,dm.not)(o),i)}))}},fm.validateUnion=function(e){const{gen:t,schema:r,keyword:n,it:i}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some((e=>(0,lm.alwaysValidSchema)(i,e)))&&!i.opts.unevaluated)return;const o=t.let("valid",!1),a=t.name("_valid");t.block((()=>r.forEach(((r,i)=>{const s=e.subschema({keyword:n,schemaProp:i,compositeRule:!0},a);t.assign(o,dm._`${o} || ${a}`);e.mergeValidEvaluated(s,a)||t.if((0,dm.not)(o))})))),e.result(o,(()=>e.reset()),(()=>e.error(!0)))},Object.defineProperty(um,"__esModule",{value:!0}),um.validateKeywordUsage=um.validSchemaType=um.funcKeywordCode=um.macroKeywordCode=void 0;const wm=Up,Am=Kp,_m=fm,Em=zp;function Sm(e){const{gen:t,data:r,it:n}=e;t.if(n.parentData,(()=>t.assign(r,wm._`${n.parentData}[${n.parentDataProperty}]`)))}function Pm(e,t,r){if(void 0===r)throw new Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword","function"==typeof r?{ref:r}:{ref:r,code:(0,wm.stringify)(r)})}um.macroKeywordCode=function(e,t){const{gen:r,keyword:n,schema:i,parentSchema:o,it:a}=e,s=t.macro.call(a.self,i,o,a),c=Pm(r,n,s);!1!==a.opts.validateSchema&&a.self.validateSchema(s,!0);const u=r.name("valid");e.subschema({schema:s,schemaPath:wm.nil,errSchemaPath:`${a.errSchemaPath}/${n}`,topSchemaRef:c,compositeRule:!0},u),e.pass(u,(()=>e.error(!0)))},um.funcKeywordCode=function(e,t){var r;const{gen:n,keyword:i,schema:o,parentSchema:a,$data:s,it:c}=e;!function({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}(c,t);const u=!s&&t.compile?t.compile.call(c.self,o,a,c):t.validate,f=Pm(n,i,u),d=n.let("valid");function l(r=(t.async?wm._`await `:wm.nil)){const i=c.opts.passContext?Am.default.this:Am.default.self,o=!("compile"in t&&!s||!1===t.schema);n.assign(d,wm._`${r}${(0,_m.callValidateCode)(e,f,i,o)}`,t.modifying)}function h(e){var r;n.if((0,wm.not)(null!==(r=t.valid)&&void 0!==r?r:d),e)}e.block$data(d,(function(){if(!1===t.errors)l(),t.modifying&&Sm(e),h((()=>e.error()));else{const r=t.async?function(){const e=n.let("ruleErrs",null);return n.try((()=>l(wm._`await `)),(t=>n.assign(d,!1).if(wm._`${t} instanceof ${c.ValidationError}`,(()=>n.assign(e,wm._`${t}.errors`)),(()=>n.throw(t))))),e}():function(){const e=wm._`${f}.errors`;return n.assign(e,null),l(wm.nil),e}();t.modifying&&Sm(e),h((()=>function(e,t){const{gen:r}=e;r.if(wm._`Array.isArray(${t})`,(()=>{r.assign(Am.default.vErrors,wm._`${Am.default.vErrors} === null ? ${t} : ${Am.default.vErrors}.concat(${t})`).assign(Am.default.errors,wm._`${Am.default.vErrors}.length`),(0,Em.extendErrors)(e)}),(()=>e.error()))}(e,r)))}})),e.ok(null!==(r=t.valid)&&void 0!==r?r:d)},um.validSchemaType=function(e,t,r=!1){return!t.length||t.some((t=>"array"===t?Array.isArray(e):"object"===t?e&&"object"==typeof e&&!Array.isArray(e):typeof e==t||r&&void 0===e))},um.validateKeywordUsage=function({schema:e,opts:t,self:r,errSchemaPath:n},i,o){if(Array.isArray(i.keyword)?!i.keyword.includes(o):i.keyword!==o)throw new Error("ajv implementation error");const a=i.dependencies;if(null==a?void 0:a.some((t=>!Object.prototype.hasOwnProperty.call(e,t))))throw new Error(`parent schema must have dependencies of ${o}: ${a.join(",")}`);if(i.validateSchema){if(!i.validateSchema(e[o])){const e=`keyword "${o}" value is invalid at path "${n}": `+r.errorsText(i.validateSchema.errors);if("log"!==t.validateSchema)throw new Error(e);r.logger.error(e)}}};var xm={};Object.defineProperty(xm,"__esModule",{value:!0}),xm.extendSubschemaMode=xm.extendSubschemaData=xm.getSubschema=void 0;const km=Up,Mm=Hp;xm.getSubschema=function(e,{keyword:t,schemaProp:r,schema:n,schemaPath:i,errSchemaPath:o,topSchemaRef:a}){if(void 0!==t&&void 0!==n)throw new Error('both "keyword" and "schema" passed, only one allowed');if(void 0!==t){const n=e.schema[t];return void 0===r?{schema:n,schemaPath:km._`${e.schemaPath}${(0,km.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:n[r],schemaPath:km._`${e.schemaPath}${(0,km.getProperty)(t)}${(0,km.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,Mm.escapeFragment)(r)}`}}if(void 0!==n){if(void 0===i||void 0===o||void 0===a)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:i,topSchemaRef:a,errSchemaPath:o}}throw new Error('either "keyword" or "schema" must be passed')},xm.extendSubschemaData=function(e,t,{dataProp:r,dataPropType:n,data:i,dataTypes:o,propertyName:a}){if(void 0!==i&&void 0!==r)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:s}=t;if(void 0!==r){const{errorPath:i,dataPathArr:o,opts:a}=t;c(s.let("data",km._`${t.data}${(0,km.getProperty)(r)}`,!0)),e.errorPath=km.str`${i}${(0,Mm.getErrorPath)(r,n,a.jsPropertySyntax)}`,e.parentDataProperty=km._`${r}`,e.dataPathArr=[...o,e.parentDataProperty]}if(void 0!==i){c(i instanceof km.Name?i:s.let("data",i,!0)),void 0!==a&&(e.propertyName=a)}function c(r){e.data=r,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,r]}o&&(e.dataTypes=o)},xm.extendSubschemaMode=function(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:n,createErrors:i,allErrors:o}){void 0!==n&&(e.compositeRule=n),void 0!==i&&(e.createErrors=i),void 0!==o&&(e.allErrors=o),e.jtdDiscriminator=t,e.jtdMetadata=r};var Cm={},Im=function e(t,r){if(t===r)return!0;if(t&&r&&"object"==typeof t&&"object"==typeof r){if(t.constructor!==r.constructor)return!1;var n,i,o;if(Array.isArray(t)){if((n=t.length)!=r.length)return!1;for(i=n;0!=i--;)if(!e(t[i],r[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if((n=(o=Object.keys(t)).length)!==Object.keys(r).length)return!1;for(i=n;0!=i--;)if(!Object.prototype.hasOwnProperty.call(r,o[i]))return!1;for(i=n;0!=i--;){var a=o[i];if(!e(t[a],r[a]))return!1}return!0}return t!=t&&r!=r},Rm={exports:{}},Nm=Rm.exports=function(e,t,r){"function"==typeof t&&(r=t,t={}),Om(t,"function"==typeof(r=t.cb||r)?r:r.pre||function(){},r.post||function(){},e,"",e)};function Om(e,t,r,n,i,o,a,s,c,u){if(n&&"object"==typeof n&&!Array.isArray(n)){for(var f in t(n,i,o,a,s,c,u),n){var d=n[f];if(Array.isArray(d)){if(f in Nm.arrayKeywords)for(var l=0;lt+=Um(e))),t===1/0))return 1/0}return t}function Lm(e,t="",r){!1!==r&&(t=Km(t));const n=e.parse(t);return qm(e,n)}function qm(e,t){return e.serialize(t).split("#")[0]+"#"}Cm.getFullPath=Lm,Cm._getFullPath=qm;const Hm=/#\/?$/;function Km(e){return e?e.replace(Hm,""):""}Cm.normalizeId=Km,Cm.resolveUrl=function(e,t,r){return r=Km(r),e.resolve(t,r)};const Jm=/^[a-z_][-a-z0-9._]*$/i;Cm.getSchemaRefs=function(e,t){if("boolean"==typeof e)return{};const{schemaId:r,uriResolver:n}=this.opts,i=Km(e[r]||t),o={"":i},a=Lm(n,i,!1),s={},c=new Set;return $m(e,{allKeys:!0},((e,t,n,i)=>{if(void 0===i)return;const d=a+t;let l=o[i];function h(t){const r=this.opts.uriResolver.resolve;if(t=Km(l?r(l,t):t),c.has(t))throw f(t);c.add(t);let n=this.refs[t];return"string"==typeof n&&(n=this.refs[n]),"object"==typeof n?u(e,n.schema,t):t!==Km(d)&&("#"===t[0]?(u(e,s[t],t),s[t]=e):this.refs[t]=d),t}function p(e){if("string"==typeof e){if(!Jm.test(e))throw new Error(`invalid anchor "${e}"`);h.call(this,`#${e}`)}}"string"==typeof e[r]&&(l=h.call(this,e[r])),p.call(this,e.$anchor),p.call(this,e.$dynamicAnchor),o[t]=l})),s;function u(e,t,r){if(void 0!==t&&!Dm(e,t))throw f(r)}function f(e){return new Error(`reference "${e}" resolves to more than one schema`)}},Object.defineProperty(Bp,"__esModule",{value:!0}),Bp.getData=Bp.KeywordCxt=Bp.validateFunctionCode=void 0;const Wm=Fp,Gm=Yp,Vm=rm,Zm=Yp,Xm=om,Qm=um,Ym=xm,eg=Up,tg=Kp,rg=Cm,ng=Hp,ig=zp;function og({gen:e,validateName:t,schema:r,schemaEnv:n,opts:i},o){i.code.es5?e.func(t,eg._`${tg.default.data}, ${tg.default.valCxt}`,n.$async,(()=>{e.code(eg._`"use strict"; ${ag(r,i)}`),function(e,t){e.if(tg.default.valCxt,(()=>{e.var(tg.default.instancePath,eg._`${tg.default.valCxt}.${tg.default.instancePath}`),e.var(tg.default.parentData,eg._`${tg.default.valCxt}.${tg.default.parentData}`),e.var(tg.default.parentDataProperty,eg._`${tg.default.valCxt}.${tg.default.parentDataProperty}`),e.var(tg.default.rootData,eg._`${tg.default.valCxt}.${tg.default.rootData}`),t.dynamicRef&&e.var(tg.default.dynamicAnchors,eg._`${tg.default.valCxt}.${tg.default.dynamicAnchors}`)}),(()=>{e.var(tg.default.instancePath,eg._`""`),e.var(tg.default.parentData,eg._`undefined`),e.var(tg.default.parentDataProperty,eg._`undefined`),e.var(tg.default.rootData,tg.default.data),t.dynamicRef&&e.var(tg.default.dynamicAnchors,eg._`{}`)}))}(e,i),e.code(o)})):e.func(t,eg._`${tg.default.data}, ${function(e){return eg._`{${tg.default.instancePath}="", ${tg.default.parentData}, ${tg.default.parentDataProperty}, ${tg.default.rootData}=${tg.default.data}${e.dynamicRef?eg._`, ${tg.default.dynamicAnchors}={}`:eg.nil}}={}`}(i)}`,n.$async,(()=>e.code(ag(r,i)).code(o)))}function ag(e,t){const r="object"==typeof e&&e[t.schemaId];return r&&(t.code.source||t.code.process)?eg._`/*# sourceURL=${r} */`:eg.nil}function sg(e,t){ug(e)&&(fg(e),cg(e))?function(e,t){const{schema:r,gen:n,opts:i}=e;i.$comment&&r.$comment&&lg(e);(function(e){const t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,rg.resolveUrl)(e.opts.uriResolver,e.baseId,t))})(e),function(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}(e);const o=n.const("_errs",tg.default.errors);dg(e,o),n.var(t,eg._`${o} === ${tg.default.errors}`)}(e,t):(0,Wm.boolOrEmptySchema)(e,t)}function cg({schema:e,self:t}){if("boolean"==typeof e)return!e;for(const r in e)if(t.RULES.all[r])return!0;return!1}function ug(e){return"boolean"!=typeof e.schema}function fg(e){(0,ng.checkUnknownRules)(e),function(e){const{schema:t,errSchemaPath:r,opts:n,self:i}=e;t.$ref&&n.ignoreKeywordsWithRef&&(0,ng.schemaHasRulesButRef)(t,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}(e)}function dg(e,t){if(e.opts.jtd)return hg(e,[],!1,t);const r=(0,Gm.getSchemaTypes)(e.schema);hg(e,r,!(0,Gm.coerceAndCheckDataType)(e,r),t)}function lg({gen:e,schemaEnv:t,schema:r,errSchemaPath:n,opts:i}){const o=r.$comment;if(!0===i.$comment)e.code(eg._`${tg.default.self}.logger.log(${o})`);else if("function"==typeof i.$comment){const r=eg.str`${n}/$comment`,i=e.scopeValue("root",{ref:t.root});e.code(eg._`${tg.default.self}.opts.$comment(${o}, ${r}, ${i}.schema)`)}}function hg(e,t,r,n){const{gen:i,schema:o,data:a,allErrors:s,opts:c,self:u}=e,{RULES:f}=u;function d(u){(0,Vm.shouldUseGroup)(o,u)&&(u.type?(i.if((0,Zm.checkDataType)(u.type,a,c.strictNumbers)),pg(e,u),1===t.length&&t[0]===u.type&&r&&(i.else(),(0,Zm.reportTypeError)(e)),i.endIf()):pg(e,u),s||i.if(eg._`${tg.default.errors} === ${n||0}`))}!o.$ref||!c.ignoreKeywordsWithRef&&(0,ng.schemaHasRulesButRef)(o,f)?(c.jtd||function(e,t){if(e.schemaEnv.meta||!e.opts.strictTypes)return;(function(e,t){if(!t.length)return;if(!e.dataTypes.length)return void(e.dataTypes=t);t.forEach((t=>{gg(e.dataTypes,t)||yg(e,`type "${t}" not allowed by context "${e.dataTypes.join(",")}"`)})),function(e,t){const r=[];for(const n of e.dataTypes)gg(t,n)?r.push(n):t.includes("integer")&&"number"===n&&r.push("integer");e.dataTypes=r}(e,t)})(e,t),e.opts.allowUnionTypes||function(e,t){t.length>1&&(2!==t.length||!t.includes("null"))&&yg(e,"use allowUnionTypes to allow union type keyword")}(e,t);!function(e,t){const r=e.self.RULES.all;for(const n in r){const i=r[n];if("object"==typeof i&&(0,Vm.shouldUseRule)(e.schema,i)){const{type:r}=i.definition;r.length&&!r.some((e=>mg(t,e)))&&yg(e,`missing type "${r.join(",")}" for keyword "${n}"`)}}}(e,e.dataTypes)}(e,t),i.block((()=>{for(const e of f.rules)d(e);d(f.post)}))):i.block((()=>vg(e,"$ref",f.all.$ref.definition)))}function pg(e,t){const{gen:r,schema:n,opts:{useDefaults:i}}=e;i&&(0,Xm.assignDefaults)(e,t.type),r.block((()=>{for(const r of t.rules)(0,Vm.shouldUseRule)(n,r)&&vg(e,r.keyword,r.definition,t.type)}))}function mg(e,t){return e.includes(t)||"number"===t&&e.includes("integer")}function gg(e,t){return e.includes(t)||"integer"===t&&e.includes("number")}function yg(e,t){t+=` at "${e.schemaEnv.baseId+e.errSchemaPath}" (strictTypes)`,(0,ng.checkStrictMode)(e,t,e.opts.strictTypes)}Bp.validateFunctionCode=function(e){ug(e)&&(fg(e),cg(e))?function(e){const{schema:t,opts:r,gen:n}=e;og(e,(()=>{r.$comment&&t.$comment&&lg(e),function(e){const{schema:t,opts:r}=e;void 0!==t.default&&r.useDefaults&&r.strictSchema&&(0,ng.checkStrictMode)(e,"default is ignored in the schema root")}(e),n.let(tg.default.vErrors,null),n.let(tg.default.errors,0),r.unevaluated&&function(e){const{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",eg._`${r}.evaluated`),t.if(eg._`${e.evaluated}.dynamicProps`,(()=>t.assign(eg._`${e.evaluated}.props`,eg._`undefined`))),t.if(eg._`${e.evaluated}.dynamicItems`,(()=>t.assign(eg._`${e.evaluated}.items`,eg._`undefined`)))}(e),dg(e),function(e){const{gen:t,schemaEnv:r,validateName:n,ValidationError:i,opts:o}=e;r.$async?t.if(eg._`${tg.default.errors} === 0`,(()=>t.return(tg.default.data)),(()=>t.throw(eg._`new ${i}(${tg.default.vErrors})`))):(t.assign(eg._`${n}.errors`,tg.default.vErrors),o.unevaluated&&function({gen:e,evaluated:t,props:r,items:n}){r instanceof eg.Name&&e.assign(eg._`${t}.props`,r);n instanceof eg.Name&&e.assign(eg._`${t}.items`,n)}(e),t.return(eg._`${tg.default.errors} === 0`))}(e)}))}(e):og(e,(()=>(0,Wm.topBoolOrEmptySchema)(e)))};class bg{constructor(e,t,r){if((0,Qm.validateKeywordUsage)(e,t,r),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=r,this.data=e.data,this.schema=e.schema[r],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,ng.schemaRefOrVal)(e,this.schema,r,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const("vSchema",_g(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,Qm.validSchemaType)(this.schema,t.schemaType,t.allowUndefined))throw new Error(`${r} value must be ${JSON.stringify(t.schemaType)}`);("code"in t?t.trackErrors:!1!==t.errors)&&(this.errsCount=e.gen.const("_errs",tg.default.errors))}result(e,t,r){this.failResult((0,eg.not)(e),t,r)}failResult(e,t,r){this.gen.if(e),r?r():this.error(),t?(this.gen.else(),t(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,t){this.failResult((0,eg.not)(e),void 0,t)}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:t}=this;this.fail(eg._`${t} !== undefined && (${(0,eg.or)(this.invalid$data(),e)})`)}error(e,t,r){if(t)return this.setParams(t),this._error(e,r),void this.setParams({});this._error(e,r)}_error(e,t){(e?ig.reportExtraError:ig.reportError)(this,this.def.error,t)}$dataError(){(0,ig.reportError)(this,this.def.$dataError||ig.keyword$DataError)}reset(){if(void 0===this.errsCount)throw new Error('add "trackErrors" to keyword definition');(0,ig.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,t){t?Object.assign(this.params,e):this.params=e}block$data(e,t,r=eg.nil){this.gen.block((()=>{this.check$data(e,r),t()}))}check$data(e=eg.nil,t=eg.nil){if(!this.$data)return;const{gen:r,schemaCode:n,schemaType:i,def:o}=this;r.if((0,eg.or)(eg._`${n} === undefined`,t)),e!==eg.nil&&r.assign(e,!0),(i.length||o.validateSchema)&&(r.elseIf(this.invalid$data()),this.$dataError(),e!==eg.nil&&r.assign(e,!1)),r.else()}invalid$data(){const{gen:e,schemaCode:t,schemaType:r,def:n,it:i}=this;return(0,eg.or)(function(){if(r.length){if(!(t instanceof eg.Name))throw new Error("ajv implementation error");const e=Array.isArray(r)?r:[r];return eg._`${(0,Zm.checkDataTypes)(e,t,i.opts.strictNumbers,Zm.DataType.Wrong)}`}return eg.nil}(),function(){if(n.validateSchema){const r=e.scopeValue("validate$data",{ref:n.validateSchema});return eg._`!${r}(${t})`}return eg.nil}())}subschema(e,t){const r=(0,Ym.getSubschema)(this.it,e);(0,Ym.extendSubschemaData)(r,this.it,e),(0,Ym.extendSubschemaMode)(r,e);const n={...this.it,...r,items:void 0,props:void 0};return sg(n,t),n}mergeEvaluated(e,t){const{it:r,gen:n}=this;r.opts.unevaluated&&(!0!==r.props&&void 0!==e.props&&(r.props=ng.mergeEvaluated.props(n,e.props,r.props,t)),!0!==r.items&&void 0!==e.items&&(r.items=ng.mergeEvaluated.items(n,e.items,r.items,t)))}mergeValidEvaluated(e,t){const{it:r,gen:n}=this;if(r.opts.unevaluated&&(!0!==r.props||!0!==r.items))return n.if(t,(()=>this.mergeEvaluated(e,eg.Name))),!0}}function vg(e,t,r,n){const i=new bg(e,r,t);"code"in r?r.code(i,n):i.$data&&r.validate?(0,Qm.funcKeywordCode)(i,r):"macro"in r?(0,Qm.macroKeywordCode)(i,r):(r.compile||r.validate)&&(0,Qm.funcKeywordCode)(i,r)}Bp.KeywordCxt=bg;const wg=/^\/(?:[^~]|~0|~1)*$/,Ag=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function _g(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let i,o;if(""===e)return tg.default.rootData;if("/"===e[0]){if(!wg.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);i=e,o=tg.default.rootData}else{const a=Ag.exec(e);if(!a)throw new Error(`Invalid JSON-pointer: ${e}`);const s=+a[1];if(i=a[2],"#"===i){if(s>=t)throw new Error(c("property/index",s));return n[t-s]}if(s>t)throw new Error(c("data",s));if(o=r[t-s],!i)return o}let a=o;const s=i.split("/");for(const e of s)e&&(o=eg._`${o}${(0,eg.getProperty)((0,ng.unescapeJsonPointer)(e))}`,a=eg._`${a} && ${o}`);return a;function c(e,r){return`Cannot access ${e} ${r} levels up, current level is ${t}`}}Bp.getData=_g;var Eg={};Object.defineProperty(Eg,"__esModule",{value:!0});class Sg extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}}Eg.default=Sg;var Pg={};Object.defineProperty(Pg,"__esModule",{value:!0});const xg=Cm;class kg extends Error{constructor(e,t,r,n){super(n||`can't resolve reference ${r} from id ${t}`),this.missingRef=(0,xg.resolveUrl)(e,t,r),this.missingSchema=(0,xg.normalizeId)((0,xg.getFullPath)(e,this.missingRef))}}Pg.default=kg;var Mg={};Object.defineProperty(Mg,"__esModule",{value:!0}),Mg.resolveSchema=Mg.getCompilingSchema=Mg.resolveRef=Mg.compileSchema=Mg.SchemaEnv=void 0;const Cg=Up,Ig=Eg,Rg=Kp,Ng=Cm,Og=Hp,Tg=Bp;class jg{constructor(e){var t;let r;this.refs={},this.dynamicAnchors={},"object"==typeof e.schema&&(r=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=null!==(t=e.baseId)&&void 0!==t?t:(0,Ng.normalizeId)(null==r?void 0:r[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=null==r?void 0:r.$async,this.refs={}}}function Dg(e){const t=Bg.call(this,e);if(t)return t;const r=(0,Ng.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:n,lines:i}=this.opts.code,{ownProperties:o}=this.opts,a=new Cg.CodeGen(this.scope,{es5:n,lines:i,ownProperties:o});let s;e.$async&&(s=a.scopeValue("Error",{ref:Ig.default,code:Cg._`require("ajv/dist/runtime/validation_error").default`}));const c=a.scopeName("validate");e.validateName=c;const u={gen:a,allErrors:this.opts.allErrors,data:Rg.default.data,parentData:Rg.default.parentData,parentDataProperty:Rg.default.parentDataProperty,dataNames:[Rg.default.data],dataPathArr:[Cg.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:a.scopeValue("schema",!0===this.opts.code.source?{ref:e.schema,code:(0,Cg.stringify)(e.schema)}:{ref:e.schema}),validateName:c,ValidationError:s,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:Cg.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:Cg._`""`,opts:this.opts,self:this};let f;try{this._compilations.add(e),(0,Tg.validateFunctionCode)(u),a.optimize(this.opts.code.optimize);const t=a.toString();f=`${a.scopeRefs(Rg.default.scope)}return ${t}`,this.opts.code.process&&(f=this.opts.code.process(f,e));const r=new Function(`${Rg.default.self}`,`${Rg.default.scope}`,f)(this,this.scope.get());if(this.scope.value(c,{ref:r}),r.errors=null,r.schema=e.schema,r.schemaEnv=e,e.$async&&(r.$async=!0),!0===this.opts.code.source&&(r.source={validateName:c,validateCode:t,scopeValues:a._values}),this.opts.unevaluated){const{props:e,items:t}=u;r.evaluated={props:e instanceof Cg.Name?void 0:e,items:t instanceof Cg.Name?void 0:t,dynamicProps:e instanceof Cg.Name,dynamicItems:t instanceof Cg.Name},r.source&&(r.source.evaluated=(0,Cg.stringify)(r.evaluated))}return e.validate=r,e}catch(t){throw delete e.validate,delete e.validateName,f&&this.logger.error("Error compiling schema, function code:",f),t}finally{this._compilations.delete(e)}}function $g(e){return(0,Ng.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:Dg.call(this,e)}function Bg(e){for(const n of this._compilations)if(r=e,(t=n).schema===r.schema&&t.root===r.root&&t.baseId===r.baseId)return n;var t,r}function Fg(e,t){let r;for(;"string"==typeof(r=this.refs[t]);)t=r;return r||this.schemas[t]||zg.call(this,e,t)}function zg(e,t){const r=this.opts.uriResolver.parse(t),n=(0,Ng._getFullPath)(this.opts.uriResolver,r);let i=(0,Ng.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===i)return Lg.call(this,r,e);const o=(0,Ng.normalizeId)(n),a=this.refs[o]||this.schemas[o];if("string"==typeof a){const t=zg.call(this,e,a);if("object"!=typeof(null==t?void 0:t.schema))return;return Lg.call(this,r,t)}if("object"==typeof(null==a?void 0:a.schema)){if(a.validate||Dg.call(this,a),o===(0,Ng.normalizeId)(t)){const{schema:t}=a,{schemaId:r}=this.opts,n=t[r];return n&&(i=(0,Ng.resolveUrl)(this.opts.uriResolver,i,n)),new jg({schema:t,schemaId:r,root:e,baseId:i})}return Lg.call(this,r,a)}}Mg.SchemaEnv=jg,Mg.compileSchema=Dg,Mg.resolveRef=function(e,t,r){var n;r=(0,Ng.resolveUrl)(this.opts.uriResolver,t,r);const i=e.refs[r];if(i)return i;let o=Fg.call(this,e,r);if(void 0===o){const i=null===(n=e.localRefs)||void 0===n?void 0:n[r],{schemaId:a}=this.opts;i&&(o=new jg({schema:i,schemaId:a,root:e,baseId:t}))}return void 0!==o?e.refs[r]=$g.call(this,o):void 0},Mg.getCompilingSchema=Bg,Mg.resolveSchema=zg;const Ug=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Lg(e,{baseId:t,schema:r,root:n}){var i;if("/"!==(null===(i=e.fragment)||void 0===i?void 0:i[0]))return;for(const n of e.fragment.slice(1).split("/")){if("boolean"==typeof r)return;const e=r[(0,Og.unescapeFragment)(n)];if(void 0===e)return;const i="object"==typeof(r=e)&&r[this.opts.schemaId];!Ug.has(n)&&i&&(t=(0,Ng.resolveUrl)(this.opts.uriResolver,t,i))}let o;if("boolean"!=typeof r&&r.$ref&&!(0,Og.schemaHasRulesButRef)(r,this.RULES)){const e=(0,Ng.resolveUrl)(this.opts.uriResolver,t,r.$ref);o=zg.call(this,n,e)}const{schemaId:a}=this.opts;return o=o||new jg({schema:r,schemaId:a,root:n,baseId:t}),o.schema!==o.root.schema?o:void 0}var qg={$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:!1},Hg={},Kg={exports:{}}; /** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */ -!function(e,t){!function(e){function t(){for(var e=arguments.length,t=Array(e),r=0;r1){t[0]=t[0].slice(0,-1);for(var n=t.length-1,i=1;i= 0x80 (not a basic code point)","invalid-input":"Invalid input"},P=h-p,x=Math.floor,k=String.fromCharCode;function M(e){throw new RangeError(S[e])}function C(e,t){for(var r=[],n=e.length;n--;)r[n]=t(e[n]);return r}function I(e,t){var r=e.split("@"),n="";return r.length>1&&(n=r[0]+"@",e=r[1]),n+C((e=e.replace(E,".")).split("."),t).join(".")}function R(e){for(var t=[],r=0,n=e.length;r=55296&&i<=56319&&r>1,e+=x(e/t);e>P*m>>1;n+=h)e=x(e/P);return x(n+(P+1)*e/(e+g))},j=function(e){var t=[],r=e.length,n=0,i=v,o=b,a=e.lastIndexOf(w);a<0&&(a=0);for(var s=0;s=128&&M("not-basic"),t.push(e.charCodeAt(s));for(var c=a>0?a+1:0;c=r&&M("invalid-input");var g=N(e.charCodeAt(c++));(g>=h||g>x((l-n)/f))&&M("overflow"),n+=g*f;var y=d<=o?p:d>=o+m?m:d-o;if(gx(l/A)&&M("overflow"),f*=A}var _=t.length+1;o=T(n-u,_,0==u),x(n/_)>l-i&&M("overflow"),i+=x(n/_),n%=_,t.splice(n++,0,i)}return String.fromCodePoint.apply(String,t)},D=function(e){var t=[],r=(e=R(e)).length,n=v,i=0,o=b,a=!0,s=!1,c=void 0;try{for(var u,f=e[Symbol.iterator]();!(a=(u=f.next()).done);a=!0){var d=u.value;d<128&&t.push(k(d))}}catch(e){s=!0,c=e}finally{try{!a&&f.return&&f.return()}finally{if(s)throw c}}var g=t.length,y=g;for(g&&t.push(w);y=n&&Ix((l-i)/N)&&M("overflow"),i+=(A-n)*N,n=A;var j=!0,D=!1,$=void 0;try{for(var B,F=e[Symbol.iterator]();!(j=(B=F.next()).done);j=!0){var z=B.value;if(zl&&M("overflow"),z==n){for(var U=i,L=h;;L+=h){var q=L<=o?p:L>=o+m?m:L-o;if(U>6|192).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase():"%"+(t>>12|224).toString(16).toUpperCase()+"%"+(t>>6&63|128).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase()}function L(e){for(var t="",r=0,n=e.length;r=194&&i<224){if(n-r>=6){var o=parseInt(e.substr(r+4,2),16);t+=String.fromCharCode((31&i)<<6|63&o)}else t+=e.substr(r,6);r+=6}else if(i>=224){if(n-r>=9){var a=parseInt(e.substr(r+4,2),16),s=parseInt(e.substr(r+7,2),16);t+=String.fromCharCode((15&i)<<12|(63&a)<<6|63&s)}else t+=e.substr(r,9);r+=9}else t+=e.substr(r,3),r+=3}return t}function q(e,t){function r(e){var r=L(e);return r.match(t.UNRESERVED)?r:e}return e.scheme&&(e.scheme=String(e.scheme).replace(t.PCT_ENCODED,r).toLowerCase().replace(t.NOT_SCHEME,"")),void 0!==e.userinfo&&(e.userinfo=String(e.userinfo).replace(t.PCT_ENCODED,r).replace(t.NOT_USERINFO,U).replace(t.PCT_ENCODED,i)),void 0!==e.host&&(e.host=String(e.host).replace(t.PCT_ENCODED,r).toLowerCase().replace(t.NOT_HOST,U).replace(t.PCT_ENCODED,i)),void 0!==e.path&&(e.path=String(e.path).replace(t.PCT_ENCODED,r).replace(e.scheme?t.NOT_PATH:t.NOT_PATH_NOSCHEME,U).replace(t.PCT_ENCODED,i)),void 0!==e.query&&(e.query=String(e.query).replace(t.PCT_ENCODED,r).replace(t.NOT_QUERY,U).replace(t.PCT_ENCODED,i)),void 0!==e.fragment&&(e.fragment=String(e.fragment).replace(t.PCT_ENCODED,r).replace(t.NOT_FRAGMENT,U).replace(t.PCT_ENCODED,i)),e}function H(e){return e.replace(/^0*(.*)/,"$1")||"0"}function K(e,t){var r=e.match(t.IPV4ADDRESS)||[],n=f(r,2)[1];return n?n.split(".").map(H).join("."):e}function J(e,t){var r=e.match(t.IPV6ADDRESS)||[],n=f(r,3),i=n[1],o=n[2];if(i){for(var a=i.toLowerCase().split("::").reverse(),s=f(a,2),c=s[0],u=s[1],d=u?u.split(":").map(H):[],l=c.split(":").map(H),h=t.IPV4ADDRESS.test(l[l.length-1]),p=h?7:8,m=l.length-p,g=Array(p),y=0;y1){var A=g.slice(0,v.index),_=g.slice(v.index+v.length);w=A.join(":")+"::"+_.join(":")}else w=g.join(":");return o&&(w+="%"+o),w}return e}var W=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,G=void 0==="".match(/(){0}/)[1];function V(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={},n=!1!==t.iri?u:c;"suffix"===t.reference&&(e=(t.scheme?t.scheme+":":"")+"//"+e);var i=e.match(W);if(i){G?(r.scheme=i[1],r.userinfo=i[3],r.host=i[4],r.port=parseInt(i[5],10),r.path=i[6]||"",r.query=i[7],r.fragment=i[8],isNaN(r.port)&&(r.port=i[5])):(r.scheme=i[1]||void 0,r.userinfo=-1!==e.indexOf("@")?i[3]:void 0,r.host=-1!==e.indexOf("//")?i[4]:void 0,r.port=parseInt(i[5],10),r.path=i[6]||"",r.query=-1!==e.indexOf("?")?i[7]:void 0,r.fragment=-1!==e.indexOf("#")?i[8]:void 0,isNaN(r.port)&&(r.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?i[4]:void 0)),r.host&&(r.host=J(K(r.host,n),n)),void 0!==r.scheme||void 0!==r.userinfo||void 0!==r.host||void 0!==r.port||r.path||void 0!==r.query?void 0===r.scheme?r.reference="relative":void 0===r.fragment?r.reference="absolute":r.reference="uri":r.reference="same-document",t.reference&&"suffix"!==t.reference&&t.reference!==r.reference&&(r.error=r.error||"URI is not a "+t.reference+" reference.");var o=z[(t.scheme||r.scheme||"").toLowerCase()];if(t.unicodeSupport||o&&o.unicodeSupport)q(r,n);else{if(r.host&&(t.domainHost||o&&o.domainHost))try{r.host=F.toASCII(r.host.replace(n.PCT_ENCODED,L).toLowerCase())}catch(e){r.error=r.error||"Host's domain name can not be converted to ASCII via punycode: "+e}q(r,c)}o&&o.parse&&o.parse(r,t)}else r.error=r.error||"URI can not be parsed.";return r}function Z(e,t){var r=!1!==t.iri?u:c,n=[];return void 0!==e.userinfo&&(n.push(e.userinfo),n.push("@")),void 0!==e.host&&n.push(J(K(String(e.host),r),r).replace(r.IPV6ADDRESS,(function(e,t,r){return"["+t+(r?"%25"+r:"")+"]"}))),"number"!=typeof e.port&&"string"!=typeof e.port||(n.push(":"),n.push(String(e.port))),n.length?n.join(""):void 0}var X=/^\.\.?\//,Q=/^\/\.(\/|$)/,Y=/^\/\.\.(\/|$)/,ee=/^\/?(?:.|\n)*?(?=\/|$)/;function te(e){for(var t=[];e.length;)if(e.match(X))e=e.replace(X,"");else if(e.match(Q))e=e.replace(Q,"/");else if(e.match(Y))e=e.replace(Y,"/"),t.pop();else if("."===e||".."===e)e="";else{var r=e.match(ee);if(!r)throw new Error("Unexpected dot segment condition");var n=r[0];e=e.slice(n.length),t.push(n)}return t.join("")}function re(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.iri?u:c,n=[],i=z[(t.scheme||e.scheme||"").toLowerCase()];if(i&&i.serialize&&i.serialize(e,t),e.host)if(r.IPV6ADDRESS.test(e.host));else if(t.domainHost||i&&i.domainHost)try{e.host=t.iri?F.toUnicode(e.host):F.toASCII(e.host.replace(r.PCT_ENCODED,L).toLowerCase())}catch(r){e.error=e.error||"Host's domain name can not be converted to "+(t.iri?"Unicode":"ASCII")+" via punycode: "+r}q(e,r),"suffix"!==t.reference&&e.scheme&&(n.push(e.scheme),n.push(":"));var o=Z(e,t);if(void 0!==o&&("suffix"!==t.reference&&n.push("//"),n.push(o),e.path&&"/"!==e.path.charAt(0)&&n.push("/")),void 0!==e.path){var a=e.path;t.absolutePath||i&&i.absolutePath||(a=te(a)),void 0===o&&(a=a.replace(/^\/\//,"/%2F")),n.push(a)}return void 0!==e.query&&(n.push("?"),n.push(e.query)),void 0!==e.fragment&&(n.push("#"),n.push(e.fragment)),n.join("")}function ne(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n={};return arguments[3]||(e=V(re(e,r),r),t=V(re(t,r),r)),!(r=r||{}).tolerant&&t.scheme?(n.scheme=t.scheme,n.userinfo=t.userinfo,n.host=t.host,n.port=t.port,n.path=te(t.path||""),n.query=t.query):(void 0!==t.userinfo||void 0!==t.host||void 0!==t.port?(n.userinfo=t.userinfo,n.host=t.host,n.port=t.port,n.path=te(t.path||""),n.query=t.query):(t.path?("/"===t.path.charAt(0)?n.path=te(t.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?n.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:n.path=t.path:n.path="/"+t.path,n.path=te(n.path)),n.query=t.query):(n.path=e.path,void 0!==t.query?n.query=t.query:n.query=e.query),n.userinfo=e.userinfo,n.host=e.host,n.port=e.port),n.scheme=e.scheme),n.fragment=t.fragment,n}function ie(e,t,r){var n=a({scheme:"null"},r);return re(ne(V(e,n),V(t,n),n,!0),n)}function oe(e,t){return"string"==typeof e?e=re(V(e,t),t):"object"===n(e)&&(e=V(re(e,t),t)),e}function ae(e,t,r){return"string"==typeof e?e=re(V(e,r),r):"object"===n(e)&&(e=re(e,r)),"string"==typeof t?t=re(V(t,r),r):"object"===n(t)&&(t=re(t,r)),e===t}function se(e,t){return e&&e.toString().replace(t&&t.iri?u.ESCAPE:c.ESCAPE,U)}function ce(e,t){return e&&e.toString().replace(t&&t.iri?u.PCT_ENCODED:c.PCT_ENCODED,L)}var ue={scheme:"http",domainHost:!0,parse:function(e,t){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e},serialize:function(e,t){var r="https"===String(e.scheme).toLowerCase();return e.port!==(r?443:80)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}},fe={scheme:"https",domainHost:ue.domainHost,parse:ue.parse,serialize:ue.serialize};function de(e){return"boolean"==typeof e.secure?e.secure:"wss"===String(e.scheme).toLowerCase()}var le={scheme:"ws",domainHost:!0,parse:function(e,t){var r=e;return r.secure=de(r),r.resourceName=(r.path||"/")+(r.query?"?"+r.query:""),r.path=void 0,r.query=void 0,r},serialize:function(e,t){if(e.port!==(de(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){var r=e.resourceName.split("?"),n=f(r,2),i=n[0],o=n[1];e.path=i&&"/"!==i?i:void 0,e.query=o,e.resourceName=void 0}return e.fragment=void 0,e}},he={scheme:"wss",domainHost:le.domainHost,parse:le.parse,serialize:le.serialize},pe={},me="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",ge="[0-9A-Fa-f]",ye=r(r("%[EFef]"+ge+"%"+ge+ge+"%"+ge+ge)+"|"+r("%[89A-Fa-f]"+ge+"%"+ge+ge)+"|"+r("%"+ge+ge)),be="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",ve=t("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),we="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",Ae=new RegExp(me,"g"),_e=new RegExp(ye,"g"),Ee=new RegExp(t("[^]",be,"[\\.]",'[\\"]',ve),"g"),Se=new RegExp(t("[^]",me,we),"g"),Pe=Se;function xe(e){var t=L(e);return t.match(Ae)?t:e}var ke={scheme:"mailto",parse:function(e,t){var r=e,n=r.to=r.path?r.path.split(","):[];if(r.path=void 0,r.query){for(var i=!1,o={},a=r.query.split("&"),s=0,c=a.length;snew RegExp(e,t);h.code="new RegExp";const p=["removeAdditional","useDefaults","coerceTypes"],m=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),g={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 b(e){var t,r,n,i,o,a,s,c,u,f,d,p,m,g,y,b,v,w,A,_,E,S,P,x,k;const M=e.strict,C=null===(t=e.code)||void 0===t?void 0:t.optimize,I=!0===C||void 0===C?1:C||0,R=null!==(n=null===(r=e.code)||void 0===r?void 0:r.regExp)&&void 0!==n?n:h,N=null!==(i=e.uriResolver)&&void 0!==i?i:l.default;return{strictSchema:null===(a=null!==(o=e.strictSchema)&&void 0!==o?o:M)||void 0===a||a,strictNumbers:null===(c=null!==(s=e.strictNumbers)&&void 0!==s?s:M)||void 0===c||c,strictTypes:null!==(f=null!==(u=e.strictTypes)&&void 0!==u?u:M)&&void 0!==f?f:"log",strictTuples:null!==(p=null!==(d=e.strictTuples)&&void 0!==d?d:M)&&void 0!==p?p:"log",strictRequired:null!==(g=null!==(m=e.strictRequired)&&void 0!==m?m:M)&&void 0!==g&&g,code:e.code?{...e.code,optimize:I,regExp:R}:{optimize:I,regExp:R},loopRequired:null!==(y=e.loopRequired)&&void 0!==y?y:200,loopEnum:null!==(b=e.loopEnum)&&void 0!==b?b:200,meta:null===(v=e.meta)||void 0===v||v,messages:null===(w=e.messages)||void 0===w||w,inlineRefs:null===(A=e.inlineRefs)||void 0===A||A,schemaId:null!==(_=e.schemaId)&&void 0!==_?_:"$id",addUsedSchema:null===(E=e.addUsedSchema)||void 0===E||E,validateSchema:null===(S=e.validateSchema)||void 0===S||S,validateFormats:null===(P=e.validateFormats)||void 0===P||P,unicodeRegExp:null===(x=e.unicodeRegExp)||void 0===x||x,int32range:null===(k=e.int32range)||void 0===k||k,uriResolver:N}}class v{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...b(e)};const{es5:t,lines:r}=this.opts.code;this.scope=new s.ValueScope({scope:{},prefixes:m,es5:t,lines:r}),this.logger=function(e){if(!1===e)return x;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 n=e.validateFormats;e.validateFormats=!1,this.RULES=(0,o.getRules)(),w.call(this,g,e,"NOT SUPPORTED"),w.call(this,y,e,"DEPRECATED","warn"),this._metaOpts=P.call(this),e.formats&&E.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&S.call(this,e.keywords),"object"==typeof e.meta&&this.addMetaSchema(e.meta),_.call(this),e.validateFormats=n}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:e,meta:t,schemaId:r}=this.opts;let n=d;"id"===r&&(n={...d},n.id=n.$id,delete n.$id),t&&e&&this.addMetaSchema(n,n[r],!1)}defaultMeta(){const{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta="object"==typeof e?e[t]||e:void 0}validate(e,t){let r;if("string"==typeof e){if(r=this.getSchema(e),!r)throw new Error(`no schema with key or ref "${e}"`)}else r=this.compile(e);const n=r(t);return"$async"in r||(this.errors=r.errors),n}compile(e,t){const r=this._addSchema(e,t);return r.validate||this._compileSchemaEnv(r)}compileAsync(e,t){if("function"!=typeof this.opts.loadSchema)throw new Error("options.loadSchema should be a function");const{loadSchema:r}=this.opts;return n.call(this,e,t);async function n(e,t){await o.call(this,e.$schema);const r=this._addSchema(e,t);return r.validate||a.call(this,r)}async function o(e){e&&!this.getSchema(e)&&await n.call(this,{$ref:e},!0)}async function a(e){try{return this._compileSchemaEnv(e)}catch(t){if(!(t instanceof i.default))throw t;return s.call(this,t),await c.call(this,t.missingSchema),a.call(this,e)}}function s({missingSchema:e,missingRef:t}){if(this.refs[e])throw new Error(`AnySchema ${e} is loaded but ${t} cannot be resolved`)}async function c(e){const r=await u.call(this,e);this.refs[e]||await o.call(this,r.$schema),this.refs[e]||this.addSchema(r,e,t)}async function u(e){const t=this._loading[e];if(t)return t;try{return await(this._loading[e]=r(e))}finally{delete this._loading[e]}}}addSchema(e,t,r,n=this.opts.validateSchema){if(Array.isArray(e)){for(const t of e)this.addSchema(t,void 0,r,n);return this}let i;if("object"==typeof e){const{schemaId:t}=this.opts;if(i=e[t],void 0!==i&&"string"!=typeof i)throw new Error(`schema ${t} must be string`)}return t=(0,c.normalizeId)(t||i),this._checkUnique(t),this.schemas[t]=this._addSchema(e,r,t,n,!0),this}addMetaSchema(e,t,r=this.opts.validateSchema){return this.addSchema(e,t,!0,r),this}validateSchema(e,t){if("boolean"==typeof e)return!0;let r;if(r=e.$schema,void 0!==r&&"string"!=typeof r)throw new Error("$schema must be a string");if(r=r||this.opts.defaultMeta||this.defaultMeta(),!r)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const n=this.validate(r,e);if(!n&&t){const e="schema is invalid: "+this.errorsText();if("log"!==this.opts.validateSchema)throw new Error(e);this.logger.error(e)}return n}getSchema(e){let t;for(;"string"==typeof(t=A.call(this,e));)e=t;if(void 0===t){const{schemaId:r}=this.opts,n=new a.SchemaEnv({schema:{},schemaId:r});if(t=a.resolveSchema.call(this,n,e),!t)return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}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 t=A.call(this,e);return"object"==typeof t&&this._cache.delete(t.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{const t=e;this._cache.delete(t);let r=e[this.opts.schemaId];return r&&(r=(0,c.normalizeId)(r),delete this.schemas[r],delete this.refs[r]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(const t of e)this.addKeyword(t);return this}addKeyword(e,t){let r;if("string"==typeof e)r=e,"object"==typeof t&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),t.keyword=r);else{if("object"!=typeof e||void 0!==t)throw new Error("invalid addKeywords parameters");if(r=(t=e).keyword,Array.isArray(r)&&!r.length)throw new Error("addKeywords: keyword must be string or non-empty array")}if(M.call(this,r,t),!t)return(0,f.eachItem)(r,(e=>C.call(this,e))),this;R.call(this,t);const n={...t,type:(0,u.getJSONTypes)(t.type),schemaType:(0,u.getJSONTypes)(t.schemaType)};return(0,f.eachItem)(r,0===n.type.length?e=>C.call(this,e,n):e=>n.type.forEach((t=>C.call(this,e,n,t)))),this}getKeyword(e){const t=this.RULES.all[e];return"object"==typeof t?t.definition:!!t}removeKeyword(e){const{RULES:t}=this;delete t.keywords[e],delete t.all[e];for(const r of t.rules){const t=r.rules.findIndex((t=>t.keyword===e));t>=0&&r.rules.splice(t,1)}return this}addFormat(e,t){return"string"==typeof t&&(t=new RegExp(t)),this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=", ",dataVar:r="data"}={}){return e&&0!==e.length?e.map((e=>`${r}${e.instancePath} ${e.message}`)).reduce(((e,r)=>e+t+r)):"No errors"}$dataMetaSchema(e,t){const r=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(const n of t){const t=n.split("/").slice(1);let i=e;for(const e of t)i=i[e];for(const e in r){const t=r[e];if("object"!=typeof t)continue;const{$data:n}=t.definition,o=i[e];n&&o&&(i[e]=O(o))}}return e}_removeAllSchemas(e,t){for(const r in e){const n=e[r];t&&!t.test(r)||("string"==typeof n?delete e[r]:n&&!n.meta&&(this._cache.delete(n.schema),delete e[r]))}}_addSchema(e,t,r,n=this.opts.validateSchema,i=this.opts.addUsedSchema){let o;const{schemaId:s}=this.opts;if("object"==typeof e)o=e[s];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 u=this._cache.get(e);if(void 0!==u)return u;r=(0,c.normalizeId)(o||r);const f=c.getSchemaRefs.call(this,e,r);return u=new a.SchemaEnv({schema:e,schemaId:s,meta:t,baseId:r,localRefs:f}),this._cache.set(u.schema,u),i&&!r.startsWith("#")&&(r&&this._checkUnique(r),this.refs[r]=u),n&&this.validateSchema(e,!0),u}_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):a.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){const t=this.opts;this.opts=this._metaOpts;try{a.compileSchema.call(this,e)}finally{this.opts=t}}}function w(e,t,r,n="error"){for(const i in e){const o=i;o in t&&this.logger[n](`${r}: option ${i}. ${e[o]}`)}}function A(e){return e=(0,c.normalizeId)(e),this.schemas[e]||this.refs[e]}function _(){const e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(const t in e)this.addSchema(e[t],t)}function E(){for(const e in this.opts.formats){const t=this.opts.formats[e];t&&this.addFormat(e,t)}}function S(e){if(Array.isArray(e))this.addVocabulary(e);else{this.logger.warn("keywords option as map is deprecated, pass array");for(const t in e){const r=e[t];r.keyword||(r.keyword=t),this.addKeyword(r)}}}function P(){const e={...this.opts};for(const t of p)delete e[t];return e}e.default=v,v.ValidationError=n.default,v.MissingRefError=i.default;const x={log(){},warn(){},error(){}};const k=/^[a-z_$][a-z0-9_$:-]*$/i;function M(e,t){const{RULES:r}=this;if((0,f.eachItem)(e,(e=>{if(r.keywords[e])throw new Error(`Keyword ${e} is already defined`);if(!k.test(e))throw new Error(`Keyword ${e} has invalid name`)})),t&&t.$data&&!("code"in t)&&!("validate"in t))throw new Error('$data keyword must have "code" or "validate" function')}function C(e,t,r){var n;const i=null==t?void 0:t.post;if(r&&i)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:o}=this;let a=i?o.post:o.rules.find((({type:e})=>e===r));if(a||(a={type:r,rules:[]},o.rules.push(a)),o.keywords[e]=!0,!t)return;const s={keyword:e,definition:{...t,type:(0,u.getJSONTypes)(t.type),schemaType:(0,u.getJSONTypes)(t.schemaType)}};t.before?I.call(this,a,s,t.before):a.rules.push(s),o.all[e]=s,null===(n=t.implements)||void 0===n||n.forEach((e=>this.addKeyword(e)))}function I(e,t,r){const n=e.rules.findIndex((e=>e.keyword===r));n>=0?e.rules.splice(n,0,t):(e.rules.push(t),this.logger.warn(`rule ${r} is not defined`))}function R(e){let{metaSchema:t}=e;void 0!==t&&(e.$data&&this.opts.$data&&(t=O(t)),e.validateSchema=this.compile(t,!0))}const N={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function O(e){return{anyOf:[e,N]}}}(jp);var Jg={},Wg={},Gg={};Object.defineProperty(Gg,"__esModule",{value:!0}),Gg.callRef=Gg.getValidate=void 0;const Vg=Eg,Zg=cm,Xg=Fp,Qg=qp,Yg=xg,ey=Lp,ty={keyword:"$ref",schemaType:"string",code(e){const{gen:t,schema:r,it:n}=e,{baseId:i,schemaEnv:o,validateName:a,opts:s,self:c}=n,{root:u}=o;if(("#"===r||"#/"===r)&&i===u.baseId)return function(){if(o===u)return ny(e,a,o,o.$async);const r=t.scopeValue("root",{ref:u});return ny(e,Xg._`${r}.validate`,u,u.$async)}();const f=Yg.resolveRef.call(c,u,i,r);if(void 0===f)throw new Vg.default(n.opts.uriResolver,i,r);return f instanceof Yg.SchemaEnv?function(t){const r=ry(e,t);ny(e,r,t,t.$async)}(f):function(n){const i=t.scopeValue("schema",!0===s.code.source?{ref:n,code:(0,Xg.stringify)(n)}:{ref:n}),o=t.name("valid"),a=e.subschema({schema:n,dataTypes:[],schemaPath:Xg.nil,topSchemaRef:i,errSchemaPath:r},o);e.mergeEvaluated(a),e.ok(o)}(f)}};function ry(e,t){const{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):Xg._`${r.scopeValue("wrapper",{ref:t})}.validate`}function ny(e,t,r,n){const{gen:i,it:o}=e,{allErrors:a,schemaEnv:s,opts:c}=o,u=c.passContext?Qg.default.this:Xg.nil;function f(e){const t=Xg._`${e}.errors`;i.assign(Qg.default.vErrors,Xg._`${Qg.default.vErrors} === null ? ${t} : ${Qg.default.vErrors}.concat(${t})`),i.assign(Qg.default.errors,Xg._`${Qg.default.vErrors}.length`)}function d(e){var t;if(!o.opts.unevaluated)return;const n=null===(t=null==r?void 0:r.validate)||void 0===t?void 0:t.evaluated;if(!0!==o.props)if(n&&!n.dynamicProps)void 0!==n.props&&(o.props=ey.mergeEvaluated.props(i,n.props,o.props));else{const t=i.var("props",Xg._`${e}.evaluated.props`);o.props=ey.mergeEvaluated.props(i,t,o.props,Xg.Name)}if(!0!==o.items)if(n&&!n.dynamicItems)void 0!==n.items&&(o.items=ey.mergeEvaluated.items(i,n.items,o.items));else{const t=i.var("items",Xg._`${e}.evaluated.items`);o.items=ey.mergeEvaluated.items(i,t,o.items,Xg.Name)}}n?function(){if(!s.$async)throw new Error("async schema referenced by sync schema");const r=i.let("valid");i.try((()=>{i.code(Xg._`await ${(0,Zg.callValidateCode)(e,t,u)}`),d(t),a||i.assign(r,!0)}),(e=>{i.if(Xg._`!(${e} instanceof ${o.ValidationError})`,(()=>i.throw(e))),f(e),a||i.assign(r,!1)})),e.ok(r)}():e.result((0,Zg.callValidateCode)(e,t,u),(()=>d(t)),(()=>f(t)))}Gg.getValidate=ry,Gg.callRef=ny,Gg.default=ty,Object.defineProperty(Wg,"__esModule",{value:!0});const iy=["$schema","id","$defs",{keyword:"$comment"},"definitions",Gg.default];Wg.default=iy;var oy={},ay={};Object.defineProperty(ay,"__esModule",{value:!0});const sy=jp,cy=Fp.operators,uy={maximum:{exclusive:"exclusiveMaximum",ops:[{okStr:"<=",ok:cy.LTE,fail:cy.GT},{okStr:"<",ok:cy.LT,fail:cy.GTE}]},minimum:{exclusive:"exclusiveMinimum",ops:[{okStr:">=",ok:cy.GTE,fail:cy.LT},{okStr:">",ok:cy.GT,fail:cy.LTE}]}},fy={message:e=>sy.str`must be ${ly(e).okStr} ${e.schemaCode}`,params:e=>sy._`{comparison: ${ly(e).okStr}, limit: ${e.schemaCode}}`},dy={keyword:Object.keys(uy),type:"number",schemaType:"number",$data:!0,error:fy,code(e){const{data:t,schemaCode:r}=e;e.fail$data(sy._`${t} ${ly(e).fail} ${r} || isNaN(${t})`)}};function ly(e){var t;const r=e.keyword,n=(null===(t=e.parentSchema)||void 0===t?void 0:t[uy[r].exclusive])?1:0;return uy[r].ops[n]}ay.default=dy;var hy={};Object.defineProperty(hy,"__esModule",{value:!0});const py={exclusiveMaximum:"maximum",exclusiveMinimum:"minimum"},my={keyword:Object.keys(py),type:"number",schemaType:"boolean",code({keyword:e,parentSchema:t}){const r=py[e];if(void 0===t[r])throw new Error(`${e} can only be used with ${r}`)}};hy.default=my;var gy={};Object.defineProperty(gy,"__esModule",{value:!0});const yy=Fp,by={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:e})=>yy.str`must be multiple of ${e}`,params:({schemaCode:e})=>yy._`{multipleOf: ${e}}`},code(e){const{gen:t,data:r,schemaCode:n,it:i}=e,o=i.opts.multipleOfPrecision,a=t.let("res"),s=o?yy._`Math.abs(Math.round(${a}) - ${a}) > 1e-${o}`:yy._`${a} !== parseInt(${a})`;e.fail$data(yy._`(${n} === 0 || (${a} = ${r}/${n}, ${s}))`)}};gy.default=by;var vy={},wy={};function Ay(e){const t=e.length;let r,n=0,i=0;for(;i=55296&&r<=56319&&i_y.str`must NOT have ${"maxLength"===e?"more":"fewer"} than ${t} characters`,params:({schemaCode:e})=>_y._`{limit: ${e}}`},xy={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:Py,code(e){const{keyword:t,data:r,schemaCode:n,it:i}=e,o="maxLength"===t?_y.operators.GT:_y.operators.LT,a=!1===i.opts.unicode?_y._`${r}.length`:_y._`${(0,Ey.useFunc)(e.gen,Sy.default)}(${r})`;e.fail$data(_y._`${a} ${o} ${n}`)}};vy.default=xy;var ky={};Object.defineProperty(ky,"__esModule",{value:!0});const My=cm,Cy=Fp,Iy={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>Cy.str`must match pattern "${e}"`,params:({schemaCode:e})=>Cy._`{pattern: ${e}}`},code(e){const{data:t,$data:r,schema:n,schemaCode:i,it:o}=e,a=o.opts.unicodeRegExp?"u":"",s=r?Cy._`(new RegExp(${i}, ${a}))`:(0,My.usePattern)(e,n);e.fail$data(Cy._`!${s}.test(${t})`)}};ky.default=Iy;var Ry={};Object.defineProperty(Ry,"__esModule",{value:!0});const Ny=Fp,Oy={message:({keyword:e,schemaCode:t})=>Ny.str`must NOT have ${"maxProperties"===e?"more":"fewer"} than ${t} properties`,params:({schemaCode:e})=>Ny._`{limit: ${e}}`},Ty={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:Oy,code(e){const{keyword:t,data:r,schemaCode:n}=e,i="maxProperties"===t?Ny.operators.GT:Ny.operators.LT;e.fail$data(Ny._`Object.keys(${r}).length ${i} ${n}`)}};Ry.default=Ty;var jy={};Object.defineProperty(jy,"__esModule",{value:!0});const Dy=cm,$y=Fp,By=Lp,Fy={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:e}})=>$y.str`must have required property '${e}'`,params:({params:{missingProperty:e}})=>$y._`{missingProperty: ${e}}`},code(e){const{gen:t,schema:r,schemaCode:n,data:i,$data:o,it:a}=e,{opts:s}=a;if(!o&&0===r.length)return;const c=r.length>=s.loopRequired;if(a.allErrors?function(){if(c||o)e.block$data($y.nil,u);else for(const t of r)(0,Dy.checkReportMissingProp)(e,t)}():function(){const a=t.let("missing");if(c||o){const r=t.let("valid",!0);e.block$data(r,(()=>function(r,o){e.setParams({missingProperty:r}),t.forOf(r,n,(()=>{t.assign(o,(0,Dy.propertyInData)(t,i,r,s.ownProperties)),t.if((0,$y.not)(o),(()=>{e.error(),t.break()}))}),$y.nil)}(a,r))),e.ok(r)}else t.if((0,Dy.checkMissingProp)(e,r,a)),(0,Dy.reportMissingProp)(e,a),t.else()}(),s.strictRequired){const t=e.parentSchema.properties,{definedProperties:n}=e.it;for(const e of r)if(void 0===(null==t?void 0:t[e])&&!n.has(e)){const t=a.schemaEnv.baseId+a.errSchemaPath;(0,By.checkStrictMode)(a,`required property "${e}" is not defined at "${t}" (strictRequired)`,a.opts.strictRequired)}}function u(){t.forOf("prop",n,(r=>{e.setParams({missingProperty:r}),t.if((0,Dy.noPropertyInData)(t,i,r,s.ownProperties),(()=>e.error()))}))}}};jy.default=Fy;var zy={};Object.defineProperty(zy,"__esModule",{value:!0});const Uy=Fp,Ly={message:({keyword:e,schemaCode:t})=>Uy.str`must NOT have ${"maxItems"===e?"more":"fewer"} than ${t} items`,params:({schemaCode:e})=>Uy._`{limit: ${e}}`},qy={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:Ly,code(e){const{keyword:t,data:r,schemaCode:n}=e,i="maxItems"===t?Uy.operators.GT:Uy.operators.LT;e.fail$data(Uy._`${r}.length ${i} ${n}`)}};zy.default=qy;var Hy={},Ky={};Object.defineProperty(Ky,"__esModule",{value:!0});const Jy=Mm;Jy.code='require("ajv/dist/runtime/equal").default',Ky.default=Jy,Object.defineProperty(Hy,"__esModule",{value:!0});const Wy=Xp,Gy=Fp,Vy=Lp,Zy=Ky,Xy={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:e,j:t}})=>Gy.str`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>Gy._`{i: ${e}, j: ${t}}`},code(e){const{gen:t,data:r,$data:n,schema:i,parentSchema:o,schemaCode:a,it:s}=e;if(!n&&!i)return;const c=t.let("valid"),u=o.items?(0,Wy.getSchemaTypes)(o.items):[];function f(n,i){const o=t.name("item"),a=(0,Wy.checkDataTypes)(u,o,s.opts.strictNumbers,Wy.DataType.Wrong),f=t.const("indices",Gy._`{}`);t.for(Gy._`;${n}--;`,(()=>{t.let(o,Gy._`${r}[${n}]`),t.if(a,Gy._`continue`),u.length>1&&t.if(Gy._`typeof ${o} == "string"`,Gy._`${o} += "_"`),t.if(Gy._`typeof ${f}[${o}] == "number"`,(()=>{t.assign(i,Gy._`${f}[${o}]`),e.error(),t.assign(c,!1).break()})).code(Gy._`${f}[${o}] = ${n}`)}))}function d(n,i){const o=(0,Vy.useFunc)(t,Zy.default),a=t.name("outer");t.label(a).for(Gy._`;${n}--;`,(()=>t.for(Gy._`${i} = ${n}; ${i}--;`,(()=>t.if(Gy._`${o}(${r}[${n}], ${r}[${i}])`,(()=>{e.error(),t.assign(c,!1).break(a)}))))))}e.block$data(c,(function(){const n=t.let("i",Gy._`${r}.length`),i=t.let("j");e.setParams({i:n,j:i}),t.assign(c,!0),t.if(Gy._`${n} > 1`,(()=>(u.length>0&&!u.some((e=>"object"===e||"array"===e))?f:d)(n,i)))}),Gy._`${a} === false`),e.ok(c)}};Hy.default=Xy;var Qy={};Object.defineProperty(Qy,"__esModule",{value:!0});const Yy=Fp,eb=Lp,tb=Ky,rb={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:e})=>Yy._`{allowedValue: ${e}}`},code(e){const{gen:t,data:r,$data:n,schemaCode:i,schema:o}=e;n||o&&"object"==typeof o?e.fail$data(Yy._`!${(0,eb.useFunc)(t,tb.default)}(${r}, ${i})`):e.fail(Yy._`${o} !== ${r}`)}};Qy.default=rb;var nb={};Object.defineProperty(nb,"__esModule",{value:!0});const ib=Fp,ob=Lp,ab=Ky,sb={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:e})=>ib._`{allowedValues: ${e}}`},code(e){const{gen:t,data:r,$data:n,schema:i,schemaCode:o,it:a}=e;if(!n&&0===i.length)throw new Error("enum must have non-empty array");const s=i.length>=a.opts.loopEnum;let c;const u=()=>null!=c?c:c=(0,ob.useFunc)(t,ab.default);let f;if(s||n)f=t.let("valid"),e.block$data(f,(function(){t.assign(f,!1),t.forOf("v",o,(e=>t.if(ib._`${u()}(${r}, ${e})`,(()=>t.assign(f,!0).break()))))}));else{if(!Array.isArray(i))throw new Error("ajv implementation error");const e=t.const("vSchema",o);f=(0,ib.or)(...i.map(((t,n)=>function(e,t){const n=i[t];return"object"==typeof n&&null!==n?ib._`${u()}(${r}, ${e}[${t}])`:ib._`${r} === ${n}`}(e,n))))}e.pass(f)}};nb.default=sb,Object.defineProperty(oy,"__esModule",{value:!0});const cb=hy,ub=gy,fb=vy,db=ky,lb=Ry,hb=jy,pb=zy,mb=Hy,gb=Qy,yb=nb,bb=[ay.default,cb.default,ub.default,fb.default,db.default,lb.default,hb.default,pb.default,mb.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},gb.default,yb.default];oy.default=bb;var vb={},wb={};Object.defineProperty(wb,"__esModule",{value:!0}),wb.validateAdditionalItems=void 0;const Ab=Fp,_b=Lp,Eb={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:e}})=>Ab.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>Ab._`{limit: ${e}}`},code(e){const{parentSchema:t,it:r}=e,{items:n}=t;Array.isArray(n)?Sb(e,n):(0,_b.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas')}};function Sb(e,t){const{gen:r,schema:n,data:i,keyword:o,it:a}=e;a.items=!0;const s=r.const("len",Ab._`${i}.length`);if(!1===n)e.setParams({len:t.length}),e.pass(Ab._`${s} <= ${t.length}`);else if("object"==typeof n&&!(0,_b.alwaysValidSchema)(a,n)){const n=r.var("valid",Ab._`${s} <= ${t.length}`);r.if((0,Ab.not)(n),(()=>function(n){r.forRange("i",t.length,s,(t=>{e.subschema({keyword:o,dataProp:t,dataPropType:_b.Type.Num},n),a.allErrors||r.if((0,Ab.not)(n),(()=>r.break()))}))}(n))),e.ok(n)}}wb.validateAdditionalItems=Sb,wb.default=Eb;var Pb={},xb={};Object.defineProperty(xb,"__esModule",{value:!0}),xb.validateTuple=void 0;const kb=Fp,Mb=Lp,Cb=cm,Ib={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){const{schema:t,it:r}=e;if(Array.isArray(t))return Rb(e,"additionalItems",t);r.items=!0,(0,Mb.alwaysValidSchema)(r,t)||e.ok((0,Cb.validateArray)(e))}};function Rb(e,t,r=e.schema){const{gen:n,parentSchema:i,data:o,keyword:a,it:s}=e;!function(e){const{opts:n,errSchemaPath:i}=s,o=r.length,c=o===e.minItems&&(o===e.maxItems||!1===e[t]);if(n.strictTuples&&!c){const e=`"${a}" is ${o}-tuple, but minItems or maxItems/${t} are not specified or different at path "${i}"`;(0,Mb.checkStrictMode)(s,e,n.strictTuples)}}(i),s.opts.unevaluated&&r.length&&!0!==s.items&&(s.items=Mb.mergeEvaluated.items(n,r.length,s.items));const c=n.name("valid"),u=n.const("len",kb._`${o}.length`);r.forEach(((t,r)=>{(0,Mb.alwaysValidSchema)(s,t)||(n.if(kb._`${u} > ${r}`,(()=>e.subschema({keyword:a,schemaProp:r,dataProp:r},c))),e.ok(c))}))}xb.validateTuple=Rb,xb.default=Ib,Object.defineProperty(Pb,"__esModule",{value:!0});const Nb=xb,Ob={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,Nb.validateTuple)(e,"items")};Pb.default=Ob;var Tb={};Object.defineProperty(Tb,"__esModule",{value:!0});const jb=Fp,Db=Lp,$b=cm,Bb=wb,Fb={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:e}})=>jb.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>jb._`{limit: ${e}}`},code(e){const{schema:t,parentSchema:r,it:n}=e,{prefixItems:i}=r;n.items=!0,(0,Db.alwaysValidSchema)(n,t)||(i?(0,Bb.validateAdditionalItems)(e,i):e.ok((0,$b.validateArray)(e)))}};Tb.default=Fb;var zb={};Object.defineProperty(zb,"__esModule",{value:!0});const Ub=Fp,Lb=Lp,qb={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:e,max:t}})=>void 0===t?Ub.str`must contain at least ${e} valid item(s)`:Ub.str`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>void 0===t?Ub._`{minContains: ${e}}`:Ub._`{minContains: ${e}, maxContains: ${t}}`},code(e){const{gen:t,schema:r,parentSchema:n,data:i,it:o}=e;let a,s;const{minContains:c,maxContains:u}=n;o.opts.next?(a=void 0===c?1:c,s=u):a=1;const f=t.const("len",Ub._`${i}.length`);if(e.setParams({min:a,max:s}),void 0===s&&0===a)return void(0,Lb.checkStrictMode)(o,'"minContains" == 0 without "maxContains": "contains" keyword ignored');if(void 0!==s&&a>s)return(0,Lb.checkStrictMode)(o,'"minContains" > "maxContains" is always invalid'),void e.fail();if((0,Lb.alwaysValidSchema)(o,r)){let t=Ub._`${f} >= ${a}`;return void 0!==s&&(t=Ub._`${t} && ${f} <= ${s}`),void e.pass(t)}o.items=!0;const d=t.name("valid");function l(){const e=t.name("_valid"),r=t.let("count",0);h(e,(()=>t.if(e,(()=>function(e){t.code(Ub._`${e}++`),void 0===s?t.if(Ub._`${e} >= ${a}`,(()=>t.assign(d,!0).break())):(t.if(Ub._`${e} > ${s}`,(()=>t.assign(d,!1).break())),1===a?t.assign(d,!0):t.if(Ub._`${e} >= ${a}`,(()=>t.assign(d,!0))))}(r)))))}function h(r,n){t.forRange("i",0,f,(t=>{e.subschema({keyword:"contains",dataProp:t,dataPropType:Lb.Type.Num,compositeRule:!0},r),n()}))}void 0===s&&1===a?h(d,(()=>t.if(d,(()=>t.break())))):0===a?(t.let(d,!0),void 0!==s&&t.if(Ub._`${i}.length > 0`,l)):(t.let(d,!1),l()),e.result(d,(()=>e.reset()))}};zb.default=qb;var Hb={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const t=Fp,r=Lp,n=cm;e.error={message:({params:{property:e,depsCount:r,deps:n}})=>t.str`must have ${1===r?"property":"properties"} ${n} when property ${e} is present`,params:({params:{property:e,depsCount:r,deps:n,missingProperty:i}})=>t._`{property: ${e}, +!function(e,t){!function(e){function t(){for(var e=arguments.length,t=Array(e),r=0;r1){t[0]=t[0].slice(0,-1);for(var n=t.length-1,i=1;i= 0x80 (not a basic code point)","invalid-input":"Invalid input"},P=h-p,x=Math.floor,k=String.fromCharCode;function M(e){throw new RangeError(S[e])}function C(e,t){for(var r=[],n=e.length;n--;)r[n]=t(e[n]);return r}function I(e,t){var r=e.split("@"),n="";return r.length>1&&(n=r[0]+"@",e=r[1]),n+C((e=e.replace(E,".")).split("."),t).join(".")}function R(e){for(var t=[],r=0,n=e.length;r=55296&&i<=56319&&r>1,e+=x(e/t);e>P*m>>1;n+=h)e=x(e/P);return x(n+(P+1)*e/(e+g))},j=function(e){var t=[],r=e.length,n=0,i=v,o=b,a=e.lastIndexOf(w);a<0&&(a=0);for(var s=0;s=128&&M("not-basic"),t.push(e.charCodeAt(s));for(var c=a>0?a+1:0;c=r&&M("invalid-input");var g=N(e.charCodeAt(c++));(g>=h||g>x((l-n)/f))&&M("overflow"),n+=g*f;var y=d<=o?p:d>=o+m?m:d-o;if(gx(l/A)&&M("overflow"),f*=A}var _=t.length+1;o=T(n-u,_,0==u),x(n/_)>l-i&&M("overflow"),i+=x(n/_),n%=_,t.splice(n++,0,i)}return String.fromCodePoint.apply(String,t)},D=function(e){var t=[],r=(e=R(e)).length,n=v,i=0,o=b,a=!0,s=!1,c=void 0;try{for(var u,f=e[Symbol.iterator]();!(a=(u=f.next()).done);a=!0){var d=u.value;d<128&&t.push(k(d))}}catch(e){s=!0,c=e}finally{try{!a&&f.return&&f.return()}finally{if(s)throw c}}var g=t.length,y=g;for(g&&t.push(w);y=n&&Ix((l-i)/N)&&M("overflow"),i+=(A-n)*N,n=A;var j=!0,D=!1,$=void 0;try{for(var B,F=e[Symbol.iterator]();!(j=(B=F.next()).done);j=!0){var z=B.value;if(zl&&M("overflow"),z==n){for(var U=i,L=h;;L+=h){var q=L<=o?p:L>=o+m?m:L-o;if(U>6|192).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase():"%"+(t>>12|224).toString(16).toUpperCase()+"%"+(t>>6&63|128).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase()}function L(e){for(var t="",r=0,n=e.length;r=194&&i<224){if(n-r>=6){var o=parseInt(e.substr(r+4,2),16);t+=String.fromCharCode((31&i)<<6|63&o)}else t+=e.substr(r,6);r+=6}else if(i>=224){if(n-r>=9){var a=parseInt(e.substr(r+4,2),16),s=parseInt(e.substr(r+7,2),16);t+=String.fromCharCode((15&i)<<12|(63&a)<<6|63&s)}else t+=e.substr(r,9);r+=9}else t+=e.substr(r,3),r+=3}return t}function q(e,t){function r(e){var r=L(e);return r.match(t.UNRESERVED)?r:e}return e.scheme&&(e.scheme=String(e.scheme).replace(t.PCT_ENCODED,r).toLowerCase().replace(t.NOT_SCHEME,"")),void 0!==e.userinfo&&(e.userinfo=String(e.userinfo).replace(t.PCT_ENCODED,r).replace(t.NOT_USERINFO,U).replace(t.PCT_ENCODED,i)),void 0!==e.host&&(e.host=String(e.host).replace(t.PCT_ENCODED,r).toLowerCase().replace(t.NOT_HOST,U).replace(t.PCT_ENCODED,i)),void 0!==e.path&&(e.path=String(e.path).replace(t.PCT_ENCODED,r).replace(e.scheme?t.NOT_PATH:t.NOT_PATH_NOSCHEME,U).replace(t.PCT_ENCODED,i)),void 0!==e.query&&(e.query=String(e.query).replace(t.PCT_ENCODED,r).replace(t.NOT_QUERY,U).replace(t.PCT_ENCODED,i)),void 0!==e.fragment&&(e.fragment=String(e.fragment).replace(t.PCT_ENCODED,r).replace(t.NOT_FRAGMENT,U).replace(t.PCT_ENCODED,i)),e}function H(e){return e.replace(/^0*(.*)/,"$1")||"0"}function K(e,t){var r=e.match(t.IPV4ADDRESS)||[],n=f(r,2)[1];return n?n.split(".").map(H).join("."):e}function J(e,t){var r=e.match(t.IPV6ADDRESS)||[],n=f(r,3),i=n[1],o=n[2];if(i){for(var a=i.toLowerCase().split("::").reverse(),s=f(a,2),c=s[0],u=s[1],d=u?u.split(":").map(H):[],l=c.split(":").map(H),h=t.IPV4ADDRESS.test(l[l.length-1]),p=h?7:8,m=l.length-p,g=Array(p),y=0;y1){var A=g.slice(0,v.index),_=g.slice(v.index+v.length);w=A.join(":")+"::"+_.join(":")}else w=g.join(":");return o&&(w+="%"+o),w}return e}var W=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,G=void 0==="".match(/(){0}/)[1];function V(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={},n=!1!==t.iri?u:c;"suffix"===t.reference&&(e=(t.scheme?t.scheme+":":"")+"//"+e);var i=e.match(W);if(i){G?(r.scheme=i[1],r.userinfo=i[3],r.host=i[4],r.port=parseInt(i[5],10),r.path=i[6]||"",r.query=i[7],r.fragment=i[8],isNaN(r.port)&&(r.port=i[5])):(r.scheme=i[1]||void 0,r.userinfo=-1!==e.indexOf("@")?i[3]:void 0,r.host=-1!==e.indexOf("//")?i[4]:void 0,r.port=parseInt(i[5],10),r.path=i[6]||"",r.query=-1!==e.indexOf("?")?i[7]:void 0,r.fragment=-1!==e.indexOf("#")?i[8]:void 0,isNaN(r.port)&&(r.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?i[4]:void 0)),r.host&&(r.host=J(K(r.host,n),n)),void 0!==r.scheme||void 0!==r.userinfo||void 0!==r.host||void 0!==r.port||r.path||void 0!==r.query?void 0===r.scheme?r.reference="relative":void 0===r.fragment?r.reference="absolute":r.reference="uri":r.reference="same-document",t.reference&&"suffix"!==t.reference&&t.reference!==r.reference&&(r.error=r.error||"URI is not a "+t.reference+" reference.");var o=z[(t.scheme||r.scheme||"").toLowerCase()];if(t.unicodeSupport||o&&o.unicodeSupport)q(r,n);else{if(r.host&&(t.domainHost||o&&o.domainHost))try{r.host=F.toASCII(r.host.replace(n.PCT_ENCODED,L).toLowerCase())}catch(e){r.error=r.error||"Host's domain name can not be converted to ASCII via punycode: "+e}q(r,c)}o&&o.parse&&o.parse(r,t)}else r.error=r.error||"URI can not be parsed.";return r}function Z(e,t){var r=!1!==t.iri?u:c,n=[];return void 0!==e.userinfo&&(n.push(e.userinfo),n.push("@")),void 0!==e.host&&n.push(J(K(String(e.host),r),r).replace(r.IPV6ADDRESS,(function(e,t,r){return"["+t+(r?"%25"+r:"")+"]"}))),"number"!=typeof e.port&&"string"!=typeof e.port||(n.push(":"),n.push(String(e.port))),n.length?n.join(""):void 0}var X=/^\.\.?\//,Q=/^\/\.(\/|$)/,Y=/^\/\.\.(\/|$)/,ee=/^\/?(?:.|\n)*?(?=\/|$)/;function te(e){for(var t=[];e.length;)if(e.match(X))e=e.replace(X,"");else if(e.match(Q))e=e.replace(Q,"/");else if(e.match(Y))e=e.replace(Y,"/"),t.pop();else if("."===e||".."===e)e="";else{var r=e.match(ee);if(!r)throw new Error("Unexpected dot segment condition");var n=r[0];e=e.slice(n.length),t.push(n)}return t.join("")}function re(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.iri?u:c,n=[],i=z[(t.scheme||e.scheme||"").toLowerCase()];if(i&&i.serialize&&i.serialize(e,t),e.host)if(r.IPV6ADDRESS.test(e.host));else if(t.domainHost||i&&i.domainHost)try{e.host=t.iri?F.toUnicode(e.host):F.toASCII(e.host.replace(r.PCT_ENCODED,L).toLowerCase())}catch(r){e.error=e.error||"Host's domain name can not be converted to "+(t.iri?"Unicode":"ASCII")+" via punycode: "+r}q(e,r),"suffix"!==t.reference&&e.scheme&&(n.push(e.scheme),n.push(":"));var o=Z(e,t);if(void 0!==o&&("suffix"!==t.reference&&n.push("//"),n.push(o),e.path&&"/"!==e.path.charAt(0)&&n.push("/")),void 0!==e.path){var a=e.path;t.absolutePath||i&&i.absolutePath||(a=te(a)),void 0===o&&(a=a.replace(/^\/\//,"/%2F")),n.push(a)}return void 0!==e.query&&(n.push("?"),n.push(e.query)),void 0!==e.fragment&&(n.push("#"),n.push(e.fragment)),n.join("")}function ne(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n={};return arguments[3]||(e=V(re(e,r),r),t=V(re(t,r),r)),!(r=r||{}).tolerant&&t.scheme?(n.scheme=t.scheme,n.userinfo=t.userinfo,n.host=t.host,n.port=t.port,n.path=te(t.path||""),n.query=t.query):(void 0!==t.userinfo||void 0!==t.host||void 0!==t.port?(n.userinfo=t.userinfo,n.host=t.host,n.port=t.port,n.path=te(t.path||""),n.query=t.query):(t.path?("/"===t.path.charAt(0)?n.path=te(t.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?n.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:n.path=t.path:n.path="/"+t.path,n.path=te(n.path)),n.query=t.query):(n.path=e.path,void 0!==t.query?n.query=t.query:n.query=e.query),n.userinfo=e.userinfo,n.host=e.host,n.port=e.port),n.scheme=e.scheme),n.fragment=t.fragment,n}function ie(e,t,r){var n=a({scheme:"null"},r);return re(ne(V(e,n),V(t,n),n,!0),n)}function oe(e,t){return"string"==typeof e?e=re(V(e,t),t):"object"===n(e)&&(e=V(re(e,t),t)),e}function ae(e,t,r){return"string"==typeof e?e=re(V(e,r),r):"object"===n(e)&&(e=re(e,r)),"string"==typeof t?t=re(V(t,r),r):"object"===n(t)&&(t=re(t,r)),e===t}function se(e,t){return e&&e.toString().replace(t&&t.iri?u.ESCAPE:c.ESCAPE,U)}function ce(e,t){return e&&e.toString().replace(t&&t.iri?u.PCT_ENCODED:c.PCT_ENCODED,L)}var ue={scheme:"http",domainHost:!0,parse:function(e,t){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e},serialize:function(e,t){var r="https"===String(e.scheme).toLowerCase();return e.port!==(r?443:80)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}},fe={scheme:"https",domainHost:ue.domainHost,parse:ue.parse,serialize:ue.serialize};function de(e){return"boolean"==typeof e.secure?e.secure:"wss"===String(e.scheme).toLowerCase()}var le={scheme:"ws",domainHost:!0,parse:function(e,t){var r=e;return r.secure=de(r),r.resourceName=(r.path||"/")+(r.query?"?"+r.query:""),r.path=void 0,r.query=void 0,r},serialize:function(e,t){if(e.port!==(de(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){var r=e.resourceName.split("?"),n=f(r,2),i=n[0],o=n[1];e.path=i&&"/"!==i?i:void 0,e.query=o,e.resourceName=void 0}return e.fragment=void 0,e}},he={scheme:"wss",domainHost:le.domainHost,parse:le.parse,serialize:le.serialize},pe={},me="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",ge="[0-9A-Fa-f]",ye=r(r("%[EFef]"+ge+"%"+ge+ge+"%"+ge+ge)+"|"+r("%[89A-Fa-f]"+ge+"%"+ge+ge)+"|"+r("%"+ge+ge)),be="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",ve=t("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),we="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",Ae=new RegExp(me,"g"),_e=new RegExp(ye,"g"),Ee=new RegExp(t("[^]",be,"[\\.]",'[\\"]',ve),"g"),Se=new RegExp(t("[^]",me,we),"g"),Pe=Se;function xe(e){var t=L(e);return t.match(Ae)?t:e}var ke={scheme:"mailto",parse:function(e,t){var r=e,n=r.to=r.path?r.path.split(","):[];if(r.path=void 0,r.query){for(var i=!1,o={},a=r.query.split("&"),s=0,c=a.length;snew RegExp(e,t);h.code="new RegExp";const p=["removeAdditional","useDefaults","coerceTypes"],m=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),g={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 b(e){var t,r,n,i,o,a,s,c,u,f,d,p,m,g,y,b,v,w,A,_,E,S,P,x,k;const M=e.strict,C=null===(t=e.code)||void 0===t?void 0:t.optimize,I=!0===C||void 0===C?1:C||0,R=null!==(n=null===(r=e.code)||void 0===r?void 0:r.regExp)&&void 0!==n?n:h,N=null!==(i=e.uriResolver)&&void 0!==i?i:l.default;return{strictSchema:null===(a=null!==(o=e.strictSchema)&&void 0!==o?o:M)||void 0===a||a,strictNumbers:null===(c=null!==(s=e.strictNumbers)&&void 0!==s?s:M)||void 0===c||c,strictTypes:null!==(f=null!==(u=e.strictTypes)&&void 0!==u?u:M)&&void 0!==f?f:"log",strictTuples:null!==(p=null!==(d=e.strictTuples)&&void 0!==d?d:M)&&void 0!==p?p:"log",strictRequired:null!==(g=null!==(m=e.strictRequired)&&void 0!==m?m:M)&&void 0!==g&&g,code:e.code?{...e.code,optimize:I,regExp:R}:{optimize:I,regExp:R},loopRequired:null!==(y=e.loopRequired)&&void 0!==y?y:200,loopEnum:null!==(b=e.loopEnum)&&void 0!==b?b:200,meta:null===(v=e.meta)||void 0===v||v,messages:null===(w=e.messages)||void 0===w||w,inlineRefs:null===(A=e.inlineRefs)||void 0===A||A,schemaId:null!==(_=e.schemaId)&&void 0!==_?_:"$id",addUsedSchema:null===(E=e.addUsedSchema)||void 0===E||E,validateSchema:null===(S=e.validateSchema)||void 0===S||S,validateFormats:null===(P=e.validateFormats)||void 0===P||P,unicodeRegExp:null===(x=e.unicodeRegExp)||void 0===x||x,int32range:null===(k=e.int32range)||void 0===k||k,uriResolver:N}}class v{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...b(e)};const{es5:t,lines:r}=this.opts.code;this.scope=new s.ValueScope({scope:{},prefixes:m,es5:t,lines:r}),this.logger=function(e){if(!1===e)return x;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 n=e.validateFormats;e.validateFormats=!1,this.RULES=(0,o.getRules)(),w.call(this,g,e,"NOT SUPPORTED"),w.call(this,y,e,"DEPRECATED","warn"),this._metaOpts=P.call(this),e.formats&&E.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&S.call(this,e.keywords),"object"==typeof e.meta&&this.addMetaSchema(e.meta),_.call(this),e.validateFormats=n}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:e,meta:t,schemaId:r}=this.opts;let n=d;"id"===r&&(n={...d},n.id=n.$id,delete n.$id),t&&e&&this.addMetaSchema(n,n[r],!1)}defaultMeta(){const{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta="object"==typeof e?e[t]||e:void 0}validate(e,t){let r;if("string"==typeof e){if(r=this.getSchema(e),!r)throw new Error(`no schema with key or ref "${e}"`)}else r=this.compile(e);const n=r(t);return"$async"in r||(this.errors=r.errors),n}compile(e,t){const r=this._addSchema(e,t);return r.validate||this._compileSchemaEnv(r)}compileAsync(e,t){if("function"!=typeof this.opts.loadSchema)throw new Error("options.loadSchema should be a function");const{loadSchema:r}=this.opts;return n.call(this,e,t);async function n(e,t){await o.call(this,e.$schema);const r=this._addSchema(e,t);return r.validate||a.call(this,r)}async function o(e){e&&!this.getSchema(e)&&await n.call(this,{$ref:e},!0)}async function a(e){try{return this._compileSchemaEnv(e)}catch(t){if(!(t instanceof i.default))throw t;return s.call(this,t),await c.call(this,t.missingSchema),a.call(this,e)}}function s({missingSchema:e,missingRef:t}){if(this.refs[e])throw new Error(`AnySchema ${e} is loaded but ${t} cannot be resolved`)}async function c(e){const r=await u.call(this,e);this.refs[e]||await o.call(this,r.$schema),this.refs[e]||this.addSchema(r,e,t)}async function u(e){const t=this._loading[e];if(t)return t;try{return await(this._loading[e]=r(e))}finally{delete this._loading[e]}}}addSchema(e,t,r,n=this.opts.validateSchema){if(Array.isArray(e)){for(const t of e)this.addSchema(t,void 0,r,n);return this}let i;if("object"==typeof e){const{schemaId:t}=this.opts;if(i=e[t],void 0!==i&&"string"!=typeof i)throw new Error(`schema ${t} must be string`)}return t=(0,c.normalizeId)(t||i),this._checkUnique(t),this.schemas[t]=this._addSchema(e,r,t,n,!0),this}addMetaSchema(e,t,r=this.opts.validateSchema){return this.addSchema(e,t,!0,r),this}validateSchema(e,t){if("boolean"==typeof e)return!0;let r;if(r=e.$schema,void 0!==r&&"string"!=typeof r)throw new Error("$schema must be a string");if(r=r||this.opts.defaultMeta||this.defaultMeta(),!r)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const n=this.validate(r,e);if(!n&&t){const e="schema is invalid: "+this.errorsText();if("log"!==this.opts.validateSchema)throw new Error(e);this.logger.error(e)}return n}getSchema(e){let t;for(;"string"==typeof(t=A.call(this,e));)e=t;if(void 0===t){const{schemaId:r}=this.opts,n=new a.SchemaEnv({schema:{},schemaId:r});if(t=a.resolveSchema.call(this,n,e),!t)return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}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 t=A.call(this,e);return"object"==typeof t&&this._cache.delete(t.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{const t=e;this._cache.delete(t);let r=e[this.opts.schemaId];return r&&(r=(0,c.normalizeId)(r),delete this.schemas[r],delete this.refs[r]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(const t of e)this.addKeyword(t);return this}addKeyword(e,t){let r;if("string"==typeof e)r=e,"object"==typeof t&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),t.keyword=r);else{if("object"!=typeof e||void 0!==t)throw new Error("invalid addKeywords parameters");if(r=(t=e).keyword,Array.isArray(r)&&!r.length)throw new Error("addKeywords: keyword must be string or non-empty array")}if(M.call(this,r,t),!t)return(0,f.eachItem)(r,(e=>C.call(this,e))),this;R.call(this,t);const n={...t,type:(0,u.getJSONTypes)(t.type),schemaType:(0,u.getJSONTypes)(t.schemaType)};return(0,f.eachItem)(r,0===n.type.length?e=>C.call(this,e,n):e=>n.type.forEach((t=>C.call(this,e,n,t)))),this}getKeyword(e){const t=this.RULES.all[e];return"object"==typeof t?t.definition:!!t}removeKeyword(e){const{RULES:t}=this;delete t.keywords[e],delete t.all[e];for(const r of t.rules){const t=r.rules.findIndex((t=>t.keyword===e));t>=0&&r.rules.splice(t,1)}return this}addFormat(e,t){return"string"==typeof t&&(t=new RegExp(t)),this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=", ",dataVar:r="data"}={}){return e&&0!==e.length?e.map((e=>`${r}${e.instancePath} ${e.message}`)).reduce(((e,r)=>e+t+r)):"No errors"}$dataMetaSchema(e,t){const r=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(const n of t){const t=n.split("/").slice(1);let i=e;for(const e of t)i=i[e];for(const e in r){const t=r[e];if("object"!=typeof t)continue;const{$data:n}=t.definition,o=i[e];n&&o&&(i[e]=O(o))}}return e}_removeAllSchemas(e,t){for(const r in e){const n=e[r];t&&!t.test(r)||("string"==typeof n?delete e[r]:n&&!n.meta&&(this._cache.delete(n.schema),delete e[r]))}}_addSchema(e,t,r,n=this.opts.validateSchema,i=this.opts.addUsedSchema){let o;const{schemaId:s}=this.opts;if("object"==typeof e)o=e[s];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 u=this._cache.get(e);if(void 0!==u)return u;r=(0,c.normalizeId)(o||r);const f=c.getSchemaRefs.call(this,e,r);return u=new a.SchemaEnv({schema:e,schemaId:s,meta:t,baseId:r,localRefs:f}),this._cache.set(u.schema,u),i&&!r.startsWith("#")&&(r&&this._checkUnique(r),this.refs[r]=u),n&&this.validateSchema(e,!0),u}_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):a.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){const t=this.opts;this.opts=this._metaOpts;try{a.compileSchema.call(this,e)}finally{this.opts=t}}}function w(e,t,r,n="error"){for(const i in e){const o=i;o in t&&this.logger[n](`${r}: option ${i}. ${e[o]}`)}}function A(e){return e=(0,c.normalizeId)(e),this.schemas[e]||this.refs[e]}function _(){const e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(const t in e)this.addSchema(e[t],t)}function E(){for(const e in this.opts.formats){const t=this.opts.formats[e];t&&this.addFormat(e,t)}}function S(e){if(Array.isArray(e))this.addVocabulary(e);else{this.logger.warn("keywords option as map is deprecated, pass array");for(const t in e){const r=e[t];r.keyword||(r.keyword=t),this.addKeyword(r)}}}function P(){const e={...this.opts};for(const t of p)delete e[t];return e}e.default=v,v.ValidationError=n.default,v.MissingRefError=i.default;const x={log(){},warn(){},error(){}};const k=/^[a-z_$][a-z0-9_$:-]*$/i;function M(e,t){const{RULES:r}=this;if((0,f.eachItem)(e,(e=>{if(r.keywords[e])throw new Error(`Keyword ${e} is already defined`);if(!k.test(e))throw new Error(`Keyword ${e} has invalid name`)})),t&&t.$data&&!("code"in t)&&!("validate"in t))throw new Error('$data keyword must have "code" or "validate" function')}function C(e,t,r){var n;const i=null==t?void 0:t.post;if(r&&i)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:o}=this;let a=i?o.post:o.rules.find((({type:e})=>e===r));if(a||(a={type:r,rules:[]},o.rules.push(a)),o.keywords[e]=!0,!t)return;const s={keyword:e,definition:{...t,type:(0,u.getJSONTypes)(t.type),schemaType:(0,u.getJSONTypes)(t.schemaType)}};t.before?I.call(this,a,s,t.before):a.rules.push(s),o.all[e]=s,null===(n=t.implements)||void 0===n||n.forEach((e=>this.addKeyword(e)))}function I(e,t,r){const n=e.rules.findIndex((e=>e.keyword===r));n>=0?e.rules.splice(n,0,t):(e.rules.push(t),this.logger.warn(`rule ${r} is not defined`))}function R(e){let{metaSchema:t}=e;void 0!==t&&(e.$data&&this.opts.$data&&(t=O(t)),e.validateSchema=this.compile(t,!0))}const N={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function O(e){return{anyOf:[e,N]}}}($p);var Gg={},Vg={},Zg={};Object.defineProperty(Zg,"__esModule",{value:!0}),Zg.callRef=Zg.getValidate=void 0;const Xg=Pg,Qg=fm,Yg=Up,ey=Kp,ty=Mg,ry=Hp,ny={keyword:"$ref",schemaType:"string",code(e){const{gen:t,schema:r,it:n}=e,{baseId:i,schemaEnv:o,validateName:a,opts:s,self:c}=n,{root:u}=o;if(("#"===r||"#/"===r)&&i===u.baseId)return function(){if(o===u)return oy(e,a,o,o.$async);const r=t.scopeValue("root",{ref:u});return oy(e,Yg._`${r}.validate`,u,u.$async)}();const f=ty.resolveRef.call(c,u,i,r);if(void 0===f)throw new Xg.default(n.opts.uriResolver,i,r);return f instanceof ty.SchemaEnv?function(t){const r=iy(e,t);oy(e,r,t,t.$async)}(f):function(n){const i=t.scopeValue("schema",!0===s.code.source?{ref:n,code:(0,Yg.stringify)(n)}:{ref:n}),o=t.name("valid"),a=e.subschema({schema:n,dataTypes:[],schemaPath:Yg.nil,topSchemaRef:i,errSchemaPath:r},o);e.mergeEvaluated(a),e.ok(o)}(f)}};function iy(e,t){const{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):Yg._`${r.scopeValue("wrapper",{ref:t})}.validate`}function oy(e,t,r,n){const{gen:i,it:o}=e,{allErrors:a,schemaEnv:s,opts:c}=o,u=c.passContext?ey.default.this:Yg.nil;function f(e){const t=Yg._`${e}.errors`;i.assign(ey.default.vErrors,Yg._`${ey.default.vErrors} === null ? ${t} : ${ey.default.vErrors}.concat(${t})`),i.assign(ey.default.errors,Yg._`${ey.default.vErrors}.length`)}function d(e){var t;if(!o.opts.unevaluated)return;const n=null===(t=null==r?void 0:r.validate)||void 0===t?void 0:t.evaluated;if(!0!==o.props)if(n&&!n.dynamicProps)void 0!==n.props&&(o.props=ry.mergeEvaluated.props(i,n.props,o.props));else{const t=i.var("props",Yg._`${e}.evaluated.props`);o.props=ry.mergeEvaluated.props(i,t,o.props,Yg.Name)}if(!0!==o.items)if(n&&!n.dynamicItems)void 0!==n.items&&(o.items=ry.mergeEvaluated.items(i,n.items,o.items));else{const t=i.var("items",Yg._`${e}.evaluated.items`);o.items=ry.mergeEvaluated.items(i,t,o.items,Yg.Name)}}n?function(){if(!s.$async)throw new Error("async schema referenced by sync schema");const r=i.let("valid");i.try((()=>{i.code(Yg._`await ${(0,Qg.callValidateCode)(e,t,u)}`),d(t),a||i.assign(r,!0)}),(e=>{i.if(Yg._`!(${e} instanceof ${o.ValidationError})`,(()=>i.throw(e))),f(e),a||i.assign(r,!1)})),e.ok(r)}():e.result((0,Qg.callValidateCode)(e,t,u),(()=>d(t)),(()=>f(t)))}Zg.getValidate=iy,Zg.callRef=oy,Zg.default=ny,Object.defineProperty(Vg,"__esModule",{value:!0});const ay=["$schema","id","$defs",{keyword:"$comment"},"definitions",Zg.default];Vg.default=ay;var sy={},cy={};Object.defineProperty(cy,"__esModule",{value:!0});const uy=$p,fy=Up.operators,dy={maximum:{exclusive:"exclusiveMaximum",ops:[{okStr:"<=",ok:fy.LTE,fail:fy.GT},{okStr:"<",ok:fy.LT,fail:fy.GTE}]},minimum:{exclusive:"exclusiveMinimum",ops:[{okStr:">=",ok:fy.GTE,fail:fy.LT},{okStr:">",ok:fy.GT,fail:fy.LTE}]}},ly={message:e=>uy.str`must be ${py(e).okStr} ${e.schemaCode}`,params:e=>uy._`{comparison: ${py(e).okStr}, limit: ${e.schemaCode}}`},hy={keyword:Object.keys(dy),type:"number",schemaType:"number",$data:!0,error:ly,code(e){const{data:t,schemaCode:r}=e;e.fail$data(uy._`${t} ${py(e).fail} ${r} || isNaN(${t})`)}};function py(e){var t;const r=e.keyword,n=(null===(t=e.parentSchema)||void 0===t?void 0:t[dy[r].exclusive])?1:0;return dy[r].ops[n]}cy.default=hy;var my={};Object.defineProperty(my,"__esModule",{value:!0});const gy={exclusiveMaximum:"maximum",exclusiveMinimum:"minimum"},yy={keyword:Object.keys(gy),type:"number",schemaType:"boolean",code({keyword:e,parentSchema:t}){const r=gy[e];if(void 0===t[r])throw new Error(`${e} can only be used with ${r}`)}};my.default=yy;var by={};Object.defineProperty(by,"__esModule",{value:!0});const vy=Up,wy={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:e})=>vy.str`must be multiple of ${e}`,params:({schemaCode:e})=>vy._`{multipleOf: ${e}}`},code(e){const{gen:t,data:r,schemaCode:n,it:i}=e,o=i.opts.multipleOfPrecision,a=t.let("res"),s=o?vy._`Math.abs(Math.round(${a}) - ${a}) > 1e-${o}`:vy._`${a} !== parseInt(${a})`;e.fail$data(vy._`(${n} === 0 || (${a} = ${r}/${n}, ${s}))`)}};by.default=wy;var Ay={},_y={};function Ey(e){const t=e.length;let r,n=0,i=0;for(;i=55296&&r<=56319&&iSy.str`must NOT have ${"maxLength"===e?"more":"fewer"} than ${t} characters`,params:({schemaCode:e})=>Sy._`{limit: ${e}}`},My={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:ky,code(e){const{keyword:t,data:r,schemaCode:n,it:i}=e,o="maxLength"===t?Sy.operators.GT:Sy.operators.LT,a=!1===i.opts.unicode?Sy._`${r}.length`:Sy._`${(0,Py.useFunc)(e.gen,xy.default)}(${r})`;e.fail$data(Sy._`${a} ${o} ${n}`)}};Ay.default=My;var Cy={};Object.defineProperty(Cy,"__esModule",{value:!0});const Iy=fm,Ry=Up,Ny={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>Ry.str`must match pattern "${e}"`,params:({schemaCode:e})=>Ry._`{pattern: ${e}}`},code(e){const{data:t,$data:r,schema:n,schemaCode:i,it:o}=e,a=o.opts.unicodeRegExp?"u":"",s=r?Ry._`(new RegExp(${i}, ${a}))`:(0,Iy.usePattern)(e,n);e.fail$data(Ry._`!${s}.test(${t})`)}};Cy.default=Ny;var Oy={};Object.defineProperty(Oy,"__esModule",{value:!0});const Ty=Up,jy={message:({keyword:e,schemaCode:t})=>Ty.str`must NOT have ${"maxProperties"===e?"more":"fewer"} than ${t} properties`,params:({schemaCode:e})=>Ty._`{limit: ${e}}`},Dy={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:jy,code(e){const{keyword:t,data:r,schemaCode:n}=e,i="maxProperties"===t?Ty.operators.GT:Ty.operators.LT;e.fail$data(Ty._`Object.keys(${r}).length ${i} ${n}`)}};Oy.default=Dy;var $y={};Object.defineProperty($y,"__esModule",{value:!0});const By=fm,Fy=Up,zy=Hp,Uy={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:e}})=>Fy.str`must have required property '${e}'`,params:({params:{missingProperty:e}})=>Fy._`{missingProperty: ${e}}`},code(e){const{gen:t,schema:r,schemaCode:n,data:i,$data:o,it:a}=e,{opts:s}=a;if(!o&&0===r.length)return;const c=r.length>=s.loopRequired;if(a.allErrors?function(){if(c||o)e.block$data(Fy.nil,u);else for(const t of r)(0,By.checkReportMissingProp)(e,t)}():function(){const a=t.let("missing");if(c||o){const r=t.let("valid",!0);e.block$data(r,(()=>function(r,o){e.setParams({missingProperty:r}),t.forOf(r,n,(()=>{t.assign(o,(0,By.propertyInData)(t,i,r,s.ownProperties)),t.if((0,Fy.not)(o),(()=>{e.error(),t.break()}))}),Fy.nil)}(a,r))),e.ok(r)}else t.if((0,By.checkMissingProp)(e,r,a)),(0,By.reportMissingProp)(e,a),t.else()}(),s.strictRequired){const t=e.parentSchema.properties,{definedProperties:n}=e.it;for(const e of r)if(void 0===(null==t?void 0:t[e])&&!n.has(e)){const t=a.schemaEnv.baseId+a.errSchemaPath;(0,zy.checkStrictMode)(a,`required property "${e}" is not defined at "${t}" (strictRequired)`,a.opts.strictRequired)}}function u(){t.forOf("prop",n,(r=>{e.setParams({missingProperty:r}),t.if((0,By.noPropertyInData)(t,i,r,s.ownProperties),(()=>e.error()))}))}}};$y.default=Uy;var Ly={};Object.defineProperty(Ly,"__esModule",{value:!0});const qy=Up,Hy={message:({keyword:e,schemaCode:t})=>qy.str`must NOT have ${"maxItems"===e?"more":"fewer"} than ${t} items`,params:({schemaCode:e})=>qy._`{limit: ${e}}`},Ky={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:Hy,code(e){const{keyword:t,data:r,schemaCode:n}=e,i="maxItems"===t?qy.operators.GT:qy.operators.LT;e.fail$data(qy._`${r}.length ${i} ${n}`)}};Ly.default=Ky;var Jy={},Wy={};Object.defineProperty(Wy,"__esModule",{value:!0});const Gy=Im;Gy.code='require("ajv/dist/runtime/equal").default',Wy.default=Gy,Object.defineProperty(Jy,"__esModule",{value:!0});const Vy=Yp,Zy=Up,Xy=Hp,Qy=Wy,Yy={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:e,j:t}})=>Zy.str`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>Zy._`{i: ${e}, j: ${t}}`},code(e){const{gen:t,data:r,$data:n,schema:i,parentSchema:o,schemaCode:a,it:s}=e;if(!n&&!i)return;const c=t.let("valid"),u=o.items?(0,Vy.getSchemaTypes)(o.items):[];function f(n,i){const o=t.name("item"),a=(0,Vy.checkDataTypes)(u,o,s.opts.strictNumbers,Vy.DataType.Wrong),f=t.const("indices",Zy._`{}`);t.for(Zy._`;${n}--;`,(()=>{t.let(o,Zy._`${r}[${n}]`),t.if(a,Zy._`continue`),u.length>1&&t.if(Zy._`typeof ${o} == "string"`,Zy._`${o} += "_"`),t.if(Zy._`typeof ${f}[${o}] == "number"`,(()=>{t.assign(i,Zy._`${f}[${o}]`),e.error(),t.assign(c,!1).break()})).code(Zy._`${f}[${o}] = ${n}`)}))}function d(n,i){const o=(0,Xy.useFunc)(t,Qy.default),a=t.name("outer");t.label(a).for(Zy._`;${n}--;`,(()=>t.for(Zy._`${i} = ${n}; ${i}--;`,(()=>t.if(Zy._`${o}(${r}[${n}], ${r}[${i}])`,(()=>{e.error(),t.assign(c,!1).break(a)}))))))}e.block$data(c,(function(){const n=t.let("i",Zy._`${r}.length`),i=t.let("j");e.setParams({i:n,j:i}),t.assign(c,!0),t.if(Zy._`${n} > 1`,(()=>(u.length>0&&!u.some((e=>"object"===e||"array"===e))?f:d)(n,i)))}),Zy._`${a} === false`),e.ok(c)}};Jy.default=Yy;var eb={};Object.defineProperty(eb,"__esModule",{value:!0});const tb=Up,rb=Hp,nb=Wy,ib={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:e})=>tb._`{allowedValue: ${e}}`},code(e){const{gen:t,data:r,$data:n,schemaCode:i,schema:o}=e;n||o&&"object"==typeof o?e.fail$data(tb._`!${(0,rb.useFunc)(t,nb.default)}(${r}, ${i})`):e.fail(tb._`${o} !== ${r}`)}};eb.default=ib;var ob={};Object.defineProperty(ob,"__esModule",{value:!0});const ab=Up,sb=Hp,cb=Wy,ub={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:e})=>ab._`{allowedValues: ${e}}`},code(e){const{gen:t,data:r,$data:n,schema:i,schemaCode:o,it:a}=e;if(!n&&0===i.length)throw new Error("enum must have non-empty array");const s=i.length>=a.opts.loopEnum;let c;const u=()=>null!=c?c:c=(0,sb.useFunc)(t,cb.default);let f;if(s||n)f=t.let("valid"),e.block$data(f,(function(){t.assign(f,!1),t.forOf("v",o,(e=>t.if(ab._`${u()}(${r}, ${e})`,(()=>t.assign(f,!0).break()))))}));else{if(!Array.isArray(i))throw new Error("ajv implementation error");const e=t.const("vSchema",o);f=(0,ab.or)(...i.map(((t,n)=>function(e,t){const n=i[t];return"object"==typeof n&&null!==n?ab._`${u()}(${r}, ${e}[${t}])`:ab._`${r} === ${n}`}(e,n))))}e.pass(f)}};ob.default=ub,Object.defineProperty(sy,"__esModule",{value:!0});const fb=my,db=by,lb=Ay,hb=Cy,pb=Oy,mb=$y,gb=Ly,yb=Jy,bb=eb,vb=ob,wb=[cy.default,fb.default,db.default,lb.default,hb.default,pb.default,mb.default,gb.default,yb.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},bb.default,vb.default];sy.default=wb;var Ab={},_b={};Object.defineProperty(_b,"__esModule",{value:!0}),_b.validateAdditionalItems=void 0;const Eb=Up,Sb=Hp,Pb={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:e}})=>Eb.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>Eb._`{limit: ${e}}`},code(e){const{parentSchema:t,it:r}=e,{items:n}=t;Array.isArray(n)?xb(e,n):(0,Sb.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas')}};function xb(e,t){const{gen:r,schema:n,data:i,keyword:o,it:a}=e;a.items=!0;const s=r.const("len",Eb._`${i}.length`);if(!1===n)e.setParams({len:t.length}),e.pass(Eb._`${s} <= ${t.length}`);else if("object"==typeof n&&!(0,Sb.alwaysValidSchema)(a,n)){const n=r.var("valid",Eb._`${s} <= ${t.length}`);r.if((0,Eb.not)(n),(()=>function(n){r.forRange("i",t.length,s,(t=>{e.subschema({keyword:o,dataProp:t,dataPropType:Sb.Type.Num},n),a.allErrors||r.if((0,Eb.not)(n),(()=>r.break()))}))}(n))),e.ok(n)}}_b.validateAdditionalItems=xb,_b.default=Pb;var kb={},Mb={};Object.defineProperty(Mb,"__esModule",{value:!0}),Mb.validateTuple=void 0;const Cb=Up,Ib=Hp,Rb=fm,Nb={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){const{schema:t,it:r}=e;if(Array.isArray(t))return Ob(e,"additionalItems",t);r.items=!0,(0,Ib.alwaysValidSchema)(r,t)||e.ok((0,Rb.validateArray)(e))}};function Ob(e,t,r=e.schema){const{gen:n,parentSchema:i,data:o,keyword:a,it:s}=e;!function(e){const{opts:n,errSchemaPath:i}=s,o=r.length,c=o===e.minItems&&(o===e.maxItems||!1===e[t]);if(n.strictTuples&&!c){const e=`"${a}" is ${o}-tuple, but minItems or maxItems/${t} are not specified or different at path "${i}"`;(0,Ib.checkStrictMode)(s,e,n.strictTuples)}}(i),s.opts.unevaluated&&r.length&&!0!==s.items&&(s.items=Ib.mergeEvaluated.items(n,r.length,s.items));const c=n.name("valid"),u=n.const("len",Cb._`${o}.length`);r.forEach(((t,r)=>{(0,Ib.alwaysValidSchema)(s,t)||(n.if(Cb._`${u} > ${r}`,(()=>e.subschema({keyword:a,schemaProp:r,dataProp:r},c))),e.ok(c))}))}Mb.validateTuple=Ob,Mb.default=Nb,Object.defineProperty(kb,"__esModule",{value:!0});const Tb=Mb,jb={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,Tb.validateTuple)(e,"items")};kb.default=jb;var Db={};Object.defineProperty(Db,"__esModule",{value:!0});const $b=Up,Bb=Hp,Fb=fm,zb=_b,Ub={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:e}})=>$b.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>$b._`{limit: ${e}}`},code(e){const{schema:t,parentSchema:r,it:n}=e,{prefixItems:i}=r;n.items=!0,(0,Bb.alwaysValidSchema)(n,t)||(i?(0,zb.validateAdditionalItems)(e,i):e.ok((0,Fb.validateArray)(e)))}};Db.default=Ub;var Lb={};Object.defineProperty(Lb,"__esModule",{value:!0});const qb=Up,Hb=Hp,Kb={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:e,max:t}})=>void 0===t?qb.str`must contain at least ${e} valid item(s)`:qb.str`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>void 0===t?qb._`{minContains: ${e}}`:qb._`{minContains: ${e}, maxContains: ${t}}`},code(e){const{gen:t,schema:r,parentSchema:n,data:i,it:o}=e;let a,s;const{minContains:c,maxContains:u}=n;o.opts.next?(a=void 0===c?1:c,s=u):a=1;const f=t.const("len",qb._`${i}.length`);if(e.setParams({min:a,max:s}),void 0===s&&0===a)return void(0,Hb.checkStrictMode)(o,'"minContains" == 0 without "maxContains": "contains" keyword ignored');if(void 0!==s&&a>s)return(0,Hb.checkStrictMode)(o,'"minContains" > "maxContains" is always invalid'),void e.fail();if((0,Hb.alwaysValidSchema)(o,r)){let t=qb._`${f} >= ${a}`;return void 0!==s&&(t=qb._`${t} && ${f} <= ${s}`),void e.pass(t)}o.items=!0;const d=t.name("valid");function l(){const e=t.name("_valid"),r=t.let("count",0);h(e,(()=>t.if(e,(()=>function(e){t.code(qb._`${e}++`),void 0===s?t.if(qb._`${e} >= ${a}`,(()=>t.assign(d,!0).break())):(t.if(qb._`${e} > ${s}`,(()=>t.assign(d,!1).break())),1===a?t.assign(d,!0):t.if(qb._`${e} >= ${a}`,(()=>t.assign(d,!0))))}(r)))))}function h(r,n){t.forRange("i",0,f,(t=>{e.subschema({keyword:"contains",dataProp:t,dataPropType:Hb.Type.Num,compositeRule:!0},r),n()}))}void 0===s&&1===a?h(d,(()=>t.if(d,(()=>t.break())))):0===a?(t.let(d,!0),void 0!==s&&t.if(qb._`${i}.length > 0`,l)):(t.let(d,!1),l()),e.result(d,(()=>e.reset()))}};Lb.default=Kb;var Jb={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const t=Up,r=Hp,n=fm;e.error={message:({params:{property:e,depsCount:r,deps:n}})=>t.str`must have ${1===r?"property":"properties"} ${n} when property ${e} is present`,params:({params:{property:e,depsCount:r,deps:n,missingProperty:i}})=>t._`{property: ${e}, missingProperty: ${i}, depsCount: ${r}, - deps: ${n}}`};const i={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(e){const[t,r]=function({schema:e}){const t={},r={};for(const n in e){if("__proto__"===n)continue;(Array.isArray(e[n])?t:r)[n]=e[n]}return[t,r]}(e);o(e,t),a(e,r)}};function o(e,r=e.schema){const{gen:i,data:o,it:a}=e;if(0===Object.keys(r).length)return;const s=i.let("missing");for(const c in r){const u=r[c];if(0===u.length)continue;const f=(0,n.propertyInData)(i,o,c,a.opts.ownProperties);e.setParams({property:c,depsCount:u.length,deps:u.join(", ")}),a.allErrors?i.if(f,(()=>{for(const t of u)(0,n.checkReportMissingProp)(e,t)})):(i.if(t._`${f} && (${(0,n.checkMissingProp)(e,u,s)})`),(0,n.reportMissingProp)(e,s),i.else())}}function a(e,t=e.schema){const{gen:i,data:o,keyword:a,it:s}=e,c=i.name("valid");for(const u in t)(0,r.alwaysValidSchema)(s,t[u])||(i.if((0,n.propertyInData)(i,o,u,s.opts.ownProperties),(()=>{const t=e.subschema({keyword:a,schemaProp:u},c);e.mergeValidEvaluated(t,c)}),(()=>i.var(c,!0))),e.ok(c))}e.validatePropertyDeps=o,e.validateSchemaDeps=a,e.default=i}(Hb);var Kb={};Object.defineProperty(Kb,"__esModule",{value:!0});const Jb=Fp,Wb=Lp,Gb={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:e})=>Jb._`{propertyName: ${e.propertyName}}`},code(e){const{gen:t,schema:r,data:n,it:i}=e;if((0,Wb.alwaysValidSchema)(i,r))return;const o=t.name("valid");t.forIn("key",n,(r=>{e.setParams({propertyName:r}),e.subschema({keyword:"propertyNames",data:r,dataTypes:["string"],propertyName:r,compositeRule:!0},o),t.if((0,Jb.not)(o),(()=>{e.error(!0),i.allErrors||t.break()}))})),e.ok(o)}};Kb.default=Gb;var Vb={};Object.defineProperty(Vb,"__esModule",{value:!0});const Zb=cm,Xb=Fp,Qb=qp,Yb=Lp,ev={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:e})=>Xb._`{additionalProperty: ${e.additionalProperty}}`},code(e){const{gen:t,schema:r,parentSchema:n,data:i,errsCount:o,it:a}=e;if(!o)throw new Error("ajv implementation error");const{allErrors:s,opts:c}=a;if(a.props=!0,"all"!==c.removeAdditional&&(0,Yb.alwaysValidSchema)(a,r))return;const u=(0,Zb.allSchemaProperties)(n.properties),f=(0,Zb.allSchemaProperties)(n.patternProperties);function d(e){t.code(Xb._`delete ${i}[${e}]`)}function l(n){if("all"===c.removeAdditional||c.removeAdditional&&!1===r)d(n);else{if(!1===r)return e.setParams({additionalProperty:n}),e.error(),void(s||t.break());if("object"==typeof r&&!(0,Yb.alwaysValidSchema)(a,r)){const r=t.name("valid");"failing"===c.removeAdditional?(h(n,r,!1),t.if((0,Xb.not)(r),(()=>{e.reset(),d(n)}))):(h(n,r),s||t.if((0,Xb.not)(r),(()=>t.break())))}}}function h(t,r,n){const i={keyword:"additionalProperties",dataProp:t,dataPropType:Yb.Type.Str};!1===n&&Object.assign(i,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(i,r)}t.forIn("key",i,(r=>{u.length||f.length?t.if(function(r){let i;if(u.length>8){const e=(0,Yb.schemaRefOrVal)(a,n.properties,"properties");i=(0,Zb.isOwnProperty)(t,e,r)}else i=u.length?(0,Xb.or)(...u.map((e=>Xb._`${r} === ${e}`))):Xb.nil;return f.length&&(i=(0,Xb.or)(i,...f.map((t=>Xb._`${(0,Zb.usePattern)(e,t)}.test(${r})`)))),(0,Xb.not)(i)}(r),(()=>l(r))):l(r)})),e.ok(Xb._`${o} === ${Qb.default.errors}`)}};Vb.default=ev;var tv={};Object.defineProperty(tv,"__esModule",{value:!0});const rv=Dp,nv=cm,iv=Lp,ov=Vb,av={keyword:"properties",type:"object",schemaType:"object",code(e){const{gen:t,schema:r,parentSchema:n,data:i,it:o}=e;"all"===o.opts.removeAdditional&&void 0===n.additionalProperties&&ov.default.code(new rv.KeywordCxt(o,ov.default,"additionalProperties"));const a=(0,nv.allSchemaProperties)(r);for(const e of a)o.definedProperties.add(e);o.opts.unevaluated&&a.length&&!0!==o.props&&(o.props=iv.mergeEvaluated.props(t,(0,iv.toHash)(a),o.props));const s=a.filter((e=>!(0,iv.alwaysValidSchema)(o,r[e])));if(0===s.length)return;const c=t.name("valid");for(const r of s)u(r)?f(r):(t.if((0,nv.propertyInData)(t,i,r,o.opts.ownProperties)),f(r),o.allErrors||t.else().var(c,!0),t.endIf()),e.it.definedProperties.add(r),e.ok(c);function u(e){return o.opts.useDefaults&&!o.compositeRule&&void 0!==r[e].default}function f(t){e.subschema({keyword:"properties",schemaProp:t,dataProp:t},c)}}};tv.default=av;var sv={};Object.defineProperty(sv,"__esModule",{value:!0});const cv=cm,uv=Fp,fv=Lp,dv=Lp,lv={keyword:"patternProperties",type:"object",schemaType:"object",code(e){const{gen:t,schema:r,data:n,parentSchema:i,it:o}=e,{opts:a}=o,s=(0,cv.allSchemaProperties)(r),c=s.filter((e=>(0,fv.alwaysValidSchema)(o,r[e])));if(0===s.length||c.length===s.length&&(!o.opts.unevaluated||!0===o.props))return;const u=a.strictSchema&&!a.allowMatchingProperties&&i.properties,f=t.name("valid");!0===o.props||o.props instanceof uv.Name||(o.props=(0,dv.evaluatedPropsToName)(t,o.props));const{props:d}=o;function l(e){for(const t in u)new RegExp(e).test(t)&&(0,fv.checkStrictMode)(o,`property ${t} matches pattern ${e} (use allowMatchingProperties)`)}function h(r){t.forIn("key",n,(n=>{t.if(uv._`${(0,cv.usePattern)(e,r)}.test(${n})`,(()=>{const i=c.includes(r);i||e.subschema({keyword:"patternProperties",schemaProp:r,dataProp:n,dataPropType:dv.Type.Str},f),o.opts.unevaluated&&!0!==d?t.assign(uv._`${d}[${n}]`,!0):i||o.allErrors||t.if((0,uv.not)(f),(()=>t.break()))}))}))}!function(){for(const e of s)u&&l(e),o.allErrors?h(e):(t.var(f,!0),h(e),t.if(f))}()}};sv.default=lv;var hv={};Object.defineProperty(hv,"__esModule",{value:!0});const pv=Lp,mv={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){const{gen:t,schema:r,it:n}=e;if((0,pv.alwaysValidSchema)(n,r))return void e.fail();const i=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},i),e.failResult(i,(()=>e.reset()),(()=>e.error()))},error:{message:"must NOT be valid"}};hv.default=mv;var gv={};Object.defineProperty(gv,"__esModule",{value:!0});const yv={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:cm.validateUnion,error:{message:"must match a schema in anyOf"}};gv.default=yv;var bv={};Object.defineProperty(bv,"__esModule",{value:!0});const vv=Fp,wv=Lp,Av={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:e})=>vv._`{passingSchemas: ${e.passing}}`},code(e){const{gen:t,schema:r,parentSchema:n,it:i}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(i.opts.discriminator&&n.discriminator)return;const o=r,a=t.let("valid",!1),s=t.let("passing",null),c=t.name("_valid");e.setParams({passing:s}),t.block((function(){o.forEach(((r,n)=>{let o;(0,wv.alwaysValidSchema)(i,r)?t.var(c,!0):o=e.subschema({keyword:"oneOf",schemaProp:n,compositeRule:!0},c),n>0&&t.if(vv._`${c} && ${a}`).assign(a,!1).assign(s,vv._`[${s}, ${n}]`).else(),t.if(c,(()=>{t.assign(a,!0),t.assign(s,n),o&&e.mergeEvaluated(o,vv.Name)}))}))})),e.result(a,(()=>e.reset()),(()=>e.error(!0)))}};bv.default=Av;var _v={};Object.defineProperty(_v,"__esModule",{value:!0});const Ev=Lp,Sv={keyword:"allOf",schemaType:"array",code(e){const{gen:t,schema:r,it:n}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");const i=t.name("valid");r.forEach(((t,r)=>{if((0,Ev.alwaysValidSchema)(n,t))return;const o=e.subschema({keyword:"allOf",schemaProp:r},i);e.ok(i),e.mergeEvaluated(o)}))}};_v.default=Sv;var Pv={};Object.defineProperty(Pv,"__esModule",{value:!0});const xv=Fp,kv=Lp,Mv={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:e})=>xv.str`must match "${e.ifClause}" schema`,params:({params:e})=>xv._`{failingKeyword: ${e.ifClause}}`},code(e){const{gen:t,parentSchema:r,it:n}=e;void 0===r.then&&void 0===r.else&&(0,kv.checkStrictMode)(n,'"if" without "then" and "else" is ignored');const i=Cv(n,"then"),o=Cv(n,"else");if(!i&&!o)return;const a=t.let("valid",!0),s=t.name("_valid");if(function(){const t=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},s);e.mergeEvaluated(t)}(),e.reset(),i&&o){const r=t.let("ifClause");e.setParams({ifClause:r}),t.if(s,c("then",r),c("else",r))}else i?t.if(s,c("then")):t.if((0,xv.not)(s),c("else"));function c(r,n){return()=>{const i=e.subschema({keyword:r},s);t.assign(a,s),e.mergeValidEvaluated(i,a),n?t.assign(n,xv._`${r}`):e.setParams({ifClause:r})}}e.pass(a,(()=>e.error(!0)))}};function Cv(e,t){const r=e.schema[t];return void 0!==r&&!(0,kv.alwaysValidSchema)(e,r)}Pv.default=Mv;var Iv={};Object.defineProperty(Iv,"__esModule",{value:!0});const Rv=Lp,Nv={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){void 0===t.if&&(0,Rv.checkStrictMode)(r,`"${e}" without "if" is ignored`)}};Iv.default=Nv,Object.defineProperty(vb,"__esModule",{value:!0});const Ov=wb,Tv=Pb,jv=xb,Dv=Tb,$v=zb,Bv=Hb,Fv=Kb,zv=Vb,Uv=tv,Lv=sv,qv=hv,Hv=gv,Kv=bv,Jv=_v,Wv=Pv,Gv=Iv;vb.default=function(e=!1){const t=[qv.default,Hv.default,Kv.default,Jv.default,Wv.default,Gv.default,Fv.default,zv.default,Bv.default,Uv.default,Lv.default];return e?t.push(Tv.default,Dv.default):t.push(Ov.default,jv.default),t.push($v.default),t};var Vv={},Zv={};Object.defineProperty(Zv,"__esModule",{value:!0});const Xv=Fp,Qv={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>Xv.str`must match format "${e}"`,params:({schemaCode:e})=>Xv._`{format: ${e}}`},code(e,t){const{gen:r,data:n,$data:i,schema:o,schemaCode:a,it:s}=e,{opts:c,errSchemaPath:u,schemaEnv:f,self:d}=s;c.validateFormats&&(i?function(){const i=r.scopeValue("formats",{ref:d.formats,code:c.code.formats}),o=r.const("fDef",Xv._`${i}[${a}]`),s=r.let("fType"),u=r.let("format");r.if(Xv._`typeof ${o} == "object" && !(${o} instanceof RegExp)`,(()=>r.assign(s,Xv._`${o}.type || "string"`).assign(u,Xv._`${o}.validate`)),(()=>r.assign(s,Xv._`"string"`).assign(u,o))),e.fail$data((0,Xv.or)(!1===c.strictSchema?Xv.nil:Xv._`${a} && !${u}`,function(){const e=f.$async?Xv._`(${o}.async ? await ${u}(${n}) : ${u}(${n}))`:Xv._`${u}(${n})`,r=Xv._`(typeof ${u} == "function" ? ${e} : ${u}.test(${n}))`;return Xv._`${u} && ${u} !== true && ${s} === ${t} && !${r}`}()))}():function(){const i=d.formats[o];if(!i)return void function(){if(!1===c.strictSchema)return void d.logger.warn(e());throw new Error(e());function e(){return`unknown format "${o}" ignored in schema at path "${u}"`}}();if(!0===i)return;const[a,s,l]=function(e){const t=e instanceof RegExp?(0,Xv.regexpCode)(e):c.code.formats?Xv._`${c.code.formats}${(0,Xv.getProperty)(o)}`:void 0,n=r.scopeValue("formats",{key:o,ref:e,code:t});if("object"==typeof e&&!(e instanceof RegExp))return[e.type||"string",e.validate,Xv._`${n}.validate`];return["string",e,n]}(i);a===t&&e.pass(function(){if("object"==typeof i&&!(i instanceof RegExp)&&i.async){if(!f.$async)throw new Error("async format in sync schema");return Xv._`await ${l}(${n})`}return"function"==typeof s?Xv._`${l}(${n})`:Xv._`${l}.test(${n})`}())}())}};Zv.default=Qv,Object.defineProperty(Vv,"__esModule",{value:!0});const Yv=[Zv.default];Vv.default=Yv,Object.defineProperty(Jg,"__esModule",{value:!0});const ew=oy,tw=vb,rw=Vv,nw=[Wg.default,ew.default,tw.default(),rw.default,["title","description","default"]];Jg.default=nw;var iw={},ow={};!function(e){var t;Object.defineProperty(e,"__esModule",{value:!0}),e.DiscrError=void 0,(t=e.DiscrError||(e.DiscrError={})).Tag="tag",t.Mapping="mapping"}(ow),Object.defineProperty(iw,"__esModule",{value:!0});const aw=Fp,sw=ow,cw=xg,uw=Lp,fw={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:e,tagName:t}})=>e===sw.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>aw._`{error: ${e}, tag: ${r}, tagValue: ${t}}`},code(e){const{gen:t,data:r,schema:n,parentSchema:i,it:o}=e,{oneOf:a}=i;if(!o.opts.discriminator)throw new Error("discriminator: requires discriminator option");const s=n.propertyName;if("string"!=typeof s)throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!a)throw new Error("discriminator: requires oneOf keyword");const c=t.let("valid",!1),u=t.const("tag",aw._`${r}${(0,aw.getProperty)(s)}`);function f(r){const n=t.name("valid"),i=e.subschema({keyword:"oneOf",schemaProp:r},n);return e.mergeEvaluated(i,aw.Name),n}t.if(aw._`typeof ${u} == "string"`,(()=>function(){const r=function(){var e;const t={},r=c(i);let n=!0;for(let t=0;te.error(!1,{discrError:sw.DiscrError.Tag,tag:u,tagName:s}))),e.ok(c)}};iw.default=fw;var dw={id:"http://json-schema.org/draft-04/schema#",$schema:"http://json-schema.org/draft-04/schema#",description:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},positiveInteger:{type:"integer",minimum:0},positiveIntegerDefault0:{allOf:[{$ref:"#/definitions/positiveInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},minItems:1,uniqueItems:!0}},type:"object",properties:{id:{type:"string",format:"uri"},$schema:{type:"string",format:"uri"},title:{type:"string"},description:{type:"string"},default:{},multipleOf:{type:"number",minimum:0,exclusiveMinimum:!0},maximum:{type:"number"},exclusiveMaximum:{type:"boolean",default:!1},minimum:{type:"number"},exclusiveMinimum:{type:"boolean",default:!1},maxLength:{$ref:"#/definitions/positiveInteger"},minLength:{$ref:"#/definitions/positiveIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{anyOf:[{type:"boolean"},{$ref:"#"}],default:{}},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:{}},maxItems:{$ref:"#/definitions/positiveInteger"},minItems:{$ref:"#/definitions/positiveIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxProperties:{$ref:"#/definitions/positiveInteger"},minProperties:{$ref:"#/definitions/positiveIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{anyOf:[{type:"boolean"},{$ref:"#"}],default:{}},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},enum:{type:"array",minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},dependencies:{exclusiveMaximum:["maximum"],exclusiveMinimum:["minimum"]},default:{}};!function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;const r=jp,n=Jg,i=iw,o=dw,a=["/properties"],s="http://json-schema.org/draft-04/schema";class c extends r.default{constructor(e={}){super({...e,schemaId:"id"})}_addVocabularies(){super._addVocabularies(),n.default.forEach((e=>this.addVocabulary(e))),this.opts.discriminator&&this.addKeyword(i.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const e=this.opts.$data?this.$dataMetaSchema(o,a):o;this.addMetaSchema(e,s,!1),this.refs["http://json-schema.org/schema"]=s}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(s)?s:void 0)}}e.exports=t=c,Object.defineProperty(t,"__esModule",{value:!0}),t.default=c;var u=jp;Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return u.KeywordCxt}});var f=jp;Object.defineProperty(t,"_",{enumerable:!0,get:function(){return f._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return f.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return f.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return f.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return f.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return f.CodeGen}})}(Tp,Tp.exports);var lw=c(Tp.exports),hw={exports:{}},pw={};!function(e){function t(e,t){return{validate:e,compare:t}}Object.defineProperty(e,"__esModule",{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0,e.fullFormats={date:t(i,o),time:t(s,c),"date-time":t((function(e){const t=e.split(u);return 2===t.length&&i(t[0])&&s(t[1],!0)}),f),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:function(e){return d.test(e)&&l.test(e)},"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?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z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:function(e){if(y.test(e))return!1;try{return new RegExp(e),!0}catch(e){return!1}},uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:function(e){return h.lastIndex=0,h.test(e)},int32:{type:"number",validate:function(e){return Number.isInteger(e)&&e<=m&&e>=p}},int64:{type:"number",validate:function(e){return Number.isInteger(e)}},float:{type:"number",validate:g},double:{type:"number",validate:g},password:!0,binary:!0},e.fastFormats={...e.fullFormats,date:t(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,o),time:t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,c),"date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,f),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},e.formatNames=Object.keys(e.fullFormats);const r=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,n=[0,31,28,31,30,31,30,31,31,30,31,30,31];function i(e){const t=r.exec(e);if(!t)return!1;const i=+t[1],o=+t[2],a=+t[3];return o>=1&&o<=12&&a>=1&&a<=(2===o&&function(e){return e%4==0&&(e%100!=0||e%400==0)}(i)?29:n[o])}function o(e,t){if(e&&t)return e>t?1:e(t=n[1]+n[2]+n[3]+(n[4]||""))?1:e=",ok:xw.GTE,fail:xw.LT},exclusiveMaximum:{okStr:"<",ok:xw.LT,fail:xw.GTE},exclusiveMinimum:{okStr:">",ok:xw.GT,fail:xw.LTE}},Mw={message:({keyword:e,schemaCode:t})=>Pw.str`must be ${kw[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>Pw._`{comparison: ${kw[e].okStr}, limit: ${t}}`},Cw={keyword:Object.keys(kw),type:"number",schemaType:"number",$data:!0,error:Mw,code(e){const{keyword:t,data:r,schemaCode:n}=e;e.fail$data(Pw._`${r} ${kw[t].fail} ${n} || isNaN(${r})`)}};Sw.default=Cw,Object.defineProperty(Ew,"__esModule",{value:!0});const Iw=gy,Rw=vy,Nw=ky,Ow=Ry,Tw=jy,jw=zy,Dw=Hy,$w=Qy,Bw=nb,Fw=[Sw.default,Iw.default,Rw.default,Nw.default,Ow.default,Tw.default,jw.default,Dw.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},$w.default,Bw.default];Ew.default=Fw;var zw={};Object.defineProperty(zw,"__esModule",{value:!0}),zw.contentVocabulary=zw.metadataVocabulary=void 0,zw.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],zw.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"],Object.defineProperty(yw,"__esModule",{value:!0});const Uw=Ew,Lw=vb,qw=Vv,Hw=zw,Kw=[bw.default,Uw.default,(0,Lw.default)(),qw.default,Hw.metadataVocabulary,Hw.contentVocabulary];yw.default=Kw;var Jw={$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:!0,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:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},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:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},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:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},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:!0};!function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;const r=jp,n=yw,i=iw,o=Jw,a=["/properties"],s="http://json-schema.org/draft-07/schema";class c extends r.default{_addVocabularies(){super._addVocabularies(),n.default.forEach((e=>this.addVocabulary(e))),this.opts.discriminator&&this.addKeyword(i.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const e=this.opts.$data?this.$dataMetaSchema(o,a):o;this.addMetaSchema(e,s,!1),this.refs["http://json-schema.org/schema"]=s}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(s)?s:void 0)}}e.exports=t=c,Object.defineProperty(t,"__esModule",{value:!0}),t.default=c;var u=Dp;Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return u.KeywordCxt}});var f=Fp;Object.defineProperty(t,"_",{enumerable:!0,get:function(){return f._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return f.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return f.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return f.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return f.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return f.CodeGen}});var d=Ag;Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return d.default}});var l=Eg;Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return l.default}})}(gw,gw.exports);var Ww=gw.exports;!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;const t=Ww,r=Fp,n=r.operators,i={formatMaximum:{okStr:"<=",ok:n.LTE,fail:n.GT},formatMinimum:{okStr:">=",ok:n.GTE,fail:n.LT},formatExclusiveMaximum:{okStr:"<",ok:n.LT,fail:n.GTE},formatExclusiveMinimum:{okStr:">",ok:n.GT,fail:n.LTE}},o={message:({keyword:e,schemaCode:t})=>r.str`should be ${i[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>r._`{comparison: ${i[e].okStr}, limit: ${t}}`};e.formatLimitDefinition={keyword:Object.keys(i),type:"string",schemaType:"string",$data:!0,error:o,code(e){const{gen:n,data:o,schemaCode:a,keyword:s,it:c}=e,{opts:u,self:f}=c;if(!u.validateFormats)return;const d=new t.KeywordCxt(c,f.RULES.all.format.definition,"format");function l(e){return r._`${e}.compare(${o}, ${a}) ${i[s].fail} 0`}d.$data?function(){const t=n.scopeValue("formats",{ref:f.formats,code:u.code.formats}),i=n.const("fmt",r._`${t}[${d.schemaCode}]`);e.fail$data(r.or(r._`typeof ${i} != "object"`,r._`${i} instanceof RegExp`,r._`typeof ${i}.compare != "function"`,l(i)))}():function(){const t=d.schema,i=f.formats[t];if(!i||!0===i)return;if("object"!=typeof i||i instanceof RegExp||"function"!=typeof i.compare)throw new Error(`"${s}": format "${t}" does not define "compare" function`);const o=n.scopeValue("formats",{key:t,ref:i,code:u.code.formats?r._`${u.code.formats}${r.getProperty(t)}`:void 0});e.fail$data(l(o))}()},dependencies:["format"]};e.default=t=>(t.addKeyword(e.formatLimitDefinition),t)}(mw),function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=pw,n=mw,i=Fp,o=new i.Name("fullFormats"),a=new i.Name("fastFormats"),s=(e,t={keywords:!0})=>{if(Array.isArray(t))return c(e,t,r.fullFormats,o),e;const[i,s]="fast"===t.mode?[r.fastFormats,a]:[r.fullFormats,o];return c(e,t.formats||r.formatNames,i,s),t.keywords&&n.default(e),e};function c(e,t,r,n){var o,a;null!==(o=(a=e.opts.code).formats)&&void 0!==o||(a.formats=i._`require("ajv-formats/dist/formats").${n}`);for(const n of t)e.addFormat(n,r[n])}s.get=(e,t="full")=>{const n=("fast"===t?r.fastFormats:r.fullFormats)[e];if(!n)throw new Error(`Unknown format "${e}"`);return n},e.exports=t=s,Object.defineProperty(t,"__esModule",{value:!0}),t.default=s}(hw,hw.exports);var Gw=c(hw.exports),Vw={exports:{}};!function(e,t){(function(){var r,n="Expected a function",i="__lodash_hash_undefined__",o="__lodash_placeholder__",a=16,c=32,u=64,f=128,d=256,l=1/0,h=9007199254740991,p=NaN,m=4294967295,g=[["ary",f],["bind",1],["bindKey",2],["curry",8],["curryRight",a],["flip",512],["partial",c],["partialRight",u],["rearg",d]],y="[object Arguments]",b="[object Array]",v="[object Boolean]",w="[object Date]",A="[object Error]",_="[object Function]",E="[object GeneratorFunction]",S="[object Map]",P="[object Number]",x="[object Object]",k="[object Promise]",M="[object RegExp]",C="[object Set]",I="[object String]",R="[object Symbol]",N="[object WeakMap]",O="[object ArrayBuffer]",T="[object DataView]",j="[object Float32Array]",D="[object Float64Array]",$="[object Int8Array]",B="[object Int16Array]",F="[object Int32Array]",z="[object Uint8Array]",U="[object Uint8ClampedArray]",L="[object Uint16Array]",q="[object Uint32Array]",H=/\b__p \+= '';/g,K=/\b(__p \+=) '' \+/g,J=/(__e\(.*?\)|\b__t\)) \+\n'';/g,W=/&(?:amp|lt|gt|quot|#39);/g,G=/[&<>"']/g,V=RegExp(W.source),Z=RegExp(G.source),X=/<%-([\s\S]+?)%>/g,Q=/<%([\s\S]+?)%>/g,Y=/<%=([\s\S]+?)%>/g,ee=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,te=/^\w*$/,re=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ne=/[\\^$.*+?()[\]{}|]/g,ie=RegExp(ne.source),oe=/^\s+/,ae=/\s/,se=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ce=/\{\n\/\* \[wrapped with (.+)\] \*/,ue=/,? & /,fe=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,de=/[()=,{}\[\]\/\s]/,le=/\\(\\)?/g,he=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,pe=/\w*$/,me=/^[-+]0x[0-9a-f]+$/i,ge=/^0b[01]+$/i,ye=/^\[object .+?Constructor\]$/,be=/^0o[0-7]+$/i,ve=/^(?:0|[1-9]\d*)$/,we=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Ae=/($^)/,_e=/['\n\r\u2028\u2029\\]/g,Ee="\\ud800-\\udfff",Se="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Pe="\\u2700-\\u27bf",xe="a-z\\xdf-\\xf6\\xf8-\\xff",ke="A-Z\\xc0-\\xd6\\xd8-\\xde",Me="\\ufe0e\\ufe0f",Ce="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ie="['’]",Re="["+Ee+"]",Ne="["+Ce+"]",Oe="["+Se+"]",Te="\\d+",je="["+Pe+"]",De="["+xe+"]",$e="[^"+Ee+Ce+Te+Pe+xe+ke+"]",Be="\\ud83c[\\udffb-\\udfff]",Fe="[^"+Ee+"]",ze="(?:\\ud83c[\\udde6-\\uddff]){2}",Ue="[\\ud800-\\udbff][\\udc00-\\udfff]",Le="["+ke+"]",qe="\\u200d",He="(?:"+De+"|"+$e+")",Ke="(?:"+Le+"|"+$e+")",Je="(?:['’](?:d|ll|m|re|s|t|ve))?",We="(?:['’](?:D|LL|M|RE|S|T|VE))?",Ge="(?:"+Oe+"|"+Be+")"+"?",Ve="["+Me+"]?",Ze=Ve+Ge+("(?:"+qe+"(?:"+[Fe,ze,Ue].join("|")+")"+Ve+Ge+")*"),Xe="(?:"+[je,ze,Ue].join("|")+")"+Ze,Qe="(?:"+[Fe+Oe+"?",Oe,ze,Ue,Re].join("|")+")",Ye=RegExp(Ie,"g"),et=RegExp(Oe,"g"),tt=RegExp(Be+"(?="+Be+")|"+Qe+Ze,"g"),rt=RegExp([Le+"?"+De+"+"+Je+"(?="+[Ne,Le,"$"].join("|")+")",Ke+"+"+We+"(?="+[Ne,Le+He,"$"].join("|")+")",Le+"?"+He+"+"+Je,Le+"+"+We,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Te,Xe].join("|"),"g"),nt=RegExp("["+qe+Ee+Se+Me+"]"),it=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ot=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],at=-1,st={};st[j]=st[D]=st[$]=st[B]=st[F]=st[z]=st[U]=st[L]=st[q]=!0,st[y]=st[b]=st[O]=st[v]=st[T]=st[w]=st[A]=st[_]=st[S]=st[P]=st[x]=st[M]=st[C]=st[I]=st[N]=!1;var ct={};ct[y]=ct[b]=ct[O]=ct[T]=ct[v]=ct[w]=ct[j]=ct[D]=ct[$]=ct[B]=ct[F]=ct[S]=ct[P]=ct[x]=ct[M]=ct[C]=ct[I]=ct[R]=ct[z]=ct[U]=ct[L]=ct[q]=!0,ct[A]=ct[_]=ct[N]=!1;var ut={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ft=parseFloat,dt=parseInt,lt="object"==typeof s&&s&&s.Object===Object&&s,ht="object"==typeof self&&self&&self.Object===Object&&self,pt=lt||ht||Function("return this")(),mt=t&&!t.nodeType&&t,gt=mt&&e&&!e.nodeType&&e,yt=gt&>.exports===mt,bt=yt&<.process,vt=function(){try{var e=gt&>.require&>.require("util").types;return e||bt&&bt.binding&&bt.binding("util")}catch(e){}}(),wt=vt&&vt.isArrayBuffer,At=vt&&vt.isDate,_t=vt&&vt.isMap,Et=vt&&vt.isRegExp,St=vt&&vt.isSet,Pt=vt&&vt.isTypedArray;function xt(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}function kt(e,t,r,n){for(var i=-1,o=null==e?0:e.length;++i-1}function Ot(e,t,r){for(var n=-1,i=null==e?0:e.length;++n-1;);return r}function rr(e,t){for(var r=e.length;r--&&Lt(t,e[r],0)>-1;);return r}var nr=Wt({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),ir=Wt({"&":"&","<":"<",">":">",'"':""","'":"'"});function or(e){return"\\"+ut[e]}function ar(e){return nt.test(e)}function sr(e){var t=-1,r=Array(e.size);return e.forEach((function(e,n){r[++t]=[n,e]})),r}function cr(e,t){return function(r){return e(t(r))}}function ur(e,t){for(var r=-1,n=e.length,i=0,a=[];++r",""":'"',"'":"'"});var gr=function e(t){var s,ae=(t=null==t?pt:gr.defaults(pt.Object(),t,gr.pick(pt,ot))).Array,Ee=t.Date,Se=t.Error,Pe=t.Function,xe=t.Math,ke=t.Object,Me=t.RegExp,Ce=t.String,Ie=t.TypeError,Re=ae.prototype,Ne=Pe.prototype,Oe=ke.prototype,Te=t["__core-js_shared__"],je=Ne.toString,De=Oe.hasOwnProperty,$e=0,Be=(s=/[^.]+$/.exec(Te&&Te.keys&&Te.keys.IE_PROTO||""))?"Symbol(src)_1."+s:"",Fe=Oe.toString,ze=je.call(ke),Ue=pt._,Le=Me("^"+je.call(De).replace(ne,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),qe=yt?t.Buffer:r,He=t.Symbol,Ke=t.Uint8Array,Je=qe?qe.allocUnsafe:r,We=cr(ke.getPrototypeOf,ke),Ge=ke.create,Ve=Oe.propertyIsEnumerable,Ze=Re.splice,Xe=He?He.isConcatSpreadable:r,Qe=He?He.iterator:r,tt=He?He.toStringTag:r,nt=function(){try{var e=ho(ke,"defineProperty");return e({},"",{}),e}catch(e){}}(),ut=t.clearTimeout!==pt.clearTimeout&&t.clearTimeout,lt=Ee&&Ee.now!==pt.Date.now&&Ee.now,ht=t.setTimeout!==pt.setTimeout&&t.setTimeout,mt=xe.ceil,gt=xe.floor,bt=ke.getOwnPropertySymbols,vt=qe?qe.isBuffer:r,Ft=t.isFinite,Wt=Re.join,yr=cr(ke.keys,ke),br=xe.max,vr=xe.min,wr=Ee.now,Ar=t.parseInt,_r=xe.random,Er=Re.reverse,Sr=ho(t,"DataView"),Pr=ho(t,"Map"),xr=ho(t,"Promise"),kr=ho(t,"Set"),Mr=ho(t,"WeakMap"),Cr=ho(ke,"create"),Ir=Mr&&new Mr,Rr={},Nr=Fo(Sr),Or=Fo(Pr),Tr=Fo(xr),jr=Fo(kr),Dr=Fo(Mr),$r=He?He.prototype:r,Br=$r?$r.valueOf:r,Fr=$r?$r.toString:r;function zr(e){if(rs(e)&&!Ka(e)&&!(e instanceof Hr)){if(e instanceof qr)return e;if(De.call(e,"__wrapped__"))return zo(e)}return new qr(e)}var Ur=function(){function e(){}return function(t){if(!ts(t))return{};if(Ge)return Ge(t);e.prototype=t;var n=new e;return e.prototype=r,n}}();function Lr(){}function qr(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=r}function Hr(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=m,this.__views__=[]}function Kr(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t=t?e:t)),e}function un(e,t,n,i,o,a){var s,c=1&t,u=2&t,f=4&t;if(n&&(s=o?n(e,i,o,a):n(e)),s!==r)return s;if(!ts(e))return e;var d=Ka(e);if(d){if(s=function(e){var t=e.length,r=new e.constructor(t);t&&"string"==typeof e[0]&&De.call(e,"index")&&(r.index=e.index,r.input=e.input);return r}(e),!c)return Ii(e,s)}else{var l=go(e),h=l==_||l==E;if(Va(e))return Si(e,c);if(l==x||l==y||h&&!o){if(s=u||h?{}:bo(e),!c)return u?function(e,t){return Ri(e,mo(e),t)}(e,function(e,t){return e&&Ri(t,Os(t),e)}(s,e)):function(e,t){return Ri(e,po(e),t)}(e,on(s,e))}else{if(!ct[l])return o?e:{};s=function(e,t,r){var n=e.constructor;switch(t){case O:return Pi(e);case v:case w:return new n(+e);case T:return function(e,t){var r=t?Pi(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}(e,r);case j:case D:case $:case B:case F:case z:case U:case L:case q:return xi(e,r);case S:return new n;case P:case I:return new n(e);case M:return function(e){var t=new e.constructor(e.source,pe.exec(e));return t.lastIndex=e.lastIndex,t}(e);case C:return new n;case R:return i=e,Br?ke(Br.call(i)):{}}var i}(e,l,c)}}a||(a=new Vr);var p=a.get(e);if(p)return p;a.set(e,s),ss(e)?e.forEach((function(r){s.add(un(r,t,n,r,e,a))})):ns(e)&&e.forEach((function(r,i){s.set(i,un(r,t,n,i,e,a))}));var m=d?r:(f?u?oo:io:u?Os:Ns)(e);return Mt(m||e,(function(r,i){m&&(r=e[i=r]),tn(s,i,un(r,t,n,i,e,a))})),s}function fn(e,t,n){var i=n.length;if(null==e)return!i;for(e=ke(e);i--;){var o=n[i],a=t[o],s=e[o];if(s===r&&!(o in e)||!a(s))return!1}return!0}function dn(e,t,i){if("function"!=typeof e)throw new Ie(n);return No((function(){e.apply(r,i)}),t)}function ln(e,t,r,n){var i=-1,o=Nt,a=!0,s=e.length,c=[],u=t.length;if(!s)return c;r&&(t=Tt(t,Qt(r))),n?(o=Ot,a=!1):t.length>=200&&(o=er,a=!1,t=new Gr(t));e:for(;++i-1},Jr.prototype.set=function(e,t){var r=this.__data__,n=rn(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this},Wr.prototype.clear=function(){this.size=0,this.__data__={hash:new Kr,map:new(Pr||Jr),string:new Kr}},Wr.prototype.delete=function(e){var t=fo(this,e).delete(e);return this.size-=t?1:0,t},Wr.prototype.get=function(e){return fo(this,e).get(e)},Wr.prototype.has=function(e){return fo(this,e).has(e)},Wr.prototype.set=function(e,t){var r=fo(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this},Gr.prototype.add=Gr.prototype.push=function(e){return this.__data__.set(e,i),this},Gr.prototype.has=function(e){return this.__data__.has(e)},Vr.prototype.clear=function(){this.__data__=new Jr,this.size=0},Vr.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},Vr.prototype.get=function(e){return this.__data__.get(e)},Vr.prototype.has=function(e){return this.__data__.has(e)},Vr.prototype.set=function(e,t){var r=this.__data__;if(r instanceof Jr){var n=r.__data__;if(!Pr||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new Wr(n)}return r.set(e,t),this.size=r.size,this};var hn=Ti(An),pn=Ti(_n,!0);function mn(e,t){var r=!0;return hn(e,(function(e,n,i){return r=!!t(e,n,i)})),r}function gn(e,t,n){for(var i=-1,o=e.length;++i0&&r(s)?t>1?bn(s,t-1,r,n,i):jt(i,s):n||(i[i.length]=s)}return i}var vn=ji(),wn=ji(!0);function An(e,t){return e&&vn(e,t,Ns)}function _n(e,t){return e&&wn(e,t,Ns)}function En(e,t){return Rt(t,(function(t){return Qa(e[t])}))}function Sn(e,t){for(var n=0,i=(t=wi(t,e)).length;null!=e&&nt}function Mn(e,t){return null!=e&&De.call(e,t)}function Cn(e,t){return null!=e&&t in ke(e)}function In(e,t,n){for(var i=n?Ot:Nt,o=e[0].length,a=e.length,s=a,c=ae(a),u=1/0,f=[];s--;){var d=e[s];s&&t&&(d=Tt(d,Qt(t))),u=vr(d.length,u),c[s]=!n&&(t||o>=120&&d.length>=120)?new Gr(s&&d):r}d=e[0];var l=-1,h=c[0];e:for(;++l=s?c:c*("desc"==r[n]?-1:1)}return e.index-t.index}(e,t,r)}))}function Jn(e,t,r){for(var n=-1,i=t.length,o={};++n-1;)s!==e&&Ze.call(s,c,1),Ze.call(e,c,1);return e}function Gn(e,t){for(var r=e?t.length:0,n=r-1;r--;){var i=t[r];if(r==n||i!==o){var o=i;wo(i)?Ze.call(e,i,1):li(e,i)}}return e}function Vn(e,t){return e+gt(_r()*(t-e+1))}function Zn(e,t){var r="";if(!e||t<1||t>h)return r;do{t%2&&(r+=e),(t=gt(t/2))&&(e+=e)}while(t);return r}function Xn(e,t){return Oo(Mo(e,t,ic),e+"")}function Qn(e){return Xr(Us(e))}function Yn(e,t){var r=Us(e);return Do(r,cn(t,0,r.length))}function ei(e,t,n,i){if(!ts(e))return e;for(var o=-1,a=(t=wi(t,e)).length,s=a-1,c=e;null!=c&&++oi?0:i+t),(r=r>i?i:r)<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var o=ae(i);++n>>1,a=e[o];null!==a&&!us(a)&&(r?a<=t:a=200){var u=t?null:Zi(e);if(u)return fr(u);a=!1,i=er,c=new Gr}else c=t?[]:s;e:for(;++n=i?e:ii(e,t,n)}var Ei=ut||function(e){return pt.clearTimeout(e)};function Si(e,t){if(t)return e.slice();var r=e.length,n=Je?Je(r):new e.constructor(r);return e.copy(n),n}function Pi(e){var t=new e.constructor(e.byteLength);return new Ke(t).set(new Ke(e)),t}function xi(e,t){var r=t?Pi(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function ki(e,t){if(e!==t){var n=e!==r,i=null===e,o=e==e,a=us(e),s=t!==r,c=null===t,u=t==t,f=us(t);if(!c&&!f&&!a&&e>t||a&&s&&u&&!c&&!f||i&&s&&u||!n&&u||!o)return 1;if(!i&&!a&&!f&&e1?n[o-1]:r,s=o>2?n[2]:r;for(a=e.length>3&&"function"==typeof a?(o--,a):r,s&&Ao(n[0],n[1],s)&&(a=o<3?r:a,o=1),t=ke(t);++i-1?o[a?t[s]:s]:r}}function zi(e){return no((function(t){var i=t.length,o=i,a=qr.prototype.thru;for(e&&t.reverse();o--;){var s=t[o];if("function"!=typeof s)throw new Ie(n);if(a&&!c&&"wrapper"==so(s))var c=new qr([],!0)}for(o=c?o:i;++o1&&v.reverse(),l&&uc))return!1;var f=a.get(e),d=a.get(t);if(f&&d)return f==t&&d==e;var l=-1,h=!0,p=2&n?new Gr:r;for(a.set(e,t),a.set(t,e);++l-1&&e%1==0&&e1?"& ":"")+t[n],t=t.join(r>2?", ":" "),e.replace(se,"{\n/* [wrapped with "+t+"] */\n")}(n,function(e,t){return Mt(g,(function(r){var n="_."+r[0];t&r[1]&&!Nt(e,n)&&e.push(n)})),e.sort()}(function(e){var t=e.match(ce);return t?t[1].split(ue):[]}(n),r)))}function jo(e){var t=0,n=0;return function(){var i=wr(),o=16-(i-n);if(n=i,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(r,arguments)}}function Do(e,t){var n=-1,i=e.length,o=i-1;for(t=t===r?i:t;++n1?e[t-1]:r;return n="function"==typeof n?(e.pop(),n):r,aa(e,n)}));function ha(e){var t=zr(e);return t.__chain__=!0,t}function pa(e,t){return t(e)}var ma=no((function(e){var t=e.length,n=t?e[0]:0,i=this.__wrapped__,o=function(t){return sn(t,e)};return!(t>1||this.__actions__.length)&&i instanceof Hr&&wo(n)?((i=i.slice(n,+n+(t?1:0))).__actions__.push({func:pa,args:[o],thisArg:r}),new qr(i,this.__chain__).thru((function(e){return t&&!e.length&&e.push(r),e}))):this.thru(o)}));var ga=Ni((function(e,t,r){De.call(e,r)?++e[r]:an(e,r,1)}));var ya=Fi(Ho),ba=Fi(Ko);function va(e,t){return(Ka(e)?Mt:hn)(e,uo(t,3))}function wa(e,t){return(Ka(e)?Ct:pn)(e,uo(t,3))}var Aa=Ni((function(e,t,r){De.call(e,r)?e[r].push(t):an(e,r,[t])}));var _a=Xn((function(e,t,r){var n=-1,i="function"==typeof t,o=Wa(e)?ae(e.length):[];return hn(e,(function(e){o[++n]=i?xt(t,e,r):Rn(e,t,r)})),o})),Ea=Ni((function(e,t,r){an(e,r,t)}));function Sa(e,t){return(Ka(e)?Tt:zn)(e,uo(t,3))}var Pa=Ni((function(e,t,r){e[r?0:1].push(t)}),(function(){return[[],[]]}));var xa=Xn((function(e,t){if(null==e)return[];var r=t.length;return r>1&&Ao(e,t[0],t[1])?t=[]:r>2&&Ao(t[0],t[1],t[2])&&(t=[t[0]]),Kn(e,bn(t,1),[])})),ka=lt||function(){return pt.Date.now()};function Ma(e,t,n){return t=n?r:t,t=e&&null==t?e.length:t,Qi(e,f,r,r,r,r,t)}function Ca(e,t){var i;if("function"!=typeof t)throw new Ie(n);return e=ms(e),function(){return--e>0&&(i=t.apply(this,arguments)),e<=1&&(t=r),i}}var Ia=Xn((function(e,t,r){var n=1;if(r.length){var i=ur(r,co(Ia));n|=c}return Qi(e,n,t,r,i)})),Ra=Xn((function(e,t,r){var n=3;if(r.length){var i=ur(r,co(Ra));n|=c}return Qi(t,n,e,r,i)}));function Na(e,t,i){var o,a,s,c,u,f,d=0,l=!1,h=!1,p=!0;if("function"!=typeof e)throw new Ie(n);function m(t){var n=o,i=a;return o=a=r,d=t,c=e.apply(i,n)}function g(e){var n=e-f;return f===r||n>=t||n<0||h&&e-d>=s}function y(){var e=ka();if(g(e))return b(e);u=No(y,function(e){var r=t-(e-f);return h?vr(r,s-(e-d)):r}(e))}function b(e){return u=r,p&&o?m(e):(o=a=r,c)}function v(){var e=ka(),n=g(e);if(o=arguments,a=this,f=e,n){if(u===r)return function(e){return d=e,u=No(y,t),l?m(e):c}(f);if(h)return Ei(u),u=No(y,t),m(f)}return u===r&&(u=No(y,t)),c}return t=ys(t)||0,ts(i)&&(l=!!i.leading,s=(h="maxWait"in i)?br(ys(i.maxWait)||0,t):s,p="trailing"in i?!!i.trailing:p),v.cancel=function(){u!==r&&Ei(u),d=0,o=f=a=u=r},v.flush=function(){return u===r?c:b(ka())},v}var Oa=Xn((function(e,t){return dn(e,1,t)})),Ta=Xn((function(e,t,r){return dn(e,ys(t)||0,r)}));function ja(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Ie(n);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var a=e.apply(this,n);return r.cache=o.set(i,a)||o,a};return r.cache=new(ja.Cache||Wr),r}function Da(e){if("function"!=typeof e)throw new Ie(n);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}ja.Cache=Wr;var $a=Ai((function(e,t){var r=(t=1==t.length&&Ka(t[0])?Tt(t[0],Qt(uo())):Tt(bn(t,1),Qt(uo()))).length;return Xn((function(n){for(var i=-1,o=vr(n.length,r);++i=t})),Ha=Nn(function(){return arguments}())?Nn:function(e){return rs(e)&&De.call(e,"callee")&&!Ve.call(e,"callee")},Ka=ae.isArray,Ja=wt?Qt(wt):function(e){return rs(e)&&xn(e)==O};function Wa(e){return null!=e&&es(e.length)&&!Qa(e)}function Ga(e){return rs(e)&&Wa(e)}var Va=vt||yc,Za=At?Qt(At):function(e){return rs(e)&&xn(e)==w};function Xa(e){if(!rs(e))return!1;var t=xn(e);return t==A||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!os(e)}function Qa(e){if(!ts(e))return!1;var t=xn(e);return t==_||t==E||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Ya(e){return"number"==typeof e&&e==ms(e)}function es(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=h}function ts(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function rs(e){return null!=e&&"object"==typeof e}var ns=_t?Qt(_t):function(e){return rs(e)&&go(e)==S};function is(e){return"number"==typeof e||rs(e)&&xn(e)==P}function os(e){if(!rs(e)||xn(e)!=x)return!1;var t=We(e);if(null===t)return!0;var r=De.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&je.call(r)==ze}var as=Et?Qt(Et):function(e){return rs(e)&&xn(e)==M};var ss=St?Qt(St):function(e){return rs(e)&&go(e)==C};function cs(e){return"string"==typeof e||!Ka(e)&&rs(e)&&xn(e)==I}function us(e){return"symbol"==typeof e||rs(e)&&xn(e)==R}var fs=Pt?Qt(Pt):function(e){return rs(e)&&es(e.length)&&!!st[xn(e)]};var ds=Wi(Fn),ls=Wi((function(e,t){return e<=t}));function hs(e){if(!e)return[];if(Wa(e))return cs(e)?hr(e):Ii(e);if(Qe&&e[Qe])return function(e){for(var t,r=[];!(t=e.next()).done;)r.push(t.value);return r}(e[Qe]());var t=go(e);return(t==S?sr:t==C?fr:Us)(e)}function ps(e){return e?(e=ys(e))===l||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function ms(e){var t=ps(e),r=t%1;return t==t?r?t-r:t:0}function gs(e){return e?cn(ms(e),0,m):0}function ys(e){if("number"==typeof e)return e;if(us(e))return p;if(ts(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=ts(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Xt(e);var r=ge.test(e);return r||be.test(e)?dt(e.slice(2),r?2:8):me.test(e)?p:+e}function bs(e){return Ri(e,Os(e))}function vs(e){return null==e?"":fi(e)}var ws=Oi((function(e,t){if(Po(t)||Wa(t))Ri(t,Ns(t),e);else for(var r in t)De.call(t,r)&&tn(e,r,t[r])})),As=Oi((function(e,t){Ri(t,Os(t),e)})),_s=Oi((function(e,t,r,n){Ri(t,Os(t),e,n)})),Es=Oi((function(e,t,r,n){Ri(t,Ns(t),e,n)})),Ss=no(sn);var Ps=Xn((function(e,t){e=ke(e);var n=-1,i=t.length,o=i>2?t[2]:r;for(o&&Ao(t[0],t[1],o)&&(i=1);++n1),t})),Ri(e,oo(e),r),n&&(r=un(r,7,to));for(var i=t.length;i--;)li(r,t[i]);return r}));var $s=no((function(e,t){return null==e?{}:function(e,t){return Jn(e,t,(function(t,r){return Ms(e,r)}))}(e,t)}));function Bs(e,t){if(null==e)return{};var r=Tt(oo(e),(function(e){return[e]}));return t=uo(t),Jn(e,r,(function(e,r){return t(e,r[0])}))}var Fs=Xi(Ns),zs=Xi(Os);function Us(e){return null==e?[]:Yt(e,Ns(e))}var Ls=$i((function(e,t,r){return t=t.toLowerCase(),e+(r?qs(t):t)}));function qs(e){return Xs(vs(e).toLowerCase())}function Hs(e){return(e=vs(e))&&e.replace(we,nr).replace(et,"")}var Ks=$i((function(e,t,r){return e+(r?"-":"")+t.toLowerCase()})),Js=$i((function(e,t,r){return e+(r?" ":"")+t.toLowerCase()})),Ws=Di("toLowerCase");var Gs=$i((function(e,t,r){return e+(r?"_":"")+t.toLowerCase()}));var Vs=$i((function(e,t,r){return e+(r?" ":"")+Xs(t)}));var Zs=$i((function(e,t,r){return e+(r?" ":"")+t.toUpperCase()})),Xs=Di("toUpperCase");function Qs(e,t,n){return e=vs(e),(t=n?r:t)===r?function(e){return it.test(e)}(e)?function(e){return e.match(rt)||[]}(e):function(e){return e.match(fe)||[]}(e):e.match(t)||[]}var Ys=Xn((function(e,t){try{return xt(e,r,t)}catch(e){return Xa(e)?e:new Se(e)}})),ec=no((function(e,t){return Mt(t,(function(t){t=Bo(t),an(e,t,Ia(e[t],e))})),e}));function tc(e){return function(){return e}}var rc=zi(),nc=zi(!0);function ic(e){return e}function oc(e){return Dn("function"==typeof e?e:un(e,1))}var ac=Xn((function(e,t){return function(r){return Rn(r,e,t)}})),sc=Xn((function(e,t){return function(r){return Rn(e,r,t)}}));function cc(e,t,r){var n=Ns(t),i=En(t,n);null!=r||ts(t)&&(i.length||!n.length)||(r=t,t=e,e=this,i=En(t,Ns(t)));var o=!(ts(r)&&"chain"in r&&!r.chain),a=Qa(e);return Mt(i,(function(r){var n=t[r];e[r]=n,a&&(e.prototype[r]=function(){var t=this.__chain__;if(o||t){var r=e(this.__wrapped__);return(r.__actions__=Ii(this.__actions__)).push({func:n,args:arguments,thisArg:e}),r.__chain__=t,r}return n.apply(e,jt([this.value()],arguments))})})),e}function uc(){}var fc=Hi(Tt),dc=Hi(It),lc=Hi(Bt);function hc(e){return _o(e)?Jt(Bo(e)):function(e){return function(t){return Sn(t,e)}}(e)}var pc=Ji(),mc=Ji(!0);function gc(){return[]}function yc(){return!1}var bc=qi((function(e,t){return e+t}),0),vc=Vi("ceil"),wc=qi((function(e,t){return e/t}),1),Ac=Vi("floor");var _c,Ec=qi((function(e,t){return e*t}),1),Sc=Vi("round"),Pc=qi((function(e,t){return e-t}),0);return zr.after=function(e,t){if("function"!=typeof t)throw new Ie(n);return e=ms(e),function(){if(--e<1)return t.apply(this,arguments)}},zr.ary=Ma,zr.assign=ws,zr.assignIn=As,zr.assignInWith=_s,zr.assignWith=Es,zr.at=Ss,zr.before=Ca,zr.bind=Ia,zr.bindAll=ec,zr.bindKey=Ra,zr.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Ka(e)?e:[e]},zr.chain=ha,zr.chunk=function(e,t,n){t=(n?Ao(e,t,n):t===r)?1:br(ms(t),0);var i=null==e?0:e.length;if(!i||t<1)return[];for(var o=0,a=0,s=ae(mt(i/t));oo?0:o+n),(i=i===r||i>o?o:ms(i))<0&&(i+=o),i=n>i?0:gs(i);n>>0)?(e=vs(e))&&("string"==typeof t||null!=t&&!as(t))&&!(t=fi(t))&&ar(e)?_i(hr(e),0,n):e.split(t,n):[]},zr.spread=function(e,t){if("function"!=typeof e)throw new Ie(n);return t=null==t?0:br(ms(t),0),Xn((function(r){var n=r[t],i=_i(r,0,t);return n&&jt(i,n),xt(e,this,i)}))},zr.tail=function(e){var t=null==e?0:e.length;return t?ii(e,1,t):[]},zr.take=function(e,t,n){return e&&e.length?ii(e,0,(t=n||t===r?1:ms(t))<0?0:t):[]},zr.takeRight=function(e,t,n){var i=null==e?0:e.length;return i?ii(e,(t=i-(t=n||t===r?1:ms(t)))<0?0:t,i):[]},zr.takeRightWhile=function(e,t){return e&&e.length?pi(e,uo(t,3),!1,!0):[]},zr.takeWhile=function(e,t){return e&&e.length?pi(e,uo(t,3)):[]},zr.tap=function(e,t){return t(e),e},zr.throttle=function(e,t,r){var i=!0,o=!0;if("function"!=typeof e)throw new Ie(n);return ts(r)&&(i="leading"in r?!!r.leading:i,o="trailing"in r?!!r.trailing:o),Na(e,t,{leading:i,maxWait:t,trailing:o})},zr.thru=pa,zr.toArray=hs,zr.toPairs=Fs,zr.toPairsIn=zs,zr.toPath=function(e){return Ka(e)?Tt(e,Bo):us(e)?[e]:Ii($o(vs(e)))},zr.toPlainObject=bs,zr.transform=function(e,t,r){var n=Ka(e),i=n||Va(e)||fs(e);if(t=uo(t,4),null==r){var o=e&&e.constructor;r=i?n?new o:[]:ts(e)&&Qa(o)?Ur(We(e)):{}}return(i?Mt:An)(e,(function(e,n,i){return t(r,e,n,i)})),r},zr.unary=function(e){return Ma(e,1)},zr.union=ra,zr.unionBy=na,zr.unionWith=ia,zr.uniq=function(e){return e&&e.length?di(e):[]},zr.uniqBy=function(e,t){return e&&e.length?di(e,uo(t,2)):[]},zr.uniqWith=function(e,t){return t="function"==typeof t?t:r,e&&e.length?di(e,r,t):[]},zr.unset=function(e,t){return null==e||li(e,t)},zr.unzip=oa,zr.unzipWith=aa,zr.update=function(e,t,r){return null==e?e:hi(e,t,vi(r))},zr.updateWith=function(e,t,n,i){return i="function"==typeof i?i:r,null==e?e:hi(e,t,vi(n),i)},zr.values=Us,zr.valuesIn=function(e){return null==e?[]:Yt(e,Os(e))},zr.without=sa,zr.words=Qs,zr.wrap=function(e,t){return Ba(vi(t),e)},zr.xor=ca,zr.xorBy=ua,zr.xorWith=fa,zr.zip=da,zr.zipObject=function(e,t){return yi(e||[],t||[],tn)},zr.zipObjectDeep=function(e,t){return yi(e||[],t||[],ei)},zr.zipWith=la,zr.entries=Fs,zr.entriesIn=zs,zr.extend=As,zr.extendWith=_s,cc(zr,zr),zr.add=bc,zr.attempt=Ys,zr.camelCase=Ls,zr.capitalize=qs,zr.ceil=vc,zr.clamp=function(e,t,n){return n===r&&(n=t,t=r),n!==r&&(n=(n=ys(n))==n?n:0),t!==r&&(t=(t=ys(t))==t?t:0),cn(ys(e),t,n)},zr.clone=function(e){return un(e,4)},zr.cloneDeep=function(e){return un(e,5)},zr.cloneDeepWith=function(e,t){return un(e,5,t="function"==typeof t?t:r)},zr.cloneWith=function(e,t){return un(e,4,t="function"==typeof t?t:r)},zr.conformsTo=function(e,t){return null==t||fn(e,t,Ns(t))},zr.deburr=Hs,zr.defaultTo=function(e,t){return null==e||e!=e?t:e},zr.divide=wc,zr.endsWith=function(e,t,n){e=vs(e),t=fi(t);var i=e.length,o=n=n===r?i:cn(ms(n),0,i);return(n-=t.length)>=0&&e.slice(n,o)==t},zr.eq=Ua,zr.escape=function(e){return(e=vs(e))&&Z.test(e)?e.replace(G,ir):e},zr.escapeRegExp=function(e){return(e=vs(e))&&ie.test(e)?e.replace(ne,"\\$&"):e},zr.every=function(e,t,n){var i=Ka(e)?It:mn;return n&&Ao(e,t,n)&&(t=r),i(e,uo(t,3))},zr.find=ya,zr.findIndex=Ho,zr.findKey=function(e,t){return zt(e,uo(t,3),An)},zr.findLast=ba,zr.findLastIndex=Ko,zr.findLastKey=function(e,t){return zt(e,uo(t,3),_n)},zr.floor=Ac,zr.forEach=va,zr.forEachRight=wa,zr.forIn=function(e,t){return null==e?e:vn(e,uo(t,3),Os)},zr.forInRight=function(e,t){return null==e?e:wn(e,uo(t,3),Os)},zr.forOwn=function(e,t){return e&&An(e,uo(t,3))},zr.forOwnRight=function(e,t){return e&&_n(e,uo(t,3))},zr.get=ks,zr.gt=La,zr.gte=qa,zr.has=function(e,t){return null!=e&&yo(e,t,Mn)},zr.hasIn=Ms,zr.head=Wo,zr.identity=ic,zr.includes=function(e,t,r,n){e=Wa(e)?e:Us(e),r=r&&!n?ms(r):0;var i=e.length;return r<0&&(r=br(i+r,0)),cs(e)?r<=i&&e.indexOf(t,r)>-1:!!i&&Lt(e,t,r)>-1},zr.indexOf=function(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var i=null==r?0:ms(r);return i<0&&(i=br(n+i,0)),Lt(e,t,i)},zr.inRange=function(e,t,n){return t=ps(t),n===r?(n=t,t=0):n=ps(n),function(e,t,r){return e>=vr(t,r)&&e=-9007199254740991&&e<=h},zr.isSet=ss,zr.isString=cs,zr.isSymbol=us,zr.isTypedArray=fs,zr.isUndefined=function(e){return e===r},zr.isWeakMap=function(e){return rs(e)&&go(e)==N},zr.isWeakSet=function(e){return rs(e)&&"[object WeakSet]"==xn(e)},zr.join=function(e,t){return null==e?"":Wt.call(e,t)},zr.kebabCase=Ks,zr.last=Xo,zr.lastIndexOf=function(e,t,n){var i=null==e?0:e.length;if(!i)return-1;var o=i;return n!==r&&(o=(o=ms(n))<0?br(i+o,0):vr(o,i-1)),t==t?function(e,t,r){for(var n=r+1;n--;)if(e[n]===t)return n;return n}(e,t,o):Ut(e,Ht,o,!0)},zr.lowerCase=Js,zr.lowerFirst=Ws,zr.lt=ds,zr.lte=ls,zr.max=function(e){return e&&e.length?gn(e,ic,kn):r},zr.maxBy=function(e,t){return e&&e.length?gn(e,uo(t,2),kn):r},zr.mean=function(e){return Kt(e,ic)},zr.meanBy=function(e,t){return Kt(e,uo(t,2))},zr.min=function(e){return e&&e.length?gn(e,ic,Fn):r},zr.minBy=function(e,t){return e&&e.length?gn(e,uo(t,2),Fn):r},zr.stubArray=gc,zr.stubFalse=yc,zr.stubObject=function(){return{}},zr.stubString=function(){return""},zr.stubTrue=function(){return!0},zr.multiply=Ec,zr.nth=function(e,t){return e&&e.length?Hn(e,ms(t)):r},zr.noConflict=function(){return pt._===this&&(pt._=Ue),this},zr.noop=uc,zr.now=ka,zr.pad=function(e,t,r){e=vs(e);var n=(t=ms(t))?lr(e):0;if(!t||n>=t)return e;var i=(t-n)/2;return Ki(gt(i),r)+e+Ki(mt(i),r)},zr.padEnd=function(e,t,r){e=vs(e);var n=(t=ms(t))?lr(e):0;return t&&nt){var i=e;e=t,t=i}if(n||e%1||t%1){var o=_r();return vr(e+o*(t-e+ft("1e-"+((o+"").length-1))),t)}return Vn(e,t)},zr.reduce=function(e,t,r){var n=Ka(e)?Dt:Gt,i=arguments.length<3;return n(e,uo(t,4),r,i,hn)},zr.reduceRight=function(e,t,r){var n=Ka(e)?$t:Gt,i=arguments.length<3;return n(e,uo(t,4),r,i,pn)},zr.repeat=function(e,t,n){return t=(n?Ao(e,t,n):t===r)?1:ms(t),Zn(vs(e),t)},zr.replace=function(){var e=arguments,t=vs(e[0]);return e.length<3?t:t.replace(e[1],e[2])},zr.result=function(e,t,n){var i=-1,o=(t=wi(t,e)).length;for(o||(o=1,e=r);++ih)return[];var r=m,n=vr(e,m);t=uo(t),e-=m;for(var i=Zt(n,t);++r=a)return e;var c=n-lr(i);if(c<1)return i;var u=s?_i(s,0,c).join(""):e.slice(0,c);if(o===r)return u+i;if(s&&(c+=u.length-c),as(o)){if(e.slice(c).search(o)){var f,d=u;for(o.global||(o=Me(o.source,vs(pe.exec(o))+"g")),o.lastIndex=0;f=o.exec(d);)var l=f.index;u=u.slice(0,l===r?c:l)}}else if(e.indexOf(fi(o),c)!=c){var h=u.lastIndexOf(o);h>-1&&(u=u.slice(0,h))}return u+i},zr.unescape=function(e){return(e=vs(e))&&V.test(e)?e.replace(W,mr):e},zr.uniqueId=function(e){var t=++$e;return vs(e)+t},zr.upperCase=Zs,zr.upperFirst=Xs,zr.each=va,zr.eachRight=wa,zr.first=Wo,cc(zr,(_c={},An(zr,(function(e,t){De.call(zr.prototype,t)||(_c[t]=e)})),_c),{chain:!1}),zr.VERSION="4.17.21",Mt(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){zr[e].placeholder=zr})),Mt(["drop","take"],(function(e,t){Hr.prototype[e]=function(n){n=n===r?1:br(ms(n),0);var i=this.__filtered__&&!t?new Hr(this):this.clone();return i.__filtered__?i.__takeCount__=vr(n,i.__takeCount__):i.__views__.push({size:vr(n,m),type:e+(i.__dir__<0?"Right":"")}),i},Hr.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),Mt(["filter","map","takeWhile"],(function(e,t){var r=t+1,n=1==r||3==r;Hr.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:uo(e,3),type:r}),t.__filtered__=t.__filtered__||n,t}})),Mt(["head","last"],(function(e,t){var r="take"+(t?"Right":"");Hr.prototype[e]=function(){return this[r](1).value()[0]}})),Mt(["initial","tail"],(function(e,t){var r="drop"+(t?"":"Right");Hr.prototype[e]=function(){return this.__filtered__?new Hr(this):this[r](1)}})),Hr.prototype.compact=function(){return this.filter(ic)},Hr.prototype.find=function(e){return this.filter(e).head()},Hr.prototype.findLast=function(e){return this.reverse().find(e)},Hr.prototype.invokeMap=Xn((function(e,t){return"function"==typeof e?new Hr(this):this.map((function(r){return Rn(r,e,t)}))})),Hr.prototype.reject=function(e){return this.filter(Da(uo(e)))},Hr.prototype.slice=function(e,t){e=ms(e);var n=this;return n.__filtered__&&(e>0||t<0)?new Hr(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==r&&(n=(t=ms(t))<0?n.dropRight(-t):n.take(t-e)),n)},Hr.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Hr.prototype.toArray=function(){return this.take(m)},An(Hr.prototype,(function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),i=/^(?:head|last)$/.test(t),o=zr[i?"take"+("last"==t?"Right":""):t],a=i||/^find/.test(t);o&&(zr.prototype[t]=function(){var t=this.__wrapped__,s=i?[1]:arguments,c=t instanceof Hr,u=s[0],f=c||Ka(t),d=function(e){var t=o.apply(zr,jt([e],s));return i&&l?t[0]:t};f&&n&&"function"==typeof u&&1!=u.length&&(c=f=!1);var l=this.__chain__,h=!!this.__actions__.length,p=a&&!l,m=c&&!h;if(!a&&f){t=m?t:new Hr(this);var g=e.apply(t,s);return g.__actions__.push({func:pa,args:[d],thisArg:r}),new qr(g,l)}return p&&m?e.apply(this,s):(g=this.thru(d),p?i?g.value()[0]:g.value():g)})})),Mt(["pop","push","shift","sort","splice","unshift"],(function(e){var t=Re[e],r=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",n=/^(?:pop|shift)$/.test(e);zr.prototype[e]=function(){var e=arguments;if(n&&!this.__chain__){var i=this.value();return t.apply(Ka(i)?i:[],e)}return this[r]((function(r){return t.apply(Ka(r)?r:[],e)}))}})),An(Hr.prototype,(function(e,t){var r=zr[t];if(r){var n=r.name+"";De.call(Rr,n)||(Rr[n]=[]),Rr[n].push({name:t,func:r})}})),Rr[Ui(r,2).name]=[{name:"wrapper",func:r}],Hr.prototype.clone=function(){var e=new Hr(this.__wrapped__);return e.__actions__=Ii(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Ii(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Ii(this.__views__),e},Hr.prototype.reverse=function(){if(this.__filtered__){var e=new Hr(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Hr.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,r=Ka(e),n=t<0,i=r?e.length:0,o=function(e,t,r){var n=-1,i=r.length;for(;++n=this.__values__.length;return{done:e,value:e?r:this.__values__[this.__index__++]}},zr.prototype.plant=function(e){for(var t,n=this;n instanceof Lr;){var i=zo(n);i.__index__=0,i.__values__=r,t?o.__wrapped__=i:t=i;var o=i;n=n.__wrapped__}return o.__wrapped__=e,t},zr.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Hr){var t=e;return this.__actions__.length&&(t=new Hr(this)),(t=t.reverse()).__actions__.push({func:pa,args:[ta],thisArg:r}),new qr(t,this.__chain__)}return this.thru(ta)},zr.prototype.toJSON=zr.prototype.valueOf=zr.prototype.value=function(){return mi(this.__wrapped__,this.__actions__)},zr.prototype.first=zr.prototype.head,Qe&&(zr.prototype[Qe]=function(){return this}),zr}();gt?((gt.exports=gr)._=gr,mt._=gr):pt._=gr}).call(s)}(Vw,Vw.exports);var Zw=c(Vw.exports),Xw={id:"https://spec.openapis.org/oas/3.0/schema/2021-09-28",$schema:"http://json-schema.org/draft-04/schema#",description:"The description of OpenAPI v3.0.x documents, as defined by https://spec.openapis.org/oas/v3.0.3",type:"object",required:["openapi","info","paths"],properties:{openapi:{type:"string",pattern:"^3\\.0\\.\\d(-.+)?$"},info:{$ref:"#/definitions/Info"},externalDocs:{$ref:"#/definitions/ExternalDocumentation"},servers:{type:"array",items:{$ref:"#/definitions/Server"}},security:{type:"array",items:{$ref:"#/definitions/SecurityRequirement"}},tags:{type:"array",items:{$ref:"#/definitions/Tag"},uniqueItems:!0},paths:{$ref:"#/definitions/Paths"},components:{$ref:"#/definitions/Components"}},patternProperties:{"^x-":{}},additionalProperties:!1,definitions:{Reference:{type:"object",required:["$ref"],patternProperties:{"^\\$ref$":{type:"string",format:"uri-reference"}}},Info:{type:"object",required:["title","version"],properties:{title:{type:"string"},description:{type:"string"},termsOfService:{type:"string",format:"uri-reference"},contact:{$ref:"#/definitions/Contact"},license:{$ref:"#/definitions/License"},version:{type:"string"}},patternProperties:{"^x-":{}},additionalProperties:!1},Contact:{type:"object",properties:{name:{type:"string"},url:{type:"string",format:"uri-reference"},email:{type:"string",format:"email"}},patternProperties:{"^x-":{}},additionalProperties:!1},License:{type:"object",required:["name"],properties:{name:{type:"string"},url:{type:"string",format:"uri-reference"}},patternProperties:{"^x-":{}},additionalProperties:!1},Server:{type:"object",required:["url"],properties:{url:{type:"string"},description:{type:"string"},variables:{type:"object",additionalProperties:{$ref:"#/definitions/ServerVariable"}}},patternProperties:{"^x-":{}},additionalProperties:!1},ServerVariable:{type:"object",required:["default"],properties:{enum:{type:"array",items:{type:"string"}},default:{type:"string"},description:{type:"string"}},patternProperties:{"^x-":{}},additionalProperties:!1},Components:{type:"object",properties:{schemas:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]}}},responses:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/Response"}]}}},parameters:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/Parameter"}]}}},examples:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/Example"}]}}},requestBodies:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/RequestBody"}]}}},headers:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/Header"}]}}},securitySchemes:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/SecurityScheme"}]}}},links:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/Link"}]}}},callbacks:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/Callback"}]}}}},patternProperties:{"^x-":{}},additionalProperties:!1},Schema:{type:"object",properties:{title:{type:"string"},multipleOf:{type:"number",minimum:0,exclusiveMinimum:!0},maximum:{type:"number"},exclusiveMaximum:{type:"boolean",default:!1},minimum:{type:"number"},exclusiveMinimum:{type:"boolean",default:!1},maxLength:{type:"integer",minimum:0},minLength:{type:"integer",minimum:0,default:0},pattern:{type:"string",format:"regex"},maxItems:{type:"integer",minimum:0},minItems:{type:"integer",minimum:0,default:0},uniqueItems:{type:"boolean",default:!1},maxProperties:{type:"integer",minimum:0},minProperties:{type:"integer",minimum:0,default:0},required:{type:"array",items:{type:"string"},minItems:1,uniqueItems:!0},enum:{type:"array",items:{},minItems:1,uniqueItems:!1},type:{type:"string",enum:["array","boolean","integer","number","object","string"]},not:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]},allOf:{type:"array",items:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]}},oneOf:{type:"array",items:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]}},anyOf:{type:"array",items:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]}},items:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]},properties:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]}},additionalProperties:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"},{type:"boolean"}],default:!0},description:{type:"string"},format:{type:"string"},default:{},nullable:{type:"boolean",default:!1},discriminator:{$ref:"#/definitions/Discriminator"},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},example:{},externalDocs:{$ref:"#/definitions/ExternalDocumentation"},deprecated:{type:"boolean",default:!1},xml:{$ref:"#/definitions/XML"}},patternProperties:{"^x-":{}},additionalProperties:!1},Discriminator:{type:"object",required:["propertyName"],properties:{propertyName:{type:"string"},mapping:{type:"object",additionalProperties:{type:"string"}}}},XML:{type:"object",properties:{name:{type:"string"},namespace:{type:"string",format:"uri"},prefix:{type:"string"},attribute:{type:"boolean",default:!1},wrapped:{type:"boolean",default:!1}},patternProperties:{"^x-":{}},additionalProperties:!1},Response:{type:"object",required:["description"],properties:{description:{type:"string"},headers:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Header"},{$ref:"#/definitions/Reference"}]}},content:{type:"object",additionalProperties:{$ref:"#/definitions/MediaType"}},links:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Link"},{$ref:"#/definitions/Reference"}]}}},patternProperties:{"^x-":{}},additionalProperties:!1},MediaType:{type:"object",properties:{schema:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]},example:{},examples:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Example"},{$ref:"#/definitions/Reference"}]}},encoding:{type:"object",additionalProperties:{$ref:"#/definitions/Encoding"}}},patternProperties:{"^x-":{}},additionalProperties:!1,allOf:[{$ref:"#/definitions/ExampleXORExamples"}]},Example:{type:"object",properties:{summary:{type:"string"},description:{type:"string"},value:{},externalValue:{type:"string",format:"uri-reference"}},patternProperties:{"^x-":{}},additionalProperties:!1},Header:{type:"object",properties:{description:{type:"string"},required:{type:"boolean",default:!1},deprecated:{type:"boolean",default:!1},allowEmptyValue:{type:"boolean",default:!1},style:{type:"string",enum:["simple"],default:"simple"},explode:{type:"boolean"},allowReserved:{type:"boolean",default:!1},schema:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]},content:{type:"object",additionalProperties:{$ref:"#/definitions/MediaType"},minProperties:1,maxProperties:1},example:{},examples:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Example"},{$ref:"#/definitions/Reference"}]}}},patternProperties:{"^x-":{}},additionalProperties:!1,allOf:[{$ref:"#/definitions/ExampleXORExamples"},{$ref:"#/definitions/SchemaXORContent"}]},Paths:{type:"object",patternProperties:{"^\\/":{$ref:"#/definitions/PathItem"},"^x-":{}},additionalProperties:!1},PathItem:{type:"object",properties:{$ref:{type:"string"},summary:{type:"string"},description:{type:"string"},servers:{type:"array",items:{$ref:"#/definitions/Server"}},parameters:{type:"array",items:{oneOf:[{$ref:"#/definitions/Parameter"},{$ref:"#/definitions/Reference"}]},uniqueItems:!0}},patternProperties:{"^(get|put|post|delete|options|head|patch|trace)$":{$ref:"#/definitions/Operation"},"^x-":{}},additionalProperties:!1},Operation:{type:"object",required:["responses"],properties:{tags:{type:"array",items:{type:"string"}},summary:{type:"string"},description:{type:"string"},externalDocs:{$ref:"#/definitions/ExternalDocumentation"},operationId:{type:"string"},parameters:{type:"array",items:{oneOf:[{$ref:"#/definitions/Parameter"},{$ref:"#/definitions/Reference"}]},uniqueItems:!0},requestBody:{oneOf:[{$ref:"#/definitions/RequestBody"},{$ref:"#/definitions/Reference"}]},responses:{$ref:"#/definitions/Responses"},callbacks:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Callback"},{$ref:"#/definitions/Reference"}]}},deprecated:{type:"boolean",default:!1},security:{type:"array",items:{$ref:"#/definitions/SecurityRequirement"}},servers:{type:"array",items:{$ref:"#/definitions/Server"}}},patternProperties:{"^x-":{}},additionalProperties:!1},Responses:{type:"object",properties:{default:{oneOf:[{$ref:"#/definitions/Response"},{$ref:"#/definitions/Reference"}]}},patternProperties:{"^[1-5](?:\\d{2}|XX)$":{oneOf:[{$ref:"#/definitions/Response"},{$ref:"#/definitions/Reference"}]},"^x-":{}},minProperties:1,additionalProperties:!1},SecurityRequirement:{type:"object",additionalProperties:{type:"array",items:{type:"string"}}},Tag:{type:"object",required:["name"],properties:{name:{type:"string"},description:{type:"string"},externalDocs:{$ref:"#/definitions/ExternalDocumentation"}},patternProperties:{"^x-":{}},additionalProperties:!1},ExternalDocumentation:{type:"object",required:["url"],properties:{description:{type:"string"},url:{type:"string",format:"uri-reference"}},patternProperties:{"^x-":{}},additionalProperties:!1},ExampleXORExamples:{description:"Example and examples are mutually exclusive",not:{required:["example","examples"]}},SchemaXORContent:{description:"Schema and content are mutually exclusive, at least one is required",not:{required:["schema","content"]},oneOf:[{required:["schema"]},{required:["content"],description:"Some properties are not allowed if content is present",allOf:[{not:{required:["style"]}},{not:{required:["explode"]}},{not:{required:["allowReserved"]}},{not:{required:["example"]}},{not:{required:["examples"]}}]}]},Parameter:{type:"object",properties:{name:{type:"string"},in:{type:"string"},description:{type:"string"},required:{type:"boolean",default:!1},deprecated:{type:"boolean",default:!1},allowEmptyValue:{type:"boolean",default:!1},style:{type:"string"},explode:{type:"boolean"},allowReserved:{type:"boolean",default:!1},schema:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]},content:{type:"object",additionalProperties:{$ref:"#/definitions/MediaType"},minProperties:1,maxProperties:1},example:{},examples:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Example"},{$ref:"#/definitions/Reference"}]}}},patternProperties:{"^x-":{}},additionalProperties:!1,required:["name","in"],allOf:[{$ref:"#/definitions/ExampleXORExamples"},{$ref:"#/definitions/SchemaXORContent"},{$ref:"#/definitions/ParameterLocation"}]},ParameterLocation:{description:"Parameter location",oneOf:[{description:"Parameter in path",required:["required"],properties:{in:{enum:["path"]},style:{enum:["matrix","label","simple"],default:"simple"},required:{enum:[!0]}}},{description:"Parameter in query",properties:{in:{enum:["query"]},style:{enum:["form","spaceDelimited","pipeDelimited","deepObject"],default:"form"}}},{description:"Parameter in header",properties:{in:{enum:["header"]},style:{enum:["simple"],default:"simple"}}},{description:"Parameter in cookie",properties:{in:{enum:["cookie"]},style:{enum:["form"],default:"form"}}}]},RequestBody:{type:"object",required:["content"],properties:{description:{type:"string"},content:{type:"object",additionalProperties:{$ref:"#/definitions/MediaType"}},required:{type:"boolean",default:!1}},patternProperties:{"^x-":{}},additionalProperties:!1},SecurityScheme:{oneOf:[{$ref:"#/definitions/APIKeySecurityScheme"},{$ref:"#/definitions/HTTPSecurityScheme"},{$ref:"#/definitions/OAuth2SecurityScheme"},{$ref:"#/definitions/OpenIdConnectSecurityScheme"}]},APIKeySecurityScheme:{type:"object",required:["type","name","in"],properties:{type:{type:"string",enum:["apiKey"]},name:{type:"string"},in:{type:"string",enum:["header","query","cookie"]},description:{type:"string"}},patternProperties:{"^x-":{}},additionalProperties:!1},HTTPSecurityScheme:{type:"object",required:["scheme","type"],properties:{scheme:{type:"string"},bearerFormat:{type:"string"},description:{type:"string"},type:{type:"string",enum:["http"]}},patternProperties:{"^x-":{}},additionalProperties:!1,oneOf:[{description:"Bearer",properties:{scheme:{type:"string",pattern:"^[Bb][Ee][Aa][Rr][Ee][Rr]$"}}},{description:"Non Bearer",not:{required:["bearerFormat"]},properties:{scheme:{not:{type:"string",pattern:"^[Bb][Ee][Aa][Rr][Ee][Rr]$"}}}}]},OAuth2SecurityScheme:{type:"object",required:["type","flows"],properties:{type:{type:"string",enum:["oauth2"]},flows:{$ref:"#/definitions/OAuthFlows"},description:{type:"string"}},patternProperties:{"^x-":{}},additionalProperties:!1},OpenIdConnectSecurityScheme:{type:"object",required:["type","openIdConnectUrl"],properties:{type:{type:"string",enum:["openIdConnect"]},openIdConnectUrl:{type:"string",format:"uri-reference"},description:{type:"string"}},patternProperties:{"^x-":{}},additionalProperties:!1},OAuthFlows:{type:"object",properties:{implicit:{$ref:"#/definitions/ImplicitOAuthFlow"},password:{$ref:"#/definitions/PasswordOAuthFlow"},clientCredentials:{$ref:"#/definitions/ClientCredentialsFlow"},authorizationCode:{$ref:"#/definitions/AuthorizationCodeOAuthFlow"}},patternProperties:{"^x-":{}},additionalProperties:!1},ImplicitOAuthFlow:{type:"object",required:["authorizationUrl","scopes"],properties:{authorizationUrl:{type:"string",format:"uri-reference"},refreshUrl:{type:"string",format:"uri-reference"},scopes:{type:"object",additionalProperties:{type:"string"}}},patternProperties:{"^x-":{}},additionalProperties:!1},PasswordOAuthFlow:{type:"object",required:["tokenUrl","scopes"],properties:{tokenUrl:{type:"string",format:"uri-reference"},refreshUrl:{type:"string",format:"uri-reference"},scopes:{type:"object",additionalProperties:{type:"string"}}},patternProperties:{"^x-":{}},additionalProperties:!1},ClientCredentialsFlow:{type:"object",required:["tokenUrl","scopes"],properties:{tokenUrl:{type:"string",format:"uri-reference"},refreshUrl:{type:"string",format:"uri-reference"},scopes:{type:"object",additionalProperties:{type:"string"}}},patternProperties:{"^x-":{}},additionalProperties:!1},AuthorizationCodeOAuthFlow:{type:"object",required:["authorizationUrl","tokenUrl","scopes"],properties:{authorizationUrl:{type:"string",format:"uri-reference"},tokenUrl:{type:"string",format:"uri-reference"},refreshUrl:{type:"string",format:"uri-reference"},scopes:{type:"object",additionalProperties:{type:"string"}}},patternProperties:{"^x-":{}},additionalProperties:!1},Link:{type:"object",properties:{operationId:{type:"string"},operationRef:{type:"string",format:"uri-reference"},parameters:{type:"object",additionalProperties:{}},requestBody:{},description:{type:"string"},server:{$ref:"#/definitions/Server"}},patternProperties:{"^x-":{}},additionalProperties:!1,not:{description:"Operation Id and Operation Ref are mutually exclusive",required:["operationId","operationRef"]}},Callback:{type:"object",additionalProperties:{$ref:"#/definitions/PathItem"},patternProperties:{"^x-":{}}},Encoding:{type:"object",properties:{contentType:{type:"string"},headers:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Header"},{$ref:"#/definitions/Reference"}]}},style:{type:"string",enum:["form","spaceDelimited","pipeDelimited","deepObject"]},explode:{type:"boolean"},allowReserved:{type:"boolean",default:!1}},additionalProperties:!1}}};function Qw(e){if(new Date(e).getTime()>0)return Number(e);throw new nn(new Error("invalid timestamp"),["invalid timestamp"])}async function Yw(e){const t=[],r=Object.keys(e);(r.length<10||r.length>11)&&t.push(new nn(new Error("Invalid agreeemt: "+JSON.stringify(e,void 0,2)),["invalid format"]));for(const n of r){let r;switch(n){case"orig":case"dest":try{e[n]!==await io(JSON.parse(e[n]),!0)&&t.push(new nn(`[dataExchangeAgreeement.${n}] A valid stringified JWK must be provided. For uniqueness, JWK claims must be alphabetically sorted in the stringified JWK. You can use the parseJWK(jwk, true) for that purpose.\n${e[n]}`,["invalid key","invalid format"]))}catch(e){t.push(new nn(`[dataExchangeAgreeement.${n}] A valid stringified JWK must be provided. For uniqueness, JWK claims must be alphabetically sorted in the stringified JWK. You can use the parseJWK(jwk, true) for that purpose.`,["invalid key","invalid format"]))}break;case"ledgerContractAddress":case"ledgerSignerAddress":try{r=Uh(e[n]),e[n]!==r&&t.push(new nn(`[dataExchangeAgreeement.${n}] Invalid EIP-55 address ${e[n]}. Did you mean ${r} instead?`,["invalid EIP-55 address","invalid format"]))}catch(r){t.push(new nn(`[dataExchangeAgreeement.${n}] Invalid EIP-55 address ${e[n]}.`,["invalid EIP-55 address","invalid format"]))}break;case"pooToPorDelay":case"pooToPopDelay":case"pooToSecretDelay":try{e[n]!==Qw(e[n])&&t.push(new nn(`[dataExchangeAgreeement.${n}] < 0 or not a number`,["invalid timestamp","invalid format"]))}catch(e){t.push(new nn(`[dataExchangeAgreeement.${n}] < 0 or not a number`,["invalid timestamp","invalid format"]))}break;case"hashAlg":Yr.includes(e[n])||t.push(new nn(`[dataExchangeAgreeement.${n}Invalid hash algorithm '${e[n]}'. It must be one of: ${Yr.join(", ")}`,["invalid algorithm"]));break;case"encAlg":tn.includes(e[n])||t.push(new nn(`[dataExchangeAgreeement.${n}Invalid encryption algorithm '${e[n]}'. It must be one of: ${tn.join(", ")}`,["invalid algorithm"]));break;case"signingAlg":en.includes(e[n])||t.push(new nn(`[dataExchangeAgreeement.${n}Invalid signing algorithm '${e[n]}'. It must be one of: ${en.join(", ")}`,["invalid algorithm"]));break;case"schema":break;default:t.push(new nn(new Error(`Property ${n} not allowed in dataAgreement`),["invalid format"]))}}return t}var eA=Object.freeze({__proto__:null,NonRepudiationDest:class{constructor(e,t,r){this.initialized=new Promise(((n,i)=>{this.asyncConstructor(e,t,r).then((()=>{n(!0)})).catch((e=>{i(e)}))}))}async asyncConstructor(e,t,r){const n=await Yw(e);if(n.length>0){const e=[];let t=[];throw n.forEach((r=>{e.push(r.message),t=t.concat(r.nrErrors)})),t=[...new Set(t)],new nn("Resource has not been validated:\n"+e.join("\n"),t)}this.agreement=e,this.jwkPairDest={privateJwk:t,publicJwk:JSON.parse(e.dest)},this.publicJwkOrig=JSON.parse(e.orig),await Xi(this.jwkPairDest.publicJwk,this.jwkPairDest.privateJwk),this.dltAgent=r;const i=await this.dltAgent.getContractAddress();if(this.agreement.ledgerContractAddress!==i)throw new Error(`Contract address ${i} does not meet agreed one ${this.agreement.ledgerContractAddress}`);this.block={}}async verifyPoO(e,r,n){await this.initialized;const i=t(await oo(r,this.agreement.hashAlg),!0,!1),{payload:o}=await Gi(e),a={...this.agreement,cipherblockDgst:i,blockCommitment:o.exchange.blockCommitment,secretCommitment:o.exchange.secretCommitment},s={proofType:"PoO",iss:"orig",exchange:{...a,id:await Lh(a)}},c={timestamp:Date.now(),notBefore:"iat",notAfter:"iat",...n},u=await Hh(e,s,c);return this.block={jwe:r,poo:{jws:e,payload:u.payload}},this.exchange=u.payload.exchange,u}async generatePoR(){if(await this.initialized,void 0===this.exchange||void 0===this.block.poo)throw new Error("Before computing a PoR, you have first to receive a valid cipherblock with a PoO and validate the PoO");const e={proofType:"PoR",iss:"dest",exchange:this.exchange,poo:this.block.poo.jws};return this.block.por=await qh(e,this.jwkPairDest.privateJwk),this.block.por}async verifyPoP(e,t){if(await this.initialized,void 0===this.exchange||void 0===this.block.por||void 0===this.block.poo)throw new Error("Cannot verify a PoP if not even a PoR have been created");const n={proofType:"PoP",iss:"orig",exchange:this.exchange,por:this.block.por.jws,secret:"",verificationCode:""},o={timestamp:Date.now(),notBefore:"iat",notAfter:1e3*this.block.poo.payload.iat+this.exchange.pooToPopDelay,...t},a=await Hh(e,n,o),s=JSON.parse(a.payload.secret);return this.block.secret={hex:i(r(s.k)),jwk:s},this.block.pop={jws:e,payload:a.payload},a}async getSecretFromLedger(){if(await this.initialized,void 0===this.exchange||void 0===this.block.poo||void 0===this.block.por)throw new Error("Cannot get secret if a PoR has not been sent before");const e=Date.now(),t=1e3*this.block.poo.payload.iat+this.agreement.pooToSecretDelay,r=Math.round((t-e)/1e3),{hex:n,iat:i}=await this.dltAgent.getSecretFromLedger(Vi(this.agreement.encAlg),this.agreement.ledgerSignerAddress,this.exchange.id,r);this.block.secret=await Zi(this.exchange.encAlg,n);try{to(1e3*i,1e3*this.block.por.payload.iat,1e3*this.block.poo.payload.iat+this.exchange.pooToSecretDelay)}catch(e){throw new nn(`Although the secret has been obtained (and you could try to decrypt the cipherblock), it's been published later than agreed: ${new Date(1e3*i).toUTCString()} > ${new Date(1e3*this.block.poo.payload.iat+this.agreement.pooToSecretDelay).toUTCString()}`,["secret not published in time"])}return this.block.secret}async decrypt(){if(await this.initialized,void 0===this.exchange)throw new Error("No agreed exchange");if(void 0===this.block.secret?.jwk)throw new Error("Cannot decrypt without the secret");if(void 0===this.block.jwe)throw new Error("No cipherblock to decrypt");const e=(await Wi(this.block.jwe,this.block.secret.jwk)).plaintext;if(t(await oo(e,this.agreement.hashAlg),!0,!1)!==this.exchange.blockCommitment)throw new Error("Decrypted block does not meet the committed one");return this.block.raw=e,e}async generateVerificationRequest(){if(await this.initialized,void 0===this.block.por||void 0===this.exchange)throw new Error("Before generating a VerificationRequest, you have first to hold a valid PoR for the exchange");return await Vh("dest",this.exchange.id,this.block.por.jws,this.jwkPairDest.privateJwk)}async generateDisputeRequest(){if(await this.initialized,void 0===this.block.por||void 0===this.block.jwe||void 0===this.exchange)throw new Error("Before generating a VerificationRequest, you have first to hold a valid PoR for the exchange and have received the cipherblock");const e={proofType:"request",iss:"dest",por:this.block.por.jws,type:"disputeRequest",cipherblock:this.block.jwe,iat:Math.floor(Date.now()/1e3),dataExchangeId:this.exchange.id},t=await Ki(this.jwkPairDest.privateJwk);try{return await new Li(e).setProtectedHeader({alg:this.jwkPairDest.privateJwk.alg}).setIssuedAt(e.iat).sign(t)}catch(e){throw new nn(e,["unexpected error"])}}},NonRepudiationOrig:class{constructor(e,t,r,n){this.jwkPairOrig={privateJwk:t,publicJwk:JSON.parse(e.orig)},this.publicJwkDest=JSON.parse(e.dest),this.block={raw:r},this.initialized=new Promise(((t,r)=>{this.init(e,n).then((()=>{t(!0)})).catch((e=>{r(e)}))}))}async init(e,r){const n=await Yw(e);if(n.length>0){const e=[];let t=[];throw n.forEach((r=>{e.push(r.message),t=t.concat(r.nrErrors)})),t=[...new Set(t)],new nn("Resource has not been validated:\n"+e.join("\n"),t)}this.agreement=e,await Xi(this.jwkPairOrig.publicJwk,this.jwkPairOrig.privateJwk);const i=await Zi(this.agreement.encAlg);this.block={...this.block,secret:i,jwe:await Ji(this.block.raw,i.jwk,this.agreement.encAlg)};const a=t(await oo(this.block.jwe,this.agreement.hashAlg),!0,!1),s=t(await oo(this.block.raw,this.agreement.hashAlg),!0,!1),c=t(await oo(new Uint8Array(o(this.block.secret.hex)),this.agreement.hashAlg),!0,!1),u={...this.agreement,cipherblockDgst:a,blockCommitment:s,secretCommitment:c},f=await Lh(u);this.exchange={...u,id:f},await this._dltSetup(r)}async _dltSetup(e){this.dltAgent=e;const t=await this.dltAgent.getAddress();if(t!==this.exchange.ledgerSignerAddress)throw new Error(`ledgerSignerAddress: ${this.exchange.ledgerSignerAddress} does not meet the address ${t} derived from the provided private key`);const r=await this.dltAgent.getContractAddress();if(r!==no(this.agreement.ledgerContractAddress,!0))throw new Error(`Contract address in use ${r} does not meet the agreed one ${this.agreement.ledgerContractAddress}`)}async generatePoO(){return await this.initialized,this.block.poo=await qh({proofType:"PoO",iss:"orig",exchange:this.exchange},this.jwkPairOrig.privateJwk),this.block.poo}async verifyPoR(e,t){if(await this.initialized,void 0===this.block.poo)throw new Error("Cannot verify a PoR if not even a PoO have been created");const r={proofType:"PoR",iss:"dest",exchange:this.exchange,poo:this.block.poo.jws},n=1e3*this.block.poo.payload.iat,i={timestamp:Date.now(),notBefore:n,notAfter:n+this.exchange.pooToPorDelay,...t},o=await Hh(e,r,i);return this.block.por={jws:e,payload:o.payload},this.block.por}async generatePoP(){if(await this.initialized,void 0===this.block.por)throw new Error("Before computing a PoP, you have first to have received and verified the PoR");const e=await this.dltAgent.deploySecret(this.block.secret.hex,this.exchange.id),t={proofType:"PoP",iss:"orig",exchange:this.exchange,por:this.block.por.jws,secret:JSON.stringify(this.block.secret.jwk),verificationCode:e};return this.block.pop=await qh(t,this.jwkPairOrig.privateJwk),this.block.pop}async generateVerificationRequest(){if(await this.initialized,void 0===this.block.por)throw new Error("Before generating a VerificationRequest, you have first to hold a valid PoR for the exchange");return await Vh("orig",this.exchange.id,this.block.por.jws,this.jwkPairOrig.privateJwk)}}});return e.ConflictResolution=Zh,e.ENC_ALGS=tn,e.EthersIoAgentDest=rp,e.EthersIoAgentOrig=Cp,e.HASH_ALGS=Yr,e.I3mServerWalletAgentDest=ap,e.I3mServerWalletAgentOrig=Rp,e.I3mWalletAgentDest=ip,e.I3mWalletAgentOrig=Ip,e.KEY_AGREEMENT_ALGS=rn,e.NonRepudiationProtocol=eA,e.NrError=nn,e.SIGNING_ALGS=en,e.Signers=Np,e.checkTimestamp=to,e.createProof=qh,e.defaultDltConfig=Xh,e.exchangeId=Lh,e.generateKeys=async function(e,n,i){if(!en.includes(e))throw new nn(new RangeError(`Invalid signature algorithm '${e}''. Allowed algorithms are ${en.toString()}`),["invalid algorithm"]);let s,c,u;switch(e){case"ES512":c="P-521",s=66;break;case"ES384":c="P-384",s=48;break;default:c="P-256",s=32}u=void 0!==n?"string"==typeof n?!0===i?r(n):new Uint8Array(o(n)):n:new Uint8Array(await a(s));const f=new on("p"+c.substring(c.length-3)).keyFromPrivate(u),d=f.getPublic(),l=d.getX().toString("hex").padStart(2*s,"0"),h=d.getY().toString("hex").padStart(2*s,"0"),p=f.getPrivate("hex").padStart(2*s,"0"),m={kty:"EC",crv:c,x:t(o(l),!0,!1),y:t(o(h),!0,!1),d:t(o(p),!0,!1),alg:e},g={...m};return delete g.d,{publicJwk:g,privateJwk:m}},e.getDltAddress=function(e){const t=e.match(/^did:ethr:(\w+:)?(0x[0-9a-fA-F]{40}[0-9a-fA-F]{26}?)$/),r=null!==t?t[t.length-1]:e;try{return xf(r)}catch(e){throw new nn("no a DID or a valid public or private key",["invalid format"])}},e.importJwk=Ki,e.jsonSort=ro,e.jweDecrypt=Wi,e.jweEncrypt=Ji,e.jwsDecode=Gi,e.oneTimeSecret=Zi,e.parseAddress=Uh,e.parseHex=no,e.parseJwk=io,e.sha=oo,e.validateDataExchange=async function(e){const t=[];try{const{id:r,...n}=e;r!==await Lh(n)&&t.push(new nn("Invalid dataExchange id",["cannot verify","invalid format"]));const{blockCommitment:i,secretCommitment:o,cipherblockDgst:a,...s}=n,c=await Yw(s);c.length>0&&c.forEach((e=>{t.push(e)}))}catch(e){t.push(new nn("Invalid dataExchange",["cannot verify","invalid format"]))}return t},e.validateDataExchangeAgreement=Yw,e.validateDataSharingAgreementSchema=async function(e){const t=[],r=new lw({strictSchema:!1,removeAdditional:"all"});r.addMetaSchema(Xw),Gw(r);const n=Op.schemas.DataSharingAgreement;try{const i=r.compile(n),o=Zw.cloneDeep(e);i(e)||null!==i.errors&&void 0!==i.errors&&i.errors.length>0&&i.errors.forEach((e=>{t.push(new nn(`[${e.instancePath}] ${e.message??"unknown"}`,["invalid format"]))})),eo(o)!==eo(e)&&t.push(new nn("Additional claims beyond the schema are not supported",["invalid format"]))}catch(e){t.push(new nn(e,["invalid format"]))}return t},e.verifyKeyPair=Xi,e.verifyProof=Hh,e}({}); + deps: ${n}}`};const i={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(e){const[t,r]=function({schema:e}){const t={},r={};for(const n in e){if("__proto__"===n)continue;(Array.isArray(e[n])?t:r)[n]=e[n]}return[t,r]}(e);o(e,t),a(e,r)}};function o(e,r=e.schema){const{gen:i,data:o,it:a}=e;if(0===Object.keys(r).length)return;const s=i.let("missing");for(const c in r){const u=r[c];if(0===u.length)continue;const f=(0,n.propertyInData)(i,o,c,a.opts.ownProperties);e.setParams({property:c,depsCount:u.length,deps:u.join(", ")}),a.allErrors?i.if(f,(()=>{for(const t of u)(0,n.checkReportMissingProp)(e,t)})):(i.if(t._`${f} && (${(0,n.checkMissingProp)(e,u,s)})`),(0,n.reportMissingProp)(e,s),i.else())}}function a(e,t=e.schema){const{gen:i,data:o,keyword:a,it:s}=e,c=i.name("valid");for(const u in t)(0,r.alwaysValidSchema)(s,t[u])||(i.if((0,n.propertyInData)(i,o,u,s.opts.ownProperties),(()=>{const t=e.subschema({keyword:a,schemaProp:u},c);e.mergeValidEvaluated(t,c)}),(()=>i.var(c,!0))),e.ok(c))}e.validatePropertyDeps=o,e.validateSchemaDeps=a,e.default=i}(Jb);var Wb={};Object.defineProperty(Wb,"__esModule",{value:!0});const Gb=Up,Vb=Hp,Zb={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:e})=>Gb._`{propertyName: ${e.propertyName}}`},code(e){const{gen:t,schema:r,data:n,it:i}=e;if((0,Vb.alwaysValidSchema)(i,r))return;const o=t.name("valid");t.forIn("key",n,(r=>{e.setParams({propertyName:r}),e.subschema({keyword:"propertyNames",data:r,dataTypes:["string"],propertyName:r,compositeRule:!0},o),t.if((0,Gb.not)(o),(()=>{e.error(!0),i.allErrors||t.break()}))})),e.ok(o)}};Wb.default=Zb;var Xb={};Object.defineProperty(Xb,"__esModule",{value:!0});const Qb=fm,Yb=Up,ev=Kp,tv=Hp,rv={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:e})=>Yb._`{additionalProperty: ${e.additionalProperty}}`},code(e){const{gen:t,schema:r,parentSchema:n,data:i,errsCount:o,it:a}=e;if(!o)throw new Error("ajv implementation error");const{allErrors:s,opts:c}=a;if(a.props=!0,"all"!==c.removeAdditional&&(0,tv.alwaysValidSchema)(a,r))return;const u=(0,Qb.allSchemaProperties)(n.properties),f=(0,Qb.allSchemaProperties)(n.patternProperties);function d(e){t.code(Yb._`delete ${i}[${e}]`)}function l(n){if("all"===c.removeAdditional||c.removeAdditional&&!1===r)d(n);else{if(!1===r)return e.setParams({additionalProperty:n}),e.error(),void(s||t.break());if("object"==typeof r&&!(0,tv.alwaysValidSchema)(a,r)){const r=t.name("valid");"failing"===c.removeAdditional?(h(n,r,!1),t.if((0,Yb.not)(r),(()=>{e.reset(),d(n)}))):(h(n,r),s||t.if((0,Yb.not)(r),(()=>t.break())))}}}function h(t,r,n){const i={keyword:"additionalProperties",dataProp:t,dataPropType:tv.Type.Str};!1===n&&Object.assign(i,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(i,r)}t.forIn("key",i,(r=>{u.length||f.length?t.if(function(r){let i;if(u.length>8){const e=(0,tv.schemaRefOrVal)(a,n.properties,"properties");i=(0,Qb.isOwnProperty)(t,e,r)}else i=u.length?(0,Yb.or)(...u.map((e=>Yb._`${r} === ${e}`))):Yb.nil;return f.length&&(i=(0,Yb.or)(i,...f.map((t=>Yb._`${(0,Qb.usePattern)(e,t)}.test(${r})`)))),(0,Yb.not)(i)}(r),(()=>l(r))):l(r)})),e.ok(Yb._`${o} === ${ev.default.errors}`)}};Xb.default=rv;var nv={};Object.defineProperty(nv,"__esModule",{value:!0});const iv=Bp,ov=fm,av=Hp,sv=Xb,cv={keyword:"properties",type:"object",schemaType:"object",code(e){const{gen:t,schema:r,parentSchema:n,data:i,it:o}=e;"all"===o.opts.removeAdditional&&void 0===n.additionalProperties&&sv.default.code(new iv.KeywordCxt(o,sv.default,"additionalProperties"));const a=(0,ov.allSchemaProperties)(r);for(const e of a)o.definedProperties.add(e);o.opts.unevaluated&&a.length&&!0!==o.props&&(o.props=av.mergeEvaluated.props(t,(0,av.toHash)(a),o.props));const s=a.filter((e=>!(0,av.alwaysValidSchema)(o,r[e])));if(0===s.length)return;const c=t.name("valid");for(const r of s)u(r)?f(r):(t.if((0,ov.propertyInData)(t,i,r,o.opts.ownProperties)),f(r),o.allErrors||t.else().var(c,!0),t.endIf()),e.it.definedProperties.add(r),e.ok(c);function u(e){return o.opts.useDefaults&&!o.compositeRule&&void 0!==r[e].default}function f(t){e.subschema({keyword:"properties",schemaProp:t,dataProp:t},c)}}};nv.default=cv;var uv={};Object.defineProperty(uv,"__esModule",{value:!0});const fv=fm,dv=Up,lv=Hp,hv=Hp,pv={keyword:"patternProperties",type:"object",schemaType:"object",code(e){const{gen:t,schema:r,data:n,parentSchema:i,it:o}=e,{opts:a}=o,s=(0,fv.allSchemaProperties)(r),c=s.filter((e=>(0,lv.alwaysValidSchema)(o,r[e])));if(0===s.length||c.length===s.length&&(!o.opts.unevaluated||!0===o.props))return;const u=a.strictSchema&&!a.allowMatchingProperties&&i.properties,f=t.name("valid");!0===o.props||o.props instanceof dv.Name||(o.props=(0,hv.evaluatedPropsToName)(t,o.props));const{props:d}=o;function l(e){for(const t in u)new RegExp(e).test(t)&&(0,lv.checkStrictMode)(o,`property ${t} matches pattern ${e} (use allowMatchingProperties)`)}function h(r){t.forIn("key",n,(n=>{t.if(dv._`${(0,fv.usePattern)(e,r)}.test(${n})`,(()=>{const i=c.includes(r);i||e.subschema({keyword:"patternProperties",schemaProp:r,dataProp:n,dataPropType:hv.Type.Str},f),o.opts.unevaluated&&!0!==d?t.assign(dv._`${d}[${n}]`,!0):i||o.allErrors||t.if((0,dv.not)(f),(()=>t.break()))}))}))}!function(){for(const e of s)u&&l(e),o.allErrors?h(e):(t.var(f,!0),h(e),t.if(f))}()}};uv.default=pv;var mv={};Object.defineProperty(mv,"__esModule",{value:!0});const gv=Hp,yv={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){const{gen:t,schema:r,it:n}=e;if((0,gv.alwaysValidSchema)(n,r))return void e.fail();const i=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},i),e.failResult(i,(()=>e.reset()),(()=>e.error()))},error:{message:"must NOT be valid"}};mv.default=yv;var bv={};Object.defineProperty(bv,"__esModule",{value:!0});const vv={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:fm.validateUnion,error:{message:"must match a schema in anyOf"}};bv.default=vv;var wv={};Object.defineProperty(wv,"__esModule",{value:!0});const Av=Up,_v=Hp,Ev={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:e})=>Av._`{passingSchemas: ${e.passing}}`},code(e){const{gen:t,schema:r,parentSchema:n,it:i}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(i.opts.discriminator&&n.discriminator)return;const o=r,a=t.let("valid",!1),s=t.let("passing",null),c=t.name("_valid");e.setParams({passing:s}),t.block((function(){o.forEach(((r,n)=>{let o;(0,_v.alwaysValidSchema)(i,r)?t.var(c,!0):o=e.subschema({keyword:"oneOf",schemaProp:n,compositeRule:!0},c),n>0&&t.if(Av._`${c} && ${a}`).assign(a,!1).assign(s,Av._`[${s}, ${n}]`).else(),t.if(c,(()=>{t.assign(a,!0),t.assign(s,n),o&&e.mergeEvaluated(o,Av.Name)}))}))})),e.result(a,(()=>e.reset()),(()=>e.error(!0)))}};wv.default=Ev;var Sv={};Object.defineProperty(Sv,"__esModule",{value:!0});const Pv=Hp,xv={keyword:"allOf",schemaType:"array",code(e){const{gen:t,schema:r,it:n}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");const i=t.name("valid");r.forEach(((t,r)=>{if((0,Pv.alwaysValidSchema)(n,t))return;const o=e.subschema({keyword:"allOf",schemaProp:r},i);e.ok(i),e.mergeEvaluated(o)}))}};Sv.default=xv;var kv={};Object.defineProperty(kv,"__esModule",{value:!0});const Mv=Up,Cv=Hp,Iv={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:e})=>Mv.str`must match "${e.ifClause}" schema`,params:({params:e})=>Mv._`{failingKeyword: ${e.ifClause}}`},code(e){const{gen:t,parentSchema:r,it:n}=e;void 0===r.then&&void 0===r.else&&(0,Cv.checkStrictMode)(n,'"if" without "then" and "else" is ignored');const i=Rv(n,"then"),o=Rv(n,"else");if(!i&&!o)return;const a=t.let("valid",!0),s=t.name("_valid");if(function(){const t=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},s);e.mergeEvaluated(t)}(),e.reset(),i&&o){const r=t.let("ifClause");e.setParams({ifClause:r}),t.if(s,c("then",r),c("else",r))}else i?t.if(s,c("then")):t.if((0,Mv.not)(s),c("else"));function c(r,n){return()=>{const i=e.subschema({keyword:r},s);t.assign(a,s),e.mergeValidEvaluated(i,a),n?t.assign(n,Mv._`${r}`):e.setParams({ifClause:r})}}e.pass(a,(()=>e.error(!0)))}};function Rv(e,t){const r=e.schema[t];return void 0!==r&&!(0,Cv.alwaysValidSchema)(e,r)}kv.default=Iv;var Nv={};Object.defineProperty(Nv,"__esModule",{value:!0});const Ov=Hp,Tv={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){void 0===t.if&&(0,Ov.checkStrictMode)(r,`"${e}" without "if" is ignored`)}};Nv.default=Tv,Object.defineProperty(Ab,"__esModule",{value:!0});const jv=_b,Dv=kb,$v=Mb,Bv=Db,Fv=Lb,zv=Jb,Uv=Wb,Lv=Xb,qv=nv,Hv=uv,Kv=mv,Jv=bv,Wv=wv,Gv=Sv,Vv=kv,Zv=Nv;Ab.default=function(e=!1){const t=[Kv.default,Jv.default,Wv.default,Gv.default,Vv.default,Zv.default,Uv.default,Lv.default,zv.default,qv.default,Hv.default];return e?t.push(Dv.default,Bv.default):t.push(jv.default,$v.default),t.push(Fv.default),t};var Xv={},Qv={};Object.defineProperty(Qv,"__esModule",{value:!0});const Yv=Up,ew={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>Yv.str`must match format "${e}"`,params:({schemaCode:e})=>Yv._`{format: ${e}}`},code(e,t){const{gen:r,data:n,$data:i,schema:o,schemaCode:a,it:s}=e,{opts:c,errSchemaPath:u,schemaEnv:f,self:d}=s;c.validateFormats&&(i?function(){const i=r.scopeValue("formats",{ref:d.formats,code:c.code.formats}),o=r.const("fDef",Yv._`${i}[${a}]`),s=r.let("fType"),u=r.let("format");r.if(Yv._`typeof ${o} == "object" && !(${o} instanceof RegExp)`,(()=>r.assign(s,Yv._`${o}.type || "string"`).assign(u,Yv._`${o}.validate`)),(()=>r.assign(s,Yv._`"string"`).assign(u,o))),e.fail$data((0,Yv.or)(!1===c.strictSchema?Yv.nil:Yv._`${a} && !${u}`,function(){const e=f.$async?Yv._`(${o}.async ? await ${u}(${n}) : ${u}(${n}))`:Yv._`${u}(${n})`,r=Yv._`(typeof ${u} == "function" ? ${e} : ${u}.test(${n}))`;return Yv._`${u} && ${u} !== true && ${s} === ${t} && !${r}`}()))}():function(){const i=d.formats[o];if(!i)return void function(){if(!1===c.strictSchema)return void d.logger.warn(e());throw new Error(e());function e(){return`unknown format "${o}" ignored in schema at path "${u}"`}}();if(!0===i)return;const[a,s,l]=function(e){const t=e instanceof RegExp?(0,Yv.regexpCode)(e):c.code.formats?Yv._`${c.code.formats}${(0,Yv.getProperty)(o)}`:void 0,n=r.scopeValue("formats",{key:o,ref:e,code:t});if("object"==typeof e&&!(e instanceof RegExp))return[e.type||"string",e.validate,Yv._`${n}.validate`];return["string",e,n]}(i);a===t&&e.pass(function(){if("object"==typeof i&&!(i instanceof RegExp)&&i.async){if(!f.$async)throw new Error("async format in sync schema");return Yv._`await ${l}(${n})`}return"function"==typeof s?Yv._`${l}(${n})`:Yv._`${l}.test(${n})`}())}())}};Qv.default=ew,Object.defineProperty(Xv,"__esModule",{value:!0});const tw=[Qv.default];Xv.default=tw,Object.defineProperty(Gg,"__esModule",{value:!0});const rw=sy,nw=Ab,iw=Xv,ow=[Vg.default,rw.default,nw.default(),iw.default,["title","description","default"]];Gg.default=ow;var aw={},sw={};!function(e){var t;Object.defineProperty(e,"__esModule",{value:!0}),e.DiscrError=void 0,(t=e.DiscrError||(e.DiscrError={})).Tag="tag",t.Mapping="mapping"}(sw),Object.defineProperty(aw,"__esModule",{value:!0});const cw=Up,uw=sw,fw=Mg,dw=Hp,lw={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:e,tagName:t}})=>e===uw.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>cw._`{error: ${e}, tag: ${r}, tagValue: ${t}}`},code(e){const{gen:t,data:r,schema:n,parentSchema:i,it:o}=e,{oneOf:a}=i;if(!o.opts.discriminator)throw new Error("discriminator: requires discriminator option");const s=n.propertyName;if("string"!=typeof s)throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!a)throw new Error("discriminator: requires oneOf keyword");const c=t.let("valid",!1),u=t.const("tag",cw._`${r}${(0,cw.getProperty)(s)}`);function f(r){const n=t.name("valid"),i=e.subschema({keyword:"oneOf",schemaProp:r},n);return e.mergeEvaluated(i,cw.Name),n}t.if(cw._`typeof ${u} == "string"`,(()=>function(){const r=function(){var e;const t={},r=c(i);let n=!0;for(let t=0;te.error(!1,{discrError:uw.DiscrError.Tag,tag:u,tagName:s}))),e.ok(c)}};aw.default=lw;var hw={id:"http://json-schema.org/draft-04/schema#",$schema:"http://json-schema.org/draft-04/schema#",description:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},positiveInteger:{type:"integer",minimum:0},positiveIntegerDefault0:{allOf:[{$ref:"#/definitions/positiveInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},minItems:1,uniqueItems:!0}},type:"object",properties:{id:{type:"string",format:"uri"},$schema:{type:"string",format:"uri"},title:{type:"string"},description:{type:"string"},default:{},multipleOf:{type:"number",minimum:0,exclusiveMinimum:!0},maximum:{type:"number"},exclusiveMaximum:{type:"boolean",default:!1},minimum:{type:"number"},exclusiveMinimum:{type:"boolean",default:!1},maxLength:{$ref:"#/definitions/positiveInteger"},minLength:{$ref:"#/definitions/positiveIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{anyOf:[{type:"boolean"},{$ref:"#"}],default:{}},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:{}},maxItems:{$ref:"#/definitions/positiveInteger"},minItems:{$ref:"#/definitions/positiveIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxProperties:{$ref:"#/definitions/positiveInteger"},minProperties:{$ref:"#/definitions/positiveIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{anyOf:[{type:"boolean"},{$ref:"#"}],default:{}},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},enum:{type:"array",minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},dependencies:{exclusiveMaximum:["maximum"],exclusiveMinimum:["minimum"]},default:{}};!function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;const r=$p,n=Gg,i=aw,o=hw,a=["/properties"],s="http://json-schema.org/draft-04/schema";class c extends r.default{constructor(e={}){super({...e,schemaId:"id"})}_addVocabularies(){super._addVocabularies(),n.default.forEach((e=>this.addVocabulary(e))),this.opts.discriminator&&this.addKeyword(i.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const e=this.opts.$data?this.$dataMetaSchema(o,a):o;this.addMetaSchema(e,s,!1),this.refs["http://json-schema.org/schema"]=s}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(s)?s:void 0)}}e.exports=t=c,Object.defineProperty(t,"__esModule",{value:!0}),t.default=c;var u=$p;Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return u.KeywordCxt}});var f=$p;Object.defineProperty(t,"_",{enumerable:!0,get:function(){return f._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return f.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return f.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return f.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return f.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return f.CodeGen}})}(Dp,Dp.exports);var pw=f(Dp.exports),mw={exports:{}},gw={};!function(e){function t(e,t){return{validate:e,compare:t}}Object.defineProperty(e,"__esModule",{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0,e.fullFormats={date:t(i,o),time:t(s,c),"date-time":t((function(e){const t=e.split(u);return 2===t.length&&i(t[0])&&s(t[1],!0)}),f),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:function(e){return d.test(e)&&l.test(e)},"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::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(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:function(e){if(y.test(e))return!1;try{return new RegExp(e),!0}catch(e){return!1}},uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:function(e){return h.lastIndex=0,h.test(e)},int32:{type:"number",validate:function(e){return Number.isInteger(e)&&e<=m&&e>=p}},int64:{type:"number",validate:function(e){return Number.isInteger(e)}},float:{type:"number",validate:g},double:{type:"number",validate:g},password:!0,binary:!0},e.fastFormats={...e.fullFormats,date:t(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,o),time:t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,c),"date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,f),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},e.formatNames=Object.keys(e.fullFormats);const r=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,n=[0,31,28,31,30,31,30,31,31,30,31,30,31];function i(e){const t=r.exec(e);if(!t)return!1;const i=+t[1],o=+t[2],a=+t[3];return o>=1&&o<=12&&a>=1&&a<=(2===o&&function(e){return e%4==0&&(e%100!=0||e%400==0)}(i)?29:n[o])}function o(e,t){if(e&&t)return e>t?1:e(t=n[1]+n[2]+n[3]+(n[4]||""))?1:e=",ok:Mw.GTE,fail:Mw.LT},exclusiveMaximum:{okStr:"<",ok:Mw.LT,fail:Mw.GTE},exclusiveMinimum:{okStr:">",ok:Mw.GT,fail:Mw.LTE}},Iw={message:({keyword:e,schemaCode:t})=>kw.str`must be ${Cw[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>kw._`{comparison: ${Cw[e].okStr}, limit: ${t}}`},Rw={keyword:Object.keys(Cw),type:"number",schemaType:"number",$data:!0,error:Iw,code(e){const{keyword:t,data:r,schemaCode:n}=e;e.fail$data(kw._`${r} ${Cw[t].fail} ${n} || isNaN(${r})`)}};xw.default=Rw,Object.defineProperty(Pw,"__esModule",{value:!0});const Nw=by,Ow=Ay,Tw=Cy,jw=Oy,Dw=$y,$w=Ly,Bw=Jy,Fw=eb,zw=ob,Uw=[xw.default,Nw.default,Ow.default,Tw.default,jw.default,Dw.default,$w.default,Bw.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},Fw.default,zw.default];Pw.default=Uw;var Lw={};Object.defineProperty(Lw,"__esModule",{value:!0}),Lw.contentVocabulary=Lw.metadataVocabulary=void 0,Lw.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],Lw.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"],Object.defineProperty(vw,"__esModule",{value:!0});const qw=Pw,Hw=Ab,Kw=Xv,Jw=Lw,Ww=[ww.default,qw.default,(0,Hw.default)(),Kw.default,Jw.metadataVocabulary,Jw.contentVocabulary];vw.default=Ww;var Gw={$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:!0,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:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},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:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},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:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},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:!0};!function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;const r=$p,n=vw,i=aw,o=Gw,a=["/properties"],s="http://json-schema.org/draft-07/schema";class c extends r.default{_addVocabularies(){super._addVocabularies(),n.default.forEach((e=>this.addVocabulary(e))),this.opts.discriminator&&this.addKeyword(i.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const e=this.opts.$data?this.$dataMetaSchema(o,a):o;this.addMetaSchema(e,s,!1),this.refs["http://json-schema.org/schema"]=s}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(s)?s:void 0)}}e.exports=t=c,Object.defineProperty(t,"__esModule",{value:!0}),t.default=c;var u=Bp;Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return u.KeywordCxt}});var f=Up;Object.defineProperty(t,"_",{enumerable:!0,get:function(){return f._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return f.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return f.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return f.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return f.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return f.CodeGen}});var d=Eg;Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return d.default}});var l=Pg;Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return l.default}})}(bw,bw.exports);var Vw=bw.exports;!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;const t=Vw,r=Up,n=r.operators,i={formatMaximum:{okStr:"<=",ok:n.LTE,fail:n.GT},formatMinimum:{okStr:">=",ok:n.GTE,fail:n.LT},formatExclusiveMaximum:{okStr:"<",ok:n.LT,fail:n.GTE},formatExclusiveMinimum:{okStr:">",ok:n.GT,fail:n.LTE}},o={message:({keyword:e,schemaCode:t})=>r.str`should be ${i[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>r._`{comparison: ${i[e].okStr}, limit: ${t}}`};e.formatLimitDefinition={keyword:Object.keys(i),type:"string",schemaType:"string",$data:!0,error:o,code(e){const{gen:n,data:o,schemaCode:a,keyword:s,it:c}=e,{opts:u,self:f}=c;if(!u.validateFormats)return;const d=new t.KeywordCxt(c,f.RULES.all.format.definition,"format");function l(e){return r._`${e}.compare(${o}, ${a}) ${i[s].fail} 0`}d.$data?function(){const t=n.scopeValue("formats",{ref:f.formats,code:u.code.formats}),i=n.const("fmt",r._`${t}[${d.schemaCode}]`);e.fail$data(r.or(r._`typeof ${i} != "object"`,r._`${i} instanceof RegExp`,r._`typeof ${i}.compare != "function"`,l(i)))}():function(){const t=d.schema,i=f.formats[t];if(!i||!0===i)return;if("object"!=typeof i||i instanceof RegExp||"function"!=typeof i.compare)throw new Error(`"${s}": format "${t}" does not define "compare" function`);const o=n.scopeValue("formats",{key:t,ref:i,code:u.code.formats?r._`${u.code.formats}${r.getProperty(t)}`:void 0});e.fail$data(l(o))}()},dependencies:["format"]};e.default=t=>(t.addKeyword(e.formatLimitDefinition),t)}(yw),function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=gw,n=yw,i=Up,o=new i.Name("fullFormats"),a=new i.Name("fastFormats"),s=(e,t={keywords:!0})=>{if(Array.isArray(t))return c(e,t,r.fullFormats,o),e;const[i,s]="fast"===t.mode?[r.fastFormats,a]:[r.fullFormats,o];return c(e,t.formats||r.formatNames,i,s),t.keywords&&n.default(e),e};function c(e,t,r,n){var o,a;null!==(o=(a=e.opts.code).formats)&&void 0!==o||(a.formats=i._`require("ajv-formats/dist/formats").${n}`);for(const n of t)e.addFormat(n,r[n])}s.get=(e,t="full")=>{const n=("fast"===t?r.fastFormats:r.fullFormats)[e];if(!n)throw new Error(`Unknown format "${e}"`);return n},e.exports=t=s,Object.defineProperty(t,"__esModule",{value:!0}),t.default=s}(mw,mw.exports);var Zw=f(mw.exports),Xw={exports:{}};!function(e,t){(function(){var r,n="Expected a function",i="__lodash_hash_undefined__",o="__lodash_placeholder__",a=16,s=32,c=64,f=128,d=256,l=1/0,h=9007199254740991,p=NaN,m=4294967295,g=[["ary",f],["bind",1],["bindKey",2],["curry",8],["curryRight",a],["flip",512],["partial",s],["partialRight",c],["rearg",d]],y="[object Arguments]",b="[object Array]",v="[object Boolean]",w="[object Date]",A="[object Error]",_="[object Function]",E="[object GeneratorFunction]",S="[object Map]",P="[object Number]",x="[object Object]",k="[object Promise]",M="[object RegExp]",C="[object Set]",I="[object String]",R="[object Symbol]",N="[object WeakMap]",O="[object ArrayBuffer]",T="[object DataView]",j="[object Float32Array]",D="[object Float64Array]",$="[object Int8Array]",B="[object Int16Array]",F="[object Int32Array]",z="[object Uint8Array]",U="[object Uint8ClampedArray]",L="[object Uint16Array]",q="[object Uint32Array]",H=/\b__p \+= '';/g,K=/\b(__p \+=) '' \+/g,J=/(__e\(.*?\)|\b__t\)) \+\n'';/g,W=/&(?:amp|lt|gt|quot|#39);/g,G=/[&<>"']/g,V=RegExp(W.source),Z=RegExp(G.source),X=/<%-([\s\S]+?)%>/g,Q=/<%([\s\S]+?)%>/g,Y=/<%=([\s\S]+?)%>/g,ee=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,te=/^\w*$/,re=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ne=/[\\^$.*+?()[\]{}|]/g,ie=RegExp(ne.source),oe=/^\s+/,ae=/\s/,se=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ce=/\{\n\/\* \[wrapped with (.+)\] \*/,ue=/,? & /,fe=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,de=/[()=,{}\[\]\/\s]/,le=/\\(\\)?/g,he=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,pe=/\w*$/,me=/^[-+]0x[0-9a-f]+$/i,ge=/^0b[01]+$/i,ye=/^\[object .+?Constructor\]$/,be=/^0o[0-7]+$/i,ve=/^(?:0|[1-9]\d*)$/,we=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Ae=/($^)/,_e=/['\n\r\u2028\u2029\\]/g,Ee="\\ud800-\\udfff",Se="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Pe="\\u2700-\\u27bf",xe="a-z\\xdf-\\xf6\\xf8-\\xff",ke="A-Z\\xc0-\\xd6\\xd8-\\xde",Me="\\ufe0e\\ufe0f",Ce="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ie="['’]",Re="["+Ee+"]",Ne="["+Ce+"]",Oe="["+Se+"]",Te="\\d+",je="["+Pe+"]",De="["+xe+"]",$e="[^"+Ee+Ce+Te+Pe+xe+ke+"]",Be="\\ud83c[\\udffb-\\udfff]",Fe="[^"+Ee+"]",ze="(?:\\ud83c[\\udde6-\\uddff]){2}",Ue="[\\ud800-\\udbff][\\udc00-\\udfff]",Le="["+ke+"]",qe="\\u200d",He="(?:"+De+"|"+$e+")",Ke="(?:"+Le+"|"+$e+")",Je="(?:['’](?:d|ll|m|re|s|t|ve))?",We="(?:['’](?:D|LL|M|RE|S|T|VE))?",Ge="(?:"+Oe+"|"+Be+")"+"?",Ve="["+Me+"]?",Ze=Ve+Ge+("(?:"+qe+"(?:"+[Fe,ze,Ue].join("|")+")"+Ve+Ge+")*"),Xe="(?:"+[je,ze,Ue].join("|")+")"+Ze,Qe="(?:"+[Fe+Oe+"?",Oe,ze,Ue,Re].join("|")+")",Ye=RegExp(Ie,"g"),et=RegExp(Oe,"g"),tt=RegExp(Be+"(?="+Be+")|"+Qe+Ze,"g"),rt=RegExp([Le+"?"+De+"+"+Je+"(?="+[Ne,Le,"$"].join("|")+")",Ke+"+"+We+"(?="+[Ne,Le+He,"$"].join("|")+")",Le+"?"+He+"+"+Je,Le+"+"+We,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Te,Xe].join("|"),"g"),nt=RegExp("["+qe+Ee+Se+Me+"]"),it=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ot=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],at=-1,st={};st[j]=st[D]=st[$]=st[B]=st[F]=st[z]=st[U]=st[L]=st[q]=!0,st[y]=st[b]=st[O]=st[v]=st[T]=st[w]=st[A]=st[_]=st[S]=st[P]=st[x]=st[M]=st[C]=st[I]=st[N]=!1;var ct={};ct[y]=ct[b]=ct[O]=ct[T]=ct[v]=ct[w]=ct[j]=ct[D]=ct[$]=ct[B]=ct[F]=ct[S]=ct[P]=ct[x]=ct[M]=ct[C]=ct[I]=ct[R]=ct[z]=ct[U]=ct[L]=ct[q]=!0,ct[A]=ct[_]=ct[N]=!1;var ut={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ft=parseFloat,dt=parseInt,lt="object"==typeof u&&u&&u.Object===Object&&u,ht="object"==typeof self&&self&&self.Object===Object&&self,pt=lt||ht||Function("return this")(),mt=t&&!t.nodeType&&t,gt=mt&&e&&!e.nodeType&&e,yt=gt&>.exports===mt,bt=yt&<.process,vt=function(){try{var e=gt&>.require&>.require("util").types;return e||bt&&bt.binding&&bt.binding("util")}catch(e){}}(),wt=vt&&vt.isArrayBuffer,At=vt&&vt.isDate,_t=vt&&vt.isMap,Et=vt&&vt.isRegExp,St=vt&&vt.isSet,Pt=vt&&vt.isTypedArray;function xt(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}function kt(e,t,r,n){for(var i=-1,o=null==e?0:e.length;++i-1}function Ot(e,t,r){for(var n=-1,i=null==e?0:e.length;++n-1;);return r}function rr(e,t){for(var r=e.length;r--&&Lt(t,e[r],0)>-1;);return r}var nr=Wt({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),ir=Wt({"&":"&","<":"<",">":">",'"':""","'":"'"});function or(e){return"\\"+ut[e]}function ar(e){return nt.test(e)}function sr(e){var t=-1,r=Array(e.size);return e.forEach((function(e,n){r[++t]=[n,e]})),r}function cr(e,t){return function(r){return e(t(r))}}function ur(e,t){for(var r=-1,n=e.length,i=0,a=[];++r",""":'"',"'":"'"});var gr=function e(t){var u,ae=(t=null==t?pt:gr.defaults(pt.Object(),t,gr.pick(pt,ot))).Array,Ee=t.Date,Se=t.Error,Pe=t.Function,xe=t.Math,ke=t.Object,Me=t.RegExp,Ce=t.String,Ie=t.TypeError,Re=ae.prototype,Ne=Pe.prototype,Oe=ke.prototype,Te=t["__core-js_shared__"],je=Ne.toString,De=Oe.hasOwnProperty,$e=0,Be=(u=/[^.]+$/.exec(Te&&Te.keys&&Te.keys.IE_PROTO||""))?"Symbol(src)_1."+u:"",Fe=Oe.toString,ze=je.call(ke),Ue=pt._,Le=Me("^"+je.call(De).replace(ne,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),qe=yt?t.Buffer:r,He=t.Symbol,Ke=t.Uint8Array,Je=qe?qe.allocUnsafe:r,We=cr(ke.getPrototypeOf,ke),Ge=ke.create,Ve=Oe.propertyIsEnumerable,Ze=Re.splice,Xe=He?He.isConcatSpreadable:r,Qe=He?He.iterator:r,tt=He?He.toStringTag:r,nt=function(){try{var e=ho(ke,"defineProperty");return e({},"",{}),e}catch(e){}}(),ut=t.clearTimeout!==pt.clearTimeout&&t.clearTimeout,lt=Ee&&Ee.now!==pt.Date.now&&Ee.now,ht=t.setTimeout!==pt.setTimeout&&t.setTimeout,mt=xe.ceil,gt=xe.floor,bt=ke.getOwnPropertySymbols,vt=qe?qe.isBuffer:r,Ft=t.isFinite,Wt=Re.join,yr=cr(ke.keys,ke),br=xe.max,vr=xe.min,wr=Ee.now,Ar=t.parseInt,_r=xe.random,Er=Re.reverse,Sr=ho(t,"DataView"),Pr=ho(t,"Map"),xr=ho(t,"Promise"),kr=ho(t,"Set"),Mr=ho(t,"WeakMap"),Cr=ho(ke,"create"),Ir=Mr&&new Mr,Rr={},Nr=Fo(Sr),Or=Fo(Pr),Tr=Fo(xr),jr=Fo(kr),Dr=Fo(Mr),$r=He?He.prototype:r,Br=$r?$r.valueOf:r,Fr=$r?$r.toString:r;function zr(e){if(rs(e)&&!Ka(e)&&!(e instanceof Hr)){if(e instanceof qr)return e;if(De.call(e,"__wrapped__"))return zo(e)}return new qr(e)}var Ur=function(){function e(){}return function(t){if(!ts(t))return{};if(Ge)return Ge(t);e.prototype=t;var n=new e;return e.prototype=r,n}}();function Lr(){}function qr(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=r}function Hr(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=m,this.__views__=[]}function Kr(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t=t?e:t)),e}function un(e,t,n,i,o,a){var s,c=1&t,u=2&t,f=4&t;if(n&&(s=o?n(e,i,o,a):n(e)),s!==r)return s;if(!ts(e))return e;var d=Ka(e);if(d){if(s=function(e){var t=e.length,r=new e.constructor(t);t&&"string"==typeof e[0]&&De.call(e,"index")&&(r.index=e.index,r.input=e.input);return r}(e),!c)return Ii(e,s)}else{var l=go(e),h=l==_||l==E;if(Va(e))return Si(e,c);if(l==x||l==y||h&&!o){if(s=u||h?{}:bo(e),!c)return u?function(e,t){return Ri(e,mo(e),t)}(e,function(e,t){return e&&Ri(t,Os(t),e)}(s,e)):function(e,t){return Ri(e,po(e),t)}(e,on(s,e))}else{if(!ct[l])return o?e:{};s=function(e,t,r){var n=e.constructor;switch(t){case O:return Pi(e);case v:case w:return new n(+e);case T:return function(e,t){var r=t?Pi(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}(e,r);case j:case D:case $:case B:case F:case z:case U:case L:case q:return xi(e,r);case S:return new n;case P:case I:return new n(e);case M:return function(e){var t=new e.constructor(e.source,pe.exec(e));return t.lastIndex=e.lastIndex,t}(e);case C:return new n;case R:return i=e,Br?ke(Br.call(i)):{}}var i}(e,l,c)}}a||(a=new Vr);var p=a.get(e);if(p)return p;a.set(e,s),ss(e)?e.forEach((function(r){s.add(un(r,t,n,r,e,a))})):ns(e)&&e.forEach((function(r,i){s.set(i,un(r,t,n,i,e,a))}));var m=d?r:(f?u?oo:io:u?Os:Ns)(e);return Mt(m||e,(function(r,i){m&&(r=e[i=r]),tn(s,i,un(r,t,n,i,e,a))})),s}function fn(e,t,n){var i=n.length;if(null==e)return!i;for(e=ke(e);i--;){var o=n[i],a=t[o],s=e[o];if(s===r&&!(o in e)||!a(s))return!1}return!0}function dn(e,t,i){if("function"!=typeof e)throw new Ie(n);return No((function(){e.apply(r,i)}),t)}function ln(e,t,r,n){var i=-1,o=Nt,a=!0,s=e.length,c=[],u=t.length;if(!s)return c;r&&(t=Tt(t,Qt(r))),n?(o=Ot,a=!1):t.length>=200&&(o=er,a=!1,t=new Gr(t));e:for(;++i-1},Jr.prototype.set=function(e,t){var r=this.__data__,n=rn(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this},Wr.prototype.clear=function(){this.size=0,this.__data__={hash:new Kr,map:new(Pr||Jr),string:new Kr}},Wr.prototype.delete=function(e){var t=fo(this,e).delete(e);return this.size-=t?1:0,t},Wr.prototype.get=function(e){return fo(this,e).get(e)},Wr.prototype.has=function(e){return fo(this,e).has(e)},Wr.prototype.set=function(e,t){var r=fo(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this},Gr.prototype.add=Gr.prototype.push=function(e){return this.__data__.set(e,i),this},Gr.prototype.has=function(e){return this.__data__.has(e)},Vr.prototype.clear=function(){this.__data__=new Jr,this.size=0},Vr.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},Vr.prototype.get=function(e){return this.__data__.get(e)},Vr.prototype.has=function(e){return this.__data__.has(e)},Vr.prototype.set=function(e,t){var r=this.__data__;if(r instanceof Jr){var n=r.__data__;if(!Pr||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new Wr(n)}return r.set(e,t),this.size=r.size,this};var hn=Ti(An),pn=Ti(_n,!0);function mn(e,t){var r=!0;return hn(e,(function(e,n,i){return r=!!t(e,n,i)})),r}function gn(e,t,n){for(var i=-1,o=e.length;++i0&&r(s)?t>1?bn(s,t-1,r,n,i):jt(i,s):n||(i[i.length]=s)}return i}var vn=ji(),wn=ji(!0);function An(e,t){return e&&vn(e,t,Ns)}function _n(e,t){return e&&wn(e,t,Ns)}function En(e,t){return Rt(t,(function(t){return Qa(e[t])}))}function Sn(e,t){for(var n=0,i=(t=wi(t,e)).length;null!=e&&nt}function Mn(e,t){return null!=e&&De.call(e,t)}function Cn(e,t){return null!=e&&t in ke(e)}function In(e,t,n){for(var i=n?Ot:Nt,o=e[0].length,a=e.length,s=a,c=ae(a),u=1/0,f=[];s--;){var d=e[s];s&&t&&(d=Tt(d,Qt(t))),u=vr(d.length,u),c[s]=!n&&(t||o>=120&&d.length>=120)?new Gr(s&&d):r}d=e[0];var l=-1,h=c[0];e:for(;++l=s?c:c*("desc"==r[n]?-1:1)}return e.index-t.index}(e,t,r)}))}function Jn(e,t,r){for(var n=-1,i=t.length,o={};++n-1;)s!==e&&Ze.call(s,c,1),Ze.call(e,c,1);return e}function Gn(e,t){for(var r=e?t.length:0,n=r-1;r--;){var i=t[r];if(r==n||i!==o){var o=i;wo(i)?Ze.call(e,i,1):li(e,i)}}return e}function Vn(e,t){return e+gt(_r()*(t-e+1))}function Zn(e,t){var r="";if(!e||t<1||t>h)return r;do{t%2&&(r+=e),(t=gt(t/2))&&(e+=e)}while(t);return r}function Xn(e,t){return Oo(Mo(e,t,ic),e+"")}function Qn(e){return Xr(Us(e))}function Yn(e,t){var r=Us(e);return Do(r,cn(t,0,r.length))}function ei(e,t,n,i){if(!ts(e))return e;for(var o=-1,a=(t=wi(t,e)).length,s=a-1,c=e;null!=c&&++oi?0:i+t),(r=r>i?i:r)<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var o=ae(i);++n>>1,a=e[o];null!==a&&!us(a)&&(r?a<=t:a=200){var u=t?null:Zi(e);if(u)return fr(u);a=!1,i=er,c=new Gr}else c=t?[]:s;e:for(;++n=i?e:ii(e,t,n)}var Ei=ut||function(e){return pt.clearTimeout(e)};function Si(e,t){if(t)return e.slice();var r=e.length,n=Je?Je(r):new e.constructor(r);return e.copy(n),n}function Pi(e){var t=new e.constructor(e.byteLength);return new Ke(t).set(new Ke(e)),t}function xi(e,t){var r=t?Pi(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function ki(e,t){if(e!==t){var n=e!==r,i=null===e,o=e==e,a=us(e),s=t!==r,c=null===t,u=t==t,f=us(t);if(!c&&!f&&!a&&e>t||a&&s&&u&&!c&&!f||i&&s&&u||!n&&u||!o)return 1;if(!i&&!a&&!f&&e1?n[o-1]:r,s=o>2?n[2]:r;for(a=e.length>3&&"function"==typeof a?(o--,a):r,s&&Ao(n[0],n[1],s)&&(a=o<3?r:a,o=1),t=ke(t);++i-1?o[a?t[s]:s]:r}}function zi(e){return no((function(t){var i=t.length,o=i,a=qr.prototype.thru;for(e&&t.reverse();o--;){var s=t[o];if("function"!=typeof s)throw new Ie(n);if(a&&!c&&"wrapper"==so(s))var c=new qr([],!0)}for(o=c?o:i;++o1&&v.reverse(),l&&uc))return!1;var f=a.get(e),d=a.get(t);if(f&&d)return f==t&&d==e;var l=-1,h=!0,p=2&n?new Gr:r;for(a.set(e,t),a.set(t,e);++l-1&&e%1==0&&e1?"& ":"")+t[n],t=t.join(r>2?", ":" "),e.replace(se,"{\n/* [wrapped with "+t+"] */\n")}(n,function(e,t){return Mt(g,(function(r){var n="_."+r[0];t&r[1]&&!Nt(e,n)&&e.push(n)})),e.sort()}(function(e){var t=e.match(ce);return t?t[1].split(ue):[]}(n),r)))}function jo(e){var t=0,n=0;return function(){var i=wr(),o=16-(i-n);if(n=i,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(r,arguments)}}function Do(e,t){var n=-1,i=e.length,o=i-1;for(t=t===r?i:t;++n1?e[t-1]:r;return n="function"==typeof n?(e.pop(),n):r,aa(e,n)}));function ha(e){var t=zr(e);return t.__chain__=!0,t}function pa(e,t){return t(e)}var ma=no((function(e){var t=e.length,n=t?e[0]:0,i=this.__wrapped__,o=function(t){return sn(t,e)};return!(t>1||this.__actions__.length)&&i instanceof Hr&&wo(n)?((i=i.slice(n,+n+(t?1:0))).__actions__.push({func:pa,args:[o],thisArg:r}),new qr(i,this.__chain__).thru((function(e){return t&&!e.length&&e.push(r),e}))):this.thru(o)}));var ga=Ni((function(e,t,r){De.call(e,r)?++e[r]:an(e,r,1)}));var ya=Fi(Ho),ba=Fi(Ko);function va(e,t){return(Ka(e)?Mt:hn)(e,uo(t,3))}function wa(e,t){return(Ka(e)?Ct:pn)(e,uo(t,3))}var Aa=Ni((function(e,t,r){De.call(e,r)?e[r].push(t):an(e,r,[t])}));var _a=Xn((function(e,t,r){var n=-1,i="function"==typeof t,o=Wa(e)?ae(e.length):[];return hn(e,(function(e){o[++n]=i?xt(t,e,r):Rn(e,t,r)})),o})),Ea=Ni((function(e,t,r){an(e,r,t)}));function Sa(e,t){return(Ka(e)?Tt:zn)(e,uo(t,3))}var Pa=Ni((function(e,t,r){e[r?0:1].push(t)}),(function(){return[[],[]]}));var xa=Xn((function(e,t){if(null==e)return[];var r=t.length;return r>1&&Ao(e,t[0],t[1])?t=[]:r>2&&Ao(t[0],t[1],t[2])&&(t=[t[0]]),Kn(e,bn(t,1),[])})),ka=lt||function(){return pt.Date.now()};function Ma(e,t,n){return t=n?r:t,t=e&&null==t?e.length:t,Qi(e,f,r,r,r,r,t)}function Ca(e,t){var i;if("function"!=typeof t)throw new Ie(n);return e=ms(e),function(){return--e>0&&(i=t.apply(this,arguments)),e<=1&&(t=r),i}}var Ia=Xn((function(e,t,r){var n=1;if(r.length){var i=ur(r,co(Ia));n|=s}return Qi(e,n,t,r,i)})),Ra=Xn((function(e,t,r){var n=3;if(r.length){var i=ur(r,co(Ra));n|=s}return Qi(t,n,e,r,i)}));function Na(e,t,i){var o,a,s,c,u,f,d=0,l=!1,h=!1,p=!0;if("function"!=typeof e)throw new Ie(n);function m(t){var n=o,i=a;return o=a=r,d=t,c=e.apply(i,n)}function g(e){var n=e-f;return f===r||n>=t||n<0||h&&e-d>=s}function y(){var e=ka();if(g(e))return b(e);u=No(y,function(e){var r=t-(e-f);return h?vr(r,s-(e-d)):r}(e))}function b(e){return u=r,p&&o?m(e):(o=a=r,c)}function v(){var e=ka(),n=g(e);if(o=arguments,a=this,f=e,n){if(u===r)return function(e){return d=e,u=No(y,t),l?m(e):c}(f);if(h)return Ei(u),u=No(y,t),m(f)}return u===r&&(u=No(y,t)),c}return t=ys(t)||0,ts(i)&&(l=!!i.leading,s=(h="maxWait"in i)?br(ys(i.maxWait)||0,t):s,p="trailing"in i?!!i.trailing:p),v.cancel=function(){u!==r&&Ei(u),d=0,o=f=a=u=r},v.flush=function(){return u===r?c:b(ka())},v}var Oa=Xn((function(e,t){return dn(e,1,t)})),Ta=Xn((function(e,t,r){return dn(e,ys(t)||0,r)}));function ja(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Ie(n);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var a=e.apply(this,n);return r.cache=o.set(i,a)||o,a};return r.cache=new(ja.Cache||Wr),r}function Da(e){if("function"!=typeof e)throw new Ie(n);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}ja.Cache=Wr;var $a=Ai((function(e,t){var r=(t=1==t.length&&Ka(t[0])?Tt(t[0],Qt(uo())):Tt(bn(t,1),Qt(uo()))).length;return Xn((function(n){for(var i=-1,o=vr(n.length,r);++i=t})),Ha=Nn(function(){return arguments}())?Nn:function(e){return rs(e)&&De.call(e,"callee")&&!Ve.call(e,"callee")},Ka=ae.isArray,Ja=wt?Qt(wt):function(e){return rs(e)&&xn(e)==O};function Wa(e){return null!=e&&es(e.length)&&!Qa(e)}function Ga(e){return rs(e)&&Wa(e)}var Va=vt||yc,Za=At?Qt(At):function(e){return rs(e)&&xn(e)==w};function Xa(e){if(!rs(e))return!1;var t=xn(e);return t==A||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!os(e)}function Qa(e){if(!ts(e))return!1;var t=xn(e);return t==_||t==E||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Ya(e){return"number"==typeof e&&e==ms(e)}function es(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=h}function ts(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function rs(e){return null!=e&&"object"==typeof e}var ns=_t?Qt(_t):function(e){return rs(e)&&go(e)==S};function is(e){return"number"==typeof e||rs(e)&&xn(e)==P}function os(e){if(!rs(e)||xn(e)!=x)return!1;var t=We(e);if(null===t)return!0;var r=De.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&je.call(r)==ze}var as=Et?Qt(Et):function(e){return rs(e)&&xn(e)==M};var ss=St?Qt(St):function(e){return rs(e)&&go(e)==C};function cs(e){return"string"==typeof e||!Ka(e)&&rs(e)&&xn(e)==I}function us(e){return"symbol"==typeof e||rs(e)&&xn(e)==R}var fs=Pt?Qt(Pt):function(e){return rs(e)&&es(e.length)&&!!st[xn(e)]};var ds=Wi(Fn),ls=Wi((function(e,t){return e<=t}));function hs(e){if(!e)return[];if(Wa(e))return cs(e)?hr(e):Ii(e);if(Qe&&e[Qe])return function(e){for(var t,r=[];!(t=e.next()).done;)r.push(t.value);return r}(e[Qe]());var t=go(e);return(t==S?sr:t==C?fr:Us)(e)}function ps(e){return e?(e=ys(e))===l||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function ms(e){var t=ps(e),r=t%1;return t==t?r?t-r:t:0}function gs(e){return e?cn(ms(e),0,m):0}function ys(e){if("number"==typeof e)return e;if(us(e))return p;if(ts(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=ts(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Xt(e);var r=ge.test(e);return r||be.test(e)?dt(e.slice(2),r?2:8):me.test(e)?p:+e}function bs(e){return Ri(e,Os(e))}function vs(e){return null==e?"":fi(e)}var ws=Oi((function(e,t){if(Po(t)||Wa(t))Ri(t,Ns(t),e);else for(var r in t)De.call(t,r)&&tn(e,r,t[r])})),As=Oi((function(e,t){Ri(t,Os(t),e)})),_s=Oi((function(e,t,r,n){Ri(t,Os(t),e,n)})),Es=Oi((function(e,t,r,n){Ri(t,Ns(t),e,n)})),Ss=no(sn);var Ps=Xn((function(e,t){e=ke(e);var n=-1,i=t.length,o=i>2?t[2]:r;for(o&&Ao(t[0],t[1],o)&&(i=1);++n1),t})),Ri(e,oo(e),r),n&&(r=un(r,7,to));for(var i=t.length;i--;)li(r,t[i]);return r}));var $s=no((function(e,t){return null==e?{}:function(e,t){return Jn(e,t,(function(t,r){return Ms(e,r)}))}(e,t)}));function Bs(e,t){if(null==e)return{};var r=Tt(oo(e),(function(e){return[e]}));return t=uo(t),Jn(e,r,(function(e,r){return t(e,r[0])}))}var Fs=Xi(Ns),zs=Xi(Os);function Us(e){return null==e?[]:Yt(e,Ns(e))}var Ls=$i((function(e,t,r){return t=t.toLowerCase(),e+(r?qs(t):t)}));function qs(e){return Xs(vs(e).toLowerCase())}function Hs(e){return(e=vs(e))&&e.replace(we,nr).replace(et,"")}var Ks=$i((function(e,t,r){return e+(r?"-":"")+t.toLowerCase()})),Js=$i((function(e,t,r){return e+(r?" ":"")+t.toLowerCase()})),Ws=Di("toLowerCase");var Gs=$i((function(e,t,r){return e+(r?"_":"")+t.toLowerCase()}));var Vs=$i((function(e,t,r){return e+(r?" ":"")+Xs(t)}));var Zs=$i((function(e,t,r){return e+(r?" ":"")+t.toUpperCase()})),Xs=Di("toUpperCase");function Qs(e,t,n){return e=vs(e),(t=n?r:t)===r?function(e){return it.test(e)}(e)?function(e){return e.match(rt)||[]}(e):function(e){return e.match(fe)||[]}(e):e.match(t)||[]}var Ys=Xn((function(e,t){try{return xt(e,r,t)}catch(e){return Xa(e)?e:new Se(e)}})),ec=no((function(e,t){return Mt(t,(function(t){t=Bo(t),an(e,t,Ia(e[t],e))})),e}));function tc(e){return function(){return e}}var rc=zi(),nc=zi(!0);function ic(e){return e}function oc(e){return Dn("function"==typeof e?e:un(e,1))}var ac=Xn((function(e,t){return function(r){return Rn(r,e,t)}})),sc=Xn((function(e,t){return function(r){return Rn(e,r,t)}}));function cc(e,t,r){var n=Ns(t),i=En(t,n);null!=r||ts(t)&&(i.length||!n.length)||(r=t,t=e,e=this,i=En(t,Ns(t)));var o=!(ts(r)&&"chain"in r&&!r.chain),a=Qa(e);return Mt(i,(function(r){var n=t[r];e[r]=n,a&&(e.prototype[r]=function(){var t=this.__chain__;if(o||t){var r=e(this.__wrapped__);return(r.__actions__=Ii(this.__actions__)).push({func:n,args:arguments,thisArg:e}),r.__chain__=t,r}return n.apply(e,jt([this.value()],arguments))})})),e}function uc(){}var fc=Hi(Tt),dc=Hi(It),lc=Hi(Bt);function hc(e){return _o(e)?Jt(Bo(e)):function(e){return function(t){return Sn(t,e)}}(e)}var pc=Ji(),mc=Ji(!0);function gc(){return[]}function yc(){return!1}var bc=qi((function(e,t){return e+t}),0),vc=Vi("ceil"),wc=qi((function(e,t){return e/t}),1),Ac=Vi("floor");var _c,Ec=qi((function(e,t){return e*t}),1),Sc=Vi("round"),Pc=qi((function(e,t){return e-t}),0);return zr.after=function(e,t){if("function"!=typeof t)throw new Ie(n);return e=ms(e),function(){if(--e<1)return t.apply(this,arguments)}},zr.ary=Ma,zr.assign=ws,zr.assignIn=As,zr.assignInWith=_s,zr.assignWith=Es,zr.at=Ss,zr.before=Ca,zr.bind=Ia,zr.bindAll=ec,zr.bindKey=Ra,zr.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Ka(e)?e:[e]},zr.chain=ha,zr.chunk=function(e,t,n){t=(n?Ao(e,t,n):t===r)?1:br(ms(t),0);var i=null==e?0:e.length;if(!i||t<1)return[];for(var o=0,a=0,s=ae(mt(i/t));oo?0:o+n),(i=i===r||i>o?o:ms(i))<0&&(i+=o),i=n>i?0:gs(i);n>>0)?(e=vs(e))&&("string"==typeof t||null!=t&&!as(t))&&!(t=fi(t))&&ar(e)?_i(hr(e),0,n):e.split(t,n):[]},zr.spread=function(e,t){if("function"!=typeof e)throw new Ie(n);return t=null==t?0:br(ms(t),0),Xn((function(r){var n=r[t],i=_i(r,0,t);return n&&jt(i,n),xt(e,this,i)}))},zr.tail=function(e){var t=null==e?0:e.length;return t?ii(e,1,t):[]},zr.take=function(e,t,n){return e&&e.length?ii(e,0,(t=n||t===r?1:ms(t))<0?0:t):[]},zr.takeRight=function(e,t,n){var i=null==e?0:e.length;return i?ii(e,(t=i-(t=n||t===r?1:ms(t)))<0?0:t,i):[]},zr.takeRightWhile=function(e,t){return e&&e.length?pi(e,uo(t,3),!1,!0):[]},zr.takeWhile=function(e,t){return e&&e.length?pi(e,uo(t,3)):[]},zr.tap=function(e,t){return t(e),e},zr.throttle=function(e,t,r){var i=!0,o=!0;if("function"!=typeof e)throw new Ie(n);return ts(r)&&(i="leading"in r?!!r.leading:i,o="trailing"in r?!!r.trailing:o),Na(e,t,{leading:i,maxWait:t,trailing:o})},zr.thru=pa,zr.toArray=hs,zr.toPairs=Fs,zr.toPairsIn=zs,zr.toPath=function(e){return Ka(e)?Tt(e,Bo):us(e)?[e]:Ii($o(vs(e)))},zr.toPlainObject=bs,zr.transform=function(e,t,r){var n=Ka(e),i=n||Va(e)||fs(e);if(t=uo(t,4),null==r){var o=e&&e.constructor;r=i?n?new o:[]:ts(e)&&Qa(o)?Ur(We(e)):{}}return(i?Mt:An)(e,(function(e,n,i){return t(r,e,n,i)})),r},zr.unary=function(e){return Ma(e,1)},zr.union=ra,zr.unionBy=na,zr.unionWith=ia,zr.uniq=function(e){return e&&e.length?di(e):[]},zr.uniqBy=function(e,t){return e&&e.length?di(e,uo(t,2)):[]},zr.uniqWith=function(e,t){return t="function"==typeof t?t:r,e&&e.length?di(e,r,t):[]},zr.unset=function(e,t){return null==e||li(e,t)},zr.unzip=oa,zr.unzipWith=aa,zr.update=function(e,t,r){return null==e?e:hi(e,t,vi(r))},zr.updateWith=function(e,t,n,i){return i="function"==typeof i?i:r,null==e?e:hi(e,t,vi(n),i)},zr.values=Us,zr.valuesIn=function(e){return null==e?[]:Yt(e,Os(e))},zr.without=sa,zr.words=Qs,zr.wrap=function(e,t){return Ba(vi(t),e)},zr.xor=ca,zr.xorBy=ua,zr.xorWith=fa,zr.zip=da,zr.zipObject=function(e,t){return yi(e||[],t||[],tn)},zr.zipObjectDeep=function(e,t){return yi(e||[],t||[],ei)},zr.zipWith=la,zr.entries=Fs,zr.entriesIn=zs,zr.extend=As,zr.extendWith=_s,cc(zr,zr),zr.add=bc,zr.attempt=Ys,zr.camelCase=Ls,zr.capitalize=qs,zr.ceil=vc,zr.clamp=function(e,t,n){return n===r&&(n=t,t=r),n!==r&&(n=(n=ys(n))==n?n:0),t!==r&&(t=(t=ys(t))==t?t:0),cn(ys(e),t,n)},zr.clone=function(e){return un(e,4)},zr.cloneDeep=function(e){return un(e,5)},zr.cloneDeepWith=function(e,t){return un(e,5,t="function"==typeof t?t:r)},zr.cloneWith=function(e,t){return un(e,4,t="function"==typeof t?t:r)},zr.conformsTo=function(e,t){return null==t||fn(e,t,Ns(t))},zr.deburr=Hs,zr.defaultTo=function(e,t){return null==e||e!=e?t:e},zr.divide=wc,zr.endsWith=function(e,t,n){e=vs(e),t=fi(t);var i=e.length,o=n=n===r?i:cn(ms(n),0,i);return(n-=t.length)>=0&&e.slice(n,o)==t},zr.eq=Ua,zr.escape=function(e){return(e=vs(e))&&Z.test(e)?e.replace(G,ir):e},zr.escapeRegExp=function(e){return(e=vs(e))&&ie.test(e)?e.replace(ne,"\\$&"):e},zr.every=function(e,t,n){var i=Ka(e)?It:mn;return n&&Ao(e,t,n)&&(t=r),i(e,uo(t,3))},zr.find=ya,zr.findIndex=Ho,zr.findKey=function(e,t){return zt(e,uo(t,3),An)},zr.findLast=ba,zr.findLastIndex=Ko,zr.findLastKey=function(e,t){return zt(e,uo(t,3),_n)},zr.floor=Ac,zr.forEach=va,zr.forEachRight=wa,zr.forIn=function(e,t){return null==e?e:vn(e,uo(t,3),Os)},zr.forInRight=function(e,t){return null==e?e:wn(e,uo(t,3),Os)},zr.forOwn=function(e,t){return e&&An(e,uo(t,3))},zr.forOwnRight=function(e,t){return e&&_n(e,uo(t,3))},zr.get=ks,zr.gt=La,zr.gte=qa,zr.has=function(e,t){return null!=e&&yo(e,t,Mn)},zr.hasIn=Ms,zr.head=Wo,zr.identity=ic,zr.includes=function(e,t,r,n){e=Wa(e)?e:Us(e),r=r&&!n?ms(r):0;var i=e.length;return r<0&&(r=br(i+r,0)),cs(e)?r<=i&&e.indexOf(t,r)>-1:!!i&&Lt(e,t,r)>-1},zr.indexOf=function(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var i=null==r?0:ms(r);return i<0&&(i=br(n+i,0)),Lt(e,t,i)},zr.inRange=function(e,t,n){return t=ps(t),n===r?(n=t,t=0):n=ps(n),function(e,t,r){return e>=vr(t,r)&&e=-9007199254740991&&e<=h},zr.isSet=ss,zr.isString=cs,zr.isSymbol=us,zr.isTypedArray=fs,zr.isUndefined=function(e){return e===r},zr.isWeakMap=function(e){return rs(e)&&go(e)==N},zr.isWeakSet=function(e){return rs(e)&&"[object WeakSet]"==xn(e)},zr.join=function(e,t){return null==e?"":Wt.call(e,t)},zr.kebabCase=Ks,zr.last=Xo,zr.lastIndexOf=function(e,t,n){var i=null==e?0:e.length;if(!i)return-1;var o=i;return n!==r&&(o=(o=ms(n))<0?br(i+o,0):vr(o,i-1)),t==t?function(e,t,r){for(var n=r+1;n--;)if(e[n]===t)return n;return n}(e,t,o):Ut(e,Ht,o,!0)},zr.lowerCase=Js,zr.lowerFirst=Ws,zr.lt=ds,zr.lte=ls,zr.max=function(e){return e&&e.length?gn(e,ic,kn):r},zr.maxBy=function(e,t){return e&&e.length?gn(e,uo(t,2),kn):r},zr.mean=function(e){return Kt(e,ic)},zr.meanBy=function(e,t){return Kt(e,uo(t,2))},zr.min=function(e){return e&&e.length?gn(e,ic,Fn):r},zr.minBy=function(e,t){return e&&e.length?gn(e,uo(t,2),Fn):r},zr.stubArray=gc,zr.stubFalse=yc,zr.stubObject=function(){return{}},zr.stubString=function(){return""},zr.stubTrue=function(){return!0},zr.multiply=Ec,zr.nth=function(e,t){return e&&e.length?Hn(e,ms(t)):r},zr.noConflict=function(){return pt._===this&&(pt._=Ue),this},zr.noop=uc,zr.now=ka,zr.pad=function(e,t,r){e=vs(e);var n=(t=ms(t))?lr(e):0;if(!t||n>=t)return e;var i=(t-n)/2;return Ki(gt(i),r)+e+Ki(mt(i),r)},zr.padEnd=function(e,t,r){e=vs(e);var n=(t=ms(t))?lr(e):0;return t&&nt){var i=e;e=t,t=i}if(n||e%1||t%1){var o=_r();return vr(e+o*(t-e+ft("1e-"+((o+"").length-1))),t)}return Vn(e,t)},zr.reduce=function(e,t,r){var n=Ka(e)?Dt:Gt,i=arguments.length<3;return n(e,uo(t,4),r,i,hn)},zr.reduceRight=function(e,t,r){var n=Ka(e)?$t:Gt,i=arguments.length<3;return n(e,uo(t,4),r,i,pn)},zr.repeat=function(e,t,n){return t=(n?Ao(e,t,n):t===r)?1:ms(t),Zn(vs(e),t)},zr.replace=function(){var e=arguments,t=vs(e[0]);return e.length<3?t:t.replace(e[1],e[2])},zr.result=function(e,t,n){var i=-1,o=(t=wi(t,e)).length;for(o||(o=1,e=r);++ih)return[];var r=m,n=vr(e,m);t=uo(t),e-=m;for(var i=Zt(n,t);++r=a)return e;var c=n-lr(i);if(c<1)return i;var u=s?_i(s,0,c).join(""):e.slice(0,c);if(o===r)return u+i;if(s&&(c+=u.length-c),as(o)){if(e.slice(c).search(o)){var f,d=u;for(o.global||(o=Me(o.source,vs(pe.exec(o))+"g")),o.lastIndex=0;f=o.exec(d);)var l=f.index;u=u.slice(0,l===r?c:l)}}else if(e.indexOf(fi(o),c)!=c){var h=u.lastIndexOf(o);h>-1&&(u=u.slice(0,h))}return u+i},zr.unescape=function(e){return(e=vs(e))&&V.test(e)?e.replace(W,mr):e},zr.uniqueId=function(e){var t=++$e;return vs(e)+t},zr.upperCase=Zs,zr.upperFirst=Xs,zr.each=va,zr.eachRight=wa,zr.first=Wo,cc(zr,(_c={},An(zr,(function(e,t){De.call(zr.prototype,t)||(_c[t]=e)})),_c),{chain:!1}),zr.VERSION="4.17.21",Mt(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){zr[e].placeholder=zr})),Mt(["drop","take"],(function(e,t){Hr.prototype[e]=function(n){n=n===r?1:br(ms(n),0);var i=this.__filtered__&&!t?new Hr(this):this.clone();return i.__filtered__?i.__takeCount__=vr(n,i.__takeCount__):i.__views__.push({size:vr(n,m),type:e+(i.__dir__<0?"Right":"")}),i},Hr.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),Mt(["filter","map","takeWhile"],(function(e,t){var r=t+1,n=1==r||3==r;Hr.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:uo(e,3),type:r}),t.__filtered__=t.__filtered__||n,t}})),Mt(["head","last"],(function(e,t){var r="take"+(t?"Right":"");Hr.prototype[e]=function(){return this[r](1).value()[0]}})),Mt(["initial","tail"],(function(e,t){var r="drop"+(t?"":"Right");Hr.prototype[e]=function(){return this.__filtered__?new Hr(this):this[r](1)}})),Hr.prototype.compact=function(){return this.filter(ic)},Hr.prototype.find=function(e){return this.filter(e).head()},Hr.prototype.findLast=function(e){return this.reverse().find(e)},Hr.prototype.invokeMap=Xn((function(e,t){return"function"==typeof e?new Hr(this):this.map((function(r){return Rn(r,e,t)}))})),Hr.prototype.reject=function(e){return this.filter(Da(uo(e)))},Hr.prototype.slice=function(e,t){e=ms(e);var n=this;return n.__filtered__&&(e>0||t<0)?new Hr(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==r&&(n=(t=ms(t))<0?n.dropRight(-t):n.take(t-e)),n)},Hr.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Hr.prototype.toArray=function(){return this.take(m)},An(Hr.prototype,(function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),i=/^(?:head|last)$/.test(t),o=zr[i?"take"+("last"==t?"Right":""):t],a=i||/^find/.test(t);o&&(zr.prototype[t]=function(){var t=this.__wrapped__,s=i?[1]:arguments,c=t instanceof Hr,u=s[0],f=c||Ka(t),d=function(e){var t=o.apply(zr,jt([e],s));return i&&l?t[0]:t};f&&n&&"function"==typeof u&&1!=u.length&&(c=f=!1);var l=this.__chain__,h=!!this.__actions__.length,p=a&&!l,m=c&&!h;if(!a&&f){t=m?t:new Hr(this);var g=e.apply(t,s);return g.__actions__.push({func:pa,args:[d],thisArg:r}),new qr(g,l)}return p&&m?e.apply(this,s):(g=this.thru(d),p?i?g.value()[0]:g.value():g)})})),Mt(["pop","push","shift","sort","splice","unshift"],(function(e){var t=Re[e],r=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",n=/^(?:pop|shift)$/.test(e);zr.prototype[e]=function(){var e=arguments;if(n&&!this.__chain__){var i=this.value();return t.apply(Ka(i)?i:[],e)}return this[r]((function(r){return t.apply(Ka(r)?r:[],e)}))}})),An(Hr.prototype,(function(e,t){var r=zr[t];if(r){var n=r.name+"";De.call(Rr,n)||(Rr[n]=[]),Rr[n].push({name:t,func:r})}})),Rr[Ui(r,2).name]=[{name:"wrapper",func:r}],Hr.prototype.clone=function(){var e=new Hr(this.__wrapped__);return e.__actions__=Ii(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Ii(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Ii(this.__views__),e},Hr.prototype.reverse=function(){if(this.__filtered__){var e=new Hr(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Hr.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,r=Ka(e),n=t<0,i=r?e.length:0,o=function(e,t,r){var n=-1,i=r.length;for(;++n=this.__values__.length;return{done:e,value:e?r:this.__values__[this.__index__++]}},zr.prototype.plant=function(e){for(var t,n=this;n instanceof Lr;){var i=zo(n);i.__index__=0,i.__values__=r,t?o.__wrapped__=i:t=i;var o=i;n=n.__wrapped__}return o.__wrapped__=e,t},zr.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Hr){var t=e;return this.__actions__.length&&(t=new Hr(this)),(t=t.reverse()).__actions__.push({func:pa,args:[ta],thisArg:r}),new qr(t,this.__chain__)}return this.thru(ta)},zr.prototype.toJSON=zr.prototype.valueOf=zr.prototype.value=function(){return mi(this.__wrapped__,this.__actions__)},zr.prototype.first=zr.prototype.head,Qe&&(zr.prototype[Qe]=function(){return this}),zr}();gt?((gt.exports=gr)._=gr,mt._=gr):pt._=gr}).call(u)}(Xw,Xw.exports);var Qw=f(Xw.exports),Yw={id:"https://spec.openapis.org/oas/3.0/schema/2021-09-28",$schema:"http://json-schema.org/draft-04/schema#",description:"The description of OpenAPI v3.0.x documents, as defined by https://spec.openapis.org/oas/v3.0.3",type:"object",required:["openapi","info","paths"],properties:{openapi:{type:"string",pattern:"^3\\.0\\.\\d(-.+)?$"},info:{$ref:"#/definitions/Info"},externalDocs:{$ref:"#/definitions/ExternalDocumentation"},servers:{type:"array",items:{$ref:"#/definitions/Server"}},security:{type:"array",items:{$ref:"#/definitions/SecurityRequirement"}},tags:{type:"array",items:{$ref:"#/definitions/Tag"},uniqueItems:!0},paths:{$ref:"#/definitions/Paths"},components:{$ref:"#/definitions/Components"}},patternProperties:{"^x-":{}},additionalProperties:!1,definitions:{Reference:{type:"object",required:["$ref"],patternProperties:{"^\\$ref$":{type:"string",format:"uri-reference"}}},Info:{type:"object",required:["title","version"],properties:{title:{type:"string"},description:{type:"string"},termsOfService:{type:"string",format:"uri-reference"},contact:{$ref:"#/definitions/Contact"},license:{$ref:"#/definitions/License"},version:{type:"string"}},patternProperties:{"^x-":{}},additionalProperties:!1},Contact:{type:"object",properties:{name:{type:"string"},url:{type:"string",format:"uri-reference"},email:{type:"string",format:"email"}},patternProperties:{"^x-":{}},additionalProperties:!1},License:{type:"object",required:["name"],properties:{name:{type:"string"},url:{type:"string",format:"uri-reference"}},patternProperties:{"^x-":{}},additionalProperties:!1},Server:{type:"object",required:["url"],properties:{url:{type:"string"},description:{type:"string"},variables:{type:"object",additionalProperties:{$ref:"#/definitions/ServerVariable"}}},patternProperties:{"^x-":{}},additionalProperties:!1},ServerVariable:{type:"object",required:["default"],properties:{enum:{type:"array",items:{type:"string"}},default:{type:"string"},description:{type:"string"}},patternProperties:{"^x-":{}},additionalProperties:!1},Components:{type:"object",properties:{schemas:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]}}},responses:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/Response"}]}}},parameters:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/Parameter"}]}}},examples:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/Example"}]}}},requestBodies:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/RequestBody"}]}}},headers:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/Header"}]}}},securitySchemes:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/SecurityScheme"}]}}},links:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/Link"}]}}},callbacks:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/Callback"}]}}}},patternProperties:{"^x-":{}},additionalProperties:!1},Schema:{type:"object",properties:{title:{type:"string"},multipleOf:{type:"number",minimum:0,exclusiveMinimum:!0},maximum:{type:"number"},exclusiveMaximum:{type:"boolean",default:!1},minimum:{type:"number"},exclusiveMinimum:{type:"boolean",default:!1},maxLength:{type:"integer",minimum:0},minLength:{type:"integer",minimum:0,default:0},pattern:{type:"string",format:"regex"},maxItems:{type:"integer",minimum:0},minItems:{type:"integer",minimum:0,default:0},uniqueItems:{type:"boolean",default:!1},maxProperties:{type:"integer",minimum:0},minProperties:{type:"integer",minimum:0,default:0},required:{type:"array",items:{type:"string"},minItems:1,uniqueItems:!0},enum:{type:"array",items:{},minItems:1,uniqueItems:!1},type:{type:"string",enum:["array","boolean","integer","number","object","string"]},not:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]},allOf:{type:"array",items:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]}},oneOf:{type:"array",items:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]}},anyOf:{type:"array",items:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]}},items:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]},properties:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]}},additionalProperties:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"},{type:"boolean"}],default:!0},description:{type:"string"},format:{type:"string"},default:{},nullable:{type:"boolean",default:!1},discriminator:{$ref:"#/definitions/Discriminator"},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},example:{},externalDocs:{$ref:"#/definitions/ExternalDocumentation"},deprecated:{type:"boolean",default:!1},xml:{$ref:"#/definitions/XML"}},patternProperties:{"^x-":{}},additionalProperties:!1},Discriminator:{type:"object",required:["propertyName"],properties:{propertyName:{type:"string"},mapping:{type:"object",additionalProperties:{type:"string"}}}},XML:{type:"object",properties:{name:{type:"string"},namespace:{type:"string",format:"uri"},prefix:{type:"string"},attribute:{type:"boolean",default:!1},wrapped:{type:"boolean",default:!1}},patternProperties:{"^x-":{}},additionalProperties:!1},Response:{type:"object",required:["description"],properties:{description:{type:"string"},headers:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Header"},{$ref:"#/definitions/Reference"}]}},content:{type:"object",additionalProperties:{$ref:"#/definitions/MediaType"}},links:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Link"},{$ref:"#/definitions/Reference"}]}}},patternProperties:{"^x-":{}},additionalProperties:!1},MediaType:{type:"object",properties:{schema:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]},example:{},examples:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Example"},{$ref:"#/definitions/Reference"}]}},encoding:{type:"object",additionalProperties:{$ref:"#/definitions/Encoding"}}},patternProperties:{"^x-":{}},additionalProperties:!1,allOf:[{$ref:"#/definitions/ExampleXORExamples"}]},Example:{type:"object",properties:{summary:{type:"string"},description:{type:"string"},value:{},externalValue:{type:"string",format:"uri-reference"}},patternProperties:{"^x-":{}},additionalProperties:!1},Header:{type:"object",properties:{description:{type:"string"},required:{type:"boolean",default:!1},deprecated:{type:"boolean",default:!1},allowEmptyValue:{type:"boolean",default:!1},style:{type:"string",enum:["simple"],default:"simple"},explode:{type:"boolean"},allowReserved:{type:"boolean",default:!1},schema:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]},content:{type:"object",additionalProperties:{$ref:"#/definitions/MediaType"},minProperties:1,maxProperties:1},example:{},examples:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Example"},{$ref:"#/definitions/Reference"}]}}},patternProperties:{"^x-":{}},additionalProperties:!1,allOf:[{$ref:"#/definitions/ExampleXORExamples"},{$ref:"#/definitions/SchemaXORContent"}]},Paths:{type:"object",patternProperties:{"^\\/":{$ref:"#/definitions/PathItem"},"^x-":{}},additionalProperties:!1},PathItem:{type:"object",properties:{$ref:{type:"string"},summary:{type:"string"},description:{type:"string"},servers:{type:"array",items:{$ref:"#/definitions/Server"}},parameters:{type:"array",items:{oneOf:[{$ref:"#/definitions/Parameter"},{$ref:"#/definitions/Reference"}]},uniqueItems:!0}},patternProperties:{"^(get|put|post|delete|options|head|patch|trace)$":{$ref:"#/definitions/Operation"},"^x-":{}},additionalProperties:!1},Operation:{type:"object",required:["responses"],properties:{tags:{type:"array",items:{type:"string"}},summary:{type:"string"},description:{type:"string"},externalDocs:{$ref:"#/definitions/ExternalDocumentation"},operationId:{type:"string"},parameters:{type:"array",items:{oneOf:[{$ref:"#/definitions/Parameter"},{$ref:"#/definitions/Reference"}]},uniqueItems:!0},requestBody:{oneOf:[{$ref:"#/definitions/RequestBody"},{$ref:"#/definitions/Reference"}]},responses:{$ref:"#/definitions/Responses"},callbacks:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Callback"},{$ref:"#/definitions/Reference"}]}},deprecated:{type:"boolean",default:!1},security:{type:"array",items:{$ref:"#/definitions/SecurityRequirement"}},servers:{type:"array",items:{$ref:"#/definitions/Server"}}},patternProperties:{"^x-":{}},additionalProperties:!1},Responses:{type:"object",properties:{default:{oneOf:[{$ref:"#/definitions/Response"},{$ref:"#/definitions/Reference"}]}},patternProperties:{"^[1-5](?:\\d{2}|XX)$":{oneOf:[{$ref:"#/definitions/Response"},{$ref:"#/definitions/Reference"}]},"^x-":{}},minProperties:1,additionalProperties:!1},SecurityRequirement:{type:"object",additionalProperties:{type:"array",items:{type:"string"}}},Tag:{type:"object",required:["name"],properties:{name:{type:"string"},description:{type:"string"},externalDocs:{$ref:"#/definitions/ExternalDocumentation"}},patternProperties:{"^x-":{}},additionalProperties:!1},ExternalDocumentation:{type:"object",required:["url"],properties:{description:{type:"string"},url:{type:"string",format:"uri-reference"}},patternProperties:{"^x-":{}},additionalProperties:!1},ExampleXORExamples:{description:"Example and examples are mutually exclusive",not:{required:["example","examples"]}},SchemaXORContent:{description:"Schema and content are mutually exclusive, at least one is required",not:{required:["schema","content"]},oneOf:[{required:["schema"]},{required:["content"],description:"Some properties are not allowed if content is present",allOf:[{not:{required:["style"]}},{not:{required:["explode"]}},{not:{required:["allowReserved"]}},{not:{required:["example"]}},{not:{required:["examples"]}}]}]},Parameter:{type:"object",properties:{name:{type:"string"},in:{type:"string"},description:{type:"string"},required:{type:"boolean",default:!1},deprecated:{type:"boolean",default:!1},allowEmptyValue:{type:"boolean",default:!1},style:{type:"string"},explode:{type:"boolean"},allowReserved:{type:"boolean",default:!1},schema:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]},content:{type:"object",additionalProperties:{$ref:"#/definitions/MediaType"},minProperties:1,maxProperties:1},example:{},examples:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Example"},{$ref:"#/definitions/Reference"}]}}},patternProperties:{"^x-":{}},additionalProperties:!1,required:["name","in"],allOf:[{$ref:"#/definitions/ExampleXORExamples"},{$ref:"#/definitions/SchemaXORContent"},{$ref:"#/definitions/ParameterLocation"}]},ParameterLocation:{description:"Parameter location",oneOf:[{description:"Parameter in path",required:["required"],properties:{in:{enum:["path"]},style:{enum:["matrix","label","simple"],default:"simple"},required:{enum:[!0]}}},{description:"Parameter in query",properties:{in:{enum:["query"]},style:{enum:["form","spaceDelimited","pipeDelimited","deepObject"],default:"form"}}},{description:"Parameter in header",properties:{in:{enum:["header"]},style:{enum:["simple"],default:"simple"}}},{description:"Parameter in cookie",properties:{in:{enum:["cookie"]},style:{enum:["form"],default:"form"}}}]},RequestBody:{type:"object",required:["content"],properties:{description:{type:"string"},content:{type:"object",additionalProperties:{$ref:"#/definitions/MediaType"}},required:{type:"boolean",default:!1}},patternProperties:{"^x-":{}},additionalProperties:!1},SecurityScheme:{oneOf:[{$ref:"#/definitions/APIKeySecurityScheme"},{$ref:"#/definitions/HTTPSecurityScheme"},{$ref:"#/definitions/OAuth2SecurityScheme"},{$ref:"#/definitions/OpenIdConnectSecurityScheme"}]},APIKeySecurityScheme:{type:"object",required:["type","name","in"],properties:{type:{type:"string",enum:["apiKey"]},name:{type:"string"},in:{type:"string",enum:["header","query","cookie"]},description:{type:"string"}},patternProperties:{"^x-":{}},additionalProperties:!1},HTTPSecurityScheme:{type:"object",required:["scheme","type"],properties:{scheme:{type:"string"},bearerFormat:{type:"string"},description:{type:"string"},type:{type:"string",enum:["http"]}},patternProperties:{"^x-":{}},additionalProperties:!1,oneOf:[{description:"Bearer",properties:{scheme:{type:"string",pattern:"^[Bb][Ee][Aa][Rr][Ee][Rr]$"}}},{description:"Non Bearer",not:{required:["bearerFormat"]},properties:{scheme:{not:{type:"string",pattern:"^[Bb][Ee][Aa][Rr][Ee][Rr]$"}}}}]},OAuth2SecurityScheme:{type:"object",required:["type","flows"],properties:{type:{type:"string",enum:["oauth2"]},flows:{$ref:"#/definitions/OAuthFlows"},description:{type:"string"}},patternProperties:{"^x-":{}},additionalProperties:!1},OpenIdConnectSecurityScheme:{type:"object",required:["type","openIdConnectUrl"],properties:{type:{type:"string",enum:["openIdConnect"]},openIdConnectUrl:{type:"string",format:"uri-reference"},description:{type:"string"}},patternProperties:{"^x-":{}},additionalProperties:!1},OAuthFlows:{type:"object",properties:{implicit:{$ref:"#/definitions/ImplicitOAuthFlow"},password:{$ref:"#/definitions/PasswordOAuthFlow"},clientCredentials:{$ref:"#/definitions/ClientCredentialsFlow"},authorizationCode:{$ref:"#/definitions/AuthorizationCodeOAuthFlow"}},patternProperties:{"^x-":{}},additionalProperties:!1},ImplicitOAuthFlow:{type:"object",required:["authorizationUrl","scopes"],properties:{authorizationUrl:{type:"string",format:"uri-reference"},refreshUrl:{type:"string",format:"uri-reference"},scopes:{type:"object",additionalProperties:{type:"string"}}},patternProperties:{"^x-":{}},additionalProperties:!1},PasswordOAuthFlow:{type:"object",required:["tokenUrl","scopes"],properties:{tokenUrl:{type:"string",format:"uri-reference"},refreshUrl:{type:"string",format:"uri-reference"},scopes:{type:"object",additionalProperties:{type:"string"}}},patternProperties:{"^x-":{}},additionalProperties:!1},ClientCredentialsFlow:{type:"object",required:["tokenUrl","scopes"],properties:{tokenUrl:{type:"string",format:"uri-reference"},refreshUrl:{type:"string",format:"uri-reference"},scopes:{type:"object",additionalProperties:{type:"string"}}},patternProperties:{"^x-":{}},additionalProperties:!1},AuthorizationCodeOAuthFlow:{type:"object",required:["authorizationUrl","tokenUrl","scopes"],properties:{authorizationUrl:{type:"string",format:"uri-reference"},tokenUrl:{type:"string",format:"uri-reference"},refreshUrl:{type:"string",format:"uri-reference"},scopes:{type:"object",additionalProperties:{type:"string"}}},patternProperties:{"^x-":{}},additionalProperties:!1},Link:{type:"object",properties:{operationId:{type:"string"},operationRef:{type:"string",format:"uri-reference"},parameters:{type:"object",additionalProperties:{}},requestBody:{},description:{type:"string"},server:{$ref:"#/definitions/Server"}},patternProperties:{"^x-":{}},additionalProperties:!1,not:{description:"Operation Id and Operation Ref are mutually exclusive",required:["operationId","operationRef"]}},Callback:{type:"object",additionalProperties:{$ref:"#/definitions/PathItem"},patternProperties:{"^x-":{}}},Encoding:{type:"object",properties:{contentType:{type:"string"},headers:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Header"},{$ref:"#/definitions/Reference"}]}},style:{type:"string",enum:["form","spaceDelimited","pipeDelimited","deepObject"]},explode:{type:"boolean"},allowReserved:{type:"boolean",default:!1}},additionalProperties:!1}}};function eA(e){if(new Date(e).getTime()>0)return Number(e);throw new an(new Error("invalid timestamp"),["invalid timestamp"])}async function tA(e){const t=[],r=Object.keys(e);(r.length<10||r.length>11)&&t.push(new an(new Error("Invalid agreeemt: "+JSON.stringify(e,void 0,2)),["invalid format"]));for(const n of r){let r;switch(n){case"orig":case"dest":try{e[n]!==await ao(JSON.parse(e[n]),!0)&&t.push(new an(`[dataExchangeAgreeement.${n}] A valid stringified JWK must be provided. For uniqueness, JWK claims must be alphabetically sorted in the stringified JWK. You can use the parseJWK(jwk, true) for that purpose.\n${e[n]}`,["invalid key","invalid format"]))}catch(e){t.push(new an(`[dataExchangeAgreeement.${n}] A valid stringified JWK must be provided. For uniqueness, JWK claims must be alphabetically sorted in the stringified JWK. You can use the parseJWK(jwk, true) for that purpose.`,["invalid key","invalid format"]))}break;case"ledgerContractAddress":case"ledgerSignerAddress":try{r=qh(e[n]),e[n]!==r&&t.push(new an(`[dataExchangeAgreeement.${n}] Invalid EIP-55 address ${e[n]}. Did you mean ${r} instead?`,["invalid EIP-55 address","invalid format"]))}catch(r){t.push(new an(`[dataExchangeAgreeement.${n}] Invalid EIP-55 address ${e[n]}.`,["invalid EIP-55 address","invalid format"]))}break;case"pooToPorDelay":case"pooToPopDelay":case"pooToSecretDelay":try{e[n]!==eA(e[n])&&t.push(new an(`[dataExchangeAgreeement.${n}] < 0 or not a number`,["invalid timestamp","invalid format"]))}catch(e){t.push(new an(`[dataExchangeAgreeement.${n}] < 0 or not a number`,["invalid timestamp","invalid format"]))}break;case"hashAlg":tn.includes(e[n])||t.push(new an(`[dataExchangeAgreeement.${n}Invalid hash algorithm '${e[n]}'. It must be one of: ${tn.join(", ")}`,["invalid algorithm"]));break;case"encAlg":nn.includes(e[n])||t.push(new an(`[dataExchangeAgreeement.${n}Invalid encryption algorithm '${e[n]}'. It must be one of: ${nn.join(", ")}`,["invalid algorithm"]));break;case"signingAlg":rn.includes(e[n])||t.push(new an(`[dataExchangeAgreeement.${n}Invalid signing algorithm '${e[n]}'. It must be one of: ${rn.join(", ")}`,["invalid algorithm"]));break;case"schema":break;default:t.push(new an(new Error(`Property ${n} not allowed in dataAgreement`),["invalid format"]))}}return t}var rA=Object.freeze({__proto__:null,NonRepudiationDest:class{constructor(e,t,r){this.initialized=new Promise(((n,i)=>{this.asyncConstructor(e,t,r).then((()=>{n(!0)})).catch((e=>{i(e)}))}))}async asyncConstructor(e,t,r){const n=await tA(e);if(n.length>0){const e=[];let t=[];throw n.forEach((r=>{e.push(r.message),t=t.concat(r.nrErrors)})),t=[...new Set(t)],new an("Resource has not been validated:\n"+e.join("\n"),t)}this.agreement=e,this.jwkPairDest={privateJwk:t,publicJwk:JSON.parse(e.dest)},this.publicJwkOrig=JSON.parse(e.orig),await Yi(this.jwkPairDest.publicJwk,this.jwkPairDest.privateJwk),this.dltAgent=r;const i=await this.dltAgent.getContractAddress();if(this.agreement.ledgerContractAddress!==i)throw new Error(`Contract address ${i} does not meet agreed one ${this.agreement.ledgerContractAddress}`);this.block={}}async verifyPoO(e,t,r){await this.initialized;const i=n(await so(t,this.agreement.hashAlg),!0,!1),{payload:o}=await Zi(e),a={...this.agreement,cipherblockDgst:i,blockCommitment:o.exchange.blockCommitment,secretCommitment:o.exchange.secretCommitment},s={proofType:"PoO",iss:"orig",exchange:{...a,id:await Hh(a)}},c={timestamp:Date.now(),notBefore:"iat",notAfter:"iat",...r},u=await Jh(e,s,c);return this.block={jwe:t,poo:{jws:e,payload:u.payload}},this.exchange=u.payload.exchange,u}async generatePoR(){if(await this.initialized,void 0===this.exchange||void 0===this.block.poo)throw new Error("Before computing a PoR, you have first to receive a valid cipherblock with a PoO and validate the PoO");const e={proofType:"PoR",iss:"dest",exchange:this.exchange,poo:this.block.poo.jws};return this.block.por=await Kh(e,this.jwkPairDest.privateJwk),this.block.por}async verifyPoP(e,t){if(await this.initialized,void 0===this.exchange||void 0===this.block.por||void 0===this.block.poo)throw new Error("Cannot verify a PoP if not even a PoR have been created");const r={proofType:"PoP",iss:"orig",exchange:this.exchange,por:this.block.por.jws,secret:"",verificationCode:""},n={timestamp:Date.now(),notBefore:"iat",notAfter:1e3*this.block.poo.payload.iat+this.exchange.pooToPopDelay,...t},o=await Jh(e,r,n),s=JSON.parse(o.payload.secret);return this.block.secret={hex:a(i(s.k)),jwk:s},this.block.pop={jws:e,payload:o.payload},o}async getSecretFromLedger(){if(await this.initialized,void 0===this.exchange||void 0===this.block.poo||void 0===this.block.por)throw new Error("Cannot get secret if a PoR has not been sent before");const e=Date.now(),t=1e3*this.block.poo.payload.iat+this.agreement.pooToSecretDelay,r=Math.round((t-e)/1e3),{hex:n,iat:i}=await this.dltAgent.getSecretFromLedger(Xi(this.agreement.encAlg),this.agreement.ledgerSignerAddress,this.exchange.id,r);this.block.secret=await Qi(this.exchange.encAlg,n);try{no(1e3*i,1e3*this.block.por.payload.iat,1e3*this.block.poo.payload.iat+this.exchange.pooToSecretDelay)}catch(e){throw new an(`Although the secret has been obtained (and you could try to decrypt the cipherblock), it's been published later than agreed: ${new Date(1e3*i).toUTCString()} > ${new Date(1e3*this.block.poo.payload.iat+this.agreement.pooToSecretDelay).toUTCString()}`,["secret not published in time"])}return this.block.secret}async decrypt(){if(await this.initialized,void 0===this.exchange)throw new Error("No agreed exchange");if(void 0===this.block.secret?.jwk)throw new Error("Cannot decrypt without the secret");if(void 0===this.block.jwe)throw new Error("No cipherblock to decrypt");const e=(await Vi(this.block.jwe,this.block.secret.jwk)).plaintext;if(n(await so(e,this.agreement.hashAlg),!0,!1)!==this.exchange.blockCommitment)throw new Error("Decrypted block does not meet the committed one");return this.block.raw=e,e}async generateVerificationRequest(){if(await this.initialized,void 0===this.block.por||void 0===this.exchange)throw new Error("Before generating a VerificationRequest, you have first to hold a valid PoR for the exchange");return await Xh("dest",this.exchange.id,this.block.por.jws,this.jwkPairDest.privateJwk)}async generateDisputeRequest(){if(await this.initialized,void 0===this.block.por||void 0===this.block.jwe||void 0===this.exchange)throw new Error("Before generating a VerificationRequest, you have first to hold a valid PoR for the exchange and have received the cipherblock");const e={proofType:"request",iss:"dest",por:this.block.por.jws,type:"disputeRequest",cipherblock:this.block.jwe,iat:Math.floor(Date.now()/1e3),dataExchangeId:this.exchange.id},t=await Wi(this.jwkPairDest.privateJwk);try{return await new Hi(e).setProtectedHeader({alg:this.jwkPairDest.privateJwk.alg}).setIssuedAt(e.iat).sign(t)}catch(e){throw new an(e,["unexpected error"])}}},NonRepudiationOrig:class{constructor(e,t,r,n){this.jwkPairOrig={privateJwk:t,publicJwk:JSON.parse(e.orig)},this.publicJwkDest=JSON.parse(e.dest),this.block={raw:r},this.initialized=new Promise(((t,r)=>{this.init(e,n).then((()=>{t(!0)})).catch((e=>{r(e)}))}))}async init(e,t){const r=await tA(e);if(r.length>0){const e=[];let t=[];throw r.forEach((r=>{e.push(r.message),t=t.concat(r.nrErrors)})),t=[...new Set(t)],new an("Resource has not been validated:\n"+e.join("\n"),t)}this.agreement=e,await Yi(this.jwkPairOrig.publicJwk,this.jwkPairOrig.privateJwk);const i=await Qi(this.agreement.encAlg);this.block={...this.block,secret:i,jwe:await Gi(this.block.raw,i.jwk,this.agreement.encAlg)};const o=n(await so(this.block.jwe,this.agreement.hashAlg),!0,!1),a=n(await so(this.block.raw,this.agreement.hashAlg),!0,!1),c=n(await so(new Uint8Array(s(this.block.secret.hex)),this.agreement.hashAlg),!0,!1),u={...this.agreement,cipherblockDgst:o,blockCommitment:a,secretCommitment:c},f=await Hh(u);this.exchange={...u,id:f},await this._dltSetup(t)}async _dltSetup(e){this.dltAgent=e;const t=await this.dltAgent.getAddress();if(t!==this.exchange.ledgerSignerAddress)throw new Error(`ledgerSignerAddress: ${this.exchange.ledgerSignerAddress} does not meet the address ${t} derived from the provided private key`);const r=await this.dltAgent.getContractAddress();if(r!==oo(this.agreement.ledgerContractAddress,!0))throw new Error(`Contract address in use ${r} does not meet the agreed one ${this.agreement.ledgerContractAddress}`)}async generatePoO(){return await this.initialized,this.block.poo=await Kh({proofType:"PoO",iss:"orig",exchange:this.exchange},this.jwkPairOrig.privateJwk),this.block.poo}async verifyPoR(e,t){if(await this.initialized,void 0===this.block.poo)throw new Error("Cannot verify a PoR if not even a PoO have been created");const r={proofType:"PoR",iss:"dest",exchange:this.exchange,poo:this.block.poo.jws},n=1e3*this.block.poo.payload.iat,i={timestamp:Date.now(),notBefore:n,notAfter:n+this.exchange.pooToPorDelay,...t},o=await Jh(e,r,i);return this.block.por={jws:e,payload:o.payload},this.block.por}async generatePoP(){if(await this.initialized,void 0===this.block.por)throw new Error("Before computing a PoP, you have first to have received and verified the PoR");const e=await this.dltAgent.deploySecret(this.block.secret.hex,this.exchange.id),t={proofType:"PoP",iss:"orig",exchange:this.exchange,por:this.block.por.jws,secret:JSON.stringify(this.block.secret.jwk),verificationCode:e};return this.block.pop=await Kh(t,this.jwkPairOrig.privateJwk),this.block.pop}async generateVerificationRequest(){if(await this.initialized,void 0===this.block.por)throw new Error("Before generating a VerificationRequest, you have first to hold a valid PoR for the exchange");return await Xh("orig",this.exchange.id,this.block.por.jws,this.jwkPairOrig.privateJwk)}}});return e.ConflictResolution=Qh,e.ENC_ALGS=nn,e.EthersIoAgentDest=ip,e.EthersIoAgentOrig=Rp,e.HASH_ALGS=tn,e.I3mServerWalletAgentDest=cp,e.I3mServerWalletAgentOrig=Op,e.I3mWalletAgentDest=ap,e.I3mWalletAgentOrig=Np,e.KEY_AGREEMENT_ALGS=on,e.NonRepudiationProtocol=rA,e.NrError=an,e.SIGNING_ALGS=rn,e.Signers=Tp,e.checkTimestamp=no,e.createProof=Kh,e.defaultDltConfig=Yh,e.exchangeId=Hh,e.generateKeys=async function(e,t,r){if(!rn.includes(e))throw new an(new RangeError(`Invalid signature algorithm '${e}''. Allowed algorithms are ${rn.toString()}`),["invalid algorithm"]);let o,a,u;switch(e){case"ES512":a="P-521",o=66;break;case"ES384":a="P-384",o=48;break;default:a="P-256",o=32}u=void 0!==t?"string"==typeof t?!0===r?i(t):new Uint8Array(s(t)):t:new Uint8Array(await c(o));const f=new sn("p"+a.substring(a.length-3)).keyFromPrivate(u),d=f.getPublic(),l=d.getX().toString("hex").padStart(2*o,"0"),h=d.getY().toString("hex").padStart(2*o,"0"),p=f.getPrivate("hex").padStart(2*o,"0"),m={kty:"EC",crv:a,x:n(s(l),!0,!1),y:n(s(h),!0,!1),d:n(s(p),!0,!1),alg:e},g={...m};return delete g.d,{publicJwk:g,privateJwk:m}},e.getDltAddress=function(e){const t=e.match(/^did:ethr:(\w+:)?(0x[0-9a-fA-F]{40}[0-9a-fA-F]{26}?)$/),r=null!==t?t[t.length-1]:e;try{return Mf(r)}catch(e){throw new an("no a DID or a valid public or private key",["invalid format"])}},e.importJwk=Wi,e.jsonSort=io,e.jweDecrypt=Vi,e.jweEncrypt=Gi,e.jwsDecode=Zi,e.oneTimeSecret=Qi,e.parseAddress=qh,e.parseHex=oo,e.parseJwk=ao,e.sha=so,e.validateDataExchange=async function(e){const t=[];try{const{id:r,...n}=e;r!==await Hh(n)&&t.push(new an("Invalid dataExchange id",["cannot verify","invalid format"]));const{blockCommitment:i,secretCommitment:o,cipherblockDgst:a,...s}=n,c=await tA(s);c.length>0&&c.forEach((e=>{t.push(e)}))}catch(e){t.push(new an("Invalid dataExchange",["cannot verify","invalid format"]))}return t},e.validateDataExchangeAgreement=tA,e.validateDataSharingAgreementSchema=async function(e){const t=[],r=new pw({strictSchema:!1,removeAdditional:"all"});r.addMetaSchema(Yw),Zw(r);const n=jp.schemas.DataSharingAgreement;try{const i=r.compile(n),o=Qw.cloneDeep(e);i(e)||null!==i.errors&&void 0!==i.errors&&i.errors.length>0&&i.errors.forEach((e=>{t.push(new an(`[${e.instancePath}] ${e.message??"unknown"}`,["invalid format"]))})),ro(o)!==ro(e)&&t.push(new an("Additional claims beyond the schema are not supported",["invalid format"]))}catch(e){t.push(new an(e,["invalid format"]))}return t},e.verifyKeyPair=Yi,e.verifyProof=Jh,e}({}); diff --git a/dist/bundle.umd.js b/dist/bundle.umd.js index 3663713..f441a1d 100644 --- a/dist/bundle.umd.js +++ b/dist/bundle.umd.js @@ -1,17 +1,17 @@ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).nonRepudiationLibrary={})}(this,(function(e){"use strict";function t(e,t=!1,r=!0){let n="";return n=(e=>{const t=[];for(let r=0;re.charCodeAt(0))));return t?(new TextDecoder).decode(n):n}}function n(e,t=!1,r){const n=e.match(/^(0x)?([\da-fA-F]+)$/);if(null==n)throw new RangeError("input must be a hexadecimal string, e.g. '0x124fe3a' or '0214f1b2'");let i=n[2];if(void 0!==r){if(r{i+=o[e>>4]+o[15&e]})),n(i,t,r)}}function o(e,t=!1){let r=n(e);return r=n(e,!1,Math.ceil(r.length/2)),Uint8Array.from(r.match(/[\da-fA-F]{2}/g).map((e=>parseInt(e,16)))).buffer}function a(e,t=!1){if(e<1)throw new RangeError("byteLength MUST be > 0");return new Promise((function(r,n){{const n=new Uint8Array(e);if(e<=65536)self.crypto.getRandomValues(n);else for(let t=0;t=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function s(e,t,r){var n=a(e,r);return r-1>=t&&(n|=a(e,r-1)<<4),n}function c(e,t,r,n){for(var i=0,o=Math.min(e.length,r),a=t;a=49?s-49+10:s>=17?s-17+10:s}return i}i.isBN=function(e){return e instanceof i||null!==e&&"object"==typeof e&&e.constructor.wordSize===i.wordSize&&Array.isArray(e.words)},i.max=function(e,t){return e.cmp(t)>0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,n){if("number"==typeof e)return this._initNumber(e,t,n);if("object"==typeof e)return this._initArray(e,t,n);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)a=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===n)for(i=0,o=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this.strip()},i.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n=t;n-=2)i=s(e,t,n)<=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(n=(e.length-t)%2==0?t+1:t;n=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this.strip()},i.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,a=o%n,s=Math.min(o,o-a)+r,u=0,f=r;f1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?""};var u=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],f=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function l(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],a=i*o,s=67108863&a,c=a/67108864|0;r.words[0]=s;for(var u=1;u>>26,d=67108863&c,l=Math.min(u,t.length-1),h=Math.max(0,u-e.length+1);h<=l;h++){var p=u-h|0;f+=(a=(i=0|e.words[p])*(o=0|t.words[h])+d)/67108864|0,d=67108863&a}r.words[u]=0|d,c=0|f}return 0!==c?r.words[u]=0|c:r.length--,r.strip()}i.prototype.toString=function(e,t){var n;if(t=0|t||1,16===(e=e||10)||"hex"===e){n="";for(var i=0,o=0,a=0;a>>24-i&16777215)||a!==this.length-1?u[6-c.length]+c+n:c+n,(i+=2)>=26&&(i-=26,a--)}for(0!==o&&(n=o.toString(16)+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(e===(0|e)&&e>=2&&e<=36){var l=f[e],h=d[e];n="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(h).toString(e);n=(p=p.idivn(h)).isZero()?m+n:u[l-m.length]+m+n}for(this.isZero()&&(n="0"+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},i.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&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(e,t){return r(void 0!==o),this.toArrayLike(o,e,t)},i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},i.prototype.toArrayLike=function(e,t,n){var i=this.byteLength(),o=n||Math.max(1,i);r(i<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0"),this.strip();var a,s,c="le"===t,u=new e(o),f=this.clone();if(c){for(s=0;!f.isZero();s++)a=f.andln(255),f.iushrn(8),u[s]=a;for(;s=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){r("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),n>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-n),this.strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){r("number"==typeof e&&e>=0);var n=e/26|0,i=e%26;return this._expand(n+1),this.words[n]=t?this.words[n]|1<e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},i.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,a=0;a>26,this.words[a]=67108863&t;for(;0!==o&&a>26,this.words[a]=67108863&t;if(0===o&&a>>13,h=0|a[1],p=8191&h,m=h>>>13,g=0|a[2],y=8191&g,b=g>>>13,v=0|a[3],w=8191&v,A=v>>>13,_=0|a[4],E=8191&_,S=_>>>13,P=0|a[5],x=8191&P,k=P>>>13,M=0|a[6],C=8191&M,I=M>>>13,R=0|a[7],N=8191&R,O=R>>>13,T=0|a[8],j=8191&T,D=T>>>13,$=0|a[9],B=8191&$,F=$>>>13,z=0|s[0],U=8191&z,L=z>>>13,q=0|s[1],H=8191&q,K=q>>>13,J=0|s[2],W=8191&J,G=J>>>13,V=0|s[3],Z=8191&V,X=V>>>13,Q=0|s[4],Y=8191&Q,ee=Q>>>13,te=0|s[5],re=8191&te,ne=te>>>13,ie=0|s[6],oe=8191&ie,ae=ie>>>13,se=0|s[7],ce=8191&se,ue=se>>>13,fe=0|s[8],de=8191&fe,le=fe>>>13,he=0|s[9],pe=8191&he,me=he>>>13;r.negative=e.negative^t.negative,r.length=19;var ge=(u+(n=Math.imul(d,U))|0)+((8191&(i=(i=Math.imul(d,L))+Math.imul(l,U)|0))<<13)|0;u=((o=Math.imul(l,L))+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(p,U),i=(i=Math.imul(p,L))+Math.imul(m,U)|0,o=Math.imul(m,L);var ye=(u+(n=n+Math.imul(d,H)|0)|0)+((8191&(i=(i=i+Math.imul(d,K)|0)+Math.imul(l,H)|0))<<13)|0;u=((o=o+Math.imul(l,K)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(y,U),i=(i=Math.imul(y,L))+Math.imul(b,U)|0,o=Math.imul(b,L),n=n+Math.imul(p,H)|0,i=(i=i+Math.imul(p,K)|0)+Math.imul(m,H)|0,o=o+Math.imul(m,K)|0;var be=(u+(n=n+Math.imul(d,W)|0)|0)+((8191&(i=(i=i+Math.imul(d,G)|0)+Math.imul(l,W)|0))<<13)|0;u=((o=o+Math.imul(l,G)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(w,U),i=(i=Math.imul(w,L))+Math.imul(A,U)|0,o=Math.imul(A,L),n=n+Math.imul(y,H)|0,i=(i=i+Math.imul(y,K)|0)+Math.imul(b,H)|0,o=o+Math.imul(b,K)|0,n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(m,W)|0,o=o+Math.imul(m,G)|0;var ve=(u+(n=n+Math.imul(d,Z)|0)|0)+((8191&(i=(i=i+Math.imul(d,X)|0)+Math.imul(l,Z)|0))<<13)|0;u=((o=o+Math.imul(l,X)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(E,U),i=(i=Math.imul(E,L))+Math.imul(S,U)|0,o=Math.imul(S,L),n=n+Math.imul(w,H)|0,i=(i=i+Math.imul(w,K)|0)+Math.imul(A,H)|0,o=o+Math.imul(A,K)|0,n=n+Math.imul(y,W)|0,i=(i=i+Math.imul(y,G)|0)+Math.imul(b,W)|0,o=o+Math.imul(b,G)|0,n=n+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,X)|0;var we=(u+(n=n+Math.imul(d,Y)|0)|0)+((8191&(i=(i=i+Math.imul(d,ee)|0)+Math.imul(l,Y)|0))<<13)|0;u=((o=o+Math.imul(l,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(x,U),i=(i=Math.imul(x,L))+Math.imul(k,U)|0,o=Math.imul(k,L),n=n+Math.imul(E,H)|0,i=(i=i+Math.imul(E,K)|0)+Math.imul(S,H)|0,o=o+Math.imul(S,K)|0,n=n+Math.imul(w,W)|0,i=(i=i+Math.imul(w,G)|0)+Math.imul(A,W)|0,o=o+Math.imul(A,G)|0,n=n+Math.imul(y,Z)|0,i=(i=i+Math.imul(y,X)|0)+Math.imul(b,Z)|0,o=o+Math.imul(b,X)|0,n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(m,Y)|0,o=o+Math.imul(m,ee)|0;var Ae=(u+(n=n+Math.imul(d,re)|0)|0)+((8191&(i=(i=i+Math.imul(d,ne)|0)+Math.imul(l,re)|0))<<13)|0;u=((o=o+Math.imul(l,ne)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(C,U),i=(i=Math.imul(C,L))+Math.imul(I,U)|0,o=Math.imul(I,L),n=n+Math.imul(x,H)|0,i=(i=i+Math.imul(x,K)|0)+Math.imul(k,H)|0,o=o+Math.imul(k,K)|0,n=n+Math.imul(E,W)|0,i=(i=i+Math.imul(E,G)|0)+Math.imul(S,W)|0,o=o+Math.imul(S,G)|0,n=n+Math.imul(w,Z)|0,i=(i=i+Math.imul(w,X)|0)+Math.imul(A,Z)|0,o=o+Math.imul(A,X)|0,n=n+Math.imul(y,Y)|0,i=(i=i+Math.imul(y,ee)|0)+Math.imul(b,Y)|0,o=o+Math.imul(b,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(m,re)|0,o=o+Math.imul(m,ne)|0;var _e=(u+(n=n+Math.imul(d,oe)|0)|0)+((8191&(i=(i=i+Math.imul(d,ae)|0)+Math.imul(l,oe)|0))<<13)|0;u=((o=o+Math.imul(l,ae)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(N,U),i=(i=Math.imul(N,L))+Math.imul(O,U)|0,o=Math.imul(O,L),n=n+Math.imul(C,H)|0,i=(i=i+Math.imul(C,K)|0)+Math.imul(I,H)|0,o=o+Math.imul(I,K)|0,n=n+Math.imul(x,W)|0,i=(i=i+Math.imul(x,G)|0)+Math.imul(k,W)|0,o=o+Math.imul(k,G)|0,n=n+Math.imul(E,Z)|0,i=(i=i+Math.imul(E,X)|0)+Math.imul(S,Z)|0,o=o+Math.imul(S,X)|0,n=n+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(A,Y)|0,o=o+Math.imul(A,ee)|0,n=n+Math.imul(y,re)|0,i=(i=i+Math.imul(y,ne)|0)+Math.imul(b,re)|0,o=o+Math.imul(b,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,ae)|0)+Math.imul(m,oe)|0,o=o+Math.imul(m,ae)|0;var Ee=(u+(n=n+Math.imul(d,ce)|0)|0)+((8191&(i=(i=i+Math.imul(d,ue)|0)+Math.imul(l,ce)|0))<<13)|0;u=((o=o+Math.imul(l,ue)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(j,U),i=(i=Math.imul(j,L))+Math.imul(D,U)|0,o=Math.imul(D,L),n=n+Math.imul(N,H)|0,i=(i=i+Math.imul(N,K)|0)+Math.imul(O,H)|0,o=o+Math.imul(O,K)|0,n=n+Math.imul(C,W)|0,i=(i=i+Math.imul(C,G)|0)+Math.imul(I,W)|0,o=o+Math.imul(I,G)|0,n=n+Math.imul(x,Z)|0,i=(i=i+Math.imul(x,X)|0)+Math.imul(k,Z)|0,o=o+Math.imul(k,X)|0,n=n+Math.imul(E,Y)|0,i=(i=i+Math.imul(E,ee)|0)+Math.imul(S,Y)|0,o=o+Math.imul(S,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(A,re)|0,o=o+Math.imul(A,ne)|0,n=n+Math.imul(y,oe)|0,i=(i=i+Math.imul(y,ae)|0)+Math.imul(b,oe)|0,o=o+Math.imul(b,ae)|0,n=n+Math.imul(p,ce)|0,i=(i=i+Math.imul(p,ue)|0)+Math.imul(m,ce)|0,o=o+Math.imul(m,ue)|0;var Se=(u+(n=n+Math.imul(d,de)|0)|0)+((8191&(i=(i=i+Math.imul(d,le)|0)+Math.imul(l,de)|0))<<13)|0;u=((o=o+Math.imul(l,le)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(B,U),i=(i=Math.imul(B,L))+Math.imul(F,U)|0,o=Math.imul(F,L),n=n+Math.imul(j,H)|0,i=(i=i+Math.imul(j,K)|0)+Math.imul(D,H)|0,o=o+Math.imul(D,K)|0,n=n+Math.imul(N,W)|0,i=(i=i+Math.imul(N,G)|0)+Math.imul(O,W)|0,o=o+Math.imul(O,G)|0,n=n+Math.imul(C,Z)|0,i=(i=i+Math.imul(C,X)|0)+Math.imul(I,Z)|0,o=o+Math.imul(I,X)|0,n=n+Math.imul(x,Y)|0,i=(i=i+Math.imul(x,ee)|0)+Math.imul(k,Y)|0,o=o+Math.imul(k,ee)|0,n=n+Math.imul(E,re)|0,i=(i=i+Math.imul(E,ne)|0)+Math.imul(S,re)|0,o=o+Math.imul(S,ne)|0,n=n+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,ae)|0)+Math.imul(A,oe)|0,o=o+Math.imul(A,ae)|0,n=n+Math.imul(y,ce)|0,i=(i=i+Math.imul(y,ue)|0)+Math.imul(b,ce)|0,o=o+Math.imul(b,ue)|0,n=n+Math.imul(p,de)|0,i=(i=i+Math.imul(p,le)|0)+Math.imul(m,de)|0,o=o+Math.imul(m,le)|0;var Pe=(u+(n=n+Math.imul(d,pe)|0)|0)+((8191&(i=(i=i+Math.imul(d,me)|0)+Math.imul(l,pe)|0))<<13)|0;u=((o=o+Math.imul(l,me)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(B,H),i=(i=Math.imul(B,K))+Math.imul(F,H)|0,o=Math.imul(F,K),n=n+Math.imul(j,W)|0,i=(i=i+Math.imul(j,G)|0)+Math.imul(D,W)|0,o=o+Math.imul(D,G)|0,n=n+Math.imul(N,Z)|0,i=(i=i+Math.imul(N,X)|0)+Math.imul(O,Z)|0,o=o+Math.imul(O,X)|0,n=n+Math.imul(C,Y)|0,i=(i=i+Math.imul(C,ee)|0)+Math.imul(I,Y)|0,o=o+Math.imul(I,ee)|0,n=n+Math.imul(x,re)|0,i=(i=i+Math.imul(x,ne)|0)+Math.imul(k,re)|0,o=o+Math.imul(k,ne)|0,n=n+Math.imul(E,oe)|0,i=(i=i+Math.imul(E,ae)|0)+Math.imul(S,oe)|0,o=o+Math.imul(S,ae)|0,n=n+Math.imul(w,ce)|0,i=(i=i+Math.imul(w,ue)|0)+Math.imul(A,ce)|0,o=o+Math.imul(A,ue)|0,n=n+Math.imul(y,de)|0,i=(i=i+Math.imul(y,le)|0)+Math.imul(b,de)|0,o=o+Math.imul(b,le)|0;var xe=(u+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,me)|0)+Math.imul(m,pe)|0))<<13)|0;u=((o=o+Math.imul(m,me)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(B,W),i=(i=Math.imul(B,G))+Math.imul(F,W)|0,o=Math.imul(F,G),n=n+Math.imul(j,Z)|0,i=(i=i+Math.imul(j,X)|0)+Math.imul(D,Z)|0,o=o+Math.imul(D,X)|0,n=n+Math.imul(N,Y)|0,i=(i=i+Math.imul(N,ee)|0)+Math.imul(O,Y)|0,o=o+Math.imul(O,ee)|0,n=n+Math.imul(C,re)|0,i=(i=i+Math.imul(C,ne)|0)+Math.imul(I,re)|0,o=o+Math.imul(I,ne)|0,n=n+Math.imul(x,oe)|0,i=(i=i+Math.imul(x,ae)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,ae)|0,n=n+Math.imul(E,ce)|0,i=(i=i+Math.imul(E,ue)|0)+Math.imul(S,ce)|0,o=o+Math.imul(S,ue)|0,n=n+Math.imul(w,de)|0,i=(i=i+Math.imul(w,le)|0)+Math.imul(A,de)|0,o=o+Math.imul(A,le)|0;var ke=(u+(n=n+Math.imul(y,pe)|0)|0)+((8191&(i=(i=i+Math.imul(y,me)|0)+Math.imul(b,pe)|0))<<13)|0;u=((o=o+Math.imul(b,me)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(B,Z),i=(i=Math.imul(B,X))+Math.imul(F,Z)|0,o=Math.imul(F,X),n=n+Math.imul(j,Y)|0,i=(i=i+Math.imul(j,ee)|0)+Math.imul(D,Y)|0,o=o+Math.imul(D,ee)|0,n=n+Math.imul(N,re)|0,i=(i=i+Math.imul(N,ne)|0)+Math.imul(O,re)|0,o=o+Math.imul(O,ne)|0,n=n+Math.imul(C,oe)|0,i=(i=i+Math.imul(C,ae)|0)+Math.imul(I,oe)|0,o=o+Math.imul(I,ae)|0,n=n+Math.imul(x,ce)|0,i=(i=i+Math.imul(x,ue)|0)+Math.imul(k,ce)|0,o=o+Math.imul(k,ue)|0,n=n+Math.imul(E,de)|0,i=(i=i+Math.imul(E,le)|0)+Math.imul(S,de)|0,o=o+Math.imul(S,le)|0;var Me=(u+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,me)|0)+Math.imul(A,pe)|0))<<13)|0;u=((o=o+Math.imul(A,me)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(B,Y),i=(i=Math.imul(B,ee))+Math.imul(F,Y)|0,o=Math.imul(F,ee),n=n+Math.imul(j,re)|0,i=(i=i+Math.imul(j,ne)|0)+Math.imul(D,re)|0,o=o+Math.imul(D,ne)|0,n=n+Math.imul(N,oe)|0,i=(i=i+Math.imul(N,ae)|0)+Math.imul(O,oe)|0,o=o+Math.imul(O,ae)|0,n=n+Math.imul(C,ce)|0,i=(i=i+Math.imul(C,ue)|0)+Math.imul(I,ce)|0,o=o+Math.imul(I,ue)|0,n=n+Math.imul(x,de)|0,i=(i=i+Math.imul(x,le)|0)+Math.imul(k,de)|0,o=o+Math.imul(k,le)|0;var Ce=(u+(n=n+Math.imul(E,pe)|0)|0)+((8191&(i=(i=i+Math.imul(E,me)|0)+Math.imul(S,pe)|0))<<13)|0;u=((o=o+Math.imul(S,me)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(B,re),i=(i=Math.imul(B,ne))+Math.imul(F,re)|0,o=Math.imul(F,ne),n=n+Math.imul(j,oe)|0,i=(i=i+Math.imul(j,ae)|0)+Math.imul(D,oe)|0,o=o+Math.imul(D,ae)|0,n=n+Math.imul(N,ce)|0,i=(i=i+Math.imul(N,ue)|0)+Math.imul(O,ce)|0,o=o+Math.imul(O,ue)|0,n=n+Math.imul(C,de)|0,i=(i=i+Math.imul(C,le)|0)+Math.imul(I,de)|0,o=o+Math.imul(I,le)|0;var Ie=(u+(n=n+Math.imul(x,pe)|0)|0)+((8191&(i=(i=i+Math.imul(x,me)|0)+Math.imul(k,pe)|0))<<13)|0;u=((o=o+Math.imul(k,me)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(B,oe),i=(i=Math.imul(B,ae))+Math.imul(F,oe)|0,o=Math.imul(F,ae),n=n+Math.imul(j,ce)|0,i=(i=i+Math.imul(j,ue)|0)+Math.imul(D,ce)|0,o=o+Math.imul(D,ue)|0,n=n+Math.imul(N,de)|0,i=(i=i+Math.imul(N,le)|0)+Math.imul(O,de)|0,o=o+Math.imul(O,le)|0;var Re=(u+(n=n+Math.imul(C,pe)|0)|0)+((8191&(i=(i=i+Math.imul(C,me)|0)+Math.imul(I,pe)|0))<<13)|0;u=((o=o+Math.imul(I,me)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(B,ce),i=(i=Math.imul(B,ue))+Math.imul(F,ce)|0,o=Math.imul(F,ue),n=n+Math.imul(j,de)|0,i=(i=i+Math.imul(j,le)|0)+Math.imul(D,de)|0,o=o+Math.imul(D,le)|0;var Ne=(u+(n=n+Math.imul(N,pe)|0)|0)+((8191&(i=(i=i+Math.imul(N,me)|0)+Math.imul(O,pe)|0))<<13)|0;u=((o=o+Math.imul(O,me)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,n=Math.imul(B,de),i=(i=Math.imul(B,le))+Math.imul(F,de)|0,o=Math.imul(F,le);var Oe=(u+(n=n+Math.imul(j,pe)|0)|0)+((8191&(i=(i=i+Math.imul(j,me)|0)+Math.imul(D,pe)|0))<<13)|0;u=((o=o+Math.imul(D,me)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863;var Te=(u+(n=Math.imul(B,pe))|0)+((8191&(i=(i=Math.imul(B,me))+Math.imul(F,pe)|0))<<13)|0;return u=((o=Math.imul(F,me))+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,c[0]=ge,c[1]=ye,c[2]=be,c[3]=ve,c[4]=we,c[5]=Ae,c[6]=_e,c[7]=Ee,c[8]=Se,c[9]=Pe,c[10]=xe,c[11]=ke,c[12]=Me,c[13]=Ce,c[14]=Ie,c[15]=Re,c[16]=Ne,c[17]=Oe,c[18]=Te,0!==u&&(c[19]=u,r.length++),r};function m(e,t,r){return(new g).mulp(e,t,r)}function g(e,t){this.x=e,this.y=t}Math.imul||(h=l),i.prototype.mulTo=function(e,t){var r,n=this.length+e.length;return r=10===this.length&&10===e.length?h(this,e,t):n<63?l(this,e,t):n<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,a&=67108863}r.words[o]=s,n=a,a=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,e,t):m(this,e,t),r},g.prototype.makeRBT=function(e){for(var t=new Array(e),r=i.prototype._countBits(e)-1,n=0;n>=1;return n},g.prototype.permute=function(e,t,r,n,i,o){for(var a=0;a>>=1)i++;return 1<>>=13,n[2*a+1]=8191&o,o>>>=13;for(a=2*t;a>=26,t+=i/67108864|0,t+=o>>>26,this.words[n]=67108863&o}return 0!==t&&(this.words[n]=t,this.length++),this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>i}return t}(e);if(0===t.length)return new i(1);for(var r=this,n=0;n=0);var t,n=e%26,i=(e-n)/26,o=67108863>>>26-n<<26-n;if(0!==n){var a=0;for(t=0;t>>26-n}a&&(this.words[t]=a,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var o=e%26,a=Math.min((e-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,u=0;u=0&&(0!==f||u>=i);u--){var d=0|this.words[u];this.words[u]=f<<26-o|d>>>o,f=d&s}return c&&0!==f&&(c.words[c.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(e,t,n){return r(0===this.negative),this.iushrn(e,t,n)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){r("number"==typeof e&&e>=0);var t=e%26,n=(e-t)/26,i=1<=0);var t=e%26,n=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==t&&n++,this.length=Math.min(n,this.length),0!==t){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},i.prototype.isubn=function(e){if(r("number"==typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(c/67108864|0),this.words[i+n]=67108863&o}for(;i>26,this.words[i+n]=67108863&o;if(0===s)return this.strip();for(r(-1===s),s=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},i.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),o=e,a=0|o.words[o.length-1];0!==(r=26-this._countBits(a))&&(o=o.ushln(r),n.iushln(r),a=0|o.words[o.length-1]);var s,c=n.length-o.length;if("mod"!==t){(s=new i(null)).length=c+1,s.words=new Array(s.length);for(var u=0;u=0;d--){var l=67108864*(0|n.words[o.length+d])+(0|n.words[o.length+d-1]);for(l=Math.min(l/a|0,67108863),n._ishlnsubmul(o,l,d);0!==n.negative;)l--,n.negative=0,n._ishlnsubmul(o,1,d),n.isZero()||(n.negative^=1);s&&(s.words[d]=l)}return s&&s.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},i.prototype.divmod=function(e,t,n){return r(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(o=s.div.neg()),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.iadd(e)),{div:o,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(o=s.div.neg()),{div:o,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modn(e.words[0]))}:this._wordDiv(e,t);var o,a,s},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modn=function(e){r(e<=67108863);for(var t=(1<<26)%e,n=0,i=this.length-1;i>=0;i--)n=(t*n+(0|this.words[i]))%e;return n},i.prototype.idivn=function(e){r(e<=67108863);for(var t=0,n=this.length-1;n>=0;n--){var i=(0|this.words[n])+67108864*t;this.words[n]=i/e|0,t=i%e}return this.strip()},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o=new i(1),a=new i(0),s=new i(0),c=new i(1),u=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++u;for(var f=n.clone(),d=t.clone();!t.isZero();){for(var l=0,h=1;0==(t.words[0]&h)&&l<26;++l,h<<=1);if(l>0)for(t.iushrn(l);l-- >0;)(o.isOdd()||a.isOdd())&&(o.iadd(f),a.isub(d)),o.iushrn(1),a.iushrn(1);for(var p=0,m=1;0==(n.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(n.iushrn(p);p-- >0;)(s.isOdd()||c.isOdd())&&(s.iadd(f),c.isub(d)),s.iushrn(1),c.iushrn(1);t.cmp(n)>=0?(t.isub(n),o.isub(s),a.isub(c)):(n.isub(t),s.isub(o),c.isub(a))}return{a:s,b:c,gcd:n.iushln(u)}},i.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o,a=new i(1),s=new i(0),c=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(var u=0,f=1;0==(t.words[0]&f)&&u<26;++u,f<<=1);if(u>0)for(t.iushrn(u);u-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);for(var d=0,l=1;0==(n.words[0]&l)&&d<26;++d,l<<=1);if(d>0)for(n.iushrn(d);d-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);t.cmp(n)>=0?(t.isub(n),a.isub(s)):(n.isub(t),s.isub(a))}return(o=0===t.cmpn(1)?a:s).cmpn(0)<0&&o.iadd(e),o},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return 0==(1&this.words[0])},i.prototype.isOdd=function(){return 1==(1&this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){r("number"==typeof e);var t=e%26,n=(e-t)/26,i=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this.strip(),this.length>1)t=1;else{n&&(e=-e),r(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){ni&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new E(e)},i.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var y={k256:null,p224:null,p192:null,p25519:null};function b(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){b.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){b.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function A(){b.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){b.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function E(e){if("string"==typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function S(e){E.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(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)}b.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},b.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},b.prototype.split=function(e,t){e.iushrn(this.n,0,t)},b.prototype.imulK=function(e){return e.imul(this.k)},n(v,b),v.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i>>22,o=a}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},v.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(y[e])return y[e];var t;if("k256"===e)t=new v;else if("p224"===e)t=new w;else if("p192"===e)t=new A;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new _}return y[e]=t,t},E.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},E.prototype._verify2=function(e,t){r(0==(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},E.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},E.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},E.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},E.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},E.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},E.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},E.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},E.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},E.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},E.prototype.isqr=function(e){return this.imul(e,e.clone())},E.prototype.sqr=function(e){return this.mul(e,e)},E.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2==1),3===t){var n=this.m.add(new i(1)).iushrn(2);return this.pow(e,n)}for(var o=this.m.subn(1),a=0;!o.isZero()&&0===o.andln(1);)a++,o.iushrn(1);r(!o.isZero());var s=new i(1).toRed(this),c=s.redNeg(),u=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new i(2*f*f).toRed(this);0!==this.pow(f,u).cmp(c);)f.redIAdd(c);for(var d=this.pow(f,o),l=this.pow(e,o.addn(1).iushrn(1)),h=this.pow(e,o),p=a;0!==h.cmp(s);){for(var m=h,g=0;0!==m.cmp(s);g++)m=m.redSqr();r(g=0;n--){for(var u=t.words[n],f=c-1;f>=0;f--){var d=u>>f&1;o!==r[0]&&(o=this.sqr(o)),0!==d||0!==a?(a<<=1,a|=d,(4===++s||0===n&&0===f)&&(o=this.mul(o,r[a]),s=0,a=0)):s=0}c=26}return o},E.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},E.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new S(e)},n(S,E),S.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},S.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},S.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},S.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(n).iushrn(this.shift),a=o;return o.cmp(this.m)>=0?a=o.isub(this.m):o.cmpn(0)<0&&(a=o.iadd(this.m)),a._forceRed(this)},S.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,s)}(h);var m=h.exports,g=y;function y(e,t){if(!e)throw new Error(t||"Assertion failed")}y.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)};var b={};!function(e){var t=e;function r(e){return 1===e.length?"0"+e:e}function n(e){for(var t="",n=0;n>8,a=255&i;o?r.push(o,a):r.push(a)}return r},t.zero2=r,t.toHex=n,t.encode=function(e,t){return"hex"===t?n(e):e}}(b),function(e){var t=e,r=m,n=g,i=b;t.assert=n,t.toArray=i.toArray,t.zero2=i.zero2,t.toHex=i.toHex,t.encode=i.encode,t.getNAF=function(e,t,r){var n=new Array(Math.max(e.bitLength(),r)+1);n.fill(0);for(var i=1<(i>>1)-1?(i>>1)-c:c,o.isubn(s)):s=0,n[a]=s,o.iushrn(1)}return n},t.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n,i=0,o=0;e.cmpn(-i)>0||t.cmpn(-o)>0;){var a,s,c=e.andln(3)+i&3,u=t.andln(3)+o&3;3===c&&(c=-1),3===u&&(u=-1),a=0==(1&c)?0:3!==(n=e.andln(7)+i&7)&&5!==n||2!==u?c:-c,r[0].push(a),s=0==(1&u)?0:3!==(n=t.andln(7)+o&7)&&5!==n||2!==c?u:-u,r[1].push(s),2*i===a+1&&(i=1-i),2*o===s+1&&(o=1-o),e.iushrn(1),t.iushrn(1)}return r},t.cachedProperty=function(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},t.parseBytes=function(e){return"string"==typeof e?t.toArray(e,"hex"):e},t.intFromLE=function(e){return new r(e,"hex","le")}}(l);var v,w={exports:{}};function A(e){this.rand=e}if(w.exports=function(e){return v||(v=new A(null)),v.generate(e)},w.exports.Rand=A,A.prototype.generate=function(e){return this._rand(e)},A.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),r=0;r0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var R=I;function N(e,t){this.curve=e,this.type=t,this.precomputed=null}I.prototype.point=function(){throw new Error("Not implemented")},I.prototype.validate=function(){throw new Error("Not implemented")},I.prototype._fixedNafMul=function(e,t){C(e.precomputed);var r=e._getDoubles(),n=k(t,1,this._bitLength),i=(1<=o;c--)a=(a<<1)+n[c];s.push(a)}for(var u=this.jpoint(null,null,null),f=this.jpoint(null,null,null),d=i;d>0;d--){for(o=0;o=0;s--){for(var c=0;s>=0&&0===o[s];s--)c++;if(s>=0&&c++,a=a.dblp(c),s<0)break;var u=o[s];C(0!==u),a="affine"===e.type?u>0?a.mixedAdd(i[u-1>>1]):a.mixedAdd(i[-u-1>>1].neg()):u>0?a.add(i[u-1>>1]):a.add(i[-u-1>>1].neg())}return"affine"===e.type?a.toP():a},I.prototype._wnafMulAdd=function(e,t,r,n,i){var o,a,s,c=this._wnafT1,u=this._wnafT2,f=this._wnafT3,d=0;for(o=0;o=1;o-=2){var h=o-1,p=o;if(1===c[h]&&1===c[p]){var m=[t[h],null,null,t[p]];0===t[h].y.cmp(t[p].y)?(m[1]=t[h].add(t[p]),m[2]=t[h].toJ().mixedAdd(t[p].neg())):0===t[h].y.cmp(t[p].y.redNeg())?(m[1]=t[h].toJ().mixedAdd(t[p]),m[2]=t[h].add(t[p].neg())):(m[1]=t[h].toJ().mixedAdd(t[p]),m[2]=t[h].toJ().mixedAdd(t[p].neg()));var g=[-3,-1,-5,-7,0,7,5,1,3],y=M(r[h],r[p]);for(d=Math.max(y[0].length,d),f[h]=new Array(d),f[p]=new Array(d),a=0;a=0;o--){for(var _=0;o>=0;){var E=!0;for(a=0;a=0&&_++,w=w.dblp(_),o<0)break;for(a=0;a0?s=u[a][S-1>>1]:S<0&&(s=u[a][-S-1>>1].neg()),w="affine"===s.type?w.mixedAdd(s):w.add(s))}}for(o=0;o=Math.ceil((e.bitLength()+1)/t.step)},N.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i=0&&(o=t,a=r),n.negative&&(n=n.neg(),i=i.neg()),o.negative&&(o=o.neg(),a=a.neg()),[{a:n,b:i},{a:o,b:a}]},F.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],i=n.b.mul(e).divRound(this.n),o=r.b.neg().mul(e).divRound(this.n),a=i.mul(r.a),s=o.mul(n.a),c=i.mul(r.b),u=o.mul(n.b);return{k1:e.sub(a).sub(s),k2:c.add(u).neg()}},F.prototype.pointFromX=function(e,t){(e=new j(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var i=n.fromRed().isOdd();return(t&&!i||!t&&i)&&(n=n.redNeg()),this.point(e,n)},F.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},F.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o":""},U.prototype.isInfinity=function(){return this.inf},U.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},U.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),a=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)},U.prototype.getX=function(){return this.x.fromRed()},U.prototype.getY=function(){return this.y.fromRed()},U.prototype.mul=function(e){return e=new j(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)},U.prototype.mulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},U.prototype.jmulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},U.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))},U.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,n=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return t},U.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},D(L,$.BasePoint),F.prototype.jpoint=function(e,t,r){return new L(this,e,t,r)},L.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},L.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},L.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),i=e.x.redMul(r),o=this.y.redMul(t.redMul(e.z)),a=e.y.redMul(r.redMul(this.z)),s=n.redSub(i),c=o.redSub(a);if(0===s.cmpn(0))return 0!==c.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=s.redSqr(),f=u.redMul(s),d=n.redMul(u),l=c.redSqr().redIAdd(f).redISub(d).redISub(d),h=c.redMul(d.redISub(l)).redISub(o.redMul(f)),p=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(l,h,p)},L.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),i=this.y,o=e.y.redMul(t).redMul(this.z),a=r.redSub(n),s=i.redSub(o);if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=a.redSqr(),u=c.redMul(a),f=r.redMul(c),d=s.redSqr().redIAdd(u).redISub(f).redISub(f),l=s.redMul(f.redISub(d)).redISub(i.redMul(u)),h=this.z.redMul(a);return this.curve.jpoint(d,l,h)},L.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var r=this;for(t=0;t=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},L.prototype.inspect=function(){return this.isInfinity()?"":""},L.prototype.isInfinity=function(){return 0===this.z.cmpn(0)};var q=m,H=T,K=R,J=l;function W(e){K.call(this,"mont",e),this.a=new q(e.a,16).toRed(this.red),this.b=new q(e.b,16).toRed(this.red),this.i4=new q(4).toRed(this.red).redInvm(),this.two=new q(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}H(W,K);var G=W;function V(e,t,r){K.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new q(t,16),this.z=new q(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}W.prototype.validate=function(e){var t=e.normalize().x,r=t.redSqr(),n=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t);return 0===n.redSqrt().redSqr().cmp(n)},H(V,K.BasePoint),W.prototype.decodePoint=function(e,t){return this.point(J.toArray(e,t),1)},W.prototype.point=function(e,t){return new V(this,e,t)},W.prototype.pointFromJSON=function(e){return V.fromJSON(this,e)},V.prototype.precompute=function(){},V.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},V.fromJSON=function(e,t){return new V(e,t[0],t[1]||e.one)},V.prototype.inspect=function(){return this.isInfinity()?"":""},V.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},V.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),r=e.redSub(t),n=e.redMul(t),i=r.redMul(t.redAdd(this.curve.a24.redMul(r)));return this.curve.point(n,i)},V.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},V.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=e.x.redAdd(e.z),o=e.x.redSub(e.z).redMul(r),a=i.redMul(n),s=t.z.redMul(o.redAdd(a).redSqr()),c=t.x.redMul(o.redISub(a).redSqr());return this.curve.point(s,c)},V.prototype.mul=function(e){for(var t=e.clone(),r=this,n=this.curve.point(null,null),i=[];0!==t.cmpn(0);t.iushrn(1))i.push(t.andln(1));for(var o=i.length-1;o>=0;o--)0===i[o]?(r=r.diffAdd(n,this),n=n.dbl()):(n=r.diffAdd(n,this),r=r.dbl());return n},V.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},V.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},V.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},V.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},V.prototype.getX=function(){return this.normalize(),this.x.fromRed()};var Z=m,X=T,Q=R,Y=l.assert;function ee(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,Q.call(this,"edwards",e),this.a=new Z(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new Z(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new Z(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),Y(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}X(ee,Q);var te=ee;function re(e,t,r,n,i){Q.BasePoint.call(this,e,"projective"),null===t&&null===r&&null===n?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new Z(t,16),this.y=new Z(r,16),this.z=n?new Z(n,16):this.curve.one,this.t=i&&new Z(i,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}ee.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},ee.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},ee.prototype.jpoint=function(e,t,r,n){return this.point(e,t,r,n)},ee.prototype.pointFromX=function(e,t){(e=new Z(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=this.c2.redSub(this.a.redMul(r)),i=this.one.redSub(this.c2.redMul(this.d).redMul(r)),o=n.redMul(i.redInvm()),a=o.redSqrt();if(0!==a.redSqr().redSub(o).cmp(this.zero))throw new Error("invalid point");var s=a.fromRed().isOdd();return(t&&!s||!t&&s)&&(a=a.redNeg()),this.point(e,a)},ee.prototype.pointFromY=function(e,t){(e=new Z(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=r.redSub(this.c2),i=r.redMul(this.d).redMul(this.c2).redSub(this.a),o=n.redMul(i.redInvm());if(0===o.cmp(this.zero)){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var a=o.redSqrt();if(0!==a.redSqr().redSub(o).cmp(this.zero))throw new Error("invalid point");return a.fromRed().isOdd()!==t&&(a=a.redNeg()),this.point(a,e)},ee.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),r=e.y.redSqr(),n=t.redMul(this.a).redAdd(r),i=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(r)));return 0===n.cmp(i)},X(re,Q.BasePoint),ee.prototype.pointFromJSON=function(e){return re.fromJSON(this,e)},ee.prototype.point=function(e,t,r,n){return new re(this,e,t,r,n)},re.fromJSON=function(e,t){return new re(e,t[0],t[1],t[2])},re.prototype.inspect=function(){return this.isInfinity()?"":""},re.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},re.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(e),i=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),o=n.redAdd(t),a=o.redSub(r),s=n.redSub(t),c=i.redMul(a),u=o.redMul(s),f=i.redMul(s),d=a.redMul(o);return this.curve.point(c,u,d,f)},re.prototype._projDbl=function(){var e,t,r,n,i,o,a=this.x.redAdd(this.y).redSqr(),s=this.x.redSqr(),c=this.y.redSqr();if(this.curve.twisted){var u=(n=this.curve._mulA(s)).redAdd(c);this.zOne?(e=a.redSub(s).redSub(c).redMul(u.redSub(this.curve.two)),t=u.redMul(n.redSub(c)),r=u.redSqr().redSub(u).redSub(u)):(i=this.z.redSqr(),o=u.redSub(i).redISub(i),e=a.redSub(s).redISub(c).redMul(o),t=u.redMul(n.redSub(c)),r=u.redMul(o))}else n=s.redAdd(c),i=this.curve._mulC(this.z).redSqr(),o=n.redSub(i).redSub(i),e=this.curve._mulC(a.redISub(n)).redMul(o),t=this.curve._mulC(n).redMul(s.redISub(c)),r=n.redMul(o);return this.curve.point(e,t,r)},re.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},re.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),n=this.t.redMul(this.curve.dd).redMul(e.t),i=this.z.redMul(e.z.redAdd(e.z)),o=r.redSub(t),a=i.redSub(n),s=i.redAdd(n),c=r.redAdd(t),u=o.redMul(a),f=s.redMul(c),d=o.redMul(c),l=a.redMul(s);return this.curve.point(u,f,l,d)},re.prototype._projAdd=function(e){var t,r,n=this.z.redMul(e.z),i=n.redSqr(),o=this.x.redMul(e.x),a=this.y.redMul(e.y),s=this.curve.d.redMul(o).redMul(a),c=i.redSub(s),u=i.redAdd(s),f=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(o).redISub(a),d=n.redMul(c).redMul(f);return this.curve.twisted?(t=n.redMul(u).redMul(a.redSub(this.curve._mulA(o))),r=c.redMul(u)):(t=n.redMul(u).redMul(a.redSub(o)),r=this.curve._mulC(c).redMul(u)),this.curve.point(d,t,r)},re.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},re.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},re.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},re.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},re.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},re.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},re.prototype.getX=function(){return this.normalize(),this.x.fromRed()},re.prototype.getY=function(){return this.normalize(),this.y.fromRed()},re.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},re.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var r=e.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(n),0===this.x.cmp(t))return!0}},re.prototype.toP=re.prototype.normalize,re.prototype.mixedAdd=re.prototype.add,function(e){var t=e;t.base=R,t.short=z,t.mont=G,t.edwards=te}(S);var ne={},ie={},oe={},ae=g,se=T;function ce(e,t){return 55296==(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1)))}function ue(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function fe(e){return 1===e.length?"0"+e:e}function de(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}oe.inherits=se,oe.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),i=0;i>6|192,r[n++]=63&o|128):ce(e,i)?(o=65536+((1023&o)<<10)+(1023&e.charCodeAt(++i)),r[n++]=o>>18|240,r[n++]=o>>12&63|128,r[n++]=o>>6&63|128,r[n++]=63&o|128):(r[n++]=o>>12|224,r[n++]=o>>6&63|128,r[n++]=63&o|128)}else for(i=0;i>>0}return o},oe.split32=function(e,t){for(var r=new Array(4*e.length),n=0,i=0;n>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}return r},oe.rotr32=function(e,t){return e>>>t|e<<32-t},oe.rotl32=function(e,t){return e<>>32-t},oe.sum32=function(e,t){return e+t>>>0},oe.sum32_3=function(e,t,r){return e+t+r>>>0},oe.sum32_4=function(e,t,r,n){return e+t+r+n>>>0},oe.sum32_5=function(e,t,r,n,i){return e+t+r+n+i>>>0},oe.sum64=function(e,t,r,n){var i=e[t],o=n+e[t+1]>>>0,a=(o>>0,e[t+1]=o},oe.sum64_hi=function(e,t,r,n){return(t+n>>>0>>0},oe.sum64_lo=function(e,t,r,n){return t+n>>>0},oe.sum64_4_hi=function(e,t,r,n,i,o,a,s){var c=0,u=t;return c+=(u=u+n>>>0)>>0)>>0)>>0},oe.sum64_4_lo=function(e,t,r,n,i,o,a,s){return t+n+o+s>>>0},oe.sum64_5_hi=function(e,t,r,n,i,o,a,s,c,u){var f=0,d=t;return f+=(d=d+n>>>0)>>0)>>0)>>0)>>0},oe.sum64_5_lo=function(e,t,r,n,i,o,a,s,c,u){return t+n+o+s+u>>>0},oe.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},oe.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},oe.shr64_hi=function(e,t,r){return e>>>r},oe.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0};var le={},he=oe,pe=g;function me(){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}le.BlockHash=me,me.prototype.update=function(e,t){if(e=he.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=he.join32(e,0,e.length-r,this.endian);for(var n=0;n>>24&255,n[i++]=e>>>16&255,n[i++]=e>>>8&255,n[i++]=255&e}else for(n[i++]=255&e,n[i++]=e>>>8&255,n[i++]=e>>>16&255,n[i++]=e>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;o>>3},ye.g1_256=function(e){return be(e,17)^be(e,19)^e>>>10};var _e=oe,Ee=le,Se=ye,Pe=_e.rotl32,xe=_e.sum32,ke=_e.sum32_5,Me=Se.ft_1,Ce=Ee.BlockHash,Ie=[1518500249,1859775393,2400959708,3395469782];function Re(){if(!(this instanceof Re))return new Re;Ce.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}_e.inherits(Re,Ce);var Ne=Re;Re.blockSize=512,Re.outSize=160,Re.hmacStrength=80,Re.padLength=64,Re.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;nthis.blockSize&&(e=(new this.Hash).update(e).digest()),Xt(e.length<=this.blockSize);for(var t=e.length;t=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}var sr=ar;ar.prototype._init=function(e,t,r){var n=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},ar.prototype.generate=function(e,t,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(n=r,r=t,t=null),r&&(r=ir.toArray(r,n||"hex"),this._update(r));for(var i=[];i.length"};var lr=m,hr=l,pr=hr.assert;function mr(e,t){if(e instanceof mr)return e;this._importDER(e,t)||(pr(e.r&&e.s,"Signature without r or s"),this.r=new lr(e.r,16),this.s=new lr(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}var gr=mr;function yr(){this.place=0}function br(e,t){var r=e[t.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var i=0,o=0,a=t.place;o>>=0;return!(i<=127)&&(t.place=a,i)}function vr(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}mr.prototype._importDER=function(e,t){e=hr.toArray(e,t);var r=new yr;if(48!==e[r.place++])return!1;var n=br(e,r);if(!1===n)return!1;if(n+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var i=br(e,r);if(!1===i)return!1;var o=e.slice(r.place,i+r.place);if(r.place+=i,2!==e[r.place++])return!1;var a=br(e,r);if(!1===a)return!1;if(e.length!==a+r.place)return!1;var s=e.slice(r.place,a+r.place);if(0===o[0]){if(!(128&o[1]))return!1;o=o.slice(1)}if(0===s[0]){if(!(128&s[1]))return!1;s=s.slice(1)}return this.r=new lr(o),this.s=new lr(s),this.recoveryParam=null,!0},mr.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=vr(t),r=vr(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];wr(n,t.length),(n=n.concat(t)).push(2),wr(n,r.length);var i=n.concat(r),o=[48];return wr(o,i.length),o=o.concat(i),hr.encode(o,e)};var Ar=m,_r=sr,Er=ne,Sr=E,Pr=l.assert,xr=dr,kr=gr;function Mr(e){if(!(this instanceof Mr))return new Mr(e);"string"==typeof e&&(Pr(Object.prototype.hasOwnProperty.call(Er,e),"Unknown curve "+e),e=Er[e]),e instanceof Er.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}var Cr=Mr;Mr.prototype.keyPair=function(e){return new xr(this,e)},Mr.prototype.keyFromPrivate=function(e,t){return xr.fromPrivate(this,e,t)},Mr.prototype.keyFromPublic=function(e,t){return xr.fromPublic(this,e,t)},Mr.prototype.genKeyPair=function(e){e||(e={});for(var t=new _r({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||Sr(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),n=this.n.sub(new Ar(2));;){var i=new Ar(t.generate(r));if(!(i.cmp(n)>0))return i.iaddn(1),this.keyFromPrivate(i)}},Mr.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},Mr.prototype.sign=function(e,t,r,n){"object"==typeof r&&(n=r,r=null),n||(n={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new Ar(e,16));for(var i=this.n.byteLength(),o=t.getPrivate().toArray("be",i),a=e.toArray("be",i),s=new _r({hash:this.hash,entropy:o,nonce:a,pers:n.pers,persEnc:n.persEnc||"utf8"}),c=this.n.sub(new Ar(1)),u=0;;u++){var f=n.k?n.k(u):new Ar(s.generate(this.n.byteLength()));if(!((f=this._truncateToN(f,!0)).cmpn(1)<=0||f.cmp(c)>=0)){var d=this.g.mul(f);if(!d.isInfinity()){var l=d.getX(),h=l.umod(this.n);if(0!==h.cmpn(0)){var p=f.invm(this.n).mul(h.mul(t.getPrivate()).iadd(e));if(0!==(p=p.umod(this.n)).cmpn(0)){var m=(d.getY().isOdd()?1:0)|(0!==l.cmp(h)?2:0);return n.canonical&&p.cmp(this.nh)>0&&(p=this.n.sub(p),m^=1),new kr({r:h,s:p,recoveryParam:m})}}}}}},Mr.prototype.verify=function(e,t,r,n){e=this._truncateToN(new Ar(e,16)),r=this.keyFromPublic(r,n);var i=(t=new kr(t,"hex")).r,o=t.s;if(i.cmpn(1)<0||i.cmp(this.n)>=0)return!1;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var a,s=o.invm(this.n),c=s.mul(e).umod(this.n),u=s.mul(i).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(c,r.getPublic(),u)).isInfinity()&&a.eqXToP(i):!(a=this.g.mulAdd(c,r.getPublic(),u)).isInfinity()&&0===a.getX().umod(this.n).cmp(i)},Mr.prototype.recoverPubKey=function(e,t,r,n){Pr((3&r)===r,"The recovery param is more than two bits"),t=new kr(t,n);var i=this.n,o=new Ar(e),a=t.r,s=t.s,c=1&r,u=r>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&u)throw new Error("Unable to find sencond key candinate");a=u?this.curve.pointFromX(a.add(this.curve.n),c):this.curve.pointFromX(a,c);var f=t.r.invm(i),d=i.sub(o).mul(f).umod(i),l=s.mul(f).umod(i);return this.g.mulAdd(d,a,l)},Mr.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new kr(t,n)).recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(e,t,i)}catch(e){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")};var Ir=l,Rr=Ir.assert,Nr=Ir.parseBytes,Or=Ir.cachedProperty;function Tr(e,t){this.eddsa=e,this._secret=Nr(t.secret),e.isPoint(t.pub)?this._pub=t.pub:this._pubBytes=Nr(t.pub)}Tr.fromPublic=function(e,t){return t instanceof Tr?t:new Tr(e,{pub:t})},Tr.fromSecret=function(e,t){return t instanceof Tr?t:new Tr(e,{secret:t})},Tr.prototype.secret=function(){return this._secret},Or(Tr,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),Or(Tr,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),Or(Tr,"privBytes",(function(){var e=this.eddsa,t=this.hash(),r=e.encodingLength-1,n=t.slice(0,e.encodingLength);return n[0]&=248,n[r]&=127,n[r]|=64,n})),Or(Tr,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),Or(Tr,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),Or(Tr,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),Tr.prototype.sign=function(e){return Rr(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},Tr.prototype.verify=function(e,t){return this.eddsa.verify(e,t,this)},Tr.prototype.getSecret=function(e){return Rr(this._secret,"KeyPair is public only"),Ir.encode(this.secret(),e)},Tr.prototype.getPublic=function(e){return Ir.encode(this.pubBytes(),e)};var jr=Tr,Dr=m,$r=l,Br=$r.assert,Fr=$r.cachedProperty,zr=$r.parseBytes;function Ur(e,t){this.eddsa=e,"object"!=typeof t&&(t=zr(t)),Array.isArray(t)&&(t={R:t.slice(0,e.encodingLength),S:t.slice(e.encodingLength)}),Br(t.R&&t.S,"Signature without R or S"),e.isPoint(t.R)&&(this._R=t.R),t.S instanceof Dr&&(this._S=t.S),this._Rencoded=Array.isArray(t.R)?t.R:t.Rencoded,this._Sencoded=Array.isArray(t.S)?t.S:t.Sencoded}Fr(Ur,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),Fr(Ur,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),Fr(Ur,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),Fr(Ur,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),Ur.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},Ur.prototype.toHex=function(){return $r.encode(this.toBytes(),"hex").toUpperCase()};var Lr=Ur,qr=ie,Hr=ne,Kr=l,Jr=Kr.assert,Wr=Kr.parseBytes,Gr=jr,Vr=Lr;function Zr(e){if(Jr("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof Zr))return new Zr(e);e=Hr[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=qr.sha512}var Xr=Zr;Zr.prototype.sign=function(e,t){e=Wr(e);var r=this.keyFromSecret(t),n=this.hashInt(r.messagePrefix(),e),i=this.g.mul(n),o=this.encodePoint(i),a=this.hashInt(o,r.pubBytes(),e).mul(r.priv()),s=n.add(a).umod(this.curve.n);return this.makeSignature({R:i,S:s,Rencoded:o})},Zr.prototype.verify=function(e,t,r){e=Wr(e),t=this.makeSignature(t);var n=this.keyFromPublic(r),i=this.hashInt(t.Rencoded(),n.pubBytes(),e),o=this.g.mul(t.S());return t.R().add(n.pub().mul(i)).eq(o)},Zr.prototype.hashInt=function(){for(var e=this.hash(),t=0;te instanceof CryptoKey,cn=async(e,t)=>{const r=`SHA-${e.slice(-3)}`;return new Uint8Array(await an.subtle.digest(r,t))},un=new TextEncoder,fn=new TextDecoder,dn=2**32;function ln(...e){const t=e.reduce(((e,{length:t})=>e+t),0),r=new Uint8Array(t);let n=0;return e.forEach((e=>{r.set(e,n),n+=e.length})),r}function hn(e,t,r){if(t<0||t>=dn)throw new RangeError(`value must be >= 0 and <= ${dn-1}. Received ${t}`);e.set([t>>>24,t>>>16,t>>>8,255&t],r)}function pn(e){const t=Math.floor(e/dn),r=e%dn,n=new Uint8Array(8);return hn(n,t,0),hn(n,r,4),n}function mn(e){const t=new Uint8Array(4);return hn(t,e),t}function gn(e){return ln(mn(e.length),e)}const yn=e=>(e=>{let t=e;"string"==typeof t&&(t=un.encode(t));const r=[];for(let e=0;e{let t=e;t instanceof Uint8Array&&(t=fn.decode(t)),t=t.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"");try{return(e=>{const t=atob(e),r=new Uint8Array(t.length);for(let e=0;eCn(new Uint8Array(In(e)>>3));const Nn=(e,t)=>{if(t.length<<3!==In(e))throw new Pn("Invalid Initialization Vector length")},On=(e,t)=>{const r=e.byteLength<<3;if(r!==t)throw new Pn(`Invalid Content Encryption Key length. Expected ${t} bits, got ${r} bits`)};function Tn(){return"undefined"!=typeof WebSocketPair||"undefined"!=typeof navigator&&"Cloudflare-Workers"===navigator.userAgent||"undefined"!=typeof EdgeRuntime&&"vercel"===EdgeRuntime}function jn(e,t="algorithm.name"){return new TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`)}function Dn(e,t){return e.name===t}function $n(e){return parseInt(e.name.slice(4),10)}function Bn(e,t){if(t.length&&!t.some((t=>e.usages.includes(t)))){let e="CryptoKey does not support this operation, its usages must include ";if(t.length>2){const r=t.pop();e+=`one of ${t.join(", ")}, or ${r}.`}else 2===t.length?e+=`one of ${t[0]} or ${t[1]}.`:e+=`${t[0]}.`;throw new TypeError(e)}}function Fn(e,t,...r){switch(t){case"HS256":case"HS384":case"HS512":{if(!Dn(e.algorithm,"HMAC"))throw jn("HMAC");const r=parseInt(t.slice(2),10);if($n(e.algorithm.hash)!==r)throw jn(`SHA-${r}`,"algorithm.hash");break}case"RS256":case"RS384":case"RS512":{if(!Dn(e.algorithm,"RSASSA-PKCS1-v1_5"))throw jn("RSASSA-PKCS1-v1_5");const r=parseInt(t.slice(2),10);if($n(e.algorithm.hash)!==r)throw jn(`SHA-${r}`,"algorithm.hash");break}case"PS256":case"PS384":case"PS512":{if(!Dn(e.algorithm,"RSA-PSS"))throw jn("RSA-PSS");const r=parseInt(t.slice(2),10);if($n(e.algorithm.hash)!==r)throw jn(`SHA-${r}`,"algorithm.hash");break}case"EdDSA":if("Ed25519"!==e.algorithm.name&&"Ed448"!==e.algorithm.name){if(Tn()){if(Dn(e.algorithm,"NODE-ED25519"))break;throw jn("Ed25519, Ed448, or NODE-ED25519")}throw jn("Ed25519 or Ed448")}break;case"ES256":case"ES384":case"ES512":{if(!Dn(e.algorithm,"ECDSA"))throw jn("ECDSA");const r=function(e){switch(e){case"ES256":return"P-256";case"ES384":return"P-384";case"ES512":return"P-521";default:throw new Error("unreachable")}}(t);if(e.algorithm.namedCurve!==r)throw jn(r,"algorithm.namedCurve");break}default:throw new TypeError("CryptoKey does not support this operation")}Bn(e,r)}function zn(e,t,...r){switch(t){case"A128GCM":case"A192GCM":case"A256GCM":{if(!Dn(e.algorithm,"AES-GCM"))throw jn("AES-GCM");const r=parseInt(t.slice(1,4),10);if(e.algorithm.length!==r)throw jn(r,"algorithm.length");break}case"A128KW":case"A192KW":case"A256KW":{if(!Dn(e.algorithm,"AES-KW"))throw jn("AES-KW");const r=parseInt(t.slice(1,4),10);if(e.algorithm.length!==r)throw jn(r,"algorithm.length");break}case"ECDH":switch(e.algorithm.name){case"ECDH":case"X25519":case"X448":break;default:throw jn("ECDH, X25519, or X448")}break;case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":if(!Dn(e.algorithm,"PBKDF2"))throw jn("PBKDF2");break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":{if(!Dn(e.algorithm,"RSA-OAEP"))throw jn("RSA-OAEP");const r=parseInt(t.slice(9),10)||1;if($n(e.algorithm.hash)!==r)throw jn(`SHA-${r}`,"algorithm.hash");break}default:throw new TypeError("CryptoKey does not support this operation")}Bn(e,r)}function Un(e,t,...r){if(r.length>2){const t=r.pop();e+=`one of type ${r.join(", ")}, or ${t}.`}else 2===r.length?e+=`one of type ${r[0]} or ${r[1]}.`:e+=`of type ${r[0]}.`;return null==t?e+=` Received ${t}`:"function"==typeof t&&t.name?e+=` Received function ${t.name}`:"object"==typeof t&&null!=t&&t.constructor&&t.constructor.name&&(e+=` Received an instance of ${t.constructor.name}`),e}var Ln=(e,...t)=>Un("Key must be ",e,...t);function qn(e,t,...r){return Un(`Key for the ${e} algorithm must be `,t,...r)}var Hn=e=>sn(e);const Kn=["CryptoKey"];async function Jn(e,t,r,n,i,o){if(!(t instanceof Uint8Array))throw new TypeError(Ln(t,"Uint8Array"));const a=parseInt(e.slice(1,4),10),s=await an.subtle.importKey("raw",t.subarray(a>>3),"AES-CBC",!1,["decrypt"]),c=await an.subtle.importKey("raw",t.subarray(0,a>>3),{hash:"SHA-"+(a<<1),name:"HMAC"},!1,["sign"]),u=ln(o,n,r,pn(o.length<<3)),f=new Uint8Array((await an.subtle.sign("HMAC",c,u)).slice(0,a>>3));let d,l;try{d=((e,t)=>{if(!(e instanceof Uint8Array))throw new TypeError("First argument must be a buffer");if(!(t instanceof Uint8Array))throw new TypeError("Second argument must be a buffer");if(e.length!==t.length)throw new TypeError("Input buffers must have the same length");const r=e.length;let n=0,i=-1;for(;++i{if(!(sn(t)||t instanceof Uint8Array))throw new TypeError(Ln(t,...Kn,"Uint8Array"));switch(Nn(e,n),e){case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return t instanceof Uint8Array&&On(t,parseInt(e.slice(-3),10)),Jn(e,t,r,n,i,o);case"A128GCM":case"A192GCM":case"A256GCM":return t instanceof Uint8Array&&On(t,parseInt(e.slice(1,4),10)),async function(e,t,r,n,i,o){let a;t instanceof Uint8Array?a=await an.subtle.importKey("raw",t,"AES-GCM",!1,["decrypt"]):(zn(t,e,"decrypt"),a=t);try{return new Uint8Array(await an.subtle.decrypt({additionalData:o,iv:n,name:"AES-GCM",tagLength:128},a,ln(r,i)))}catch(e){throw new Sn}}(e,t,r,n,i,o);default:throw new En("Unsupported JWE Content Encryption Algorithm")}},Gn=async()=>{throw new En('JWE "zip" (Compression Algorithm) Header Parameter is not supported by your javascript runtime. You need to use the `inflateRaw` decrypt option to provide Inflate Raw implementation.')},Vn=async()=>{throw new En('JWE "zip" (Compression Algorithm) Header Parameter is not supported by your javascript runtime. You need to use the `deflateRaw` encrypt option to provide Deflate Raw implementation.')},Zn=(...e)=>{const t=e.filter(Boolean);if(0===t.length||1===t.length)return!0;let r;for(const e of t){const t=Object.keys(e);if(r&&0!==r.size)for(const e of t){if(r.has(e))return!1;r.add(e)}else r=new Set(t)}return!0};function Xn(e){if("object"!=typeof(t=e)||null===t||"[object Object]"!==Object.prototype.toString.call(e))return!1;var t;if(null===Object.getPrototypeOf(e))return!0;let r=e;for(;null!==Object.getPrototypeOf(r);)r=Object.getPrototypeOf(r);return Object.getPrototypeOf(e)===r}const Qn=[{hash:"SHA-256",name:"HMAC"},!0,["sign"]];function Yn(e,t){if(e.algorithm.length!==parseInt(t.slice(1,4),10))throw new TypeError(`Invalid key size for alg: ${t}`)}function ei(e,t,r){if(sn(e))return zn(e,t,r),e;if(e instanceof Uint8Array)return an.subtle.importKey("raw",e,"AES-KW",!0,[r]);throw new TypeError(Ln(e,...Kn,"Uint8Array"))}const ti=async(e,t,r)=>{const n=await ei(t,e,"wrapKey");Yn(n,e);const i=await an.subtle.importKey("raw",r,...Qn);return new Uint8Array(await an.subtle.wrapKey("raw",i,n,"AES-KW"))},ri=async(e,t,r)=>{const n=await ei(t,e,"unwrapKey");Yn(n,e);const i=await an.subtle.unwrapKey("raw",r,n,"AES-KW",...Qn);return new Uint8Array(await an.subtle.exportKey("raw",i))};async function ni(e,t,r,n,i=new Uint8Array(0),o=new Uint8Array(0)){if(!sn(e))throw new TypeError(Ln(e,...Kn));if(zn(e,"ECDH"),!sn(t))throw new TypeError(Ln(t,...Kn));zn(t,"ECDH","deriveBits");const a=ln(gn(un.encode(r)),gn(i),gn(o),mn(n));let s;s="X25519"===e.algorithm.name?256:"X448"===e.algorithm.name?448:Math.ceil(parseInt(e.algorithm.namedCurve.substr(-3),10)/8)<<3;return async function(e,t,r){const n=Math.ceil((t>>3)/32),i=new Uint8Array(32*n);for(let t=0;t>3)}(new Uint8Array(await an.subtle.deriveBits({name:e.algorithm.name,public:e},t,s)),n,a)}function ii(e){if(!sn(e))throw new TypeError(Ln(e,...Kn));return["P-256","P-384","P-521"].includes(e.algorithm.namedCurve)||"X25519"===e.algorithm.name||"X448"===e.algorithm.name}async function oi(e,t,r,n){!function(e){if(!(e instanceof Uint8Array)||e.length<8)throw new Pn("PBES2 Salt Input must be 8 or more octets")}(e);const i=function(e,t){return ln(un.encode(e),new Uint8Array([0]),t)}(t,e),o=parseInt(t.slice(13,16),10),a={hash:`SHA-${t.slice(8,11)}`,iterations:r,name:"PBKDF2",salt:i},s={length:o,name:"AES-KW"},c=await function(e,t){if(e instanceof Uint8Array)return an.subtle.importKey("raw",e,"PBKDF2",!1,["deriveBits"]);if(sn(e))return zn(e,t,"deriveBits","deriveKey"),e;throw new TypeError(Ln(e,...Kn,"Uint8Array"))}(n,t);if(c.usages.includes("deriveBits"))return new Uint8Array(await an.subtle.deriveBits(a,c,o));if(c.usages.includes("deriveKey"))return an.subtle.deriveKey(a,c,s,!1,["wrapKey","unwrapKey"]);throw new TypeError('PBKDF2 key "usages" must include "deriveBits" or "deriveKey"')}const ai=async(e,t,r,n,i)=>{const o=await oi(i,e,n,t);return ri(e.slice(-6),o,r)};function si(e){switch(e){case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":return"RSA-OAEP";default:throw new En(`alg ${e} is not supported either by JOSE or your javascript runtime`)}}var ci=(e,t)=>{if(e.startsWith("RS")||e.startsWith("PS")){const{modulusLength:r}=t.algorithm;if("number"!=typeof r||r<2048)throw new TypeError(`${e} requires key modulusLength to be 2048 bits or larger`)}};const ui=async(e,t,r)=>{if(!sn(t))throw new TypeError(Ln(t,...Kn));if(zn(t,e,"decrypt","unwrapKey"),ci(e,t),t.usages.includes("decrypt"))return new Uint8Array(await an.subtle.decrypt(si(e),t,r));if(t.usages.includes("unwrapKey")){const n=await an.subtle.unwrapKey("raw",r,t,si(e),...Qn);return new Uint8Array(await an.subtle.exportKey("raw",n))}throw new TypeError('RSA-OAEP key "usages" must include "decrypt" or "unwrapKey" for this operation')};function fi(e){switch(e){case"A128GCM":return 128;case"A192GCM":return 192;case"A256GCM":case"A128CBC-HS256":return 256;case"A192CBC-HS384":return 384;case"A256CBC-HS512":return 512;default:throw new En(`Unsupported JWE Algorithm: ${e}`)}}var di=e=>Cn(new Uint8Array(fi(e)>>3));var li=async e=>{var t,r;if(!e.alg)throw new TypeError('"alg" argument is required when "jwk.alg" is not present');const{algorithm:n,keyUsages:i}=function(e){let t,r;switch(e.kty){case"oct":switch(e.alg){case"HS256":case"HS384":case"HS512":t={name:"HMAC",hash:`SHA-${e.alg.slice(-3)}`},r=["sign","verify"];break;case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":throw new En(`${e.alg} keys cannot be imported as CryptoKey instances`);case"A128GCM":case"A192GCM":case"A256GCM":case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":t={name:"AES-GCM"},r=["encrypt","decrypt"];break;case"A128KW":case"A192KW":case"A256KW":t={name:"AES-KW"},r=["wrapKey","unwrapKey"];break;case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":t={name:"PBKDF2"},r=["deriveBits"];break;default:throw new En('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"RSA":switch(e.alg){case"PS256":case"PS384":case"PS512":t={name:"RSA-PSS",hash:`SHA-${e.alg.slice(-3)}`},r=e.d?["sign"]:["verify"];break;case"RS256":case"RS384":case"RS512":t={name:"RSASSA-PKCS1-v1_5",hash:`SHA-${e.alg.slice(-3)}`},r=e.d?["sign"]:["verify"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":t={name:"RSA-OAEP",hash:`SHA-${parseInt(e.alg.slice(-3),10)||1}`},r=e.d?["decrypt","unwrapKey"]:["encrypt","wrapKey"];break;default:throw new En('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"EC":switch(e.alg){case"ES256":t={name:"ECDSA",namedCurve:"P-256"},r=e.d?["sign"]:["verify"];break;case"ES384":t={name:"ECDSA",namedCurve:"P-384"},r=e.d?["sign"]:["verify"];break;case"ES512":t={name:"ECDSA",namedCurve:"P-521"},r=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":t={name:"ECDH",namedCurve:e.crv},r=e.d?["deriveBits"]:[];break;default:throw new En('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"OKP":switch(e.alg){case"EdDSA":t={name:e.crv},r=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":t={name:e.crv},r=e.d?["deriveBits"]:[];break;default:throw new En('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;default:throw new En('Invalid or unsupported JWK "kty" (Key Type) Parameter value')}return{algorithm:t,keyUsages:r}}(e),o=[n,null!==(t=e.ext)&&void 0!==t&&t,null!==(r=e.key_ops)&&void 0!==r?r:i];if("PBKDF2"===n.name)return an.subtle.importKey("raw",bn(e.k),...o);const a={...e};delete a.alg,delete a.use;try{return await an.subtle.importKey("jwk",a,...o)}catch(e){if("Ed25519"===n.name&&"NotSupportedError"===(null==e?void 0:e.name)&&Tn())return o[0]={name:"NODE-ED25519",namedCurve:"NODE-ED25519"},await an.subtle.importKey("jwk",a,...o);throw e}};async function hi(e,t,r){var n;if(!Xn(e))throw new TypeError("JWK must be an object");switch(t||(t=e.alg),e.kty){case"oct":if("string"!=typeof e.k||!e.k)throw new TypeError('missing "k" (Key Value) Parameter value');return null!=r||(r=!0!==e.ext),r?li({...e,alg:t,ext:null!==(n=e.ext)&&void 0!==n&&n}):bn(e.k);case"RSA":if(void 0!==e.oth)throw new En('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');case"EC":case"OKP":return li({...e,alg:t});default:throw new En('Unsupported "kty" (Key Type) Parameter value')}}const pi=(e,t,r)=>{e.startsWith("HS")||"dir"===e||e.startsWith("PBES2")||/^A\d{3}(?:GCM)?KW$/.test(e)?((e,t)=>{if(!(t instanceof Uint8Array)){if(!Hn(t))throw new TypeError(qn(e,t,...Kn,"Uint8Array"));if("secret"!==t.type)throw new TypeError(`${Kn.join(" or ")} instances for symmetric algorithms must be of type "secret"`)}})(e,t):((e,t,r)=>{if(!Hn(t))throw new TypeError(qn(e,t,...Kn));if("secret"===t.type)throw new TypeError(`${Kn.join(" or ")} instances for asymmetric algorithms must not be of type "secret"`);if("sign"===r&&"public"===t.type)throw new TypeError(`${Kn.join(" or ")} instances for asymmetric algorithm signing must be of type "private"`);if("decrypt"===r&&"public"===t.type)throw new TypeError(`${Kn.join(" or ")} instances for asymmetric algorithm decryption must be of type "private"`);if(t.algorithm&&"verify"===r&&"private"===t.type)throw new TypeError(`${Kn.join(" or ")} instances for asymmetric algorithm verifying must be of type "public"`);if(t.algorithm&&"encrypt"===r&&"private"===t.type)throw new TypeError(`${Kn.join(" or ")} instances for asymmetric algorithm encryption must be of type "public"`)})(e,t,r)};const mi=async(e,t,r,n,i)=>{if(!(sn(r)||r instanceof Uint8Array))throw new TypeError(Ln(r,...Kn,"Uint8Array"));switch(Nn(e,n),e){case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return r instanceof Uint8Array&&On(r,parseInt(e.slice(-3),10)),async function(e,t,r,n,i){if(!(r instanceof Uint8Array))throw new TypeError(Ln(r,"Uint8Array"));const o=parseInt(e.slice(1,4),10),a=await an.subtle.importKey("raw",r.subarray(o>>3),"AES-CBC",!1,["encrypt"]),s=await an.subtle.importKey("raw",r.subarray(0,o>>3),{hash:"SHA-"+(o<<1),name:"HMAC"},!1,["sign"]),c=new Uint8Array(await an.subtle.encrypt({iv:n,name:"AES-CBC"},a,t)),u=ln(i,n,c,pn(i.length<<3));return{ciphertext:c,tag:new Uint8Array((await an.subtle.sign("HMAC",s,u)).slice(0,o>>3))}}(e,t,r,n,i);case"A128GCM":case"A192GCM":case"A256GCM":return r instanceof Uint8Array&&On(r,parseInt(e.slice(1,4),10)),async function(e,t,r,n,i){let o;r instanceof Uint8Array?o=await an.subtle.importKey("raw",r,"AES-GCM",!1,["encrypt"]):(zn(r,e,"encrypt"),o=r);const a=new Uint8Array(await an.subtle.encrypt({additionalData:i,iv:n,name:"AES-GCM",tagLength:128},o,t)),s=a.slice(-16);return{ciphertext:a.slice(0,-16),tag:s}}(e,t,r,n,i);default:throw new En("Unsupported JWE Content Encryption Algorithm")}};async function gi(e,t,r,n,i){switch(pi(e,t,"decrypt"),e){case"dir":if(void 0!==r)throw new Pn("Encountered unexpected JWE Encrypted Key");return t;case"ECDH-ES":if(void 0!==r)throw new Pn("Encountered unexpected JWE Encrypted Key");case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{if(!Xn(n.epk))throw new Pn('JOSE Header "epk" (Ephemeral Public Key) missing or invalid');if(!ii(t))throw new En("ECDH with the provided key is not allowed or not supported by your javascript runtime");const i=await hi(n.epk,e);let o,a;if(void 0!==n.apu){if("string"!=typeof n.apu)throw new Pn('JOSE Header "apu" (Agreement PartyUInfo) invalid');o=bn(n.apu)}if(void 0!==n.apv){if("string"!=typeof n.apv)throw new Pn('JOSE Header "apv" (Agreement PartyVInfo) invalid');a=bn(n.apv)}const s=await ni(i,t,"ECDH-ES"===e?n.enc:e,"ECDH-ES"===e?fi(n.enc):parseInt(e.slice(-5,-2),10),o,a);if("ECDH-ES"===e)return s;if(void 0===r)throw new Pn("JWE Encrypted Key missing");return ri(e.slice(-6),s,r)}case"RSA1_5":case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":if(void 0===r)throw new Pn("JWE Encrypted Key missing");return ui(e,t,r);case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":{if(void 0===r)throw new Pn("JWE Encrypted Key missing");if("number"!=typeof n.p2c)throw new Pn('JOSE Header "p2c" (PBES2 Count) missing or invalid');const o=(null==i?void 0:i.maxPBES2Count)||1e4;if(n.p2c>o)throw new Pn('JOSE Header "p2c" (PBES2 Count) out is of acceptable bounds');if("string"!=typeof n.p2s)throw new Pn('JOSE Header "p2s" (PBES2 Salt) missing or invalid');return ai(e,t,r,n.p2c,bn(n.p2s))}case"A128KW":case"A192KW":case"A256KW":if(void 0===r)throw new Pn("JWE Encrypted Key missing");return ri(e,t,r);case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":if(void 0===r)throw new Pn("JWE Encrypted Key missing");if("string"!=typeof n.iv)throw new Pn('JOSE Header "iv" (Initialization Vector) missing or invalid');if("string"!=typeof n.tag)throw new Pn('JOSE Header "tag" (Authentication Tag) missing or invalid');return async function(e,t,r,n,i){const o=e.slice(0,7);return Wn(o,t,r,n,i,new Uint8Array(0))}(e,t,r,bn(n.iv),bn(n.tag));default:throw new En('Invalid or unsupported "alg" (JWE Algorithm) header value')}}function yi(e,t,r,n,i){if(void 0!==i.crit&&void 0===n.crit)throw new e('"crit" (Critical) Header Parameter MUST be integrity protected');if(!n||void 0===n.crit)return new Set;if(!Array.isArray(n.crit)||0===n.crit.length||n.crit.some((e=>"string"!=typeof e||0===e.length)))throw new e('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');let o;o=void 0!==r?new Map([...Object.entries(r),...t.entries()]):t;for(const t of n.crit){if(!o.has(t))throw new En(`Extension Header Parameter "${t}" is not recognized`);if(void 0===i[t])throw new e(`Extension Header Parameter "${t}" is missing`);if(o.get(t)&&void 0===n[t])throw new e(`Extension Header Parameter "${t}" MUST be integrity protected`)}return new Set(n.crit)}const bi=(e,t)=>{if(void 0!==t&&(!Array.isArray(t)||t.some((e=>"string"!=typeof e))))throw new TypeError(`"${e}" option must be an array of strings`);if(t)return new Set(t)};async function vi(e,t,r){if(e instanceof Uint8Array&&(e=fn.decode(e)),"string"!=typeof e)throw new Pn("Compact JWE must be a string or Uint8Array");const{0:n,1:i,2:o,3:a,4:s,length:c}=e.split(".");if(5!==c)throw new Pn("Invalid Compact JWE");const u=await async function(e,t,r){var n;if(!Xn(e))throw new Pn("Flattened JWE must be an object");if(void 0===e.protected&&void 0===e.header&&void 0===e.unprotected)throw new Pn("JOSE Header missing");if("string"!=typeof e.iv)throw new Pn("JWE Initialization Vector missing or incorrect type");if("string"!=typeof e.ciphertext)throw new Pn("JWE Ciphertext missing or incorrect type");if("string"!=typeof e.tag)throw new Pn("JWE Authentication Tag missing or incorrect type");if(void 0!==e.protected&&"string"!=typeof e.protected)throw new Pn("JWE Protected Header incorrect type");if(void 0!==e.encrypted_key&&"string"!=typeof e.encrypted_key)throw new Pn("JWE Encrypted Key incorrect type");if(void 0!==e.aad&&"string"!=typeof e.aad)throw new Pn("JWE AAD incorrect type");if(void 0!==e.header&&!Xn(e.header))throw new Pn("JWE Shared Unprotected Header incorrect type");if(void 0!==e.unprotected&&!Xn(e.unprotected))throw new Pn("JWE Per-Recipient Unprotected Header incorrect type");let i;if(e.protected)try{const t=bn(e.protected);i=JSON.parse(fn.decode(t))}catch(e){throw new Pn("JWE Protected Header is invalid")}if(!Zn(i,e.header,e.unprotected))throw new Pn("JWE Protected, JWE Unprotected Header, and JWE Per-Recipient Unprotected Header Parameter names must be disjoint");const o={...i,...e.header,...e.unprotected};if(yi(Pn,new Map,null==r?void 0:r.crit,i,o),void 0!==o.zip){if(!i||!i.zip)throw new Pn('JWE "zip" (Compression Algorithm) Header MUST be integrity protected');if("DEF"!==o.zip)throw new En('Unsupported JWE "zip" (Compression Algorithm) Header Parameter value')}const{alg:a,enc:s}=o;if("string"!=typeof a||!a)throw new Pn("missing JWE Algorithm (alg) in JWE Header");if("string"!=typeof s||!s)throw new Pn("missing JWE Encryption Algorithm (enc) in JWE Header");const c=r&&bi("keyManagementAlgorithms",r.keyManagementAlgorithms),u=r&&bi("contentEncryptionAlgorithms",r.contentEncryptionAlgorithms);if(c&&!c.has(a))throw new _n('"alg" (Algorithm) Header Parameter not allowed');if(u&&!u.has(s))throw new _n('"enc" (Encryption Algorithm) Header Parameter not allowed');let f;void 0!==e.encrypted_key&&(f=bn(e.encrypted_key));let d,l=!1;"function"==typeof t&&(t=await t(i,e),l=!0);try{d=await gi(a,t,f,o,r)}catch(e){if(e instanceof TypeError||e instanceof Pn||e instanceof En)throw e;d=di(s)}const h=bn(e.iv),p=bn(e.tag),m=un.encode(null!==(n=e.protected)&&void 0!==n?n:"");let g;g=void 0!==e.aad?ln(m,un.encode("."),un.encode(e.aad)):m;let y=await Wn(s,d,bn(e.ciphertext),h,p,g);"DEF"===o.zip&&(y=await((null==r?void 0:r.inflateRaw)||Gn)(y));const b={plaintext:y};return void 0!==e.protected&&(b.protectedHeader=i),void 0!==e.aad&&(b.additionalAuthenticatedData=bn(e.aad)),void 0!==e.unprotected&&(b.sharedUnprotectedHeader=e.unprotected),void 0!==e.header&&(b.unprotectedHeader=e.header),l?{...b,key:t}:b}({ciphertext:a,iv:o||void 0,protected:n||void 0,tag:s||void 0,encrypted_key:i||void 0},t,r),f={plaintext:u.plaintext,protectedHeader:u.protectedHeader};return"function"==typeof t?{...f,key:u.key}:f}var wi=async e=>{if(e instanceof Uint8Array)return{kty:"oct",k:yn(e)};if(!sn(e))throw new TypeError(Ln(e,...Kn,"Uint8Array"));if(!e.extractable)throw new TypeError("non-extractable CryptoKey cannot be exported as a JWK");const{ext:t,key_ops:r,alg:n,use:i,...o}=await an.subtle.exportKey("jwk",e);return o};async function Ai(e){return wi(e)}async function _i(e,t,r,n,i={}){let o,a,s;switch(pi(e,r,"encrypt"),e){case"dir":s=r;break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{if(!ii(r))throw new En("ECDH with the provided key is not allowed or not supported by your javascript runtime");const{apu:c,apv:u}=i;let{epk:f}=i;f||(f=(await async function(e){if(!sn(e))throw new TypeError(Ln(e,...Kn));return an.subtle.generateKey(e.algorithm,!0,["deriveBits"])}(r)).privateKey);const{x:d,y:l,crv:h,kty:p}=await Ai(f),m=await ni(r,f,"ECDH-ES"===e?t:e,"ECDH-ES"===e?fi(t):parseInt(e.slice(-5,-2),10),c,u);if(a={epk:{x:d,crv:h,kty:p}},"EC"===p&&(a.epk.y=l),c&&(a.apu=yn(c)),u&&(a.apv=yn(u)),"ECDH-ES"===e){s=m;break}s=n||di(t);const g=e.slice(-6);o=await ti(g,m,s);break}case"RSA1_5":case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":s=n||di(t),o=await(async(e,t,r)=>{if(!sn(t))throw new TypeError(Ln(t,...Kn));if(zn(t,e,"encrypt","wrapKey"),ci(e,t),t.usages.includes("encrypt"))return new Uint8Array(await an.subtle.encrypt(si(e),t,r));if(t.usages.includes("wrapKey")){const n=await an.subtle.importKey("raw",r,...Qn);return new Uint8Array(await an.subtle.wrapKey("raw",n,t,si(e)))}throw new TypeError('RSA-OAEP key "usages" must include "encrypt" or "wrapKey" for this operation')})(e,r,s);break;case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":{s=n||di(t);const{p2c:c,p2s:u}=i;({encryptedKey:o,...a}=await(async(e,t,r,n=2048,i=Cn(new Uint8Array(16)))=>{const o=await oi(i,e,n,t);return{encryptedKey:await ti(e.slice(-6),o,r),p2c:n,p2s:yn(i)}})(e,r,s,c,u));break}case"A128KW":case"A192KW":case"A256KW":s=n||di(t),o=await ti(e,r,s);break;case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":{s=n||di(t);const{iv:c}=i;({encryptedKey:o,...a}=await async function(e,t,r,n){const i=e.slice(0,7);n||(n=Rn(i));const{ciphertext:o,tag:a}=await mi(i,r,t,n,new Uint8Array(0));return{encryptedKey:o,iv:yn(n),tag:yn(a)}}(e,r,s,c));break}default:throw new En('Invalid or unsupported "alg" (JWE Algorithm) header value')}return{cek:s,encryptedKey:o,parameters:a}}const Ei=Symbol();class Si{constructor(e){if(!(e instanceof Uint8Array))throw new TypeError("plaintext must be an instance of Uint8Array");this._plaintext=e}setKeyManagementParameters(e){if(this._keyManagementParameters)throw new TypeError("setKeyManagementParameters can only be called once");return this._keyManagementParameters=e,this}setProtectedHeader(e){if(this._protectedHeader)throw new TypeError("setProtectedHeader can only be called once");return this._protectedHeader=e,this}setSharedUnprotectedHeader(e){if(this._sharedUnprotectedHeader)throw new TypeError("setSharedUnprotectedHeader can only be called once");return this._sharedUnprotectedHeader=e,this}setUnprotectedHeader(e){if(this._unprotectedHeader)throw new TypeError("setUnprotectedHeader can only be called once");return this._unprotectedHeader=e,this}setAdditionalAuthenticatedData(e){return this._aad=e,this}setContentEncryptionKey(e){if(this._cek)throw new TypeError("setContentEncryptionKey can only be called once");return this._cek=e,this}setInitializationVector(e){if(this._iv)throw new TypeError("setInitializationVector can only be called once");return this._iv=e,this}async encrypt(e,t){if(!this._protectedHeader&&!this._unprotectedHeader&&!this._sharedUnprotectedHeader)throw new Pn("either setProtectedHeader, setUnprotectedHeader, or sharedUnprotectedHeader must be called before #encrypt()");if(!Zn(this._protectedHeader,this._unprotectedHeader,this._sharedUnprotectedHeader))throw new Pn("JWE Protected, JWE Shared Unprotected and JWE Per-Recipient Header Parameter names must be disjoint");const r={...this._protectedHeader,...this._unprotectedHeader,...this._sharedUnprotectedHeader};if(yi(Pn,new Map,null==t?void 0:t.crit,this._protectedHeader,r),void 0!==r.zip){if(!this._protectedHeader||!this._protectedHeader.zip)throw new Pn('JWE "zip" (Compression Algorithm) Header MUST be integrity protected');if("DEF"!==r.zip)throw new En('Unsupported JWE "zip" (Compression Algorithm) Header Parameter value')}const{alg:n,enc:i}=r;if("string"!=typeof n||!n)throw new Pn('JWE "alg" (Algorithm) Header Parameter missing or invalid');if("string"!=typeof i||!i)throw new Pn('JWE "enc" (Encryption Algorithm) Header Parameter missing or invalid');let o,a,s,c,u,f,d;if("dir"===n){if(this._cek)throw new TypeError("setContentEncryptionKey cannot be called when using Direct Encryption")}else if("ECDH-ES"===n&&this._cek)throw new TypeError("setContentEncryptionKey cannot be called when using Direct Key Agreement");{let r;({cek:a,encryptedKey:o,parameters:r}=await _i(n,i,e,this._cek,this._keyManagementParameters)),r&&(t&&Ei in t?this._unprotectedHeader?this._unprotectedHeader={...this._unprotectedHeader,...r}:this.setUnprotectedHeader(r):this._protectedHeader?this._protectedHeader={...this._protectedHeader,...r}:this.setProtectedHeader(r))}if(this._iv||(this._iv=Rn(i)),c=this._protectedHeader?un.encode(yn(JSON.stringify(this._protectedHeader))):un.encode(""),this._aad?(u=yn(this._aad),s=ln(c,un.encode("."),un.encode(u))):s=c,"DEF"===r.zip){const e=await((null==t?void 0:t.deflateRaw)||Vn)(this._plaintext);({ciphertext:f,tag:d}=await mi(i,e,a,this._iv,s))}else({ciphertext:f,tag:d}=await mi(i,this._plaintext,a,this._iv,s));const l={ciphertext:yn(f),iv:yn(this._iv),tag:yn(d)};return o&&(l.encrypted_key=yn(o)),u&&(l.aad=u),this._protectedHeader&&(l.protected=fn.decode(c)),this._sharedUnprotectedHeader&&(l.unprotected=this._sharedUnprotectedHeader),this._unprotectedHeader&&(l.header=this._unprotectedHeader),l}}function Pi(e,t){const r=`SHA-${e.slice(-3)}`;switch(e){case"HS256":case"HS384":case"HS512":return{hash:r,name:"HMAC"};case"PS256":case"PS384":case"PS512":return{hash:r,name:"RSA-PSS",saltLength:e.slice(-3)>>3};case"RS256":case"RS384":case"RS512":return{hash:r,name:"RSASSA-PKCS1-v1_5"};case"ES256":case"ES384":case"ES512":return{hash:r,name:"ECDSA",namedCurve:t.namedCurve};case"EdDSA":return Tn()&&"NODE-ED25519"===t.name?{name:"NODE-ED25519",namedCurve:"NODE-ED25519"}:{name:t.name};default:throw new En(`alg ${e} is not supported either by JOSE or your javascript runtime`)}}function xi(e,t,r){if(sn(t))return Fn(t,e,r),t;if(t instanceof Uint8Array){if(!e.startsWith("HS"))throw new TypeError(Ln(t,...Kn));return an.subtle.importKey("raw",t,{hash:`SHA-${e.slice(-3)}`,name:"HMAC"},!1,[r])}throw new TypeError(Ln(t,...Kn,"Uint8Array"))}const ki=async(e,t,r,n)=>{const i=await xi(e,t,"verify");ci(e,i);const o=Pi(e,i.algorithm);try{return await an.subtle.verify(o,i,r,n)}catch(e){return!1}};async function Mi(e,t,r){var n;if(!Xn(e))throw new xn("Flattened JWS must be an object");if(void 0===e.protected&&void 0===e.header)throw new xn('Flattened JWS must have either of the "protected" or "header" members');if(void 0!==e.protected&&"string"!=typeof e.protected)throw new xn("JWS Protected Header incorrect type");if(void 0===e.payload)throw new xn("JWS Payload missing");if("string"!=typeof e.signature)throw new xn("JWS Signature missing or incorrect type");if(void 0!==e.header&&!Xn(e.header))throw new xn("JWS Unprotected Header incorrect type");let i={};if(e.protected)try{const t=bn(e.protected);i=JSON.parse(fn.decode(t))}catch(e){throw new xn("JWS Protected Header is invalid")}if(!Zn(i,e.header))throw new xn("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");const o={...i,...e.header};let a=!0;if(yi(xn,new Map([["b64",!0]]),null==r?void 0:r.crit,i,o).has("b64")&&(a=i.b64,"boolean"!=typeof a))throw new xn('The "b64" (base64url-encode payload) Header Parameter must be a boolean');const{alg:s}=o;if("string"!=typeof s||!s)throw new xn('JWS "alg" (Algorithm) Header Parameter missing or invalid');const c=r&&bi("algorithms",r.algorithms);if(c&&!c.has(s))throw new _n('"alg" (Algorithm) Header Parameter not allowed');if(a){if("string"!=typeof e.payload)throw new xn("JWS Payload must be a string")}else if("string"!=typeof e.payload&&!(e.payload instanceof Uint8Array))throw new xn("JWS Payload must be a string or an Uint8Array instance");let u=!1;"function"==typeof t&&(t=await t(i,e),u=!0),pi(s,t,"verify");const f=ln(un.encode(null!==(n=e.protected)&&void 0!==n?n:""),un.encode("."),"string"==typeof e.payload?un.encode(e.payload):e.payload),d=bn(e.signature);if(!await ki(s,t,d,f))throw new Mn;let l;l=a?bn(e.payload):"string"==typeof e.payload?un.encode(e.payload):e.payload;const h={payload:l};return void 0!==e.protected&&(h.protectedHeader=i),void 0!==e.header&&(h.unprotectedHeader=e.header),u?{...h,key:t}:h}var Ci=e=>Math.floor(e.getTime()/1e3);const Ii=86400,Ri=/^(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)$/i;var Ni=e=>{const t=Ri.exec(e);if(!t)throw new TypeError("Invalid time period format");const r=parseFloat(t[1]);switch(t[2].toLowerCase()){case"sec":case"secs":case"second":case"seconds":case"s":return Math.round(r);case"minute":case"minutes":case"min":case"mins":case"m":return Math.round(60*r);case"hour":case"hours":case"hr":case"hrs":case"h":return Math.round(3600*r);case"day":case"days":case"d":return Math.round(r*Ii);case"week":case"weeks":case"w":return Math.round(604800*r);default:return Math.round(31557600*r)}};const Oi=e=>e.toLowerCase().replace(/^application\//,"");var Ti=(e,t,r={})=>{const{typ:n}=r;if(n&&("string"!=typeof e.typ||Oi(e.typ)!==Oi(n)))throw new wn('unexpected "typ" JWT header value',"typ","check_failed");let i;try{i=JSON.parse(fn.decode(t))}catch(e){}if(!Xn(i))throw new kn("JWT Claims Set must be a top-level JSON object");const{requiredClaims:o=[],issuer:a,subject:s,audience:c,maxTokenAge:u}=r;void 0!==u&&o.push("iat"),void 0!==c&&o.push("aud"),void 0!==s&&o.push("sub"),void 0!==a&&o.push("iss");for(const e of new Set(o.reverse()))if(!(e in i))throw new wn(`missing required "${e}" claim`,e,"missing");if(a&&!(Array.isArray(a)?a:[a]).includes(i.iss))throw new wn('unexpected "iss" claim value',"iss","check_failed");if(s&&i.sub!==s)throw new wn('unexpected "sub" claim value',"sub","check_failed");if(c&&(f=i.aud,d="string"==typeof c?[c]:c,!("string"==typeof f?d.includes(f):Array.isArray(f)&&d.some(Set.prototype.has.bind(new Set(f))))))throw new wn('unexpected "aud" claim value',"aud","check_failed");var f,d;let l;switch(typeof r.clockTolerance){case"string":l=Ni(r.clockTolerance);break;case"number":l=r.clockTolerance;break;case"undefined":l=0;break;default:throw new TypeError("Invalid clockTolerance option type")}const{currentDate:h}=r,p=Ci(h||new Date);if((void 0!==i.iat||u)&&"number"!=typeof i.iat)throw new wn('"iat" claim must be a number',"iat","invalid");if(void 0!==i.nbf){if("number"!=typeof i.nbf)throw new wn('"nbf" claim must be a number',"nbf","invalid");if(i.nbf>p+l)throw new wn('"nbf" claim timestamp check failed',"nbf","check_failed")}if(void 0!==i.exp){if("number"!=typeof i.exp)throw new wn('"exp" claim must be a number',"exp","invalid");if(i.exp<=p-l)throw new An('"exp" claim timestamp check failed',"exp","check_failed")}if(u){const e=p-i.iat;if(e-l>("number"==typeof u?u:Ni(u)))throw new An('"iat" claim timestamp check failed (too far in the past)',"iat","check_failed");if(e<0-l)throw new wn('"iat" claim timestamp check failed (it should be in the past)',"iat","check_failed")}return i};async function ji(e,t,r){var n;const i=await async function(e,t,r){if(e instanceof Uint8Array&&(e=fn.decode(e)),"string"!=typeof e)throw new xn("Compact JWS must be a string or Uint8Array");const{0:n,1:i,2:o,length:a}=e.split(".");if(3!==a)throw new xn("Invalid Compact JWS");const s=await Mi({payload:i,protected:n,signature:o},t,r),c={payload:s.payload,protectedHeader:s.protectedHeader};return"function"==typeof t?{...c,key:s.key}:c}(e,t,r);if((null===(n=i.protectedHeader.crit)||void 0===n?void 0:n.includes("b64"))&&!1===i.protectedHeader.b64)throw new kn("JWTs MUST NOT use unencoded payload");const o={payload:Ti(i.protectedHeader,i.payload,r),protectedHeader:i.protectedHeader};return"function"==typeof t?{...o,key:i.key}:o}class Di{constructor(e){this._flattened=new Si(e)}setContentEncryptionKey(e){return this._flattened.setContentEncryptionKey(e),this}setInitializationVector(e){return this._flattened.setInitializationVector(e),this}setProtectedHeader(e){return this._flattened.setProtectedHeader(e),this}setKeyManagementParameters(e){return this._flattened.setKeyManagementParameters(e),this}async encrypt(e,t){const r=await this._flattened.encrypt(e,t);return[r.protected,r.encrypted_key,r.iv,r.ciphertext,r.tag].join(".")}}class $i{constructor(e){if(!(e instanceof Uint8Array))throw new TypeError("payload must be an instance of Uint8Array");this._payload=e}setProtectedHeader(e){if(this._protectedHeader)throw new TypeError("setProtectedHeader can only be called once");return this._protectedHeader=e,this}setUnprotectedHeader(e){if(this._unprotectedHeader)throw new TypeError("setUnprotectedHeader can only be called once");return this._unprotectedHeader=e,this}async sign(e,t){if(!this._protectedHeader&&!this._unprotectedHeader)throw new xn("either setProtectedHeader or setUnprotectedHeader must be called before #sign()");if(!Zn(this._protectedHeader,this._unprotectedHeader))throw new xn("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");const r={...this._protectedHeader,...this._unprotectedHeader};let n=!0;if(yi(xn,new Map([["b64",!0]]),null==t?void 0:t.crit,this._protectedHeader,r).has("b64")&&(n=this._protectedHeader.b64,"boolean"!=typeof n))throw new xn('The "b64" (base64url-encode payload) Header Parameter must be a boolean');const{alg:i}=r;if("string"!=typeof i||!i)throw new xn('JWS "alg" (Algorithm) Header Parameter missing or invalid');pi(i,e,"sign");let o,a=this._payload;n&&(a=un.encode(yn(a))),o=this._protectedHeader?un.encode(yn(JSON.stringify(this._protectedHeader))):un.encode("");const s=ln(o,un.encode("."),a),c=await(async(e,t,r)=>{const n=await xi(e,t,"sign");ci(e,n);const i=await an.subtle.sign(Pi(e,n.algorithm),n,r);return new Uint8Array(i)})(i,e,s),u={signature:yn(c),payload:""};return n&&(u.payload=fn.decode(a)),this._unprotectedHeader&&(u.header=this._unprotectedHeader),this._protectedHeader&&(u.protected=fn.decode(o)),u}}class Bi{constructor(e){this._flattened=new $i(e)}setProtectedHeader(e){return this._flattened.setProtectedHeader(e),this}async sign(e,t){const r=await this._flattened.sign(e,t);if(void 0===r.payload)throw new TypeError("use the flattened module for creating JWS with b64: false");return`${r.protected}.${r.payload}.${r.signature}`}}class Fi{constructor(e,t,r){this.parent=e,this.key=t,this.options=r}setProtectedHeader(e){if(this.protectedHeader)throw new TypeError("setProtectedHeader can only be called once");return this.protectedHeader=e,this}setUnprotectedHeader(e){if(this.unprotectedHeader)throw new TypeError("setUnprotectedHeader can only be called once");return this.unprotectedHeader=e,this}addSignature(...e){return this.parent.addSignature(...e)}sign(...e){return this.parent.sign(...e)}done(){return this.parent}}class zi{constructor(e){this._signatures=[],this._payload=e}addSignature(e,t){const r=new Fi(this,e,t);return this._signatures.push(r),r}async sign(){if(!this._signatures.length)throw new xn("at least one signature must be added");const e={signatures:[],payload:""};for(let t=0;t>3));case"A128KW":case"A192KW":case"A256KW":n=parseInt(e.slice(1,4),10),i={name:"AES-KW",length:n},o=["wrapKey","unwrapKey"];break;case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":case"A128GCM":case"A192GCM":case"A256GCM":n=parseInt(e.slice(1,4),10),i={name:"AES-GCM",length:n},o=["encrypt","decrypt"];break;default:throw new En('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}return an.subtle.generateKey(i,null!==(r=null==t?void 0:t.extractable)&&void 0!==r&&r,o)}(e,t)}async function Ki(e,t){const r=void 0===t?e.alg:t,n=tn.concat(en).concat(rn);if(!n.includes(r))throw new nn("invalid alg. Must be one of: "+n.join(","),["invalid algorithm"]);try{const r=await hi(e,t);if(null==r)throw new nn(new Error("failed importing keys"),["invalid key"]);return r}catch(e){throw new nn(e,["invalid key"])}}async function Ji(e,t,r){let n,i;const o={...t};if(tn.includes(t.alg))n="dir",i=void 0!==r?r:t.alg;else{if(!en.concat(rn).includes(t.alg))throw new nn(`Not a valid symmetric or assymetric alg: ${t.alg}`,["encryption failed","invalid key","invalid algorithm"]);if(void 0===r)throw new nn("An encryption algorith encAlg for content encryption should be provided. Allowed values are: "+tn.join(","),["encryption failed"]);i=r,n="ECDH-ES",o.alg=n}const a=await Ki(o);let s;try{return s=await new Di(e).setProtectedHeader({alg:n,enc:i,kid:t.kid}).encrypt(a),s}catch(e){throw new nn(e,["encryption failed"])}}async function Wi(e,t){try{const r={...t},{alg:n,enc:i}=function(e){let t;if("string"==typeof e){const r=e.split(".");3!==r.length&&5!==r.length||([t]=r)}else if("object"==typeof e&&e){if(!("protected"in e))throw new TypeError("Token does not contain a Protected Header");t=e.protected}try{if("string"!=typeof t||!t)throw new Error;const e=JSON.parse(fn.decode(qi(t)));if(!Xn(e))throw new Error;return e}catch(e){throw new TypeError("Invalid Token or Protected Header formatting")}}(e);if(void 0===n||void 0===i)throw new nn("missing enc or alg in jwe header",["invalid format"]);"ECDH-ES"===n&&(r.alg=n);const o=await Ki(r);return await vi(e,o,{contentEncryptionAlgorithms:[i]})}catch(e){throw new nn(e,["decryption failed"])}}async function Gi(e,t){const n=e.match(/^([a-zA-Z0-9_-]+)\.{1,2}([a-zA-Z0-9_-]+)\.([a-zA-Z0-9_-]+)$/);if(null===n)throw new nn(new Error(`${e} is not a JWS`),["not a compact jws"]);let i,o;try{i=JSON.parse(r(n[1],!0)),o=JSON.parse(r(n[2],!0))}catch(e){throw new nn(e,["invalid format","not a compact jws"])}if(void 0!==t){const r="function"==typeof t?await t(i,o):t,n=await Ki(r);try{const t=await ji(e,n);return{header:t.protectedHeader,payload:t.payload,signer:r}}catch(e){throw new nn(e,["jws verification failed"])}}return{header:i,payload:o}}function Vi(e){if(tn.concat(Yr).concat(en).includes(e))return Number(e.match(/\d{3}/)[0])/8;throw new nn("unsupported algorithm",["invalid algorithm"])}async function Zi(e,t,a){let s;if(!tn.includes(e))throw new nn(new Error(`Invalid encAlg '${e}'. Supported values are: ${tn.toString()}`),["invalid algorithm"]);const c=Vi(e);if(void 0!==t){if("string"==typeof t)if(!0===a)s=r(t);else{const e=n(t,!1);if(e!==n(t,!1,c))throw new nn(new RangeError(`Expected hex length ${2*c} does not meet provided one ${e.length/2}`),["invalid key"]);s=new Uint8Array(o(t))}else s=t;if(s.length!==c)throw new nn(new RangeError(`Expected secret length ${c} does not meet provided one ${s.length}`),["invalid key"])}else try{s=await Hi(e,{extractable:!0})}catch(e){throw new nn(e,["unexpected error"])}const u=await Ai(s);return u.alg=e,{jwk:u,hex:i(r(u.k),!1,c)}}async function Xi(e,t){if(void 0===e.alg||void 0===t.alg||e.alg!==t.alg)throw new Error("alg no present in either pubJwk or privJwk, or pubJWK.alg != privJWK.alg");const r=await Ki(e),n=await Ki(t);try{const e=await a(16),i=await new zi(e).addSignature(n).setProtectedHeader({alg:t.alg}).sign();await async function(e,t,r){if(!Xn(e))throw new xn("General JWS must be an object");if(!Array.isArray(e.signatures)||!e.signatures.every(Xn))throw new xn("JWS Signatures missing or incorrect type");for(const n of e.signatures)try{return await Mi({header:n.header,payload:e.payload,protected:n.protected,signature:n.signature},t,r)}catch(e){}throw new Mn}(i,r)}catch(e){throw new nn(e,["unexpected error"])}}function Qi(e){return null!=e&&"object"==typeof e&&!Array.isArray(e)}function Yi(e){return Qi(e)||Array.isArray(e)?Array.isArray(e)?e.map((e=>Array.isArray(e)||Qi(e)?Yi(e):e)):Object.keys(e).sort().map((t=>[t,Yi(e[t])])):e}function eo(e){return JSON.stringify(Yi(e))}function to(e,t,r,n=2e3){if(er+n)throw new nn(new Error(`timestamp ${new Date(e).toTimeString()} after 'notAfter' ${new Date(r).toTimeString()} with tolerance of ${n/1e3}s`),["invalid timestamp"])}function ro(e){return Array.isArray(e)?e.sort().map(ro):(t=e,"[object Object]"===Object.prototype.toString.call(t)?Object.keys(e).sort().reduce((function(t,r){return t[r]=ro(e[r]),t}),{}):e);var t}function no(e,t=!1,r){try{return n(e,t,r)}catch(e){throw new nn(e,["invalid format"])}}async function io(e,t){try{await Ki(e,e.alg);const r=ro(e);return t?JSON.stringify(r):r}catch(e){throw new nn(e,["invalid key"])}}async function oo(e,t){const r=Yr;if(!r.includes(t))throw new nn(new RangeError(`Valid hash algorith values are any of ${JSON.stringify(r)}`),["invalid algorithm"]);const n=new TextEncoder,i="string"==typeof e?n.encode(e).buffer:e;try{let e;return e=new Uint8Array(await crypto.subtle.digest(t,i)),e}catch(e){throw new nn(e,["unexpected error"])}}var ao={exports:{}};!function(e){!function(e,t){function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function n(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function i(e,t,r){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var o;"object"==typeof e?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:p.Buffer}catch(e){}function a(e,t){var n=e.charCodeAt(t);return n>=48&&n<=57?n-48:n>=65&&n<=70?n-55:n>=97&&n<=102?n-87:void r(!1,"Invalid character in "+e)}function s(e,t,r){var n=a(e,r);return r-1>=t&&(n|=a(e,r-1)<<4),n}function c(e,t,n,i){for(var o=0,a=0,s=Math.min(e.length,n),c=t;c=49?u-49+10:u>=17?u-17+10:u,r(u>=0&&a0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,n){if("number"==typeof e)return this._initNumber(e,t,n);if("object"==typeof e)return this._initArray(e,t,n);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)a=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===n)for(i=0,o=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this._strip()},i.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n=t;n-=2)i=s(e,t,n)<=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(n=(e.length-t)%2==0?t+1:t;n=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this._strip()},i.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,a=o%n,s=Math.min(o,o-a)+r,u=0,f=r;f1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=f}catch(e){i.prototype.inspect=f}else i.prototype.inspect=f;function f(){return(this.red?""}var d=["","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"],l=[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];i.prototype.toString=function(e,t){var n;if(t=0|t||1,16===(e=e||10)||"hex"===e){n="";for(var i=0,o=0,a=0;a>>24-i&16777215,(i+=2)>=26&&(i-=26,a--),n=0!==o||a!==this.length-1?d[6-c.length]+c+n:c+n}for(0!==o&&(n=o.toString(16)+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(e===(0|e)&&e>=2&&e<=36){var u=l[e],f=h[e];n="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modrn(f).toString(e);n=(p=p.idivn(f)).isZero()?m+n:d[u-m.length]+m+n}for(this.isZero()&&(n="0"+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},i.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&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16,2)},o&&(i.prototype.toBuffer=function(e,t){return this.toArrayLike(o,e,t)}),i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)};function m(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],a=i*o,s=67108863&a,c=a/67108864|0;r.words[0]=s;for(var u=1;u>>26,d=67108863&c,l=Math.min(u,t.length-1),h=Math.max(0,u-e.length+1);h<=l;h++){var p=u-h|0;f+=(a=(i=0|e.words[p])*(o=0|t.words[h])+d)/67108864|0,d=67108863&a}r.words[u]=0|d,c=0|f}return 0!==c?r.words[u]=0|c:r.length--,r._strip()}i.prototype.toArrayLike=function(e,t,n){this._strip();var i=this.byteLength(),o=n||Math.max(1,i);r(i<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0");var a=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,o);return this["_toArrayLike"+("le"===t?"LE":"BE")](a,i),a},i.prototype._toArrayLikeLE=function(e,t){for(var r=0,n=0,i=0,o=0;i>8&255),r>16&255),6===o?(r>24&255),n=0,o=0):(n=a>>>24,o+=2)}if(r=0&&(e[r--]=a>>8&255),r>=0&&(e[r--]=a>>16&255),6===o?(r>=0&&(e[r--]=a>>24&255),n=0,o=0):(n=a>>>24,o+=2)}if(r>=0)for(e[r--]=n;r>=0;)e[r--]=0},Math.clz32?i.prototype._countBits=function(e){return 32-Math.clz32(e)}:i.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){r("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),n>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-n),this._strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){r("number"==typeof e&&e>=0);var n=e/26|0,i=e%26;return this._expand(n+1),this.words[n]=t?this.words[n]|1<e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},i.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,a=0;a>26,this.words[a]=67108863&t;for(;0!==o&&a>26,this.words[a]=67108863&t;if(0===o&&a>>13,h=0|a[1],p=8191&h,m=h>>>13,g=0|a[2],y=8191&g,b=g>>>13,v=0|a[3],w=8191&v,A=v>>>13,_=0|a[4],E=8191&_,S=_>>>13,P=0|a[5],x=8191&P,k=P>>>13,M=0|a[6],C=8191&M,I=M>>>13,R=0|a[7],N=8191&R,O=R>>>13,T=0|a[8],j=8191&T,D=T>>>13,$=0|a[9],B=8191&$,F=$>>>13,z=0|s[0],U=8191&z,L=z>>>13,q=0|s[1],H=8191&q,K=q>>>13,J=0|s[2],W=8191&J,G=J>>>13,V=0|s[3],Z=8191&V,X=V>>>13,Q=0|s[4],Y=8191&Q,ee=Q>>>13,te=0|s[5],re=8191&te,ne=te>>>13,ie=0|s[6],oe=8191&ie,ae=ie>>>13,se=0|s[7],ce=8191&se,ue=se>>>13,fe=0|s[8],de=8191&fe,le=fe>>>13,he=0|s[9],pe=8191&he,me=he>>>13;r.negative=e.negative^t.negative,r.length=19;var ge=(u+(n=Math.imul(d,U))|0)+((8191&(i=(i=Math.imul(d,L))+Math.imul(l,U)|0))<<13)|0;u=((o=Math.imul(l,L))+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(p,U),i=(i=Math.imul(p,L))+Math.imul(m,U)|0,o=Math.imul(m,L);var ye=(u+(n=n+Math.imul(d,H)|0)|0)+((8191&(i=(i=i+Math.imul(d,K)|0)+Math.imul(l,H)|0))<<13)|0;u=((o=o+Math.imul(l,K)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(y,U),i=(i=Math.imul(y,L))+Math.imul(b,U)|0,o=Math.imul(b,L),n=n+Math.imul(p,H)|0,i=(i=i+Math.imul(p,K)|0)+Math.imul(m,H)|0,o=o+Math.imul(m,K)|0;var be=(u+(n=n+Math.imul(d,W)|0)|0)+((8191&(i=(i=i+Math.imul(d,G)|0)+Math.imul(l,W)|0))<<13)|0;u=((o=o+Math.imul(l,G)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(w,U),i=(i=Math.imul(w,L))+Math.imul(A,U)|0,o=Math.imul(A,L),n=n+Math.imul(y,H)|0,i=(i=i+Math.imul(y,K)|0)+Math.imul(b,H)|0,o=o+Math.imul(b,K)|0,n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(m,W)|0,o=o+Math.imul(m,G)|0;var ve=(u+(n=n+Math.imul(d,Z)|0)|0)+((8191&(i=(i=i+Math.imul(d,X)|0)+Math.imul(l,Z)|0))<<13)|0;u=((o=o+Math.imul(l,X)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(E,U),i=(i=Math.imul(E,L))+Math.imul(S,U)|0,o=Math.imul(S,L),n=n+Math.imul(w,H)|0,i=(i=i+Math.imul(w,K)|0)+Math.imul(A,H)|0,o=o+Math.imul(A,K)|0,n=n+Math.imul(y,W)|0,i=(i=i+Math.imul(y,G)|0)+Math.imul(b,W)|0,o=o+Math.imul(b,G)|0,n=n+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,X)|0;var we=(u+(n=n+Math.imul(d,Y)|0)|0)+((8191&(i=(i=i+Math.imul(d,ee)|0)+Math.imul(l,Y)|0))<<13)|0;u=((o=o+Math.imul(l,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(x,U),i=(i=Math.imul(x,L))+Math.imul(k,U)|0,o=Math.imul(k,L),n=n+Math.imul(E,H)|0,i=(i=i+Math.imul(E,K)|0)+Math.imul(S,H)|0,o=o+Math.imul(S,K)|0,n=n+Math.imul(w,W)|0,i=(i=i+Math.imul(w,G)|0)+Math.imul(A,W)|0,o=o+Math.imul(A,G)|0,n=n+Math.imul(y,Z)|0,i=(i=i+Math.imul(y,X)|0)+Math.imul(b,Z)|0,o=o+Math.imul(b,X)|0,n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(m,Y)|0,o=o+Math.imul(m,ee)|0;var Ae=(u+(n=n+Math.imul(d,re)|0)|0)+((8191&(i=(i=i+Math.imul(d,ne)|0)+Math.imul(l,re)|0))<<13)|0;u=((o=o+Math.imul(l,ne)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(C,U),i=(i=Math.imul(C,L))+Math.imul(I,U)|0,o=Math.imul(I,L),n=n+Math.imul(x,H)|0,i=(i=i+Math.imul(x,K)|0)+Math.imul(k,H)|0,o=o+Math.imul(k,K)|0,n=n+Math.imul(E,W)|0,i=(i=i+Math.imul(E,G)|0)+Math.imul(S,W)|0,o=o+Math.imul(S,G)|0,n=n+Math.imul(w,Z)|0,i=(i=i+Math.imul(w,X)|0)+Math.imul(A,Z)|0,o=o+Math.imul(A,X)|0,n=n+Math.imul(y,Y)|0,i=(i=i+Math.imul(y,ee)|0)+Math.imul(b,Y)|0,o=o+Math.imul(b,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(m,re)|0,o=o+Math.imul(m,ne)|0;var _e=(u+(n=n+Math.imul(d,oe)|0)|0)+((8191&(i=(i=i+Math.imul(d,ae)|0)+Math.imul(l,oe)|0))<<13)|0;u=((o=o+Math.imul(l,ae)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(N,U),i=(i=Math.imul(N,L))+Math.imul(O,U)|0,o=Math.imul(O,L),n=n+Math.imul(C,H)|0,i=(i=i+Math.imul(C,K)|0)+Math.imul(I,H)|0,o=o+Math.imul(I,K)|0,n=n+Math.imul(x,W)|0,i=(i=i+Math.imul(x,G)|0)+Math.imul(k,W)|0,o=o+Math.imul(k,G)|0,n=n+Math.imul(E,Z)|0,i=(i=i+Math.imul(E,X)|0)+Math.imul(S,Z)|0,o=o+Math.imul(S,X)|0,n=n+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(A,Y)|0,o=o+Math.imul(A,ee)|0,n=n+Math.imul(y,re)|0,i=(i=i+Math.imul(y,ne)|0)+Math.imul(b,re)|0,o=o+Math.imul(b,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,ae)|0)+Math.imul(m,oe)|0,o=o+Math.imul(m,ae)|0;var Ee=(u+(n=n+Math.imul(d,ce)|0)|0)+((8191&(i=(i=i+Math.imul(d,ue)|0)+Math.imul(l,ce)|0))<<13)|0;u=((o=o+Math.imul(l,ue)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(j,U),i=(i=Math.imul(j,L))+Math.imul(D,U)|0,o=Math.imul(D,L),n=n+Math.imul(N,H)|0,i=(i=i+Math.imul(N,K)|0)+Math.imul(O,H)|0,o=o+Math.imul(O,K)|0,n=n+Math.imul(C,W)|0,i=(i=i+Math.imul(C,G)|0)+Math.imul(I,W)|0,o=o+Math.imul(I,G)|0,n=n+Math.imul(x,Z)|0,i=(i=i+Math.imul(x,X)|0)+Math.imul(k,Z)|0,o=o+Math.imul(k,X)|0,n=n+Math.imul(E,Y)|0,i=(i=i+Math.imul(E,ee)|0)+Math.imul(S,Y)|0,o=o+Math.imul(S,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(A,re)|0,o=o+Math.imul(A,ne)|0,n=n+Math.imul(y,oe)|0,i=(i=i+Math.imul(y,ae)|0)+Math.imul(b,oe)|0,o=o+Math.imul(b,ae)|0,n=n+Math.imul(p,ce)|0,i=(i=i+Math.imul(p,ue)|0)+Math.imul(m,ce)|0,o=o+Math.imul(m,ue)|0;var Se=(u+(n=n+Math.imul(d,de)|0)|0)+((8191&(i=(i=i+Math.imul(d,le)|0)+Math.imul(l,de)|0))<<13)|0;u=((o=o+Math.imul(l,le)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(B,U),i=(i=Math.imul(B,L))+Math.imul(F,U)|0,o=Math.imul(F,L),n=n+Math.imul(j,H)|0,i=(i=i+Math.imul(j,K)|0)+Math.imul(D,H)|0,o=o+Math.imul(D,K)|0,n=n+Math.imul(N,W)|0,i=(i=i+Math.imul(N,G)|0)+Math.imul(O,W)|0,o=o+Math.imul(O,G)|0,n=n+Math.imul(C,Z)|0,i=(i=i+Math.imul(C,X)|0)+Math.imul(I,Z)|0,o=o+Math.imul(I,X)|0,n=n+Math.imul(x,Y)|0,i=(i=i+Math.imul(x,ee)|0)+Math.imul(k,Y)|0,o=o+Math.imul(k,ee)|0,n=n+Math.imul(E,re)|0,i=(i=i+Math.imul(E,ne)|0)+Math.imul(S,re)|0,o=o+Math.imul(S,ne)|0,n=n+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,ae)|0)+Math.imul(A,oe)|0,o=o+Math.imul(A,ae)|0,n=n+Math.imul(y,ce)|0,i=(i=i+Math.imul(y,ue)|0)+Math.imul(b,ce)|0,o=o+Math.imul(b,ue)|0,n=n+Math.imul(p,de)|0,i=(i=i+Math.imul(p,le)|0)+Math.imul(m,de)|0,o=o+Math.imul(m,le)|0;var Pe=(u+(n=n+Math.imul(d,pe)|0)|0)+((8191&(i=(i=i+Math.imul(d,me)|0)+Math.imul(l,pe)|0))<<13)|0;u=((o=o+Math.imul(l,me)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(B,H),i=(i=Math.imul(B,K))+Math.imul(F,H)|0,o=Math.imul(F,K),n=n+Math.imul(j,W)|0,i=(i=i+Math.imul(j,G)|0)+Math.imul(D,W)|0,o=o+Math.imul(D,G)|0,n=n+Math.imul(N,Z)|0,i=(i=i+Math.imul(N,X)|0)+Math.imul(O,Z)|0,o=o+Math.imul(O,X)|0,n=n+Math.imul(C,Y)|0,i=(i=i+Math.imul(C,ee)|0)+Math.imul(I,Y)|0,o=o+Math.imul(I,ee)|0,n=n+Math.imul(x,re)|0,i=(i=i+Math.imul(x,ne)|0)+Math.imul(k,re)|0,o=o+Math.imul(k,ne)|0,n=n+Math.imul(E,oe)|0,i=(i=i+Math.imul(E,ae)|0)+Math.imul(S,oe)|0,o=o+Math.imul(S,ae)|0,n=n+Math.imul(w,ce)|0,i=(i=i+Math.imul(w,ue)|0)+Math.imul(A,ce)|0,o=o+Math.imul(A,ue)|0,n=n+Math.imul(y,de)|0,i=(i=i+Math.imul(y,le)|0)+Math.imul(b,de)|0,o=o+Math.imul(b,le)|0;var xe=(u+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,me)|0)+Math.imul(m,pe)|0))<<13)|0;u=((o=o+Math.imul(m,me)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(B,W),i=(i=Math.imul(B,G))+Math.imul(F,W)|0,o=Math.imul(F,G),n=n+Math.imul(j,Z)|0,i=(i=i+Math.imul(j,X)|0)+Math.imul(D,Z)|0,o=o+Math.imul(D,X)|0,n=n+Math.imul(N,Y)|0,i=(i=i+Math.imul(N,ee)|0)+Math.imul(O,Y)|0,o=o+Math.imul(O,ee)|0,n=n+Math.imul(C,re)|0,i=(i=i+Math.imul(C,ne)|0)+Math.imul(I,re)|0,o=o+Math.imul(I,ne)|0,n=n+Math.imul(x,oe)|0,i=(i=i+Math.imul(x,ae)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,ae)|0,n=n+Math.imul(E,ce)|0,i=(i=i+Math.imul(E,ue)|0)+Math.imul(S,ce)|0,o=o+Math.imul(S,ue)|0,n=n+Math.imul(w,de)|0,i=(i=i+Math.imul(w,le)|0)+Math.imul(A,de)|0,o=o+Math.imul(A,le)|0;var ke=(u+(n=n+Math.imul(y,pe)|0)|0)+((8191&(i=(i=i+Math.imul(y,me)|0)+Math.imul(b,pe)|0))<<13)|0;u=((o=o+Math.imul(b,me)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(B,Z),i=(i=Math.imul(B,X))+Math.imul(F,Z)|0,o=Math.imul(F,X),n=n+Math.imul(j,Y)|0,i=(i=i+Math.imul(j,ee)|0)+Math.imul(D,Y)|0,o=o+Math.imul(D,ee)|0,n=n+Math.imul(N,re)|0,i=(i=i+Math.imul(N,ne)|0)+Math.imul(O,re)|0,o=o+Math.imul(O,ne)|0,n=n+Math.imul(C,oe)|0,i=(i=i+Math.imul(C,ae)|0)+Math.imul(I,oe)|0,o=o+Math.imul(I,ae)|0,n=n+Math.imul(x,ce)|0,i=(i=i+Math.imul(x,ue)|0)+Math.imul(k,ce)|0,o=o+Math.imul(k,ue)|0,n=n+Math.imul(E,de)|0,i=(i=i+Math.imul(E,le)|0)+Math.imul(S,de)|0,o=o+Math.imul(S,le)|0;var Me=(u+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,me)|0)+Math.imul(A,pe)|0))<<13)|0;u=((o=o+Math.imul(A,me)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(B,Y),i=(i=Math.imul(B,ee))+Math.imul(F,Y)|0,o=Math.imul(F,ee),n=n+Math.imul(j,re)|0,i=(i=i+Math.imul(j,ne)|0)+Math.imul(D,re)|0,o=o+Math.imul(D,ne)|0,n=n+Math.imul(N,oe)|0,i=(i=i+Math.imul(N,ae)|0)+Math.imul(O,oe)|0,o=o+Math.imul(O,ae)|0,n=n+Math.imul(C,ce)|0,i=(i=i+Math.imul(C,ue)|0)+Math.imul(I,ce)|0,o=o+Math.imul(I,ue)|0,n=n+Math.imul(x,de)|0,i=(i=i+Math.imul(x,le)|0)+Math.imul(k,de)|0,o=o+Math.imul(k,le)|0;var Ce=(u+(n=n+Math.imul(E,pe)|0)|0)+((8191&(i=(i=i+Math.imul(E,me)|0)+Math.imul(S,pe)|0))<<13)|0;u=((o=o+Math.imul(S,me)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(B,re),i=(i=Math.imul(B,ne))+Math.imul(F,re)|0,o=Math.imul(F,ne),n=n+Math.imul(j,oe)|0,i=(i=i+Math.imul(j,ae)|0)+Math.imul(D,oe)|0,o=o+Math.imul(D,ae)|0,n=n+Math.imul(N,ce)|0,i=(i=i+Math.imul(N,ue)|0)+Math.imul(O,ce)|0,o=o+Math.imul(O,ue)|0,n=n+Math.imul(C,de)|0,i=(i=i+Math.imul(C,le)|0)+Math.imul(I,de)|0,o=o+Math.imul(I,le)|0;var Ie=(u+(n=n+Math.imul(x,pe)|0)|0)+((8191&(i=(i=i+Math.imul(x,me)|0)+Math.imul(k,pe)|0))<<13)|0;u=((o=o+Math.imul(k,me)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(B,oe),i=(i=Math.imul(B,ae))+Math.imul(F,oe)|0,o=Math.imul(F,ae),n=n+Math.imul(j,ce)|0,i=(i=i+Math.imul(j,ue)|0)+Math.imul(D,ce)|0,o=o+Math.imul(D,ue)|0,n=n+Math.imul(N,de)|0,i=(i=i+Math.imul(N,le)|0)+Math.imul(O,de)|0,o=o+Math.imul(O,le)|0;var Re=(u+(n=n+Math.imul(C,pe)|0)|0)+((8191&(i=(i=i+Math.imul(C,me)|0)+Math.imul(I,pe)|0))<<13)|0;u=((o=o+Math.imul(I,me)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(B,ce),i=(i=Math.imul(B,ue))+Math.imul(F,ce)|0,o=Math.imul(F,ue),n=n+Math.imul(j,de)|0,i=(i=i+Math.imul(j,le)|0)+Math.imul(D,de)|0,o=o+Math.imul(D,le)|0;var Ne=(u+(n=n+Math.imul(N,pe)|0)|0)+((8191&(i=(i=i+Math.imul(N,me)|0)+Math.imul(O,pe)|0))<<13)|0;u=((o=o+Math.imul(O,me)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,n=Math.imul(B,de),i=(i=Math.imul(B,le))+Math.imul(F,de)|0,o=Math.imul(F,le);var Oe=(u+(n=n+Math.imul(j,pe)|0)|0)+((8191&(i=(i=i+Math.imul(j,me)|0)+Math.imul(D,pe)|0))<<13)|0;u=((o=o+Math.imul(D,me)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863;var Te=(u+(n=Math.imul(B,pe))|0)+((8191&(i=(i=Math.imul(B,me))+Math.imul(F,pe)|0))<<13)|0;return u=((o=Math.imul(F,me))+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,c[0]=ge,c[1]=ye,c[2]=be,c[3]=ve,c[4]=we,c[5]=Ae,c[6]=_e,c[7]=Ee,c[8]=Se,c[9]=Pe,c[10]=xe,c[11]=ke,c[12]=Me,c[13]=Ce,c[14]=Ie,c[15]=Re,c[16]=Ne,c[17]=Oe,c[18]=Te,0!==u&&(c[19]=u,r.length++),r};function y(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,a&=67108863}r.words[o]=s,n=a,a=i}return 0!==n?r.words[o]=n:r.length--,r._strip()}function b(e,t,r){return y(e,t,r)}Math.imul||(g=m),i.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?g(this,e,t):r<63?m(this,e,t):r<1024?y(this,e,t):b(this,e,t)},i.prototype.mul=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},i.prototype.mulf=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),b(this,e,t)},i.prototype.imul=function(e){return this.clone().mulTo(e,this)},i.prototype.imuln=function(e){var t=e<0;t&&(e=-e),r("number"==typeof e),r(e<67108864);for(var n=0,i=0;i>=26,n+=o/67108864|0,n+=a>>>26,this.words[i]=67108863&a}return 0!==n&&(this.words[i]=n,this.length++),t?this.ineg():this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>i&1}return t}(e);if(0===t.length)return new i(1);for(var r=this,n=0;n=0);var t,n=e%26,i=(e-n)/26,o=67108863>>>26-n<<26-n;if(0!==n){var a=0;for(t=0;t>>26-n}a&&(this.words[t]=a,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var o=e%26,a=Math.min((e-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,u=0;u=0&&(0!==f||u>=i);u--){var d=0|this.words[u];this.words[u]=f<<26-o|d>>>o,f=d&s}return c&&0!==f&&(c.words[c.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(e,t,n){return r(0===this.negative),this.iushrn(e,t,n)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){r("number"==typeof e&&e>=0);var t=e%26,n=(e-t)/26,i=1<=0);var t=e%26,n=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==t&&n++,this.length=Math.min(n,this.length),0!==t){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},i.prototype.isubn=function(e){if(r("number"==typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(c/67108864|0),this.words[i+n]=67108863&o}for(;i>26,this.words[i+n]=67108863&o;if(0===s)return this._strip();for(r(-1===s),s=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},i.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),o=e,a=0|o.words[o.length-1];0!==(r=26-this._countBits(a))&&(o=o.ushln(r),n.iushln(r),a=0|o.words[o.length-1]);var s,c=n.length-o.length;if("mod"!==t){(s=new i(null)).length=c+1,s.words=new Array(s.length);for(var u=0;u=0;d--){var l=67108864*(0|n.words[o.length+d])+(0|n.words[o.length+d-1]);for(l=Math.min(l/a|0,67108863),n._ishlnsubmul(o,l,d);0!==n.negative;)l--,n.negative=0,n._ishlnsubmul(o,1,d),n.isZero()||(n.negative^=1);s&&(s.words[d]=l)}return s&&s._strip(),n._strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},i.prototype.divmod=function(e,t,n){return r(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(o=s.div.neg()),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.iadd(e)),{div:o,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(o=s.div.neg()),{div:o,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modrn(e.words[0]))}:this._wordDiv(e,t);var o,a,s},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modrn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var n=(1<<26)%e,i=0,o=this.length-1;o>=0;o--)i=(n*i+(0|this.words[o]))%e;return t?-i:i},i.prototype.modn=function(e){return this.modrn(e)},i.prototype.idivn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var n=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*n;this.words[i]=o/e|0,n=o%e}return this._strip(),t?this.ineg():this},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o=new i(1),a=new i(0),s=new i(0),c=new i(1),u=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++u;for(var f=n.clone(),d=t.clone();!t.isZero();){for(var l=0,h=1;0==(t.words[0]&h)&&l<26;++l,h<<=1);if(l>0)for(t.iushrn(l);l-- >0;)(o.isOdd()||a.isOdd())&&(o.iadd(f),a.isub(d)),o.iushrn(1),a.iushrn(1);for(var p=0,m=1;0==(n.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(n.iushrn(p);p-- >0;)(s.isOdd()||c.isOdd())&&(s.iadd(f),c.isub(d)),s.iushrn(1),c.iushrn(1);t.cmp(n)>=0?(t.isub(n),o.isub(s),a.isub(c)):(n.isub(t),s.isub(o),c.isub(a))}return{a:s,b:c,gcd:n.iushln(u)}},i.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o,a=new i(1),s=new i(0),c=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(var u=0,f=1;0==(t.words[0]&f)&&u<26;++u,f<<=1);if(u>0)for(t.iushrn(u);u-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);for(var d=0,l=1;0==(n.words[0]&l)&&d<26;++d,l<<=1);if(d>0)for(n.iushrn(d);d-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);t.cmp(n)>=0?(t.isub(n),a.isub(s)):(n.isub(t),s.isub(a))}return(o=0===t.cmpn(1)?a:s).cmpn(0)<0&&o.iadd(e),o},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return 0==(1&this.words[0])},i.prototype.isOdd=function(){return 1==(1&this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){r("number"==typeof e);var t=e%26,n=(e-t)/26,i=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this._strip(),this.length>1)t=1;else{n&&(e=-e),r(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){ni&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new P(e)},i.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var v={k256:null,p224:null,p192:null,p25519:null};function w(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function A(){w.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function _(){w.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function E(){w.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function S(){w.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function P(e){if("string"==typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function x(e){P.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}w.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},w.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},w.prototype.split=function(e,t){e.iushrn(this.n,0,t)},w.prototype.imulK=function(e){return e.imul(this.k)},n(A,w),A.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i>>22,o=a}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},A.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(v[e])return v[e];var t;if("k256"===e)t=new A;else if("p224"===e)t=new _;else if("p192"===e)t=new E;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new S}return v[e]=t,t},P.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},P.prototype._verify2=function(e,t){r(0==(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},P.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(u(e,e.umod(this.m)._forceRed(this)),e)},P.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},P.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},P.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},P.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},P.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},P.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},P.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},P.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},P.prototype.isqr=function(e){return this.imul(e,e.clone())},P.prototype.sqr=function(e){return this.mul(e,e)},P.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2==1),3===t){var n=this.m.add(new i(1)).iushrn(2);return this.pow(e,n)}for(var o=this.m.subn(1),a=0;!o.isZero()&&0===o.andln(1);)a++,o.iushrn(1);r(!o.isZero());var s=new i(1).toRed(this),c=s.redNeg(),u=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new i(2*f*f).toRed(this);0!==this.pow(f,u).cmp(c);)f.redIAdd(c);for(var d=this.pow(f,o),l=this.pow(e,o.addn(1).iushrn(1)),h=this.pow(e,o),p=a;0!==h.cmp(s);){for(var m=h,g=0;0!==m.cmp(s);g++)m=m.redSqr();r(g=0;n--){for(var u=t.words[n],f=c-1;f>=0;f--){var d=u>>f&1;o!==r[0]&&(o=this.sqr(o)),0!==d||0!==a?(a<<=1,a|=d,(4===++s||0===n&&0===f)&&(o=this.mul(o,r[a]),s=0,a=0)):s=0}c=26}return o},P.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},P.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new x(e)},n(x,P),x.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},x.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},x.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},x.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(n).iushrn(this.shift),a=o;return o.cmp(this.m)>=0?a=o.isub(this.m):o.cmpn(0)<0&&(a=o.iadd(this.m)),a._forceRed(this)},x.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,s)}(ao);var so=c(ao.exports);let co=!1,uo=!1;const fo={debug:1,default:2,info:2,warning:3,error:4,off:5};let lo=fo.default,ho=null;const po=function(){try{const e=[];if(["NFD","NFC","NFKD","NFKC"].forEach((t=>{try{if("test"!=="test".normalize(t))throw new Error("bad normalize")}catch(r){e.push(t)}})),e.length)throw new Error("missing "+e.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(e){return e.message}return null}();var mo,go;!function(e){e.DEBUG="DEBUG",e.INFO="INFO",e.WARNING="WARNING",e.ERROR="ERROR",e.OFF="OFF"}(mo||(mo={})),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"}(go||(go={}));const yo="0123456789abcdef";class bo{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,t){const r=e.toLowerCase();null==fo[r]&&this.throwArgumentError("invalid log level name","logLevel",e),lo>fo[r]||console.log.apply(console,t)}debug(...e){this._log(bo.levels.DEBUG,e)}info(...e){this._log(bo.levels.INFO,e)}warn(...e){this._log(bo.levels.WARNING,e)}makeError(e,t,r){if(uo)return this.makeError("censored error",t,{});t||(t=bo.errors.UNKNOWN_ERROR),r||(r={});const n=[];Object.keys(r).forEach((e=>{const t=r[e];try{if(t instanceof Uint8Array){let r="";for(let e=0;e>4],r+=yo[15&t[e]];n.push(e+"=Uint8Array(0x"+r+")")}else n.push(e+"="+JSON.stringify(t))}catch(t){n.push(e+"="+JSON.stringify(r[e].toString()))}})),n.push(`code=${t}`),n.push(`version=${this.version}`);const i=e;let o="";switch(t){case go.NUMERIC_FAULT:{o="NUMERIC_FAULT";const t=e;switch(t){case"overflow":case"underflow":case"division-by-zero":o+="-"+t;break;case"negative-power":case"negative-width":o+="-unsupported";break;case"unbound-bitwise-result":o+="-unbound-result"}break}case go.CALL_EXCEPTION:case go.INSUFFICIENT_FUNDS:case go.MISSING_NEW:case go.NONCE_EXPIRED:case go.REPLACEMENT_UNDERPRICED:case go.TRANSACTION_REPLACED:case go.UNPREDICTABLE_GAS_LIMIT:o=t}o&&(e+=" [ See: https://links.ethers.org/v5-errors-"+o+" ]"),n.length&&(e+=" ("+n.join(", ")+")");const a=new Error(e);return a.reason=i,a.code=t,Object.keys(r).forEach((function(e){a[e]=r[e]})),a}throwError(e,t,r){throw this.makeError(e,t,r)}throwArgumentError(e,t,r){return this.throwError(e,bo.errors.INVALID_ARGUMENT,{argument:t,value:r})}assert(e,t,r,n){e||this.throwError(t,r,n)}assertArgument(e,t,r,n){e||this.throwArgumentError(t,r,n)}checkNormalize(e){po&&this.throwError("platform missing String.prototype.normalize",bo.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:po})}checkSafeUint53(e,t){"number"==typeof e&&(null==t&&(t="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(t,bo.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(t,bo.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,t,r){r=r?": "+r:"",et&&this.throwError("too many arguments"+r,bo.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:t})}checkNew(e,t){e!==Object&&null!=e||this.throwError("missing new",bo.errors.MISSING_NEW,{name:t.name})}checkAbstract(e,t){e===t?this.throwError("cannot instantiate abstract class "+JSON.stringify(t.name)+" directly; use a sub-class",bo.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):e!==Object&&null!=e||this.throwError("missing new",bo.errors.MISSING_NEW,{name:t.name})}static globalLogger(){return ho||(ho=new bo("logger/5.7.0")),ho}static setCensorship(e,t){if(!e&&t&&this.globalLogger().throwError("cannot permanently disable censorship",bo.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),co){if(!e)return;this.globalLogger().throwError("error censorship permanent",bo.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}uo=!!e,co=!!t}static setLogLevel(e){const t=fo[e.toLowerCase()];null!=t?lo=t:bo.globalLogger().warn("invalid log level - "+e)}static from(e){return new bo(e)}}bo.errors=go,bo.levels=mo;var vo=Object.freeze({__proto__:null,get ErrorCode(){return go},get LogLevel(){return mo},Logger:bo});const wo=new bo("bytes/5.7.0");function Ao(e){return!!e.toHexString}function _o(e){return e.slice||(e.slice=function(){const t=Array.prototype.slice.call(arguments);return _o(new Uint8Array(Array.prototype.slice.apply(e,t)))}),e}function Eo(e){return Io(e)&&!(e.length%2)||Po(e)}function So(e){return"number"==typeof e&&e==e&&e%1==0}function Po(e){if(null==e)return!1;if(e.constructor===Uint8Array)return!0;if("string"==typeof e)return!1;if(!So(e.length)||e.length<0)return!1;for(let t=0;t=256)return!1}return!0}function xo(e,t){if(t||(t={}),"number"==typeof e){wo.checkSafeUint53(e,"invalid arrayify value");const t=[];for(;e;)t.unshift(255&e),e=parseInt(String(e/256));return 0===t.length&&t.push(0),_o(new Uint8Array(t))}if(t.allowMissingPrefix&&"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),Ao(e)&&(e=e.toHexString()),Io(e)){let r=e.substring(2);r.length%2&&("left"===t.hexPad?r="0"+r:"right"===t.hexPad?r+="0":wo.throwArgumentError("hex data is odd-length","value",e));const n=[];for(let e=0;exo(e))),r=t.reduce(((e,t)=>e+t.length),0),n=new Uint8Array(r);return t.reduce(((e,t)=>(n.set(t,e),e+t.length)),0),_o(n)}function Mo(e){let t=xo(e);if(0===t.length)return t;let r=0;for(;rt&&wo.throwArgumentError("value out of range","value",arguments[0]);const r=new Uint8Array(t);return r.set(e,t-e.length),_o(r)}function Io(e,t){return!("string"!=typeof e||!e.match(/^0x[0-9A-Fa-f]*$/))&&(!t||e.length===2+2*t)}const Ro="0123456789abcdef";function No(e,t){if(t||(t={}),"number"==typeof e){wo.checkSafeUint53(e,"invalid hexlify value");let t="";for(;e;)t=Ro[15&e]+t,e=Math.floor(e/16);return t.length?(t.length%2&&(t="0"+t),"0x"+t):"0x00"}if("bigint"==typeof e)return(e=e.toString(16)).length%2?"0x0"+e:"0x"+e;if(t.allowMissingPrefix&&"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),Ao(e))return e.toHexString();if(Io(e))return e.length%2&&("left"===t.hexPad?e="0x0"+e.substring(2):"right"===t.hexPad?e+="0":wo.throwArgumentError("hex data is odd-length","value",e)),e.toLowerCase();if(Po(e)){let t="0x";for(let r=0;r>4]+Ro[15&n]}return t}return wo.throwArgumentError("invalid hexlify value","value",e)}function Oo(e){if("string"!=typeof e)e=No(e);else if(!Io(e)||e.length%2)return null;return(e.length-2)/2}function To(e,t,r){return"string"!=typeof e?e=No(e):(!Io(e)||e.length%2)&&wo.throwArgumentError("invalid hexData","value",e),t=2+2*t,null!=r?"0x"+e.substring(t,2+2*r):"0x"+e.substring(t)}function jo(e){let t="0x";return e.forEach((e=>{t+=No(e).substring(2)})),t}function Do(e){const t=$o(No(e,{hexPad:"left"}));return"0x"===t?"0x0":t}function $o(e){"string"!=typeof e&&(e=No(e)),Io(e)||wo.throwArgumentError("invalid hex string","value",e),e=e.substring(2);let t=0;for(;t2*t+2&&wo.throwArgumentError("value out of range","value",arguments[1]);e.length<2*t+2;)e="0x0"+e.substring(2);return e}function Fo(e){const t={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(Eo(e)){let r=xo(e);64===r.length?(t.v=27+(r[32]>>7),r[32]&=127,t.r=No(r.slice(0,32)),t.s=No(r.slice(32,64))):65===r.length?(t.r=No(r.slice(0,32)),t.s=No(r.slice(32,64)),t.v=r[64]):wo.throwArgumentError("invalid signature string","signature",e),t.v<27&&(0===t.v||1===t.v?t.v+=27:wo.throwArgumentError("signature invalid v byte","signature",e)),t.recoveryParam=1-t.v%2,t.recoveryParam&&(r[32]|=128),t._vs=No(r.slice(32,64))}else{if(t.r=e.r,t.s=e.s,t.v=e.v,t.recoveryParam=e.recoveryParam,t._vs=e._vs,null!=t._vs){const r=Co(xo(t._vs),32);t._vs=No(r);const n=r[0]>=128?1:0;null==t.recoveryParam?t.recoveryParam=n:t.recoveryParam!==n&&wo.throwArgumentError("signature recoveryParam mismatch _vs","signature",e),r[0]&=127;const i=No(r);null==t.s?t.s=i:t.s!==i&&wo.throwArgumentError("signature v mismatch _vs","signature",e)}if(null==t.recoveryParam)null==t.v?wo.throwArgumentError("signature missing v and recoveryParam","signature",e):0===t.v||1===t.v?t.recoveryParam=t.v:t.recoveryParam=1-t.v%2;else if(null==t.v)t.v=27+t.recoveryParam;else{const r=0===t.v||1===t.v?t.v:1-t.v%2;t.recoveryParam!==r&&wo.throwArgumentError("signature recoveryParam mismatch v","signature",e)}null!=t.r&&Io(t.r)?t.r=Bo(t.r,32):wo.throwArgumentError("signature missing or invalid r","signature",e),null!=t.s&&Io(t.s)?t.s=Bo(t.s,32):wo.throwArgumentError("signature missing or invalid s","signature",e);const r=xo(t.s);r[0]>=128&&wo.throwArgumentError("signature s out of range","signature",e),t.recoveryParam&&(r[0]|=128);const n=No(r);t._vs&&(Io(t._vs)||wo.throwArgumentError("signature invalid _vs","signature",e),t._vs=Bo(t._vs,32)),null==t._vs?t._vs=n:t._vs!==n&&wo.throwArgumentError("signature _vs mismatch v and s","signature",e)}return t.yParityAndS=t._vs,t.compact=t.r+t.yParityAndS.substring(2),t}function zo(e){return No(ko([(e=Fo(e)).r,e.s,e.recoveryParam?"0x1c":"0x1b"]))}var Uo=Object.freeze({__proto__:null,arrayify:xo,concat:ko,hexConcat:jo,hexDataLength:Oo,hexDataSlice:To,hexStripZeros:$o,hexValue:Do,hexZeroPad:Bo,hexlify:No,isBytes:Po,isBytesLike:Eo,isHexString:Io,joinSignature:zo,splitSignature:Fo,stripZeros:Mo,zeroPad:Co});const Lo="bignumber/5.7.0";var qo=so.BN;const Ho=new bo(Lo),Ko={},Jo=9007199254740991;let Wo=!1;class Go{constructor(e,t){e!==Ko&&Ho.throwError("cannot call constructor directly; use BigNumber.from",bo.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=t,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return Zo(Xo(this).fromTwos(e))}toTwos(e){return Zo(Xo(this).toTwos(e))}abs(){return"-"===this._hex[0]?Go.from(this._hex.substring(1)):this}add(e){return Zo(Xo(this).add(Xo(e)))}sub(e){return Zo(Xo(this).sub(Xo(e)))}div(e){return Go.from(e).isZero()&&Qo("division-by-zero","div"),Zo(Xo(this).div(Xo(e)))}mul(e){return Zo(Xo(this).mul(Xo(e)))}mod(e){const t=Xo(e);return t.isNeg()&&Qo("division-by-zero","mod"),Zo(Xo(this).umod(t))}pow(e){const t=Xo(e);return t.isNeg()&&Qo("negative-power","pow"),Zo(Xo(this).pow(t))}and(e){const t=Xo(e);return(this.isNegative()||t.isNeg())&&Qo("unbound-bitwise-result","and"),Zo(Xo(this).and(t))}or(e){const t=Xo(e);return(this.isNegative()||t.isNeg())&&Qo("unbound-bitwise-result","or"),Zo(Xo(this).or(t))}xor(e){const t=Xo(e);return(this.isNegative()||t.isNeg())&&Qo("unbound-bitwise-result","xor"),Zo(Xo(this).xor(t))}mask(e){return(this.isNegative()||e<0)&&Qo("negative-width","mask"),Zo(Xo(this).maskn(e))}shl(e){return(this.isNegative()||e<0)&&Qo("negative-width","shl"),Zo(Xo(this).shln(e))}shr(e){return(this.isNegative()||e<0)&&Qo("negative-width","shr"),Zo(Xo(this).shrn(e))}eq(e){return Xo(this).eq(Xo(e))}lt(e){return Xo(this).lt(Xo(e))}lte(e){return Xo(this).lte(Xo(e))}gt(e){return Xo(this).gt(Xo(e))}gte(e){return Xo(this).gte(Xo(e))}isNegative(){return"-"===this._hex[0]}isZero(){return Xo(this).isZero()}toNumber(){try{return Xo(this).toNumber()}catch(e){Qo("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch(e){}return Ho.throwError("this platform does not support BigInt",bo.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(10===arguments[0]?Wo||(Wo=!0,Ho.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?Ho.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",bo.errors.UNEXPECTED_ARGUMENT,{}):Ho.throwError("BigNumber.toString does not accept parameters",bo.errors.UNEXPECTED_ARGUMENT,{})),Xo(this).toString(10)}toHexString(){return this._hex}toJSON(e){return{type:"BigNumber",hex:this.toHexString()}}static from(e){if(e instanceof Go)return e;if("string"==typeof e)return e.match(/^-?0x[0-9a-f]+$/i)?new Go(Ko,Vo(e)):e.match(/^-?[0-9]+$/)?new Go(Ko,Vo(new qo(e))):Ho.throwArgumentError("invalid BigNumber string","value",e);if("number"==typeof e)return e%1&&Qo("underflow","BigNumber.from",e),(e>=Jo||e<=-Jo)&&Qo("overflow","BigNumber.from",e),Go.from(String(e));const t=e;if("bigint"==typeof t)return Go.from(t.toString());if(Po(t))return Go.from(No(t));if(t)if(t.toHexString){const e=t.toHexString();if("string"==typeof e)return Go.from(e)}else{let e=t._hex;if(null==e&&"BigNumber"===t.type&&(e=t.hex),"string"==typeof e&&(Io(e)||"-"===e[0]&&Io(e.substring(1))))return Go.from(e)}return Ho.throwArgumentError("invalid BigNumber value","value",e)}static isBigNumber(e){return!(!e||!e._isBigNumber)}}function Vo(e){if("string"!=typeof e)return Vo(e.toString(16));if("-"===e[0])return"-"===(e=e.substring(1))[0]&&Ho.throwArgumentError("invalid hex","value",e),"0x00"===(e=Vo(e))?e:"-"+e;if("0x"!==e.substring(0,2)&&(e="0x"+e),"0x"===e)return"0x00";for(e.length%2&&(e="0x0"+e.substring(2));e.length>4&&"0x00"===e.substring(0,4);)e="0x"+e.substring(4);return e}function Zo(e){return Go.from(Vo(e))}function Xo(e){const t=Go.from(e).toHexString();return"-"===t[0]?new qo("-"+t.substring(3),16):new qo(t.substring(2),16)}function Qo(e,t,r){const n={fault:e,operation:t};return null!=r&&(n.value=r),Ho.throwError(e,bo.errors.NUMERIC_FAULT,n)}const Yo=new bo(Lo),ea={},ta=Go.from(0),ra=Go.from(-1);function na(e,t,r,n){const i={fault:t,operation:r};return void 0!==n&&(i.value=n),Yo.throwError(e,bo.errors.NUMERIC_FAULT,i)}let ia="0";for(;ia.length<256;)ia+=ia;function oa(e){if("number"!=typeof e)try{e=Go.from(e).toNumber()}catch(e){}return"number"==typeof e&&e>=0&&e<=256&&!(e%1)?"1"+ia.substring(0,e):Yo.throwArgumentError("invalid decimal size","decimals",e)}function aa(e,t){null==t&&(t=0);const r=oa(t),n=(e=Go.from(e)).lt(ta);n&&(e=e.mul(ra));let i=e.mod(r).toString();for(;i.length2&&Yo.throwArgumentError("too many decimal points","value",e);let o=i[0],a=i[1];for(o||(o="0"),a||(a="0");"0"===a[a.length-1];)a=a.substring(0,a.length-1);for(a.length>r.length-1&&na("fractional component exceeds decimals","underflow","parseFixed"),""===a&&(a="0");a.lengthnull==e[t]?n:(typeof e[t]!==r&&Yo.throwArgumentError("invalid fixed format ("+t+" not "+r+")","format."+t,e[t]),e[t]);t=i("signed","boolean",t),r=i("width","number",r),n=i("decimals","number",n)}return r%8&&Yo.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",r),n>80&&Yo.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",n),new ca(ea,t,r,n)}}class ua{constructor(e,t,r,n){e!==ea&&Yo.throwError("cannot use FixedNumber constructor; use FixedNumber.from",bo.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=n,this._hex=t,this._value=r,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(e){this.format.name!==e.format.name&&Yo.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",e)}addUnsafe(e){this._checkFormat(e);const t=sa(this._value,this.format.decimals),r=sa(e._value,e.format.decimals);return ua.fromValue(t.add(r),this.format.decimals,this.format)}subUnsafe(e){this._checkFormat(e);const t=sa(this._value,this.format.decimals),r=sa(e._value,e.format.decimals);return ua.fromValue(t.sub(r),this.format.decimals,this.format)}mulUnsafe(e){this._checkFormat(e);const t=sa(this._value,this.format.decimals),r=sa(e._value,e.format.decimals);return ua.fromValue(t.mul(r).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(e){this._checkFormat(e);const t=sa(this._value,this.format.decimals),r=sa(e._value,e.format.decimals);return ua.fromValue(t.mul(this.format._multiplier).div(r),this.format.decimals,this.format)}floor(){const e=this.toString().split(".");1===e.length&&e.push("0");let t=ua.from(e[0],this.format);const r=!e[1].match(/^(0*)$/);return this.isNegative()&&r&&(t=t.subUnsafe(fa.toFormat(t.format))),t}ceiling(){const e=this.toString().split(".");1===e.length&&e.push("0");let t=ua.from(e[0],this.format);const r=!e[1].match(/^(0*)$/);return!this.isNegative()&&r&&(t=t.addUnsafe(fa.toFormat(t.format))),t}round(e){null==e&&(e=0);const t=this.toString().split(".");if(1===t.length&&t.push("0"),(e<0||e>80||e%1)&&Yo.throwArgumentError("invalid decimal count","decimals",e),t[1].length<=e)return this;const r=ua.from("1"+ia.substring(0,e),this.format),n=da.toFormat(this.format);return this.mulUnsafe(r).addUnsafe(n).floor().divUnsafe(r)}isZero(){return"0.0"===this._value||"0"===this._value}isNegative(){return"-"===this._value[0]}toString(){return this._value}toHexString(e){if(null==e)return this._hex;e%8&&Yo.throwArgumentError("invalid byte width","width",e);return Bo(Go.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString(),e/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return ua.fromString(this._value,e)}static fromValue(e,t,r){return null!=r||null==t||function(e){return null!=e&&(Go.isBigNumber(e)||"number"==typeof e&&e%1==0||"string"==typeof e&&!!e.match(/^-?[0-9]+$/)||Io(e)||"bigint"==typeof e||Po(e))}(t)||(r=t,t=null),null==t&&(t=0),null==r&&(r="fixed"),ua.fromString(aa(e,t),ca.from(r))}static fromString(e,t){null==t&&(t="fixed");const r=ca.from(t),n=sa(e,r.decimals);!r.signed&&n.lt(ta)&&na("unsigned value cannot be negative","overflow","value",e);let i=null;r.signed?i=n.toTwos(r.width).toHexString():(i=n.toHexString(),i=Bo(i,r.width/8));const o=aa(n,r.decimals);return new ua(ea,i,o,r)}static fromBytes(e,t){null==t&&(t="fixed");const r=ca.from(t);if(xo(e).length>r.width/8)throw new Error("overflow");let n=Go.from(e);r.signed&&(n=n.fromTwos(r.width));const i=n.toTwos((r.signed?0:1)+r.width).toHexString(),o=aa(n,r.decimals);return new ua(ea,i,o,r)}static from(e,t){if("string"==typeof e)return ua.fromString(e,t);if(Po(e))return ua.fromBytes(e,t);try{return ua.fromValue(e,0,t)}catch(e){if(e.code!==bo.errors.INVALID_ARGUMENT)throw e}return Yo.throwArgumentError("invalid FixedNumber value","value",e)}static isFixedNumber(e){return!(!e||!e._isFixedNumber)}}const fa=ua.from(1),da=ua.from("0.5");var la=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))};const ha=new bo("properties/5.7.0");function pa(e,t,r){Object.defineProperty(e,t,{enumerable:!0,value:r,writable:!1})}function ma(e,t){for(let r=0;r<32;r++){if(e[t])return e[t];if(!e.prototype||"object"!=typeof e.prototype)break;e=Object.getPrototypeOf(e.prototype).constructor}return null}function ga(e){return la(this,void 0,void 0,(function*(){const t=Object.keys(e).map((t=>{const r=e[t];return Promise.resolve(r).then((e=>({key:t,value:e})))}));return(yield Promise.all(t)).reduce(((e,t)=>(e[t.key]=t.value,e)),{})}))}function ya(e,t){e&&"object"==typeof e||ha.throwArgumentError("invalid object","object",e),Object.keys(e).forEach((r=>{t[r]||ha.throwArgumentError("invalid object key - "+r,"transaction:"+r,e)}))}function ba(e){const t={};for(const r in e)t[r]=e[r];return t}const va={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function wa(e){if(null==e||va[typeof e])return!0;if(Array.isArray(e)||"object"==typeof e){if(!Object.isFrozen(e))return!1;const t=Object.keys(e);for(let r=0;r_a(e))));if("object"==typeof e){const t={};for(const r in e){const n=e[r];void 0!==n&&pa(t,r,_a(n))}return t}return ha.throwArgumentError("Cannot deepCopy "+typeof e,"object",e)}function _a(e){return Aa(e)}class Ea{constructor(e){for(const t in e)this[t]=_a(e[t])}}var Sa=Object.freeze({__proto__:null,Description:Ea,checkProperties:ya,deepCopy:_a,defineReadOnly:pa,getStatic:ma,resolveProperties:ga,shallowCopy:ba});const Pa="abi/5.7.0",xa=new bo(Pa),ka={};let Ma={calldata:!0,memory:!0,storage:!0},Ca={calldata:!0,memory:!0};function Ia(e,t){if("bytes"===e||"string"===e){if(Ma[t])return!0}else if("address"===e){if("payable"===t)return!0}else if((e.indexOf("[")>=0||"tuple"===e)&&Ca[t])return!0;return(Ma[t]||"payable"===t)&&xa.throwArgumentError("invalid modifier","name",t),!1}function Ra(e,t){for(let r in t)pa(e,r,t[r])}const Na=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),Oa=new RegExp(/^(.*)\[([0-9]*)\]$/);class Ta{constructor(e,t){e!==ka&&xa.throwError("use fromString",bo.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),Ra(this,t);let r=this.type.match(Oa);Ra(this,r?{arrayLength:parseInt(r[2]||"-1"),arrayChildren:Ta.fromObject({type:r[1],components:this.components}),baseType:"array"}:{arrayLength:null,arrayChildren:null,baseType:null!=this.components?"tuple":this.type}),this._isParamType=!0,Object.freeze(this)}format(e){if(e||(e=Na.sighash),Na[e]||xa.throwArgumentError("invalid format type","format",e),e===Na.json){let t={type:"tuple"===this.baseType?"tuple":this.type,name:this.name||void 0};return"boolean"==typeof this.indexed&&(t.indexed=this.indexed),this.components&&(t.components=this.components.map((t=>JSON.parse(t.format(e))))),JSON.stringify(t)}let t="";return"array"===this.baseType?(t+=this.arrayChildren.format(e),t+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):"tuple"===this.baseType?(e!==Na.sighash&&(t+=this.type),t+="("+this.components.map((t=>t.format(e))).join(e===Na.full?", ":",")+")"):t+=this.type,e!==Na.sighash&&(!0===this.indexed&&(t+=" indexed"),e===Na.full&&this.name&&(t+=" "+this.name)),t}static from(e,t){return"string"==typeof e?Ta.fromString(e,t):Ta.fromObject(e)}static fromObject(e){return Ta.isParamType(e)?e:new Ta(ka,{name:e.name||null,type:Ka(e.type),indexed:null==e.indexed?null:!!e.indexed,components:e.components?e.components.map(Ta.fromObject):null})}static fromString(e,t){return r=function(e,t){let r=e;function n(t){xa.throwArgumentError(`unexpected character at position ${t}`,"param",e)}function i(e){let r={type:"",name:"",parent:e,state:{allowType:!0}};return t&&(r.indexed=!1),r}e=e.replace(/\s/g," ");let o={type:"",name:"",state:{allowType:!0}},a=o;for(let r=0;rTa.fromString(e,t)))}class Da{constructor(e,t){e!==ka&&xa.throwError("use a static from method",bo.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),Ra(this,t),this._isFragment=!0,Object.freeze(this)}static from(e){return Da.isFragment(e)?e:"string"==typeof e?Da.fromString(e):Da.fromObject(e)}static fromObject(e){if(Da.isFragment(e))return e;switch(e.type){case"function":return La.fromObject(e);case"event":return $a.fromObject(e);case"constructor":return Ua.fromObject(e);case"error":return Ha.fromObject(e);case"fallback":case"receive":return null}return xa.throwArgumentError("invalid fragment object","value",e)}static fromString(e){return"event"===(e=(e=(e=e.replace(/\s/g," ")).replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," ")).trim()).split(" ")[0]?$a.fromString(e.substring(5).trim()):"function"===e.split(" ")[0]?La.fromString(e.substring(8).trim()):"constructor"===e.split("(")[0].trim()?Ua.fromString(e.trim()):"error"===e.split(" ")[0]?Ha.fromString(e.substring(5).trim()):xa.throwArgumentError("unsupported fragment","value",e)}static isFragment(e){return!(!e||!e._isFragment)}}class $a extends Da{format(e){if(e||(e=Na.sighash),Na[e]||xa.throwArgumentError("invalid format type","format",e),e===Na.json)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==Na.sighash&&(t+="event "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===Na.full?", ":",")+") ",e!==Na.sighash&&this.anonymous&&(t+="anonymous "),t.trim()}static from(e){return"string"==typeof e?$a.fromString(e):$a.fromObject(e)}static fromObject(e){if($a.isEventFragment(e))return e;"event"!==e.type&&xa.throwArgumentError("invalid event object","value",e);const t={name:Wa(e.name),anonymous:e.anonymous,inputs:e.inputs?e.inputs.map(Ta.fromObject):[],type:"event"};return new $a(ka,t)}static fromString(e){let t=e.match(Ga);t||xa.throwArgumentError("invalid event string","value",e);let r=!1;return t[3].split(" ").forEach((e=>{switch(e.trim()){case"anonymous":r=!0;break;case"":break;default:xa.warn("unknown modifier: "+e)}})),$a.fromObject({name:t[1].trim(),anonymous:r,inputs:ja(t[2],!0),type:"event"})}static isEventFragment(e){return e&&e._isFragment&&"event"===e.type}}function Ba(e,t){t.gas=null;let r=e.split("@");return 1!==r.length?(r.length>2&&xa.throwArgumentError("invalid human-readable ABI signature","value",e),r[1].match(/^[0-9]+$/)||xa.throwArgumentError("invalid human-readable ABI signature gas","value",e),t.gas=Go.from(r[1]),r[0]):e}function Fa(e,t){t.constant=!1,t.payable=!1,t.stateMutability="nonpayable",e.split(" ").forEach((e=>{switch(e.trim()){case"constant":t.constant=!0;break;case"payable":t.payable=!0,t.stateMutability="payable";break;case"nonpayable":t.payable=!1,t.stateMutability="nonpayable";break;case"pure":t.constant=!0,t.stateMutability="pure";break;case"view":t.constant=!0,t.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+e)}}))}function za(e){let t={constant:!1,payable:!0,stateMutability:"payable"};return null!=e.stateMutability?(t.stateMutability=e.stateMutability,t.constant="view"===t.stateMutability||"pure"===t.stateMutability,null!=e.constant&&!!e.constant!==t.constant&&xa.throwArgumentError("cannot have constant function with mutability "+t.stateMutability,"value",e),t.payable="payable"===t.stateMutability,null!=e.payable&&!!e.payable!==t.payable&&xa.throwArgumentError("cannot have payable function with mutability "+t.stateMutability,"value",e)):null!=e.payable?(t.payable=!!e.payable,null!=e.constant||t.payable||"constructor"===e.type||xa.throwArgumentError("unable to determine stateMutability","value",e),t.constant=!!e.constant,t.constant?t.stateMutability="view":t.stateMutability=t.payable?"payable":"nonpayable",t.payable&&t.constant&&xa.throwArgumentError("cannot have constant payable function","value",e)):null!=e.constant?(t.constant=!!e.constant,t.payable=!t.constant,t.stateMutability=t.constant?"view":"payable"):"constructor"!==e.type&&xa.throwArgumentError("unable to determine stateMutability","value",e),t}class Ua extends Da{format(e){if(e||(e=Na.sighash),Na[e]||xa.throwArgumentError("invalid format type","format",e),e===Na.json)return JSON.stringify({type:"constructor",stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});e===Na.sighash&&xa.throwError("cannot format a constructor for sighash",bo.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});let t="constructor("+this.inputs.map((t=>t.format(e))).join(e===Na.full?", ":",")+") ";return this.stateMutability&&"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "),t.trim()}static from(e){return"string"==typeof e?Ua.fromString(e):Ua.fromObject(e)}static fromObject(e){if(Ua.isConstructorFragment(e))return e;"constructor"!==e.type&&xa.throwArgumentError("invalid constructor object","value",e);let t=za(e);t.constant&&xa.throwArgumentError("constructor cannot be constant","value",e);const r={name:null,type:e.type,inputs:e.inputs?e.inputs.map(Ta.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?Go.from(e.gas):null};return new Ua(ka,r)}static fromString(e){let t={type:"constructor"},r=(e=Ba(e,t)).match(Ga);return r&&"constructor"===r[1].trim()||xa.throwArgumentError("invalid constructor string","value",e),t.inputs=ja(r[2].trim(),!1),Fa(r[3].trim(),t),Ua.fromObject(t)}static isConstructorFragment(e){return e&&e._isFragment&&"constructor"===e.type}}class La extends Ua{format(e){if(e||(e=Na.sighash),Na[e]||xa.throwArgumentError("invalid format type","format",e),e===Na.json)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((t=>JSON.parse(t.format(e)))),outputs:this.outputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==Na.sighash&&(t+="function "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===Na.full?", ":",")+") ",e!==Na.sighash&&(this.stateMutability?"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "):this.constant&&(t+="view "),this.outputs&&this.outputs.length&&(t+="returns ("+this.outputs.map((t=>t.format(e))).join(", ")+") "),null!=this.gas&&(t+="@"+this.gas.toString()+" ")),t.trim()}static from(e){return"string"==typeof e?La.fromString(e):La.fromObject(e)}static fromObject(e){if(La.isFunctionFragment(e))return e;"function"!==e.type&&xa.throwArgumentError("invalid function object","value",e);let t=za(e);const r={type:e.type,name:Wa(e.name),constant:t.constant,inputs:e.inputs?e.inputs.map(Ta.fromObject):[],outputs:e.outputs?e.outputs.map(Ta.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?Go.from(e.gas):null};return new La(ka,r)}static fromString(e){let t={type:"function"},r=(e=Ba(e,t)).split(" returns ");r.length>2&&xa.throwArgumentError("invalid function string","value",e);let n=r[0].match(Ga);if(n||xa.throwArgumentError("invalid function signature","value",e),t.name=n[1].trim(),t.name&&Wa(t.name),t.inputs=ja(n[2],!1),Fa(n[3].trim(),t),r.length>1){let n=r[1].match(Ga);""==n[1].trim()&&""==n[3].trim()||xa.throwArgumentError("unexpected tokens","value",e),t.outputs=ja(n[2],!1)}else t.outputs=[];return La.fromObject(t)}static isFunctionFragment(e){return e&&e._isFragment&&"function"===e.type}}function qa(e){const t=e.format();return"Error(string)"!==t&&"Panic(uint256)"!==t||xa.throwArgumentError(`cannot specify user defined ${t} error`,"fragment",e),e}class Ha extends Da{format(e){if(e||(e=Na.sighash),Na[e]||xa.throwArgumentError("invalid format type","format",e),e===Na.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==Na.sighash&&(t+="error "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===Na.full?", ":",")+") ",t.trim()}static from(e){return"string"==typeof e?Ha.fromString(e):Ha.fromObject(e)}static fromObject(e){if(Ha.isErrorFragment(e))return e;"error"!==e.type&&xa.throwArgumentError("invalid error object","value",e);const t={type:e.type,name:Wa(e.name),inputs:e.inputs?e.inputs.map(Ta.fromObject):[]};return qa(new Ha(ka,t))}static fromString(e){let t={type:"error"},r=e.match(Ga);return r||xa.throwArgumentError("invalid error signature","value",e),t.name=r[1].trim(),t.name&&Wa(t.name),t.inputs=ja(r[2],!1),qa(Ha.fromObject(t))}static isErrorFragment(e){return e&&e._isFragment&&"error"===e.type}}function Ka(e){return e.match(/^uint($|[^1-9])/)?e="uint256"+e.substring(4):e.match(/^int($|[^1-9])/)&&(e="int256"+e.substring(3)),e}const Ja=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function Wa(e){return e&&e.match(Ja)||xa.throwArgumentError(`invalid identifier "${e}"`,"value",e),e}const Ga=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$");const Va=new bo(Pa);function Za(e){const t=[],r=function(e,n){if(Array.isArray(n))for(let i in n){const o=e.slice();o.push(i);try{r(o,n[i])}catch(e){t.push({path:o,error:e})}}};return r([],e),t}class Xa{constructor(e,t,r,n){this.name=e,this.type=t,this.localName=r,this.dynamic=n}_throwError(e,t){Va.throwArgumentError(e,this.localName,t)}}class Qa{constructor(e){pa(this,"wordSize",e||32),this._data=[],this._dataLength=0,this._padding=new Uint8Array(e)}get data(){return jo(this._data)}get length(){return this._dataLength}_writeData(e){return this._data.push(e),this._dataLength+=e.length,e.length}appendWriter(e){return this._writeData(ko(e._data))}writeBytes(e){let t=xo(e);const r=t.length%this.wordSize;return r&&(t=ko([t,this._padding.slice(r)])),this._writeData(t)}_getValue(e){let t=xo(Go.from(e));return t.length>this.wordSize&&Va.throwError("value out-of-bounds",bo.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:t.length}),t.length%this.wordSize&&(t=ko([this._padding.slice(t.length%this.wordSize),t])),t}writeValue(e){return this._writeData(this._getValue(e))}writeUpdatableValue(){const e=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,t=>{this._data[e]=this._getValue(t)}}}class Ya{constructor(e,t,r,n){pa(this,"_data",xo(e)),pa(this,"wordSize",t||32),pa(this,"_coerceFunc",r),pa(this,"allowLoose",n),this._offset=0}get data(){return No(this._data)}get consumed(){return this._offset}static coerce(e,t){let r=e.match("^u?int([0-9]+)$");return r&&parseInt(r[1])<=48&&(t=t.toNumber()),t}coerce(e,t){return this._coerceFunc?this._coerceFunc(e,t):Ya.coerce(e,t)}_peekBytes(e,t,r){let n=Math.ceil(t/this.wordSize)*this.wordSize;return this._offset+n>this._data.length&&(this.allowLoose&&r&&this._offset+t<=this._data.length?n=t:Va.throwError("data out-of-bounds",bo.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+n})),this._data.slice(this._offset,this._offset+n)}subReader(e){return new Ya(this._data.slice(this._offset+e),this.wordSize,this._coerceFunc,this.allowLoose)}readBytes(e,t){let r=this._peekBytes(0,e,!!t);return this._offset+=r.length,r.slice(0,e)}readValue(){return Go.from(this.readBytes(this.wordSize))}}var es={exports:{}}; +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).nonRepudiationLibrary={})}(this,(function(e){"use strict";const t=e=>{const t=[];for(let r=0;rnew Uint8Array(atob(e).split("").map((e=>e.charCodeAt(0))));function n(e,r=!1,n=!0){let i="";{const r="string"==typeof e?(new TextEncoder).encode(e):new Uint8Array(e);i=t(r)}return r&&(i=function(e){return e.replace(/\+/g,"-").replace(/\//g,"_")}(i)),n||(i=i.replace(/=/g,"")),i}function i(e,t=!1){{let n=!1;if(/^[0-9a-zA-Z_-]+={0,2}$/.test(e))n=!0;else if(!/^[0-9a-zA-Z+/]*={0,2}$/.test(e))throw new Error("Not a valid base64 input");n&&(e=e.replace(/-/g,"+").replace(/_/g,"/").replace(/=/g,""));const i=r(e);return t?(new TextDecoder).decode(i):i}}function o(e,t=!1,r){const n=e.match(/^(0x)?([\da-fA-F]+)$/);if(null==n)throw new RangeError("input must be a hexadecimal string, e.g. '0x124fe3a' or '0214f1b2'");let i=n[2];if(void 0!==r){if(r{n+=i[e>>4]+i[15&e]})),o(n,t,r)}}function s(e,t=!1){let r=o(e);return r=o(e,!1,Math.ceil(r.length/2)),Uint8Array.from(r.match(/[\da-fA-F]{2}/g).map((e=>parseInt(e,16)))).buffer}function c(e,t=!1){if(e<1)throw new RangeError("byteLength MUST be > 0");return new Promise((function(r,n){{const n=new Uint8Array(e);if(e<=65536)self.crypto.getRandomValues(n);else for(let t=0;t=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function s(e,t,r){var n=a(e,r);return r-1>=t&&(n|=a(e,r-1)<<4),n}function c(e,t,r,n){for(var i=0,o=Math.min(e.length,r),a=t;a=49?s-49+10:s>=17?s-17+10:s}return i}i.isBN=function(e){return e instanceof i||null!==e&&"object"==typeof e&&e.constructor.wordSize===i.wordSize&&Array.isArray(e.words)},i.max=function(e,t){return e.cmp(t)>0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,n){if("number"==typeof e)return this._initNumber(e,t,n);if("object"==typeof e)return this._initArray(e,t,n);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)a=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===n)for(i=0,o=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this.strip()},i.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n=t;n-=2)i=s(e,t,n)<=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(n=(e.length-t)%2==0?t+1:t;n=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this.strip()},i.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,a=o%n,s=Math.min(o,o-a)+r,u=0,f=r;f1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?""};var u=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],f=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function l(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],a=i*o,s=67108863&a,c=a/67108864|0;r.words[0]=s;for(var u=1;u>>26,d=67108863&c,l=Math.min(u,t.length-1),h=Math.max(0,u-e.length+1);h<=l;h++){var p=u-h|0;f+=(a=(i=0|e.words[p])*(o=0|t.words[h])+d)/67108864|0,d=67108863&a}r.words[u]=0|d,c=0|f}return 0!==c?r.words[u]=0|c:r.length--,r.strip()}i.prototype.toString=function(e,t){var n;if(t=0|t||1,16===(e=e||10)||"hex"===e){n="";for(var i=0,o=0,a=0;a>>24-i&16777215)||a!==this.length-1?u[6-c.length]+c+n:c+n,(i+=2)>=26&&(i-=26,a--)}for(0!==o&&(n=o.toString(16)+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(e===(0|e)&&e>=2&&e<=36){var l=f[e],h=d[e];n="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(h).toString(e);n=(p=p.idivn(h)).isZero()?m+n:u[l-m.length]+m+n}for(this.isZero()&&(n="0"+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},i.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&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(e,t){return r(void 0!==o),this.toArrayLike(o,e,t)},i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},i.prototype.toArrayLike=function(e,t,n){var i=this.byteLength(),o=n||Math.max(1,i);r(i<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0"),this.strip();var a,s,c="le"===t,u=new e(o),f=this.clone();if(c){for(s=0;!f.isZero();s++)a=f.andln(255),f.iushrn(8),u[s]=a;for(;s=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){r("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),n>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-n),this.strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){r("number"==typeof e&&e>=0);var n=e/26|0,i=e%26;return this._expand(n+1),this.words[n]=t?this.words[n]|1<e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},i.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,a=0;a>26,this.words[a]=67108863&t;for(;0!==o&&a>26,this.words[a]=67108863&t;if(0===o&&a>>13,h=0|a[1],p=8191&h,m=h>>>13,g=0|a[2],y=8191&g,b=g>>>13,v=0|a[3],w=8191&v,A=v>>>13,_=0|a[4],E=8191&_,S=_>>>13,P=0|a[5],x=8191&P,k=P>>>13,M=0|a[6],C=8191&M,I=M>>>13,R=0|a[7],N=8191&R,O=R>>>13,T=0|a[8],j=8191&T,D=T>>>13,$=0|a[9],B=8191&$,F=$>>>13,z=0|s[0],U=8191&z,L=z>>>13,q=0|s[1],H=8191&q,K=q>>>13,J=0|s[2],W=8191&J,G=J>>>13,V=0|s[3],Z=8191&V,X=V>>>13,Q=0|s[4],Y=8191&Q,ee=Q>>>13,te=0|s[5],re=8191&te,ne=te>>>13,ie=0|s[6],oe=8191&ie,ae=ie>>>13,se=0|s[7],ce=8191&se,ue=se>>>13,fe=0|s[8],de=8191&fe,le=fe>>>13,he=0|s[9],pe=8191&he,me=he>>>13;r.negative=e.negative^t.negative,r.length=19;var ge=(u+(n=Math.imul(d,U))|0)+((8191&(i=(i=Math.imul(d,L))+Math.imul(l,U)|0))<<13)|0;u=((o=Math.imul(l,L))+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(p,U),i=(i=Math.imul(p,L))+Math.imul(m,U)|0,o=Math.imul(m,L);var ye=(u+(n=n+Math.imul(d,H)|0)|0)+((8191&(i=(i=i+Math.imul(d,K)|0)+Math.imul(l,H)|0))<<13)|0;u=((o=o+Math.imul(l,K)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(y,U),i=(i=Math.imul(y,L))+Math.imul(b,U)|0,o=Math.imul(b,L),n=n+Math.imul(p,H)|0,i=(i=i+Math.imul(p,K)|0)+Math.imul(m,H)|0,o=o+Math.imul(m,K)|0;var be=(u+(n=n+Math.imul(d,W)|0)|0)+((8191&(i=(i=i+Math.imul(d,G)|0)+Math.imul(l,W)|0))<<13)|0;u=((o=o+Math.imul(l,G)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(w,U),i=(i=Math.imul(w,L))+Math.imul(A,U)|0,o=Math.imul(A,L),n=n+Math.imul(y,H)|0,i=(i=i+Math.imul(y,K)|0)+Math.imul(b,H)|0,o=o+Math.imul(b,K)|0,n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(m,W)|0,o=o+Math.imul(m,G)|0;var ve=(u+(n=n+Math.imul(d,Z)|0)|0)+((8191&(i=(i=i+Math.imul(d,X)|0)+Math.imul(l,Z)|0))<<13)|0;u=((o=o+Math.imul(l,X)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(E,U),i=(i=Math.imul(E,L))+Math.imul(S,U)|0,o=Math.imul(S,L),n=n+Math.imul(w,H)|0,i=(i=i+Math.imul(w,K)|0)+Math.imul(A,H)|0,o=o+Math.imul(A,K)|0,n=n+Math.imul(y,W)|0,i=(i=i+Math.imul(y,G)|0)+Math.imul(b,W)|0,o=o+Math.imul(b,G)|0,n=n+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,X)|0;var we=(u+(n=n+Math.imul(d,Y)|0)|0)+((8191&(i=(i=i+Math.imul(d,ee)|0)+Math.imul(l,Y)|0))<<13)|0;u=((o=o+Math.imul(l,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(x,U),i=(i=Math.imul(x,L))+Math.imul(k,U)|0,o=Math.imul(k,L),n=n+Math.imul(E,H)|0,i=(i=i+Math.imul(E,K)|0)+Math.imul(S,H)|0,o=o+Math.imul(S,K)|0,n=n+Math.imul(w,W)|0,i=(i=i+Math.imul(w,G)|0)+Math.imul(A,W)|0,o=o+Math.imul(A,G)|0,n=n+Math.imul(y,Z)|0,i=(i=i+Math.imul(y,X)|0)+Math.imul(b,Z)|0,o=o+Math.imul(b,X)|0,n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(m,Y)|0,o=o+Math.imul(m,ee)|0;var Ae=(u+(n=n+Math.imul(d,re)|0)|0)+((8191&(i=(i=i+Math.imul(d,ne)|0)+Math.imul(l,re)|0))<<13)|0;u=((o=o+Math.imul(l,ne)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(C,U),i=(i=Math.imul(C,L))+Math.imul(I,U)|0,o=Math.imul(I,L),n=n+Math.imul(x,H)|0,i=(i=i+Math.imul(x,K)|0)+Math.imul(k,H)|0,o=o+Math.imul(k,K)|0,n=n+Math.imul(E,W)|0,i=(i=i+Math.imul(E,G)|0)+Math.imul(S,W)|0,o=o+Math.imul(S,G)|0,n=n+Math.imul(w,Z)|0,i=(i=i+Math.imul(w,X)|0)+Math.imul(A,Z)|0,o=o+Math.imul(A,X)|0,n=n+Math.imul(y,Y)|0,i=(i=i+Math.imul(y,ee)|0)+Math.imul(b,Y)|0,o=o+Math.imul(b,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(m,re)|0,o=o+Math.imul(m,ne)|0;var _e=(u+(n=n+Math.imul(d,oe)|0)|0)+((8191&(i=(i=i+Math.imul(d,ae)|0)+Math.imul(l,oe)|0))<<13)|0;u=((o=o+Math.imul(l,ae)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(N,U),i=(i=Math.imul(N,L))+Math.imul(O,U)|0,o=Math.imul(O,L),n=n+Math.imul(C,H)|0,i=(i=i+Math.imul(C,K)|0)+Math.imul(I,H)|0,o=o+Math.imul(I,K)|0,n=n+Math.imul(x,W)|0,i=(i=i+Math.imul(x,G)|0)+Math.imul(k,W)|0,o=o+Math.imul(k,G)|0,n=n+Math.imul(E,Z)|0,i=(i=i+Math.imul(E,X)|0)+Math.imul(S,Z)|0,o=o+Math.imul(S,X)|0,n=n+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(A,Y)|0,o=o+Math.imul(A,ee)|0,n=n+Math.imul(y,re)|0,i=(i=i+Math.imul(y,ne)|0)+Math.imul(b,re)|0,o=o+Math.imul(b,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,ae)|0)+Math.imul(m,oe)|0,o=o+Math.imul(m,ae)|0;var Ee=(u+(n=n+Math.imul(d,ce)|0)|0)+((8191&(i=(i=i+Math.imul(d,ue)|0)+Math.imul(l,ce)|0))<<13)|0;u=((o=o+Math.imul(l,ue)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(j,U),i=(i=Math.imul(j,L))+Math.imul(D,U)|0,o=Math.imul(D,L),n=n+Math.imul(N,H)|0,i=(i=i+Math.imul(N,K)|0)+Math.imul(O,H)|0,o=o+Math.imul(O,K)|0,n=n+Math.imul(C,W)|0,i=(i=i+Math.imul(C,G)|0)+Math.imul(I,W)|0,o=o+Math.imul(I,G)|0,n=n+Math.imul(x,Z)|0,i=(i=i+Math.imul(x,X)|0)+Math.imul(k,Z)|0,o=o+Math.imul(k,X)|0,n=n+Math.imul(E,Y)|0,i=(i=i+Math.imul(E,ee)|0)+Math.imul(S,Y)|0,o=o+Math.imul(S,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(A,re)|0,o=o+Math.imul(A,ne)|0,n=n+Math.imul(y,oe)|0,i=(i=i+Math.imul(y,ae)|0)+Math.imul(b,oe)|0,o=o+Math.imul(b,ae)|0,n=n+Math.imul(p,ce)|0,i=(i=i+Math.imul(p,ue)|0)+Math.imul(m,ce)|0,o=o+Math.imul(m,ue)|0;var Se=(u+(n=n+Math.imul(d,de)|0)|0)+((8191&(i=(i=i+Math.imul(d,le)|0)+Math.imul(l,de)|0))<<13)|0;u=((o=o+Math.imul(l,le)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(B,U),i=(i=Math.imul(B,L))+Math.imul(F,U)|0,o=Math.imul(F,L),n=n+Math.imul(j,H)|0,i=(i=i+Math.imul(j,K)|0)+Math.imul(D,H)|0,o=o+Math.imul(D,K)|0,n=n+Math.imul(N,W)|0,i=(i=i+Math.imul(N,G)|0)+Math.imul(O,W)|0,o=o+Math.imul(O,G)|0,n=n+Math.imul(C,Z)|0,i=(i=i+Math.imul(C,X)|0)+Math.imul(I,Z)|0,o=o+Math.imul(I,X)|0,n=n+Math.imul(x,Y)|0,i=(i=i+Math.imul(x,ee)|0)+Math.imul(k,Y)|0,o=o+Math.imul(k,ee)|0,n=n+Math.imul(E,re)|0,i=(i=i+Math.imul(E,ne)|0)+Math.imul(S,re)|0,o=o+Math.imul(S,ne)|0,n=n+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,ae)|0)+Math.imul(A,oe)|0,o=o+Math.imul(A,ae)|0,n=n+Math.imul(y,ce)|0,i=(i=i+Math.imul(y,ue)|0)+Math.imul(b,ce)|0,o=o+Math.imul(b,ue)|0,n=n+Math.imul(p,de)|0,i=(i=i+Math.imul(p,le)|0)+Math.imul(m,de)|0,o=o+Math.imul(m,le)|0;var Pe=(u+(n=n+Math.imul(d,pe)|0)|0)+((8191&(i=(i=i+Math.imul(d,me)|0)+Math.imul(l,pe)|0))<<13)|0;u=((o=o+Math.imul(l,me)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(B,H),i=(i=Math.imul(B,K))+Math.imul(F,H)|0,o=Math.imul(F,K),n=n+Math.imul(j,W)|0,i=(i=i+Math.imul(j,G)|0)+Math.imul(D,W)|0,o=o+Math.imul(D,G)|0,n=n+Math.imul(N,Z)|0,i=(i=i+Math.imul(N,X)|0)+Math.imul(O,Z)|0,o=o+Math.imul(O,X)|0,n=n+Math.imul(C,Y)|0,i=(i=i+Math.imul(C,ee)|0)+Math.imul(I,Y)|0,o=o+Math.imul(I,ee)|0,n=n+Math.imul(x,re)|0,i=(i=i+Math.imul(x,ne)|0)+Math.imul(k,re)|0,o=o+Math.imul(k,ne)|0,n=n+Math.imul(E,oe)|0,i=(i=i+Math.imul(E,ae)|0)+Math.imul(S,oe)|0,o=o+Math.imul(S,ae)|0,n=n+Math.imul(w,ce)|0,i=(i=i+Math.imul(w,ue)|0)+Math.imul(A,ce)|0,o=o+Math.imul(A,ue)|0,n=n+Math.imul(y,de)|0,i=(i=i+Math.imul(y,le)|0)+Math.imul(b,de)|0,o=o+Math.imul(b,le)|0;var xe=(u+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,me)|0)+Math.imul(m,pe)|0))<<13)|0;u=((o=o+Math.imul(m,me)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(B,W),i=(i=Math.imul(B,G))+Math.imul(F,W)|0,o=Math.imul(F,G),n=n+Math.imul(j,Z)|0,i=(i=i+Math.imul(j,X)|0)+Math.imul(D,Z)|0,o=o+Math.imul(D,X)|0,n=n+Math.imul(N,Y)|0,i=(i=i+Math.imul(N,ee)|0)+Math.imul(O,Y)|0,o=o+Math.imul(O,ee)|0,n=n+Math.imul(C,re)|0,i=(i=i+Math.imul(C,ne)|0)+Math.imul(I,re)|0,o=o+Math.imul(I,ne)|0,n=n+Math.imul(x,oe)|0,i=(i=i+Math.imul(x,ae)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,ae)|0,n=n+Math.imul(E,ce)|0,i=(i=i+Math.imul(E,ue)|0)+Math.imul(S,ce)|0,o=o+Math.imul(S,ue)|0,n=n+Math.imul(w,de)|0,i=(i=i+Math.imul(w,le)|0)+Math.imul(A,de)|0,o=o+Math.imul(A,le)|0;var ke=(u+(n=n+Math.imul(y,pe)|0)|0)+((8191&(i=(i=i+Math.imul(y,me)|0)+Math.imul(b,pe)|0))<<13)|0;u=((o=o+Math.imul(b,me)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(B,Z),i=(i=Math.imul(B,X))+Math.imul(F,Z)|0,o=Math.imul(F,X),n=n+Math.imul(j,Y)|0,i=(i=i+Math.imul(j,ee)|0)+Math.imul(D,Y)|0,o=o+Math.imul(D,ee)|0,n=n+Math.imul(N,re)|0,i=(i=i+Math.imul(N,ne)|0)+Math.imul(O,re)|0,o=o+Math.imul(O,ne)|0,n=n+Math.imul(C,oe)|0,i=(i=i+Math.imul(C,ae)|0)+Math.imul(I,oe)|0,o=o+Math.imul(I,ae)|0,n=n+Math.imul(x,ce)|0,i=(i=i+Math.imul(x,ue)|0)+Math.imul(k,ce)|0,o=o+Math.imul(k,ue)|0,n=n+Math.imul(E,de)|0,i=(i=i+Math.imul(E,le)|0)+Math.imul(S,de)|0,o=o+Math.imul(S,le)|0;var Me=(u+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,me)|0)+Math.imul(A,pe)|0))<<13)|0;u=((o=o+Math.imul(A,me)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(B,Y),i=(i=Math.imul(B,ee))+Math.imul(F,Y)|0,o=Math.imul(F,ee),n=n+Math.imul(j,re)|0,i=(i=i+Math.imul(j,ne)|0)+Math.imul(D,re)|0,o=o+Math.imul(D,ne)|0,n=n+Math.imul(N,oe)|0,i=(i=i+Math.imul(N,ae)|0)+Math.imul(O,oe)|0,o=o+Math.imul(O,ae)|0,n=n+Math.imul(C,ce)|0,i=(i=i+Math.imul(C,ue)|0)+Math.imul(I,ce)|0,o=o+Math.imul(I,ue)|0,n=n+Math.imul(x,de)|0,i=(i=i+Math.imul(x,le)|0)+Math.imul(k,de)|0,o=o+Math.imul(k,le)|0;var Ce=(u+(n=n+Math.imul(E,pe)|0)|0)+((8191&(i=(i=i+Math.imul(E,me)|0)+Math.imul(S,pe)|0))<<13)|0;u=((o=o+Math.imul(S,me)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(B,re),i=(i=Math.imul(B,ne))+Math.imul(F,re)|0,o=Math.imul(F,ne),n=n+Math.imul(j,oe)|0,i=(i=i+Math.imul(j,ae)|0)+Math.imul(D,oe)|0,o=o+Math.imul(D,ae)|0,n=n+Math.imul(N,ce)|0,i=(i=i+Math.imul(N,ue)|0)+Math.imul(O,ce)|0,o=o+Math.imul(O,ue)|0,n=n+Math.imul(C,de)|0,i=(i=i+Math.imul(C,le)|0)+Math.imul(I,de)|0,o=o+Math.imul(I,le)|0;var Ie=(u+(n=n+Math.imul(x,pe)|0)|0)+((8191&(i=(i=i+Math.imul(x,me)|0)+Math.imul(k,pe)|0))<<13)|0;u=((o=o+Math.imul(k,me)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(B,oe),i=(i=Math.imul(B,ae))+Math.imul(F,oe)|0,o=Math.imul(F,ae),n=n+Math.imul(j,ce)|0,i=(i=i+Math.imul(j,ue)|0)+Math.imul(D,ce)|0,o=o+Math.imul(D,ue)|0,n=n+Math.imul(N,de)|0,i=(i=i+Math.imul(N,le)|0)+Math.imul(O,de)|0,o=o+Math.imul(O,le)|0;var Re=(u+(n=n+Math.imul(C,pe)|0)|0)+((8191&(i=(i=i+Math.imul(C,me)|0)+Math.imul(I,pe)|0))<<13)|0;u=((o=o+Math.imul(I,me)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(B,ce),i=(i=Math.imul(B,ue))+Math.imul(F,ce)|0,o=Math.imul(F,ue),n=n+Math.imul(j,de)|0,i=(i=i+Math.imul(j,le)|0)+Math.imul(D,de)|0,o=o+Math.imul(D,le)|0;var Ne=(u+(n=n+Math.imul(N,pe)|0)|0)+((8191&(i=(i=i+Math.imul(N,me)|0)+Math.imul(O,pe)|0))<<13)|0;u=((o=o+Math.imul(O,me)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,n=Math.imul(B,de),i=(i=Math.imul(B,le))+Math.imul(F,de)|0,o=Math.imul(F,le);var Oe=(u+(n=n+Math.imul(j,pe)|0)|0)+((8191&(i=(i=i+Math.imul(j,me)|0)+Math.imul(D,pe)|0))<<13)|0;u=((o=o+Math.imul(D,me)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863;var Te=(u+(n=Math.imul(B,pe))|0)+((8191&(i=(i=Math.imul(B,me))+Math.imul(F,pe)|0))<<13)|0;return u=((o=Math.imul(F,me))+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,c[0]=ge,c[1]=ye,c[2]=be,c[3]=ve,c[4]=we,c[5]=Ae,c[6]=_e,c[7]=Ee,c[8]=Se,c[9]=Pe,c[10]=xe,c[11]=ke,c[12]=Me,c[13]=Ce,c[14]=Ie,c[15]=Re,c[16]=Ne,c[17]=Oe,c[18]=Te,0!==u&&(c[19]=u,r.length++),r};function p(e,t,r){return(new m).mulp(e,t,r)}function m(e,t){this.x=e,this.y=t}Math.imul||(h=l),i.prototype.mulTo=function(e,t){var r,n=this.length+e.length;return r=10===this.length&&10===e.length?h(this,e,t):n<63?l(this,e,t):n<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,a&=67108863}r.words[o]=s,n=a,a=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,e,t):p(this,e,t),r},m.prototype.makeRBT=function(e){for(var t=new Array(e),r=i.prototype._countBits(e)-1,n=0;n>=1;return n},m.prototype.permute=function(e,t,r,n,i,o){for(var a=0;a>>=1)i++;return 1<>>=13,n[2*a+1]=8191&o,o>>>=13;for(a=2*t;a>=26,t+=i/67108864|0,t+=o>>>26,this.words[n]=67108863&o}return 0!==t&&(this.words[n]=t,this.length++),this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>i}return t}(e);if(0===t.length)return new i(1);for(var r=this,n=0;n=0);var t,n=e%26,i=(e-n)/26,o=67108863>>>26-n<<26-n;if(0!==n){var a=0;for(t=0;t>>26-n}a&&(this.words[t]=a,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var o=e%26,a=Math.min((e-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,u=0;u=0&&(0!==f||u>=i);u--){var d=0|this.words[u];this.words[u]=f<<26-o|d>>>o,f=d&s}return c&&0!==f&&(c.words[c.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(e,t,n){return r(0===this.negative),this.iushrn(e,t,n)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){r("number"==typeof e&&e>=0);var t=e%26,n=(e-t)/26,i=1<=0);var t=e%26,n=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==t&&n++,this.length=Math.min(n,this.length),0!==t){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},i.prototype.isubn=function(e){if(r("number"==typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(c/67108864|0),this.words[i+n]=67108863&o}for(;i>26,this.words[i+n]=67108863&o;if(0===s)return this.strip();for(r(-1===s),s=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},i.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),o=e,a=0|o.words[o.length-1];0!==(r=26-this._countBits(a))&&(o=o.ushln(r),n.iushln(r),a=0|o.words[o.length-1]);var s,c=n.length-o.length;if("mod"!==t){(s=new i(null)).length=c+1,s.words=new Array(s.length);for(var u=0;u=0;d--){var l=67108864*(0|n.words[o.length+d])+(0|n.words[o.length+d-1]);for(l=Math.min(l/a|0,67108863),n._ishlnsubmul(o,l,d);0!==n.negative;)l--,n.negative=0,n._ishlnsubmul(o,1,d),n.isZero()||(n.negative^=1);s&&(s.words[d]=l)}return s&&s.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},i.prototype.divmod=function(e,t,n){return r(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(o=s.div.neg()),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.iadd(e)),{div:o,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(o=s.div.neg()),{div:o,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modn(e.words[0]))}:this._wordDiv(e,t);var o,a,s},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modn=function(e){r(e<=67108863);for(var t=(1<<26)%e,n=0,i=this.length-1;i>=0;i--)n=(t*n+(0|this.words[i]))%e;return n},i.prototype.idivn=function(e){r(e<=67108863);for(var t=0,n=this.length-1;n>=0;n--){var i=(0|this.words[n])+67108864*t;this.words[n]=i/e|0,t=i%e}return this.strip()},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o=new i(1),a=new i(0),s=new i(0),c=new i(1),u=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++u;for(var f=n.clone(),d=t.clone();!t.isZero();){for(var l=0,h=1;0==(t.words[0]&h)&&l<26;++l,h<<=1);if(l>0)for(t.iushrn(l);l-- >0;)(o.isOdd()||a.isOdd())&&(o.iadd(f),a.isub(d)),o.iushrn(1),a.iushrn(1);for(var p=0,m=1;0==(n.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(n.iushrn(p);p-- >0;)(s.isOdd()||c.isOdd())&&(s.iadd(f),c.isub(d)),s.iushrn(1),c.iushrn(1);t.cmp(n)>=0?(t.isub(n),o.isub(s),a.isub(c)):(n.isub(t),s.isub(o),c.isub(a))}return{a:s,b:c,gcd:n.iushln(u)}},i.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o,a=new i(1),s=new i(0),c=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(var u=0,f=1;0==(t.words[0]&f)&&u<26;++u,f<<=1);if(u>0)for(t.iushrn(u);u-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);for(var d=0,l=1;0==(n.words[0]&l)&&d<26;++d,l<<=1);if(d>0)for(n.iushrn(d);d-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);t.cmp(n)>=0?(t.isub(n),a.isub(s)):(n.isub(t),s.isub(a))}return(o=0===t.cmpn(1)?a:s).cmpn(0)<0&&o.iadd(e),o},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return 0==(1&this.words[0])},i.prototype.isOdd=function(){return 1==(1&this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){r("number"==typeof e);var t=e%26,n=(e-t)/26,i=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this.strip(),this.length>1)t=1;else{n&&(e=-e),r(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){ni&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new E(e)},i.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var y={k256:null,p224:null,p192:null,p25519:null};function b(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){b.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){b.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function A(){b.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){b.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function E(e){if("string"==typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function S(e){E.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(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)}b.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},b.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},b.prototype.split=function(e,t){e.iushrn(this.n,0,t)},b.prototype.imulK=function(e){return e.imul(this.k)},n(v,b),v.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i>>22,o=a}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},v.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(y[e])return y[e];var t;if("k256"===e)t=new v;else if("p224"===e)t=new w;else if("p192"===e)t=new A;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new _}return y[e]=t,t},E.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},E.prototype._verify2=function(e,t){r(0==(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},E.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},E.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},E.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},E.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},E.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},E.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},E.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},E.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},E.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},E.prototype.isqr=function(e){return this.imul(e,e.clone())},E.prototype.sqr=function(e){return this.mul(e,e)},E.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2==1),3===t){var n=this.m.add(new i(1)).iushrn(2);return this.pow(e,n)}for(var o=this.m.subn(1),a=0;!o.isZero()&&0===o.andln(1);)a++,o.iushrn(1);r(!o.isZero());var s=new i(1).toRed(this),c=s.redNeg(),u=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new i(2*f*f).toRed(this);0!==this.pow(f,u).cmp(c);)f.redIAdd(c);for(var d=this.pow(f,o),l=this.pow(e,o.addn(1).iushrn(1)),h=this.pow(e,o),p=a;0!==h.cmp(s);){for(var m=h,g=0;0!==m.cmp(s);g++)m=m.redSqr();r(g=0;n--){for(var u=t.words[n],f=c-1;f>=0;f--){var d=u>>f&1;o!==r[0]&&(o=this.sqr(o)),0!==d||0!==a?(a<<=1,a|=d,(4===++s||0===n&&0===f)&&(o=this.mul(o,r[a]),s=0,a=0)):s=0}c=26}return o},E.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},E.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new S(e)},n(S,E),S.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},S.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},S.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},S.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(n).iushrn(this.shift),a=o;return o.cmp(this.m)>=0?a=o.isub(this.m):o.cmpn(0)<0&&(a=o.iadd(this.m)),a._forceRed(this)},S.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,u)}(m);var y=m.exports,b=v;function v(e,t){if(!e)throw new Error(t||"Assertion failed")}v.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)};var w={};!function(e){var t=e;function r(e){return 1===e.length?"0"+e:e}function n(e){for(var t="",n=0;n>8,a=255&i;o?r.push(o,a):r.push(a)}return r},t.zero2=r,t.toHex=n,t.encode=function(e,t){return"hex"===t?n(e):e}}(w),function(e){var t=e,r=y,n=b,i=w;t.assert=n,t.toArray=i.toArray,t.zero2=i.zero2,t.toHex=i.toHex,t.encode=i.encode,t.getNAF=function(e,t,r){var n=new Array(Math.max(e.bitLength(),r)+1);n.fill(0);for(var i=1<(i>>1)-1?(i>>1)-c:c,o.isubn(s)):s=0,n[a]=s,o.iushrn(1)}return n},t.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n,i=0,o=0;e.cmpn(-i)>0||t.cmpn(-o)>0;){var a,s,c=e.andln(3)+i&3,u=t.andln(3)+o&3;3===c&&(c=-1),3===u&&(u=-1),a=0==(1&c)?0:3!==(n=e.andln(7)+i&7)&&5!==n||2!==u?c:-c,r[0].push(a),s=0==(1&u)?0:3!==(n=t.andln(7)+o&7)&&5!==n||2!==c?u:-u,r[1].push(s),2*i===a+1&&(i=1-i),2*o===s+1&&(o=1-o),e.iushrn(1),t.iushrn(1)}return r},t.cachedProperty=function(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},t.parseBytes=function(e){return"string"==typeof e?t.toArray(e,"hex"):e},t.intFromLE=function(e){return new r(e,"hex","le")}}(p);var A,_={exports:{}};function E(e){this.rand=e}if(_.exports=function(e){return A||(A=new E(null)),A.generate(e)},_.exports.Rand=E,E.prototype.generate=function(e){return this._rand(e)},E.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),r=0;r0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var O=N;function T(e,t){this.curve=e,this.type=t,this.precomputed=null}N.prototype.point=function(){throw new Error("Not implemented")},N.prototype.validate=function(){throw new Error("Not implemented")},N.prototype._fixedNafMul=function(e,t){R(e.precomputed);var r=e._getDoubles(),n=C(t,1,this._bitLength),i=(1<=o;c--)a=(a<<1)+n[c];s.push(a)}for(var u=this.jpoint(null,null,null),f=this.jpoint(null,null,null),d=i;d>0;d--){for(o=0;o=0;s--){for(var c=0;s>=0&&0===o[s];s--)c++;if(s>=0&&c++,a=a.dblp(c),s<0)break;var u=o[s];R(0!==u),a="affine"===e.type?u>0?a.mixedAdd(i[u-1>>1]):a.mixedAdd(i[-u-1>>1].neg()):u>0?a.add(i[u-1>>1]):a.add(i[-u-1>>1].neg())}return"affine"===e.type?a.toP():a},N.prototype._wnafMulAdd=function(e,t,r,n,i){var o,a,s,c=this._wnafT1,u=this._wnafT2,f=this._wnafT3,d=0;for(o=0;o=1;o-=2){var h=o-1,p=o;if(1===c[h]&&1===c[p]){var m=[t[h],null,null,t[p]];0===t[h].y.cmp(t[p].y)?(m[1]=t[h].add(t[p]),m[2]=t[h].toJ().mixedAdd(t[p].neg())):0===t[h].y.cmp(t[p].y.redNeg())?(m[1]=t[h].toJ().mixedAdd(t[p]),m[2]=t[h].add(t[p].neg())):(m[1]=t[h].toJ().mixedAdd(t[p]),m[2]=t[h].toJ().mixedAdd(t[p].neg()));var g=[-3,-1,-5,-7,0,7,5,1,3],y=I(r[h],r[p]);for(d=Math.max(y[0].length,d),f[h]=new Array(d),f[p]=new Array(d),a=0;a=0;o--){for(var _=0;o>=0;){var E=!0;for(a=0;a=0&&_++,w=w.dblp(_),o<0)break;for(a=0;a0?s=u[a][S-1>>1]:S<0&&(s=u[a][-S-1>>1].neg()),w="affine"===s.type?w.mixedAdd(s):w.add(s))}}for(o=0;o=Math.ceil((e.bitLength()+1)/t.step)},T.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i=0&&(o=t,a=r),n.negative&&(n=n.neg(),i=i.neg()),o.negative&&(o=o.neg(),a=a.neg()),[{a:n,b:i},{a:o,b:a}]},U.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],i=n.b.mul(e).divRound(this.n),o=r.b.neg().mul(e).divRound(this.n),a=i.mul(r.a),s=o.mul(n.a),c=i.mul(r.b),u=o.mul(n.b);return{k1:e.sub(a).sub(s),k2:c.add(u).neg()}},U.prototype.pointFromX=function(e,t){(e=new $(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var i=n.fromRed().isOdd();return(t&&!i||!t&&i)&&(n=n.redNeg()),this.point(e,n)},U.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},U.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o":""},q.prototype.isInfinity=function(){return this.inf},q.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},q.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),a=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)},q.prototype.getX=function(){return this.x.fromRed()},q.prototype.getY=function(){return this.y.fromRed()},q.prototype.mul=function(e){return e=new $(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)},q.prototype.mulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},q.prototype.jmulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},q.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))},q.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,n=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return t},q.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},B(H,F.BasePoint),U.prototype.jpoint=function(e,t,r){return new H(this,e,t,r)},H.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},H.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},H.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),i=e.x.redMul(r),o=this.y.redMul(t.redMul(e.z)),a=e.y.redMul(r.redMul(this.z)),s=n.redSub(i),c=o.redSub(a);if(0===s.cmpn(0))return 0!==c.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=s.redSqr(),f=u.redMul(s),d=n.redMul(u),l=c.redSqr().redIAdd(f).redISub(d).redISub(d),h=c.redMul(d.redISub(l)).redISub(o.redMul(f)),p=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(l,h,p)},H.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),i=this.y,o=e.y.redMul(t).redMul(this.z),a=r.redSub(n),s=i.redSub(o);if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=a.redSqr(),u=c.redMul(a),f=r.redMul(c),d=s.redSqr().redIAdd(u).redISub(f).redISub(f),l=s.redMul(f.redISub(d)).redISub(i.redMul(u)),h=this.z.redMul(a);return this.curve.jpoint(d,l,h)},H.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var r=this;for(t=0;t=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},H.prototype.inspect=function(){return this.isInfinity()?"":""},H.prototype.isInfinity=function(){return 0===this.z.cmpn(0)};var K=y,J=D,W=O,G=p;function V(e){W.call(this,"mont",e),this.a=new K(e.a,16).toRed(this.red),this.b=new K(e.b,16).toRed(this.red),this.i4=new K(4).toRed(this.red).redInvm(),this.two=new K(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}J(V,W);var Z=V;function X(e,t,r){W.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new K(t,16),this.z=new K(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}V.prototype.validate=function(e){var t=e.normalize().x,r=t.redSqr(),n=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t);return 0===n.redSqrt().redSqr().cmp(n)},J(X,W.BasePoint),V.prototype.decodePoint=function(e,t){return this.point(G.toArray(e,t),1)},V.prototype.point=function(e,t){return new X(this,e,t)},V.prototype.pointFromJSON=function(e){return X.fromJSON(this,e)},X.prototype.precompute=function(){},X.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},X.fromJSON=function(e,t){return new X(e,t[0],t[1]||e.one)},X.prototype.inspect=function(){return this.isInfinity()?"":""},X.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},X.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),r=e.redSub(t),n=e.redMul(t),i=r.redMul(t.redAdd(this.curve.a24.redMul(r)));return this.curve.point(n,i)},X.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},X.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=e.x.redAdd(e.z),o=e.x.redSub(e.z).redMul(r),a=i.redMul(n),s=t.z.redMul(o.redAdd(a).redSqr()),c=t.x.redMul(o.redISub(a).redSqr());return this.curve.point(s,c)},X.prototype.mul=function(e){for(var t=e.clone(),r=this,n=this.curve.point(null,null),i=[];0!==t.cmpn(0);t.iushrn(1))i.push(t.andln(1));for(var o=i.length-1;o>=0;o--)0===i[o]?(r=r.diffAdd(n,this),n=n.dbl()):(n=r.diffAdd(n,this),r=r.dbl());return n},X.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},X.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},X.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},X.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},X.prototype.getX=function(){return this.normalize(),this.x.fromRed()};var Q=y,Y=D,ee=O,te=p.assert;function re(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,ee.call(this,"edwards",e),this.a=new Q(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new Q(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new Q(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),te(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}Y(re,ee);var ne=re;function ie(e,t,r,n,i){ee.BasePoint.call(this,e,"projective"),null===t&&null===r&&null===n?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new Q(t,16),this.y=new Q(r,16),this.z=n?new Q(n,16):this.curve.one,this.t=i&&new Q(i,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}re.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},re.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},re.prototype.jpoint=function(e,t,r,n){return this.point(e,t,r,n)},re.prototype.pointFromX=function(e,t){(e=new Q(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=this.c2.redSub(this.a.redMul(r)),i=this.one.redSub(this.c2.redMul(this.d).redMul(r)),o=n.redMul(i.redInvm()),a=o.redSqrt();if(0!==a.redSqr().redSub(o).cmp(this.zero))throw new Error("invalid point");var s=a.fromRed().isOdd();return(t&&!s||!t&&s)&&(a=a.redNeg()),this.point(e,a)},re.prototype.pointFromY=function(e,t){(e=new Q(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=r.redSub(this.c2),i=r.redMul(this.d).redMul(this.c2).redSub(this.a),o=n.redMul(i.redInvm());if(0===o.cmp(this.zero)){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var a=o.redSqrt();if(0!==a.redSqr().redSub(o).cmp(this.zero))throw new Error("invalid point");return a.fromRed().isOdd()!==t&&(a=a.redNeg()),this.point(a,e)},re.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),r=e.y.redSqr(),n=t.redMul(this.a).redAdd(r),i=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(r)));return 0===n.cmp(i)},Y(ie,ee.BasePoint),re.prototype.pointFromJSON=function(e){return ie.fromJSON(this,e)},re.prototype.point=function(e,t,r,n){return new ie(this,e,t,r,n)},ie.fromJSON=function(e,t){return new ie(e,t[0],t[1],t[2])},ie.prototype.inspect=function(){return this.isInfinity()?"":""},ie.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},ie.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(e),i=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),o=n.redAdd(t),a=o.redSub(r),s=n.redSub(t),c=i.redMul(a),u=o.redMul(s),f=i.redMul(s),d=a.redMul(o);return this.curve.point(c,u,d,f)},ie.prototype._projDbl=function(){var e,t,r,n,i,o,a=this.x.redAdd(this.y).redSqr(),s=this.x.redSqr(),c=this.y.redSqr();if(this.curve.twisted){var u=(n=this.curve._mulA(s)).redAdd(c);this.zOne?(e=a.redSub(s).redSub(c).redMul(u.redSub(this.curve.two)),t=u.redMul(n.redSub(c)),r=u.redSqr().redSub(u).redSub(u)):(i=this.z.redSqr(),o=u.redSub(i).redISub(i),e=a.redSub(s).redISub(c).redMul(o),t=u.redMul(n.redSub(c)),r=u.redMul(o))}else n=s.redAdd(c),i=this.curve._mulC(this.z).redSqr(),o=n.redSub(i).redSub(i),e=this.curve._mulC(a.redISub(n)).redMul(o),t=this.curve._mulC(n).redMul(s.redISub(c)),r=n.redMul(o);return this.curve.point(e,t,r)},ie.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},ie.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),n=this.t.redMul(this.curve.dd).redMul(e.t),i=this.z.redMul(e.z.redAdd(e.z)),o=r.redSub(t),a=i.redSub(n),s=i.redAdd(n),c=r.redAdd(t),u=o.redMul(a),f=s.redMul(c),d=o.redMul(c),l=a.redMul(s);return this.curve.point(u,f,l,d)},ie.prototype._projAdd=function(e){var t,r,n=this.z.redMul(e.z),i=n.redSqr(),o=this.x.redMul(e.x),a=this.y.redMul(e.y),s=this.curve.d.redMul(o).redMul(a),c=i.redSub(s),u=i.redAdd(s),f=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(o).redISub(a),d=n.redMul(c).redMul(f);return this.curve.twisted?(t=n.redMul(u).redMul(a.redSub(this.curve._mulA(o))),r=c.redMul(u)):(t=n.redMul(u).redMul(a.redSub(o)),r=this.curve._mulC(c).redMul(u)),this.curve.point(d,t,r)},ie.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},ie.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},ie.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},ie.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},ie.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},ie.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},ie.prototype.getX=function(){return this.normalize(),this.x.fromRed()},ie.prototype.getY=function(){return this.normalize(),this.y.fromRed()},ie.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},ie.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var r=e.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(n),0===this.x.cmp(t))return!0}},ie.prototype.toP=ie.prototype.normalize,ie.prototype.mixedAdd=ie.prototype.add,function(e){var t=e;t.base=O,t.short=L,t.mont=Z,t.edwards=ne}(x);var oe={},ae={},se={},ce=b,ue=D;function fe(e,t){return 55296==(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1)))}function de(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function le(e){return 1===e.length?"0"+e:e}function he(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}se.inherits=ue,se.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),i=0;i>6|192,r[n++]=63&o|128):fe(e,i)?(o=65536+((1023&o)<<10)+(1023&e.charCodeAt(++i)),r[n++]=o>>18|240,r[n++]=o>>12&63|128,r[n++]=o>>6&63|128,r[n++]=63&o|128):(r[n++]=o>>12|224,r[n++]=o>>6&63|128,r[n++]=63&o|128)}else for(i=0;i>>0}return o},se.split32=function(e,t){for(var r=new Array(4*e.length),n=0,i=0;n>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}return r},se.rotr32=function(e,t){return e>>>t|e<<32-t},se.rotl32=function(e,t){return e<>>32-t},se.sum32=function(e,t){return e+t>>>0},se.sum32_3=function(e,t,r){return e+t+r>>>0},se.sum32_4=function(e,t,r,n){return e+t+r+n>>>0},se.sum32_5=function(e,t,r,n,i){return e+t+r+n+i>>>0},se.sum64=function(e,t,r,n){var i=e[t],o=n+e[t+1]>>>0,a=(o>>0,e[t+1]=o},se.sum64_hi=function(e,t,r,n){return(t+n>>>0>>0},se.sum64_lo=function(e,t,r,n){return t+n>>>0},se.sum64_4_hi=function(e,t,r,n,i,o,a,s){var c=0,u=t;return c+=(u=u+n>>>0)>>0)>>0)>>0},se.sum64_4_lo=function(e,t,r,n,i,o,a,s){return t+n+o+s>>>0},se.sum64_5_hi=function(e,t,r,n,i,o,a,s,c,u){var f=0,d=t;return f+=(d=d+n>>>0)>>0)>>0)>>0)>>0},se.sum64_5_lo=function(e,t,r,n,i,o,a,s,c,u){return t+n+o+s+u>>>0},se.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},se.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},se.shr64_hi=function(e,t,r){return e>>>r},se.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0};var pe={},me=se,ge=b;function ye(){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}pe.BlockHash=ye,ye.prototype.update=function(e,t){if(e=me.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=me.join32(e,0,e.length-r,this.endian);for(var n=0;n>>24&255,n[i++]=e>>>16&255,n[i++]=e>>>8&255,n[i++]=255&e}else for(n[i++]=255&e,n[i++]=e>>>8&255,n[i++]=e>>>16&255,n[i++]=e>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;o>>3},ve.g1_256=function(e){return we(e,17)^we(e,19)^e>>>10};var Se=se,Pe=pe,xe=ve,ke=Se.rotl32,Me=Se.sum32,Ce=Se.sum32_5,Ie=xe.ft_1,Re=Pe.BlockHash,Ne=[1518500249,1859775393,2400959708,3395469782];function Oe(){if(!(this instanceof Oe))return new Oe;Re.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}Se.inherits(Oe,Re);var Te=Oe;Oe.blockSize=512,Oe.outSize=160,Oe.hmacStrength=80,Oe.padLength=64,Oe.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;nthis.blockSize&&(e=(new this.Hash).update(e).digest()),Yt(e.length<=this.blockSize);for(var t=e.length;t=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}var ur=cr;cr.prototype._init=function(e,t,r){var n=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},cr.prototype.generate=function(e,t,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(n=r,r=t,t=null),r&&(r=ar.toArray(r,n||"hex"),this._update(r));for(var i=[];i.length"};var pr=y,mr=p,gr=mr.assert;function yr(e,t){if(e instanceof yr)return e;this._importDER(e,t)||(gr(e.r&&e.s,"Signature without r or s"),this.r=new pr(e.r,16),this.s=new pr(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}var br=yr;function vr(){this.place=0}function wr(e,t){var r=e[t.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var i=0,o=0,a=t.place;o>>=0;return!(i<=127)&&(t.place=a,i)}function Ar(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}yr.prototype._importDER=function(e,t){e=mr.toArray(e,t);var r=new vr;if(48!==e[r.place++])return!1;var n=wr(e,r);if(!1===n)return!1;if(n+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var i=wr(e,r);if(!1===i)return!1;var o=e.slice(r.place,i+r.place);if(r.place+=i,2!==e[r.place++])return!1;var a=wr(e,r);if(!1===a)return!1;if(e.length!==a+r.place)return!1;var s=e.slice(r.place,a+r.place);if(0===o[0]){if(!(128&o[1]))return!1;o=o.slice(1)}if(0===s[0]){if(!(128&s[1]))return!1;s=s.slice(1)}return this.r=new pr(o),this.s=new pr(s),this.recoveryParam=null,!0},yr.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=Ar(t),r=Ar(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];_r(n,t.length),(n=n.concat(t)).push(2),_r(n,r.length);var i=n.concat(r),o=[48];return _r(o,i.length),o=o.concat(i),mr.encode(o,e)};var Er=y,Sr=ur,Pr=oe,xr=P,kr=p.assert,Mr=hr,Cr=br;function Ir(e){if(!(this instanceof Ir))return new Ir(e);"string"==typeof e&&(kr(Object.prototype.hasOwnProperty.call(Pr,e),"Unknown curve "+e),e=Pr[e]),e instanceof Pr.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}var Rr=Ir;Ir.prototype.keyPair=function(e){return new Mr(this,e)},Ir.prototype.keyFromPrivate=function(e,t){return Mr.fromPrivate(this,e,t)},Ir.prototype.keyFromPublic=function(e,t){return Mr.fromPublic(this,e,t)},Ir.prototype.genKeyPair=function(e){e||(e={});for(var t=new Sr({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||xr(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),n=this.n.sub(new Er(2));;){var i=new Er(t.generate(r));if(!(i.cmp(n)>0))return i.iaddn(1),this.keyFromPrivate(i)}},Ir.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},Ir.prototype.sign=function(e,t,r,n){"object"==typeof r&&(n=r,r=null),n||(n={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new Er(e,16));for(var i=this.n.byteLength(),o=t.getPrivate().toArray("be",i),a=e.toArray("be",i),s=new Sr({hash:this.hash,entropy:o,nonce:a,pers:n.pers,persEnc:n.persEnc||"utf8"}),c=this.n.sub(new Er(1)),u=0;;u++){var f=n.k?n.k(u):new Er(s.generate(this.n.byteLength()));if(!((f=this._truncateToN(f,!0)).cmpn(1)<=0||f.cmp(c)>=0)){var d=this.g.mul(f);if(!d.isInfinity()){var l=d.getX(),h=l.umod(this.n);if(0!==h.cmpn(0)){var p=f.invm(this.n).mul(h.mul(t.getPrivate()).iadd(e));if(0!==(p=p.umod(this.n)).cmpn(0)){var m=(d.getY().isOdd()?1:0)|(0!==l.cmp(h)?2:0);return n.canonical&&p.cmp(this.nh)>0&&(p=this.n.sub(p),m^=1),new Cr({r:h,s:p,recoveryParam:m})}}}}}},Ir.prototype.verify=function(e,t,r,n){e=this._truncateToN(new Er(e,16)),r=this.keyFromPublic(r,n);var i=(t=new Cr(t,"hex")).r,o=t.s;if(i.cmpn(1)<0||i.cmp(this.n)>=0)return!1;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var a,s=o.invm(this.n),c=s.mul(e).umod(this.n),u=s.mul(i).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(c,r.getPublic(),u)).isInfinity()&&a.eqXToP(i):!(a=this.g.mulAdd(c,r.getPublic(),u)).isInfinity()&&0===a.getX().umod(this.n).cmp(i)},Ir.prototype.recoverPubKey=function(e,t,r,n){kr((3&r)===r,"The recovery param is more than two bits"),t=new Cr(t,n);var i=this.n,o=new Er(e),a=t.r,s=t.s,c=1&r,u=r>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&u)throw new Error("Unable to find sencond key candinate");a=u?this.curve.pointFromX(a.add(this.curve.n),c):this.curve.pointFromX(a,c);var f=t.r.invm(i),d=i.sub(o).mul(f).umod(i),l=s.mul(f).umod(i);return this.g.mulAdd(d,a,l)},Ir.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new Cr(t,n)).recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(e,t,i)}catch(e){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")};var Nr=p,Or=Nr.assert,Tr=Nr.parseBytes,jr=Nr.cachedProperty;function Dr(e,t){this.eddsa=e,this._secret=Tr(t.secret),e.isPoint(t.pub)?this._pub=t.pub:this._pubBytes=Tr(t.pub)}Dr.fromPublic=function(e,t){return t instanceof Dr?t:new Dr(e,{pub:t})},Dr.fromSecret=function(e,t){return t instanceof Dr?t:new Dr(e,{secret:t})},Dr.prototype.secret=function(){return this._secret},jr(Dr,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),jr(Dr,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),jr(Dr,"privBytes",(function(){var e=this.eddsa,t=this.hash(),r=e.encodingLength-1,n=t.slice(0,e.encodingLength);return n[0]&=248,n[r]&=127,n[r]|=64,n})),jr(Dr,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),jr(Dr,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),jr(Dr,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),Dr.prototype.sign=function(e){return Or(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},Dr.prototype.verify=function(e,t){return this.eddsa.verify(e,t,this)},Dr.prototype.getSecret=function(e){return Or(this._secret,"KeyPair is public only"),Nr.encode(this.secret(),e)},Dr.prototype.getPublic=function(e){return Nr.encode(this.pubBytes(),e)};var $r=Dr,Br=y,Fr=p,zr=Fr.assert,Ur=Fr.cachedProperty,Lr=Fr.parseBytes;function qr(e,t){this.eddsa=e,"object"!=typeof t&&(t=Lr(t)),Array.isArray(t)&&(t={R:t.slice(0,e.encodingLength),S:t.slice(e.encodingLength)}),zr(t.R&&t.S,"Signature without R or S"),e.isPoint(t.R)&&(this._R=t.R),t.S instanceof Br&&(this._S=t.S),this._Rencoded=Array.isArray(t.R)?t.R:t.Rencoded,this._Sencoded=Array.isArray(t.S)?t.S:t.Sencoded}Ur(qr,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),Ur(qr,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),Ur(qr,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),Ur(qr,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),qr.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},qr.prototype.toHex=function(){return Fr.encode(this.toBytes(),"hex").toUpperCase()};var Hr=qr,Kr=ae,Jr=oe,Wr=p,Gr=Wr.assert,Vr=Wr.parseBytes,Zr=$r,Xr=Hr;function Qr(e){if(Gr("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof Qr))return new Qr(e);e=Jr[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=Kr.sha512}var Yr=Qr;Qr.prototype.sign=function(e,t){e=Vr(e);var r=this.keyFromSecret(t),n=this.hashInt(r.messagePrefix(),e),i=this.g.mul(n),o=this.encodePoint(i),a=this.hashInt(o,r.pubBytes(),e).mul(r.priv()),s=n.add(a).umod(this.curve.n);return this.makeSignature({R:i,S:s,Rencoded:o})},Qr.prototype.verify=function(e,t,r){e=Vr(e),t=this.makeSignature(t);var n=this.keyFromPublic(r),i=this.hashInt(t.Rencoded(),n.pubBytes(),e),o=this.g.mul(t.S());return t.R().add(n.pub().mul(i)).eq(o)},Qr.prototype.hashInt=function(){for(var e=this.hash(),t=0;te instanceof CryptoKey,fn=async(e,t)=>{const r=`SHA-${e.slice(-3)}`;return new Uint8Array(await cn.subtle.digest(r,t))},dn=new TextEncoder,ln=new TextDecoder,hn=2**32;function pn(...e){const t=e.reduce(((e,{length:t})=>e+t),0),r=new Uint8Array(t);let n=0;return e.forEach((e=>{r.set(e,n),n+=e.length})),r}function mn(e,t,r){if(t<0||t>=hn)throw new RangeError(`value must be >= 0 and <= ${hn-1}. Received ${t}`);e.set([t>>>24,t>>>16,t>>>8,255&t],r)}function gn(e){const t=Math.floor(e/hn),r=e%hn,n=new Uint8Array(8);return mn(n,t,0),mn(n,r,4),n}function yn(e){const t=new Uint8Array(4);return mn(t,e),t}function bn(e){return pn(yn(e.length),e)}const vn=e=>(e=>{let t=e;"string"==typeof t&&(t=dn.encode(t));const r=[];for(let e=0;e{let t=e;t instanceof Uint8Array&&(t=ln.decode(t)),t=t.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"");try{return(e=>{const t=atob(e),r=new Uint8Array(t.length);for(let e=0;eRn(new Uint8Array(Nn(e)>>3));const Tn=(e,t)=>{if(t.length<<3!==Nn(e))throw new kn("Invalid Initialization Vector length")},jn=(e,t)=>{const r=e.byteLength<<3;if(r!==t)throw new kn(`Invalid Content Encryption Key length. Expected ${t} bits, got ${r} bits`)};function Dn(){return"undefined"!=typeof WebSocketPair||"undefined"!=typeof navigator&&"Cloudflare-Workers"===navigator.userAgent||"undefined"!=typeof EdgeRuntime&&"vercel"===EdgeRuntime}function $n(e,t="algorithm.name"){return new TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`)}function Bn(e,t){return e.name===t}function Fn(e){return parseInt(e.name.slice(4),10)}function zn(e,t){if(t.length&&!t.some((t=>e.usages.includes(t)))){let e="CryptoKey does not support this operation, its usages must include ";if(t.length>2){const r=t.pop();e+=`one of ${t.join(", ")}, or ${r}.`}else 2===t.length?e+=`one of ${t[0]} or ${t[1]}.`:e+=`${t[0]}.`;throw new TypeError(e)}}function Un(e,t,...r){switch(t){case"HS256":case"HS384":case"HS512":{if(!Bn(e.algorithm,"HMAC"))throw $n("HMAC");const r=parseInt(t.slice(2),10);if(Fn(e.algorithm.hash)!==r)throw $n(`SHA-${r}`,"algorithm.hash");break}case"RS256":case"RS384":case"RS512":{if(!Bn(e.algorithm,"RSASSA-PKCS1-v1_5"))throw $n("RSASSA-PKCS1-v1_5");const r=parseInt(t.slice(2),10);if(Fn(e.algorithm.hash)!==r)throw $n(`SHA-${r}`,"algorithm.hash");break}case"PS256":case"PS384":case"PS512":{if(!Bn(e.algorithm,"RSA-PSS"))throw $n("RSA-PSS");const r=parseInt(t.slice(2),10);if(Fn(e.algorithm.hash)!==r)throw $n(`SHA-${r}`,"algorithm.hash");break}case"EdDSA":if("Ed25519"!==e.algorithm.name&&"Ed448"!==e.algorithm.name){if(Dn()){if(Bn(e.algorithm,"NODE-ED25519"))break;throw $n("Ed25519, Ed448, or NODE-ED25519")}throw $n("Ed25519 or Ed448")}break;case"ES256":case"ES384":case"ES512":{if(!Bn(e.algorithm,"ECDSA"))throw $n("ECDSA");const r=function(e){switch(e){case"ES256":return"P-256";case"ES384":return"P-384";case"ES512":return"P-521";default:throw new Error("unreachable")}}(t);if(e.algorithm.namedCurve!==r)throw $n(r,"algorithm.namedCurve");break}default:throw new TypeError("CryptoKey does not support this operation")}zn(e,r)}function Ln(e,t,...r){switch(t){case"A128GCM":case"A192GCM":case"A256GCM":{if(!Bn(e.algorithm,"AES-GCM"))throw $n("AES-GCM");const r=parseInt(t.slice(1,4),10);if(e.algorithm.length!==r)throw $n(r,"algorithm.length");break}case"A128KW":case"A192KW":case"A256KW":{if(!Bn(e.algorithm,"AES-KW"))throw $n("AES-KW");const r=parseInt(t.slice(1,4),10);if(e.algorithm.length!==r)throw $n(r,"algorithm.length");break}case"ECDH":switch(e.algorithm.name){case"ECDH":case"X25519":case"X448":break;default:throw $n("ECDH, X25519, or X448")}break;case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":if(!Bn(e.algorithm,"PBKDF2"))throw $n("PBKDF2");break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":{if(!Bn(e.algorithm,"RSA-OAEP"))throw $n("RSA-OAEP");const r=parseInt(t.slice(9),10)||1;if(Fn(e.algorithm.hash)!==r)throw $n(`SHA-${r}`,"algorithm.hash");break}default:throw new TypeError("CryptoKey does not support this operation")}zn(e,r)}function qn(e,t,...r){if(r.length>2){const t=r.pop();e+=`one of type ${r.join(", ")}, or ${t}.`}else 2===r.length?e+=`one of type ${r[0]} or ${r[1]}.`:e+=`of type ${r[0]}.`;return null==t?e+=` Received ${t}`:"function"==typeof t&&t.name?e+=` Received function ${t.name}`:"object"==typeof t&&null!=t&&t.constructor&&t.constructor.name&&(e+=` Received an instance of ${t.constructor.name}`),e}var Hn=(e,...t)=>qn("Key must be ",e,...t);function Kn(e,t,...r){return qn(`Key for the ${e} algorithm must be `,t,...r)}var Jn=e=>un(e);const Wn=["CryptoKey"];async function Gn(e,t,r,n,i,o){if(!(t instanceof Uint8Array))throw new TypeError(Hn(t,"Uint8Array"));const a=parseInt(e.slice(1,4),10),s=await cn.subtle.importKey("raw",t.subarray(a>>3),"AES-CBC",!1,["decrypt"]),c=await cn.subtle.importKey("raw",t.subarray(0,a>>3),{hash:"SHA-"+(a<<1),name:"HMAC"},!1,["sign"]),u=pn(o,n,r,gn(o.length<<3)),f=new Uint8Array((await cn.subtle.sign("HMAC",c,u)).slice(0,a>>3));let d,l;try{d=((e,t)=>{if(!(e instanceof Uint8Array))throw new TypeError("First argument must be a buffer");if(!(t instanceof Uint8Array))throw new TypeError("Second argument must be a buffer");if(e.length!==t.length)throw new TypeError("Input buffers must have the same length");const r=e.length;let n=0,i=-1;for(;++i{if(!(un(t)||t instanceof Uint8Array))throw new TypeError(Hn(t,...Wn,"Uint8Array"));switch(Tn(e,n),e){case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return t instanceof Uint8Array&&jn(t,parseInt(e.slice(-3),10)),Gn(e,t,r,n,i,o);case"A128GCM":case"A192GCM":case"A256GCM":return t instanceof Uint8Array&&jn(t,parseInt(e.slice(1,4),10)),async function(e,t,r,n,i,o){let a;t instanceof Uint8Array?a=await cn.subtle.importKey("raw",t,"AES-GCM",!1,["decrypt"]):(Ln(t,e,"decrypt"),a=t);try{return new Uint8Array(await cn.subtle.decrypt({additionalData:o,iv:n,name:"AES-GCM",tagLength:128},a,pn(r,i)))}catch(e){throw new xn}}(e,t,r,n,i,o);default:throw new Pn("Unsupported JWE Content Encryption Algorithm")}},Zn=async()=>{throw new Pn('JWE "zip" (Compression Algorithm) Header Parameter is not supported by your javascript runtime. You need to use the `inflateRaw` decrypt option to provide Inflate Raw implementation.')},Xn=async()=>{throw new Pn('JWE "zip" (Compression Algorithm) Header Parameter is not supported by your javascript runtime. You need to use the `deflateRaw` encrypt option to provide Deflate Raw implementation.')},Qn=(...e)=>{const t=e.filter(Boolean);if(0===t.length||1===t.length)return!0;let r;for(const e of t){const t=Object.keys(e);if(r&&0!==r.size)for(const e of t){if(r.has(e))return!1;r.add(e)}else r=new Set(t)}return!0};function Yn(e){if("object"!=typeof(t=e)||null===t||"[object Object]"!==Object.prototype.toString.call(e))return!1;var t;if(null===Object.getPrototypeOf(e))return!0;let r=e;for(;null!==Object.getPrototypeOf(r);)r=Object.getPrototypeOf(r);return Object.getPrototypeOf(e)===r}const ei=[{hash:"SHA-256",name:"HMAC"},!0,["sign"]];function ti(e,t){if(e.algorithm.length!==parseInt(t.slice(1,4),10))throw new TypeError(`Invalid key size for alg: ${t}`)}function ri(e,t,r){if(un(e))return Ln(e,t,r),e;if(e instanceof Uint8Array)return cn.subtle.importKey("raw",e,"AES-KW",!0,[r]);throw new TypeError(Hn(e,...Wn,"Uint8Array"))}const ni=async(e,t,r)=>{const n=await ri(t,e,"wrapKey");ti(n,e);const i=await cn.subtle.importKey("raw",r,...ei);return new Uint8Array(await cn.subtle.wrapKey("raw",i,n,"AES-KW"))},ii=async(e,t,r)=>{const n=await ri(t,e,"unwrapKey");ti(n,e);const i=await cn.subtle.unwrapKey("raw",r,n,"AES-KW",...ei);return new Uint8Array(await cn.subtle.exportKey("raw",i))};async function oi(e,t,r,n,i=new Uint8Array(0),o=new Uint8Array(0)){if(!un(e))throw new TypeError(Hn(e,...Wn));if(Ln(e,"ECDH"),!un(t))throw new TypeError(Hn(t,...Wn));Ln(t,"ECDH","deriveBits");const a=pn(bn(dn.encode(r)),bn(i),bn(o),yn(n));let s;s="X25519"===e.algorithm.name?256:"X448"===e.algorithm.name?448:Math.ceil(parseInt(e.algorithm.namedCurve.substr(-3),10)/8)<<3;return async function(e,t,r){const n=Math.ceil((t>>3)/32),i=new Uint8Array(32*n);for(let t=0;t>3)}(new Uint8Array(await cn.subtle.deriveBits({name:e.algorithm.name,public:e},t,s)),n,a)}function ai(e){if(!un(e))throw new TypeError(Hn(e,...Wn));return["P-256","P-384","P-521"].includes(e.algorithm.namedCurve)||"X25519"===e.algorithm.name||"X448"===e.algorithm.name}async function si(e,t,r,n){!function(e){if(!(e instanceof Uint8Array)||e.length<8)throw new kn("PBES2 Salt Input must be 8 or more octets")}(e);const i=function(e,t){return pn(dn.encode(e),new Uint8Array([0]),t)}(t,e),o=parseInt(t.slice(13,16),10),a={hash:`SHA-${t.slice(8,11)}`,iterations:r,name:"PBKDF2",salt:i},s={length:o,name:"AES-KW"},c=await function(e,t){if(e instanceof Uint8Array)return cn.subtle.importKey("raw",e,"PBKDF2",!1,["deriveBits"]);if(un(e))return Ln(e,t,"deriveBits","deriveKey"),e;throw new TypeError(Hn(e,...Wn,"Uint8Array"))}(n,t);if(c.usages.includes("deriveBits"))return new Uint8Array(await cn.subtle.deriveBits(a,c,o));if(c.usages.includes("deriveKey"))return cn.subtle.deriveKey(a,c,s,!1,["wrapKey","unwrapKey"]);throw new TypeError('PBKDF2 key "usages" must include "deriveBits" or "deriveKey"')}const ci=async(e,t,r,n,i)=>{const o=await si(i,e,n,t);return ii(e.slice(-6),o,r)};function ui(e){switch(e){case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":return"RSA-OAEP";default:throw new Pn(`alg ${e} is not supported either by JOSE or your javascript runtime`)}}var fi=(e,t)=>{if(e.startsWith("RS")||e.startsWith("PS")){const{modulusLength:r}=t.algorithm;if("number"!=typeof r||r<2048)throw new TypeError(`${e} requires key modulusLength to be 2048 bits or larger`)}};const di=async(e,t,r)=>{if(!un(t))throw new TypeError(Hn(t,...Wn));if(Ln(t,e,"decrypt","unwrapKey"),fi(e,t),t.usages.includes("decrypt"))return new Uint8Array(await cn.subtle.decrypt(ui(e),t,r));if(t.usages.includes("unwrapKey")){const n=await cn.subtle.unwrapKey("raw",r,t,ui(e),...ei);return new Uint8Array(await cn.subtle.exportKey("raw",n))}throw new TypeError('RSA-OAEP key "usages" must include "decrypt" or "unwrapKey" for this operation')};function li(e){switch(e){case"A128GCM":return 128;case"A192GCM":return 192;case"A256GCM":case"A128CBC-HS256":return 256;case"A192CBC-HS384":return 384;case"A256CBC-HS512":return 512;default:throw new Pn(`Unsupported JWE Algorithm: ${e}`)}}var hi=e=>Rn(new Uint8Array(li(e)>>3));var pi=async e=>{var t,r;if(!e.alg)throw new TypeError('"alg" argument is required when "jwk.alg" is not present');const{algorithm:n,keyUsages:i}=function(e){let t,r;switch(e.kty){case"oct":switch(e.alg){case"HS256":case"HS384":case"HS512":t={name:"HMAC",hash:`SHA-${e.alg.slice(-3)}`},r=["sign","verify"];break;case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":throw new Pn(`${e.alg} keys cannot be imported as CryptoKey instances`);case"A128GCM":case"A192GCM":case"A256GCM":case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":t={name:"AES-GCM"},r=["encrypt","decrypt"];break;case"A128KW":case"A192KW":case"A256KW":t={name:"AES-KW"},r=["wrapKey","unwrapKey"];break;case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":t={name:"PBKDF2"},r=["deriveBits"];break;default:throw new Pn('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"RSA":switch(e.alg){case"PS256":case"PS384":case"PS512":t={name:"RSA-PSS",hash:`SHA-${e.alg.slice(-3)}`},r=e.d?["sign"]:["verify"];break;case"RS256":case"RS384":case"RS512":t={name:"RSASSA-PKCS1-v1_5",hash:`SHA-${e.alg.slice(-3)}`},r=e.d?["sign"]:["verify"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":t={name:"RSA-OAEP",hash:`SHA-${parseInt(e.alg.slice(-3),10)||1}`},r=e.d?["decrypt","unwrapKey"]:["encrypt","wrapKey"];break;default:throw new Pn('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"EC":switch(e.alg){case"ES256":t={name:"ECDSA",namedCurve:"P-256"},r=e.d?["sign"]:["verify"];break;case"ES384":t={name:"ECDSA",namedCurve:"P-384"},r=e.d?["sign"]:["verify"];break;case"ES512":t={name:"ECDSA",namedCurve:"P-521"},r=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":t={name:"ECDH",namedCurve:e.crv},r=e.d?["deriveBits"]:[];break;default:throw new Pn('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"OKP":switch(e.alg){case"EdDSA":t={name:e.crv},r=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":t={name:e.crv},r=e.d?["deriveBits"]:[];break;default:throw new Pn('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;default:throw new Pn('Invalid or unsupported JWK "kty" (Key Type) Parameter value')}return{algorithm:t,keyUsages:r}}(e),o=[n,null!==(t=e.ext)&&void 0!==t&&t,null!==(r=e.key_ops)&&void 0!==r?r:i];if("PBKDF2"===n.name)return cn.subtle.importKey("raw",wn(e.k),...o);const a={...e};delete a.alg,delete a.use;try{return await cn.subtle.importKey("jwk",a,...o)}catch(e){if("Ed25519"===n.name&&"NotSupportedError"===(null==e?void 0:e.name)&&Dn())return o[0]={name:"NODE-ED25519",namedCurve:"NODE-ED25519"},await cn.subtle.importKey("jwk",a,...o);throw e}};async function mi(e,t,r){var n;if(!Yn(e))throw new TypeError("JWK must be an object");switch(t||(t=e.alg),e.kty){case"oct":if("string"!=typeof e.k||!e.k)throw new TypeError('missing "k" (Key Value) Parameter value');return null!=r||(r=!0!==e.ext),r?pi({...e,alg:t,ext:null!==(n=e.ext)&&void 0!==n&&n}):wn(e.k);case"RSA":if(void 0!==e.oth)throw new Pn('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');case"EC":case"OKP":return pi({...e,alg:t});default:throw new Pn('Unsupported "kty" (Key Type) Parameter value')}}const gi=(e,t,r)=>{e.startsWith("HS")||"dir"===e||e.startsWith("PBES2")||/^A\d{3}(?:GCM)?KW$/.test(e)?((e,t)=>{if(!(t instanceof Uint8Array)){if(!Jn(t))throw new TypeError(Kn(e,t,...Wn,"Uint8Array"));if("secret"!==t.type)throw new TypeError(`${Wn.join(" or ")} instances for symmetric algorithms must be of type "secret"`)}})(e,t):((e,t,r)=>{if(!Jn(t))throw new TypeError(Kn(e,t,...Wn));if("secret"===t.type)throw new TypeError(`${Wn.join(" or ")} instances for asymmetric algorithms must not be of type "secret"`);if("sign"===r&&"public"===t.type)throw new TypeError(`${Wn.join(" or ")} instances for asymmetric algorithm signing must be of type "private"`);if("decrypt"===r&&"public"===t.type)throw new TypeError(`${Wn.join(" or ")} instances for asymmetric algorithm decryption must be of type "private"`);if(t.algorithm&&"verify"===r&&"private"===t.type)throw new TypeError(`${Wn.join(" or ")} instances for asymmetric algorithm verifying must be of type "public"`);if(t.algorithm&&"encrypt"===r&&"private"===t.type)throw new TypeError(`${Wn.join(" or ")} instances for asymmetric algorithm encryption must be of type "public"`)})(e,t,r)};const yi=async(e,t,r,n,i)=>{if(!(un(r)||r instanceof Uint8Array))throw new TypeError(Hn(r,...Wn,"Uint8Array"));switch(Tn(e,n),e){case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return r instanceof Uint8Array&&jn(r,parseInt(e.slice(-3),10)),async function(e,t,r,n,i){if(!(r instanceof Uint8Array))throw new TypeError(Hn(r,"Uint8Array"));const o=parseInt(e.slice(1,4),10),a=await cn.subtle.importKey("raw",r.subarray(o>>3),"AES-CBC",!1,["encrypt"]),s=await cn.subtle.importKey("raw",r.subarray(0,o>>3),{hash:"SHA-"+(o<<1),name:"HMAC"},!1,["sign"]),c=new Uint8Array(await cn.subtle.encrypt({iv:n,name:"AES-CBC"},a,t)),u=pn(i,n,c,gn(i.length<<3));return{ciphertext:c,tag:new Uint8Array((await cn.subtle.sign("HMAC",s,u)).slice(0,o>>3))}}(e,t,r,n,i);case"A128GCM":case"A192GCM":case"A256GCM":return r instanceof Uint8Array&&jn(r,parseInt(e.slice(1,4),10)),async function(e,t,r,n,i){let o;r instanceof Uint8Array?o=await cn.subtle.importKey("raw",r,"AES-GCM",!1,["encrypt"]):(Ln(r,e,"encrypt"),o=r);const a=new Uint8Array(await cn.subtle.encrypt({additionalData:i,iv:n,name:"AES-GCM",tagLength:128},o,t)),s=a.slice(-16);return{ciphertext:a.slice(0,-16),tag:s}}(e,t,r,n,i);default:throw new Pn("Unsupported JWE Content Encryption Algorithm")}};async function bi(e,t,r,n,i){switch(gi(e,t,"decrypt"),e){case"dir":if(void 0!==r)throw new kn("Encountered unexpected JWE Encrypted Key");return t;case"ECDH-ES":if(void 0!==r)throw new kn("Encountered unexpected JWE Encrypted Key");case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{if(!Yn(n.epk))throw new kn('JOSE Header "epk" (Ephemeral Public Key) missing or invalid');if(!ai(t))throw new Pn("ECDH with the provided key is not allowed or not supported by your javascript runtime");const i=await mi(n.epk,e);let o,a;if(void 0!==n.apu){if("string"!=typeof n.apu)throw new kn('JOSE Header "apu" (Agreement PartyUInfo) invalid');o=wn(n.apu)}if(void 0!==n.apv){if("string"!=typeof n.apv)throw new kn('JOSE Header "apv" (Agreement PartyVInfo) invalid');a=wn(n.apv)}const s=await oi(i,t,"ECDH-ES"===e?n.enc:e,"ECDH-ES"===e?li(n.enc):parseInt(e.slice(-5,-2),10),o,a);if("ECDH-ES"===e)return s;if(void 0===r)throw new kn("JWE Encrypted Key missing");return ii(e.slice(-6),s,r)}case"RSA1_5":case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":if(void 0===r)throw new kn("JWE Encrypted Key missing");return di(e,t,r);case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":{if(void 0===r)throw new kn("JWE Encrypted Key missing");if("number"!=typeof n.p2c)throw new kn('JOSE Header "p2c" (PBES2 Count) missing or invalid');const o=(null==i?void 0:i.maxPBES2Count)||1e4;if(n.p2c>o)throw new kn('JOSE Header "p2c" (PBES2 Count) out is of acceptable bounds');if("string"!=typeof n.p2s)throw new kn('JOSE Header "p2s" (PBES2 Salt) missing or invalid');return ci(e,t,r,n.p2c,wn(n.p2s))}case"A128KW":case"A192KW":case"A256KW":if(void 0===r)throw new kn("JWE Encrypted Key missing");return ii(e,t,r);case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":if(void 0===r)throw new kn("JWE Encrypted Key missing");if("string"!=typeof n.iv)throw new kn('JOSE Header "iv" (Initialization Vector) missing or invalid');if("string"!=typeof n.tag)throw new kn('JOSE Header "tag" (Authentication Tag) missing or invalid');return async function(e,t,r,n,i){const o=e.slice(0,7);return Vn(o,t,r,n,i,new Uint8Array(0))}(e,t,r,wn(n.iv),wn(n.tag));default:throw new Pn('Invalid or unsupported "alg" (JWE Algorithm) header value')}}function vi(e,t,r,n,i){if(void 0!==i.crit&&void 0===n.crit)throw new e('"crit" (Critical) Header Parameter MUST be integrity protected');if(!n||void 0===n.crit)return new Set;if(!Array.isArray(n.crit)||0===n.crit.length||n.crit.some((e=>"string"!=typeof e||0===e.length)))throw new e('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');let o;o=void 0!==r?new Map([...Object.entries(r),...t.entries()]):t;for(const t of n.crit){if(!o.has(t))throw new Pn(`Extension Header Parameter "${t}" is not recognized`);if(void 0===i[t])throw new e(`Extension Header Parameter "${t}" is missing`);if(o.get(t)&&void 0===n[t])throw new e(`Extension Header Parameter "${t}" MUST be integrity protected`)}return new Set(n.crit)}const wi=(e,t)=>{if(void 0!==t&&(!Array.isArray(t)||t.some((e=>"string"!=typeof e))))throw new TypeError(`"${e}" option must be an array of strings`);if(t)return new Set(t)};async function Ai(e,t,r){if(e instanceof Uint8Array&&(e=ln.decode(e)),"string"!=typeof e)throw new kn("Compact JWE must be a string or Uint8Array");const{0:n,1:i,2:o,3:a,4:s,length:c}=e.split(".");if(5!==c)throw new kn("Invalid Compact JWE");const u=await async function(e,t,r){var n;if(!Yn(e))throw new kn("Flattened JWE must be an object");if(void 0===e.protected&&void 0===e.header&&void 0===e.unprotected)throw new kn("JOSE Header missing");if("string"!=typeof e.iv)throw new kn("JWE Initialization Vector missing or incorrect type");if("string"!=typeof e.ciphertext)throw new kn("JWE Ciphertext missing or incorrect type");if("string"!=typeof e.tag)throw new kn("JWE Authentication Tag missing or incorrect type");if(void 0!==e.protected&&"string"!=typeof e.protected)throw new kn("JWE Protected Header incorrect type");if(void 0!==e.encrypted_key&&"string"!=typeof e.encrypted_key)throw new kn("JWE Encrypted Key incorrect type");if(void 0!==e.aad&&"string"!=typeof e.aad)throw new kn("JWE AAD incorrect type");if(void 0!==e.header&&!Yn(e.header))throw new kn("JWE Shared Unprotected Header incorrect type");if(void 0!==e.unprotected&&!Yn(e.unprotected))throw new kn("JWE Per-Recipient Unprotected Header incorrect type");let i;if(e.protected)try{const t=wn(e.protected);i=JSON.parse(ln.decode(t))}catch(e){throw new kn("JWE Protected Header is invalid")}if(!Qn(i,e.header,e.unprotected))throw new kn("JWE Protected, JWE Unprotected Header, and JWE Per-Recipient Unprotected Header Parameter names must be disjoint");const o={...i,...e.header,...e.unprotected};if(vi(kn,new Map,null==r?void 0:r.crit,i,o),void 0!==o.zip){if(!i||!i.zip)throw new kn('JWE "zip" (Compression Algorithm) Header MUST be integrity protected');if("DEF"!==o.zip)throw new Pn('Unsupported JWE "zip" (Compression Algorithm) Header Parameter value')}const{alg:a,enc:s}=o;if("string"!=typeof a||!a)throw new kn("missing JWE Algorithm (alg) in JWE Header");if("string"!=typeof s||!s)throw new kn("missing JWE Encryption Algorithm (enc) in JWE Header");const c=r&&wi("keyManagementAlgorithms",r.keyManagementAlgorithms),u=r&&wi("contentEncryptionAlgorithms",r.contentEncryptionAlgorithms);if(c&&!c.has(a))throw new Sn('"alg" (Algorithm) Header Parameter not allowed');if(u&&!u.has(s))throw new Sn('"enc" (Encryption Algorithm) Header Parameter not allowed');let f;void 0!==e.encrypted_key&&(f=wn(e.encrypted_key));let d,l=!1;"function"==typeof t&&(t=await t(i,e),l=!0);try{d=await bi(a,t,f,o,r)}catch(e){if(e instanceof TypeError||e instanceof kn||e instanceof Pn)throw e;d=hi(s)}const h=wn(e.iv),p=wn(e.tag),m=dn.encode(null!==(n=e.protected)&&void 0!==n?n:"");let g;g=void 0!==e.aad?pn(m,dn.encode("."),dn.encode(e.aad)):m;let y=await Vn(s,d,wn(e.ciphertext),h,p,g);"DEF"===o.zip&&(y=await((null==r?void 0:r.inflateRaw)||Zn)(y));const b={plaintext:y};return void 0!==e.protected&&(b.protectedHeader=i),void 0!==e.aad&&(b.additionalAuthenticatedData=wn(e.aad)),void 0!==e.unprotected&&(b.sharedUnprotectedHeader=e.unprotected),void 0!==e.header&&(b.unprotectedHeader=e.header),l?{...b,key:t}:b}({ciphertext:a,iv:o||void 0,protected:n||void 0,tag:s||void 0,encrypted_key:i||void 0},t,r),f={plaintext:u.plaintext,protectedHeader:u.protectedHeader};return"function"==typeof t?{...f,key:u.key}:f}var _i=async e=>{if(e instanceof Uint8Array)return{kty:"oct",k:vn(e)};if(!un(e))throw new TypeError(Hn(e,...Wn,"Uint8Array"));if(!e.extractable)throw new TypeError("non-extractable CryptoKey cannot be exported as a JWK");const{ext:t,key_ops:r,alg:n,use:i,...o}=await cn.subtle.exportKey("jwk",e);return o};async function Ei(e){return _i(e)}async function Si(e,t,r,n,i={}){let o,a,s;switch(gi(e,r,"encrypt"),e){case"dir":s=r;break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{if(!ai(r))throw new Pn("ECDH with the provided key is not allowed or not supported by your javascript runtime");const{apu:c,apv:u}=i;let{epk:f}=i;f||(f=(await async function(e){if(!un(e))throw new TypeError(Hn(e,...Wn));return cn.subtle.generateKey(e.algorithm,!0,["deriveBits"])}(r)).privateKey);const{x:d,y:l,crv:h,kty:p}=await Ei(f),m=await oi(r,f,"ECDH-ES"===e?t:e,"ECDH-ES"===e?li(t):parseInt(e.slice(-5,-2),10),c,u);if(a={epk:{x:d,crv:h,kty:p}},"EC"===p&&(a.epk.y=l),c&&(a.apu=vn(c)),u&&(a.apv=vn(u)),"ECDH-ES"===e){s=m;break}s=n||hi(t);const g=e.slice(-6);o=await ni(g,m,s);break}case"RSA1_5":case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":s=n||hi(t),o=await(async(e,t,r)=>{if(!un(t))throw new TypeError(Hn(t,...Wn));if(Ln(t,e,"encrypt","wrapKey"),fi(e,t),t.usages.includes("encrypt"))return new Uint8Array(await cn.subtle.encrypt(ui(e),t,r));if(t.usages.includes("wrapKey")){const n=await cn.subtle.importKey("raw",r,...ei);return new Uint8Array(await cn.subtle.wrapKey("raw",n,t,ui(e)))}throw new TypeError('RSA-OAEP key "usages" must include "encrypt" or "wrapKey" for this operation')})(e,r,s);break;case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":{s=n||hi(t);const{p2c:c,p2s:u}=i;({encryptedKey:o,...a}=await(async(e,t,r,n=2048,i=Rn(new Uint8Array(16)))=>{const o=await si(i,e,n,t);return{encryptedKey:await ni(e.slice(-6),o,r),p2c:n,p2s:vn(i)}})(e,r,s,c,u));break}case"A128KW":case"A192KW":case"A256KW":s=n||hi(t),o=await ni(e,r,s);break;case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":{s=n||hi(t);const{iv:c}=i;({encryptedKey:o,...a}=await async function(e,t,r,n){const i=e.slice(0,7);n||(n=On(i));const{ciphertext:o,tag:a}=await yi(i,r,t,n,new Uint8Array(0));return{encryptedKey:o,iv:vn(n),tag:vn(a)}}(e,r,s,c));break}default:throw new Pn('Invalid or unsupported "alg" (JWE Algorithm) header value')}return{cek:s,encryptedKey:o,parameters:a}}const Pi=Symbol();class xi{constructor(e){if(!(e instanceof Uint8Array))throw new TypeError("plaintext must be an instance of Uint8Array");this._plaintext=e}setKeyManagementParameters(e){if(this._keyManagementParameters)throw new TypeError("setKeyManagementParameters can only be called once");return this._keyManagementParameters=e,this}setProtectedHeader(e){if(this._protectedHeader)throw new TypeError("setProtectedHeader can only be called once");return this._protectedHeader=e,this}setSharedUnprotectedHeader(e){if(this._sharedUnprotectedHeader)throw new TypeError("setSharedUnprotectedHeader can only be called once");return this._sharedUnprotectedHeader=e,this}setUnprotectedHeader(e){if(this._unprotectedHeader)throw new TypeError("setUnprotectedHeader can only be called once");return this._unprotectedHeader=e,this}setAdditionalAuthenticatedData(e){return this._aad=e,this}setContentEncryptionKey(e){if(this._cek)throw new TypeError("setContentEncryptionKey can only be called once");return this._cek=e,this}setInitializationVector(e){if(this._iv)throw new TypeError("setInitializationVector can only be called once");return this._iv=e,this}async encrypt(e,t){if(!this._protectedHeader&&!this._unprotectedHeader&&!this._sharedUnprotectedHeader)throw new kn("either setProtectedHeader, setUnprotectedHeader, or sharedUnprotectedHeader must be called before #encrypt()");if(!Qn(this._protectedHeader,this._unprotectedHeader,this._sharedUnprotectedHeader))throw new kn("JWE Protected, JWE Shared Unprotected and JWE Per-Recipient Header Parameter names must be disjoint");const r={...this._protectedHeader,...this._unprotectedHeader,...this._sharedUnprotectedHeader};if(vi(kn,new Map,null==t?void 0:t.crit,this._protectedHeader,r),void 0!==r.zip){if(!this._protectedHeader||!this._protectedHeader.zip)throw new kn('JWE "zip" (Compression Algorithm) Header MUST be integrity protected');if("DEF"!==r.zip)throw new Pn('Unsupported JWE "zip" (Compression Algorithm) Header Parameter value')}const{alg:n,enc:i}=r;if("string"!=typeof n||!n)throw new kn('JWE "alg" (Algorithm) Header Parameter missing or invalid');if("string"!=typeof i||!i)throw new kn('JWE "enc" (Encryption Algorithm) Header Parameter missing or invalid');let o,a,s,c,u,f,d;if("dir"===n){if(this._cek)throw new TypeError("setContentEncryptionKey cannot be called when using Direct Encryption")}else if("ECDH-ES"===n&&this._cek)throw new TypeError("setContentEncryptionKey cannot be called when using Direct Key Agreement");{let r;({cek:a,encryptedKey:o,parameters:r}=await Si(n,i,e,this._cek,this._keyManagementParameters)),r&&(t&&Pi in t?this._unprotectedHeader?this._unprotectedHeader={...this._unprotectedHeader,...r}:this.setUnprotectedHeader(r):this._protectedHeader?this._protectedHeader={...this._protectedHeader,...r}:this.setProtectedHeader(r))}if(this._iv||(this._iv=On(i)),c=this._protectedHeader?dn.encode(vn(JSON.stringify(this._protectedHeader))):dn.encode(""),this._aad?(u=vn(this._aad),s=pn(c,dn.encode("."),dn.encode(u))):s=c,"DEF"===r.zip){const e=await((null==t?void 0:t.deflateRaw)||Xn)(this._plaintext);({ciphertext:f,tag:d}=await yi(i,e,a,this._iv,s))}else({ciphertext:f,tag:d}=await yi(i,this._plaintext,a,this._iv,s));const l={ciphertext:vn(f),iv:vn(this._iv),tag:vn(d)};return o&&(l.encrypted_key=vn(o)),u&&(l.aad=u),this._protectedHeader&&(l.protected=ln.decode(c)),this._sharedUnprotectedHeader&&(l.unprotected=this._sharedUnprotectedHeader),this._unprotectedHeader&&(l.header=this._unprotectedHeader),l}}function ki(e,t){const r=`SHA-${e.slice(-3)}`;switch(e){case"HS256":case"HS384":case"HS512":return{hash:r,name:"HMAC"};case"PS256":case"PS384":case"PS512":return{hash:r,name:"RSA-PSS",saltLength:e.slice(-3)>>3};case"RS256":case"RS384":case"RS512":return{hash:r,name:"RSASSA-PKCS1-v1_5"};case"ES256":case"ES384":case"ES512":return{hash:r,name:"ECDSA",namedCurve:t.namedCurve};case"EdDSA":return Dn()&&"NODE-ED25519"===t.name?{name:"NODE-ED25519",namedCurve:"NODE-ED25519"}:{name:t.name};default:throw new Pn(`alg ${e} is not supported either by JOSE or your javascript runtime`)}}function Mi(e,t,r){if(un(t))return Un(t,e,r),t;if(t instanceof Uint8Array){if(!e.startsWith("HS"))throw new TypeError(Hn(t,...Wn));return cn.subtle.importKey("raw",t,{hash:`SHA-${e.slice(-3)}`,name:"HMAC"},!1,[r])}throw new TypeError(Hn(t,...Wn,"Uint8Array"))}const Ci=async(e,t,r,n)=>{const i=await Mi(e,t,"verify");fi(e,i);const o=ki(e,i.algorithm);try{return await cn.subtle.verify(o,i,r,n)}catch(e){return!1}};async function Ii(e,t,r){var n;if(!Yn(e))throw new Mn("Flattened JWS must be an object");if(void 0===e.protected&&void 0===e.header)throw new Mn('Flattened JWS must have either of the "protected" or "header" members');if(void 0!==e.protected&&"string"!=typeof e.protected)throw new Mn("JWS Protected Header incorrect type");if(void 0===e.payload)throw new Mn("JWS Payload missing");if("string"!=typeof e.signature)throw new Mn("JWS Signature missing or incorrect type");if(void 0!==e.header&&!Yn(e.header))throw new Mn("JWS Unprotected Header incorrect type");let i={};if(e.protected)try{const t=wn(e.protected);i=JSON.parse(ln.decode(t))}catch(e){throw new Mn("JWS Protected Header is invalid")}if(!Qn(i,e.header))throw new Mn("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");const o={...i,...e.header};let a=!0;if(vi(Mn,new Map([["b64",!0]]),null==r?void 0:r.crit,i,o).has("b64")&&(a=i.b64,"boolean"!=typeof a))throw new Mn('The "b64" (base64url-encode payload) Header Parameter must be a boolean');const{alg:s}=o;if("string"!=typeof s||!s)throw new Mn('JWS "alg" (Algorithm) Header Parameter missing or invalid');const c=r&&wi("algorithms",r.algorithms);if(c&&!c.has(s))throw new Sn('"alg" (Algorithm) Header Parameter not allowed');if(a){if("string"!=typeof e.payload)throw new Mn("JWS Payload must be a string")}else if("string"!=typeof e.payload&&!(e.payload instanceof Uint8Array))throw new Mn("JWS Payload must be a string or an Uint8Array instance");let u=!1;"function"==typeof t&&(t=await t(i,e),u=!0),gi(s,t,"verify");const f=pn(dn.encode(null!==(n=e.protected)&&void 0!==n?n:""),dn.encode("."),"string"==typeof e.payload?dn.encode(e.payload):e.payload),d=wn(e.signature);if(!await Ci(s,t,d,f))throw new In;let l;l=a?wn(e.payload):"string"==typeof e.payload?dn.encode(e.payload):e.payload;const h={payload:l};return void 0!==e.protected&&(h.protectedHeader=i),void 0!==e.header&&(h.unprotectedHeader=e.header),u?{...h,key:t}:h}var Ri=e=>Math.floor(e.getTime()/1e3);const Ni=86400,Oi=/^(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)$/i;var Ti=e=>{const t=Oi.exec(e);if(!t)throw new TypeError("Invalid time period format");const r=parseFloat(t[1]);switch(t[2].toLowerCase()){case"sec":case"secs":case"second":case"seconds":case"s":return Math.round(r);case"minute":case"minutes":case"min":case"mins":case"m":return Math.round(60*r);case"hour":case"hours":case"hr":case"hrs":case"h":return Math.round(3600*r);case"day":case"days":case"d":return Math.round(r*Ni);case"week":case"weeks":case"w":return Math.round(604800*r);default:return Math.round(31557600*r)}};const ji=e=>e.toLowerCase().replace(/^application\//,"");var Di=(e,t,r={})=>{const{typ:n}=r;if(n&&("string"!=typeof e.typ||ji(e.typ)!==ji(n)))throw new _n('unexpected "typ" JWT header value',"typ","check_failed");let i;try{i=JSON.parse(ln.decode(t))}catch(e){}if(!Yn(i))throw new Cn("JWT Claims Set must be a top-level JSON object");const{issuer:o}=r;if(o&&!(Array.isArray(o)?o:[o]).includes(i.iss))throw new _n('unexpected "iss" claim value',"iss","check_failed");const{subject:a}=r;if(a&&i.sub!==a)throw new _n('unexpected "sub" claim value',"sub","check_failed");const{audience:s}=r;if(s&&(c=i.aud,u="string"==typeof s?[s]:s,!("string"==typeof c?u.includes(c):Array.isArray(c)&&u.some(Set.prototype.has.bind(new Set(c))))))throw new _n('unexpected "aud" claim value',"aud","check_failed");var c,u;let f;switch(typeof r.clockTolerance){case"string":f=Ti(r.clockTolerance);break;case"number":f=r.clockTolerance;break;case"undefined":f=0;break;default:throw new TypeError("Invalid clockTolerance option type")}const{currentDate:d}=r,l=Ri(d||new Date);if((void 0!==i.iat||r.maxTokenAge)&&"number"!=typeof i.iat)throw new _n('"iat" claim must be a number',"iat","invalid");if(void 0!==i.nbf){if("number"!=typeof i.nbf)throw new _n('"nbf" claim must be a number',"nbf","invalid");if(i.nbf>l+f)throw new _n('"nbf" claim timestamp check failed',"nbf","check_failed")}if(void 0!==i.exp){if("number"!=typeof i.exp)throw new _n('"exp" claim must be a number',"exp","invalid");if(i.exp<=l-f)throw new En('"exp" claim timestamp check failed',"exp","check_failed")}if(r.maxTokenAge){const e=l-i.iat;if(e-f>("number"==typeof r.maxTokenAge?r.maxTokenAge:Ti(r.maxTokenAge)))throw new En('"iat" claim timestamp check failed (too far in the past)',"iat","check_failed");if(e<0-f)throw new _n('"iat" claim timestamp check failed (it should be in the past)',"iat","check_failed")}return i};async function $i(e,t,r){var n;const i=await async function(e,t,r){if(e instanceof Uint8Array&&(e=ln.decode(e)),"string"!=typeof e)throw new Mn("Compact JWS must be a string or Uint8Array");const{0:n,1:i,2:o,length:a}=e.split(".");if(3!==a)throw new Mn("Invalid Compact JWS");const s=await Ii({payload:i,protected:n,signature:o},t,r),c={payload:s.payload,protectedHeader:s.protectedHeader};return"function"==typeof t?{...c,key:s.key}:c}(e,t,r);if((null===(n=i.protectedHeader.crit)||void 0===n?void 0:n.includes("b64"))&&!1===i.protectedHeader.b64)throw new Cn("JWTs MUST NOT use unencoded payload");const o={payload:Di(i.protectedHeader,i.payload,r),protectedHeader:i.protectedHeader};return"function"==typeof t?{...o,key:i.key}:o}class Bi{constructor(e){this._flattened=new xi(e)}setContentEncryptionKey(e){return this._flattened.setContentEncryptionKey(e),this}setInitializationVector(e){return this._flattened.setInitializationVector(e),this}setProtectedHeader(e){return this._flattened.setProtectedHeader(e),this}setKeyManagementParameters(e){return this._flattened.setKeyManagementParameters(e),this}async encrypt(e,t){const r=await this._flattened.encrypt(e,t);return[r.protected,r.encrypted_key,r.iv,r.ciphertext,r.tag].join(".")}}class Fi{constructor(e){if(!(e instanceof Uint8Array))throw new TypeError("payload must be an instance of Uint8Array");this._payload=e}setProtectedHeader(e){if(this._protectedHeader)throw new TypeError("setProtectedHeader can only be called once");return this._protectedHeader=e,this}setUnprotectedHeader(e){if(this._unprotectedHeader)throw new TypeError("setUnprotectedHeader can only be called once");return this._unprotectedHeader=e,this}async sign(e,t){if(!this._protectedHeader&&!this._unprotectedHeader)throw new Mn("either setProtectedHeader or setUnprotectedHeader must be called before #sign()");if(!Qn(this._protectedHeader,this._unprotectedHeader))throw new Mn("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");const r={...this._protectedHeader,...this._unprotectedHeader};let n=!0;if(vi(Mn,new Map([["b64",!0]]),null==t?void 0:t.crit,this._protectedHeader,r).has("b64")&&(n=this._protectedHeader.b64,"boolean"!=typeof n))throw new Mn('The "b64" (base64url-encode payload) Header Parameter must be a boolean');const{alg:i}=r;if("string"!=typeof i||!i)throw new Mn('JWS "alg" (Algorithm) Header Parameter missing or invalid');gi(i,e,"sign");let o,a=this._payload;n&&(a=dn.encode(vn(a))),o=this._protectedHeader?dn.encode(vn(JSON.stringify(this._protectedHeader))):dn.encode("");const s=pn(o,dn.encode("."),a),c=await(async(e,t,r)=>{const n=await Mi(e,t,"sign");fi(e,n);const i=await cn.subtle.sign(ki(e,n.algorithm),n,r);return new Uint8Array(i)})(i,e,s),u={signature:vn(c),payload:""};return n&&(u.payload=ln.decode(a)),this._unprotectedHeader&&(u.header=this._unprotectedHeader),this._protectedHeader&&(u.protected=ln.decode(o)),u}}class zi{constructor(e){this._flattened=new Fi(e)}setProtectedHeader(e){return this._flattened.setProtectedHeader(e),this}async sign(e,t){const r=await this._flattened.sign(e,t);if(void 0===r.payload)throw new TypeError("use the flattened module for creating JWS with b64: false");return`${r.protected}.${r.payload}.${r.signature}`}}class Ui{constructor(e,t,r){this.parent=e,this.key=t,this.options=r}setProtectedHeader(e){if(this.protectedHeader)throw new TypeError("setProtectedHeader can only be called once");return this.protectedHeader=e,this}setUnprotectedHeader(e){if(this.unprotectedHeader)throw new TypeError("setUnprotectedHeader can only be called once");return this.unprotectedHeader=e,this}addSignature(...e){return this.parent.addSignature(...e)}sign(...e){return this.parent.sign(...e)}done(){return this.parent}}class Li{constructor(e){this._signatures=[],this._payload=e}addSignature(e,t){const r=new Ui(this,e,t);return this._signatures.push(r),r}async sign(){if(!this._signatures.length)throw new Mn("at least one signature must be added");const e={signatures:[],payload:""};for(let t=0;t>3));case"A128KW":case"A192KW":case"A256KW":n=parseInt(e.slice(1,4),10),i={name:"AES-KW",length:n},o=["wrapKey","unwrapKey"];break;case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":case"A128GCM":case"A192GCM":case"A256GCM":n=parseInt(e.slice(1,4),10),i={name:"AES-GCM",length:n},o=["encrypt","decrypt"];break;default:throw new Pn('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}return cn.subtle.generateKey(i,null!==(r=null==t?void 0:t.extractable)&&void 0!==r&&r,o)}(e,t)}async function Wi(e,t){const r=void 0===t?e.alg:t,n=nn.concat(rn).concat(on);if(!n.includes(r))throw new an("invalid alg. Must be one of: "+n.join(","),["invalid algorithm"]);try{const r=await mi(e,t);if(null==r)throw new an(new Error("failed importing keys"),["invalid key"]);return r}catch(e){throw new an(e,["invalid key"])}}async function Gi(e,t,r){let n,i;const o={...t};if(nn.includes(t.alg))n="dir",i=void 0!==r?r:t.alg;else{if(!rn.concat(on).includes(t.alg))throw new an(`Not a valid symmetric or assymetric alg: ${t.alg}`,["encryption failed","invalid key","invalid algorithm"]);if(void 0===r)throw new an("An encryption algorith encAlg for content encryption should be provided. Allowed values are: "+nn.join(","),["encryption failed"]);i=r,n="ECDH-ES",o.alg=n}const a=await Wi(o);let s;try{return s=await new Bi(e).setProtectedHeader({alg:n,enc:i,kid:t.kid}).encrypt(a),s}catch(e){throw new an(e,["encryption failed"])}}async function Vi(e,t){try{const r={...t},{alg:n,enc:i}=function(e){let t;if("string"==typeof e){const r=e.split(".");3!==r.length&&5!==r.length||([t]=r)}else if("object"==typeof e&&e){if(!("protected"in e))throw new TypeError("Token does not contain a Protected Header");t=e.protected}try{if("string"!=typeof t||!t)throw new Error;const e=JSON.parse(ln.decode(Ki(t)));if(!Yn(e))throw new Error;return e}catch(e){throw new TypeError("Invalid Token or Protected Header formatting")}}(e);if(void 0===n||void 0===i)throw new an("missing enc or alg in jwe header",["invalid format"]);"ECDH-ES"===n&&(r.alg=n);const o=await Wi(r);return await Ai(e,o,{contentEncryptionAlgorithms:[i]})}catch(e){throw new an(e,["decryption failed"])}}async function Zi(e,t){const r=e.match(/^([a-zA-Z0-9_-]+)\.{1,2}([a-zA-Z0-9_-]+)\.([a-zA-Z0-9_-]+)$/);if(null===r)throw new an(new Error(`${e} is not a JWS`),["not a compact jws"]);let n,o;try{n=JSON.parse(i(r[1],!0)),o=JSON.parse(i(r[2],!0))}catch(e){throw new an(e,["invalid format","not a compact jws"])}if(void 0!==t){const r="function"==typeof t?await t(n,o):t,i=await Wi(r);try{const t=await $i(e,i);return{header:t.protectedHeader,payload:t.payload,signer:r}}catch(e){throw new an(e,["jws verification failed"])}}return{header:n,payload:o}}function Xi(e){if(nn.concat(tn).concat(rn).includes(e))return Number(e.match(/\d{3}/)[0])/8;throw new an("unsupported algorithm",["invalid algorithm"])}async function Qi(e,t,r){let n;if(!nn.includes(e))throw new an(new Error(`Invalid encAlg '${e}'. Supported values are: ${nn.toString()}`),["invalid algorithm"]);const c=Xi(e);if(void 0!==t){if("string"==typeof t)if(!0===r)n=i(t);else{const e=o(t,!1);if(e!==o(t,!1,c))throw new an(new RangeError(`Expected hex length ${2*c} does not meet provided one ${e.length/2}`),["invalid key"]);n=new Uint8Array(s(t))}else n=t;if(n.length!==c)throw new an(new RangeError(`Expected secret length ${c} does not meet provided one ${n.length}`),["invalid key"])}else try{n=await Ji(e,{extractable:!0})}catch(e){throw new an(e,["unexpected error"])}const u=await Ei(n);return u.alg=e,{jwk:u,hex:a(i(u.k),!1,c)}}async function Yi(e,t){if(void 0===e.alg||void 0===t.alg||e.alg!==t.alg)throw new Error("alg no present in either pubJwk or privJwk, or pubJWK.alg != privJWK.alg");const r=await Wi(e),n=await Wi(t);try{const e=await c(16),i=await new Li(e).addSignature(n).setProtectedHeader({alg:t.alg}).sign();await async function(e,t,r){if(!Yn(e))throw new Mn("General JWS must be an object");if(!Array.isArray(e.signatures)||!e.signatures.every(Yn))throw new Mn("JWS Signatures missing or incorrect type");for(const n of e.signatures)try{return await Ii({header:n.header,payload:e.payload,protected:n.protected,signature:n.signature},t,r)}catch(e){}throw new In}(i,r)}catch(e){throw new an(e,["unexpected error"])}}function eo(e){return null!=e&&"object"==typeof e&&!Array.isArray(e)}function to(e){return eo(e)||Array.isArray(e)?Array.isArray(e)?e.map((e=>Array.isArray(e)||eo(e)?to(e):e)):Object.keys(e).sort().map((t=>[t,to(e[t])])):e}function ro(e){return JSON.stringify(to(e))}function no(e,t,r,n=2e3){if(er+n)throw new an(new Error(`timestamp ${new Date(e).toTimeString()} after 'notAfter' ${new Date(r).toTimeString()} with tolerance of ${n/1e3}s`),["invalid timestamp"])}function io(e){return Array.isArray(e)?e.sort().map(io):(t=e,"[object Object]"===Object.prototype.toString.call(t)?Object.keys(e).sort().reduce((function(t,r){return t[r]=io(e[r]),t}),{}):e);var t}function oo(e,t=!1,r){try{return o(e,t,r)}catch(e){throw new an(e,["invalid format"])}}async function ao(e,t){try{await Wi(e,e.alg);const r=io(e);return t?JSON.stringify(r):r}catch(e){throw new an(e,["invalid key"])}}async function so(e,t){const r=tn;if(!r.includes(t))throw new an(new RangeError(`Valid hash algorith values are any of ${JSON.stringify(r)}`),["invalid algorithm"]);const n=new TextEncoder,i="string"==typeof e?n.encode(e).buffer:e;try{let e;return e=new Uint8Array(await crypto.subtle.digest(t,i)),e}catch(e){throw new an(e,["unexpected error"])}}var co={exports:{}};!function(e){!function(e,t){function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function n(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function i(e,t,r){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var o;"object"==typeof e?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:g.Buffer}catch(e){}function a(e,t){var n=e.charCodeAt(t);return n>=48&&n<=57?n-48:n>=65&&n<=70?n-55:n>=97&&n<=102?n-87:void r(!1,"Invalid character in "+e)}function s(e,t,r){var n=a(e,r);return r-1>=t&&(n|=a(e,r-1)<<4),n}function c(e,t,n,i){for(var o=0,a=0,s=Math.min(e.length,n),c=t;c=49?u-49+10:u>=17?u-17+10:u,r(u>=0&&a0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,n){if("number"==typeof e)return this._initNumber(e,t,n);if("object"==typeof e)return this._initArray(e,t,n);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)a=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===n)for(i=0,o=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this._strip()},i.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n=t;n-=2)i=s(e,t,n)<=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(n=(e.length-t)%2==0?t+1:t;n=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this._strip()},i.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,a=o%n,s=Math.min(o,o-a)+r,u=0,f=r;f1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=f}catch(e){i.prototype.inspect=f}else i.prototype.inspect=f;function f(){return(this.red?""}var d=["","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"],l=[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];i.prototype.toString=function(e,t){var n;if(t=0|t||1,16===(e=e||10)||"hex"===e){n="";for(var i=0,o=0,a=0;a>>24-i&16777215,(i+=2)>=26&&(i-=26,a--),n=0!==o||a!==this.length-1?d[6-c.length]+c+n:c+n}for(0!==o&&(n=o.toString(16)+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(e===(0|e)&&e>=2&&e<=36){var u=l[e],f=h[e];n="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modrn(f).toString(e);n=(p=p.idivn(f)).isZero()?m+n:d[u-m.length]+m+n}for(this.isZero()&&(n="0"+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},i.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&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16,2)},o&&(i.prototype.toBuffer=function(e,t){return this.toArrayLike(o,e,t)}),i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)};function p(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],a=i*o,s=67108863&a,c=a/67108864|0;r.words[0]=s;for(var u=1;u>>26,d=67108863&c,l=Math.min(u,t.length-1),h=Math.max(0,u-e.length+1);h<=l;h++){var p=u-h|0;f+=(a=(i=0|e.words[p])*(o=0|t.words[h])+d)/67108864|0,d=67108863&a}r.words[u]=0|d,c=0|f}return 0!==c?r.words[u]=0|c:r.length--,r._strip()}i.prototype.toArrayLike=function(e,t,n){this._strip();var i=this.byteLength(),o=n||Math.max(1,i);r(i<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0");var a=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,o);return this["_toArrayLike"+("le"===t?"LE":"BE")](a,i),a},i.prototype._toArrayLikeLE=function(e,t){for(var r=0,n=0,i=0,o=0;i>8&255),r>16&255),6===o?(r>24&255),n=0,o=0):(n=a>>>24,o+=2)}if(r=0&&(e[r--]=a>>8&255),r>=0&&(e[r--]=a>>16&255),6===o?(r>=0&&(e[r--]=a>>24&255),n=0,o=0):(n=a>>>24,o+=2)}if(r>=0)for(e[r--]=n;r>=0;)e[r--]=0},Math.clz32?i.prototype._countBits=function(e){return 32-Math.clz32(e)}:i.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){r("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),n>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-n),this._strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){r("number"==typeof e&&e>=0);var n=e/26|0,i=e%26;return this._expand(n+1),this.words[n]=t?this.words[n]|1<e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},i.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,a=0;a>26,this.words[a]=67108863&t;for(;0!==o&&a>26,this.words[a]=67108863&t;if(0===o&&a>>13,h=0|a[1],p=8191&h,m=h>>>13,g=0|a[2],y=8191&g,b=g>>>13,v=0|a[3],w=8191&v,A=v>>>13,_=0|a[4],E=8191&_,S=_>>>13,P=0|a[5],x=8191&P,k=P>>>13,M=0|a[6],C=8191&M,I=M>>>13,R=0|a[7],N=8191&R,O=R>>>13,T=0|a[8],j=8191&T,D=T>>>13,$=0|a[9],B=8191&$,F=$>>>13,z=0|s[0],U=8191&z,L=z>>>13,q=0|s[1],H=8191&q,K=q>>>13,J=0|s[2],W=8191&J,G=J>>>13,V=0|s[3],Z=8191&V,X=V>>>13,Q=0|s[4],Y=8191&Q,ee=Q>>>13,te=0|s[5],re=8191&te,ne=te>>>13,ie=0|s[6],oe=8191&ie,ae=ie>>>13,se=0|s[7],ce=8191&se,ue=se>>>13,fe=0|s[8],de=8191&fe,le=fe>>>13,he=0|s[9],pe=8191&he,me=he>>>13;r.negative=e.negative^t.negative,r.length=19;var ge=(u+(n=Math.imul(d,U))|0)+((8191&(i=(i=Math.imul(d,L))+Math.imul(l,U)|0))<<13)|0;u=((o=Math.imul(l,L))+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(p,U),i=(i=Math.imul(p,L))+Math.imul(m,U)|0,o=Math.imul(m,L);var ye=(u+(n=n+Math.imul(d,H)|0)|0)+((8191&(i=(i=i+Math.imul(d,K)|0)+Math.imul(l,H)|0))<<13)|0;u=((o=o+Math.imul(l,K)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(y,U),i=(i=Math.imul(y,L))+Math.imul(b,U)|0,o=Math.imul(b,L),n=n+Math.imul(p,H)|0,i=(i=i+Math.imul(p,K)|0)+Math.imul(m,H)|0,o=o+Math.imul(m,K)|0;var be=(u+(n=n+Math.imul(d,W)|0)|0)+((8191&(i=(i=i+Math.imul(d,G)|0)+Math.imul(l,W)|0))<<13)|0;u=((o=o+Math.imul(l,G)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(w,U),i=(i=Math.imul(w,L))+Math.imul(A,U)|0,o=Math.imul(A,L),n=n+Math.imul(y,H)|0,i=(i=i+Math.imul(y,K)|0)+Math.imul(b,H)|0,o=o+Math.imul(b,K)|0,n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(m,W)|0,o=o+Math.imul(m,G)|0;var ve=(u+(n=n+Math.imul(d,Z)|0)|0)+((8191&(i=(i=i+Math.imul(d,X)|0)+Math.imul(l,Z)|0))<<13)|0;u=((o=o+Math.imul(l,X)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(E,U),i=(i=Math.imul(E,L))+Math.imul(S,U)|0,o=Math.imul(S,L),n=n+Math.imul(w,H)|0,i=(i=i+Math.imul(w,K)|0)+Math.imul(A,H)|0,o=o+Math.imul(A,K)|0,n=n+Math.imul(y,W)|0,i=(i=i+Math.imul(y,G)|0)+Math.imul(b,W)|0,o=o+Math.imul(b,G)|0,n=n+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,X)|0;var we=(u+(n=n+Math.imul(d,Y)|0)|0)+((8191&(i=(i=i+Math.imul(d,ee)|0)+Math.imul(l,Y)|0))<<13)|0;u=((o=o+Math.imul(l,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(x,U),i=(i=Math.imul(x,L))+Math.imul(k,U)|0,o=Math.imul(k,L),n=n+Math.imul(E,H)|0,i=(i=i+Math.imul(E,K)|0)+Math.imul(S,H)|0,o=o+Math.imul(S,K)|0,n=n+Math.imul(w,W)|0,i=(i=i+Math.imul(w,G)|0)+Math.imul(A,W)|0,o=o+Math.imul(A,G)|0,n=n+Math.imul(y,Z)|0,i=(i=i+Math.imul(y,X)|0)+Math.imul(b,Z)|0,o=o+Math.imul(b,X)|0,n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(m,Y)|0,o=o+Math.imul(m,ee)|0;var Ae=(u+(n=n+Math.imul(d,re)|0)|0)+((8191&(i=(i=i+Math.imul(d,ne)|0)+Math.imul(l,re)|0))<<13)|0;u=((o=o+Math.imul(l,ne)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(C,U),i=(i=Math.imul(C,L))+Math.imul(I,U)|0,o=Math.imul(I,L),n=n+Math.imul(x,H)|0,i=(i=i+Math.imul(x,K)|0)+Math.imul(k,H)|0,o=o+Math.imul(k,K)|0,n=n+Math.imul(E,W)|0,i=(i=i+Math.imul(E,G)|0)+Math.imul(S,W)|0,o=o+Math.imul(S,G)|0,n=n+Math.imul(w,Z)|0,i=(i=i+Math.imul(w,X)|0)+Math.imul(A,Z)|0,o=o+Math.imul(A,X)|0,n=n+Math.imul(y,Y)|0,i=(i=i+Math.imul(y,ee)|0)+Math.imul(b,Y)|0,o=o+Math.imul(b,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(m,re)|0,o=o+Math.imul(m,ne)|0;var _e=(u+(n=n+Math.imul(d,oe)|0)|0)+((8191&(i=(i=i+Math.imul(d,ae)|0)+Math.imul(l,oe)|0))<<13)|0;u=((o=o+Math.imul(l,ae)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(N,U),i=(i=Math.imul(N,L))+Math.imul(O,U)|0,o=Math.imul(O,L),n=n+Math.imul(C,H)|0,i=(i=i+Math.imul(C,K)|0)+Math.imul(I,H)|0,o=o+Math.imul(I,K)|0,n=n+Math.imul(x,W)|0,i=(i=i+Math.imul(x,G)|0)+Math.imul(k,W)|0,o=o+Math.imul(k,G)|0,n=n+Math.imul(E,Z)|0,i=(i=i+Math.imul(E,X)|0)+Math.imul(S,Z)|0,o=o+Math.imul(S,X)|0,n=n+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(A,Y)|0,o=o+Math.imul(A,ee)|0,n=n+Math.imul(y,re)|0,i=(i=i+Math.imul(y,ne)|0)+Math.imul(b,re)|0,o=o+Math.imul(b,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,ae)|0)+Math.imul(m,oe)|0,o=o+Math.imul(m,ae)|0;var Ee=(u+(n=n+Math.imul(d,ce)|0)|0)+((8191&(i=(i=i+Math.imul(d,ue)|0)+Math.imul(l,ce)|0))<<13)|0;u=((o=o+Math.imul(l,ue)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(j,U),i=(i=Math.imul(j,L))+Math.imul(D,U)|0,o=Math.imul(D,L),n=n+Math.imul(N,H)|0,i=(i=i+Math.imul(N,K)|0)+Math.imul(O,H)|0,o=o+Math.imul(O,K)|0,n=n+Math.imul(C,W)|0,i=(i=i+Math.imul(C,G)|0)+Math.imul(I,W)|0,o=o+Math.imul(I,G)|0,n=n+Math.imul(x,Z)|0,i=(i=i+Math.imul(x,X)|0)+Math.imul(k,Z)|0,o=o+Math.imul(k,X)|0,n=n+Math.imul(E,Y)|0,i=(i=i+Math.imul(E,ee)|0)+Math.imul(S,Y)|0,o=o+Math.imul(S,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(A,re)|0,o=o+Math.imul(A,ne)|0,n=n+Math.imul(y,oe)|0,i=(i=i+Math.imul(y,ae)|0)+Math.imul(b,oe)|0,o=o+Math.imul(b,ae)|0,n=n+Math.imul(p,ce)|0,i=(i=i+Math.imul(p,ue)|0)+Math.imul(m,ce)|0,o=o+Math.imul(m,ue)|0;var Se=(u+(n=n+Math.imul(d,de)|0)|0)+((8191&(i=(i=i+Math.imul(d,le)|0)+Math.imul(l,de)|0))<<13)|0;u=((o=o+Math.imul(l,le)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(B,U),i=(i=Math.imul(B,L))+Math.imul(F,U)|0,o=Math.imul(F,L),n=n+Math.imul(j,H)|0,i=(i=i+Math.imul(j,K)|0)+Math.imul(D,H)|0,o=o+Math.imul(D,K)|0,n=n+Math.imul(N,W)|0,i=(i=i+Math.imul(N,G)|0)+Math.imul(O,W)|0,o=o+Math.imul(O,G)|0,n=n+Math.imul(C,Z)|0,i=(i=i+Math.imul(C,X)|0)+Math.imul(I,Z)|0,o=o+Math.imul(I,X)|0,n=n+Math.imul(x,Y)|0,i=(i=i+Math.imul(x,ee)|0)+Math.imul(k,Y)|0,o=o+Math.imul(k,ee)|0,n=n+Math.imul(E,re)|0,i=(i=i+Math.imul(E,ne)|0)+Math.imul(S,re)|0,o=o+Math.imul(S,ne)|0,n=n+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,ae)|0)+Math.imul(A,oe)|0,o=o+Math.imul(A,ae)|0,n=n+Math.imul(y,ce)|0,i=(i=i+Math.imul(y,ue)|0)+Math.imul(b,ce)|0,o=o+Math.imul(b,ue)|0,n=n+Math.imul(p,de)|0,i=(i=i+Math.imul(p,le)|0)+Math.imul(m,de)|0,o=o+Math.imul(m,le)|0;var Pe=(u+(n=n+Math.imul(d,pe)|0)|0)+((8191&(i=(i=i+Math.imul(d,me)|0)+Math.imul(l,pe)|0))<<13)|0;u=((o=o+Math.imul(l,me)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(B,H),i=(i=Math.imul(B,K))+Math.imul(F,H)|0,o=Math.imul(F,K),n=n+Math.imul(j,W)|0,i=(i=i+Math.imul(j,G)|0)+Math.imul(D,W)|0,o=o+Math.imul(D,G)|0,n=n+Math.imul(N,Z)|0,i=(i=i+Math.imul(N,X)|0)+Math.imul(O,Z)|0,o=o+Math.imul(O,X)|0,n=n+Math.imul(C,Y)|0,i=(i=i+Math.imul(C,ee)|0)+Math.imul(I,Y)|0,o=o+Math.imul(I,ee)|0,n=n+Math.imul(x,re)|0,i=(i=i+Math.imul(x,ne)|0)+Math.imul(k,re)|0,o=o+Math.imul(k,ne)|0,n=n+Math.imul(E,oe)|0,i=(i=i+Math.imul(E,ae)|0)+Math.imul(S,oe)|0,o=o+Math.imul(S,ae)|0,n=n+Math.imul(w,ce)|0,i=(i=i+Math.imul(w,ue)|0)+Math.imul(A,ce)|0,o=o+Math.imul(A,ue)|0,n=n+Math.imul(y,de)|0,i=(i=i+Math.imul(y,le)|0)+Math.imul(b,de)|0,o=o+Math.imul(b,le)|0;var xe=(u+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,me)|0)+Math.imul(m,pe)|0))<<13)|0;u=((o=o+Math.imul(m,me)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(B,W),i=(i=Math.imul(B,G))+Math.imul(F,W)|0,o=Math.imul(F,G),n=n+Math.imul(j,Z)|0,i=(i=i+Math.imul(j,X)|0)+Math.imul(D,Z)|0,o=o+Math.imul(D,X)|0,n=n+Math.imul(N,Y)|0,i=(i=i+Math.imul(N,ee)|0)+Math.imul(O,Y)|0,o=o+Math.imul(O,ee)|0,n=n+Math.imul(C,re)|0,i=(i=i+Math.imul(C,ne)|0)+Math.imul(I,re)|0,o=o+Math.imul(I,ne)|0,n=n+Math.imul(x,oe)|0,i=(i=i+Math.imul(x,ae)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,ae)|0,n=n+Math.imul(E,ce)|0,i=(i=i+Math.imul(E,ue)|0)+Math.imul(S,ce)|0,o=o+Math.imul(S,ue)|0,n=n+Math.imul(w,de)|0,i=(i=i+Math.imul(w,le)|0)+Math.imul(A,de)|0,o=o+Math.imul(A,le)|0;var ke=(u+(n=n+Math.imul(y,pe)|0)|0)+((8191&(i=(i=i+Math.imul(y,me)|0)+Math.imul(b,pe)|0))<<13)|0;u=((o=o+Math.imul(b,me)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(B,Z),i=(i=Math.imul(B,X))+Math.imul(F,Z)|0,o=Math.imul(F,X),n=n+Math.imul(j,Y)|0,i=(i=i+Math.imul(j,ee)|0)+Math.imul(D,Y)|0,o=o+Math.imul(D,ee)|0,n=n+Math.imul(N,re)|0,i=(i=i+Math.imul(N,ne)|0)+Math.imul(O,re)|0,o=o+Math.imul(O,ne)|0,n=n+Math.imul(C,oe)|0,i=(i=i+Math.imul(C,ae)|0)+Math.imul(I,oe)|0,o=o+Math.imul(I,ae)|0,n=n+Math.imul(x,ce)|0,i=(i=i+Math.imul(x,ue)|0)+Math.imul(k,ce)|0,o=o+Math.imul(k,ue)|0,n=n+Math.imul(E,de)|0,i=(i=i+Math.imul(E,le)|0)+Math.imul(S,de)|0,o=o+Math.imul(S,le)|0;var Me=(u+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,me)|0)+Math.imul(A,pe)|0))<<13)|0;u=((o=o+Math.imul(A,me)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(B,Y),i=(i=Math.imul(B,ee))+Math.imul(F,Y)|0,o=Math.imul(F,ee),n=n+Math.imul(j,re)|0,i=(i=i+Math.imul(j,ne)|0)+Math.imul(D,re)|0,o=o+Math.imul(D,ne)|0,n=n+Math.imul(N,oe)|0,i=(i=i+Math.imul(N,ae)|0)+Math.imul(O,oe)|0,o=o+Math.imul(O,ae)|0,n=n+Math.imul(C,ce)|0,i=(i=i+Math.imul(C,ue)|0)+Math.imul(I,ce)|0,o=o+Math.imul(I,ue)|0,n=n+Math.imul(x,de)|0,i=(i=i+Math.imul(x,le)|0)+Math.imul(k,de)|0,o=o+Math.imul(k,le)|0;var Ce=(u+(n=n+Math.imul(E,pe)|0)|0)+((8191&(i=(i=i+Math.imul(E,me)|0)+Math.imul(S,pe)|0))<<13)|0;u=((o=o+Math.imul(S,me)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(B,re),i=(i=Math.imul(B,ne))+Math.imul(F,re)|0,o=Math.imul(F,ne),n=n+Math.imul(j,oe)|0,i=(i=i+Math.imul(j,ae)|0)+Math.imul(D,oe)|0,o=o+Math.imul(D,ae)|0,n=n+Math.imul(N,ce)|0,i=(i=i+Math.imul(N,ue)|0)+Math.imul(O,ce)|0,o=o+Math.imul(O,ue)|0,n=n+Math.imul(C,de)|0,i=(i=i+Math.imul(C,le)|0)+Math.imul(I,de)|0,o=o+Math.imul(I,le)|0;var Ie=(u+(n=n+Math.imul(x,pe)|0)|0)+((8191&(i=(i=i+Math.imul(x,me)|0)+Math.imul(k,pe)|0))<<13)|0;u=((o=o+Math.imul(k,me)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(B,oe),i=(i=Math.imul(B,ae))+Math.imul(F,oe)|0,o=Math.imul(F,ae),n=n+Math.imul(j,ce)|0,i=(i=i+Math.imul(j,ue)|0)+Math.imul(D,ce)|0,o=o+Math.imul(D,ue)|0,n=n+Math.imul(N,de)|0,i=(i=i+Math.imul(N,le)|0)+Math.imul(O,de)|0,o=o+Math.imul(O,le)|0;var Re=(u+(n=n+Math.imul(C,pe)|0)|0)+((8191&(i=(i=i+Math.imul(C,me)|0)+Math.imul(I,pe)|0))<<13)|0;u=((o=o+Math.imul(I,me)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(B,ce),i=(i=Math.imul(B,ue))+Math.imul(F,ce)|0,o=Math.imul(F,ue),n=n+Math.imul(j,de)|0,i=(i=i+Math.imul(j,le)|0)+Math.imul(D,de)|0,o=o+Math.imul(D,le)|0;var Ne=(u+(n=n+Math.imul(N,pe)|0)|0)+((8191&(i=(i=i+Math.imul(N,me)|0)+Math.imul(O,pe)|0))<<13)|0;u=((o=o+Math.imul(O,me)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,n=Math.imul(B,de),i=(i=Math.imul(B,le))+Math.imul(F,de)|0,o=Math.imul(F,le);var Oe=(u+(n=n+Math.imul(j,pe)|0)|0)+((8191&(i=(i=i+Math.imul(j,me)|0)+Math.imul(D,pe)|0))<<13)|0;u=((o=o+Math.imul(D,me)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863;var Te=(u+(n=Math.imul(B,pe))|0)+((8191&(i=(i=Math.imul(B,me))+Math.imul(F,pe)|0))<<13)|0;return u=((o=Math.imul(F,me))+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,c[0]=ge,c[1]=ye,c[2]=be,c[3]=ve,c[4]=we,c[5]=Ae,c[6]=_e,c[7]=Ee,c[8]=Se,c[9]=Pe,c[10]=xe,c[11]=ke,c[12]=Me,c[13]=Ce,c[14]=Ie,c[15]=Re,c[16]=Ne,c[17]=Oe,c[18]=Te,0!==u&&(c[19]=u,r.length++),r};function y(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,a&=67108863}r.words[o]=s,n=a,a=i}return 0!==n?r.words[o]=n:r.length--,r._strip()}function b(e,t,r){return y(e,t,r)}Math.imul||(m=p),i.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?m(this,e,t):r<63?p(this,e,t):r<1024?y(this,e,t):b(this,e,t)},i.prototype.mul=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},i.prototype.mulf=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),b(this,e,t)},i.prototype.imul=function(e){return this.clone().mulTo(e,this)},i.prototype.imuln=function(e){var t=e<0;t&&(e=-e),r("number"==typeof e),r(e<67108864);for(var n=0,i=0;i>=26,n+=o/67108864|0,n+=a>>>26,this.words[i]=67108863&a}return 0!==n&&(this.words[i]=n,this.length++),t?this.ineg():this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>i&1}return t}(e);if(0===t.length)return new i(1);for(var r=this,n=0;n=0);var t,n=e%26,i=(e-n)/26,o=67108863>>>26-n<<26-n;if(0!==n){var a=0;for(t=0;t>>26-n}a&&(this.words[t]=a,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var o=e%26,a=Math.min((e-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,u=0;u=0&&(0!==f||u>=i);u--){var d=0|this.words[u];this.words[u]=f<<26-o|d>>>o,f=d&s}return c&&0!==f&&(c.words[c.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(e,t,n){return r(0===this.negative),this.iushrn(e,t,n)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){r("number"==typeof e&&e>=0);var t=e%26,n=(e-t)/26,i=1<=0);var t=e%26,n=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==t&&n++,this.length=Math.min(n,this.length),0!==t){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},i.prototype.isubn=function(e){if(r("number"==typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(c/67108864|0),this.words[i+n]=67108863&o}for(;i>26,this.words[i+n]=67108863&o;if(0===s)return this._strip();for(r(-1===s),s=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},i.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),o=e,a=0|o.words[o.length-1];0!==(r=26-this._countBits(a))&&(o=o.ushln(r),n.iushln(r),a=0|o.words[o.length-1]);var s,c=n.length-o.length;if("mod"!==t){(s=new i(null)).length=c+1,s.words=new Array(s.length);for(var u=0;u=0;d--){var l=67108864*(0|n.words[o.length+d])+(0|n.words[o.length+d-1]);for(l=Math.min(l/a|0,67108863),n._ishlnsubmul(o,l,d);0!==n.negative;)l--,n.negative=0,n._ishlnsubmul(o,1,d),n.isZero()||(n.negative^=1);s&&(s.words[d]=l)}return s&&s._strip(),n._strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},i.prototype.divmod=function(e,t,n){return r(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(o=s.div.neg()),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.iadd(e)),{div:o,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(o=s.div.neg()),{div:o,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),n&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modrn(e.words[0]))}:this._wordDiv(e,t);var o,a,s},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modrn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var n=(1<<26)%e,i=0,o=this.length-1;o>=0;o--)i=(n*i+(0|this.words[o]))%e;return t?-i:i},i.prototype.modn=function(e){return this.modrn(e)},i.prototype.idivn=function(e){var t=e<0;t&&(e=-e),r(e<=67108863);for(var n=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*n;this.words[i]=o/e|0,n=o%e}return this._strip(),t?this.ineg():this},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o=new i(1),a=new i(0),s=new i(0),c=new i(1),u=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++u;for(var f=n.clone(),d=t.clone();!t.isZero();){for(var l=0,h=1;0==(t.words[0]&h)&&l<26;++l,h<<=1);if(l>0)for(t.iushrn(l);l-- >0;)(o.isOdd()||a.isOdd())&&(o.iadd(f),a.isub(d)),o.iushrn(1),a.iushrn(1);for(var p=0,m=1;0==(n.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(n.iushrn(p);p-- >0;)(s.isOdd()||c.isOdd())&&(s.iadd(f),c.isub(d)),s.iushrn(1),c.iushrn(1);t.cmp(n)>=0?(t.isub(n),o.isub(s),a.isub(c)):(n.isub(t),s.isub(o),c.isub(a))}return{a:s,b:c,gcd:n.iushln(u)}},i.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o,a=new i(1),s=new i(0),c=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(var u=0,f=1;0==(t.words[0]&f)&&u<26;++u,f<<=1);if(u>0)for(t.iushrn(u);u-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);for(var d=0,l=1;0==(n.words[0]&l)&&d<26;++d,l<<=1);if(d>0)for(n.iushrn(d);d-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);t.cmp(n)>=0?(t.isub(n),a.isub(s)):(n.isub(t),s.isub(a))}return(o=0===t.cmpn(1)?a:s).cmpn(0)<0&&o.iadd(e),o},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return 0==(1&this.words[0])},i.prototype.isOdd=function(){return 1==(1&this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){r("number"==typeof e);var t=e%26,n=(e-t)/26,i=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this._strip(),this.length>1)t=1;else{n&&(e=-e),r(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){ni&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new P(e)},i.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var v={k256:null,p224:null,p192:null,p25519:null};function w(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function A(){w.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function _(){w.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function E(){w.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function S(){w.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function P(e){if("string"==typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function x(e){P.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}w.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},w.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},w.prototype.split=function(e,t){e.iushrn(this.n,0,t)},w.prototype.imulK=function(e){return e.imul(this.k)},n(A,w),A.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i>>22,o=a}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},A.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(v[e])return v[e];var t;if("k256"===e)t=new A;else if("p224"===e)t=new _;else if("p192"===e)t=new E;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new S}return v[e]=t,t},P.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},P.prototype._verify2=function(e,t){r(0==(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},P.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(u(e,e.umod(this.m)._forceRed(this)),e)},P.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},P.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},P.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},P.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},P.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},P.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},P.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},P.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},P.prototype.isqr=function(e){return this.imul(e,e.clone())},P.prototype.sqr=function(e){return this.mul(e,e)},P.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2==1),3===t){var n=this.m.add(new i(1)).iushrn(2);return this.pow(e,n)}for(var o=this.m.subn(1),a=0;!o.isZero()&&0===o.andln(1);)a++,o.iushrn(1);r(!o.isZero());var s=new i(1).toRed(this),c=s.redNeg(),u=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new i(2*f*f).toRed(this);0!==this.pow(f,u).cmp(c);)f.redIAdd(c);for(var d=this.pow(f,o),l=this.pow(e,o.addn(1).iushrn(1)),h=this.pow(e,o),p=a;0!==h.cmp(s);){for(var m=h,g=0;0!==m.cmp(s);g++)m=m.redSqr();r(g=0;n--){for(var u=t.words[n],f=c-1;f>=0;f--){var d=u>>f&1;o!==r[0]&&(o=this.sqr(o)),0!==d||0!==a?(a<<=1,a|=d,(4===++s||0===n&&0===f)&&(o=this.mul(o,r[a]),s=0,a=0)):s=0}c=26}return o},P.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},P.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new x(e)},n(x,P),x.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},x.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},x.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},x.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(n).iushrn(this.shift),a=o;return o.cmp(this.m)>=0?a=o.isub(this.m):o.cmpn(0)<0&&(a=o.iadd(this.m)),a._forceRed(this)},x.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,u)}(co);var uo=f(co.exports);let fo=!1,lo=!1;const ho={debug:1,default:2,info:2,warning:3,error:4,off:5};let po=ho.default,mo=null;const go=function(){try{const e=[];if(["NFD","NFC","NFKD","NFKC"].forEach((t=>{try{if("test"!=="test".normalize(t))throw new Error("bad normalize")}catch(r){e.push(t)}})),e.length)throw new Error("missing "+e.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(e){return e.message}return null}();var yo,bo;!function(e){e.DEBUG="DEBUG",e.INFO="INFO",e.WARNING="WARNING",e.ERROR="ERROR",e.OFF="OFF"}(yo||(yo={})),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"}(bo||(bo={}));const vo="0123456789abcdef";class wo{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,t){const r=e.toLowerCase();null==ho[r]&&this.throwArgumentError("invalid log level name","logLevel",e),po>ho[r]||console.log.apply(console,t)}debug(...e){this._log(wo.levels.DEBUG,e)}info(...e){this._log(wo.levels.INFO,e)}warn(...e){this._log(wo.levels.WARNING,e)}makeError(e,t,r){if(lo)return this.makeError("censored error",t,{});t||(t=wo.errors.UNKNOWN_ERROR),r||(r={});const n=[];Object.keys(r).forEach((e=>{const t=r[e];try{if(t instanceof Uint8Array){let r="";for(let e=0;e>4],r+=vo[15&t[e]];n.push(e+"=Uint8Array(0x"+r+")")}else n.push(e+"="+JSON.stringify(t))}catch(t){n.push(e+"="+JSON.stringify(r[e].toString()))}})),n.push(`code=${t}`),n.push(`version=${this.version}`);const i=e;let o="";switch(t){case bo.NUMERIC_FAULT:{o="NUMERIC_FAULT";const t=e;switch(t){case"overflow":case"underflow":case"division-by-zero":o+="-"+t;break;case"negative-power":case"negative-width":o+="-unsupported";break;case"unbound-bitwise-result":o+="-unbound-result"}break}case bo.CALL_EXCEPTION:case bo.INSUFFICIENT_FUNDS:case bo.MISSING_NEW:case bo.NONCE_EXPIRED:case bo.REPLACEMENT_UNDERPRICED:case bo.TRANSACTION_REPLACED:case bo.UNPREDICTABLE_GAS_LIMIT:o=t}o&&(e+=" [ See: https://links.ethers.org/v5-errors-"+o+" ]"),n.length&&(e+=" ("+n.join(", ")+")");const a=new Error(e);return a.reason=i,a.code=t,Object.keys(r).forEach((function(e){a[e]=r[e]})),a}throwError(e,t,r){throw this.makeError(e,t,r)}throwArgumentError(e,t,r){return this.throwError(e,wo.errors.INVALID_ARGUMENT,{argument:t,value:r})}assert(e,t,r,n){e||this.throwError(t,r,n)}assertArgument(e,t,r,n){e||this.throwArgumentError(t,r,n)}checkNormalize(e){go&&this.throwError("platform missing String.prototype.normalize",wo.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:go})}checkSafeUint53(e,t){"number"==typeof e&&(null==t&&(t="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(t,wo.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(t,wo.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,t,r){r=r?": "+r:"",et&&this.throwError("too many arguments"+r,wo.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:t})}checkNew(e,t){e!==Object&&null!=e||this.throwError("missing new",wo.errors.MISSING_NEW,{name:t.name})}checkAbstract(e,t){e===t?this.throwError("cannot instantiate abstract class "+JSON.stringify(t.name)+" directly; use a sub-class",wo.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):e!==Object&&null!=e||this.throwError("missing new",wo.errors.MISSING_NEW,{name:t.name})}static globalLogger(){return mo||(mo=new wo("logger/5.7.0")),mo}static setCensorship(e,t){if(!e&&t&&this.globalLogger().throwError("cannot permanently disable censorship",wo.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),fo){if(!e)return;this.globalLogger().throwError("error censorship permanent",wo.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}lo=!!e,fo=!!t}static setLogLevel(e){const t=ho[e.toLowerCase()];null!=t?po=t:wo.globalLogger().warn("invalid log level - "+e)}static from(e){return new wo(e)}}wo.errors=bo,wo.levels=yo;var Ao=Object.freeze({__proto__:null,get ErrorCode(){return bo},get LogLevel(){return yo},Logger:wo});const _o=new wo("bytes/5.7.0");function Eo(e){return!!e.toHexString}function So(e){return e.slice||(e.slice=function(){const t=Array.prototype.slice.call(arguments);return So(new Uint8Array(Array.prototype.slice.apply(e,t)))}),e}function Po(e){return No(e)&&!(e.length%2)||ko(e)}function xo(e){return"number"==typeof e&&e==e&&e%1==0}function ko(e){if(null==e)return!1;if(e.constructor===Uint8Array)return!0;if("string"==typeof e)return!1;if(!xo(e.length)||e.length<0)return!1;for(let t=0;t=256)return!1}return!0}function Mo(e,t){if(t||(t={}),"number"==typeof e){_o.checkSafeUint53(e,"invalid arrayify value");const t=[];for(;e;)t.unshift(255&e),e=parseInt(String(e/256));return 0===t.length&&t.push(0),So(new Uint8Array(t))}if(t.allowMissingPrefix&&"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),Eo(e)&&(e=e.toHexString()),No(e)){let r=e.substring(2);r.length%2&&("left"===t.hexPad?r="0"+r:"right"===t.hexPad?r+="0":_o.throwArgumentError("hex data is odd-length","value",e));const n=[];for(let e=0;eMo(e))),r=t.reduce(((e,t)=>e+t.length),0),n=new Uint8Array(r);return t.reduce(((e,t)=>(n.set(t,e),e+t.length)),0),So(n)}function Io(e){let t=Mo(e);if(0===t.length)return t;let r=0;for(;rt&&_o.throwArgumentError("value out of range","value",arguments[0]);const r=new Uint8Array(t);return r.set(e,t-e.length),So(r)}function No(e,t){return!("string"!=typeof e||!e.match(/^0x[0-9A-Fa-f]*$/))&&(!t||e.length===2+2*t)}const Oo="0123456789abcdef";function To(e,t){if(t||(t={}),"number"==typeof e){_o.checkSafeUint53(e,"invalid hexlify value");let t="";for(;e;)t=Oo[15&e]+t,e=Math.floor(e/16);return t.length?(t.length%2&&(t="0"+t),"0x"+t):"0x00"}if("bigint"==typeof e)return(e=e.toString(16)).length%2?"0x0"+e:"0x"+e;if(t.allowMissingPrefix&&"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),Eo(e))return e.toHexString();if(No(e))return e.length%2&&("left"===t.hexPad?e="0x0"+e.substring(2):"right"===t.hexPad?e+="0":_o.throwArgumentError("hex data is odd-length","value",e)),e.toLowerCase();if(ko(e)){let t="0x";for(let r=0;r>4]+Oo[15&n]}return t}return _o.throwArgumentError("invalid hexlify value","value",e)}function jo(e){if("string"!=typeof e)e=To(e);else if(!No(e)||e.length%2)return null;return(e.length-2)/2}function Do(e,t,r){return"string"!=typeof e?e=To(e):(!No(e)||e.length%2)&&_o.throwArgumentError("invalid hexData","value",e),t=2+2*t,null!=r?"0x"+e.substring(t,2+2*r):"0x"+e.substring(t)}function $o(e){let t="0x";return e.forEach((e=>{t+=To(e).substring(2)})),t}function Bo(e){const t=Fo(To(e,{hexPad:"left"}));return"0x"===t?"0x0":t}function Fo(e){"string"!=typeof e&&(e=To(e)),No(e)||_o.throwArgumentError("invalid hex string","value",e),e=e.substring(2);let t=0;for(;t2*t+2&&_o.throwArgumentError("value out of range","value",arguments[1]);e.length<2*t+2;)e="0x0"+e.substring(2);return e}function Uo(e){const t={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(Po(e)){let r=Mo(e);64===r.length?(t.v=27+(r[32]>>7),r[32]&=127,t.r=To(r.slice(0,32)),t.s=To(r.slice(32,64))):65===r.length?(t.r=To(r.slice(0,32)),t.s=To(r.slice(32,64)),t.v=r[64]):_o.throwArgumentError("invalid signature string","signature",e),t.v<27&&(0===t.v||1===t.v?t.v+=27:_o.throwArgumentError("signature invalid v byte","signature",e)),t.recoveryParam=1-t.v%2,t.recoveryParam&&(r[32]|=128),t._vs=To(r.slice(32,64))}else{if(t.r=e.r,t.s=e.s,t.v=e.v,t.recoveryParam=e.recoveryParam,t._vs=e._vs,null!=t._vs){const r=Ro(Mo(t._vs),32);t._vs=To(r);const n=r[0]>=128?1:0;null==t.recoveryParam?t.recoveryParam=n:t.recoveryParam!==n&&_o.throwArgumentError("signature recoveryParam mismatch _vs","signature",e),r[0]&=127;const i=To(r);null==t.s?t.s=i:t.s!==i&&_o.throwArgumentError("signature v mismatch _vs","signature",e)}if(null==t.recoveryParam)null==t.v?_o.throwArgumentError("signature missing v and recoveryParam","signature",e):0===t.v||1===t.v?t.recoveryParam=t.v:t.recoveryParam=1-t.v%2;else if(null==t.v)t.v=27+t.recoveryParam;else{const r=0===t.v||1===t.v?t.v:1-t.v%2;t.recoveryParam!==r&&_o.throwArgumentError("signature recoveryParam mismatch v","signature",e)}null!=t.r&&No(t.r)?t.r=zo(t.r,32):_o.throwArgumentError("signature missing or invalid r","signature",e),null!=t.s&&No(t.s)?t.s=zo(t.s,32):_o.throwArgumentError("signature missing or invalid s","signature",e);const r=Mo(t.s);r[0]>=128&&_o.throwArgumentError("signature s out of range","signature",e),t.recoveryParam&&(r[0]|=128);const n=To(r);t._vs&&(No(t._vs)||_o.throwArgumentError("signature invalid _vs","signature",e),t._vs=zo(t._vs,32)),null==t._vs?t._vs=n:t._vs!==n&&_o.throwArgumentError("signature _vs mismatch v and s","signature",e)}return t.yParityAndS=t._vs,t.compact=t.r+t.yParityAndS.substring(2),t}function Lo(e){return To(Co([(e=Uo(e)).r,e.s,e.recoveryParam?"0x1c":"0x1b"]))}var qo=Object.freeze({__proto__:null,arrayify:Mo,concat:Co,hexConcat:$o,hexDataLength:jo,hexDataSlice:Do,hexStripZeros:Fo,hexValue:Bo,hexZeroPad:zo,hexlify:To,isBytes:ko,isBytesLike:Po,isHexString:No,joinSignature:Lo,splitSignature:Uo,stripZeros:Io,zeroPad:Ro});const Ho="bignumber/5.7.0";var Ko=uo.BN;const Jo=new wo(Ho),Wo={},Go=9007199254740991;let Vo=!1;class Zo{constructor(e,t){e!==Wo&&Jo.throwError("cannot call constructor directly; use BigNumber.from",wo.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=t,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return Qo(Yo(this).fromTwos(e))}toTwos(e){return Qo(Yo(this).toTwos(e))}abs(){return"-"===this._hex[0]?Zo.from(this._hex.substring(1)):this}add(e){return Qo(Yo(this).add(Yo(e)))}sub(e){return Qo(Yo(this).sub(Yo(e)))}div(e){return Zo.from(e).isZero()&&ea("division-by-zero","div"),Qo(Yo(this).div(Yo(e)))}mul(e){return Qo(Yo(this).mul(Yo(e)))}mod(e){const t=Yo(e);return t.isNeg()&&ea("division-by-zero","mod"),Qo(Yo(this).umod(t))}pow(e){const t=Yo(e);return t.isNeg()&&ea("negative-power","pow"),Qo(Yo(this).pow(t))}and(e){const t=Yo(e);return(this.isNegative()||t.isNeg())&&ea("unbound-bitwise-result","and"),Qo(Yo(this).and(t))}or(e){const t=Yo(e);return(this.isNegative()||t.isNeg())&&ea("unbound-bitwise-result","or"),Qo(Yo(this).or(t))}xor(e){const t=Yo(e);return(this.isNegative()||t.isNeg())&&ea("unbound-bitwise-result","xor"),Qo(Yo(this).xor(t))}mask(e){return(this.isNegative()||e<0)&&ea("negative-width","mask"),Qo(Yo(this).maskn(e))}shl(e){return(this.isNegative()||e<0)&&ea("negative-width","shl"),Qo(Yo(this).shln(e))}shr(e){return(this.isNegative()||e<0)&&ea("negative-width","shr"),Qo(Yo(this).shrn(e))}eq(e){return Yo(this).eq(Yo(e))}lt(e){return Yo(this).lt(Yo(e))}lte(e){return Yo(this).lte(Yo(e))}gt(e){return Yo(this).gt(Yo(e))}gte(e){return Yo(this).gte(Yo(e))}isNegative(){return"-"===this._hex[0]}isZero(){return Yo(this).isZero()}toNumber(){try{return Yo(this).toNumber()}catch(e){ea("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch(e){}return Jo.throwError("this platform does not support BigInt",wo.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(10===arguments[0]?Vo||(Vo=!0,Jo.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?Jo.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",wo.errors.UNEXPECTED_ARGUMENT,{}):Jo.throwError("BigNumber.toString does not accept parameters",wo.errors.UNEXPECTED_ARGUMENT,{})),Yo(this).toString(10)}toHexString(){return this._hex}toJSON(e){return{type:"BigNumber",hex:this.toHexString()}}static from(e){if(e instanceof Zo)return e;if("string"==typeof e)return e.match(/^-?0x[0-9a-f]+$/i)?new Zo(Wo,Xo(e)):e.match(/^-?[0-9]+$/)?new Zo(Wo,Xo(new Ko(e))):Jo.throwArgumentError("invalid BigNumber string","value",e);if("number"==typeof e)return e%1&&ea("underflow","BigNumber.from",e),(e>=Go||e<=-Go)&&ea("overflow","BigNumber.from",e),Zo.from(String(e));const t=e;if("bigint"==typeof t)return Zo.from(t.toString());if(ko(t))return Zo.from(To(t));if(t)if(t.toHexString){const e=t.toHexString();if("string"==typeof e)return Zo.from(e)}else{let e=t._hex;if(null==e&&"BigNumber"===t.type&&(e=t.hex),"string"==typeof e&&(No(e)||"-"===e[0]&&No(e.substring(1))))return Zo.from(e)}return Jo.throwArgumentError("invalid BigNumber value","value",e)}static isBigNumber(e){return!(!e||!e._isBigNumber)}}function Xo(e){if("string"!=typeof e)return Xo(e.toString(16));if("-"===e[0])return"-"===(e=e.substring(1))[0]&&Jo.throwArgumentError("invalid hex","value",e),"0x00"===(e=Xo(e))?e:"-"+e;if("0x"!==e.substring(0,2)&&(e="0x"+e),"0x"===e)return"0x00";for(e.length%2&&(e="0x0"+e.substring(2));e.length>4&&"0x00"===e.substring(0,4);)e="0x"+e.substring(4);return e}function Qo(e){return Zo.from(Xo(e))}function Yo(e){const t=Zo.from(e).toHexString();return"-"===t[0]?new Ko("-"+t.substring(3),16):new Ko(t.substring(2),16)}function ea(e,t,r){const n={fault:e,operation:t};return null!=r&&(n.value=r),Jo.throwError(e,wo.errors.NUMERIC_FAULT,n)}const ta=new wo(Ho),ra={},na=Zo.from(0),ia=Zo.from(-1);function oa(e,t,r,n){const i={fault:t,operation:r};return void 0!==n&&(i.value=n),ta.throwError(e,wo.errors.NUMERIC_FAULT,i)}let aa="0";for(;aa.length<256;)aa+=aa;function sa(e){if("number"!=typeof e)try{e=Zo.from(e).toNumber()}catch(e){}return"number"==typeof e&&e>=0&&e<=256&&!(e%1)?"1"+aa.substring(0,e):ta.throwArgumentError("invalid decimal size","decimals",e)}function ca(e,t){null==t&&(t=0);const r=sa(t),n=(e=Zo.from(e)).lt(na);n&&(e=e.mul(ia));let i=e.mod(r).toString();for(;i.length2&&ta.throwArgumentError("too many decimal points","value",e);let o=i[0],a=i[1];for(o||(o="0"),a||(a="0");"0"===a[a.length-1];)a=a.substring(0,a.length-1);for(a.length>r.length-1&&oa("fractional component exceeds decimals","underflow","parseFixed"),""===a&&(a="0");a.lengthnull==e[t]?n:(typeof e[t]!==r&&ta.throwArgumentError("invalid fixed format ("+t+" not "+r+")","format."+t,e[t]),e[t]);t=i("signed","boolean",t),r=i("width","number",r),n=i("decimals","number",n)}return r%8&&ta.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",r),n>80&&ta.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",n),new fa(ra,t,r,n)}}class da{constructor(e,t,r,n){e!==ra&&ta.throwError("cannot use FixedNumber constructor; use FixedNumber.from",wo.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=n,this._hex=t,this._value=r,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(e){this.format.name!==e.format.name&&ta.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",e)}addUnsafe(e){this._checkFormat(e);const t=ua(this._value,this.format.decimals),r=ua(e._value,e.format.decimals);return da.fromValue(t.add(r),this.format.decimals,this.format)}subUnsafe(e){this._checkFormat(e);const t=ua(this._value,this.format.decimals),r=ua(e._value,e.format.decimals);return da.fromValue(t.sub(r),this.format.decimals,this.format)}mulUnsafe(e){this._checkFormat(e);const t=ua(this._value,this.format.decimals),r=ua(e._value,e.format.decimals);return da.fromValue(t.mul(r).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(e){this._checkFormat(e);const t=ua(this._value,this.format.decimals),r=ua(e._value,e.format.decimals);return da.fromValue(t.mul(this.format._multiplier).div(r),this.format.decimals,this.format)}floor(){const e=this.toString().split(".");1===e.length&&e.push("0");let t=da.from(e[0],this.format);const r=!e[1].match(/^(0*)$/);return this.isNegative()&&r&&(t=t.subUnsafe(la.toFormat(t.format))),t}ceiling(){const e=this.toString().split(".");1===e.length&&e.push("0");let t=da.from(e[0],this.format);const r=!e[1].match(/^(0*)$/);return!this.isNegative()&&r&&(t=t.addUnsafe(la.toFormat(t.format))),t}round(e){null==e&&(e=0);const t=this.toString().split(".");if(1===t.length&&t.push("0"),(e<0||e>80||e%1)&&ta.throwArgumentError("invalid decimal count","decimals",e),t[1].length<=e)return this;const r=da.from("1"+aa.substring(0,e),this.format),n=ha.toFormat(this.format);return this.mulUnsafe(r).addUnsafe(n).floor().divUnsafe(r)}isZero(){return"0.0"===this._value||"0"===this._value}isNegative(){return"-"===this._value[0]}toString(){return this._value}toHexString(e){if(null==e)return this._hex;e%8&&ta.throwArgumentError("invalid byte width","width",e);return zo(Zo.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString(),e/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return da.fromString(this._value,e)}static fromValue(e,t,r){return null!=r||null==t||function(e){return null!=e&&(Zo.isBigNumber(e)||"number"==typeof e&&e%1==0||"string"==typeof e&&!!e.match(/^-?[0-9]+$/)||No(e)||"bigint"==typeof e||ko(e))}(t)||(r=t,t=null),null==t&&(t=0),null==r&&(r="fixed"),da.fromString(ca(e,t),fa.from(r))}static fromString(e,t){null==t&&(t="fixed");const r=fa.from(t),n=ua(e,r.decimals);!r.signed&&n.lt(na)&&oa("unsigned value cannot be negative","overflow","value",e);let i=null;r.signed?i=n.toTwos(r.width).toHexString():(i=n.toHexString(),i=zo(i,r.width/8));const o=ca(n,r.decimals);return new da(ra,i,o,r)}static fromBytes(e,t){null==t&&(t="fixed");const r=fa.from(t);if(Mo(e).length>r.width/8)throw new Error("overflow");let n=Zo.from(e);r.signed&&(n=n.fromTwos(r.width));const i=n.toTwos((r.signed?0:1)+r.width).toHexString(),o=ca(n,r.decimals);return new da(ra,i,o,r)}static from(e,t){if("string"==typeof e)return da.fromString(e,t);if(ko(e))return da.fromBytes(e,t);try{return da.fromValue(e,0,t)}catch(e){if(e.code!==wo.errors.INVALID_ARGUMENT)throw e}return ta.throwArgumentError("invalid FixedNumber value","value",e)}static isFixedNumber(e){return!(!e||!e._isFixedNumber)}}const la=da.from(1),ha=da.from("0.5");var pa=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))};const ma=new wo("properties/5.7.0");function ga(e,t,r){Object.defineProperty(e,t,{enumerable:!0,value:r,writable:!1})}function ya(e,t){for(let r=0;r<32;r++){if(e[t])return e[t];if(!e.prototype||"object"!=typeof e.prototype)break;e=Object.getPrototypeOf(e.prototype).constructor}return null}function ba(e){return pa(this,void 0,void 0,(function*(){const t=Object.keys(e).map((t=>{const r=e[t];return Promise.resolve(r).then((e=>({key:t,value:e})))}));return(yield Promise.all(t)).reduce(((e,t)=>(e[t.key]=t.value,e)),{})}))}function va(e,t){e&&"object"==typeof e||ma.throwArgumentError("invalid object","object",e),Object.keys(e).forEach((r=>{t[r]||ma.throwArgumentError("invalid object key - "+r,"transaction:"+r,e)}))}function wa(e){const t={};for(const r in e)t[r]=e[r];return t}const Aa={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function _a(e){if(null==e||Aa[typeof e])return!0;if(Array.isArray(e)||"object"==typeof e){if(!Object.isFrozen(e))return!1;const t=Object.keys(e);for(let r=0;rSa(e))));if("object"==typeof e){const t={};for(const r in e){const n=e[r];void 0!==n&&ga(t,r,Sa(n))}return t}return ma.throwArgumentError("Cannot deepCopy "+typeof e,"object",e)}function Sa(e){return Ea(e)}class Pa{constructor(e){for(const t in e)this[t]=Sa(e[t])}}var xa=Object.freeze({__proto__:null,Description:Pa,checkProperties:va,deepCopy:Sa,defineReadOnly:ga,getStatic:ya,resolveProperties:ba,shallowCopy:wa});const ka="abi/5.7.0",Ma=new wo(ka),Ca={};let Ia={calldata:!0,memory:!0,storage:!0},Ra={calldata:!0,memory:!0};function Na(e,t){if("bytes"===e||"string"===e){if(Ia[t])return!0}else if("address"===e){if("payable"===t)return!0}else if((e.indexOf("[")>=0||"tuple"===e)&&Ra[t])return!0;return(Ia[t]||"payable"===t)&&Ma.throwArgumentError("invalid modifier","name",t),!1}function Oa(e,t){for(let r in t)ga(e,r,t[r])}const Ta=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),ja=new RegExp(/^(.*)\[([0-9]*)\]$/);class Da{constructor(e,t){e!==Ca&&Ma.throwError("use fromString",wo.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),Oa(this,t);let r=this.type.match(ja);Oa(this,r?{arrayLength:parseInt(r[2]||"-1"),arrayChildren:Da.fromObject({type:r[1],components:this.components}),baseType:"array"}:{arrayLength:null,arrayChildren:null,baseType:null!=this.components?"tuple":this.type}),this._isParamType=!0,Object.freeze(this)}format(e){if(e||(e=Ta.sighash),Ta[e]||Ma.throwArgumentError("invalid format type","format",e),e===Ta.json){let t={type:"tuple"===this.baseType?"tuple":this.type,name:this.name||void 0};return"boolean"==typeof this.indexed&&(t.indexed=this.indexed),this.components&&(t.components=this.components.map((t=>JSON.parse(t.format(e))))),JSON.stringify(t)}let t="";return"array"===this.baseType?(t+=this.arrayChildren.format(e),t+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):"tuple"===this.baseType?(e!==Ta.sighash&&(t+=this.type),t+="("+this.components.map((t=>t.format(e))).join(e===Ta.full?", ":",")+")"):t+=this.type,e!==Ta.sighash&&(!0===this.indexed&&(t+=" indexed"),e===Ta.full&&this.name&&(t+=" "+this.name)),t}static from(e,t){return"string"==typeof e?Da.fromString(e,t):Da.fromObject(e)}static fromObject(e){return Da.isParamType(e)?e:new Da(Ca,{name:e.name||null,type:Wa(e.type),indexed:null==e.indexed?null:!!e.indexed,components:e.components?e.components.map(Da.fromObject):null})}static fromString(e,t){return r=function(e,t){let r=e;function n(t){Ma.throwArgumentError(`unexpected character at position ${t}`,"param",e)}function i(e){let r={type:"",name:"",parent:e,state:{allowType:!0}};return t&&(r.indexed=!1),r}e=e.replace(/\s/g," ");let o={type:"",name:"",state:{allowType:!0}},a=o;for(let r=0;rDa.fromString(e,t)))}class Ba{constructor(e,t){e!==Ca&&Ma.throwError("use a static from method",wo.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),Oa(this,t),this._isFragment=!0,Object.freeze(this)}static from(e){return Ba.isFragment(e)?e:"string"==typeof e?Ba.fromString(e):Ba.fromObject(e)}static fromObject(e){if(Ba.isFragment(e))return e;switch(e.type){case"function":return Ha.fromObject(e);case"event":return Fa.fromObject(e);case"constructor":return qa.fromObject(e);case"error":return Ja.fromObject(e);case"fallback":case"receive":return null}return Ma.throwArgumentError("invalid fragment object","value",e)}static fromString(e){return"event"===(e=(e=(e=e.replace(/\s/g," ")).replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," ")).trim()).split(" ")[0]?Fa.fromString(e.substring(5).trim()):"function"===e.split(" ")[0]?Ha.fromString(e.substring(8).trim()):"constructor"===e.split("(")[0].trim()?qa.fromString(e.trim()):"error"===e.split(" ")[0]?Ja.fromString(e.substring(5).trim()):Ma.throwArgumentError("unsupported fragment","value",e)}static isFragment(e){return!(!e||!e._isFragment)}}class Fa extends Ba{format(e){if(e||(e=Ta.sighash),Ta[e]||Ma.throwArgumentError("invalid format type","format",e),e===Ta.json)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==Ta.sighash&&(t+="event "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===Ta.full?", ":",")+") ",e!==Ta.sighash&&this.anonymous&&(t+="anonymous "),t.trim()}static from(e){return"string"==typeof e?Fa.fromString(e):Fa.fromObject(e)}static fromObject(e){if(Fa.isEventFragment(e))return e;"event"!==e.type&&Ma.throwArgumentError("invalid event object","value",e);const t={name:Va(e.name),anonymous:e.anonymous,inputs:e.inputs?e.inputs.map(Da.fromObject):[],type:"event"};return new Fa(Ca,t)}static fromString(e){let t=e.match(Za);t||Ma.throwArgumentError("invalid event string","value",e);let r=!1;return t[3].split(" ").forEach((e=>{switch(e.trim()){case"anonymous":r=!0;break;case"":break;default:Ma.warn("unknown modifier: "+e)}})),Fa.fromObject({name:t[1].trim(),anonymous:r,inputs:$a(t[2],!0),type:"event"})}static isEventFragment(e){return e&&e._isFragment&&"event"===e.type}}function za(e,t){t.gas=null;let r=e.split("@");return 1!==r.length?(r.length>2&&Ma.throwArgumentError("invalid human-readable ABI signature","value",e),r[1].match(/^[0-9]+$/)||Ma.throwArgumentError("invalid human-readable ABI signature gas","value",e),t.gas=Zo.from(r[1]),r[0]):e}function Ua(e,t){t.constant=!1,t.payable=!1,t.stateMutability="nonpayable",e.split(" ").forEach((e=>{switch(e.trim()){case"constant":t.constant=!0;break;case"payable":t.payable=!0,t.stateMutability="payable";break;case"nonpayable":t.payable=!1,t.stateMutability="nonpayable";break;case"pure":t.constant=!0,t.stateMutability="pure";break;case"view":t.constant=!0,t.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+e)}}))}function La(e){let t={constant:!1,payable:!0,stateMutability:"payable"};return null!=e.stateMutability?(t.stateMutability=e.stateMutability,t.constant="view"===t.stateMutability||"pure"===t.stateMutability,null!=e.constant&&!!e.constant!==t.constant&&Ma.throwArgumentError("cannot have constant function with mutability "+t.stateMutability,"value",e),t.payable="payable"===t.stateMutability,null!=e.payable&&!!e.payable!==t.payable&&Ma.throwArgumentError("cannot have payable function with mutability "+t.stateMutability,"value",e)):null!=e.payable?(t.payable=!!e.payable,null!=e.constant||t.payable||"constructor"===e.type||Ma.throwArgumentError("unable to determine stateMutability","value",e),t.constant=!!e.constant,t.constant?t.stateMutability="view":t.stateMutability=t.payable?"payable":"nonpayable",t.payable&&t.constant&&Ma.throwArgumentError("cannot have constant payable function","value",e)):null!=e.constant?(t.constant=!!e.constant,t.payable=!t.constant,t.stateMutability=t.constant?"view":"payable"):"constructor"!==e.type&&Ma.throwArgumentError("unable to determine stateMutability","value",e),t}class qa extends Ba{format(e){if(e||(e=Ta.sighash),Ta[e]||Ma.throwArgumentError("invalid format type","format",e),e===Ta.json)return JSON.stringify({type:"constructor",stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});e===Ta.sighash&&Ma.throwError("cannot format a constructor for sighash",wo.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});let t="constructor("+this.inputs.map((t=>t.format(e))).join(e===Ta.full?", ":",")+") ";return this.stateMutability&&"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "),t.trim()}static from(e){return"string"==typeof e?qa.fromString(e):qa.fromObject(e)}static fromObject(e){if(qa.isConstructorFragment(e))return e;"constructor"!==e.type&&Ma.throwArgumentError("invalid constructor object","value",e);let t=La(e);t.constant&&Ma.throwArgumentError("constructor cannot be constant","value",e);const r={name:null,type:e.type,inputs:e.inputs?e.inputs.map(Da.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?Zo.from(e.gas):null};return new qa(Ca,r)}static fromString(e){let t={type:"constructor"},r=(e=za(e,t)).match(Za);return r&&"constructor"===r[1].trim()||Ma.throwArgumentError("invalid constructor string","value",e),t.inputs=$a(r[2].trim(),!1),Ua(r[3].trim(),t),qa.fromObject(t)}static isConstructorFragment(e){return e&&e._isFragment&&"constructor"===e.type}}class Ha extends qa{format(e){if(e||(e=Ta.sighash),Ta[e]||Ma.throwArgumentError("invalid format type","format",e),e===Ta.json)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((t=>JSON.parse(t.format(e)))),outputs:this.outputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==Ta.sighash&&(t+="function "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===Ta.full?", ":",")+") ",e!==Ta.sighash&&(this.stateMutability?"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "):this.constant&&(t+="view "),this.outputs&&this.outputs.length&&(t+="returns ("+this.outputs.map((t=>t.format(e))).join(", ")+") "),null!=this.gas&&(t+="@"+this.gas.toString()+" ")),t.trim()}static from(e){return"string"==typeof e?Ha.fromString(e):Ha.fromObject(e)}static fromObject(e){if(Ha.isFunctionFragment(e))return e;"function"!==e.type&&Ma.throwArgumentError("invalid function object","value",e);let t=La(e);const r={type:e.type,name:Va(e.name),constant:t.constant,inputs:e.inputs?e.inputs.map(Da.fromObject):[],outputs:e.outputs?e.outputs.map(Da.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?Zo.from(e.gas):null};return new Ha(Ca,r)}static fromString(e){let t={type:"function"},r=(e=za(e,t)).split(" returns ");r.length>2&&Ma.throwArgumentError("invalid function string","value",e);let n=r[0].match(Za);if(n||Ma.throwArgumentError("invalid function signature","value",e),t.name=n[1].trim(),t.name&&Va(t.name),t.inputs=$a(n[2],!1),Ua(n[3].trim(),t),r.length>1){let n=r[1].match(Za);""==n[1].trim()&&""==n[3].trim()||Ma.throwArgumentError("unexpected tokens","value",e),t.outputs=$a(n[2],!1)}else t.outputs=[];return Ha.fromObject(t)}static isFunctionFragment(e){return e&&e._isFragment&&"function"===e.type}}function Ka(e){const t=e.format();return"Error(string)"!==t&&"Panic(uint256)"!==t||Ma.throwArgumentError(`cannot specify user defined ${t} error`,"fragment",e),e}class Ja extends Ba{format(e){if(e||(e=Ta.sighash),Ta[e]||Ma.throwArgumentError("invalid format type","format",e),e===Ta.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==Ta.sighash&&(t+="error "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===Ta.full?", ":",")+") ",t.trim()}static from(e){return"string"==typeof e?Ja.fromString(e):Ja.fromObject(e)}static fromObject(e){if(Ja.isErrorFragment(e))return e;"error"!==e.type&&Ma.throwArgumentError("invalid error object","value",e);const t={type:e.type,name:Va(e.name),inputs:e.inputs?e.inputs.map(Da.fromObject):[]};return Ka(new Ja(Ca,t))}static fromString(e){let t={type:"error"},r=e.match(Za);return r||Ma.throwArgumentError("invalid error signature","value",e),t.name=r[1].trim(),t.name&&Va(t.name),t.inputs=$a(r[2],!1),Ka(Ja.fromObject(t))}static isErrorFragment(e){return e&&e._isFragment&&"error"===e.type}}function Wa(e){return e.match(/^uint($|[^1-9])/)?e="uint256"+e.substring(4):e.match(/^int($|[^1-9])/)&&(e="int256"+e.substring(3)),e}const Ga=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function Va(e){return e&&e.match(Ga)||Ma.throwArgumentError(`invalid identifier "${e}"`,"value",e),e}const Za=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$");const Xa=new wo(ka);function Qa(e){const t=[],r=function(e,n){if(Array.isArray(n))for(let i in n){const o=e.slice();o.push(i);try{r(o,n[i])}catch(e){t.push({path:o,error:e})}}};return r([],e),t}class Ya{constructor(e,t,r,n){this.name=e,this.type=t,this.localName=r,this.dynamic=n}_throwError(e,t){Xa.throwArgumentError(e,this.localName,t)}}class es{constructor(e){ga(this,"wordSize",e||32),this._data=[],this._dataLength=0,this._padding=new Uint8Array(e)}get data(){return $o(this._data)}get length(){return this._dataLength}_writeData(e){return this._data.push(e),this._dataLength+=e.length,e.length}appendWriter(e){return this._writeData(Co(e._data))}writeBytes(e){let t=Mo(e);const r=t.length%this.wordSize;return r&&(t=Co([t,this._padding.slice(r)])),this._writeData(t)}_getValue(e){let t=Mo(Zo.from(e));return t.length>this.wordSize&&Xa.throwError("value out-of-bounds",wo.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:t.length}),t.length%this.wordSize&&(t=Co([this._padding.slice(t.length%this.wordSize),t])),t}writeValue(e){return this._writeData(this._getValue(e))}writeUpdatableValue(){const e=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,t=>{this._data[e]=this._getValue(t)}}}class ts{constructor(e,t,r,n){ga(this,"_data",Mo(e)),ga(this,"wordSize",t||32),ga(this,"_coerceFunc",r),ga(this,"allowLoose",n),this._offset=0}get data(){return To(this._data)}get consumed(){return this._offset}static coerce(e,t){let r=e.match("^u?int([0-9]+)$");return r&&parseInt(r[1])<=48&&(t=t.toNumber()),t}coerce(e,t){return this._coerceFunc?this._coerceFunc(e,t):ts.coerce(e,t)}_peekBytes(e,t,r){let n=Math.ceil(t/this.wordSize)*this.wordSize;return this._offset+n>this._data.length&&(this.allowLoose&&r&&this._offset+t<=this._data.length?n=t:Xa.throwError("data out-of-bounds",wo.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+n})),this._data.slice(this._offset,this._offset+n)}subReader(e){return new ts(this._data.slice(this._offset+e),this.wordSize,this._coerceFunc,this.allowLoose)}readBytes(e,t){let r=this._peekBytes(0,e,!!t);return this._offset+=r.length,r.slice(0,e)}readValue(){return Zo.from(this.readBytes(this.wordSize))}}var rs={exports:{}}; /** - * [js-sha3]{@link https://github.com/emn178/js-sha3} - * - * @version 0.8.0 - * @author Chen, Yi-Cyuan [emn178@gmail.com] - * @copyright Chen, Yi-Cyuan 2015-2018 - * @license MIT - */!function(e){!function(){var t="input is invalid type",r="object"==typeof window,n=r?window:{};n.JS_SHA3_NO_WINDOW&&(r=!1);var i=!r&&"object"==typeof self;!n.JS_SHA3_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node?n=s:i&&(n=self);var o=!n.JS_SHA3_NO_COMMON_JS&&e.exports,a=!n.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,c="0123456789abcdef".split(""),u=[4,1024,262144,67108864],f=[0,8,16,24],d=[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],l=[224,256,384,512],h=[128,256],p=["hex","buffer","arrayBuffer","array","digest"],m={128:168,256:136};!n.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!a||!n.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 g=function(e,t,r){return function(n){return new R(e,t,e).update(n)[r]()}},y=function(e,t,r){return function(n,i){return new R(e,t,i).update(n)[r]()}},b=function(e,t,r){return function(t,n,i,o){return E["cshake"+e].update(t,n,i,o)[r]()}},v=function(e,t,r){return function(t,n,i,o){return E["kmac"+e].update(t,n,i,o)[r]()}},w=function(e,t,r,n){for(var i=0;i>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var n=0;n<50;++n)this.s[n]=0}function N(e,t,r){R.call(this,e,t,r)}R.prototype.update=function(e){if(this.finalized)throw new Error("finalize already called");var r,n=typeof e;if("string"!==n){if("object"!==n)throw new Error(t);if(null===e)throw new Error(t);if(a&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||a&&ArrayBuffer.isView(e)))throw new Error(t);r=!0}for(var i,o,s=this.blocks,c=this.byteCount,u=e.length,d=this.blockCount,l=0,h=this.s;l>2]|=e[l]<>2]|=o<>2]|=(192|o>>6)<>2]|=(128|63&o)<=57344?(s[i>>2]|=(224|o>>12)<>2]|=(128|o>>6&63)<>2]|=(128|63&o)<>2]|=(240|o>>18)<>2]|=(128|o>>12&63)<>2]|=(128|o>>6&63)<>2]|=(128|63&o)<=c){for(this.start=i-c,this.block=s[d],i=0;i>=8);r>0;)i.unshift(r),r=255&(e>>=8),++n;return t?i.push(n):i.unshift(n),this.update(i),i.length},R.prototype.encodeString=function(e){var r,n=typeof e;if("string"!==n){if("object"!==n)throw new Error(t);if(null===e)throw new Error(t);if(a&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||a&&ArrayBuffer.isView(e)))throw new Error(t);r=!0}var i=0,o=e.length;if(r)i=o;else for(var s=0;s=57344?i+=3:(c=65536+((1023&c)<<10|1023&e.charCodeAt(++s)),i+=4)}return i+=this.encode(8*i),this.update(e),i},R.prototype.bytepad=function(e,t){for(var r=this.encode(t),n=0;n>2]|=this.padding[3&t],this.lastByteIndex===this.byteCount)for(e[0]=e[r],t=1;t>4&15]+c[15&e]+c[e>>12&15]+c[e>>8&15]+c[e>>20&15]+c[e>>16&15]+c[e>>28&15]+c[e>>24&15];a%t==0&&(O(r),o=0)}return i&&(e=r[o],s+=c[e>>4&15]+c[15&e],i>1&&(s+=c[e>>12&15]+c[e>>8&15]),i>2&&(s+=c[e>>20&15]+c[e>>16&15])),s},R.prototype.arrayBuffer=function(){this.finalize();var e,t=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,a=0,s=this.outputBits>>3;e=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(s);for(var c=new Uint32Array(e);a>8&255,c[e+2]=t>>16&255,c[e+3]=t>>24&255;s%r==0&&O(n)}return o&&(e=s<<2,t=n[a],c[e]=255&t,o>1&&(c[e+1]=t>>8&255),o>2&&(c[e+2]=t>>16&255)),c},N.prototype=new R,N.prototype.finalize=function(){return this.encode(this.outputBits,!0),R.prototype.finalize.call(this)};var O=function(e){var t,r,n,i,o,a,s,c,u,f,l,h,p,m,g,y,b,v,w,A,_,E,S,P,x,k,M,C,I,R,N,O,T,j,D,$,B,F,z,U,L,q,H,K,J,W,G,V,Z,X,Q,Y,ee,te,re,ne,ie,oe,ae,se,ce,ue,fe;for(n=0;n<48;n+=2)i=e[0]^e[10]^e[20]^e[30]^e[40],o=e[1]^e[11]^e[21]^e[31]^e[41],a=e[2]^e[12]^e[22]^e[32]^e[42],s=e[3]^e[13]^e[23]^e[33]^e[43],c=e[4]^e[14]^e[24]^e[34]^e[44],u=e[5]^e[15]^e[25]^e[35]^e[45],f=e[6]^e[16]^e[26]^e[36]^e[46],l=e[7]^e[17]^e[27]^e[37]^e[47],t=(h=e[8]^e[18]^e[28]^e[38]^e[48])^(a<<1|s>>>31),r=(p=e[9]^e[19]^e[29]^e[39]^e[49])^(s<<1|a>>>31),e[0]^=t,e[1]^=r,e[10]^=t,e[11]^=r,e[20]^=t,e[21]^=r,e[30]^=t,e[31]^=r,e[40]^=t,e[41]^=r,t=i^(c<<1|u>>>31),r=o^(u<<1|c>>>31),e[2]^=t,e[3]^=r,e[12]^=t,e[13]^=r,e[22]^=t,e[23]^=r,e[32]^=t,e[33]^=r,e[42]^=t,e[43]^=r,t=a^(f<<1|l>>>31),r=s^(l<<1|f>>>31),e[4]^=t,e[5]^=r,e[14]^=t,e[15]^=r,e[24]^=t,e[25]^=r,e[34]^=t,e[35]^=r,e[44]^=t,e[45]^=r,t=c^(h<<1|p>>>31),r=u^(p<<1|h>>>31),e[6]^=t,e[7]^=r,e[16]^=t,e[17]^=r,e[26]^=t,e[27]^=r,e[36]^=t,e[37]^=r,e[46]^=t,e[47]^=r,t=f^(i<<1|o>>>31),r=l^(o<<1|i>>>31),e[8]^=t,e[9]^=r,e[18]^=t,e[19]^=r,e[28]^=t,e[29]^=r,e[38]^=t,e[39]^=r,e[48]^=t,e[49]^=r,m=e[0],g=e[1],W=e[11]<<4|e[10]>>>28,G=e[10]<<4|e[11]>>>28,C=e[20]<<3|e[21]>>>29,I=e[21]<<3|e[20]>>>29,se=e[31]<<9|e[30]>>>23,ce=e[30]<<9|e[31]>>>23,q=e[40]<<18|e[41]>>>14,H=e[41]<<18|e[40]>>>14,j=e[2]<<1|e[3]>>>31,D=e[3]<<1|e[2]>>>31,y=e[13]<<12|e[12]>>>20,b=e[12]<<12|e[13]>>>20,V=e[22]<<10|e[23]>>>22,Z=e[23]<<10|e[22]>>>22,R=e[33]<<13|e[32]>>>19,N=e[32]<<13|e[33]>>>19,ue=e[42]<<2|e[43]>>>30,fe=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,re=e[4]<<30|e[5]>>>2,$=e[14]<<6|e[15]>>>26,B=e[15]<<6|e[14]>>>26,v=e[25]<<11|e[24]>>>21,w=e[24]<<11|e[25]>>>21,X=e[34]<<15|e[35]>>>17,Q=e[35]<<15|e[34]>>>17,O=e[45]<<29|e[44]>>>3,T=e[44]<<29|e[45]>>>3,P=e[6]<<28|e[7]>>>4,x=e[7]<<28|e[6]>>>4,ne=e[17]<<23|e[16]>>>9,ie=e[16]<<23|e[17]>>>9,F=e[26]<<25|e[27]>>>7,z=e[27]<<25|e[26]>>>7,A=e[36]<<21|e[37]>>>11,_=e[37]<<21|e[36]>>>11,Y=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,K=e[8]<<27|e[9]>>>5,J=e[9]<<27|e[8]>>>5,k=e[18]<<20|e[19]>>>12,M=e[19]<<20|e[18]>>>12,oe=e[29]<<7|e[28]>>>25,ae=e[28]<<7|e[29]>>>25,U=e[38]<<8|e[39]>>>24,L=e[39]<<8|e[38]>>>24,E=e[48]<<14|e[49]>>>18,S=e[49]<<14|e[48]>>>18,e[0]=m^~y&v,e[1]=g^~b&w,e[10]=P^~k&C,e[11]=x^~M&I,e[20]=j^~$&F,e[21]=D^~B&z,e[30]=K^~W&V,e[31]=J^~G&Z,e[40]=te^~ne&oe,e[41]=re^~ie&ae,e[2]=y^~v&A,e[3]=b^~w&_,e[12]=k^~C&R,e[13]=M^~I&N,e[22]=$^~F&U,e[23]=B^~z&L,e[32]=W^~V&X,e[33]=G^~Z&Q,e[42]=ne^~oe&se,e[43]=ie^~ae&ce,e[4]=v^~A&E,e[5]=w^~_&S,e[14]=C^~R&O,e[15]=I^~N&T,e[24]=F^~U&q,e[25]=z^~L&H,e[34]=V^~X&Y,e[35]=Z^~Q&ee,e[44]=oe^~se&ue,e[45]=ae^~ce&fe,e[6]=A^~E&m,e[7]=_^~S&g,e[16]=R^~O&P,e[17]=N^~T&x,e[26]=U^~q&j,e[27]=L^~H&D,e[36]=X^~Y&K,e[37]=Q^~ee&J,e[46]=se^~ue&te,e[47]=ce^~fe&re,e[8]=E^~m&y,e[9]=S^~g&b,e[18]=O^~P&k,e[19]=T^~x&M,e[28]=q^~j&$,e[29]=H^~D&B,e[38]=Y^~K&W,e[39]=ee^~J&G,e[48]=ue^~te&ne,e[49]=fe^~re&ie,e[0]^=d[n],e[1]^=d[n+1]};if(o)e.exports=E;else for(P=0;P>=8;return t}function as(e,t,r){let n=0;for(let i=0;it+1+n&&is.throwError("child data too short",bo.errors.BUFFER_OVERRUN,{})}return{consumed:1+n,result:i}}function fs(e,t){if(0===e.length&&is.throwError("data too short",bo.errors.BUFFER_OVERRUN,{}),e[t]>=248){const r=e[t]-247;t+1+r>e.length&&is.throwError("data short segment too short",bo.errors.BUFFER_OVERRUN,{});const n=as(e,t+1,r);return t+1+r+n>e.length&&is.throwError("data long segment too short",bo.errors.BUFFER_OVERRUN,{}),us(e,t,t+1+r,r+n)}if(e[t]>=192){const r=e[t]-192;return t+1+r>e.length&&is.throwError("data array too short",bo.errors.BUFFER_OVERRUN,{}),us(e,t,t+1,r)}if(e[t]>=184){const r=e[t]-183;t+1+r>e.length&&is.throwError("data array too short",bo.errors.BUFFER_OVERRUN,{});const n=as(e,t+1,r);t+1+r+n>e.length&&is.throwError("data array too short",bo.errors.BUFFER_OVERRUN,{});return{consumed:1+r+n,result:No(e.slice(t+1+r,t+1+r+n))}}if(e[t]>=128){const r=e[t]-128;t+1+r>e.length&&is.throwError("data too short",bo.errors.BUFFER_OVERRUN,{});return{consumed:1+r,result:No(e.slice(t+1,t+1+r))}}return{consumed:1,result:No(e[t])}}function ds(e){const t=xo(e),r=fs(t,0);return r.consumed!==t.length&&is.throwArgumentError("invalid rlp data","data",e),r.result}var ls=Object.freeze({__proto__:null,decode:ds,encode:cs});const hs=new bo("address/5.7.0");function ps(e){Io(e,20)||hs.throwArgumentError("invalid address","address",e);const t=(e=e.toLowerCase()).substring(2).split(""),r=new Uint8Array(40);for(let e=0;e<40;e++)r[e]=t[e].charCodeAt(0);const n=xo(rs(r));for(let e=0;e<40;e+=2)n[e>>1]>>4>=8&&(t[e]=t[e].toUpperCase()),(15&n[e>>1])>=8&&(t[e+1]=t[e+1].toUpperCase());return"0x"+t.join("")}const ms={};for(let e=0;e<10;e++)ms[String(e)]=String(e);for(let e=0;e<26;e++)ms[String.fromCharCode(65+e)]=String(10+e);const gs=Math.floor(function(e){return Math.log10?Math.log10(e):Math.log(e)/Math.LN10}(9007199254740991));function ys(e){let t=(e=(e=e.toUpperCase()).substring(4)+e.substring(0,2)+"00").split("").map((e=>ms[e])).join("");for(;t.length>=gs;){let e=t.substring(0,gs);t=parseInt(e,10)%97+t.substring(e.length)}let r=String(98-parseInt(t,10)%97);for(;r.length<2;)r="0"+r;return r}function bs(e){let t=null;if("string"!=typeof e&&hs.throwArgumentError("invalid address","address",e),e.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==e.substring(0,2)&&(e="0x"+e),t=ps(e),e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==e&&hs.throwArgumentError("bad address checksum","address",e);else if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(e.substring(2,4)!==ys(e)&&hs.throwArgumentError("bad icap checksum","address",e),r=e.substring(4),t=new qo(r,36).toString(16);t.length<40;)t="0"+t;t=ps("0x"+t)}else hs.throwArgumentError("invalid address","address",e);var r;return t}function vs(e){let t=null;try{t=bs(e.from)}catch(t){hs.throwArgumentError("missing from address","transaction",e)}return bs(To(rs(cs([t,Mo(xo(Go.from(e.nonce).toHexString()))])),12))}var ws=Object.freeze({__proto__:null,getAddress:bs,getContractAddress:vs,getCreate2Address:function(e,t,r){return 32!==Oo(t)&&hs.throwArgumentError("salt must be 32 bytes","salt",t),32!==Oo(r)&&hs.throwArgumentError("initCodeHash must be 32 bytes","initCodeHash",r),bs(To(rs(ko(["0xff",bs(e),t,r])),12))},getIcapAddress:function(e){let t=(r=bs(e).substring(2),new qo(r,16).toString(36)).toUpperCase();for(var r;t.length<30;)t="0"+t;return"XE"+ys("XE00"+t)+t},isAddress:function(e){try{return bs(e),!0}catch(e){}return!1}});class As extends Xa{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,t){try{t=bs(t)}catch(e){this._throwError(e.message,t)}return e.writeValue(t)}decode(e){return bs(Bo(e.readValue().toHexString(),20))}}class _s extends Xa{constructor(e){super(e.name,e.type,void 0,e.dynamic),this.coder=e}defaultValue(){return this.coder.defaultValue()}encode(e,t){return this.coder.encode(e,t)}decode(e){return this.coder.decode(e)}}const Es=new bo(Pa);function Ss(e,t,r){let n=null;if(Array.isArray(r))n=r;else if(r&&"object"==typeof r){let e={};n=t.map((t=>{const n=t.localName;return n||Es.throwError("cannot encode object for signature with missing names",bo.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:r}),e[n]&&Es.throwError("cannot encode object for signature with duplicate names",bo.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:r}),e[n]=!0,r[n]}))}else Es.throwArgumentError("invalid tuple value","tuple",r);t.length!==n.length&&Es.throwArgumentError("types/value length mismatch","tuple",r);let i=new Qa(e.wordSize),o=new Qa(e.wordSize),a=[];t.forEach(((e,t)=>{let r=n[t];if(e.dynamic){let t=o.length;e.encode(o,r);let n=i.writeUpdatableValue();a.push((e=>{n(e+t)}))}else e.encode(i,r)})),a.forEach((e=>{e(i.length)}));let s=e.appendWriter(i);return s+=e.appendWriter(o),s}function Ps(e,t){let r=[],n=e.subReader(0);t.forEach((t=>{let i=null;if(t.dynamic){let r=e.readValue(),o=n.subReader(r.toNumber());try{i=t.decode(o)}catch(e){if(e.code===bo.errors.BUFFER_OVERRUN)throw e;i=e,i.baseType=t.name,i.name=t.localName,i.type=t.type}}else try{i=t.decode(e)}catch(e){if(e.code===bo.errors.BUFFER_OVERRUN)throw e;i=e,i.baseType=t.name,i.name=t.localName,i.type=t.type}null!=i&&r.push(i)}));const i=t.reduce(((e,t)=>{const r=t.localName;return r&&(e[r]||(e[r]=0),e[r]++),e}),{});t.forEach(((e,t)=>{let n=e.localName;if(!n||1!==i[n])return;if("length"===n&&(n="_length"),null!=r[n])return;const o=r[t];o instanceof Error?Object.defineProperty(r,n,{enumerable:!0,get:()=>{throw o}}):r[n]=o}));for(let e=0;e{throw t}})}return Object.freeze(r)}class xs extends Xa{constructor(e,t,r){super("array",e.type+"["+(t>=0?t:"")+"]",r,-1===t||e.dynamic),this.coder=e,this.length=t}defaultValue(){const e=this.coder.defaultValue(),t=[];for(let r=0;re._data.length&&Es.throwError("insufficient data length",bo.errors.BUFFER_OVERRUN,{length:e._data.length,count:t}));let r=[];for(let e=0;e>6==2;n++)e++;return e}return e===zs.OVERRUN?r.length-t-1:0}!function(e){e.current="",e.NFC="NFC",e.NFD="NFD",e.NFKC="NFKC",e.NFKD="NFKD"}(Fs||(Fs={})),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"}(zs||(zs={}));const Ls=Object.freeze({error:function(e,t,r,n,i){return Bs.throwArgumentError(`invalid codepoint at offset ${t}; ${e}`,"bytes",r)},ignore:Us,replace:function(e,t,r,n,i){return e===zs.OVERLONG?(n.push(i),0):(n.push(65533),Us(e,t,r))}});function qs(e,t){null==t&&(t=Ls.error),e=xo(e);const r=[];let n=0;for(;n>7==0){r.push(i);continue}let o=null,a=null;if(192==(224&i))o=1,a=127;else if(224==(240&i))o=2,a=2047;else{if(240!=(248&i)){n+=t(128==(192&i)?zs.UNEXPECTED_CONTINUE:zs.BAD_PREFIX,n-1,e,r);continue}o=3,a=65535}if(n-1+o>=e.length){n+=t(zs.OVERRUN,n-1,e,r);continue}let s=i&(1<<8-o-1)-1;for(let i=0;i1114111?n+=t(zs.OUT_OF_RANGE,n-1-o,e,r,s):s>=55296&&s<=57343?n+=t(zs.UTF16_SURROGATE,n-1-o,e,r,s):s<=a?n+=t(zs.OVERLONG,n-1-o,e,r,s):r.push(s))}return r}function Hs(e,t=Fs.current){t!=Fs.current&&(Bs.checkNormalize(),e=e.normalize(t));let r=[];for(let t=0;t>6|192),r.push(63&n|128);else if(55296==(64512&n)){t++;const i=e.charCodeAt(t);if(t>=e.length||56320!=(64512&i))throw new Error("invalid utf-8 string");const o=65536+((1023&n)<<10)+(1023&i);r.push(o>>18|240),r.push(o>>12&63|128),r.push(o>>6&63|128),r.push(63&o|128)}else r.push(n>>12|224),r.push(n>>6&63|128),r.push(63&n|128)}return xo(r)}function Ks(e){const t="0000"+e.toString(16);return"\\u"+t.substring(t.length-4)}function Js(e){return e.map((e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10&1023),56320+(1023&e))))).join("")}function Ws(e,t){return Js(qs(e,t))}function Gs(e,t=Fs.current){return qs(Hs(e,t))}function Vs(e,t){t||(t=function(e){return[parseInt(e,16)]});let r=0,n={};return e.split(",").forEach((e=>{let i=e.split(":");r+=parseInt(i[0],16),n[r]=t(i[1])})),n}function Zs(e){let t=0;return e.split(",").map((e=>{let r=e.split("-");1===r.length?r[1]="0":""===r[1]&&(r[1]="1");let n=t+parseInt(r[0],16);return t=parseInt(r[1],16),{l:n,h:t}}))}function Xs(e,t){let r=0;for(let n=0;n=r&&e<=r+i.h&&(e-r)%(i.d||1)==0){if(i.e&&-1!==i.e.indexOf(e-r))continue;return i}}return null}const Qs=Zs("221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d"),Ys="ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map((e=>parseInt(e,16))),ec=[{h:25,s:32,l:65},{h:30,s:32,e:[23],l:127},{h:54,s:1,e:[48],l:64,d:2},{h:14,s:1,l:57,d:2},{h:44,s:1,l:17,d:2},{h:10,s:1,e:[2,6,8],l:61,d:2},{h:16,s:1,l:68,d:2},{h:84,s:1,e:[18,24,66],l:19,d:2},{h:26,s:32,e:[17],l:435},{h:22,s:1,l:71,d:2},{h:15,s:80,l:40},{h:31,s:32,l:16},{h:32,s:1,l:80,d:2},{h:52,s:1,l:42,d:2},{h:12,s:1,l:55,d:2},{h:40,s:1,e:[38],l:15,d:2},{h:14,s:1,l:48,d:2},{h:37,s:48,l:49},{h:148,s:1,l:6351,d:2},{h:88,s:1,l:160,d:2},{h:15,s:16,l:704},{h:25,s:26,l:854},{h:25,s:32,l:55915},{h:37,s:40,l:1247},{h:25,s:-119711,l:53248},{h:25,s:-119763,l:52},{h:25,s:-119815,l:52},{h:25,s:-119867,e:[1,4,5,7,8,11,12,17],l:52},{h:25,s:-119919,l:52},{h:24,s:-119971,e:[2,7,8,17],l:52},{h:24,s:-120023,e:[2,7,13,15,16,17],l:52},{h:25,s:-120075,l:52},{h:25,s:-120127,l:52},{h:25,s:-120179,l:52},{h:25,s:-120231,l:52},{h:25,s:-120283,l:52},{h:25,s:-120335,l:52},{h:24,s:-119543,e:[17],l:56},{h:24,s:-119601,e:[17],l:58},{h:24,s:-119659,e:[17],l:58},{h:24,s:-119717,e:[17],l:58},{h:24,s:-119775,e:[17],l:58}],tc=Vs("b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3"),rc=Vs("179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7"),nc=Vs("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D",(function(e){if(e.length%4!=0)throw new Error("bad data");let t=[];for(let r=0;r{if(e<256){switch(e){case 8:return"\\b";case 9:return"\\t";case 10:return"\\n";case 13:return"\\r";case 34:return'\\"';case 92:return"\\\\"}if(e>=32&&e<127)return String.fromCharCode(e)}return e<=65535?Ks(e):Ks(55296+((e-=65536)>>10&1023))+Ks(56320+(1023&e))})).join("")+'"'},formatBytes32String:function(e){const t=Hs(e);if(t.length>31)throw new Error("bytes32 string must be less than 32 bytes");return No(ko([t,Ds]).slice(0,32))},nameprep:function(e){if(e.match(/^[a-z0-9-]*$/i)&&e.length<=59)return e.toLowerCase();let t=Gs(e);var r;r=t.map((e=>{if(Ys.indexOf(e)>=0)return[];if(e>=65024&&e<=65039)return[];let t=function(e){let t=Xs(e,ec);if(t)return[e+t.s];let r=tc[e];if(r)return r;let n=rc[e];return n?[e+n[0]]:nc[e]||null}(e);return t||[e]})),t=r.reduce(((e,t)=>(t.forEach((t=>{e.push(t)})),e)),[]),t=Gs(Js(t),Fs.NFKC),t.forEach((e=>{if(Xs(e,ic))throw new Error("STRINGPREP_CONTAINS_PROHIBITED")})),t.forEach((e=>{if(Xs(e,Qs))throw new Error("STRINGPREP_CONTAINS_UNASSIGNED")}));let n=Js(t);if("-"===n.substring(0,1)||"--"===n.substring(2,4)||"-"===n.substring(n.length-1))throw new Error("invalid hyphen");return n},parseBytes32String:function(e){const t=xo(e);if(32!==t.length)throw new Error("invalid bytes32 - not 32 bytes long");if(0!==t[31])throw new Error("invalid bytes32 string - no null terminator");let r=31;for(;0===t[r-1];)r--;return Ws(t.slice(0,r))},toUtf8Bytes:Hs,toUtf8CodePoints:Gs,toUtf8String:Ws});class ac extends Ms{constructor(e){super("string",e)}defaultValue(){return""}encode(e,t){return super.encode(e,Hs(t))}decode(e){return Ws(super.decode(e))}}class sc extends Xa{constructor(e,t){let r=!1;const n=[];e.forEach((e=>{e.dynamic&&(r=!0),n.push(e.type)}));super("tuple","tuple("+n.join(",")+")",t,r),this.coders=e}defaultValue(){const e=[];this.coders.forEach((t=>{e.push(t.defaultValue())}));const t=this.coders.reduce(((e,t)=>{const r=t.localName;return r&&(e[r]||(e[r]=0),e[r]++),e}),{});return this.coders.forEach(((r,n)=>{let i=r.localName;i&&1===t[i]&&("length"===i&&(i="_length"),null==e[i]&&(e[i]=e[n]))})),Object.freeze(e)}encode(e,t){return Ss(e,this.coders,t)}decode(e){return e.coerce(this.name,Ps(e,this.coders))}}const cc=new bo(Pa),uc=new RegExp(/^bytes([0-9]*)$/),fc=new RegExp(/^(u?int)([0-9]*)$/);class dc{constructor(e){pa(this,"coerceFunc",e||null)}_getCoder(e){switch(e.baseType){case"address":return new As(e.name);case"bool":return new ks(e.name);case"string":return new ac(e.name);case"bytes":return new Cs(e.name);case"array":return new xs(this._getCoder(e.arrayChildren),e.arrayLength,e.name);case"tuple":return new sc((e.components||[]).map((e=>this._getCoder(e))),e.name);case"":return new Rs(e.name)}let t=e.type.match(fc);if(t){let r=parseInt(t[2]||"256");return(0===r||r>256||r%8!=0)&&cc.throwArgumentError("invalid "+t[1]+" bit length","param",e),new $s(r/8,"int"===t[1],e.name)}if(t=e.type.match(uc),t){let r=parseInt(t[1]);return(0===r||r>32)&&cc.throwArgumentError("invalid bytes length","param",e),new Is(r,e.name)}return cc.throwArgumentError("invalid type","type",e.type)}_getWordSize(){return 32}_getReader(e,t){return new Ya(e,this._getWordSize(),this.coerceFunc,t)}_getWriter(){return new Qa(this._getWordSize())}getDefaultValue(e){const t=e.map((e=>this._getCoder(Ta.from(e))));return new sc(t,"_").defaultValue()}encode(e,t){e.length!==t.length&&cc.throwError("types/values length mismatch",bo.errors.INVALID_ARGUMENT,{count:{types:e.length,values:t.length},value:{types:e,values:t}});const r=e.map((e=>this._getCoder(Ta.from(e)))),n=new sc(r,"_"),i=this._getWriter();return n.encode(i,t),i.data}decode(e,t,r){const n=e.map((e=>this._getCoder(Ta.from(e))));return new sc(n,"_").decode(this._getReader(xo(t),r))}}const lc=new dc;function hc(e){return rs(Hs(e))}const pc="hash/5.7.0";function mc(e){e=atob(e);const t=[];for(let r=0;r0&&Array.isArray(e)?i(e,t-1):r.push(e)}))};return i(e,t),r}function vc(e){return function(e){let t=0;return()=>e[t++]}(function(e){let t=0;function r(){return e[t++]<<8|e[t++]}let n=r(),i=1,o=[0,1];for(let e=1;e>--c&1}const d=Math.pow(2,31),l=d>>>1,h=l>>1,p=d-1;let m=0;for(let e=0;e<31;e++)m=m<<1|f();let g=[],y=0,b=d;for(;;){let e=Math.floor(((m-y+1)*i-1)/b),t=0,r=n;for(;r-t>1;){let n=t+r>>>1;e>>1|f(),a=a<<1^l,s=(s^l)<<1|l|1;y=a,b=1+s-a}let v=n-4;return g.map((t=>{switch(t-v){case 3:return v+65792+(e[s++]<<16|e[s++]<<8|e[s++]);case 2:return v+256+(e[s++]<<8|e[s++]);case 1:return v+e[s++];default:return t-1}}))}(e))}function wc(e){return 1&e?~e>>1:e>>1}function Ac(e,t){let r=Array(e);for(let n=0,i=-1;nt[e])):r}function Sc(e,t,r){let n=Array(e).fill(void 0).map((()=>[]));for(let i=0;in[t].push(e)));return n}function Pc(e,t){let r=1+t(),n=t(),i=function(e){let t=[];for(;;){let r=e();if(0==r)break;t.push(r)}return t}(t);return bc(Sc(i.length,1+e,t).map(((e,t)=>{const o=e[0],a=e.slice(1);return Array(i[t]).fill(void 0).map(((e,t)=>{let i=t*n;return[o+t*r,a.map((e=>e+i))]}))})))}function xc(e,t){return Sc(1+t(),1+e,t).map((e=>[e[0],e.slice(1)]))}const kc=vc(mc("AEQF2AO2DEsA2wIrAGsBRABxAN8AZwCcAEwAqgA0AGwAUgByADcATAAVAFYAIQAyACEAKAAYAFgAGwAjABQAMAAmADIAFAAfABQAKwATACoADgAbAA8AHQAYABoAGQAxADgALAAoADwAEwA9ABMAGgARAA4ADwAWABMAFgAIAA8AHgQXBYMA5BHJAS8JtAYoAe4AExozi0UAH21tAaMnBT8CrnIyhrMDhRgDygIBUAEHcoFHUPe8AXBjAewCjgDQR8IICIcEcQLwATXCDgzvHwBmBoHNAqsBdBcUAykgDhAMShskMgo8AY8jqAQfAUAfHw8BDw87MioGlCIPBwZCa4ELatMAAMspJVgsDl8AIhckSg8XAHdvTwBcIQEiDT4OPhUqbyECAEoAS34Aej8Ybx83JgT/Xw8gHxZ/7w8RICxPHA9vBw+Pfw8PHwAPFv+fAsAvCc8vEr8ivwD/EQ8Bol8OEBa/A78hrwAPCU8vESNvvwWfHwNfAVoDHr+ZAAED34YaAdJPAK7PLwSEgDLHAGo1Pz8Pvx9fUwMrpb8O/58VTzAPIBoXIyQJNF8hpwIVAT8YGAUADDNBaX3RAMomJCg9EhUeA29MABsZBTMNJipjOhc19gcIDR8bBwQHEggCWi6DIgLuAQYA+BAFCha3A5XiAEsqM7UFFgFLhAMjFTMYE1Klnw74nRVBG/ASCm0BYRN/BrsU3VoWy+S0vV8LQx+vN8gF2AC2AK5EAW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Tr8MME7Ps2wiVfygUmPoUBJJfJWX5Nda0nuncbFkA==")),Mc=new Set(Ec(kc)),Cc=new Set(Ec(kc)),Ic=function(e){let t=[];for(;;){let r=e();if(0==r)break;t.push(Pc(r,e))}for(;;){let r=e()-1;if(r<0)break;t.push(xc(r,e))}return function(e){const t={};for(let r=0;re-t));return function r(){let n=[];for(;;){let i=Ec(e,t);if(0==i.length)break;n.push({set:new Set(i),node:r()})}n.sort(((e,t)=>t.set.size-e.set.size));let i=e(),o=i%3;i=i/3|0;let a=!!(1&i);return i>>=1,{branches:n,valid:o,fe0f:a,save:1==i,check:2==i}}()}(kc),Nc=45,Oc=95;function Tc(e){return Gs(e)}function jc(e){return e.filter((e=>65039!=e))}function Dc(e){for(let t of e.split(".")){let e=Tc(t);try{for(let t=e.lastIndexOf(Oc)-1;t>=0;t--)if(e[t]!==Oc)throw new Error("underscore only allowed at start");if(e.length>=4&&e.every((e=>e<128))&&e[2]===Nc&&e[3]===Nc)throw new Error("invalid label extension")}catch(e){throw new Error(`Invalid label "${t}": ${e.message}`)}}return e}function $c(e){return Dc(function(e,t){let r=Tc(e).reverse(),n=[];for(;r.length;){let e=Bc(r);if(e){n.push(...t(e));continue}let i=r.pop();if(Mc.has(i)){n.push(i);continue}if(Cc.has(i))continue;let o=Ic[i];if(!o)throw new Error(`Disallowed codepoint: 0x${i.toString(16).toUpperCase()}`);n.push(...o)}return Dc(function(e){return e.normalize("NFC")}(String.fromCodePoint(...n)))}(e,jc))}function Bc(e,t){var r;let n,i,o=Rc,a=[],s=e.length;for(t&&(t.length=0);s;){let c=e[--s];if(o=null===(r=o.branches.find((e=>e.set.has(c))))||void 0===r?void 0:r.node,!o)break;if(o.save)i=c;else if(o.check&&c===i)break;a.push(c),o.fe0f&&(a.push(65039),s>0&&65039==e[s-1]&&s--),o.valid&&(n=a.slice(),2==o.valid&&n.splice(1,1),t&&t.push(...e.slice(s).reverse()),e.length=s)}return n}const Fc=new bo(pc),zc=new Uint8Array(32);function Uc(e){if(0===e.length)throw new Error("invalid ENS name; empty component");return e}function Lc(e){const t=Hs($c(e)),r=[];if(0===e.length)return r;let n=0;for(let e=0;e=t.length)throw new Error("invalid ENS name; empty component");return r.push(Uc(t.slice(n))),r}function qc(e){"string"!=typeof e&&Fc.throwArgumentError("invalid ENS name; not a string","name",e);let t=zc;const r=Lc(e);for(;r.length;)t=rs(ko([t,rs(r.pop())]));return No(t)}function Hc(e){return No(ko(Lc(e).map((e=>{if(e.length>63)throw new Error("invalid DNS encoded entry; length exceeds 63 bytes");const t=new Uint8Array(e.length+1);return t.set(e,1),t[0]=t.length-1,t}))))+"00"}zc.fill(0);const Kc="Ethereum Signed Message:\n";function Jc(e){return"string"==typeof e&&(e=Hs(e)),rs(ko([Hs(Kc),Hs(String(e.length)),e]))}var Wc=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))};const Gc=new bo(pc),Vc=new Uint8Array(32);Vc.fill(0);const Zc=Go.from(-1),Xc=Go.from(0),Qc=Go.from(1),Yc=Go.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");const eu=Bo(Qc.toHexString(),32),tu=Bo(Xc.toHexString(),32),ru={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},nu=["name","version","chainId","verifyingContract","salt"];function iu(e){return function(t){return"string"!=typeof t&&Gc.throwArgumentError(`invalid domain value for ${JSON.stringify(e)}`,`domain.${e}`,t),t}}const ou={name:iu("name"),version:iu("version"),chainId:function(e){try{return Go.from(e).toString()}catch(e){}return Gc.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",e)},verifyingContract:function(e){try{return bs(e).toLowerCase()}catch(e){}return Gc.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",e)},salt:function(e){try{const t=xo(e);if(32!==t.length)throw new Error("bad length");return No(t)}catch(e){}return Gc.throwArgumentError('invalid domain value "salt"',"domain.salt",e)}};function au(e){{const t=e.match(/^(u?)int(\d*)$/);if(t){const r=""===t[1],n=parseInt(t[2]||"256");(n%8!=0||n>256||t[2]&&t[2]!==String(n))&&Gc.throwArgumentError("invalid numeric width","type",e);const i=Yc.mask(r?n-1:n),o=r?i.add(Qc).mul(Zc):Xc;return function(t){const r=Go.from(t);return(r.lt(o)||r.gt(i))&&Gc.throwArgumentError(`value out-of-bounds for ${e}`,"value",t),Bo(r.toTwos(256).toHexString(),32)}}}{const t=e.match(/^bytes(\d+)$/);if(t){const r=parseInt(t[1]);return(0===r||r>32||t[1]!==String(r))&&Gc.throwArgumentError("invalid bytes width","type",e),function(t){return xo(t).length!==r&&Gc.throwArgumentError(`invalid length for ${e}`,"value",t),function(e){const t=xo(e),r=t.length%32;return r?jo([t,Vc.slice(r)]):No(t)}(t)}}}switch(e){case"address":return function(e){return Bo(bs(e),32)};case"bool":return function(e){return e?eu:tu};case"bytes":return function(e){return rs(e)};case"string":return function(e){return hc(e)}}return null}function su(e,t){return`${e}(${t.map((({name:e,type:t})=>t+" "+e)).join(",")})`}class cu{constructor(e){pa(this,"types",Object.freeze(_a(e))),pa(this,"_encoderCache",{}),pa(this,"_types",{});const t={},r={},n={};Object.keys(e).forEach((e=>{t[e]={},r[e]=[],n[e]={}}));for(const n in e){const i={};e[n].forEach((o=>{i[o.name]&&Gc.throwArgumentError(`duplicate variable name ${JSON.stringify(o.name)} in ${JSON.stringify(n)}`,"types",e),i[o.name]=!0;const a=o.type.match(/^([^\x5b]*)(\x5b|$)/)[1];a===n&&Gc.throwArgumentError(`circular type reference to ${JSON.stringify(a)}`,"types",e);au(a)||(r[a]||Gc.throwArgumentError(`unknown type ${JSON.stringify(a)}`,"types",e),r[a].push(n),t[n][a]=!0)}))}const i=Object.keys(r).filter((e=>0===r[e].length));0===i.length?Gc.throwArgumentError("missing primary type","types",e):i.length>1&&Gc.throwArgumentError(`ambiguous primary types or unused types: ${i.map((e=>JSON.stringify(e))).join(", ")}`,"types",e),pa(this,"primaryType",i[0]),function i(o,a){a[o]&&Gc.throwArgumentError(`circular type reference to ${JSON.stringify(o)}`,"types",e),a[o]=!0,Object.keys(t[o]).forEach((e=>{r[e]&&(i(e,a),Object.keys(a).forEach((t=>{n[t][e]=!0})))})),delete a[o]}(this.primaryType,{});for(const t in n){const r=Object.keys(n[t]);r.sort(),this._types[t]=su(t,e[t])+r.map((t=>su(t,e[t]))).join("")}}getEncoder(e){let t=this._encoderCache[e];return t||(t=this._encoderCache[e]=this._getEncoder(e)),t}_getEncoder(e){{const t=au(e);if(t)return t}const t=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(t){const e=t[1],r=this.getEncoder(e),n=parseInt(t[3]);return t=>{n>=0&&t.length!==n&&Gc.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",t);let i=t.map(r);return this._types[e]&&(i=i.map(rs)),rs(jo(i))}}const r=this.types[e];if(r){const t=hc(this._types[e]);return e=>{const n=r.map((({name:t,type:r})=>{const n=this.getEncoder(r)(e[t]);return this._types[r]?rs(n):n}));return n.unshift(t),jo(n)}}return Gc.throwArgumentError(`unknown type: ${e}`,"type",e)}encodeType(e){const t=this._types[e];return t||Gc.throwArgumentError(`unknown type: ${JSON.stringify(e)}`,"name",e),t}encodeData(e,t){return this.getEncoder(e)(t)}hashStruct(e,t){return rs(this.encodeData(e,t))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,t,r){if(au(e))return r(e,t);const n=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(n){const e=n[1],i=parseInt(n[3]);return i>=0&&t.length!==i&&Gc.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",t),t.map((t=>this._visit(e,t,r)))}const i=this.types[e];return i?i.reduce(((e,{name:n,type:i})=>(e[n]=this._visit(i,t[n],r),e)),{}):Gc.throwArgumentError(`unknown type: ${e}`,"type",e)}visit(e,t){return this._visit(this.primaryType,e,t)}static from(e){return new cu(e)}static getPrimaryType(e){return cu.from(e).primaryType}static hashStruct(e,t,r){return cu.from(t).hashStruct(e,r)}static hashDomain(e){const t=[];for(const r in e){const n=ru[r];n||Gc.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(r)}`,"domain",e),t.push({name:r,type:n})}return t.sort(((e,t)=>nu.indexOf(e.name)-nu.indexOf(t.name))),cu.hashStruct("EIP712Domain",{EIP712Domain:t},e)}static encode(e,t,r){return jo(["0x1901",cu.hashDomain(e),cu.from(t).hash(r)])}static hash(e,t,r){return rs(cu.encode(e,t,r))}static resolveNames(e,t,r,n){return Wc(this,void 0,void 0,(function*(){e=ba(e);const i={};e.verifyingContract&&!Io(e.verifyingContract,20)&&(i[e.verifyingContract]="0x");const o=cu.from(t);o.visit(r,((e,t)=>("address"!==e||Io(t,20)||(i[t]="0x"),t)));for(const e in i)i[e]=yield n(e);return e.verifyingContract&&i[e.verifyingContract]&&(e.verifyingContract=i[e.verifyingContract]),r=o.visit(r,((e,t)=>"address"===e&&i[t]?i[t]:t)),{domain:e,value:r}}))}static getPayload(e,t,r){cu.hashDomain(e);const n={},i=[];nu.forEach((t=>{const r=e[t];null!=r&&(n[t]=ou[t](r),i.push({name:t,type:ru[t]}))}));const o=cu.from(t),a=ba(t);return a.EIP712Domain?Gc.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",t):a.EIP712Domain=i,o.encode(r),{types:a,domain:n,primaryType:o.primaryType,message:o.visit(r,((e,t)=>{if(e.match(/^bytes(\d*)/))return No(xo(t));if(e.match(/^u?int/))return Go.from(t).toString();switch(e){case"address":return t.toLowerCase();case"bool":return!!t;case"string":return"string"!=typeof t&&Gc.throwArgumentError("invalid string","value",t),t}return Gc.throwArgumentError("unsupported type","type",e)}))}}}var uu=Object.freeze({__proto__:null,_TypedDataEncoder:cu,dnsEncode:Hc,ensNormalize:function(e){return Lc(e).map((e=>Ws(e))).join(".")},hashMessage:Jc,id:hc,isValidName:function(e){try{return 0!==Lc(e).length}catch(e){}return!1},messagePrefix:Kc,namehash:qc});const fu=new bo(Pa);class du extends Ea{}class lu extends Ea{}class hu extends Ea{}class pu extends Ea{static isIndexed(e){return!(!e||!e._isIndexed)}}const mu={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function gu(e,t){const r=new Error(`deferred error during ABI decoding triggered accessing ${e}`);return r.error=t,r}class yu{constructor(e){let t=[];t="string"==typeof e?JSON.parse(e):e,pa(this,"fragments",t.map((e=>Da.from(e))).filter((e=>null!=e))),pa(this,"_abiCoder",ma(new.target,"getAbiCoder")()),pa(this,"functions",{}),pa(this,"errors",{}),pa(this,"events",{}),pa(this,"structs",{}),this.fragments.forEach((e=>{let t=null;switch(e.type){case"constructor":return this.deploy?void fu.warn("duplicate definition - constructor"):void pa(this,"deploy",e);case"function":t=this.functions;break;case"event":t=this.events;break;case"error":t=this.errors;break;default:return}let r=e.format();t[r]?fu.warn("duplicate definition - "+r):t[r]=e})),this.deploy||pa(this,"deploy",Ua.from({payable:!1,type:"constructor"})),pa(this,"_isInterface",!0)}format(e){e||(e=Na.full),e===Na.sighash&&fu.throwArgumentError("interface does not support formatting sighash","format",e);const t=this.fragments.map((t=>t.format(e)));return e===Na.json?JSON.stringify(t.map((e=>JSON.parse(e)))):t}static getAbiCoder(){return lc}static getAddress(e){return bs(e)}static getSighash(e){return To(hc(e.format()),0,4)}static getEventTopic(e){return hc(e.format())}getFunction(e){if(Io(e)){for(const t in this.functions)if(e===this.getSighash(t))return this.functions[t];fu.throwArgumentError("no matching function","sighash",e)}if(-1===e.indexOf("(")){const t=e.trim(),r=Object.keys(this.functions).filter((e=>e.split("(")[0]===t));return 0===r.length?fu.throwArgumentError("no matching function","name",t):r.length>1&&fu.throwArgumentError("multiple matching functions","name",t),this.functions[r[0]]}const t=this.functions[La.fromString(e).format()];return t||fu.throwArgumentError("no matching function","signature",e),t}getEvent(e){if(Io(e)){const t=e.toLowerCase();for(const e in this.events)if(t===this.getEventTopic(e))return this.events[e];fu.throwArgumentError("no matching event","topichash",t)}if(-1===e.indexOf("(")){const t=e.trim(),r=Object.keys(this.events).filter((e=>e.split("(")[0]===t));return 0===r.length?fu.throwArgumentError("no matching event","name",t):r.length>1&&fu.throwArgumentError("multiple matching events","name",t),this.events[r[0]]}const t=this.events[$a.fromString(e).format()];return t||fu.throwArgumentError("no matching event","signature",e),t}getError(e){if(Io(e)){const t=ma(this.constructor,"getSighash");for(const r in this.errors){if(e===t(this.errors[r]))return this.errors[r]}fu.throwArgumentError("no matching error","sighash",e)}if(-1===e.indexOf("(")){const t=e.trim(),r=Object.keys(this.errors).filter((e=>e.split("(")[0]===t));return 0===r.length?fu.throwArgumentError("no matching error","name",t):r.length>1&&fu.throwArgumentError("multiple matching errors","name",t),this.errors[r[0]]}const t=this.errors[La.fromString(e).format()];return t||fu.throwArgumentError("no matching error","signature",e),t}getSighash(e){if("string"==typeof e)try{e=this.getFunction(e)}catch(t){try{e=this.getError(e)}catch(e){throw t}}return ma(this.constructor,"getSighash")(e)}getEventTopic(e){return"string"==typeof e&&(e=this.getEvent(e)),ma(this.constructor,"getEventTopic")(e)}_decodeParams(e,t){return this._abiCoder.decode(e,t)}_encodeParams(e,t){return this._abiCoder.encode(e,t)}encodeDeploy(e){return this._encodeParams(this.deploy.inputs,e||[])}decodeErrorResult(e,t){"string"==typeof e&&(e=this.getError(e));const r=xo(t);return No(r.slice(0,4))!==this.getSighash(e)&&fu.throwArgumentError(`data signature does not match error ${e.name}.`,"data",No(r)),this._decodeParams(e.inputs,r.slice(4))}encodeErrorResult(e,t){return"string"==typeof e&&(e=this.getError(e)),No(ko([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}decodeFunctionData(e,t){"string"==typeof e&&(e=this.getFunction(e));const r=xo(t);return No(r.slice(0,4))!==this.getSighash(e)&&fu.throwArgumentError(`data signature does not match function ${e.name}.`,"data",No(r)),this._decodeParams(e.inputs,r.slice(4))}encodeFunctionData(e,t){return"string"==typeof e&&(e=this.getFunction(e)),No(ko([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}decodeFunctionResult(e,t){"string"==typeof e&&(e=this.getFunction(e));let r=xo(t),n=null,i="",o=null,a=null,s=null;switch(r.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(e.outputs,r)}catch(e){}break;case 4:{const e=No(r.slice(0,4)),t=mu[e];if(t)o=this._abiCoder.decode(t.inputs,r.slice(4)),a=t.name,s=t.signature,t.reason&&(n=o[0]),"Error"===a?i=`; VM Exception while processing transaction: reverted with reason string ${JSON.stringify(o[0])}`:"Panic"===a&&(i=`; VM Exception while processing transaction: reverted with panic code ${o[0]}`);else try{const t=this.getError(e);o=this._abiCoder.decode(t.inputs,r.slice(4)),a=t.name,s=t.format()}catch(e){}break}}return fu.throwError("call revert exception"+i,bo.errors.CALL_EXCEPTION,{method:e.format(),data:No(t),errorArgs:o,errorName:a,errorSignature:s,reason:n})}encodeFunctionResult(e,t){return"string"==typeof e&&(e=this.getFunction(e)),No(this._abiCoder.encode(e.outputs,t||[]))}encodeFilterTopics(e,t){"string"==typeof e&&(e=this.getEvent(e)),t.length>e.inputs.length&&fu.throwError("too many arguments for "+e.format(),bo.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:t});let r=[];e.anonymous||r.push(this.getEventTopic(e));const n=(e,t)=>"string"===e.type?hc(t):"bytes"===e.type?rs(No(t)):("bool"===e.type&&"boolean"==typeof t&&(t=t?"0x01":"0x00"),e.type.match(/^u?int/)&&(t=Go.from(t).toHexString()),"address"===e.type&&this._abiCoder.encode(["address"],[t]),Bo(No(t),32));for(t.forEach(((t,i)=>{let o=e.inputs[i];o.indexed?null==t?r.push(null):"array"===o.baseType||"tuple"===o.baseType?fu.throwArgumentError("filtering with tuples or arrays not supported","contract."+o.name,t):Array.isArray(t)?r.push(t.map((e=>n(o,e)))):r.push(n(o,t)):null!=t&&fu.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+o.name,t)}));r.length&&null===r[r.length-1];)r.pop();return r}encodeEventLog(e,t){"string"==typeof e&&(e=this.getEvent(e));const r=[],n=[],i=[];return e.anonymous||r.push(this.getEventTopic(e)),t.length!==e.inputs.length&&fu.throwArgumentError("event arguments/values mismatch","values",t),e.inputs.forEach(((e,o)=>{const a=t[o];if(e.indexed)if("string"===e.type)r.push(hc(a));else if("bytes"===e.type)r.push(rs(a));else{if("tuple"===e.baseType||"array"===e.baseType)throw new Error("not implemented");r.push(this._abiCoder.encode([e.type],[a]))}else n.push(e),i.push(a)})),{data:this._abiCoder.encode(n,i),topics:r}}decodeEventLog(e,t,r){if("string"==typeof e&&(e=this.getEvent(e)),null!=r&&!e.anonymous){let t=this.getEventTopic(e);Io(r[0],32)&&r[0].toLowerCase()===t||fu.throwError("fragment/topic mismatch",bo.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:t,value:r[0]}),r=r.slice(1)}let n=[],i=[],o=[];e.inputs.forEach(((e,t)=>{e.indexed?"string"===e.type||"bytes"===e.type||"tuple"===e.baseType||"array"===e.baseType?(n.push(Ta.fromObject({type:"bytes32",name:e.name})),o.push(!0)):(n.push(e),o.push(!1)):(i.push(e),o.push(!1))}));let a=null!=r?this._abiCoder.decode(n,ko(r)):null,s=this._abiCoder.decode(i,t,!0),c=[],u=0,f=0;e.inputs.forEach(((e,t)=>{if(e.indexed)if(null==a)c[t]=new pu({_isIndexed:!0,hash:null});else if(o[t])c[t]=new pu({_isIndexed:!0,hash:a[f++]});else try{c[t]=a[f++]}catch(e){c[t]=e}else try{c[t]=s[u++]}catch(e){c[t]=e}if(e.name&&null==c[e.name]){const r=c[t];r instanceof Error?Object.defineProperty(c,e.name,{enumerable:!0,get:()=>{throw gu(`property ${JSON.stringify(e.name)}`,r)}}):c[e.name]=r}}));for(let e=0;e{throw gu(`index ${e}`,t)}})}return Object.freeze(c)}parseTransaction(e){let t=this.getFunction(e.data.substring(0,10).toLowerCase());return t?new lu({args:this._abiCoder.decode(t.inputs,"0x"+e.data.substring(10)),functionFragment:t,name:t.name,signature:t.format(),sighash:this.getSighash(t),value:Go.from(e.value||"0")}):null}parseLog(e){let t=this.getEvent(e.topics[0]);return!t||t.anonymous?null:new du({eventFragment:t,name:t.name,signature:t.format(),topic:this.getEventTopic(t),args:this.decodeEventLog(t,e.data,e.topics)})}parseError(e){const t=No(e);let r=this.getError(t.substring(0,10).toLowerCase());return r?new hu({args:this._abiCoder.decode(r.inputs,"0x"+t.substring(10)),errorFragment:r,name:r.name,signature:r.format(),sighash:this.getSighash(r)}):null}static isInterface(e){return!(!e||!e._isInterface)}}var bu=Object.freeze({__proto__:null,AbiCoder:dc,ConstructorFragment:Ua,ErrorFragment:Ha,EventFragment:$a,FormatTypes:Na,Fragment:Da,FunctionFragment:La,Indexed:pu,Interface:yu,LogDescription:du,ParamType:Ta,TransactionDescription:lu,checkResultErrors:Za,defaultAbiCoder:lc});var vu=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))};const wu=new bo("abstract-provider/5.7.0");class Au extends Ea{static isForkEvent(e){return!(!e||!e._isForkEvent)}}class _u{constructor(){wu.checkAbstract(new.target,_u),pa(this,"_isProvider",!0)}getFeeData(){return vu(this,void 0,void 0,(function*(){const{block:e,gasPrice:t}=yield ga({block:this.getBlock("latest"),gasPrice:this.getGasPrice().catch((e=>null))});let r=null,n=null,i=null;return e&&e.baseFeePerGas&&(r=e.baseFeePerGas,i=Go.from("1500000000"),n=e.baseFeePerGas.mul(2).add(i)),{lastBaseFeePerGas:r,maxFeePerGas:n,maxPriorityFeePerGas:i,gasPrice:t}}))}addListener(e,t){return this.on(e,t)}removeListener(e,t){return this.off(e,t)}static isProvider(e){return!(!e||!e._isProvider)}}var Eu=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))};const Su=new bo("abstract-signer/5.7.0"),Pu=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],xu=[bo.errors.INSUFFICIENT_FUNDS,bo.errors.NONCE_EXPIRED,bo.errors.REPLACEMENT_UNDERPRICED];class ku{constructor(){Su.checkAbstract(new.target,ku),pa(this,"_isSigner",!0)}getBalance(e){return Eu(this,void 0,void 0,(function*(){return this._checkProvider("getBalance"),yield this.provider.getBalance(this.getAddress(),e)}))}getTransactionCount(e){return Eu(this,void 0,void 0,(function*(){return this._checkProvider("getTransactionCount"),yield this.provider.getTransactionCount(this.getAddress(),e)}))}estimateGas(e){return Eu(this,void 0,void 0,(function*(){this._checkProvider("estimateGas");const t=yield ga(this.checkTransaction(e));return yield this.provider.estimateGas(t)}))}call(e,t){return Eu(this,void 0,void 0,(function*(){this._checkProvider("call");const r=yield ga(this.checkTransaction(e));return yield this.provider.call(r,t)}))}sendTransaction(e){return Eu(this,void 0,void 0,(function*(){this._checkProvider("sendTransaction");const t=yield this.populateTransaction(e),r=yield this.signTransaction(t);return yield this.provider.sendTransaction(r)}))}getChainId(){return Eu(this,void 0,void 0,(function*(){this._checkProvider("getChainId");return(yield this.provider.getNetwork()).chainId}))}getGasPrice(){return Eu(this,void 0,void 0,(function*(){return this._checkProvider("getGasPrice"),yield this.provider.getGasPrice()}))}getFeeData(){return Eu(this,void 0,void 0,(function*(){return this._checkProvider("getFeeData"),yield this.provider.getFeeData()}))}resolveName(e){return Eu(this,void 0,void 0,(function*(){return this._checkProvider("resolveName"),yield this.provider.resolveName(e)}))}checkTransaction(e){for(const t in e)-1===Pu.indexOf(t)&&Su.throwArgumentError("invalid transaction key: "+t,"transaction",e);const t=ba(e);return null==t.from?t.from=this.getAddress():t.from=Promise.all([Promise.resolve(t.from),this.getAddress()]).then((t=>(t[0].toLowerCase()!==t[1].toLowerCase()&&Su.throwArgumentError("from address mismatch","transaction",e),t[0]))),t}populateTransaction(e){return Eu(this,void 0,void 0,(function*(){const t=yield ga(this.checkTransaction(e));null!=t.to&&(t.to=Promise.resolve(t.to).then((e=>Eu(this,void 0,void 0,(function*(){if(null==e)return null;const t=yield this.resolveName(e);return null==t&&Su.throwArgumentError("provided ENS name resolves to null","tx.to",e),t})))),t.to.catch((e=>{})));const r=null!=t.maxFeePerGas||null!=t.maxPriorityFeePerGas;if(null==t.gasPrice||2!==t.type&&!r?0!==t.type&&1!==t.type||!r||Su.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",e):Su.throwArgumentError("eip-1559 transaction do not support gasPrice","transaction",e),2!==t.type&&null!=t.type||null==t.maxFeePerGas||null==t.maxPriorityFeePerGas)if(0===t.type||1===t.type)null==t.gasPrice&&(t.gasPrice=this.getGasPrice());else{const e=yield this.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?(r&&Su.throwError("network does not support EIP-1559",bo.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),null==t.gasPrice&&(t.gasPrice=e.gasPrice),t.type=0):Su.throwError("failed to get consistent fee data",bo.errors.UNSUPPORTED_OPERATION,{operation:"signer.getFeeData"});else 2===t.type&&(null==t.maxFeePerGas&&(t.maxFeePerGas=e.maxFeePerGas),null==t.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=e.maxPriorityFeePerGas))}else t.type=2;return null==t.nonce&&(t.nonce=this.getTransactionCount("pending")),null==t.gasLimit&&(t.gasLimit=this.estimateGas(t).catch((e=>{if(xu.indexOf(e.code)>=0)throw e;return Su.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",bo.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,tx:t})}))),null==t.chainId?t.chainId=this.getChainId():t.chainId=Promise.all([Promise.resolve(t.chainId),this.getChainId()]).then((t=>(0!==t[1]&&t[0]!==t[1]&&Su.throwArgumentError("chainId address mismatch","transaction",e),t[0]))),yield ga(t)}))}_checkProvider(e){this.provider||Su.throwError("missing provider",bo.errors.UNSUPPORTED_OPERATION,{operation:e||"_checkProvider"})}static isSigner(e){return!(!e||!e._isSigner)}}class Mu extends ku{constructor(e,t){super(),pa(this,"address",e),pa(this,"provider",t||null)}getAddress(){return Promise.resolve(this.address)}_fail(e,t){return Promise.resolve().then((()=>{Su.throwError(e,bo.errors.UNSUPPORTED_OPERATION,{operation:t})}))}signMessage(e){return this._fail("VoidSigner cannot sign messages","signMessage")}signTransaction(e){return this._fail("VoidSigner cannot sign transactions","signTransaction")}_signTypedData(e,t,r){return this._fail("VoidSigner cannot sign typed data","signTypedData")}connect(e){return new Mu(this.address,e)}}function Cu(e,t,r){return r={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&r.path)}},e(r,r.exports),r.exports}var Iu=Ru;function Ru(e,t){if(!e)throw new Error(t||"Assertion failed")}Ru.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)};var Nu=Cu((function(e,t){var r=t;function n(e){return 1===e.length?"0"+e:e}function i(e){for(var t="",r=0;r>8,a=255&i;o?r.push(o,a):r.push(a)}return r},r.zero2=n,r.toHex=i,r.encode=function(e,t){return"hex"===t?i(e):e}})),Ou=Cu((function(e,t){var r=t;r.assert=Iu,r.toArray=Nu.toArray,r.zero2=Nu.zero2,r.toHex=Nu.toHex,r.encode=Nu.encode,r.getNAF=function(e,t,r){var n=new Array(Math.max(e.bitLength(),r)+1);n.fill(0);for(var i=1<(i>>1)-1?(i>>1)-c:c,o.isubn(s)):s=0,n[a]=s,o.iushrn(1)}return n},r.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n,i=0,o=0;e.cmpn(-i)>0||t.cmpn(-o)>0;){var a,s,c=e.andln(3)+i&3,u=t.andln(3)+o&3;3===c&&(c=-1),3===u&&(u=-1),a=0==(1&c)?0:3!==(n=e.andln(7)+i&7)&&5!==n||2!==u?c:-c,r[0].push(a),s=0==(1&u)?0:3!==(n=t.andln(7)+o&7)&&5!==n||2!==c?u:-u,r[1].push(s),2*i===a+1&&(i=1-i),2*o===s+1&&(o=1-o),e.iushrn(1),t.iushrn(1)}return r},r.cachedProperty=function(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},r.parseBytes=function(e){return"string"==typeof e?r.toArray(e,"hex"):e},r.intFromLE=function(e){return new so(e,"hex","le")}})),Tu=Ou.getNAF,ju=Ou.getJSF,Du=Ou.assert;function $u(e,t){this.type=e,this.p=new so(t.p,16),this.red=t.prime?so.red(t.prime):so.mont(this.p),this.zero=new so(0).toRed(this.red),this.one=new so(1).toRed(this.red),this.two=new so(2).toRed(this.red),this.n=t.n&&new so(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var Bu=$u;function Fu(e,t){this.curve=e,this.type=t,this.precomputed=null}$u.prototype.point=function(){throw new Error("Not implemented")},$u.prototype.validate=function(){throw new Error("Not implemented")},$u.prototype._fixedNafMul=function(e,t){Du(e.precomputed);var r=e._getDoubles(),n=Tu(t,1,this._bitLength),i=(1<=o;c--)a=(a<<1)+n[c];s.push(a)}for(var u=this.jpoint(null,null,null),f=this.jpoint(null,null,null),d=i;d>0;d--){for(o=0;o=0;s--){for(var c=0;s>=0&&0===o[s];s--)c++;if(s>=0&&c++,a=a.dblp(c),s<0)break;var u=o[s];Du(0!==u),a="affine"===e.type?u>0?a.mixedAdd(i[u-1>>1]):a.mixedAdd(i[-u-1>>1].neg()):u>0?a.add(i[u-1>>1]):a.add(i[-u-1>>1].neg())}return"affine"===e.type?a.toP():a},$u.prototype._wnafMulAdd=function(e,t,r,n,i){var o,a,s,c=this._wnafT1,u=this._wnafT2,f=this._wnafT3,d=0;for(o=0;o=1;o-=2){var h=o-1,p=o;if(1===c[h]&&1===c[p]){var m=[t[h],null,null,t[p]];0===t[h].y.cmp(t[p].y)?(m[1]=t[h].add(t[p]),m[2]=t[h].toJ().mixedAdd(t[p].neg())):0===t[h].y.cmp(t[p].y.redNeg())?(m[1]=t[h].toJ().mixedAdd(t[p]),m[2]=t[h].add(t[p].neg())):(m[1]=t[h].toJ().mixedAdd(t[p]),m[2]=t[h].toJ().mixedAdd(t[p].neg()));var g=[-3,-1,-5,-7,0,7,5,1,3],y=ju(r[h],r[p]);for(d=Math.max(y[0].length,d),f[h]=new Array(d),f[p]=new Array(d),a=0;a=0;o--){for(var _=0;o>=0;){var E=!0;for(a=0;a=0&&_++,w=w.dblp(_),o<0)break;for(a=0;a0?s=u[a][S-1>>1]:S<0&&(s=u[a][-S-1>>1].neg()),w="affine"===s.type?w.mixedAdd(s):w.add(s))}}for(o=0;o=Math.ceil((e.bitLength()+1)/t.step)},Fu.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i=0&&(o=t,a=r),n.negative&&(n=n.neg(),i=i.neg()),o.negative&&(o=o.neg(),a=a.neg()),[{a:n,b:i},{a:o,b:a}]},Lu.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],i=n.b.mul(e).divRound(this.n),o=r.b.neg().mul(e).divRound(this.n),a=i.mul(r.a),s=o.mul(n.a),c=i.mul(r.b),u=o.mul(n.b);return{k1:e.sub(a).sub(s),k2:c.add(u).neg()}},Lu.prototype.pointFromX=function(e,t){(e=new so(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var i=n.fromRed().isOdd();return(t&&!i||!t&&i)&&(n=n.redNeg()),this.point(e,n)},Lu.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},Lu.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o":""},Hu.prototype.isInfinity=function(){return this.inf},Hu.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},Hu.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),a=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)},Hu.prototype.getX=function(){return this.x.fromRed()},Hu.prototype.getY=function(){return this.y.fromRed()},Hu.prototype.mul=function(e){return e=new so(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)},Hu.prototype.mulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},Hu.prototype.jmulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},Hu.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))},Hu.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,n=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return t},Hu.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},zu(Ku,Bu.BasePoint),Lu.prototype.jpoint=function(e,t,r){return new Ku(this,e,t,r)},Ku.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},Ku.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},Ku.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),i=e.x.redMul(r),o=this.y.redMul(t.redMul(e.z)),a=e.y.redMul(r.redMul(this.z)),s=n.redSub(i),c=o.redSub(a);if(0===s.cmpn(0))return 0!==c.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=s.redSqr(),f=u.redMul(s),d=n.redMul(u),l=c.redSqr().redIAdd(f).redISub(d).redISub(d),h=c.redMul(d.redISub(l)).redISub(o.redMul(f)),p=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(l,h,p)},Ku.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),i=this.y,o=e.y.redMul(t).redMul(this.z),a=r.redSub(n),s=i.redSub(o);if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=a.redSqr(),u=c.redMul(a),f=r.redMul(c),d=s.redSqr().redIAdd(u).redISub(f).redISub(f),l=s.redMul(f.redISub(d)).redISub(i.redMul(u)),h=this.z.redMul(a);return this.curve.jpoint(d,l,h)},Ku.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var r=this;for(t=0;t=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},Ku.prototype.inspect=function(){return this.isInfinity()?"":""},Ku.prototype.isInfinity=function(){return 0===this.z.cmpn(0)};var Ju=Cu((function(e,t){var r=t;r.base=Bu,r.short=qu,r.mont=null,r.edwards=null})),Wu=Cu((function(e,t){var r,n=t,i=Ou.assert;function o(e){"short"===e.type?this.curve=new Ju.short(e):"edwards"===e.type?this.curve=new Ju.edwards(e):this.curve=new Ju.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,i(this.g.validate(),"Invalid curve"),i(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function a(e,t){Object.defineProperty(n,e,{configurable:!0,enumerable:!0,get:function(){var r=new o(t);return Object.defineProperty(n,e,{configurable:!0,enumerable:!0,value:r}),r}})}n.PresetCurve=o,a("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:rr.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),a("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:rr.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),a("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:rr.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),a("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:rr.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"]}),a("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:rr.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"]}),a("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:rr.sha256,gRed:!1,g:["9"]}),a("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:rr.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{r=null.crash()}catch(e){r=void 0}a("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:rr.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})}));function Gu(e){if(!(this instanceof Gu))return new Gu(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=Nu.toArray(e.entropy,e.entropyEnc||"hex"),r=Nu.toArray(e.nonce,e.nonceEnc||"hex"),n=Nu.toArray(e.pers,e.persEnc||"hex");Iu(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}var Vu=Gu;Gu.prototype._init=function(e,t,r){var n=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},Gu.prototype.generate=function(e,t,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(n=r,r=t,t=null),r&&(r=Nu.toArray(r,n||"hex"),this._update(r));for(var i=[];i.length"};var Yu=Ou.assert;function ef(e,t){if(e instanceof ef)return e;this._importDER(e,t)||(Yu(e.r&&e.s,"Signature without r or s"),this.r=new so(e.r,16),this.s=new so(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}var tf=ef;function rf(){this.place=0}function nf(e,t){var r=e[t.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var i=0,o=0,a=t.place;o>>=0;return!(i<=127)&&(t.place=a,i)}function of(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}ef.prototype._importDER=function(e,t){e=Ou.toArray(e,t);var r=new rf;if(48!==e[r.place++])return!1;var n=nf(e,r);if(!1===n)return!1;if(n+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var i=nf(e,r);if(!1===i)return!1;var o=e.slice(r.place,i+r.place);if(r.place+=i,2!==e[r.place++])return!1;var a=nf(e,r);if(!1===a)return!1;if(e.length!==a+r.place)return!1;var s=e.slice(r.place,a+r.place);if(0===o[0]){if(!(128&o[1]))return!1;o=o.slice(1)}if(0===s[0]){if(!(128&s[1]))return!1;s=s.slice(1)}return this.r=new so(o),this.s=new so(s),this.recoveryParam=null,!0},ef.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=of(t),r=of(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];af(n,t.length),(n=n.concat(t)).push(2),af(n,r.length);var i=n.concat(r),o=[48];return af(o,i.length),o=o.concat(i),Ou.encode(o,e)};var sf=function(){throw new Error("unsupported")},cf=Ou.assert;function uf(e){if(!(this instanceof uf))return new uf(e);"string"==typeof e&&(cf(Object.prototype.hasOwnProperty.call(Wu,e),"Unknown curve "+e),e=Wu[e]),e instanceof Wu.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}var ff=uf;uf.prototype.keyPair=function(e){return new Qu(this,e)},uf.prototype.keyFromPrivate=function(e,t){return Qu.fromPrivate(this,e,t)},uf.prototype.keyFromPublic=function(e,t){return Qu.fromPublic(this,e,t)},uf.prototype.genKeyPair=function(e){e||(e={});for(var t=new Vu({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||sf(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),n=this.n.sub(new so(2));;){var i=new so(t.generate(r));if(!(i.cmp(n)>0))return i.iaddn(1),this.keyFromPrivate(i)}},uf.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},uf.prototype.sign=function(e,t,r,n){"object"==typeof r&&(n=r,r=null),n||(n={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new so(e,16));for(var i=this.n.byteLength(),o=t.getPrivate().toArray("be",i),a=e.toArray("be",i),s=new Vu({hash:this.hash,entropy:o,nonce:a,pers:n.pers,persEnc:n.persEnc||"utf8"}),c=this.n.sub(new so(1)),u=0;;u++){var f=n.k?n.k(u):new so(s.generate(this.n.byteLength()));if(!((f=this._truncateToN(f,!0)).cmpn(1)<=0||f.cmp(c)>=0)){var d=this.g.mul(f);if(!d.isInfinity()){var l=d.getX(),h=l.umod(this.n);if(0!==h.cmpn(0)){var p=f.invm(this.n).mul(h.mul(t.getPrivate()).iadd(e));if(0!==(p=p.umod(this.n)).cmpn(0)){var m=(d.getY().isOdd()?1:0)|(0!==l.cmp(h)?2:0);return n.canonical&&p.cmp(this.nh)>0&&(p=this.n.sub(p),m^=1),new tf({r:h,s:p,recoveryParam:m})}}}}}},uf.prototype.verify=function(e,t,r,n){e=this._truncateToN(new so(e,16)),r=this.keyFromPublic(r,n);var i=(t=new tf(t,"hex")).r,o=t.s;if(i.cmpn(1)<0||i.cmp(this.n)>=0)return!1;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var a,s=o.invm(this.n),c=s.mul(e).umod(this.n),u=s.mul(i).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(c,r.getPublic(),u)).isInfinity()&&a.eqXToP(i):!(a=this.g.mulAdd(c,r.getPublic(),u)).isInfinity()&&0===a.getX().umod(this.n).cmp(i)},uf.prototype.recoverPubKey=function(e,t,r,n){cf((3&r)===r,"The recovery param is more than two bits"),t=new tf(t,n);var i=this.n,o=new so(e),a=t.r,s=t.s,c=1&r,u=r>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&u)throw new Error("Unable to find sencond key candinate");a=u?this.curve.pointFromX(a.add(this.curve.n),c):this.curve.pointFromX(a,c);var f=t.r.invm(i),d=i.sub(o).mul(f).umod(i),l=s.mul(f).umod(i);return this.g.mulAdd(d,a,l)},uf.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new tf(t,n)).recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(e,t,i)}catch(e){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")};var df=Cu((function(e,t){var r=t;r.version="6.5.4",r.utils=Ou,r.rand=function(){throw new Error("unsupported")},r.curve=Ju,r.curves=Wu,r.ec=ff,r.eddsa=null})),lf=df.ec;const hf=new bo("signing-key/5.7.0");let pf=null;function mf(){return pf||(pf=new lf("secp256k1")),pf}class gf{constructor(e){pa(this,"curve","secp256k1"),pa(this,"privateKey",No(e)),32!==Oo(this.privateKey)&&hf.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const t=mf().keyFromPrivate(xo(this.privateKey));pa(this,"publicKey","0x"+t.getPublic(!1,"hex")),pa(this,"compressedPublicKey","0x"+t.getPublic(!0,"hex")),pa(this,"_isSigningKey",!0)}_addPoint(e){const t=mf().keyFromPublic(xo(this.publicKey)),r=mf().keyFromPublic(xo(e));return"0x"+t.pub.add(r.pub).encodeCompressed("hex")}signDigest(e){const t=mf().keyFromPrivate(xo(this.privateKey)),r=xo(e);32!==r.length&&hf.throwArgumentError("bad digest length","digest",e);const n=t.sign(r,{canonical:!0});return Fo({recoveryParam:n.recoveryParam,r:Bo("0x"+n.r.toString(16),32),s:Bo("0x"+n.s.toString(16),32)})}computeSharedSecret(e){const t=mf().keyFromPrivate(xo(this.privateKey)),r=mf().keyFromPublic(xo(bf(e)));return Bo("0x"+t.derive(r.getPublic()).toString(16),32)}static isSigningKey(e){return!(!e||!e._isSigningKey)}}function yf(e,t){const r=Fo(t),n={r:xo(r.r),s:xo(r.s)};return"0x"+mf().recoverPubKey(xo(e),n,r.recoveryParam).encode("hex",!1)}function bf(e,t){const r=xo(e);if(32===r.length){const e=new gf(r);return t?"0x"+mf().keyFromPrivate(r).getPublic(!0,"hex"):e.publicKey}return 33===r.length?t?No(r):"0x"+mf().keyFromPublic(r).getPublic(!1,"hex"):65===r.length?t?"0x"+mf().keyFromPublic(r).getPublic(!0,"hex"):No(r):hf.throwArgumentError("invalid public or private key","key","[REDACTED]")}var vf=Object.freeze({__proto__:null,SigningKey:gf,computePublicKey:bf,recoverPublicKey:yf});const wf=new bo("transactions/5.7.0");var Af;function _f(e){return"0x"===e?null:bs(e)}function Ef(e){return"0x"===e?Os:Go.from(e)}!function(e){e[e.legacy=0]="legacy",e[e.eip2930=1]="eip2930",e[e.eip1559=2]="eip1559"}(Af||(Af={}));const Sf=[{name:"nonce",maxLength:32,numeric:!0},{name:"gasPrice",maxLength:32,numeric:!0},{name:"gasLimit",maxLength:32,numeric:!0},{name:"to",length:20},{name:"value",maxLength:32,numeric:!0},{name:"data"}],Pf={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,type:!0,value:!0};function xf(e){return bs(To(rs(To(bf(e),1)),12))}function kf(e,t){return xf(yf(xo(e),t))}function Mf(e,t){const r=Mo(Go.from(e).toHexString());return r.length>32&&wf.throwArgumentError("invalid length for "+t,"transaction:"+t,e),r}function Cf(e,t){return{address:bs(e),storageKeys:(t||[]).map(((t,r)=>(32!==Oo(t)&&wf.throwArgumentError("invalid access list storageKey",`accessList[${e}:${r}]`,t),t.toLowerCase())))}}function If(e){if(Array.isArray(e))return e.map(((e,t)=>Array.isArray(e)?(e.length>2&&wf.throwArgumentError("access list expected to be [ address, storageKeys[] ]",`value[${t}]`,e),Cf(e[0],e[1])):Cf(e.address,e.storageKeys)));const t=Object.keys(e).map((t=>{const r=e[t].reduce(((e,t)=>(e[t]=!0,e)),{});return Cf(t,Object.keys(r).sort())}));return t.sort(((e,t)=>e.address.localeCompare(t.address))),t}function Rf(e){return If(e).map((e=>[e.address,e.storageKeys]))}function Nf(e,t){if(null!=e.gasPrice){const t=Go.from(e.gasPrice),r=Go.from(e.maxFeePerGas||0);t.eq(r)||wf.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:t,maxFeePerGas:r})}const r=[Mf(e.chainId||0,"chainId"),Mf(e.nonce||0,"nonce"),Mf(e.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),Mf(e.maxFeePerGas||0,"maxFeePerGas"),Mf(e.gasLimit||0,"gasLimit"),null!=e.to?bs(e.to):"0x",Mf(e.value||0,"value"),e.data||"0x",Rf(e.accessList||[])];if(t){const e=Fo(t);r.push(Mf(e.recoveryParam,"recoveryParam")),r.push(Mo(e.r)),r.push(Mo(e.s))}return jo(["0x02",cs(r)])}function Of(e,t){const r=[Mf(e.chainId||0,"chainId"),Mf(e.nonce||0,"nonce"),Mf(e.gasPrice||0,"gasPrice"),Mf(e.gasLimit||0,"gasLimit"),null!=e.to?bs(e.to):"0x",Mf(e.value||0,"value"),e.data||"0x",Rf(e.accessList||[])];if(t){const e=Fo(t);r.push(Mf(e.recoveryParam,"recoveryParam")),r.push(Mo(e.r)),r.push(Mo(e.s))}return jo(["0x01",cs(r)])}function Tf(e,t){if(null==e.type||0===e.type)return null!=e.accessList&&wf.throwArgumentError("untyped transactions do not support accessList; include type: 1","transaction",e),function(e,t){ya(e,Pf);const r=[];Sf.forEach((function(t){let n=e[t.name]||[];const i={};t.numeric&&(i.hexPad="left"),n=xo(No(n,i)),t.length&&n.length!==t.length&&n.length>0&&wf.throwArgumentError("invalid length for "+t.name,"transaction:"+t.name,n),t.maxLength&&(n=Mo(n),n.length>t.maxLength&&wf.throwArgumentError("invalid length for "+t.name,"transaction:"+t.name,n)),r.push(No(n))}));let n=0;if(null!=e.chainId?(n=e.chainId,"number"!=typeof n&&wf.throwArgumentError("invalid transaction.chainId","transaction",e)):t&&!Eo(t)&&t.v>28&&(n=Math.floor((t.v-35)/2)),0!==n&&(r.push(No(n)),r.push("0x"),r.push("0x")),!t)return cs(r);const i=Fo(t);let o=27+i.recoveryParam;return 0!==n?(r.pop(),r.pop(),r.pop(),o+=2*n+8,i.v>28&&i.v!==o&&wf.throwArgumentError("transaction.chainId/signature.v mismatch","signature",t)):i.v!==o&&wf.throwArgumentError("transaction.chainId/signature.v mismatch","signature",t),r.push(No(o)),r.push(Mo(xo(i.r))),r.push(Mo(xo(i.s))),cs(r)}(e,t);switch(e.type){case 1:return Of(e,t);case 2:return Nf(e,t)}return wf.throwError(`unsupported transaction type: ${e.type}`,bo.errors.UNSUPPORTED_OPERATION,{operation:"serializeTransaction",transactionType:e.type})}function jf(e,t,r){try{const r=Ef(t[0]).toNumber();if(0!==r&&1!==r)throw new Error("bad recid");e.v=r}catch(e){wf.throwArgumentError("invalid v for transaction type: 1","v",t[0])}e.r=Bo(t[1],32),e.s=Bo(t[2],32);try{const t=rs(r(e));e.from=kf(t,{r:e.r,s:e.s,recoveryParam:e.v})}catch(e){}}function Df(e){const t=xo(e);if(t[0]>127)return function(e){const t=ds(e);9!==t.length&&6!==t.length&&wf.throwArgumentError("invalid raw transaction","rawTransaction",e);const r={nonce:Ef(t[0]).toNumber(),gasPrice:Ef(t[1]),gasLimit:Ef(t[2]),to:_f(t[3]),value:Ef(t[4]),data:t[5],chainId:0};if(6===t.length)return r;try{r.v=Go.from(t[6]).toNumber()}catch(e){return r}if(r.r=Bo(t[7],32),r.s=Bo(t[8],32),Go.from(r.r).isZero()&&Go.from(r.s).isZero())r.chainId=r.v,r.v=0;else{r.chainId=Math.floor((r.v-35)/2),r.chainId<0&&(r.chainId=0);let n=r.v-27;const i=t.slice(0,6);0!==r.chainId&&(i.push(No(r.chainId)),i.push("0x"),i.push("0x"),n-=2*r.chainId+8);const o=rs(cs(i));try{r.from=kf(o,{r:No(r.r),s:No(r.s),recoveryParam:n})}catch(e){}r.hash=rs(e)}return r.type=null,r}(t);switch(t[0]){case 1:return function(e){const t=ds(e.slice(1));8!==t.length&&11!==t.length&&wf.throwArgumentError("invalid component count for transaction type: 1","payload",No(e));const r={type:1,chainId:Ef(t[0]).toNumber(),nonce:Ef(t[1]).toNumber(),gasPrice:Ef(t[2]),gasLimit:Ef(t[3]),to:_f(t[4]),value:Ef(t[5]),data:t[6],accessList:If(t[7])};return 8===t.length||(r.hash=rs(e),jf(r,t.slice(8),Of)),r}(t);case 2:return function(e){const t=ds(e.slice(1));9!==t.length&&12!==t.length&&wf.throwArgumentError("invalid component count for transaction type: 2","payload",No(e));const r=Ef(t[2]),n=Ef(t[3]),i={type:2,chainId:Ef(t[0]).toNumber(),nonce:Ef(t[1]).toNumber(),maxPriorityFeePerGas:r,maxFeePerGas:n,gasPrice:null,gasLimit:Ef(t[4]),to:_f(t[5]),value:Ef(t[6]),data:t[7],accessList:If(t[8])};return 9===t.length||(i.hash=rs(e),jf(i,t.slice(9),Nf)),i}(t)}return wf.throwError(`unsupported transaction type: ${t[0]}`,bo.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:t[0]})}var $f=Object.freeze({__proto__:null,get TransactionTypes(){return Af},accessListify:If,computeAddress:xf,parse:Df,recoverAddress:kf,serialize:Tf});var Bf=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))};const Ff=new bo("contracts/5.7.0");function zf(e,t){return Bf(this,void 0,void 0,(function*(){const r=yield t;"string"!=typeof r&&Ff.throwArgumentError("invalid address or ENS name","name",r);try{return bs(r)}catch(e){}e||Ff.throwError("a provider or signer is needed to resolve ENS names",bo.errors.UNSUPPORTED_OPERATION,{operation:"resolveName"});const n=yield e.resolveName(r);return null==n&&Ff.throwArgumentError("resolver or addr is not configured for ENS name","name",r),n}))}function Uf(e,t,r){return Bf(this,void 0,void 0,(function*(){return Array.isArray(r)?yield Promise.all(r.map(((r,n)=>Uf(e,Array.isArray(t)?t[n]:t[r.name],r)))):"address"===r.type?yield zf(e,t):"tuple"===r.type?yield Uf(e,t,r.components):"array"===r.baseType?Array.isArray(t)?yield Promise.all(t.map((t=>Uf(e,t,r.arrayChildren)))):Promise.reject(Ff.makeError("invalid value for array",bo.errors.INVALID_ARGUMENT,{argument:"value",value:t})):t}))}function Lf(e,t,r){return Bf(this,void 0,void 0,(function*(){let n={};r.length===t.inputs.length+1&&"object"==typeof r[r.length-1]&&(n=ba(r.pop())),Ff.checkArgumentCount(r.length,t.inputs.length,"passed to contract"),e.signer?n.from?n.from=ga({override:zf(e.signer,n.from),signer:e.signer.getAddress()}).then((e=>Bf(this,void 0,void 0,(function*(){return bs(e.signer)!==e.override&&Ff.throwError("Contract with a Signer cannot override from",bo.errors.UNSUPPORTED_OPERATION,{operation:"overrides.from"}),e.override})))):n.from=e.signer.getAddress():n.from&&(n.from=zf(e.provider,n.from));const i=yield ga({args:Uf(e.signer||e.provider,r,t.inputs),address:e.resolvedAddress,overrides:ga(n)||{}}),o=e.interface.encodeFunctionData(t,i.args),a={data:o,to:i.address},s=i.overrides;if(null!=s.nonce&&(a.nonce=Go.from(s.nonce).toNumber()),null!=s.gasLimit&&(a.gasLimit=Go.from(s.gasLimit)),null!=s.gasPrice&&(a.gasPrice=Go.from(s.gasPrice)),null!=s.maxFeePerGas&&(a.maxFeePerGas=Go.from(s.maxFeePerGas)),null!=s.maxPriorityFeePerGas&&(a.maxPriorityFeePerGas=Go.from(s.maxPriorityFeePerGas)),null!=s.from&&(a.from=s.from),null!=s.type&&(a.type=s.type),null!=s.accessList&&(a.accessList=If(s.accessList)),null==a.gasLimit&&null!=t.gas){let e=21e3;const r=xo(o);for(let t=0;tnull!=n[e]));return c.length&&Ff.throwError(`cannot override ${c.map((e=>JSON.stringify(e))).join(",")}`,bo.errors.UNSUPPORTED_OPERATION,{operation:"overrides",overrides:c}),a}))}function qf(e,t,r){const n=e.signer||e.provider;return function(...i){return Bf(this,void 0,void 0,(function*(){let o;if(i.length===t.inputs.length+1&&"object"==typeof i[i.length-1]){const e=ba(i.pop());null!=e.blockTag&&(o=yield e.blockTag),delete e.blockTag,i.push(e)}null!=e.deployTransaction&&(yield e._deployed(o));const a=yield Lf(e,t,i),s=yield n.call(a,o);try{let n=e.interface.decodeFunctionResult(t,s);return r&&1===t.outputs.length&&(n=n[0]),n}catch(t){throw t.code===bo.errors.CALL_EXCEPTION&&(t.address=e.address,t.args=i,t.transaction=a),t}}))}}function Hf(e,t){return function(...r){return Bf(this,void 0,void 0,(function*(){e.signer||Ff.throwError("sending a transaction requires a signer",bo.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction"}),null!=e.deployTransaction&&(yield e._deployed());const n=yield Lf(e,t,r),i=yield e.signer.sendTransaction(n);return function(e,t){const r=t.wait.bind(t);t.wait=t=>r(t).then((t=>(t.events=t.logs.map((r=>{let n=_a(r),i=null;try{i=e.interface.parseLog(r)}catch(e){}return i&&(n.args=i.args,n.decode=(t,r)=>e.interface.decodeEventLog(i.eventFragment,t,r),n.event=i.name,n.eventSignature=i.signature),n.removeListener=()=>e.provider,n.getBlock=()=>e.provider.getBlock(t.blockHash),n.getTransaction=()=>e.provider.getTransaction(t.transactionHash),n.getTransactionReceipt=()=>Promise.resolve(t),n})),t)))}(e,i),i}))}}function Kf(e,t,r){return t.constant?qf(e,t,r):Hf(e,t)}function Jf(e){return!e.address||null!=e.topics&&0!==e.topics.length?(e.address||"*")+"@"+(e.topics?e.topics.map((e=>Array.isArray(e)?e.join("|"):e)).join(":"):""):"*"}class Wf{constructor(e,t){pa(this,"tag",e),pa(this,"filter",t),this._listeners=[]}addListener(e,t){this._listeners.push({listener:e,once:t})}removeListener(e){let t=!1;this._listeners=this._listeners.filter((r=>!(!t&&r.listener===e)||(t=!0,!1)))}removeAllListeners(){this._listeners=[]}listeners(){return this._listeners.map((e=>e.listener))}listenerCount(){return this._listeners.length}run(e){const t=this.listenerCount();return this._listeners=this._listeners.filter((t=>{const r=e.slice();return setTimeout((()=>{t.listener.apply(this,r)}),0),!t.once})),t}prepareEvent(e){}getEmit(e){return[e]}}class Gf extends Wf{constructor(){super("error",null)}}class Vf extends Wf{constructor(e,t,r,n){const i={address:e};let o=t.getEventTopic(r);n?(o!==n[0]&&Ff.throwArgumentError("topic mismatch","topics",n),i.topics=n.slice()):i.topics=[o],super(Jf(i),i),pa(this,"address",e),pa(this,"interface",t),pa(this,"fragment",r)}prepareEvent(e){super.prepareEvent(e),e.event=this.fragment.name,e.eventSignature=this.fragment.format(),e.decode=(e,t)=>this.interface.decodeEventLog(this.fragment,e,t);try{e.args=this.interface.decodeEventLog(this.fragment,e.data,e.topics)}catch(t){e.args=null,e.decodeError=t}}getEmit(e){const t=Za(e.args);if(t.length)throw t[0].error;const r=(e.args||[]).slice();return r.push(e),r}}class Zf extends Wf{constructor(e,t){super("*",{address:e}),pa(this,"address",e),pa(this,"interface",t)}prepareEvent(e){super.prepareEvent(e);try{const t=this.interface.parseLog(e);e.event=t.name,e.eventSignature=t.signature,e.decode=(e,r)=>this.interface.decodeEventLog(t.eventFragment,e,r),e.args=t.args}catch(e){}}}class Xf{constructor(e,t,r){pa(this,"interface",ma(new.target,"getInterface")(t)),null==r?(pa(this,"provider",null),pa(this,"signer",null)):ku.isSigner(r)?(pa(this,"provider",r.provider||null),pa(this,"signer",r)):_u.isProvider(r)?(pa(this,"provider",r),pa(this,"signer",null)):Ff.throwArgumentError("invalid signer or provider","signerOrProvider",r),pa(this,"callStatic",{}),pa(this,"estimateGas",{}),pa(this,"functions",{}),pa(this,"populateTransaction",{}),pa(this,"filters",{});{const e={};Object.keys(this.interface.events).forEach((t=>{const r=this.interface.events[t];pa(this.filters,t,((...e)=>({address:this.address,topics:this.interface.encodeFilterTopics(r,e)}))),e[r.name]||(e[r.name]=[]),e[r.name].push(t)})),Object.keys(e).forEach((t=>{const r=e[t];1===r.length?pa(this.filters,t,this.filters[r[0]]):Ff.warn(`Duplicate definition of ${t} (${r.join(", ")})`)}))}if(pa(this,"_runningEvents",{}),pa(this,"_wrappedEmits",{}),null==e&&Ff.throwArgumentError("invalid contract address or ENS name","addressOrName",e),pa(this,"address",e),this.provider)pa(this,"resolvedAddress",zf(this.provider,e));else try{pa(this,"resolvedAddress",Promise.resolve(bs(e)))}catch(e){Ff.throwError("provider is required to use ENS name as contract address",bo.errors.UNSUPPORTED_OPERATION,{operation:"new Contract"})}this.resolvedAddress.catch((e=>{}));const n={},i={};Object.keys(this.interface.functions).forEach((e=>{const t=this.interface.functions[e];if(i[e])Ff.warn(`Duplicate ABI entry for ${JSON.stringify(e)}`);else{i[e]=!0;{const r=t.name;n[`%${r}`]||(n[`%${r}`]=[]),n[`%${r}`].push(e)}null==this[e]&&pa(this,e,Kf(this,t,!0)),null==this.functions[e]&&pa(this.functions,e,Kf(this,t,!1)),null==this.callStatic[e]&&pa(this.callStatic,e,qf(this,t,!0)),null==this.populateTransaction[e]&&pa(this.populateTransaction,e,function(e,t){return function(...r){return Lf(e,t,r)}}(this,t)),null==this.estimateGas[e]&&pa(this.estimateGas,e,function(e,t){const r=e.signer||e.provider;return function(...n){return Bf(this,void 0,void 0,(function*(){r||Ff.throwError("estimate require a provider or signer",bo.errors.UNSUPPORTED_OPERATION,{operation:"estimateGas"});const i=yield Lf(e,t,n);return yield r.estimateGas(i)}))}}(this,t))}})),Object.keys(n).forEach((e=>{const t=n[e];if(t.length>1)return;e=e.substring(1);const r=t[0];try{null==this[e]&&pa(this,e,this[r])}catch(e){}null==this.functions[e]&&pa(this.functions,e,this.functions[r]),null==this.callStatic[e]&&pa(this.callStatic,e,this.callStatic[r]),null==this.populateTransaction[e]&&pa(this.populateTransaction,e,this.populateTransaction[r]),null==this.estimateGas[e]&&pa(this.estimateGas,e,this.estimateGas[r])}))}static getContractAddress(e){return vs(e)}static getInterface(e){return yu.isInterface(e)?e:new yu(e)}deployed(){return this._deployed()}_deployed(e){return this._deployedPromise||(this.deployTransaction?this._deployedPromise=this.deployTransaction.wait().then((()=>this)):this._deployedPromise=this.provider.getCode(this.address,e).then((e=>("0x"===e&&Ff.throwError("contract not deployed",bo.errors.UNSUPPORTED_OPERATION,{contractAddress:this.address,operation:"getDeployed"}),this)))),this._deployedPromise}fallback(e){this.signer||Ff.throwError("sending a transactions require a signer",bo.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction(fallback)"});const t=ba(e||{});return["from","to"].forEach((function(e){null!=t[e]&&Ff.throwError("cannot override "+e,bo.errors.UNSUPPORTED_OPERATION,{operation:e})})),t.to=this.resolvedAddress,this.deployed().then((()=>this.signer.sendTransaction(t)))}connect(e){"string"==typeof e&&(e=new Mu(e,this.provider));const t=new this.constructor(this.address,this.interface,e);return this.deployTransaction&&pa(t,"deployTransaction",this.deployTransaction),t}attach(e){return new this.constructor(e,this.interface,this.signer||this.provider)}static isIndexed(e){return pu.isIndexed(e)}_normalizeRunningEvent(e){return this._runningEvents[e.tag]?this._runningEvents[e.tag]:e}_getRunningEvent(e){if("string"==typeof e){if("error"===e)return this._normalizeRunningEvent(new Gf);if("event"===e)return this._normalizeRunningEvent(new Wf("event",null));if("*"===e)return this._normalizeRunningEvent(new Zf(this.address,this.interface));const t=this.interface.getEvent(e);return this._normalizeRunningEvent(new Vf(this.address,this.interface,t))}if(e.topics&&e.topics.length>0){try{const t=e.topics[0];if("string"!=typeof t)throw new Error("invalid topic");const r=this.interface.getEvent(t);return this._normalizeRunningEvent(new Vf(this.address,this.interface,r,e.topics))}catch(e){}const t={address:this.address,topics:e.topics};return this._normalizeRunningEvent(new Wf(Jf(t),t))}return this._normalizeRunningEvent(new Zf(this.address,this.interface))}_checkRunningEvents(e){if(0===e.listenerCount()){delete this._runningEvents[e.tag];const t=this._wrappedEmits[e.tag];t&&e.filter&&(this.provider.off(e.filter,t),delete this._wrappedEmits[e.tag])}}_wrapEvent(e,t,r){const n=_a(t);return n.removeListener=()=>{r&&(e.removeListener(r),this._checkRunningEvents(e))},n.getBlock=()=>this.provider.getBlock(t.blockHash),n.getTransaction=()=>this.provider.getTransaction(t.transactionHash),n.getTransactionReceipt=()=>this.provider.getTransactionReceipt(t.transactionHash),e.prepareEvent(n),n}_addEventListener(e,t,r){if(this.provider||Ff.throwError("events require a provider or a signer with a provider",bo.errors.UNSUPPORTED_OPERATION,{operation:"once"}),e.addListener(t,r),this._runningEvents[e.tag]=e,!this._wrappedEmits[e.tag]){const r=r=>{let n=this._wrapEvent(e,r,t);if(null==n.decodeError)try{const t=e.getEmit(n);this.emit(e.filter,...t)}catch(e){n.decodeError=e.error}null!=e.filter&&this.emit("event",n),null!=n.decodeError&&this.emit("error",n.decodeError,n)};this._wrappedEmits[e.tag]=r,null!=e.filter&&this.provider.on(e.filter,r)}}queryFilter(e,t,r){const n=this._getRunningEvent(e),i=ba(n.filter);return"string"==typeof t&&Io(t,32)?(null!=r&&Ff.throwArgumentError("cannot specify toBlock with blockhash","toBlock",r),i.blockHash=t):(i.fromBlock=null!=t?t:0,i.toBlock=null!=r?r:"latest"),this.provider.getLogs(i).then((e=>e.map((e=>this._wrapEvent(n,e,null)))))}on(e,t){return this._addEventListener(this._getRunningEvent(e),t,!1),this}once(e,t){return this._addEventListener(this._getRunningEvent(e),t,!0),this}emit(e,...t){if(!this.provider)return!1;const r=this._getRunningEvent(e),n=r.run(t)>0;return this._checkRunningEvents(r),n}listenerCount(e){return this.provider?null==e?Object.keys(this._runningEvents).reduce(((e,t)=>e+this._runningEvents[t].listenerCount()),0):this._getRunningEvent(e).listenerCount():0}listeners(e){if(!this.provider)return[];if(null==e){const e=[];for(let t in this._runningEvents)this._runningEvents[t].listeners().forEach((t=>{e.push(t)}));return e}return this._getRunningEvent(e).listeners()}removeAllListeners(e){if(!this.provider)return this;if(null==e){for(const e in this._runningEvents){const t=this._runningEvents[e];t.removeAllListeners(),this._checkRunningEvents(t)}return this}const t=this._getRunningEvent(e);return t.removeAllListeners(),this._checkRunningEvents(t),this}off(e,t){if(!this.provider)return this;const r=this._getRunningEvent(e);return r.removeListener(t),this._checkRunningEvents(r),this}removeListener(e,t){return this.off(e,t)}}class Qf extends Xf{}class Yf{constructor(e){pa(this,"alphabet",e),pa(this,"base",e.length),pa(this,"_alphabetMap",{}),pa(this,"_leader",e.charAt(0));for(let t=0;t0;)r.push(n%this.base),n=n/this.base|0}let n="";for(let e=0;0===t[e]&&e=0;--e)n+=this.alphabet[r[e]];return n}decode(e){if("string"!=typeof e)throw new TypeError("Expected String");let t=[];if(0===e.length)return new Uint8Array(t);t.push(0);for(let r=0;r>=8;for(;i>0;)t.push(255&i),i>>=8}for(let r=0;e[r]===this._leader&&r>24&255,c[t.length+1]=d>>16&255,c[t.length+2]=d>>8&255,c[t.length+3]=255&d;let l=xo(sd(i,e,c));o||(o=l.length,f=new Uint8Array(o),a=Math.ceil(n/o),u=n-(a-1)*o),f.set(l);for(let t=1;t=256)throw new Error("Depth too large!");return _d(ko([null!=this.privateKey?"0x0488ADE4":"0x0488B21E",No(this.depth),this.parentFingerprint,Bo(No(this.index),4),this.chainCode,null!=this.privateKey?ko(["0x00",this.privateKey]):this.publicKey]))}neuter(){return new xd(Sd,null,this.publicKey,this.parentFingerprint,this.chainCode,this.index,this.depth,this.path)}_derive(e){if(e>4294967295)throw new Error("invalid index - "+String(e));let t=this.path;t&&(t+="/"+(2147483647&e));const r=new Uint8Array(37);if(e&vd){if(!this.privateKey)throw new Error("cannot derive child of neutered node");r.set(xo(this.privateKey),1),t&&(t+="'")}else r.set(xo(this.publicKey));for(let t=24;t>=0;t-=8)r[33+(t>>3)]=e>>24-t&255;const n=xo(sd(rd.sha512,this.chainCode,r)),i=n.slice(0,32),o=n.slice(32);let a=null,s=null;if(this.privateKey)a=Ad(Go.from(i).add(this.privateKey).mod(yd));else{s=new gf(No(i))._addPoint(this.publicKey)}let c=t;const u=this.mnemonic;return u&&(c=Object.freeze({phrase:u.phrase,path:t,locale:u.locale||"en"})),new xd(Sd,a,s,this.fingerprint,Ad(o),e,this.depth+1,c)}derivePath(e){const t=e.split("/");if(0===t.length||"m"===t[0]&&0!==this.depth)throw new Error("invalid path - "+e);"m"===t[0]&&t.shift();let r=this;for(let e=0;e=vd)throw new Error("invalid path index - "+n);r=r._derive(vd+e)}else{if(!n.match(/^[0-9]+$/))throw new Error("invalid path component - "+n);{const e=parseInt(n);if(e>=vd)throw new Error("invalid path index - "+n);r=r._derive(e)}}}return r}static _fromSeed(e,t){const r=xo(e);if(r.length<16||r.length>64)throw new Error("invalid seed");const n=xo(sd(rd.sha512,bd,r));return new xd(Sd,Ad(n.slice(0,32)),null,"0x00000000",Ad(n.slice(32)),0,0,t)}static fromMnemonic(e,t,r){return e=Cd(Md(e,r=Ed(r)),r),xd._fromSeed(kd(e,t),{phrase:e,path:"m",locale:r.locale})}static fromSeed(e){return xd._fromSeed(e,null)}static fromExtendedKey(e){const t=td.decode(e);82===t.length&&_d(t.slice(0,78))===e||gd.throwArgumentError("invalid extended key","extendedKey","[REDACTED]");const r=t[4],n=No(t.slice(5,9)),i=parseInt(No(t.slice(9,13)).substring(2),16),o=No(t.slice(13,45)),a=t.slice(45,78);switch(No(t.slice(0,4))){case"0x0488b21e":case"0x043587cf":return new xd(Sd,null,No(a),n,o,i,r,null);case"0x0488ade4":case"0x04358394 ":if(0!==a[0])break;return new xd(Sd,No(a.slice(1)),null,n,o,i,r,null)}return gd.throwArgumentError("invalid extended key","extendedKey","[REDACTED]")}}function kd(e,t){t||(t="");const r=Hs("mnemonic"+t,Fs.NFKD);return ud(Hs(e,Fs.NFKD),r,2048,64,"sha512")}function Md(e,t){t=Ed(t),gd.checkNormalize();const r=t.split(e);if(r.length%3!=0)throw new Error("invalid mnemonic");const n=xo(new Uint8Array(Math.ceil(11*r.length/8)));let i=0;for(let e=0;e>3]|=1<<7-i%8),i++}const o=32*r.length/3,a=wd(r.length/3);if((xo(ad(n.slice(0,o/8)))[0]&a)!==(n[n.length-1]&a))throw new Error("invalid checksum");return No(n.slice(0,o/8))}function Cd(e,t){if(t=Ed(t),(e=xo(e)).length%4!=0||e.length<16||e.length>32)throw new Error("invalid entropy");const r=[0];let n=11;for(let t=0;t8?(r[r.length-1]<<=8,r[r.length-1]|=e[t],n-=8):(r[r.length-1]<<=n,r[r.length-1]|=e[t]>>8-n,r.push(e[t]&(1<<8-n)-1),n+=3);const i=e.length/4,o=xo(ad(e))[0]&wd(i);return r[r.length-1]<<=i,r[r.length-1]|=o>>8-i,t.join(r.map((e=>t.getWord(e))))}var Id=Object.freeze({__proto__:null,HDNode:xd,defaultPath:Pd,entropyToMnemonic:Cd,getAccountPath:function(e){return("number"!=typeof e||e<0||e>=vd||e%1)&&gd.throwArgumentError("invalid account index","index",e),`m/44'/60'/${e}'/0/0`},isValidMnemonic:function(e,t){try{return Md(e,t),!0}catch(e){}return!1},mnemonicToEntropy:Md,mnemonicToSeed:kd});const Rd=new bo("random/5.7.0");const Nd=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")}();let Od=Nd.crypto||Nd.msCrypto;function Td(e){(e<=0||e>1024||e%1||e!=e)&&Rd.throwArgumentError("invalid length","length",e);const t=new Uint8Array(e);return Od.getRandomValues(t),xo(t)}Od&&Od.getRandomValues||(Rd.warn("WARNING: Missing strong random number source"),Od={getRandomValues:function(e){return Rd.throwError("no secure random source avaialble",bo.errors.UNSUPPORTED_OPERATION,{operation:"crypto.getRandomValues"})}});var jd=Object.freeze({__proto__:null,randomBytes:Td,shuffled:function(e){for(let t=(e=e.slice()).length-1;t>0;t--){const r=Math.floor(Math.random()*(t+1)),n=e[t];e[t]=e[r],e[r]=n}return e}}),Dd={exports:{}};!function(e,t){!function(t){function r(e){return parseInt(e)===e}function n(e){if(!r(e.length))return!1;for(var t=0;t255)return!1;return!0}function i(e,t){if(e.buffer&&ArrayBuffer.isView(e)&&"Uint8Array"===e.name)return t&&(e=e.slice?e.slice():Array.prototype.slice.call(e)),e;if(Array.isArray(e)){if(!n(e))throw new Error("Array contains invalid value: "+e);return new Uint8Array(e)}if(r(e.length)&&n(e))return new Uint8Array(e);throw new Error("unsupported array-like object")}function o(e){return new Uint8Array(e)}function a(e,t,r,n,i){null==n&&null==i||(e=e.slice?e.slice(n,i):Array.prototype.slice.call(e,n,i)),t.set(e,r)}var s,c={toBytes:function(e){var t=[],r=0;for(e=encodeURI(e);r191&&n<224?(t.push(String.fromCharCode((31&n)<<6|63&e[r+1])),r+=2):(t.push(String.fromCharCode((15&n)<<12|(63&e[r+1])<<6|63&e[r+2])),r+=3)}return t.join("")}},u=(s="0123456789abcdef",{toBytes:function(e){for(var t=[],r=0;r>4]+s[15&n])}return t.join("")}}),f={16:10,24:12,32:14},d=[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],l=[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],h=[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],p=[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],m=[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],g=[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],y=[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],b=[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],v=[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],w=[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],A=[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],_=[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],E=[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],S=[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],P=[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 x(e){for(var t=[],r=0;r>2,this._Ke[r][t%4]=o[t],this._Kd[e-r][t%4]=o[t];for(var a,s=0,c=i;c>16&255]<<24^l[a>>8&255]<<16^l[255&a]<<8^l[a>>24&255]^d[s]<<24,s+=1,8!=i)for(t=1;t>8&255]<<8^l[a>>16&255]<<16^l[a>>24&255]<<24;for(t=i/2+1;t>2,h=c%4,this._Ke[u][h]=o[t],this._Kd[e-u][h]=o[t++],c++}for(var u=1;u>24&255]^E[a>>16&255]^S[a>>8&255]^P[255&a]},k.prototype.encrypt=function(e){if(16!=e.length)throw new Error("invalid plaintext size (must be 16 bytes)");for(var t=this._Ke.length-1,r=[0,0,0,0],n=x(e),i=0;i<4;i++)n[i]^=this._Ke[0][i];for(var a=1;a>24&255]^m[n[(i+1)%4]>>16&255]^g[n[(i+2)%4]>>8&255]^y[255&n[(i+3)%4]]^this._Ke[a][i];n=r.slice()}var s,c=o(16);for(i=0;i<4;i++)s=this._Ke[t][i],c[4*i]=255&(l[n[i]>>24&255]^s>>24),c[4*i+1]=255&(l[n[(i+1)%4]>>16&255]^s>>16),c[4*i+2]=255&(l[n[(i+2)%4]>>8&255]^s>>8),c[4*i+3]=255&(l[255&n[(i+3)%4]]^s);return c},k.prototype.decrypt=function(e){if(16!=e.length)throw new Error("invalid ciphertext size (must be 16 bytes)");for(var t=this._Kd.length-1,r=[0,0,0,0],n=x(e),i=0;i<4;i++)n[i]^=this._Kd[0][i];for(var a=1;a>24&255]^v[n[(i+3)%4]>>16&255]^w[n[(i+2)%4]>>8&255]^A[255&n[(i+1)%4]]^this._Kd[a][i];n=r.slice()}var s,c=o(16);for(i=0;i<4;i++)s=this._Kd[t][i],c[4*i]=255&(h[n[i]>>24&255]^s>>24),c[4*i+1]=255&(h[n[(i+3)%4]>>16&255]^s>>16),c[4*i+2]=255&(h[n[(i+2)%4]>>8&255]^s>>8),c[4*i+3]=255&(h[255&n[(i+1)%4]]^s);return c};var M=function(e){if(!(this instanceof M))throw Error("AES must be instanitated with `new`");this.description="Electronic Code Block",this.name="ecb",this._aes=new k(e)};M.prototype.encrypt=function(e){if((e=i(e)).length%16!=0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var t=o(e.length),r=o(16),n=0;n=0;--t)this._counter[t]=e%256,e>>=8},N.prototype.setBytes=function(e){if(16!=(e=i(e,!0)).length)throw new Error("invalid counter bytes size (must be 16 bytes)");this._counter=e},N.prototype.increment=function(){for(var e=15;e>=0;e--){if(255!==this._counter[e]){this._counter[e]++;break}this._counter[e]=0}};var O=function(e,t){if(!(this instanceof O))throw Error("AES must be instanitated with `new`");this.description="Counter",this.name="ctr",t instanceof N||(t=new N(t)),this._counter=t,this._remainingCounter=null,this._remainingCounterIndex=16,this._aes=new k(e)};O.prototype.encrypt=function(e){for(var t=i(e,!0),r=0;r16)throw new Error("PKCS#7 padding byte out of range");for(var r=e.length-t,n=0;n=64;){let h,p,m,g,y,b=r,v=n,w=i,A=o,_=a,E=s,S=c,P=u;for(p=0;p<16;p++)m=d+4*p,f[p]=(255&e[m])<<24|(255&e[m+1])<<16|(255&e[m+2])<<8|255&e[m+3];for(p=16;p<64;p++)h=f[p-2],g=(h>>>17|h<<15)^(h>>>19|h<<13)^h>>>10,h=f[p-15],y=(h>>>7|h<<25)^(h>>>18|h<<14)^h>>>3,f[p]=(g+f[p-7]|0)+(y+f[p-16]|0)|0;for(p=0;p<64;p++)g=(((_>>>6|_<<26)^(_>>>11|_<<21)^(_>>>25|_<<7))+(_&E^~_&S)|0)+(P+(t[p]+f[p]|0)|0)|0,y=((b>>>2|b<<30)^(b>>>13|b<<19)^(b>>>22|b<<10))+(b&v^b&w^v&w)|0,P=S,S=E,E=_,_=A+g|0,A=w,w=v,v=b,b=g+y|0;r=r+b|0,n=n+v|0,i=i+w|0,o=o+A|0,a=a+_|0,s=s+E|0,c=c+S|0,u=u+P|0,d+=64,l-=64}}d(e);let l,h=e.length%64,p=e.length/536870912|0,m=e.length<<3,g=h<56?56:120,y=e.slice(e.length-h,e.length);for(y.push(128),l=h+1;l>>24&255),y.push(p>>>16&255),y.push(p>>>8&255),y.push(p>>>0&255),y.push(m>>>24&255),y.push(m>>>16&255),y.push(m>>>8&255),y.push(m>>>0&255),d(y),[r>>>24&255,r>>>16&255,r>>>8&255,r>>>0&255,n>>>24&255,n>>>16&255,n>>>8&255,n>>>0&255,i>>>24&255,i>>>16&255,i>>>8&255,i>>>0&255,o>>>24&255,o>>>16&255,o>>>8&255,o>>>0&255,a>>>24&255,a>>>16&255,a>>>8&255,a>>>0&255,s>>>24&255,s>>>16&255,s>>>8&255,s>>>0&255,c>>>24&255,c>>>16&255,c>>>8&255,c>>>0&255,u>>>24&255,u>>>16&255,u>>>8&255,u>>>0&255]}function i(e,t,r){e=e.length<=64?e:n(e);const i=64+t.length+4,o=new Array(i),a=new Array(64);let s,c=[];for(s=0;s<64;s++)o[s]=54;for(s=0;s=i-4;e--){if(o[e]++,o[e]<=255)return;o[e]=0}}for(;r>=32;)u(),c=c.concat(n(a.concat(n(o)))),r-=32;return r>0&&(u(),c=c.concat(n(a.concat(n(o))).slice(0,r))),c}function o(e,t,r,n,i){let o;for(u(e,16*(2*r-1),i,0,16),o=0;o<2*r;o++)c(e,16*o,i,16),s(i,n),u(i,0,e,t+16*o,16);for(o=0;o>>32-t}function s(e,t){u(e,0,t,0,16);for(let e=8;e>0;e-=2)t[4]^=a(t[0]+t[12],7),t[8]^=a(t[4]+t[0],9),t[12]^=a(t[8]+t[4],13),t[0]^=a(t[12]+t[8],18),t[9]^=a(t[5]+t[1],7),t[13]^=a(t[9]+t[5],9),t[1]^=a(t[13]+t[9],13),t[5]^=a(t[1]+t[13],18),t[14]^=a(t[10]+t[6],7),t[2]^=a(t[14]+t[10],9),t[6]^=a(t[2]+t[14],13),t[10]^=a(t[6]+t[2],18),t[3]^=a(t[15]+t[11],7),t[7]^=a(t[3]+t[15],9),t[11]^=a(t[7]+t[3],13),t[15]^=a(t[11]+t[7],18),t[1]^=a(t[0]+t[3],7),t[2]^=a(t[1]+t[0],9),t[3]^=a(t[2]+t[1],13),t[0]^=a(t[3]+t[2],18),t[6]^=a(t[5]+t[4],7),t[7]^=a(t[6]+t[5],9),t[4]^=a(t[7]+t[6],13),t[5]^=a(t[4]+t[7],18),t[11]^=a(t[10]+t[9],7),t[8]^=a(t[11]+t[10],9),t[9]^=a(t[8]+t[11],13),t[10]^=a(t[9]+t[8],18),t[12]^=a(t[15]+t[14],7),t[13]^=a(t[12]+t[15],9),t[14]^=a(t[13]+t[12],13),t[15]^=a(t[14]+t[13],18);for(let r=0;r<16;++r)e[r]+=t[r]}function c(e,t,r,n){for(let i=0;i=256)return!1}return!0}function d(e,t){if("number"!=typeof e||e%1)throw new Error("invalid "+t);return e}function l(e,t,n,a,s,l,h){if(n=d(n,"N"),a=d(a,"r"),s=d(s,"p"),l=d(l,"dkLen"),0===n||0!=(n&n-1))throw new Error("N must be power of 2");if(n>r/128/a)throw new Error("N too large");if(a>r/128/s)throw new Error("r too large");if(!f(e))throw new Error("password must be an array or buffer");if(e=Array.prototype.slice.call(e),!f(t))throw new Error("salt must be an array or buffer");t=Array.prototype.slice.call(t);let p=i(e,t,128*s*a);const m=new Uint32Array(32*s*a);for(let e=0;eC&&(t=C);for(let e=0;eC&&(t=C);for(let e=0;e>0&255),p.push(m[e]>>8&255),p.push(m[e]>>16&255),p.push(m[e]>>24&255);const r=i(e,p,l);return h&&h(null,1,r),r}h&&I(R)};if(!h)for(;;){const e=R();if(null!=e)return e}R()}const h={scrypt:function(e,t,r,n,i,o,a){return new Promise((function(s,c){let u=0;a&&a(0),l(e,t,r,n,i,o,(function(e,t,r){if(e)c(e);else if(r)a&&1!==u&&a(1),s(new Uint8Array(r));else if(a&&t!==u)return u=t,a(t)}))}))},syncScrypt:function(e,t,r,n,i,o){return new Uint8Array(l(e,t,r,n,i,o))}};e.exports=h}()}(Vd);var Zd=c(Vd.exports),Xd=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))};const Qd=new bo(Bd);function Yd(e){return null!=e&&e.mnemonic&&e.mnemonic.phrase}class el extends Ea{isKeystoreAccount(e){return!(!e||!e._isKeystoreAccount)}}function tl(e,t){const r=Fd(Ld(e,"crypto/ciphertext"));if(No(rs(ko([t.slice(16,32),r]))).substring(2)!==Ld(e,"crypto/mac").toLowerCase())throw new Error("invalid password");const n=function(e,t,r){if("aes-128-ctr"===Ld(e,"crypto/cipher")){const n=Fd(Ld(e,"crypto/cipherparams/iv")),i=new $d.Counter(n);return xo(new $d.ModeOfOperation.ctr(t,i).decrypt(r))}return null}(e,t.slice(0,16),r);n||Qd.throwError("unsupported cipher",bo.errors.UNSUPPORTED_OPERATION,{operation:"decrypt"});const i=t.slice(32,64),o=xf(n);if(e.address){let t=e.address.toLowerCase();if("0x"!==t.substring(0,2)&&(t="0x"+t),bs(t)!==o)throw new Error("address mismatch")}const a={_isKeystoreAccount:!0,address:o,privateKey:No(n)};if("0.1"===Ld(e,"x-ethers/version")){const t=Fd(Ld(e,"x-ethers/mnemonicCiphertext")),r=Fd(Ld(e,"x-ethers/mnemonicCounter")),n=new $d.Counter(r),o=new $d.ModeOfOperation.ctr(i,n),s=Ld(e,"x-ethers/path")||Pd,c=Ld(e,"x-ethers/locale")||"en",u=xo(o.decrypt(t));try{const e=Cd(u,c),t=xd.fromMnemonic(e,null,c).derivePath(s);if(t.privateKey!=a.privateKey)throw new Error("mnemonic mismatch");a.mnemonic=t.mnemonic}catch(e){if(e.code!==bo.errors.INVALID_ARGUMENT||"wordlist"!==e.argument)throw e}}return new el(a)}function rl(e,t,r,n,i){return xo(ud(e,t,r,n,i))}function nl(e,t,r,n,i){return Promise.resolve(rl(e,t,r,n,i))}function il(e,t,r,n,i){const o=Ud(t),a=Ld(e,"crypto/kdf");if(a&&"string"==typeof a){const t=function(e,t){return Qd.throwArgumentError("invalid key-derivation function parameters",e,t)};if("scrypt"===a.toLowerCase()){const r=Fd(Ld(e,"crypto/kdfparams/salt")),s=parseInt(Ld(e,"crypto/kdfparams/n")),c=parseInt(Ld(e,"crypto/kdfparams/r")),u=parseInt(Ld(e,"crypto/kdfparams/p"));s&&c&&u||t("kdf",a),0!=(s&s-1)&&t("N",s);const f=parseInt(Ld(e,"crypto/kdfparams/dklen"));return 32!==f&&t("dklen",f),n(o,r,s,c,u,64,i)}if("pbkdf2"===a.toLowerCase()){const n=Fd(Ld(e,"crypto/kdfparams/salt"));let i=null;const a=Ld(e,"crypto/kdfparams/prf");"hmac-sha256"===a?i="sha256":"hmac-sha512"===a?i="sha512":t("prf",a);const s=parseInt(Ld(e,"crypto/kdfparams/c")),c=parseInt(Ld(e,"crypto/kdfparams/dklen"));return 32!==c&&t("dklen",c),r(o,n,s,c,i)}}return Qd.throwArgumentError("unsupported key-derivation function","kdf",a)}function ol(e,t){const r=JSON.parse(e);return tl(r,il(r,t,rl,Zd.syncScrypt))}function al(e,t,r){return Xd(this,void 0,void 0,(function*(){const n=JSON.parse(e);return tl(n,yield il(n,t,nl,Zd.scrypt,r))}))}function sl(e,t,r,n){try{if(bs(e.address)!==xf(e.privateKey))throw new Error("address/privateKey mismatch");if(Yd(e)){const t=e.mnemonic;if(xd.fromMnemonic(t.phrase,null,t.locale).derivePath(t.path||Pd).privateKey!=e.privateKey)throw new Error("mnemonic mismatch")}}catch(e){return Promise.reject(e)}"function"!=typeof r||n||(n=r,r={}),r||(r={});const i=xo(e.privateKey),o=Ud(t);let a=null,s=null,c=null;if(Yd(e)){const t=e.mnemonic;a=xo(Md(t.phrase,t.locale||"en")),s=t.path||Pd,c=t.locale||"en"}let u=r.client;u||(u="ethers.js");let f=null;f=r.salt?xo(r.salt):Td(32);let d=null;if(r.iv){if(d=xo(r.iv),16!==d.length)throw new Error("invalid iv")}else d=Td(16);let l=null;if(r.uuid){if(l=xo(r.uuid),16!==l.length)throw new Error("invalid uuid")}else l=Td(16);let h=1<<17,p=8,m=1;return r.scrypt&&(r.scrypt.N&&(h=r.scrypt.N),r.scrypt.r&&(p=r.scrypt.r),r.scrypt.p&&(m=r.scrypt.p)),Zd.scrypt(o,f,h,p,m,64,n).then((t=>{const r=(t=xo(t)).slice(0,16),n=t.slice(16,32),o=t.slice(32,64),g=new $d.Counter(d),y=xo(new $d.ModeOfOperation.ctr(r,g).encrypt(i)),b=rs(ko([n,y])),v={address:e.address.substring(2).toLowerCase(),id:qd(l),version:3,crypto:{cipher:"aes-128-ctr",cipherparams:{iv:No(d).substring(2)},ciphertext:No(y).substring(2),kdf:"scrypt",kdfparams:{salt:No(f).substring(2),n:h,dklen:32,p:m,r:p},mac:b.substring(2)}};if(a){const e=Td(16),t=new $d.Counter(e),r=xo(new $d.ModeOfOperation.ctr(o,t).encrypt(a)),n=new Date,i=n.getUTCFullYear()+"-"+zd(n.getUTCMonth()+1,2)+"-"+zd(n.getUTCDate(),2)+"T"+zd(n.getUTCHours(),2)+"-"+zd(n.getUTCMinutes(),2)+"-"+zd(n.getUTCSeconds(),2)+".0Z";v["x-ethers"]={client:u,gethFilename:"UTC--"+i+"--"+v.address,mnemonicCounter:No(e).substring(2),mnemonicCiphertext:No(r).substring(2),path:s,locale:c,version:"0.1"}}return JSON.stringify(v)}))}function cl(e,t,r){if(Wd(e)){r&&r(0);const n=Jd(e,t);return r&&r(1),Promise.resolve(n)}return Gd(e)?al(e,t,r):Promise.reject(new Error("invalid JSON wallet"))}function ul(e,t){if(Wd(e))return Jd(e,t);if(Gd(e))return ol(e,t);throw new Error("invalid JSON wallet")}var fl=Object.freeze({__proto__:null,decryptCrowdsale:Jd,decryptJsonWallet:cl,decryptJsonWalletSync:ul,decryptKeystore:al,decryptKeystoreSync:ol,encryptKeystore:sl,getJsonWalletAddress:function(e){if(Wd(e))try{return bs(JSON.parse(e).ethaddr)}catch(e){return null}if(Gd(e))try{return bs(JSON.parse(e).address)}catch(e){return null}return null},isCrowdsaleWallet:Wd,isKeystoreWallet:Gd});var dl=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))};const ll=new bo("wallet/5.7.0");class hl extends ku{constructor(e,t){if(super(),null!=(r=e)&&Io(r.privateKey,32)&&null!=r.address){const t=new gf(e.privateKey);if(pa(this,"_signingKey",(()=>t)),pa(this,"address",xf(this.publicKey)),this.address!==bs(e.address)&&ll.throwArgumentError("privateKey/address mismatch","privateKey","[REDACTED]"),function(e){const t=e.mnemonic;return t&&t.phrase}(e)){const t=e.mnemonic;pa(this,"_mnemonic",(()=>({phrase:t.phrase,path:t.path||Pd,locale:t.locale||"en"})));const r=this.mnemonic;xf(xd.fromMnemonic(r.phrase,null,r.locale).derivePath(r.path).privateKey)!==this.address&&ll.throwArgumentError("mnemonic/address mismatch","privateKey","[REDACTED]")}else pa(this,"_mnemonic",(()=>null))}else{if(gf.isSigningKey(e))"secp256k1"!==e.curve&&ll.throwArgumentError("unsupported curve; must be secp256k1","privateKey","[REDACTED]"),pa(this,"_signingKey",(()=>e));else{"string"==typeof e&&e.match(/^[0-9a-f]*$/i)&&64===e.length&&(e="0x"+e);const t=new gf(e);pa(this,"_signingKey",(()=>t))}pa(this,"_mnemonic",(()=>null)),pa(this,"address",xf(this.publicKey))}var r;t&&!_u.isProvider(t)&&ll.throwArgumentError("invalid provider","provider",t),pa(this,"provider",t||null)}get mnemonic(){return this._mnemonic()}get privateKey(){return this._signingKey().privateKey}get publicKey(){return this._signingKey().publicKey}getAddress(){return Promise.resolve(this.address)}connect(e){return new hl(this,e)}signTransaction(e){return ga(e).then((t=>{null!=t.from&&(bs(t.from)!==this.address&&ll.throwArgumentError("transaction from address mismatch","transaction.from",e.from),delete t.from);const r=this._signingKey().signDigest(rs(Tf(t)));return Tf(t,r)}))}signMessage(e){return dl(this,void 0,void 0,(function*(){return zo(this._signingKey().signDigest(Jc(e)))}))}_signTypedData(e,t,r){return dl(this,void 0,void 0,(function*(){const n=yield cu.resolveNames(e,t,r,(e=>(null==this.provider&&ll.throwError("cannot resolve ENS names without a provider",bo.errors.UNSUPPORTED_OPERATION,{operation:"resolveName",value:e}),this.provider.resolveName(e))));return zo(this._signingKey().signDigest(cu.hash(n.domain,t,n.value)))}))}encrypt(e,t,r){if("function"!=typeof t||r||(r=t,t={}),r&&"function"!=typeof r)throw new Error("invalid callback");return t||(t={}),sl(this,e,t,r)}static createRandom(e){let t=Td(16);e||(e={}),e.extraEntropy&&(t=xo(To(rs(ko([t,e.extraEntropy])),0,16)));const r=Cd(t,e.locale);return hl.fromMnemonic(r,e.path,e.locale)}static fromEncryptedJson(e,t,r){return cl(e,t,r).then((e=>new hl(e)))}static fromEncryptedJsonSync(e,t){return new hl(ul(e,t))}static fromMnemonic(e,t,r){return t||(t=Pd),new hl(xd.fromMnemonic(e,null,r).derivePath(t))}}var pl=Object.freeze({__proto__:null,Wallet:hl,verifyMessage:function(e,t){return kf(Jc(e),t)},verifyTypedData:function(e,t,r,n){return kf(cu.hash(e,t,r),n)}});const ml=new bo("networks/5.7.1");function gl(e){const t=function(t,r){null==r&&(r={});const n=[];if(t.InfuraProvider&&"-"!==r.infura)try{n.push(new t.InfuraProvider(e,r.infura))}catch(e){}if(t.EtherscanProvider&&"-"!==r.etherscan)try{n.push(new t.EtherscanProvider(e,r.etherscan))}catch(e){}if(t.AlchemyProvider&&"-"!==r.alchemy)try{n.push(new t.AlchemyProvider(e,r.alchemy))}catch(e){}if(t.PocketProvider&&"-"!==r.pocket){const i=["goerli","ropsten","rinkeby","sepolia"];try{const o=new t.PocketProvider(e,r.pocket);o.network&&-1===i.indexOf(o.network.name)&&n.push(o)}catch(e){}}if(t.CloudflareProvider&&"-"!==r.cloudflare)try{n.push(new t.CloudflareProvider(e))}catch(e){}if(t.AnkrProvider&&"-"!==r.ankr)try{const i=["ropsten"],o=new t.AnkrProvider(e,r.ankr);o.network&&-1===i.indexOf(o.network.name)&&n.push(o)}catch(e){}if(0===n.length)return null;if(t.FallbackProvider){let i=1;return null!=r.quorum?i=r.quorum:"homestead"===e&&(i=2),new t.FallbackProvider(n,i)}return n[0]};return t.renetwork=function(e){return gl(e)},t}function yl(e,t){const r=function(r,n){return r.JsonRpcProvider?new r.JsonRpcProvider(e,t):null};return r.renetwork=function(t){return yl(e,t)},r}const bl={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:gl("homestead")},vl={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:gl("ropsten")},wl={chainId:63,name:"classicMordor",_defaultProvider:yl("https://www.ethercluster.com/mordor","classicMordor")},Al={unspecified:{chainId:0,name:"unspecified"},homestead:bl,mainnet:bl,morden:{chainId:2,name:"morden"},ropsten:vl,testnet:vl,rinkeby:{chainId:4,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"rinkeby",_defaultProvider:gl("rinkeby")},kovan:{chainId:42,name:"kovan",_defaultProvider:gl("kovan")},goerli:{chainId:5,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"goerli",_defaultProvider:gl("goerli")},kintsugi:{chainId:1337702,name:"kintsugi"},sepolia:{chainId:11155111,name:"sepolia",_defaultProvider:gl("sepolia")},classic:{chainId:61,name:"classic",_defaultProvider:yl("https://www.ethercluster.com/etc","classic")},classicMorden:{chainId:62,name:"classicMorden"},classicMordor:wl,classicTestnet:wl,classicKotti:{chainId:6,name:"classicKotti",_defaultProvider:yl("https://www.ethercluster.com/kotti","classicKotti")},xdai:{chainId:100,name:"xdai"},matic:{chainId:137,name:"matic",_defaultProvider:gl("matic")},maticmum:{chainId:80001,name:"maticmum"},optimism:{chainId:10,name:"optimism",_defaultProvider:gl("optimism")},"optimism-kovan":{chainId:69,name:"optimism-kovan"},"optimism-goerli":{chainId:420,name:"optimism-goerli"},arbitrum:{chainId:42161,name:"arbitrum"},"arbitrum-rinkeby":{chainId:421611,name:"arbitrum-rinkeby"},"arbitrum-goerli":{chainId:421613,name:"arbitrum-goerli"},bnb:{chainId:56,name:"bnb"},bnbt:{chainId:97,name:"bnbt"}};var _l=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))};function El(e,t){return _l(this,void 0,void 0,(function*(){null==t&&(t={});const r={method:t.method||"GET",headers:t.headers||{},body:t.body||void 0};if(!0!==t.skipFetchSetup&&(r.mode="cors",r.cache="no-cache",r.credentials="same-origin",r.redirect="follow",r.referrer="client"),null!=t.fetchOptions){const e=t.fetchOptions;e.mode&&(r.mode=e.mode),e.cache&&(r.cache=e.cache),e.credentials&&(r.credentials=e.credentials),e.redirect&&(r.redirect=e.redirect),e.referrer&&(r.referrer=e.referrer)}const n=yield fetch(e,r),i=yield n.arrayBuffer(),o={};return n.headers.forEach?n.headers.forEach(((e,t)=>{o[t.toLowerCase()]=e})):n.headers.keys().forEach((e=>{o[e.toLowerCase()]=n.headers.get(e)})),{headers:o,statusCode:n.status,statusMessage:n.statusText,body:xo(new Uint8Array(i))}}))}var Sl=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))};const Pl=new bo("web/5.7.1");function xl(e){return new Promise((t=>{setTimeout(t,e)}))}function kl(e,t){if(null==e)return null;if("string"==typeof e)return e;if(Eo(e)){if(t&&("text"===t.split("/")[0]||"application/json"===t.split(";")[0].trim()))try{return Ws(e)}catch(e){}return No(e)}return e}function Ml(e,t,r){const n="object"==typeof e&&null!=e.throttleLimit?e.throttleLimit:12;Pl.assertArgument(n>0&&n%1==0,"invalid connection throttle limit","connection.throttleLimit",n);const i="object"==typeof e?e.throttleCallback:null,o="object"==typeof e&&"number"==typeof e.throttleSlotInterval?e.throttleSlotInterval:100;Pl.assertArgument(o>0&&o%1==0,"invalid connection throttle slot interval","connection.throttleSlotInterval",o);const a="object"==typeof e&&!!e.errorPassThrough,s={};let c=null;const u={method:"GET"};let f=!1,d=12e4;if("string"==typeof e)c=e;else if("object"==typeof e){if(null!=e&&null!=e.url||Pl.throwArgumentError("missing URL","connection.url",e),c=e.url,"number"==typeof e.timeout&&e.timeout>0&&(d=e.timeout),e.headers)for(const t in e.headers)s[t.toLowerCase()]={key:t,value:String(e.headers[t])},["if-none-match","if-modified-since"].indexOf(t.toLowerCase())>=0&&(f=!0);if(u.allowGzip=!!e.allowGzip,null!=e.user&&null!=e.password){"https:"!==c.substring(0,6)&&!0!==e.allowInsecureAuthentication&&Pl.throwError("basic authentication requires a secure https url",bo.errors.INVALID_ARGUMENT,{argument:"url",url:c,user:e.user,password:"[REDACTED]"});const t=e.user+":"+e.password;s.authorization={key:"Authorization",value:"Basic "+gc(Hs(t))}}null!=e.skipFetchSetup&&(u.skipFetchSetup=!!e.skipFetchSetup),null!=e.fetchOptions&&(u.fetchOptions=ba(e.fetchOptions))}const l=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),h=c?c.match(l):null;if(h)try{const e={statusCode:200,statusMessage:"OK",headers:{"content-type":h[1]||"text/plain"},body:h[2]?mc(h[3]):(p=h[3],Hs(p.replace(/%([0-9a-f][0-9a-f])/gi,((e,t)=>String.fromCharCode(parseInt(t,16))))))};let t=e.body;return r&&(t=r(e.body,e)),Promise.resolve(t)}catch(e){Pl.throwError("processing response error",bo.errors.SERVER_ERROR,{body:kl(h[1],h[2]),error:e,requestBody:null,requestMethod:"GET",url:c})}var p;t&&(u.method="POST",u.body=t,null==s["content-type"]&&(s["content-type"]={key:"Content-Type",value:"application/octet-stream"}),null==s["content-length"]&&(s["content-length"]={key:"Content-Length",value:String(t.length)}));const m={};Object.keys(s).forEach((e=>{const t=s[e];m[t.key]=t.value})),u.headers=m;const g=function(){let e=null;return{promise:new Promise((function(t,r){d&&(e=setTimeout((()=>{null!=e&&(e=null,r(Pl.makeError("timeout",bo.errors.TIMEOUT,{requestBody:kl(u.body,m["content-type"]),requestMethod:u.method,timeout:d,url:c})))}),d))})),cancel:function(){null!=e&&(clearTimeout(e),e=null)}}}(),y=function(){return Sl(this,void 0,void 0,(function*(){for(let e=0;e=300)&&(g.cancel(),Pl.throwError("bad response",bo.errors.SERVER_ERROR,{status:t.statusCode,headers:t.headers,body:kl(s,t.headers?t.headers["content-type"]:null),requestBody:kl(u.body,m["content-type"]),requestMethod:u.method,url:c})),r)try{const e=yield r(s,t);return g.cancel(),e}catch(r){if(r.throttleRetry&&e"content-type"===e.toLowerCase())).length||(r.headers=ba(r.headers),r.headers["content-type"]="application/json")}else r.headers={"content-type":"application/json"};e=r}return Ml(e,n,((e,t)=>{let n=null;if(null!=e)try{n=JSON.parse(Ws(e))}catch(t){Pl.throwError("invalid JSON",bo.errors.SERVER_ERROR,{body:e,error:t})}return r&&(n=r(n,t)),n}))}function Il(e,t){return t||(t={}),null==(t=ba(t)).floor&&(t.floor=0),null==t.ceiling&&(t.ceiling=1e4),null==t.interval&&(t.interval=250),new Promise((function(r,n){let i=null,o=!1;const a=()=>!o&&(o=!0,i&&clearTimeout(i),!0);t.timeout&&(i=setTimeout((()=>{a()&&n(new Error("timeout"))}),t.timeout));const s=t.retryLimit;let c=0;!function i(){return e().then((function(e){if(void 0!==e)a()&&r(e);else if(t.oncePoll)t.oncePoll.once("poll",i);else if(t.onceBlock)t.onceBlock.once("block",i);else if(!o){if(c++,c>s)return void(a()&&n(new Error("retry limit reached")));let e=t.interval*parseInt(String(Math.random()*Math.pow(2,c)));et.ceiling&&(e=t.ceiling),setTimeout(i,e)}return null}),(function(e){a()&&n(e)}))}()}))}for(var Rl=Object.freeze({__proto__:null,_fetchData:Ml,fetchJson:Cl,poll:Il}),Nl="qpzry9x8gf2tvdw0s3jn54khce6mua7l",Ol={},Tl=0;Tl>25;return(33554431&e)<<5^996825010&-(t>>0&1)^642813549&-(t>>1&1)^513874426&-(t>>2&1)^1027748829&-(t>>3&1)^705979059&-(t>>4&1)}function $l(e){for(var t=1,r=0;r126)return"Invalid prefix ("+e+")";t=Dl(t)^n>>5}for(t=Dl(t),r=0;rt)return"Exceeds length limit";var r=e.toLowerCase(),n=e.toUpperCase();if(e!==r&&e!==n)return"Mixed-case string "+e;var i=(e=r).lastIndexOf("1");if(-1===i)return"No separator character for "+e;if(0===i)return"Missing prefix for "+e;var o=e.slice(0,i),a=e.slice(i+1);if(a.length<6)return"Data too short";var s=$l(o);if("string"==typeof s)return s;for(var c=[],u=0;u=a.length||c.push(d)}return 1!==s?"Invalid checksum for "+e:{prefix:o,words:c}}function Fl(e,t,r,n){for(var i=0,o=0,a=(1<=r;)o-=r,s.push(i>>o&a);if(n)o>0&&s.push(i<=t)return"Excess padding";if(i<r)throw new TypeError("Exceeds length limit");var n=$l(e=e.toLowerCase());if("string"==typeof n)throw new Error(n);for(var i=e+"1",o=0;o>5!=0)throw new Error("Non 5-bit word");n=Dl(n)^a,i+=Nl.charAt(a)}for(o=0;o<6;++o)n=Dl(n);for(n^=1,o=0;o<6;++o){i+=Nl.charAt(n>>5*(5-o)&31)}return i},toWordsUnsafe:function(e){var t=Fl(e,8,5,!0);if(Array.isArray(t))return t},toWords:function(e){var t=Fl(e,8,5,!0);if(Array.isArray(t))return t;throw new Error(t)},fromWordsUnsafe:function(e){var t=Fl(e,5,8,!1);if(Array.isArray(t))return t},fromWords:function(e){var t=Fl(e,5,8,!1);if(Array.isArray(t))return t;throw new Error(t)}},Ul=c(zl);const Ll="providers/5.7.2",ql=new bo(Ll);class Hl{constructor(){this.formats=this.getDefaultFormats()}getDefaultFormats(){const e={},t=this.address.bind(this),r=this.bigNumber.bind(this),n=this.blockTag.bind(this),i=this.data.bind(this),o=this.hash.bind(this),a=this.hex.bind(this),s=this.number.bind(this),c=this.type.bind(this);return e.transaction={hash:o,type:c,accessList:Hl.allowNull(this.accessList.bind(this),null),blockHash:Hl.allowNull(o,null),blockNumber:Hl.allowNull(s,null),transactionIndex:Hl.allowNull(s,null),confirmations:Hl.allowNull(s,null),from:t,gasPrice:Hl.allowNull(r),maxPriorityFeePerGas:Hl.allowNull(r),maxFeePerGas:Hl.allowNull(r),gasLimit:r,to:Hl.allowNull(t,null),value:r,nonce:s,data:i,r:Hl.allowNull(this.uint256),s:Hl.allowNull(this.uint256),v:Hl.allowNull(s),creates:Hl.allowNull(t,null),raw:Hl.allowNull(i)},e.transactionRequest={from:Hl.allowNull(t),nonce:Hl.allowNull(s),gasLimit:Hl.allowNull(r),gasPrice:Hl.allowNull(r),maxPriorityFeePerGas:Hl.allowNull(r),maxFeePerGas:Hl.allowNull(r),to:Hl.allowNull(t),value:Hl.allowNull(r),data:Hl.allowNull((e=>this.data(e,!0))),type:Hl.allowNull(s),accessList:Hl.allowNull(this.accessList.bind(this),null)},e.receiptLog={transactionIndex:s,blockNumber:s,transactionHash:o,address:t,topics:Hl.arrayOf(o),data:i,logIndex:s,blockHash:o},e.receipt={to:Hl.allowNull(this.address,null),from:Hl.allowNull(this.address,null),contractAddress:Hl.allowNull(t,null),transactionIndex:s,root:Hl.allowNull(a),gasUsed:r,logsBloom:Hl.allowNull(i),blockHash:o,transactionHash:o,logs:Hl.arrayOf(this.receiptLog.bind(this)),blockNumber:s,confirmations:Hl.allowNull(s,null),cumulativeGasUsed:r,effectiveGasPrice:Hl.allowNull(r),status:Hl.allowNull(s),type:c},e.block={hash:Hl.allowNull(o),parentHash:o,number:s,timestamp:s,nonce:Hl.allowNull(a),difficulty:this.difficulty.bind(this),gasLimit:r,gasUsed:r,miner:Hl.allowNull(t),extraData:i,transactions:Hl.allowNull(Hl.arrayOf(o)),baseFeePerGas:Hl.allowNull(r)},e.blockWithTransactions=ba(e.block),e.blockWithTransactions.transactions=Hl.allowNull(Hl.arrayOf(this.transactionResponse.bind(this))),e.filter={fromBlock:Hl.allowNull(n,void 0),toBlock:Hl.allowNull(n,void 0),blockHash:Hl.allowNull(o,void 0),address:Hl.allowNull(t,void 0),topics:Hl.allowNull(this.topics.bind(this),void 0)},e.filterLog={blockNumber:Hl.allowNull(s),blockHash:Hl.allowNull(o),transactionIndex:s,removed:Hl.allowNull(this.boolean.bind(this)),address:t,data:Hl.allowFalsish(i,"0x"),topics:Hl.arrayOf(o),transactionHash:o,logIndex:s},e}accessList(e){return If(e||[])}number(e){return"0x"===e?0:Go.from(e).toNumber()}type(e){return"0x"===e||null==e?0:Go.from(e).toNumber()}bigNumber(e){return Go.from(e)}boolean(e){if("boolean"==typeof e)return e;if("string"==typeof e){if("true"===(e=e.toLowerCase()))return!0;if("false"===e)return!1}throw new Error("invalid boolean - "+e)}hex(e,t){return"string"==typeof e&&(t||"0x"===e.substring(0,2)||(e="0x"+e),Io(e))?e.toLowerCase():ql.throwArgumentError("invalid hash","value",e)}data(e,t){const r=this.hex(e,t);if(r.length%2!=0)throw new Error("invalid data; odd-length - "+e);return r}address(e){return bs(e)}callAddress(e){if(!Io(e,32))return null;const t=bs(To(e,12));return"0x0000000000000000000000000000000000000000"===t?null:t}contractAddress(e){return vs(e)}blockTag(e){if(null==e)return"latest";if("earliest"===e)return"0x0";switch(e){case"earliest":return"0x0";case"latest":case"pending":case"safe":case"finalized":return e}if("number"==typeof e||Io(e))return Do(e);throw new Error("invalid blockTag")}hash(e,t){const r=this.hex(e,t);return 32!==Oo(r)?ql.throwArgumentError("invalid hash","value",e):r}difficulty(e){if(null==e)return null;const t=Go.from(e);try{return t.toNumber()}catch(e){}return null}uint256(e){if(!Io(e))throw new Error("invalid uint256");return Bo(e,32)}_block(e,t){null!=e.author&&null==e.miner&&(e.miner=e.author);const r=null!=e._difficulty?e._difficulty:e.difficulty,n=Hl.check(t,e);return n._difficulty=null==r?null:Go.from(r),n}block(e){return this._block(e,this.formats.block)}blockWithTransactions(e){return this._block(e,this.formats.blockWithTransactions)}transactionRequest(e){return Hl.check(this.formats.transactionRequest,e)}transactionResponse(e){null!=e.gas&&null==e.gasLimit&&(e.gasLimit=e.gas),e.to&&Go.from(e.to).isZero()&&(e.to="0x0000000000000000000000000000000000000000"),null!=e.input&&null==e.data&&(e.data=e.input),null==e.to&&null==e.creates&&(e.creates=this.contractAddress(e)),1!==e.type&&2!==e.type||null!=e.accessList||(e.accessList=[]);const t=Hl.check(this.formats.transaction,e);if(null!=e.chainId){let r=e.chainId;Io(r)&&(r=Go.from(r).toNumber()),t.chainId=r}else{let r=e.networkId;null==r&&null==t.v&&(r=e.chainId),Io(r)&&(r=Go.from(r).toNumber()),"number"!=typeof r&&null!=t.v&&(r=(t.v-35)/2,r<0&&(r=0),r=parseInt(r)),"number"!=typeof r&&(r=0),t.chainId=r}return t.blockHash&&"x"===t.blockHash.replace(/0/g,"")&&(t.blockHash=null),t}transaction(e){return Df(e)}receiptLog(e){return Hl.check(this.formats.receiptLog,e)}receipt(e){const t=Hl.check(this.formats.receipt,e);if(null!=t.root)if(t.root.length<=4){const e=Go.from(t.root).toNumber();0===e||1===e?(null!=t.status&&t.status!==e&&ql.throwArgumentError("alt-root-status/status mismatch","value",{root:t.root,status:t.status}),t.status=e,delete t.root):ql.throwArgumentError("invalid alt-root-status","value.root",t.root)}else 66!==t.root.length&&ql.throwArgumentError("invalid root hash","value.root",t.root);return null!=t.status&&(t.byzantium=!0),t}topics(e){return Array.isArray(e)?e.map((e=>this.topics(e))):null!=e?this.hash(e,!0):null}filter(e){return Hl.check(this.formats.filter,e)}filterLog(e){return Hl.check(this.formats.filterLog,e)}static check(e,t){const r={};for(const n in e)try{const i=e[n](t[n]);void 0!==i&&(r[n]=i)}catch(e){throw e.checkKey=n,e.checkValue=t[n],e}return r}static allowNull(e,t){return function(r){return null==r?t:e(r)}}static allowFalsish(e,t){return function(r){return r?e(r):t}}static arrayOf(e){return function(t){if(!Array.isArray(t))throw new Error("not an array");const r=[];return t.forEach((function(t){r.push(e(t))})),r}}}var Kl=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))};const Jl=new bo(Ll);function Wl(e){return null==e?"null":(32!==Oo(e)&&Jl.throwArgumentError("invalid topic","topic",e),e.toLowerCase())}function Gl(e){for(e=e.slice();e.length>0&&null==e[e.length-1];)e.pop();return e.map((e=>{if(Array.isArray(e)){const t={};e.forEach((e=>{t[Wl(e)]=!0}));const r=Object.keys(t);return r.sort(),r.join("|")}return Wl(e)})).join("&")}function Vl(e){if("string"==typeof e){if(32===Oo(e=e.toLowerCase()))return"tx:"+e;if(-1===e.indexOf(":"))return e}else{if(Array.isArray(e))return"filter:*:"+Gl(e);if(Au.isForkEvent(e))throw Jl.warn("not implemented"),new Error("not implemented");if(e&&"object"==typeof e)return"filter:"+(e.address||"*")+":"+Gl(e.topics||[])}throw new Error("invalid event - "+e)}function Zl(){return(new Date).getTime()}function Xl(e){return new Promise((t=>{setTimeout(t,e)}))}const Ql=["block","network","pending","poll"];class Yl{constructor(e,t,r){pa(this,"tag",e),pa(this,"listener",t),pa(this,"once",r),this._lastBlockNumber=-2,this._inflight=!1}get event(){switch(this.type){case"tx":return this.hash;case"filter":return this.filter}return this.tag}get type(){return this.tag.split(":")[0]}get hash(){const e=this.tag.split(":");return"tx"!==e[0]?null:e[1]}get filter(){const e=this.tag.split(":");if("filter"!==e[0])return null;const t=e[1],r=""===(n=e[2])?[]:n.split(/&/g).map((e=>{if(""===e)return[];const t=e.split("|").map((e=>"null"===e?null:e));return 1===t.length?t[0]:t}));var n;const i={};return r.length>0&&(i.topics=r),t&&"*"!==t&&(i.address=t),i}pollable(){return this.tag.indexOf(":")>=0||Ql.indexOf(this.tag)>=0}}const eh={0:{symbol:"btc",p2pkh:0,p2sh:5,prefix:"bc"},2:{symbol:"ltc",p2pkh:48,p2sh:50,prefix:"ltc"},3:{symbol:"doge",p2pkh:30,p2sh:22},60:{symbol:"eth",ilk:"eth"},61:{symbol:"etc",ilk:"eth"},700:{symbol:"xdai",ilk:"eth"}};function th(e){return Bo(Go.from(e).toHexString(),32)}function rh(e){return td.encode(ko([e,To(ad(ad(e)),0,4)]))}const nh=new RegExp("^(ipfs)://(.*)$","i"),ih=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),nh,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function oh(e,t){try{return Ws(ah(e,t))}catch(e){}return null}function ah(e,t){if("0x"===e)return null;const r=Go.from(To(e,t,t+32)).toNumber(),n=Go.from(To(e,r,r+32)).toNumber();return To(e,r+32,r+32+n)}function sh(e){return e.match(/^ipfs:\/\/ipfs\//i)?e=e.substring(12):e.match(/^ipfs:\/\//i)?e=e.substring(7):Jl.throwArgumentError("unsupported IPFS format","link",e),`https://gateway.ipfs.io/ipfs/${e}`}function ch(e){const t=xo(e);if(t.length>32)throw new Error("internal; should not happen");const r=new Uint8Array(32);return r.set(t,32-t.length),r}function uh(e){if(e.length%32==0)return e;const t=new Uint8Array(32*Math.ceil(e.length/32));return t.set(e),t}function fh(e){const t=[];let r=0;for(let n=0;nGo.from(e).eq(1))).catch((e=>{if(e.code===bo.errors.CALL_EXCEPTION)return!1;throw this._supportsEip2544=null,e}))),this._supportsEip2544}_fetch(e,t){return Kl(this,void 0,void 0,(function*(){const r={to:this.address,ccipReadEnabled:!0,data:jo([e,qc(this.name),t||"0x"])};let n=!1;(yield this.supportsWildcard())&&(n=!0,r.data=jo(["0x9061b923",fh([Hc(this.name),r.data])]));try{let e=yield this.provider.call(r);return xo(e).length%32==4&&Jl.throwError("resolver threw error",bo.errors.CALL_EXCEPTION,{transaction:r,data:e}),n&&(e=ah(e,0)),e}catch(e){if(e.code===bo.errors.CALL_EXCEPTION)return null;throw e}}))}_fetchBytes(e,t){return Kl(this,void 0,void 0,(function*(){const r=yield this._fetch(e,t);return null!=r?ah(r,0):null}))}_getAddress(e,t){const r=eh[String(e)];if(null==r&&Jl.throwError(`unsupported coin type: ${e}`,bo.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`}),"eth"===r.ilk)return this.provider.formatter.address(t);const n=xo(t);if(null!=r.p2pkh){const e=t.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);if(e){const t=parseInt(e[1],16);if(e[2].length===2*t&&t>=1&&t<=75)return rh(ko([[r.p2pkh],"0x"+e[2]]))}}if(null!=r.p2sh){const e=t.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(e){const t=parseInt(e[1],16);if(e[2].length===2*t&&t>=1&&t<=75)return rh(ko([[r.p2sh],"0x"+e[2]]))}}if(null!=r.prefix){const e=n[1];let t=n[0];if(0===t?20!==e&&32!==e&&(t=-1):t=-1,t>=0&&n.length===2+e&&e>=1&&e<=75){const e=Ul.toWords(n.slice(2));return e.unshift(t),Ul.encode(r.prefix,e)}}return null}getAddress(e){return Kl(this,void 0,void 0,(function*(){if(null==e&&(e=60),60===e)try{const e=yield this._fetch("0x3b3b57de");return"0x"===e||e===Ds?null:this.provider.formatter.callAddress(e)}catch(e){if(e.code===bo.errors.CALL_EXCEPTION)return null;throw e}const t=yield this._fetchBytes("0xf1cb7e06",th(e));if(null==t||"0x"===t)return null;const r=this._getAddress(e,t);return null==r&&Jl.throwError("invalid or unsupported coin data",bo.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`,coinType:e,data:t}),r}))}getAvatar(){return Kl(this,void 0,void 0,(function*(){const e=[{type:"name",content:this.name}];try{const t=yield this.getText("avatar");if(null==t)return null;for(let r=0;re[t]))}return Jl.throwError("invalid or unsupported content hash data",bo.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:e})}))}getText(e){return Kl(this,void 0,void 0,(function*(){let t=Hs(e);t=ko([th(64),th(t.length),t]),t.length%32!=0&&(t=ko([t,Bo("0x",32-e.length%32)]));const r=yield this._fetchBytes("0x59d1d43c",No(t));return null==r||"0x"===r?null:Ws(r)}))}}let lh=null,hh=1;class ph extends _u{constructor(e){if(super(),this._events=[],this._emitted={block:-2},this.disableCcipRead=!1,this.formatter=new.target.getFormatter(),pa(this,"anyNetwork","any"===e),this.anyNetwork&&(e=this.detectNetwork()),e instanceof Promise)this._networkPromise=e,e.catch((e=>{})),this._ready().catch((e=>{}));else{const t=ma(new.target,"getNetwork")(e);t?(pa(this,"_network",t),this.emit("network",t,null)):Jl.throwArgumentError("invalid network","network",e)}this._maxInternalBlockNumber=-1024,this._lastBlockNumber=-2,this._maxFilterBlockRange=10,this._pollingInterval=4e3,this._fastQueryDate=0}_ready(){return Kl(this,void 0,void 0,(function*(){if(null==this._network){let e=null;if(this._networkPromise)try{e=yield this._networkPromise}catch(e){}null==e&&(e=yield this.detectNetwork()),e||Jl.throwError("no network detected",bo.errors.UNKNOWN_ERROR,{}),null==this._network&&(this.anyNetwork?this._network=e:pa(this,"_network",e),this.emit("network",e,null))}return this._network}))}get ready(){return Il((()=>this._ready().then((e=>e),(e=>{if(e.code!==bo.errors.NETWORK_ERROR||"noNetwork"!==e.event)throw e}))))}static getFormatter(){return null==lh&&(lh=new Hl),lh}static getNetwork(e){return function(e){if(null==e)return null;if("number"==typeof e){for(const t in Al){const r=Al[t];if(r.chainId===e)return{name:r.name,chainId:r.chainId,ensAddress:r.ensAddress||null,_defaultProvider:r._defaultProvider||null}}return{chainId:e,name:"unknown"}}if("string"==typeof e){const t=Al[e];return null==t?null:{name:t.name,chainId:t.chainId,ensAddress:t.ensAddress,_defaultProvider:t._defaultProvider||null}}const t=Al[e.name];if(!t)return"number"!=typeof e.chainId&&ml.throwArgumentError("invalid network chainId","network",e),e;0!==e.chainId&&e.chainId!==t.chainId&&ml.throwArgumentError("network chainId mismatch","network",e);let r=e._defaultProvider||null;var n;return null==r&&t._defaultProvider&&(r=(n=t._defaultProvider)&&"function"==typeof n.renetwork?t._defaultProvider.renetwork(e):t._defaultProvider),{name:e.name,chainId:t.chainId,ensAddress:e.ensAddress||t.ensAddress||null,_defaultProvider:r}}(null==e?"homestead":e)}ccipReadFetch(e,t,r){return Kl(this,void 0,void 0,(function*(){if(this.disableCcipRead||0===r.length)return null;const n=e.to.toLowerCase(),i=t.toLowerCase(),o=[];for(let e=0;e=0?null:JSON.stringify({data:i,sender:n}),c=yield Cl({url:a,errorPassThrough:!0},s,((e,t)=>(e.status=t.statusCode,e)));if(c.data)return c.data;const u=c.message||"unknown error";if(c.status>=400&&c.status<500)return Jl.throwError(`response not found during CCIP fetch: ${u}`,bo.errors.SERVER_ERROR,{url:t,errorMessage:u});o.push(u)}return Jl.throwError(`error encountered during CCIP fetch: ${o.map((e=>JSON.stringify(e))).join(", ")}`,bo.errors.SERVER_ERROR,{urls:r,errorMessages:o})}))}_getInternalBlockNumber(e){return Kl(this,void 0,void 0,(function*(){if(yield this._ready(),e>0)for(;this._internalBlockNumber;){const t=this._internalBlockNumber;try{const r=yield t;if(Zl()-r.respTime<=e)return r.blockNumber;break}catch(e){if(this._internalBlockNumber===t)break}}const t=Zl(),r=ga({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then((e=>null),(e=>e))}).then((({blockNumber:e,networkError:n})=>{if(n)throw this._internalBlockNumber===r&&(this._internalBlockNumber=null),n;const i=Zl();return(e=Go.from(e).toNumber()){this._internalBlockNumber===r&&(this._internalBlockNumber=null)})),(yield r).blockNumber}))}poll(){return Kl(this,void 0,void 0,(function*(){const e=hh++,t=[];let r=null;try{r=yield this._getInternalBlockNumber(100+this.pollingInterval/2)}catch(e){return void this.emit("error",e)}if(this._setFastBlockNumber(r),this.emit("poll",e,r),r!==this._lastBlockNumber){if(-2===this._emitted.block&&(this._emitted.block=r-1),Math.abs(this._emitted.block-r)>1e3)Jl.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${r})`),this.emit("error",Jl.makeError("network block skew detected",bo.errors.NETWORK_ERROR,{blockNumber:r,event:"blockSkew",previousBlockNumber:this._emitted.block})),this.emit("block",r);else for(let e=this._emitted.block+1;e<=r;e++)this.emit("block",e);this._emitted.block!==r&&(this._emitted.block=r,Object.keys(this._emitted).forEach((e=>{if("block"===e)return;const t=this._emitted[e];"pending"!==t&&r-t>12&&delete this._emitted[e]}))),-2===this._lastBlockNumber&&(this._lastBlockNumber=r-1),this._events.forEach((e=>{switch(e.type){case"tx":{const r=e.hash;let n=this.getTransactionReceipt(r).then((e=>e&&null!=e.blockNumber?(this._emitted["t:"+r]=e.blockNumber,this.emit(r,e),null):null)).catch((e=>{this.emit("error",e)}));t.push(n);break}case"filter":if(!e._inflight){e._inflight=!0,-2===e._lastBlockNumber&&(e._lastBlockNumber=r-1);const n=e.filter;n.fromBlock=e._lastBlockNumber+1,n.toBlock=r;const i=n.toBlock-this._maxFilterBlockRange;i>n.fromBlock&&(n.fromBlock=i),n.fromBlock<0&&(n.fromBlock=0);const o=this.getLogs(n).then((t=>{e._inflight=!1,0!==t.length&&t.forEach((t=>{t.blockNumber>e._lastBlockNumber&&(e._lastBlockNumber=t.blockNumber),this._emitted["b:"+t.blockHash]=t.blockNumber,this._emitted["t:"+t.transactionHash]=t.blockNumber,this.emit(n,t)}))})).catch((t=>{this.emit("error",t),e._inflight=!1}));t.push(o)}}})),this._lastBlockNumber=r,Promise.all(t).then((()=>{this.emit("didPoll",e)})).catch((e=>{this.emit("error",e)}))}else this.emit("didPoll",e)}))}resetEventsBlock(e){this._lastBlockNumber=e-1,this.polling&&this.poll()}get network(){return this._network}detectNetwork(){return Kl(this,void 0,void 0,(function*(){return Jl.throwError("provider does not support network detection",bo.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"})}))}getNetwork(){return Kl(this,void 0,void 0,(function*(){const e=yield this._ready(),t=yield this.detectNetwork();if(e.chainId!==t.chainId){if(this.anyNetwork)return this._network=t,this._lastBlockNumber=-2,this._fastBlockNumber=null,this._fastBlockNumberPromise=null,this._fastQueryDate=0,this._emitted.block=-2,this._maxInternalBlockNumber=-1024,this._internalBlockNumber=null,this.emit("network",t,e),yield Xl(0),this._network;const r=Jl.makeError("underlying network changed",bo.errors.NETWORK_ERROR,{event:"changed",network:e,detectedNetwork:t});throw this.emit("error",r),r}return e}))}get blockNumber(){return this._getInternalBlockNumber(100+this.pollingInterval/2).then((e=>{this._setFastBlockNumber(e)}),(e=>{})),null!=this._fastBlockNumber?this._fastBlockNumber:-1}get polling(){return null!=this._poller}set polling(e){e&&!this._poller?(this._poller=setInterval((()=>{this.poll()}),this.pollingInterval),this._bootstrapPoll||(this._bootstrapPoll=setTimeout((()=>{this.poll(),this._bootstrapPoll=setTimeout((()=>{this._poller||this.poll(),this._bootstrapPoll=null}),this.pollingInterval)}),0))):!e&&this._poller&&(clearInterval(this._poller),this._poller=null)}get pollingInterval(){return this._pollingInterval}set pollingInterval(e){if("number"!=typeof e||e<=0||parseInt(String(e))!=e)throw new Error("invalid polling interval");this._pollingInterval=e,this._poller&&(clearInterval(this._poller),this._poller=setInterval((()=>{this.poll()}),this._pollingInterval))}_getFastBlockNumber(){const e=Zl();return e-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=e,this._fastBlockNumberPromise=this.getBlockNumber().then((e=>((null==this._fastBlockNumber||e>this._fastBlockNumber)&&(this._fastBlockNumber=e),this._fastBlockNumber)))),this._fastBlockNumberPromise}_setFastBlockNumber(e){null!=this._fastBlockNumber&&ethis._fastBlockNumber)&&(this._fastBlockNumber=e,this._fastBlockNumberPromise=Promise.resolve(e)))}waitForTransaction(e,t,r){return Kl(this,void 0,void 0,(function*(){return this._waitForTransaction(e,null==t?1:t,r||0,null)}))}_waitForTransaction(e,t,r,n){return Kl(this,void 0,void 0,(function*(){const i=yield this.getTransactionReceipt(e);return(i?i.confirmations:0)>=t?i:new Promise(((i,o)=>{const a=[];let s=!1;const c=function(){return!!s||(s=!0,a.forEach((e=>{e()})),!1)},u=e=>{e.confirmations{this.removeListener(e,u)})),n){let r=n.startBlock,i=null;const u=a=>Kl(this,void 0,void 0,(function*(){s||(yield Xl(1e3),this.getTransactionCount(n.from).then((f=>Kl(this,void 0,void 0,(function*(){if(!s){if(f<=n.nonce)r=a;else{{const t=yield this.getTransaction(e);if(t&&null!=t.blockNumber)return}for(null==i&&(i=r-3,i{s||this.once("block",u)})))}));if(s)return;this.once("block",u),a.push((()=>{this.removeListener("block",u)}))}if("number"==typeof r&&r>0){const e=setTimeout((()=>{c()||o(Jl.makeError("timeout exceeded",bo.errors.TIMEOUT,{timeout:r}))}),r);e.unref&&e.unref(),a.push((()=>{clearTimeout(e)}))}}))}))}getBlockNumber(){return Kl(this,void 0,void 0,(function*(){return this._getInternalBlockNumber(0)}))}getGasPrice(){return Kl(this,void 0,void 0,(function*(){yield this.getNetwork();const e=yield this.perform("getGasPrice",{});try{return Go.from(e)}catch(t){return Jl.throwError("bad result from backend",bo.errors.SERVER_ERROR,{method:"getGasPrice",result:e,error:t})}}))}getBalance(e,t){return Kl(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield ga({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),n=yield this.perform("getBalance",r);try{return Go.from(n)}catch(e){return Jl.throwError("bad result from backend",bo.errors.SERVER_ERROR,{method:"getBalance",params:r,result:n,error:e})}}))}getTransactionCount(e,t){return Kl(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield ga({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),n=yield this.perform("getTransactionCount",r);try{return Go.from(n).toNumber()}catch(e){return Jl.throwError("bad result from backend",bo.errors.SERVER_ERROR,{method:"getTransactionCount",params:r,result:n,error:e})}}))}getCode(e,t){return Kl(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield ga({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),n=yield this.perform("getCode",r);try{return No(n)}catch(e){return Jl.throwError("bad result from backend",bo.errors.SERVER_ERROR,{method:"getCode",params:r,result:n,error:e})}}))}getStorageAt(e,t,r){return Kl(this,void 0,void 0,(function*(){yield this.getNetwork();const n=yield ga({address:this._getAddress(e),blockTag:this._getBlockTag(r),position:Promise.resolve(t).then((e=>Do(e)))}),i=yield this.perform("getStorageAt",n);try{return No(i)}catch(e){return Jl.throwError("bad result from backend",bo.errors.SERVER_ERROR,{method:"getStorageAt",params:n,result:i,error:e})}}))}_wrapTransaction(e,t,r){if(null!=t&&32!==Oo(t))throw new Error("invalid response - sendTransaction");const n=e;return null!=t&&e.hash!==t&&Jl.throwError("Transaction hash mismatch from Provider.sendTransaction.",bo.errors.UNKNOWN_ERROR,{expectedHash:e.hash,returnedHash:t}),n.wait=(t,n)=>Kl(this,void 0,void 0,(function*(){let i;null==t&&(t=1),null==n&&(n=0),0!==t&&null!=r&&(i={data:e.data,from:e.from,nonce:e.nonce,to:e.to,value:e.value,startBlock:r});const o=yield this._waitForTransaction(e.hash,t,n,i);return null==o&&0===t?null:(this._emitted["t:"+e.hash]=o.blockNumber,0===o.status&&Jl.throwError("transaction failed",bo.errors.CALL_EXCEPTION,{transactionHash:e.hash,transaction:e,receipt:o}),o)})),n}sendTransaction(e){return Kl(this,void 0,void 0,(function*(){yield this.getNetwork();const t=yield Promise.resolve(e).then((e=>No(e))),r=this.formatter.transaction(e);null==r.confirmations&&(r.confirmations=0);const n=yield this._getInternalBlockNumber(100+2*this.pollingInterval);try{const e=yield this.perform("sendTransaction",{signedTransaction:t});return this._wrapTransaction(r,e,n)}catch(e){throw e.transaction=r,e.transactionHash=r.hash,e}}))}_getTransactionRequest(e){return Kl(this,void 0,void 0,(function*(){const t=yield e,r={};return["from","to"].forEach((e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then((e=>e?this._getAddress(e):null)))})),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach((e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then((e=>e?Go.from(e):null)))})),["type"].forEach((e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then((e=>null!=e?e:null)))})),t.accessList&&(r.accessList=this.formatter.accessList(t.accessList)),["data"].forEach((e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then((e=>e?No(e):null)))})),this.formatter.transactionRequest(yield ga(r))}))}_getFilter(e){return Kl(this,void 0,void 0,(function*(){e=yield e;const t={};return null!=e.address&&(t.address=this._getAddress(e.address)),["blockHash","topics"].forEach((r=>{null!=e[r]&&(t[r]=e[r])})),["fromBlock","toBlock"].forEach((r=>{null!=e[r]&&(t[r]=this._getBlockTag(e[r]))})),this.formatter.filter(yield ga(t))}))}_call(e,t,r){return Kl(this,void 0,void 0,(function*(){r>=10&&Jl.throwError("CCIP read exceeded maximum redirections",bo.errors.SERVER_ERROR,{redirects:r,transaction:e});const n=e.to,i=yield this.perform("call",{transaction:e,blockTag:t});if(r>=0&&"latest"===t&&null!=n&&"0x556f1830"===i.substring(0,10)&&Oo(i)%32==4)try{const o=To(i,4),a=To(o,0,32);Go.from(a).eq(n)||Jl.throwError("CCIP Read sender did not match",bo.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:i});const s=[],c=Go.from(To(o,32,64)).toNumber(),u=Go.from(To(o,c,c+32)).toNumber(),f=To(o,c+32);for(let t=0;tKl(this,void 0,void 0,(function*(){const e=yield this.perform("getBlock",n);if(null==e)return null!=n.blockHash&&null==this._emitted["b:"+n.blockHash]||null!=n.blockTag&&r>this._emitted.block?null:void 0;if(t){let t=null;for(let r=0;rthis._wrapTransaction(e))),r}return this.formatter.block(e)}))),{oncePoll:this})}))}getBlock(e){return this._getBlock(e,!1)}getBlockWithTransactions(e){return this._getBlock(e,!0)}getTransaction(e){return Kl(this,void 0,void 0,(function*(){yield this.getNetwork(),e=yield e;const t={transactionHash:this.formatter.hash(e,!0)};return Il((()=>Kl(this,void 0,void 0,(function*(){const r=yield this.perform("getTransaction",t);if(null==r)return null==this._emitted["t:"+e]?null:void 0;const n=this.formatter.transactionResponse(r);if(null==n.blockNumber)n.confirmations=0;else if(null==n.confirmations){let e=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-n.blockNumber+1;e<=0&&(e=1),n.confirmations=e}return this._wrapTransaction(n)}))),{oncePoll:this})}))}getTransactionReceipt(e){return Kl(this,void 0,void 0,(function*(){yield this.getNetwork(),e=yield e;const t={transactionHash:this.formatter.hash(e,!0)};return Il((()=>Kl(this,void 0,void 0,(function*(){const r=yield this.perform("getTransactionReceipt",t);if(null==r)return null==this._emitted["t:"+e]?null:void 0;if(null==r.blockHash)return;const n=this.formatter.receipt(r);if(null==n.blockNumber)n.confirmations=0;else if(null==n.confirmations){let e=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-n.blockNumber+1;e<=0&&(e=1),n.confirmations=e}return n}))),{oncePoll:this})}))}getLogs(e){return Kl(this,void 0,void 0,(function*(){yield this.getNetwork();const t=yield ga({filter:this._getFilter(e)}),r=yield this.perform("getLogs",t);return r.forEach((e=>{null==e.removed&&(e.removed=!1)})),Hl.arrayOf(this.formatter.filterLog.bind(this.formatter))(r)}))}getEtherPrice(){return Kl(this,void 0,void 0,(function*(){return yield this.getNetwork(),this.perform("getEtherPrice",{})}))}_getBlockTag(e){return Kl(this,void 0,void 0,(function*(){if("number"==typeof(e=yield e)&&e<0){e%1&&Jl.throwArgumentError("invalid BlockTag","blockTag",e);let t=yield this._getInternalBlockNumber(100+2*this.pollingInterval);return t+=e,t<0&&(t=0),this.formatter.blockTag(t)}return this.formatter.blockTag(e)}))}getResolver(e){return Kl(this,void 0,void 0,(function*(){let t=e;for(;;){if(""===t||"."===t)return null;if("eth"!==e&&"eth"===t)return null;const r=yield this._getResolver(t,"getResolver");if(null!=r){const n=new dh(this,r,e);return t===e||(yield n.supportsWildcard())?n:null}t=t.split(".").slice(1).join(".")}}))}_getResolver(e,t){return Kl(this,void 0,void 0,(function*(){null==t&&(t="ENS");const r=yield this.getNetwork();r.ensAddress||Jl.throwError("network does not support ENS",bo.errors.UNSUPPORTED_OPERATION,{operation:t,network:r.name});try{const t=yield this.call({to:r.ensAddress,data:"0x0178b8bf"+qc(e).substring(2)});return this.formatter.callAddress(t)}catch(e){}return null}))}resolveName(e){return Kl(this,void 0,void 0,(function*(){e=yield e;try{return Promise.resolve(this.formatter.address(e))}catch(t){if(Io(e))throw t}"string"!=typeof e&&Jl.throwArgumentError("invalid ENS name","name",e);const t=yield this.getResolver(e);return t?yield t.getAddress():null}))}lookupAddress(e){return Kl(this,void 0,void 0,(function*(){e=yield e;const t=(e=this.formatter.address(e)).substring(2).toLowerCase()+".addr.reverse",r=yield this._getResolver(t,"lookupAddress");if(null==r)return null;const n=oh(yield this.call({to:r,data:"0x691f3431"+qc(t).substring(2)}),0);return(yield this.resolveName(n))!=e?null:n}))}getAvatar(e){return Kl(this,void 0,void 0,(function*(){let t=null;if(Io(e)){const r=this.formatter.address(e).substring(2).toLowerCase()+".addr.reverse",n=yield this._getResolver(r,"getAvatar");if(!n)return null;t=new dh(this,n,r);try{const e=yield t.getAvatar();if(e)return e.url}catch(e){if(e.code!==bo.errors.CALL_EXCEPTION)throw e}try{const e=oh(yield this.call({to:n,data:"0x691f3431"+qc(r).substring(2)}),0);t=yield this.getResolver(e)}catch(e){if(e.code!==bo.errors.CALL_EXCEPTION)throw e;return null}}else if(t=yield this.getResolver(e),!t)return null;const r=yield t.getAvatar();return null==r?null:r.url}))}perform(e,t){return Jl.throwError(e+" not implemented",bo.errors.NOT_IMPLEMENTED,{operation:e})}_startEvent(e){this.polling=this._events.filter((e=>e.pollable())).length>0}_stopEvent(e){this.polling=this._events.filter((e=>e.pollable())).length>0}_addEventListener(e,t,r){const n=new Yl(Vl(e),t,r);return this._events.push(n),this._startEvent(n),this}on(e,t){return this._addEventListener(e,t,!1)}once(e,t){return this._addEventListener(e,t,!0)}emit(e,...t){let r=!1,n=[],i=Vl(e);return this._events=this._events.filter((e=>e.tag!==i||(setTimeout((()=>{e.listener.apply(this,t)}),0),r=!0,!e.once||(n.push(e),!1)))),n.forEach((e=>{this._stopEvent(e)})),r}listenerCount(e){if(!e)return this._events.length;let t=Vl(e);return this._events.filter((e=>e.tag===t)).length}listeners(e){if(null==e)return this._events.map((e=>e.listener));let t=Vl(e);return this._events.filter((e=>e.tag===t)).map((e=>e.listener))}off(e,t){if(null==t)return this.removeAllListeners(e);const r=[];let n=!1,i=Vl(e);return this._events=this._events.filter((e=>e.tag!==i||e.listener!=t||(!!n||(n=!0,r.push(e),!1)))),r.forEach((e=>{this._stopEvent(e)})),this}removeAllListeners(e){let t=[];if(null==e)t=this._events,this._events=[];else{const r=Vl(e);this._events=this._events.filter((e=>e.tag!==r||(t.push(e),!1)))}return t.forEach((e=>{this._stopEvent(e)})),this}}var mh=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))};const gh=new bo(Ll),yh=["call","estimateGas"];function bh(e,t){if(null==e)return null;if("string"==typeof e.message&&e.message.match("reverted")){const r=Io(e.data)?e.data:null;if(!t||r)return{message:e.message,data:r}}if("object"==typeof e){for(const r in e){const n=bh(e[r],t);if(n)return n}return null}if("string"==typeof e)try{return bh(JSON.parse(e),t)}catch(e){}return null}function vh(e,t,r){const n=r.transaction||r.signedTransaction;if("call"===e){const e=bh(t,!0);if(e)return e.data;gh.throwError("missing revert data in call exception; Transaction reverted without a reason string",bo.errors.CALL_EXCEPTION,{data:"0x",transaction:n,error:t})}if("estimateGas"===e){let r=bh(t.body,!1);null==r&&(r=bh(t,!1)),r&&gh.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",bo.errors.UNPREDICTABLE_GAS_LIMIT,{reason:r.message,method:e,transaction:n,error:t})}let i=t.message;throw t.code===bo.errors.SERVER_ERROR&&t.error&&"string"==typeof t.error.message?i=t.error.message:"string"==typeof t.body?i=t.body:"string"==typeof t.responseText&&(i=t.responseText),i=(i||"").toLowerCase(),i.match(/insufficient funds|base fee exceeds gas limit|InsufficientFunds/i)&&gh.throwError("insufficient funds for intrinsic transaction cost",bo.errors.INSUFFICIENT_FUNDS,{error:t,method:e,transaction:n}),i.match(/nonce (is )?too low/i)&&gh.throwError("nonce has already been used",bo.errors.NONCE_EXPIRED,{error:t,method:e,transaction:n}),i.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&gh.throwError("replacement fee too low",bo.errors.REPLACEMENT_UNDERPRICED,{error:t,method:e,transaction:n}),i.match(/only replay-protected/i)&&gh.throwError("legacy pre-eip-155 transactions not supported",bo.errors.UNSUPPORTED_OPERATION,{error:t,method:e,transaction:n}),yh.indexOf(e)>=0&&i.match(/gas required exceeds allowance|always failing transaction|execution reverted|revert/)&&gh.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",bo.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,method:e,transaction:n}),t}function wh(e){return new Promise((function(t){setTimeout(t,e)}))}function Ah(e){if(e.error){const t=new Error(e.error.message);throw t.code=e.error.code,t.data=e.error.data,t}return e.result}function _h(e){return e?e.toLowerCase():e}const Eh={};class Sh extends ku{constructor(e,t,r){if(super(),e!==Eh)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");pa(this,"provider",t),null==r&&(r=0),"string"==typeof r?(pa(this,"_address",this.provider.formatter.address(r)),pa(this,"_index",null)):"number"==typeof r?(pa(this,"_index",r),pa(this,"_address",null)):gh.throwArgumentError("invalid address or index","addressOrIndex",r)}connect(e){return gh.throwError("cannot alter JSON-RPC Signer connection",bo.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}connectUnchecked(){return new Ph(Eh,this.provider,this._address||this._index)}getAddress(){return this._address?Promise.resolve(this._address):this.provider.send("eth_accounts",[]).then((e=>(e.length<=this._index&&gh.throwError("unknown account #"+this._index,bo.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),this.provider.formatter.address(e[this._index]))))}sendUncheckedTransaction(e){e=ba(e);const t=this.getAddress().then((e=>(e&&(e=e.toLowerCase()),e)));if(null==e.gasLimit){const r=ba(e);r.from=t,e.gasLimit=this.provider.estimateGas(r)}return null!=e.to&&(e.to=Promise.resolve(e.to).then((e=>mh(this,void 0,void 0,(function*(){if(null==e)return null;const t=yield this.provider.resolveName(e);return null==t&&gh.throwArgumentError("provided ENS name resolves to null","tx.to",e),t}))))),ga({tx:ga(e),sender:t}).then((({tx:t,sender:r})=>{null!=t.from?t.from.toLowerCase()!==r&&gh.throwArgumentError("from address mismatch","transaction",e):t.from=r;const n=this.provider.constructor.hexlifyTransaction(t,{from:!0});return this.provider.send("eth_sendTransaction",[n]).then((e=>e),(e=>("string"==typeof e.message&&e.message.match(/user denied/i)&&gh.throwError("user rejected transaction",bo.errors.ACTION_REJECTED,{action:"sendTransaction",transaction:t}),vh("sendTransaction",e,n))))}))}signTransaction(e){return gh.throwError("signing transactions is unsupported",bo.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}sendTransaction(e){return mh(this,void 0,void 0,(function*(){const t=yield this.provider._getInternalBlockNumber(100+2*this.provider.pollingInterval),r=yield this.sendUncheckedTransaction(e);try{return yield Il((()=>mh(this,void 0,void 0,(function*(){const e=yield this.provider.getTransaction(r);if(null!==e)return this.provider._wrapTransaction(e,r,t)}))),{oncePoll:this.provider})}catch(e){throw e.transactionHash=r,e}}))}signMessage(e){return mh(this,void 0,void 0,(function*(){const t="string"==typeof e?Hs(e):e,r=yield this.getAddress();try{return yield this.provider.send("personal_sign",[No(t),r.toLowerCase()])}catch(t){throw"string"==typeof t.message&&t.message.match(/user denied/i)&&gh.throwError("user rejected signing",bo.errors.ACTION_REJECTED,{action:"signMessage",from:r,messageData:e}),t}}))}_legacySignMessage(e){return mh(this,void 0,void 0,(function*(){const t="string"==typeof e?Hs(e):e,r=yield this.getAddress();try{return yield this.provider.send("eth_sign",[r.toLowerCase(),No(t)])}catch(t){throw"string"==typeof t.message&&t.message.match(/user denied/i)&&gh.throwError("user rejected signing",bo.errors.ACTION_REJECTED,{action:"_legacySignMessage",from:r,messageData:e}),t}}))}_signTypedData(e,t,r){return mh(this,void 0,void 0,(function*(){const n=yield cu.resolveNames(e,t,r,(e=>this.provider.resolveName(e))),i=yield this.getAddress();try{return yield this.provider.send("eth_signTypedData_v4",[i.toLowerCase(),JSON.stringify(cu.getPayload(n.domain,t,n.value))])}catch(e){throw"string"==typeof e.message&&e.message.match(/user denied/i)&&gh.throwError("user rejected signing",bo.errors.ACTION_REJECTED,{action:"_signTypedData",from:i,messageData:{domain:n.domain,types:t,value:n.value}}),e}}))}unlock(e){return mh(this,void 0,void 0,(function*(){const t=this.provider,r=yield this.getAddress();return t.send("personal_unlockAccount",[r.toLowerCase(),e,null])}))}}class Ph extends Sh{sendTransaction(e){return this.sendUncheckedTransaction(e).then((e=>({hash:e,nonce:null,gasLimit:null,gasPrice:null,data:null,value:null,chainId:null,confirmations:0,from:null,wait:t=>this.provider.waitForTransaction(e,t)})))}}const xh={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0};class kh extends ph{constructor(e,t){let r=t;null==r&&(r=new Promise(((e,t)=>{setTimeout((()=>{this.detectNetwork().then((t=>{e(t)}),(e=>{t(e)}))}),0)}))),super(r),e||(e=ma(this.constructor,"defaultUrl")()),pa(this,"connection","string"==typeof e?Object.freeze({url:e}):Object.freeze(ba(e))),this._nextId=42}get _cache(){return null==this._eventLoopCache&&(this._eventLoopCache={}),this._eventLoopCache}static defaultUrl(){return"http://localhost:8545"}detectNetwork(){return this._cache.detectNetwork||(this._cache.detectNetwork=this._uncachedDetectNetwork(),setTimeout((()=>{this._cache.detectNetwork=null}),0)),this._cache.detectNetwork}_uncachedDetectNetwork(){return mh(this,void 0,void 0,(function*(){yield wh(0);let e=null;try{e=yield this.send("eth_chainId",[])}catch(t){try{e=yield this.send("net_version",[])}catch(e){}}if(null!=e){const t=ma(this.constructor,"getNetwork");try{return t(Go.from(e).toNumber())}catch(t){return gh.throwError("could not detect network",bo.errors.NETWORK_ERROR,{chainId:e,event:"invalidNetwork",serverError:t})}}return gh.throwError("could not detect network",bo.errors.NETWORK_ERROR,{event:"noNetwork"})}))}getSigner(e){return new Sh(Eh,this,e)}getUncheckedSigner(e){return this.getSigner(e).connectUnchecked()}listAccounts(){return this.send("eth_accounts",[]).then((e=>e.map((e=>this.formatter.address(e)))))}send(e,t){const r={method:e,params:t,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:_a(r),provider:this});const n=["eth_chainId","eth_blockNumber"].indexOf(e)>=0;if(n&&this._cache[e])return this._cache[e];const i=Cl(this.connection,JSON.stringify(r),Ah).then((e=>(this.emit("debug",{action:"response",request:r,response:e,provider:this}),e)),(e=>{throw this.emit("debug",{action:"response",error:e,request:r,provider:this}),e}));return n&&(this._cache[e]=i,setTimeout((()=>{this._cache[e]=null}),0)),i}prepareRequest(e,t){switch(e){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[_h(t.address),t.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[_h(t.address),t.blockTag]];case"getCode":return["eth_getCode",[_h(t.address),t.blockTag]];case"getStorageAt":return["eth_getStorageAt",[_h(t.address),Bo(t.position,32),t.blockTag]];case"sendTransaction":return["eth_sendRawTransaction",[t.signedTransaction]];case"getBlock":return t.blockTag?["eth_getBlockByNumber",[t.blockTag,!!t.includeTransactions]]:t.blockHash?["eth_getBlockByHash",[t.blockHash,!!t.includeTransactions]]:null;case"getTransaction":return["eth_getTransactionByHash",[t.transactionHash]];case"getTransactionReceipt":return["eth_getTransactionReceipt",[t.transactionHash]];case"call":return["eth_call",[ma(this.constructor,"hexlifyTransaction")(t.transaction,{from:!0}),t.blockTag]];case"estimateGas":return["eth_estimateGas",[ma(this.constructor,"hexlifyTransaction")(t.transaction,{from:!0})]];case"getLogs":return t.filter&&null!=t.filter.address&&(t.filter.address=_h(t.filter.address)),["eth_getLogs",[t.filter]]}return null}perform(e,t){return mh(this,void 0,void 0,(function*(){if("call"===e||"estimateGas"===e){const e=t.transaction;if(e&&null!=e.type&&Go.from(e.type).isZero()&&null==e.maxFeePerGas&&null==e.maxPriorityFeePerGas){const r=yield this.getFeeData();null==r.maxFeePerGas&&null==r.maxPriorityFeePerGas&&((t=ba(t)).transaction=ba(e),delete t.transaction.type)}}const r=this.prepareRequest(e,t);null==r&&gh.throwError(e+" not implemented",bo.errors.NOT_IMPLEMENTED,{operation:e});try{return yield this.send(r[0],r[1])}catch(r){return vh(e,r,t)}}))}_startEvent(e){"pending"===e.tag&&this._startPending(),super._startEvent(e)}_startPending(){if(null!=this._pendingFilter)return;const e=this,t=this.send("eth_newPendingTransactionFilter",[]);this._pendingFilter=t,t.then((function(r){return function n(){e.send("eth_getFilterChanges",[r]).then((function(r){if(e._pendingFilter!=t)return null;let n=Promise.resolve();return r.forEach((function(t){e._emitted["t:"+t.toLowerCase()]="pending",n=n.then((function(){return e.getTransaction(t).then((function(t){return e.emit("pending",t),null}))}))})),n.then((function(){return wh(1e3)}))})).then((function(){if(e._pendingFilter==t)return setTimeout((function(){n()}),0),null;e.send("eth_uninstallFilter",[r])})).catch((e=>{}))}(),r})).catch((e=>{}))}_stopEvent(e){"pending"===e.tag&&0===this.listenerCount("pending")&&(this._pendingFilter=null),super._stopEvent(e)}static hexlifyTransaction(e,t){const r=ba(xh);if(t)for(const e in t)t[e]&&(r[e]=!0);ya(e,r);const n={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach((function(t){if(null==e[t])return;const r=Do(Go.from(e[t]));"gasLimit"===t&&(t="gas"),n[t]=r})),["from","to","data"].forEach((function(t){null!=e[t]&&(n[t]=No(e[t]))})),e.accessList&&(n.accessList=If(e.accessList)),n}}const Mh=new RegExp("^bytes([0-9]+)$"),Ch=new RegExp("^(u?int)([0-9]*)$"),Ih=new RegExp("^(.*)\\[([0-9]*)\\]$"),Rh="0000000000000000000000000000000000000000000000000000000000000000",Nh=new bo("solidity/5.7.0");function Oh(e,t,r){switch(e){case"address":return r?Co(t,32):xo(t);case"string":return Hs(t);case"bytes":return xo(t);case"bool":return t=t?"0x01":"0x00",r?Co(t,32):xo(t)}let n=e.match(Ch);if(n){let i=parseInt(n[2]||"256");return(n[2]&&String(i)!==n[2]||i%8!=0||0===i||i>256)&&Nh.throwArgumentError("invalid number type","type",e),r&&(i=256),Co(t=Go.from(t).toTwos(i),i/8)}if(n=e.match(Mh),n){const i=parseInt(n[1]);return(String(i)!==n[1]||0===i||i>32)&&Nh.throwArgumentError("invalid bytes type","type",e),xo(t).byteLength!==i&&Nh.throwArgumentError(`invalid value for ${e}`,"value",t),r?xo((t+Rh).substring(0,66)):t}if(n=e.match(Ih),n&&Array.isArray(t)){const r=n[1];parseInt(n[2]||String(t.length))!=t.length&&Nh.throwArgumentError(`invalid array length for ${e}`,"value",t);const i=[];return t.forEach((function(e){i.push(Oh(r,e,!0))})),ko(i)}return Nh.throwArgumentError("invalid type","type",e)}function Th(e,t){e.length!=t.length&&Nh.throwArgumentError("wrong number of values; expected ${ types.length }","values",t);const r=[];return e.forEach((function(e,n){r.push(Oh(e,t[n]))})),No(ko(r))}var jh=Object.freeze({__proto__:null,keccak256:function(e,t){return rs(Th(e,t))},pack:Th,sha256:function(e,t){return ad(Th(e,t))}});const Dh=new bo("units/5.7.0"),$h=["wei","kwei","mwei","gwei","szabo","finney","ether"];function Bh(e,t){if("string"==typeof t){const e=$h.indexOf(t);-1!==e&&(t=3*e)}return aa(e,null!=t?t:18)}function Fh(e,t){if("string"!=typeof e&&Dh.throwArgumentError("value must be a string","value",e),"string"==typeof t){const e=$h.indexOf(t);-1!==e&&(t=3*e)}return sa(e,null!=t?t:18)}var zh=Object.freeze({__proto__:null,commify:function(e){const t=String(e).split(".");(t.length>2||!t[0].match(/^-?[0-9]*$/)||t[1]&&!t[1].match(/^[0-9]*$/)||"."===e||"-."===e)&&Dh.throwArgumentError("invalid value","value",e);let r=t[0],n="";for("-"===r.substring(0,1)&&(n="-",r=r.substring(1));"0"===r.substring(0,1);)r=r.substring(1);""===r&&(r="0");let i="";for(2===t.length&&(i="."+(t[1]||"0"));i.length>2&&"0"===i[i.length-1];)i=i.substring(0,i.length-1);const o=[];for(;r.length;){if(r.length<=3){o.unshift(r);break}{const e=r.length-3;o.unshift(r.substring(e)),r=r.substring(0,e)}}return n+o.join(",")+i},formatEther:function(e){return Bh(e,18)},formatUnits:Bh,parseEther:function(e){return Fh(e,18)},parseUnits:Fh});function Uh(e){if(null==e.match(/^(0x)?([\da-fA-F]{40})$/))throw new RangeError("incorrect address format");try{return bs(no(e,!0,20))}catch(e){throw new nn(e,["invalid EIP-55 address"])}}async function Lh(e){return t(await oo(eo(e),"SHA-256"),!0,!1)}async function qh(e,t){if(void 0===e.iss)throw new Error('Payload iss should be set to either "orig" or "dest"');const r=JSON.parse(e.exchange[e.iss]);await Xi(r,t);const n=await Ki(t),i=t.alg,o={...e,iat:Math.floor(Date.now()/1e3)};return{jws:await new Li(o).setProtectedHeader({alg:i}).setIssuedAt(o.iat).sign(n),payload:o}}async function Hh(e,t,r){const n=JSON.parse(t.exchange[t.iss]),i=await Gi(e,n);if(void 0===i.payload.iss)throw new Error('Property "iss" missing');if(void 0===i.payload.iat)throw new Error("Property claim iat missing");if(void 0!==r){to("iat"===r.timestamp?1e3*i.payload.iat:r.timestamp,"iat"===r.notBefore?1e3*i.payload.iat:r.notBefore,"iat"===r.notAfter?1e3*i.payload.iat:r.notAfter,r.tolerance)}const o=i.payload,a=o.exchange[o.iss];if(eo(n)!==eo(JSON.parse(a)))throw new Error(`The proof is issued by ${a} instead of ${JSON.stringify(n)}`);const s=t;for(const e in s){if(void 0===o[e])throw new Error(`Expected key '${e}' not found in proof`);if("exchange"===e){const e=t.exchange;Kh(o.exchange,e)}else if(""!==s[e]&&eo(s[e])!==eo(o[e]))throw new Error(`Proof's ${e}: ${JSON.stringify(o[e],void 0,2)} does not meet provided value ${JSON.stringify(s[e],void 0,2)}`)}return i}function Kh(e,t){const r=["id","orig","dest","hashAlg","cipherblockDgst","blockCommitment","blockCommitment","secretCommitment","schema"];for(const t of r)if("schema"!==t&&(void 0===e[t]||""===e[t]))throw new Error(`${t} is missing on dataExchange.\ndataExchange: ${JSON.stringify(e,void 0,2)}`);for(const r in t)if(""!==t[r]&&eo(t[r])!==eo(e[r]))throw new Error(`dataExchange's ${r}: ${JSON.stringify(e[r],void 0,2)} does not meet expected value ${JSON.stringify(t[r],void 0,2)}`)}async function Jh(e,t,r=10){const{payload:n}=await Gi(e),i=n.exchange,o={...i};delete o.id;if(await Lh(o)!==i.id)throw new nn(new Error("data exchange integrity failed"),["dataExchange integrity violated"]);const a=JSON.parse(i.dest),s=JSON.parse(i.orig);let c,u,f;try{c=(await Hh(n.poo,{iss:"orig",proofType:"PoO",exchange:i})).payload}catch(e){throw new nn(e,["invalid poo"])}try{await Hh(e,{iss:"dest",proofType:"PoR",exchange:i},{timestamp:"iat",notBefore:1e3*c.iat,notAfter:1e3*c.iat+i.pooToPorDelay})}catch(e){throw new nn(e,["invalid por"])}try{const e=await t.getSecretFromLedger(Vi(i.encAlg),i.ledgerSignerAddress,i.id,r);u=e.hex,f=e.iat}catch(e){throw new nn(e,["cannot verify"])}try{to(1e3*f,1e3*n.iat,1e3*c.iat+i.pooToSecretDelay)}catch(e){throw new nn(`Although the secret has been obtained (and you could try to decrypt the cipherblock), it's been published later than agreed: ${new Date(1e3*f).toUTCString()} > ${new Date(1e3*c.iat+i.pooToSecretDelay).toUTCString()}`,["secret not published in time"])}return{pooPayload:c,porPayload:n,secretHex:u,destPublicJwk:a,origPublicJwk:s}}async function Wh(e,t,r=10){let n,i,o,a,s;try{n=(await Gi(e)).payload}catch(e){throw new nn(e,["invalid verification request"])}try{const e=await Jh(n.por,t,r);i=e.destPublicJwk,o=e.origPublicJwk,a=e.pooPayload,s=e.porPayload}catch(e){throw new nn(e,["invalid por","invalid verification request"])}try{await Gi(e,"dest"===n.iss?i:o)}catch(e){throw new nn(e,["invalid verification request"])}return{pooPayload:a,porPayload:s,vrPayload:n,destPublicJwk:i,origPublicJwk:o}}async function Gh(e,r){const{payload:n}=await Gi(e),{destPublicJwk:i,origPublicJwk:o,secretHex:a,pooPayload:s,porPayload:c}=await Jh(n.por,r);try{await Gi(e,i)}catch(e){throw e instanceof nn&&e.add("invalid dispute request"),e}if(t(await oo(n.cipherblock,c.exchange.hashAlg),!0,!1)!==c.exchange.cipherblockDgst)throw new nn(new Error("cipherblock does not meet the committed (and already accepted) one"),["invalid dispute request"]);return await Wi(n.cipherblock,(await Zi(c.exchange.encAlg,a)).jwk),{pooPayload:s,porPayload:c,drPayload:n,destPublicJwk:i,origPublicJwk:o}}async function Vh(e,t,r,n){const i={proofType:"request",iss:e,dataExchangeId:t,por:r,type:"verificationRequest",iat:Math.floor(Date.now()/1e3)},o=await hi(n);return await new Li(i).setProtectedHeader({alg:n.alg}).setIssuedAt(i.iat).sign(o)}var Zh=Object.freeze({__proto__:null,ConflictResolver:class{constructor(e,t){this.jwkPair=e,this.dltAgent=t,this.initialized=new Promise(((e,t)=>{this.init().then((()=>{e(!0)})).catch((e=>{t(e)}))}))}async init(){await Xi(this.jwkPair.publicJwk,this.jwkPair.privateJwk)}async resolveCompleteness(e){await this.initialized;const{payload:t}=await Gi(e);let r;try{r=(await Gi(t.por)).payload}catch(e){throw new nn(e,["invalid por"])}const n={...await this._resolution(t.dataExchangeId,r.exchange[t.iss]),resolution:"not completed",type:"verification"};try{await Wh(e,this.dltAgent),n.resolution="completed"}catch(e){if(!(e instanceof nn)||e.nrErrors.includes("invalid verification request")||e.nrErrors.includes("unexpected error"))throw e}const i=await hi(this.jwkPair.privateJwk);return await new Li(n).setProtectedHeader({alg:this.jwkPair.privateJwk.alg}).setIssuedAt(n.iat).sign(i)}async resolveDispute(e){await this.initialized;const{payload:t}=await Gi(e);let r;try{r=(await Gi(t.por)).payload}catch(e){throw new nn(e,["invalid por"])}const n={...await this._resolution(t.dataExchangeId,r.exchange[t.iss]),resolution:"denied",type:"dispute"};try{await Gh(e,this.dltAgent)}catch(e){if(!(e instanceof nn&&e.nrErrors.includes("decryption failed")))throw new nn(e,["cannot verify"]);n.resolution="accepted"}const i=await hi(this.jwkPair.privateJwk);return await new Li(n).setProtectedHeader({alg:this.jwkPair.privateJwk.alg}).setIssuedAt(n.iat).sign(i)}async _resolution(e,t){return{proofType:"resolution",dataExchangeId:e,iat:Math.floor(Date.now()/1e3),iss:await io(this.jwkPair.publicJwk,!0),sub:t}}},checkCompleteness:Wh,checkDecryption:Gh,generateVerificationRequest:Vh,verifyPor:Jh,verifyResolution:async function(e,t){return await Gi(e,t??((e,t)=>JSON.parse(t.iss)))}});const Xh={gasLimit:125e5,contract:{address:"0x8d407A1722633bDD1dcf221474be7a44C05d7c2F",abi:[{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"sender",type:"address"},{indexed:!1,internalType:"uint256",name:"dataExchangeId",type:"uint256"},{indexed:!1,internalType:"uint256",name:"timestamp",type:"uint256"},{indexed:!1,internalType:"uint256",name:"secret",type:"uint256"}],name:"Registration",type:"event"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"uint256",name:"",type:"uint256"}],name:"registry",outputs:[{internalType:"uint256",name:"timestamp",type:"uint256"},{internalType:"uint256",name:"secret",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"_dataExchangeId",type:"uint256"},{internalType:"uint256",name:"_secret",type:"uint256"}],name:"setRegistry",outputs:[],stateMutability:"nonpayable",type:"function"}],transactionHash:"0x6a3828f8fe232819dc40ca66f93930b3bd1619db31a67ec34b44446b3e7c8289",receipt:{to:null,from:"0x17bd12C2134AfC1f6E9302a532eFE30C19B9E903",contractAddress:"0x8d407A1722633bDD1dcf221474be7a44C05d7c2F",transactionIndex:0,gasUsed:"253928",logsBloom:"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",blockHash:"0x0118672bb9b27679e616831d056d36291dd20cfe88c3ee2abd8f2dfce579cad4",transactionHash:"0x6a3828f8fe232819dc40ca66f93930b3bd1619db31a67ec34b44446b3e7c8289",logs:[],blockNumber:119389,cumulativeGasUsed:"253928",status:1,byzantium:!0},args:[],solcInputHash:"c528a37588793ef74285d75e08d6b8eb",metadata:'{"compiler":{"version":"0.8.4+commit.c7e474f2"},"language":"Solidity","output":{"abi":[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"dataExchangeId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"secret","type":"uint256"}],"name":"Registration","type":"event"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"registry","outputs":[{"internalType":"uint256","name":"timestamp","type":"uint256"},{"internalType":"uint256","name":"secret","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_dataExchangeId","type":"uint256"},{"internalType":"uint256","name":"_secret","type":"uint256"}],"name":"setRegistry","outputs":[],"stateMutability":"nonpayable","type":"function"}],"devdoc":{"kind":"dev","methods":{},"version":1},"userdoc":{"kind":"user","methods":{},"version":1}},"settings":{"compilationTarget":{"contracts/NonRepudiation.sol":"NonRepudiation"},"evmVersion":"istanbul","libraries":{},"metadata":{"bytecodeHash":"ipfs","useLiteralContent":true},"optimizer":{"enabled":false,"runs":200},"remappings":[]},"sources":{"contracts/NonRepudiation.sol":{"content":"//SPDX-License-Identifier: Unlicense\\npragma solidity ^0.8.0;\\n\\ncontract NonRepudiation {\\n struct Proof {\\n uint256 timestamp;\\n uint256 secret;\\n }\\n mapping(address => mapping (uint256 => Proof)) public registry;\\n event Registration(address sender, uint256 dataExchangeId, uint256 timestamp, uint256 secret);\\n\\n function setRegistry(uint256 _dataExchangeId, uint256 _secret) public {\\n require(registry[msg.sender][_dataExchangeId].secret == 0);\\n registry[msg.sender][_dataExchangeId] = Proof(block.timestamp, _secret);\\n emit Registration(msg.sender, _dataExchangeId, block.timestamp, _secret);\\n }\\n}\\n","keccak256":"0x8d371257a9b03c9102f158323e61f56ce49dd8489bd92c5a7d8abc3d9f6f8399","license":"Unlicense"}},"version":1}',bytecode:"0x608060405234801561001057600080fd5b506103a2806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c8063032439371461003b578063d05cb54514610057575b600080fd5b6100556004803603810190610050919061023a565b610088565b005b610071600480360381019061006c91906101fe565b6101a3565b60405161007f9291906102d9565b60405180910390f35b60008060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002060010154146100e757600080fd5b6040518060400160405280428152602001828152506000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002060008201518160000155602082015181600101559050507faa58599838af2e5e0f3251cfbb4eac5d5d447ded49f6b0ac28d6b44098224e63338342846040516101979493929190610294565b60405180910390a15050565b6000602052816000526040600020602052806000526040600020600091509150508060000154908060010154905082565b6000813590506101e38161033e565b92915050565b6000813590506101f881610355565b92915050565b6000806040838503121561021157600080fd5b600061021f858286016101d4565b9250506020610230858286016101e9565b9150509250929050565b6000806040838503121561024d57600080fd5b600061025b858286016101e9565b925050602061026c858286016101e9565b9150509250929050565b61027f81610302565b82525050565b61028e81610334565b82525050565b60006080820190506102a96000830187610276565b6102b66020830186610285565b6102c36040830185610285565b6102d06060830184610285565b95945050505050565b60006040820190506102ee6000830185610285565b6102fb6020830184610285565b9392505050565b600061030d82610314565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b61034781610302565b811461035257600080fd5b50565b61035e81610334565b811461036957600080fd5b5056fea26469706673582212204fd0fc653fb487221da9a14a4ca5d5499f9e9bc7b27ac8ab0f8d397fd6e3148564736f6c63430008040033",deployedBytecode:"0x608060405234801561001057600080fd5b50600436106100365760003560e01c8063032439371461003b578063d05cb54514610057575b600080fd5b6100556004803603810190610050919061023a565b610088565b005b610071600480360381019061006c91906101fe565b6101a3565b60405161007f9291906102d9565b60405180910390f35b60008060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002060010154146100e757600080fd5b6040518060400160405280428152602001828152506000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002060008201518160000155602082015181600101559050507faa58599838af2e5e0f3251cfbb4eac5d5d447ded49f6b0ac28d6b44098224e63338342846040516101979493929190610294565b60405180910390a15050565b6000602052816000526040600020602052806000526040600020600091509150508060000154908060010154905082565b6000813590506101e38161033e565b92915050565b6000813590506101f881610355565b92915050565b6000806040838503121561021157600080fd5b600061021f858286016101d4565b9250506020610230858286016101e9565b9150509250929050565b6000806040838503121561024d57600080fd5b600061025b858286016101e9565b925050602061026c858286016101e9565b9150509250929050565b61027f81610302565b82525050565b61028e81610334565b82525050565b60006080820190506102a96000830187610276565b6102b66020830186610285565b6102c36040830185610285565b6102d06060830184610285565b95945050505050565b60006040820190506102ee6000830185610285565b6102fb6020830184610285565b9392505050565b600061030d82610314565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b61034781610302565b811461035257600080fd5b50565b61035e81610334565b811461036957600080fd5b5056fea26469706673582212204fd0fc653fb487221da9a14a4ca5d5499f9e9bc7b27ac8ab0f8d397fd6e3148564736f6c63430008040033",devdoc:{kind:"dev",methods:{},version:1},userdoc:{kind:"user",methods:{},version:1},storageLayout:{storage:[{astId:13,contract:"contracts/NonRepudiation.sol:NonRepudiation",label:"registry",offset:0,slot:"0",type:"t_mapping(t_address,t_mapping(t_uint256,t_struct(Proof)6_storage))"}],types:{t_address:{encoding:"inplace",label:"address",numberOfBytes:"20"},"t_mapping(t_address,t_mapping(t_uint256,t_struct(Proof)6_storage))":{encoding:"mapping",key:"t_address",label:"mapping(address => mapping(uint256 => struct NonRepudiation.Proof))",numberOfBytes:"32",value:"t_mapping(t_uint256,t_struct(Proof)6_storage)"},"t_mapping(t_uint256,t_struct(Proof)6_storage)":{encoding:"mapping",key:"t_uint256",label:"mapping(uint256 => struct NonRepudiation.Proof)",numberOfBytes:"32",value:"t_struct(Proof)6_storage"},"t_struct(Proof)6_storage":{encoding:"inplace",label:"struct NonRepudiation.Proof",members:[{astId:3,contract:"contracts/NonRepudiation.sol:NonRepudiation",label:"timestamp",offset:0,slot:"0",type:"t_uint256"},{astId:5,contract:"contracts/NonRepudiation.sol:NonRepudiation",label:"secret",offset:0,slot:"1",type:"t_uint256"}],numberOfBytes:"64"},t_uint256:{encoding:"inplace",label:"uint256",numberOfBytes:"32"}}}}};async function Qh(e,t,n,o,a){let s=Go.from(0),c=Go.from(0);const u=no(i(r(n)),!0);let f=0;do{try{({secret:s,timestamp:c}=await e.registry(no(t,!0),u))}catch(e){throw new nn(e,["cannot contact the ledger"])}s.isZero()&&(f++,await new Promise((e=>setTimeout(e,1e3))))}while(s.isZero()&&f{null!==e&&"object"==typeof e&&"function"==typeof e.then?e.then((e=>{this.dltConfig={...Xh,...e},this.provider=new kh(this.dltConfig.rpcProviderUrl),this.contract=new Qf(this.dltConfig.contract.address,this.dltConfig.contract.abi,this.provider),t(!0)})).catch((e=>r(e))):(this.dltConfig={...Xh,...e},this.provider=new kh(this.dltConfig.rpcProviderUrl),this.contract=new Qf(this.dltConfig.contract.address,this.dltConfig.contract.abi,this.provider),t(!0))}))}async getContractAddress(){return await this.initialized,this.contract.address}}class rp extends tp{async getSecretFromLedger(e,t,r,n){return await this.initialized,await Qh(this.contract,t,r,n,e)}}class np extends tp{constructor(e,t,r){const n=new Promise(((t,n)=>{e.providerinfo.get().then((e=>{const i=e.rpcUrl;void 0===i?n(new Error("wallet is not connected to RPC endpoint")):t({...r,rpcProviderUrl:"string"==typeof i?i:i[0]})})).catch((e=>{n(e)}))}));super(n),this.wallet=e,this.did=t}}class ip extends np{async getSecretFromLedger(e,t,r,n){return await this.initialized,await Qh(this.contract,t,r,n,e)}}class op extends tp{constructor(e,t,r){const n=new Promise(((t,n)=>{e.providerinfoGet().then((e=>{const i=e.rpcUrl;void 0===i?n(new Error("wallet is not connected to RPC endpoint")):t({...r,rpcProviderUrl:"string"==typeof i?i:i[0]})})).catch((e=>{n(e)}))}));super(n),this.wallet=e,this.did=t}}class ap extends op{async getSecretFromLedger(e,t,r,n){return await this.initialized,await Qh(this.contract,t,r,n,e)}}var sp={},cp=u(bu),up=u(ws),fp=u(yc),dp=u(nd),lp=u(Uo),hp=u(uu),pp=u(Id),mp=u(fl),gp=u(ns),yp=u(vo),bp=u(cd),vp=u(jh),wp=u(jd),Ap=u(Sa),_p=u(ls),Ep=u(vf),Sp=u(oc),Pp=u($f),xp=u(zh),kp=u(pl),Mp=u(Rl);!function(e){var t=s&&s.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),r=s&&s.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=s&&s.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&t(n,e,i);return r(n,e),n};Object.defineProperty(e,"__esModule",{value:!0}),e.formatBytes32String=e.Utf8ErrorFuncs=e.toUtf8String=e.toUtf8CodePoints=e.toUtf8Bytes=e._toEscapedUtf8String=e.nameprep=e.hexDataSlice=e.hexDataLength=e.hexZeroPad=e.hexValue=e.hexStripZeros=e.hexConcat=e.isHexString=e.hexlify=e.base64=e.base58=e.TransactionDescription=e.LogDescription=e.Interface=e.SigningKey=e.HDNode=e.defaultPath=e.isBytesLike=e.isBytes=e.zeroPad=e.stripZeros=e.concat=e.arrayify=e.shallowCopy=e.resolveProperties=e.getStatic=e.defineReadOnly=e.deepCopy=e.checkProperties=e.poll=e.fetchJson=e._fetchData=e.RLP=e.Logger=e.checkResultErrors=e.FormatTypes=e.ParamType=e.FunctionFragment=e.EventFragment=e.ErrorFragment=e.ConstructorFragment=e.Fragment=e.defaultAbiCoder=e.AbiCoder=void 0,e.Indexed=e.Utf8ErrorReason=e.UnicodeNormalizationForm=e.SupportedAlgorithm=e.mnemonicToSeed=e.isValidMnemonic=e.entropyToMnemonic=e.mnemonicToEntropy=e.getAccountPath=e.verifyTypedData=e.verifyMessage=e.recoverPublicKey=e.computePublicKey=e.recoverAddress=e.computeAddress=e.getJsonWalletAddress=e.TransactionTypes=e.serializeTransaction=e.parseTransaction=e.accessListify=e.joinSignature=e.splitSignature=e.soliditySha256=e.solidityKeccak256=e.solidityPack=e.shuffled=e.randomBytes=e.sha512=e.sha256=e.ripemd160=e.keccak256=e.computeHmac=e.commify=e.parseUnits=e.formatUnits=e.parseEther=e.formatEther=e.isAddress=e.getCreate2Address=e.getContractAddress=e.getIcapAddress=e.getAddress=e._TypedDataEncoder=e.id=e.isValidName=e.namehash=e.hashMessage=e.dnsEncode=e.parseBytes32String=void 0;var i=cp;Object.defineProperty(e,"AbiCoder",{enumerable:!0,get:function(){return i.AbiCoder}}),Object.defineProperty(e,"checkResultErrors",{enumerable:!0,get:function(){return i.checkResultErrors}}),Object.defineProperty(e,"ConstructorFragment",{enumerable:!0,get:function(){return i.ConstructorFragment}}),Object.defineProperty(e,"defaultAbiCoder",{enumerable:!0,get:function(){return i.defaultAbiCoder}}),Object.defineProperty(e,"ErrorFragment",{enumerable:!0,get:function(){return i.ErrorFragment}}),Object.defineProperty(e,"EventFragment",{enumerable:!0,get:function(){return i.EventFragment}}),Object.defineProperty(e,"FormatTypes",{enumerable:!0,get:function(){return i.FormatTypes}}),Object.defineProperty(e,"Fragment",{enumerable:!0,get:function(){return i.Fragment}}),Object.defineProperty(e,"FunctionFragment",{enumerable:!0,get:function(){return i.FunctionFragment}}),Object.defineProperty(e,"Indexed",{enumerable:!0,get:function(){return i.Indexed}}),Object.defineProperty(e,"Interface",{enumerable:!0,get:function(){return i.Interface}}),Object.defineProperty(e,"LogDescription",{enumerable:!0,get:function(){return i.LogDescription}}),Object.defineProperty(e,"ParamType",{enumerable:!0,get:function(){return i.ParamType}}),Object.defineProperty(e,"TransactionDescription",{enumerable:!0,get:function(){return i.TransactionDescription}});var o=up;Object.defineProperty(e,"getAddress",{enumerable:!0,get:function(){return o.getAddress}}),Object.defineProperty(e,"getCreate2Address",{enumerable:!0,get:function(){return o.getCreate2Address}}),Object.defineProperty(e,"getContractAddress",{enumerable:!0,get:function(){return o.getContractAddress}}),Object.defineProperty(e,"getIcapAddress",{enumerable:!0,get:function(){return o.getIcapAddress}}),Object.defineProperty(e,"isAddress",{enumerable:!0,get:function(){return o.isAddress}});var a=n(fp);e.base64=a;var c=dp;Object.defineProperty(e,"base58",{enumerable:!0,get:function(){return c.Base58}});var u=lp;Object.defineProperty(e,"arrayify",{enumerable:!0,get:function(){return u.arrayify}}),Object.defineProperty(e,"concat",{enumerable:!0,get:function(){return u.concat}}),Object.defineProperty(e,"hexConcat",{enumerable:!0,get:function(){return u.hexConcat}}),Object.defineProperty(e,"hexDataSlice",{enumerable:!0,get:function(){return u.hexDataSlice}}),Object.defineProperty(e,"hexDataLength",{enumerable:!0,get:function(){return u.hexDataLength}}),Object.defineProperty(e,"hexlify",{enumerable:!0,get:function(){return u.hexlify}}),Object.defineProperty(e,"hexStripZeros",{enumerable:!0,get:function(){return u.hexStripZeros}}),Object.defineProperty(e,"hexValue",{enumerable:!0,get:function(){return u.hexValue}}),Object.defineProperty(e,"hexZeroPad",{enumerable:!0,get:function(){return u.hexZeroPad}}),Object.defineProperty(e,"isBytes",{enumerable:!0,get:function(){return u.isBytes}}),Object.defineProperty(e,"isBytesLike",{enumerable:!0,get:function(){return u.isBytesLike}}),Object.defineProperty(e,"isHexString",{enumerable:!0,get:function(){return u.isHexString}}),Object.defineProperty(e,"joinSignature",{enumerable:!0,get:function(){return u.joinSignature}}),Object.defineProperty(e,"zeroPad",{enumerable:!0,get:function(){return u.zeroPad}}),Object.defineProperty(e,"splitSignature",{enumerable:!0,get:function(){return u.splitSignature}}),Object.defineProperty(e,"stripZeros",{enumerable:!0,get:function(){return u.stripZeros}});var f=hp;Object.defineProperty(e,"_TypedDataEncoder",{enumerable:!0,get:function(){return f._TypedDataEncoder}}),Object.defineProperty(e,"dnsEncode",{enumerable:!0,get:function(){return f.dnsEncode}}),Object.defineProperty(e,"hashMessage",{enumerable:!0,get:function(){return f.hashMessage}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return f.id}}),Object.defineProperty(e,"isValidName",{enumerable:!0,get:function(){return f.isValidName}}),Object.defineProperty(e,"namehash",{enumerable:!0,get:function(){return f.namehash}});var d=pp;Object.defineProperty(e,"defaultPath",{enumerable:!0,get:function(){return d.defaultPath}}),Object.defineProperty(e,"entropyToMnemonic",{enumerable:!0,get:function(){return d.entropyToMnemonic}}),Object.defineProperty(e,"getAccountPath",{enumerable:!0,get:function(){return d.getAccountPath}}),Object.defineProperty(e,"HDNode",{enumerable:!0,get:function(){return d.HDNode}}),Object.defineProperty(e,"isValidMnemonic",{enumerable:!0,get:function(){return d.isValidMnemonic}}),Object.defineProperty(e,"mnemonicToEntropy",{enumerable:!0,get:function(){return d.mnemonicToEntropy}}),Object.defineProperty(e,"mnemonicToSeed",{enumerable:!0,get:function(){return d.mnemonicToSeed}});var l=mp;Object.defineProperty(e,"getJsonWalletAddress",{enumerable:!0,get:function(){return l.getJsonWalletAddress}});var h=gp;Object.defineProperty(e,"keccak256",{enumerable:!0,get:function(){return h.keccak256}});var p=yp;Object.defineProperty(e,"Logger",{enumerable:!0,get:function(){return p.Logger}});var m=bp;Object.defineProperty(e,"computeHmac",{enumerable:!0,get:function(){return m.computeHmac}}),Object.defineProperty(e,"ripemd160",{enumerable:!0,get:function(){return m.ripemd160}}),Object.defineProperty(e,"sha256",{enumerable:!0,get:function(){return m.sha256}}),Object.defineProperty(e,"sha512",{enumerable:!0,get:function(){return m.sha512}});var g=vp;Object.defineProperty(e,"solidityKeccak256",{enumerable:!0,get:function(){return g.keccak256}}),Object.defineProperty(e,"solidityPack",{enumerable:!0,get:function(){return g.pack}}),Object.defineProperty(e,"soliditySha256",{enumerable:!0,get:function(){return g.sha256}});var y=wp;Object.defineProperty(e,"randomBytes",{enumerable:!0,get:function(){return y.randomBytes}}),Object.defineProperty(e,"shuffled",{enumerable:!0,get:function(){return y.shuffled}});var b=Ap;Object.defineProperty(e,"checkProperties",{enumerable:!0,get:function(){return b.checkProperties}}),Object.defineProperty(e,"deepCopy",{enumerable:!0,get:function(){return b.deepCopy}}),Object.defineProperty(e,"defineReadOnly",{enumerable:!0,get:function(){return b.defineReadOnly}}),Object.defineProperty(e,"getStatic",{enumerable:!0,get:function(){return b.getStatic}}),Object.defineProperty(e,"resolveProperties",{enumerable:!0,get:function(){return b.resolveProperties}}),Object.defineProperty(e,"shallowCopy",{enumerable:!0,get:function(){return b.shallowCopy}});var v=n(_p);e.RLP=v;var w=Ep;Object.defineProperty(e,"computePublicKey",{enumerable:!0,get:function(){return w.computePublicKey}}),Object.defineProperty(e,"recoverPublicKey",{enumerable:!0,get:function(){return w.recoverPublicKey}}),Object.defineProperty(e,"SigningKey",{enumerable:!0,get:function(){return w.SigningKey}});var A=Sp;Object.defineProperty(e,"formatBytes32String",{enumerable:!0,get:function(){return A.formatBytes32String}}),Object.defineProperty(e,"nameprep",{enumerable:!0,get:function(){return A.nameprep}}),Object.defineProperty(e,"parseBytes32String",{enumerable:!0,get:function(){return A.parseBytes32String}}),Object.defineProperty(e,"_toEscapedUtf8String",{enumerable:!0,get:function(){return A._toEscapedUtf8String}}),Object.defineProperty(e,"toUtf8Bytes",{enumerable:!0,get:function(){return A.toUtf8Bytes}}),Object.defineProperty(e,"toUtf8CodePoints",{enumerable:!0,get:function(){return A.toUtf8CodePoints}}),Object.defineProperty(e,"toUtf8String",{enumerable:!0,get:function(){return A.toUtf8String}}),Object.defineProperty(e,"Utf8ErrorFuncs",{enumerable:!0,get:function(){return A.Utf8ErrorFuncs}});var _=Pp;Object.defineProperty(e,"accessListify",{enumerable:!0,get:function(){return _.accessListify}}),Object.defineProperty(e,"computeAddress",{enumerable:!0,get:function(){return _.computeAddress}}),Object.defineProperty(e,"parseTransaction",{enumerable:!0,get:function(){return _.parse}}),Object.defineProperty(e,"recoverAddress",{enumerable:!0,get:function(){return _.recoverAddress}}),Object.defineProperty(e,"serializeTransaction",{enumerable:!0,get:function(){return _.serialize}}),Object.defineProperty(e,"TransactionTypes",{enumerable:!0,get:function(){return _.TransactionTypes}});var E=xp;Object.defineProperty(e,"commify",{enumerable:!0,get:function(){return E.commify}}),Object.defineProperty(e,"formatEther",{enumerable:!0,get:function(){return E.formatEther}}),Object.defineProperty(e,"parseEther",{enumerable:!0,get:function(){return E.parseEther}}),Object.defineProperty(e,"formatUnits",{enumerable:!0,get:function(){return E.formatUnits}}),Object.defineProperty(e,"parseUnits",{enumerable:!0,get:function(){return E.parseUnits}});var S=kp;Object.defineProperty(e,"verifyMessage",{enumerable:!0,get:function(){return S.verifyMessage}}),Object.defineProperty(e,"verifyTypedData",{enumerable:!0,get:function(){return S.verifyTypedData}});var P=Mp;Object.defineProperty(e,"_fetchData",{enumerable:!0,get:function(){return P._fetchData}}),Object.defineProperty(e,"fetchJson",{enumerable:!0,get:function(){return P.fetchJson}}),Object.defineProperty(e,"poll",{enumerable:!0,get:function(){return P.poll}});var x=bp;Object.defineProperty(e,"SupportedAlgorithm",{enumerable:!0,get:function(){return x.SupportedAlgorithm}});var k=Sp;Object.defineProperty(e,"UnicodeNormalizationForm",{enumerable:!0,get:function(){return k.UnicodeNormalizationForm}}),Object.defineProperty(e,"Utf8ErrorReason",{enumerable:!0,get:function(){return k.Utf8ErrorReason}})}(sp);class Cp extends tp{constructor(e,t){let r;super(e),this.count=-1,r=void 0===t?function(e,t=!1){if(e<1)throw new RangeError("byteLength MUST be > 0");{const r=new Uint8Array(e);if(e<=65536)self.crypto.getRandomValues(r);else for(let t=0;tthis.count&&(this.count=e),this.count}}class Ip extends np{constructor(){super(...arguments),this.count=-1}async deploySecret(e,t){await this.initialized;const r=await Yh(e,t,this),n=(await this.wallet.identities.sign({did:this.did},{type:"Transaction",data:r})).signature,i=await this.provider.sendTransaction(n);return this.count=this.count+1,i.hash}async getAddress(){await this.initialized;const e=await this.wallet.identities.info({did:this.did});if(void 0===e.addresses)throw new nn(new Error("no addresses for did "+this.did),["unexpected error"]);return e.addresses[0]}async nextNonce(){await this.initialized;const e=await this.provider.getTransactionCount(await this.getAddress(),"pending");return e>this.count&&(this.count=e),this.count}}class Rp extends op{constructor(){super(...arguments),this.count=-1}async deploySecret(e,t){await this.initialized;const r=await Yh(e,t,this),n=(await this.wallet.identitySign({did:this.did},{type:"Transaction",data:r})).signature,i=await this.provider.sendTransaction(n);return this.count=this.count+1,i.hash}async getAddress(){await this.initialized;const e=await this.wallet.identityInfo({did:this.did});if(void 0===e.addresses)throw new nn(`Can't get address for did: ${this.did}`,["unexpected error"]);return e.addresses[0]}async nextNonce(){await this.initialized;const e=await this.provider.getTransactionCount(await this.getAddress(),"pending");return e>this.count&&(this.count=e),this.count}}var Np=Object.freeze({__proto__:null,EthersIoAgentDest:rp,EthersIoAgentOrig:Cp,I3mServerWalletAgentDest:ap,I3mServerWalletAgentOrig:Rp,I3mWalletAgentDest:ip,I3mWalletAgentOrig:Ip}),Op={schemas:{IdentitySelectOutput:{title:"IdentitySelectOutput",type:"object",properties:{did:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},required:["did"]},SignInput:{title:"SignInput",oneOf:[{title:"SignTransaction",type:"object",properties:{type:{enum:["Transaction"]},data:{title:"Transaction",type:"object",additionalProperties:!0,properties:{from:{type:"string"},to:{type:"string"},nonce:{type:"number"}}}},required:["type","data"]},{title:"SignRaw",type:"object",properties:{type:{enum:["Raw"]},data:{type:"object",properties:{payload:{description:"Base64Url encoded data to sign",type:"string",pattern:"^[A-Za-z0-9_-]+$"}},required:["payload"]}},required:["type","data"]},{title:"SignJWT",type:"object",properties:{type:{enum:["JWT"]},data:{type:"object",properties:{header:{description:'header fields to be added to the JWS header. "alg" and "kid" will be ignored since they are automatically added by the wallet.',type:"object",additionalProperties:!0},payload:{description:"A JSON object to be signed by the wallet. It will become the payload of the generated JWS. 'iss' (issuer) and 'iat' (issued at) will be automatically added by the wallet and will override provided values.",type:"object",additionalProperties:!0}},required:["payload"]}},required:["type","data"]}]},SignRaw:{title:"SignRaw",type:"object",properties:{type:{enum:["Raw"]},data:{type:"object",properties:{payload:{description:"Base64Url encoded data to sign",type:"string",pattern:"^[A-Za-z0-9_-]+$"}},required:["payload"]}},required:["type","data"]},SignTransaction:{title:"SignTransaction",type:"object",properties:{type:{enum:["Transaction"]},data:{title:"Transaction",type:"object",additionalProperties:!0,properties:{from:{type:"string"},to:{type:"string"},nonce:{type:"number"}}}},required:["type","data"]},SignJWT:{title:"SignJWT",type:"object",properties:{type:{enum:["JWT"]},data:{type:"object",properties:{header:{description:'header fields to be added to the JWS header. "alg" and "kid" will be ignored since they are automatically added by the wallet.',type:"object",additionalProperties:!0},payload:{description:"A JSON object to be signed by the wallet. It will become the payload of the generated JWS. 'iss' (issuer) and 'iat' (issued at) will be automatically added by the wallet and will override provided values.",type:"object",additionalProperties:!0}},required:["payload"]}},required:["type","data"]},Transaction:{title:"Transaction",type:"object",additionalProperties:!0,properties:{from:{type:"string"},to:{type:"string"},nonce:{type:"number"}}},SignOutput:{title:"SignOutput",type:"object",properties:{signature:{type:"string"}},required:["signature"]},Receipt:{title:"Receipt",type:"object",properties:{receipt:{type:"string"}},required:["receipt"]},SignTypes:{title:"SignTypes",type:"string",enum:["Transaction","Raw","JWT"]},IdentityListInput:{title:"IdentityListInput",description:"A list of DIDs",type:"array",items:{type:"object",properties:{did:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},required:["did"]}},IdentityCreateInput:{title:"IdentityCreateInput",description:'Besides the here defined options, provider specific properties should be added here if necessary, e.g. "path" for BIP21 wallets, or the key algorithm (if the wallet supports multiple algorithm).\n',type:"object",properties:{alias:{type:"string"}},additionalProperties:!0},IdentityCreateOutput:{title:"IdentityCreateOutput",description:"It returns the account id and type\n",type:"object",properties:{did:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},additionalProperties:!0,required:["did"]},ResourceListOutput:{title:"ResourceListOutput",description:"A list of resources",type:"array",items:{title:"Resource",anyOf:[{title:"VerifiableCredential",type:"object",properties:{type:{example:"VerifiableCredential",enum:["VerifiableCredential"]},name:{type:"string",example:"Resource name"},resource:{type:"object",properties:{"@context":{type:"array",items:{type:"string"},example:["https://www.w3.org/2018/credentials/v1"]},id:{type:"string",example:"http://example.edu/credentials/1872"},type:{type:"array",items:{type:"string"},example:["VerifiableCredential"]},issuer:{type:"object",properties:{id:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},additionalProperties:!0,required:["id"]},issuanceDate:{type:"string",format:"date-time",example:"2021-06-10T19:07:28.000Z"},credentialSubject:{type:"object",properties:{id:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},required:["id"],additionalProperties:!0},proof:{type:"object",properties:{type:{type:"string",enum:["JwtProof2020"]}},required:["type"],additionalProperties:!0}},additionalProperties:!0,required:["@context","type","issuer","issuanceDate","credentialSubject","proof"]}},required:["type","resource"]},{title:"ObjectResource",type:"object",properties:{type:{example:"Object",enum:["Object"]},name:{type:"string",example:"Resource name"},parentResource:{type:"string"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",additionalProperties:!0}},required:["type","resource"]},{title:"JWK pair",type:"object",properties:{type:{example:"KeyPair",enum:["KeyPair"]},name:{type:"string",example:"Resource name"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",properties:{keyPair:{type:"object",properties:{privateJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents a private key (complementary to `publicJwk`)\n",example:'{"alg":"ES256","crv":"P-256","d":"rQp_3eZzvXwt1sK7WWsRhVYipqNGblzYDKKaYirlqs0","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'},publicJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents the public key (complementary to `privateJwk`).\n",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'}},required:["privateJwk","publicJwk"]}},required:["keyPair"]}},required:["type","resource"]},{title:"Contract",type:"object",properties:{type:{example:"Contract",enum:["Contract"]},name:{type:"string",example:"Resource name"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",properties:{dataSharingAgreement:{type:"object",required:["dataOfferingDescription","parties","purpose","duration","intendedUse","licenseGrant","dataStream","personalData","pricingModel","dataExchangeAgreement","signatures"],properties:{dataOfferingDescription:{type:"object",required:["dataOfferingId","version","active"],properties:{dataOfferingId:{type:"string"},version:{type:"integer"},category:{type:"string"},active:{type:"boolean"},title:{type:"string"}}},parties:{type:"object",required:["providerDid","consumerDid"],properties:{providerDid:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},consumerDid:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}}},purpose:{type:"string"},duration:{type:"object",required:["creationDate","startDate","endDate"],properties:{creationDate:{type:"integer"},startDate:{type:"integer"},endDate:{type:"integer"}}},intendedUse:{type:"object",required:["processData","shareDataWithThirdParty","editData"],properties:{processData:{type:"boolean"},shareDataWithThirdParty:{type:"boolean"},editData:{type:"boolean"}}},licenseGrant:{type:"object",required:["transferable","exclusiveness","paidUp","revocable","processing","modifying","analyzing","storingData","storingCopy","reproducing","distributing","loaning","selling","renting","furtherLicensing","leasing"],properties:{transferable:{type:"boolean"},exclusiveness:{type:"boolean"},paidUp:{type:"boolean"},revocable:{type:"boolean"},processing:{type:"boolean"},modifying:{type:"boolean"},analyzing:{type:"boolean"},storingData:{type:"boolean"},storingCopy:{type:"boolean"},reproducing:{type:"boolean"},distributing:{type:"boolean"},loaning:{type:"boolean"},selling:{type:"boolean"},renting:{type:"boolean"},furtherLicensing:{type:"boolean"},leasing:{type:"boolean"}}},dataStream:{type:"boolean"},personalData:{type:"boolean"},pricingModel:{type:"object",required:["basicPrice","currency","hasFreePrice"],properties:{paymentType:{type:"string"},pricingModelName:{type:"string"},basicPrice:{type:"number",format:"float"},currency:{type:"string"},fee:{type:"number",format:"float"},hasPaymentOnSubscription:{type:"object",properties:{paymentOnSubscriptionName:{type:"string"},paymentType:{type:"string"},timeDuration:{type:"string"},description:{type:"string"},repeat:{type:"string"},hasSubscriptionPrice:{type:"number"}}},hasFreePrice:{type:"object",properties:{hasPriceFree:{type:"boolean"}}}}},dataExchangeAgreement:{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},signatures:{type:"object",required:["providerSignature","consumerSignature"],properties:{providerSignature:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"},consumerSignature:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"}}}}},keyPair:{type:"object",properties:{privateJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents a private key (complementary to `publicJwk`)\n",example:'{"alg":"ES256","crv":"P-256","d":"rQp_3eZzvXwt1sK7WWsRhVYipqNGblzYDKKaYirlqs0","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'},publicJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents the public key (complementary to `privateJwk`).\n",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'}},required:["privateJwk","publicJwk"]}},required:["dataSharingAgreement"]}},required:["type","resource"]},{title:"NonRepudiationProof",type:"object",properties:{type:{example:"NonRepudiationProof",enum:["NonRepudiationProof"]},name:{type:"string",example:"Resource name"},resource:{description:"a non-repudiation proof (either a PoO, a PoR or a PoP) as a compact JWS"}},required:["type","resource"]},{title:"DataExchangeResource",type:"object",properties:{type:{example:"DataExchange",enum:["DataExchange"]},name:{type:"string",example:"Resource name"},resource:{allOf:[{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},{type:"object",properties:{cipherblockDgst:{type:"string",description:"hash of the cipherblock in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"},blockCommitment:{type:"string",description:"hash of the plaintext block in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"},secretCommitment:{type:"string",description:"ash of the secret that can be used to decrypt the block in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"}},required:["cipherblockDgst","blockCommitment","secretCommitment"]}]}},required:["type","resource"]}]}},Resource:{title:"Resource",anyOf:[{title:"VerifiableCredential",type:"object",properties:{type:{example:"VerifiableCredential",enum:["VerifiableCredential"]},name:{type:"string",example:"Resource name"},resource:{type:"object",properties:{"@context":{type:"array",items:{type:"string"},example:["https://www.w3.org/2018/credentials/v1"]},id:{type:"string",example:"http://example.edu/credentials/1872"},type:{type:"array",items:{type:"string"},example:["VerifiableCredential"]},issuer:{type:"object",properties:{id:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},additionalProperties:!0,required:["id"]},issuanceDate:{type:"string",format:"date-time",example:"2021-06-10T19:07:28.000Z"},credentialSubject:{type:"object",properties:{id:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},required:["id"],additionalProperties:!0},proof:{type:"object",properties:{type:{type:"string",enum:["JwtProof2020"]}},required:["type"],additionalProperties:!0}},additionalProperties:!0,required:["@context","type","issuer","issuanceDate","credentialSubject","proof"]}},required:["type","resource"]},{title:"ObjectResource",type:"object",properties:{type:{example:"Object",enum:["Object"]},name:{type:"string",example:"Resource name"},parentResource:{type:"string"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",additionalProperties:!0}},required:["type","resource"]},{title:"JWK pair",type:"object",properties:{type:{example:"KeyPair",enum:["KeyPair"]},name:{type:"string",example:"Resource name"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",properties:{keyPair:{type:"object",properties:{privateJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents a private key (complementary to `publicJwk`)\n",example:'{"alg":"ES256","crv":"P-256","d":"rQp_3eZzvXwt1sK7WWsRhVYipqNGblzYDKKaYirlqs0","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'},publicJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents the public key (complementary to `privateJwk`).\n",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'}},required:["privateJwk","publicJwk"]}},required:["keyPair"]}},required:["type","resource"]},{title:"Contract",type:"object",properties:{type:{example:"Contract",enum:["Contract"]},name:{type:"string",example:"Resource name"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",properties:{dataSharingAgreement:{type:"object",required:["dataOfferingDescription","parties","purpose","duration","intendedUse","licenseGrant","dataStream","personalData","pricingModel","dataExchangeAgreement","signatures"],properties:{dataOfferingDescription:{type:"object",required:["dataOfferingId","version","active"],properties:{dataOfferingId:{type:"string"},version:{type:"integer"},category:{type:"string"},active:{type:"boolean"},title:{type:"string"}}},parties:{type:"object",required:["providerDid","consumerDid"],properties:{providerDid:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},consumerDid:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}}},purpose:{type:"string"},duration:{type:"object",required:["creationDate","startDate","endDate"],properties:{creationDate:{type:"integer"},startDate:{type:"integer"},endDate:{type:"integer"}}},intendedUse:{type:"object",required:["processData","shareDataWithThirdParty","editData"],properties:{processData:{type:"boolean"},shareDataWithThirdParty:{type:"boolean"},editData:{type:"boolean"}}},licenseGrant:{type:"object",required:["transferable","exclusiveness","paidUp","revocable","processing","modifying","analyzing","storingData","storingCopy","reproducing","distributing","loaning","selling","renting","furtherLicensing","leasing"],properties:{transferable:{type:"boolean"},exclusiveness:{type:"boolean"},paidUp:{type:"boolean"},revocable:{type:"boolean"},processing:{type:"boolean"},modifying:{type:"boolean"},analyzing:{type:"boolean"},storingData:{type:"boolean"},storingCopy:{type:"boolean"},reproducing:{type:"boolean"},distributing:{type:"boolean"},loaning:{type:"boolean"},selling:{type:"boolean"},renting:{type:"boolean"},furtherLicensing:{type:"boolean"},leasing:{type:"boolean"}}},dataStream:{type:"boolean"},personalData:{type:"boolean"},pricingModel:{type:"object",required:["basicPrice","currency","hasFreePrice"],properties:{paymentType:{type:"string"},pricingModelName:{type:"string"},basicPrice:{type:"number",format:"float"},currency:{type:"string"},fee:{type:"number",format:"float"},hasPaymentOnSubscription:{type:"object",properties:{paymentOnSubscriptionName:{type:"string"},paymentType:{type:"string"},timeDuration:{type:"string"},description:{type:"string"},repeat:{type:"string"},hasSubscriptionPrice:{type:"number"}}},hasFreePrice:{type:"object",properties:{hasPriceFree:{type:"boolean"}}}}},dataExchangeAgreement:{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},signatures:{type:"object",required:["providerSignature","consumerSignature"],properties:{providerSignature:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"},consumerSignature:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"}}}}},keyPair:{type:"object",properties:{privateJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents a private key (complementary to `publicJwk`)\n",example:'{"alg":"ES256","crv":"P-256","d":"rQp_3eZzvXwt1sK7WWsRhVYipqNGblzYDKKaYirlqs0","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'},publicJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents the public key (complementary to `privateJwk`).\n",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'}},required:["privateJwk","publicJwk"]}},required:["dataSharingAgreement"]}},required:["type","resource"]},{title:"NonRepudiationProof",type:"object",properties:{type:{example:"NonRepudiationProof",enum:["NonRepudiationProof"]},name:{type:"string",example:"Resource name"},resource:{description:"a non-repudiation proof (either a PoO, a PoR or a PoP) as a compact JWS"}},required:["type","resource"]},{title:"DataExchangeResource",type:"object",properties:{type:{example:"DataExchange",enum:["DataExchange"]},name:{type:"string",example:"Resource name"},resource:{allOf:[{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},{type:"object",properties:{cipherblockDgst:{type:"string",description:"hash of the cipherblock in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"},blockCommitment:{type:"string",description:"hash of the plaintext block in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"},secretCommitment:{type:"string",description:"ash of the secret that can be used to decrypt the block in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"}},required:["cipherblockDgst","blockCommitment","secretCommitment"]}]}},required:["type","resource"]}]},VerifiableCredential:{title:"VerifiableCredential",type:"object",properties:{type:{example:"VerifiableCredential",enum:["VerifiableCredential"]},name:{type:"string",example:"Resource name"},resource:{type:"object",properties:{"@context":{type:"array",items:{type:"string"},example:["https://www.w3.org/2018/credentials/v1"]},id:{type:"string",example:"http://example.edu/credentials/1872"},type:{type:"array",items:{type:"string"},example:["VerifiableCredential"]},issuer:{type:"object",properties:{id:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},additionalProperties:!0,required:["id"]},issuanceDate:{type:"string",format:"date-time",example:"2021-06-10T19:07:28.000Z"},credentialSubject:{type:"object",properties:{id:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},required:["id"],additionalProperties:!0},proof:{type:"object",properties:{type:{type:"string",enum:["JwtProof2020"]}},required:["type"],additionalProperties:!0}},additionalProperties:!0,required:["@context","type","issuer","issuanceDate","credentialSubject","proof"]}},required:["type","resource"]},ObjectResource:{title:"ObjectResource",type:"object",properties:{type:{example:"Object",enum:["Object"]},name:{type:"string",example:"Resource name"},parentResource:{type:"string"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",additionalProperties:!0}},required:["type","resource"]},KeyPair:{title:"JWK pair",type:"object",properties:{type:{example:"KeyPair",enum:["KeyPair"]},name:{type:"string",example:"Resource name"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",properties:{keyPair:{type:"object",properties:{privateJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents a private key (complementary to `publicJwk`)\n",example:'{"alg":"ES256","crv":"P-256","d":"rQp_3eZzvXwt1sK7WWsRhVYipqNGblzYDKKaYirlqs0","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'},publicJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents the public key (complementary to `privateJwk`).\n",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'}},required:["privateJwk","publicJwk"]}},required:["keyPair"]}},required:["type","resource"]},Contract:{title:"Contract",type:"object",properties:{type:{example:"Contract",enum:["Contract"]},name:{type:"string",example:"Resource name"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",properties:{dataSharingAgreement:{type:"object",required:["dataOfferingDescription","parties","purpose","duration","intendedUse","licenseGrant","dataStream","personalData","pricingModel","dataExchangeAgreement","signatures"],properties:{dataOfferingDescription:{type:"object",required:["dataOfferingId","version","active"],properties:{dataOfferingId:{type:"string"},version:{type:"integer"},category:{type:"string"},active:{type:"boolean"},title:{type:"string"}}},parties:{type:"object",required:["providerDid","consumerDid"],properties:{providerDid:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},consumerDid:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}}},purpose:{type:"string"},duration:{type:"object",required:["creationDate","startDate","endDate"],properties:{creationDate:{type:"integer"},startDate:{type:"integer"},endDate:{type:"integer"}}},intendedUse:{type:"object",required:["processData","shareDataWithThirdParty","editData"],properties:{processData:{type:"boolean"},shareDataWithThirdParty:{type:"boolean"},editData:{type:"boolean"}}},licenseGrant:{type:"object",required:["transferable","exclusiveness","paidUp","revocable","processing","modifying","analyzing","storingData","storingCopy","reproducing","distributing","loaning","selling","renting","furtherLicensing","leasing"],properties:{transferable:{type:"boolean"},exclusiveness:{type:"boolean"},paidUp:{type:"boolean"},revocable:{type:"boolean"},processing:{type:"boolean"},modifying:{type:"boolean"},analyzing:{type:"boolean"},storingData:{type:"boolean"},storingCopy:{type:"boolean"},reproducing:{type:"boolean"},distributing:{type:"boolean"},loaning:{type:"boolean"},selling:{type:"boolean"},renting:{type:"boolean"},furtherLicensing:{type:"boolean"},leasing:{type:"boolean"}}},dataStream:{type:"boolean"},personalData:{type:"boolean"},pricingModel:{type:"object",required:["basicPrice","currency","hasFreePrice"],properties:{paymentType:{type:"string"},pricingModelName:{type:"string"},basicPrice:{type:"number",format:"float"},currency:{type:"string"},fee:{type:"number",format:"float"},hasPaymentOnSubscription:{type:"object",properties:{paymentOnSubscriptionName:{type:"string"},paymentType:{type:"string"},timeDuration:{type:"string"},description:{type:"string"},repeat:{type:"string"},hasSubscriptionPrice:{type:"number"}}},hasFreePrice:{type:"object",properties:{hasPriceFree:{type:"boolean"}}}}},dataExchangeAgreement:{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},signatures:{type:"object",required:["providerSignature","consumerSignature"],properties:{providerSignature:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"},consumerSignature:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"}}}}},keyPair:{type:"object",properties:{privateJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents a private key (complementary to `publicJwk`)\n",example:'{"alg":"ES256","crv":"P-256","d":"rQp_3eZzvXwt1sK7WWsRhVYipqNGblzYDKKaYirlqs0","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'},publicJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents the public key (complementary to `privateJwk`).\n",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'}},required:["privateJwk","publicJwk"]}},required:["dataSharingAgreement"]}},required:["type","resource"]},DataExchangeResource:{title:"DataExchangeResource",type:"object",properties:{type:{example:"DataExchange",enum:["DataExchange"]},name:{type:"string",example:"Resource name"},resource:{allOf:[{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},{type:"object",properties:{cipherblockDgst:{type:"string",description:"hash of the cipherblock in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"},blockCommitment:{type:"string",description:"hash of the plaintext block in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"},secretCommitment:{type:"string",description:"ash of the secret that can be used to decrypt the block in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"}},required:["cipherblockDgst","blockCommitment","secretCommitment"]}]}},required:["type","resource"]},NonRepudiationProof:{title:"NonRepudiationProof",type:"object",properties:{type:{example:"NonRepudiationProof",enum:["NonRepudiationProof"]},name:{type:"string",example:"Resource name"},resource:{description:"a non-repudiation proof (either a PoO, a PoR or a PoP) as a compact JWS"}},required:["type","resource"]},ResourceId:{type:"object",properties:{id:{type:"string"}},required:["id"]},ResourceType:{type:"string",enum:["VerifiableCredential","Object","KeyPair","Contract","DataExchange","NonRepudiationProof"]},SignedTransaction:{title:"SignedTransaction",description:"A list of resources",type:"object",properties:{transaction:{type:"string",pattern:"^0x(?:[A-Fa-f0-9])+$"}}},DecodedJwt:{title:"JwtPayload",type:"object",properties:{header:{type:"object",properties:{typ:{type:"string",enum:["JWT"]},alg:{type:"string",enum:["ES256K"]}},required:["typ","alg"],additionalProperties:!0},payload:{type:"object",properties:{iss:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},required:["iss"],additionalProperties:!0},signature:{type:"string",format:"^[A-Za-z0-9_-]+$"},data:{type:"string",format:"^[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+$",description:"."}},required:["signature","data"]},VerificationOutput:{title:"VerificationOutput",type:"object",properties:{verification:{type:"string",enum:["success","failed"],description:"whether verification has been successful or has failed"},error:{type:"string",description:"error message if verification failed"},decodedJwt:{description:"the decoded JWT"}},required:["verification"]},ProviderData:{title:"ProviderData",description:"A JSON object with information of the DLT provider currently in use.",type:"object",properties:{provider:{type:"string",example:"did:ethr:i3m"},network:{type:"string",example:"i3m"},rpcUrl:{oneOf:[{type:"string",example:"http://95.211.3.250:8545"},{type:"array",items:{type:"string"},uniqueItems:!0,example:["http://95.211.3.249:8545","http://95.211.3.250:8545"]}]}},additionalProperties:!0},EthereumAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},did:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},IdentityData:{title:"Identity Data",type:"object",properties:{did:{type:"string",example:"did:ethr:i3m:0x03142f480f831e835822fc0cd35726844a7069d28df58fb82037f1598812e1ade8"},alias:{type:"string",example:"identity1"},provider:{type:"string",example:"did:ethr:i3m"},addresses:{type:"array",items:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},example:["0x8646cAcF516de1292be1D30AB68E7Ea51e9B1BE7"]}},required:["did"]},ApiError:{type:"object",title:"Error",required:["code","message"],properties:{code:{type:"integer",format:"int32"},message:{type:"string"}}},JwkPair:{type:"object",properties:{privateJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents a private key (complementary to `publicJwk`)\n",example:'{"alg":"ES256","crv":"P-256","d":"rQp_3eZzvXwt1sK7WWsRhVYipqNGblzYDKKaYirlqs0","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'},publicJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents the public key (complementary to `privateJwk`).\n",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'}},required:["privateJwk","publicJwk"]},CompactJWS:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"},DataExchangeAgreement:{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},DataSharingAgreement:{type:"object",required:["dataOfferingDescription","parties","purpose","duration","intendedUse","licenseGrant","dataStream","personalData","pricingModel","dataExchangeAgreement","signatures"],properties:{dataOfferingDescription:{type:"object",required:["dataOfferingId","version","active"],properties:{dataOfferingId:{type:"string"},version:{type:"integer"},category:{type:"string"},active:{type:"boolean"},title:{type:"string"}}},parties:{type:"object",required:["providerDid","consumerDid"],properties:{providerDid:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},consumerDid:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}}},purpose:{type:"string"},duration:{type:"object",required:["creationDate","startDate","endDate"],properties:{creationDate:{type:"integer"},startDate:{type:"integer"},endDate:{type:"integer"}}},intendedUse:{type:"object",required:["processData","shareDataWithThirdParty","editData"],properties:{processData:{type:"boolean"},shareDataWithThirdParty:{type:"boolean"},editData:{type:"boolean"}}},licenseGrant:{type:"object",required:["transferable","exclusiveness","paidUp","revocable","processing","modifying","analyzing","storingData","storingCopy","reproducing","distributing","loaning","selling","renting","furtherLicensing","leasing"],properties:{transferable:{type:"boolean"},exclusiveness:{type:"boolean"},paidUp:{type:"boolean"},revocable:{type:"boolean"},processing:{type:"boolean"},modifying:{type:"boolean"},analyzing:{type:"boolean"},storingData:{type:"boolean"},storingCopy:{type:"boolean"},reproducing:{type:"boolean"},distributing:{type:"boolean"},loaning:{type:"boolean"},selling:{type:"boolean"},renting:{type:"boolean"},furtherLicensing:{type:"boolean"},leasing:{type:"boolean"}}},dataStream:{type:"boolean"},personalData:{type:"boolean"},pricingModel:{type:"object",required:["basicPrice","currency","hasFreePrice"],properties:{paymentType:{type:"string"},pricingModelName:{type:"string"},basicPrice:{type:"number",format:"float"},currency:{type:"string"},fee:{type:"number",format:"float"},hasPaymentOnSubscription:{type:"object",properties:{paymentOnSubscriptionName:{type:"string"},paymentType:{type:"string"},timeDuration:{type:"string"},description:{type:"string"},repeat:{type:"string"},hasSubscriptionPrice:{type:"number"}}},hasFreePrice:{type:"object",properties:{hasPriceFree:{type:"boolean"}}}}},dataExchangeAgreement:{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},signatures:{type:"object",required:["providerSignature","consumerSignature"],properties:{providerSignature:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"},consumerSignature:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"}}}}},DataExchange:{allOf:[{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},{type:"object",properties:{cipherblockDgst:{type:"string",description:"hash of the cipherblock in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"},blockCommitment:{type:"string",description:"hash of the plaintext block in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"},secretCommitment:{type:"string",description:"ash of the secret that can be used to decrypt the block in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"}},required:["cipherblockDgst","blockCommitment","secretCommitment"]}]}}},Tp={exports:{}},jp={},Dp={},$p={},Bp={},Fp={},zp={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;class t{}e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class r extends t{constructor(t){if(super(),!e.IDENTIFIER.test(t))throw new Error("CodeGen: name must be a valid identifier");this.str=t}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=r;class n 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,t)=>`${e}${t}`),"")}get names(){var e;return null!==(e=this._names)&&void 0!==e?e:this._names=this._items.reduce(((e,t)=>(t instanceof r&&(e[t.str]=(e[t.str]||0)+1),e)),{})}}function i(e,...t){const r=[e[0]];let i=0;for(;i{if(void 0===r.scopePath)throw new Error(`CodeGen: name "${r}" has no value`);return t._`${e}${r.scopePath}`}))}scopeCode(e=this._values,t,r){return this._reduceValues(e,(e=>{if(void 0===e.value)throw new Error(`CodeGen: name "${e}" has no value`);return e.value.code}),t,r)}_reduceValues(i,o,a={},s){let c=t.nil;for(const u in i){const f=i[u];if(!f)continue;const d=a[u]=a[u]||new Map;f.forEach((i=>{if(d.has(i))return;d.set(i,n.Started);let a=o(i);if(a){const r=this.opts.es5?e.varKinds.var:e.varKinds.const;c=t._`${c}${r} ${i} = ${a};${this.opts._n}`}else{if(!(a=null==s?void 0:s(i)))throw new r(i);c=t._`${c}${a}${this.opts._n}`}d.set(i,n.Completed)}))}return c}}}(Up),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;const t=zp,r=Up;var n=zp;Object.defineProperty(e,"_",{enumerable:!0,get:function(){return n._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return n.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return n.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return n.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return n.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return n.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return n.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return n.Name}});var i=Up;Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return i.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return i.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return i.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return i.varKinds}}),e.operators={GT:new t._Code(">"),GTE:new t._Code(">="),LT:new t._Code("<"),LTE:new t._Code("<="),EQ:new t._Code("==="),NEQ:new t._Code("!=="),NOT:new t._Code("!"),OR:new t._Code("||"),AND:new t._Code("&&"),ADD:new t._Code("+")};class o{optimizeNodes(){return this}optimizeNames(e,t){return this}}class a extends o{constructor(e,t,r){super(),this.varKind=e,this.name=t,this.rhs=r}render({es5:e,_n:t}){const n=e?r.varKinds.var:this.varKind,i=void 0===this.rhs?"":` = ${this.rhs}`;return`${n} ${this.name}${i};`+t}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&(this.rhs=C(this.rhs,e,t)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class s extends o{constructor(e,t,r){super(),this.lhs=e,this.rhs=t,this.sideEffects=r}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof t.Name)||e[this.lhs.str]||this.sideEffects)return this.rhs=C(this.rhs,e,r),this}get names(){return M(this.lhs instanceof t.Name?{}:{...this.lhs.names},this.rhs)}}class c extends s{constructor(e,t,r,n){super(e,r,n),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class u extends o{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class f extends o{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class d extends o{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class l extends o{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=C(this.code,e,t),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class h extends o{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce(((t,r)=>t+r.render(e)),"")}optimizeNodes(){const{nodes:e}=this;let t=e.length;for(;t--;){const r=e[t].optimizeNodes();Array.isArray(r)?e.splice(t,1,...r):r?e[t]=r:e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){const{nodes:r}=this;let n=r.length;for(;n--;){const i=r[n];i.optimizeNames(e,t)||(I(e,i.names),r.splice(n,1))}return r.length>0?this:void 0}get names(){return this.nodes.reduce(((e,t)=>k(e,t.names)),{})}}class p extends h{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class m extends h{}class g extends p{}g.kind="else";class y extends p{constructor(e,t){super(t),this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);return this.else&&(t+="else "+this.else.render(e)),t}optimizeNodes(){super.optimizeNodes();const e=this.condition;if(!0===e)return this.nodes;let t=this.else;if(t){const e=t.optimizeNodes();t=this.else=Array.isArray(e)?new g(e):e}return t?!1===e?t instanceof y?t:t.nodes:this.nodes.length?this:new y(R(e),t instanceof y?[t]:t.nodes):!1!==e&&this.nodes.length?this:void 0}optimizeNames(e,t){var r;if(this.else=null===(r=this.else)||void 0===r?void 0:r.optimizeNames(e,t),super.optimizeNames(e,t)||this.else)return this.condition=C(this.condition,e,t),this}get names(){const e=super.names;return M(e,this.condition),this.else&&k(e,this.else.names),e}}y.kind="if";class b extends p{}b.kind="for";class v extends b{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iteration=C(this.iteration,e,t),this}get names(){return k(super.names,this.iteration.names)}}class w extends b{constructor(e,t,r,n){super(),this.varKind=e,this.name=t,this.from=r,this.to=n}render(e){const t=e.es5?r.varKinds.var:this.varKind,{name:n,from:i,to:o}=this;return`for(${t} ${n}=${i}; ${n}<${o}; ${n}++)`+super.render(e)}get names(){const e=M(super.names,this.from);return M(e,this.to)}}class A extends b{constructor(e,t,r,n){super(),this.loop=e,this.varKind=t,this.name=r,this.iterable=n}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iterable=C(this.iterable,e,t),this}get names(){return k(super.names,this.iterable.names)}}class _ extends p{constructor(e,t,r){super(),this.name=e,this.args=t,this.async=r}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}}_.kind="func";class E extends h{render(e){return"return "+super.render(e)}}E.kind="return";class S extends p{render(e){let t="try"+super.render(e);return this.catch&&(t+=this.catch.render(e)),this.finally&&(t+=this.finally.render(e)),t}optimizeNodes(){var e,t;return super.optimizeNodes(),null===(e=this.catch)||void 0===e||e.optimizeNodes(),null===(t=this.finally)||void 0===t||t.optimizeNodes(),this}optimizeNames(e,t){var r,n;return super.optimizeNames(e,t),null===(r=this.catch)||void 0===r||r.optimizeNames(e,t),null===(n=this.finally)||void 0===n||n.optimizeNames(e,t),this}get names(){const e=super.names;return this.catch&&k(e,this.catch.names),this.finally&&k(e,this.finally.names),e}}class P extends p{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}P.kind="catch";class x extends p{render(e){return"finally"+super.render(e)}}x.kind="finally";function k(e,t){for(const r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function M(e,r){return r instanceof t._CodeOrName?k(e,r.names):e}function C(e,r,n){return e instanceof t.Name?i(e):function(e){return e instanceof t._Code&&e._items.some((e=>e instanceof t.Name&&1===r[e.str]&&void 0!==n[e.str]))}(e)?new t._Code(e._items.reduce(((e,r)=>(r instanceof t.Name&&(r=i(r)),r instanceof t._Code?e.push(...r._items):e.push(r),e)),[])):e;function i(e){const t=n[e.str];return void 0===t||1!==r[e.str]?e:(delete r[e.str],t)}}function I(e,t){for(const r in t)e[r]=(e[r]||0)-(t[r]||0)}function R(e){return"boolean"==typeof e||"number"==typeof e||null===e?!e:t._`!${j(e)}`}e.CodeGen=class{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?"\n":""},this._extScope=e,this._scope=new r.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,t){const r=this._extScope.value(e,t);return(this._values[r.prefix]||(this._values[r.prefix]=new Set)).add(r),r}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,r,n){const i=this._scope.toName(t);return void 0!==r&&n&&(this._constants[i.str]=r),this._leafNode(new a(e,i,r)),i}const(e,t,n){return this._def(r.varKinds.const,e,t,n)}let(e,t,n){return this._def(r.varKinds.let,e,t,n)}var(e,t,n){return this._def(r.varKinds.var,e,t,n)}assign(e,t,r){return this._leafNode(new s(e,t,r))}add(t,r){return this._leafNode(new c(t,e.operators.ADD,r))}code(e){return"function"==typeof e?e():e!==t.nil&&this._leafNode(new l(e)),this}object(...e){const r=["{"];for(const[n,i]of e)r.length>1&&r.push(","),r.push(n),(n!==i||this.opts.es5)&&(r.push(":"),(0,t.addCodeArg)(r,i));return r.push("}"),new t._Code(r)}if(e,t,r){if(this._blockNode(new y(e)),t&&r)this.code(t).else().code(r).endIf();else if(t)this.code(t).endIf();else if(r)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new y(e))}else(){return this._elseNode(new g)}endIf(){return this._endBlockNode(y,g)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new v(e),t)}forRange(e,t,n,i,o=(this.opts.es5?r.varKinds.var:r.varKinds.let)){const a=this._scope.toName(e);return this._for(new w(o,a,t,n),(()=>i(a)))}forOf(e,n,i,o=r.varKinds.const){const a=this._scope.toName(e);if(this.opts.es5){const e=n instanceof t.Name?n:this.var("_arr",n);return this.forRange("_i",0,t._`${e}.length`,(r=>{this.var(a,t._`${e}[${r}]`),i(a)}))}return this._for(new A("of",o,a,n),(()=>i(a)))}forIn(e,n,i,o=(this.opts.es5?r.varKinds.var:r.varKinds.const)){if(this.opts.ownProperties)return this.forOf(e,t._`Object.keys(${n})`,i);const a=this._scope.toName(e);return this._for(new A("in",o,a,n),(()=>i(a)))}endFor(){return this._endBlockNode(b)}label(e){return this._leafNode(new u(e))}break(e){return this._leafNode(new f(e))}return(e){const t=new E;if(this._blockNode(t),this.code(e),1!==t.nodes.length)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(E)}try(e,t,r){if(!t&&!r)throw new Error('CodeGen: "try" without "catch" and "finally"');const n=new S;if(this._blockNode(n),this.code(e),t){const e=this.name("e");this._currNode=n.catch=new P(e),t(e)}return r&&(this._currNode=n.finally=new x,this.code(r)),this._endBlockNode(P,x)}throw(e){return this._leafNode(new d(e))}block(e,t){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(t),this}endBlock(e){const t=this._blockStarts.pop();if(void 0===t)throw new Error("CodeGen: not in self-balancing block");const r=this._nodes.length-t;if(r<0||void 0!==e&&r!==e)throw new Error(`CodeGen: wrong number of nodes: ${r} vs ${e} expected`);return this._nodes.length=t,this}func(e,r=t.nil,n,i){return this._blockNode(new _(e,r,n)),i&&this.code(i).endFunc(),this}endFunc(){return this._endBlockNode(_)}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,t){const r=this._currNode;if(r instanceof e||t&&r instanceof t)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){const t=this._currNode;if(!(t instanceof y))throw new Error('CodeGen: "else" without "if"');return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){const e=this._nodes;return e[e.length-1]}set _currNode(e){const t=this._nodes;t[t.length-1]=e}},e.not=R;const N=T(e.operators.AND);e.and=function(...e){return e.reduce(N)};const O=T(e.operators.OR);function T(e){return(r,n)=>r===t.nil?n:n===t.nil?r:t._`${j(r)} ${e} ${j(n)}`}function j(e){return e instanceof t.Name?e:t._`(${e})`}e.or=function(...e){return e.reduce(O)}}(Fp);var Lp={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.checkStrictMode=e.getErrorPath=e.Type=e.useFunc=e.setEvaluated=e.evaluatedPropsToName=e.mergeEvaluated=e.eachItem=e.unescapeJsonPointer=e.escapeJsonPointer=e.escapeFragment=e.unescapeFragment=e.schemaRefOrVal=e.schemaHasRulesButRef=e.schemaHasRules=e.checkUnknownRules=e.alwaysValidSchema=e.toHash=void 0;const t=Fp,r=zp;function n(e,t=e.schema){const{opts:r,self:n}=e;if(!r.strictSchema)return;if("boolean"==typeof t)return;const i=n.RULES.keywords;for(const r in t)i[r]||l(e,`unknown keyword: "${r}"`)}function i(e,t){if("boolean"==typeof e)return!e;for(const r in e)if(t[r])return!0;return!1}function o(e){return"number"==typeof e?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}function a(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function s({mergeNames:e,mergeToName:r,mergeValues:n,resultToName:i}){return(o,a,s,c)=>{const u=void 0===s?a:s instanceof t.Name?(a instanceof t.Name?e(o,a,s):r(o,a,s),s):a instanceof t.Name?(r(o,s,a),a):n(a,s);return c!==t.Name||u instanceof t.Name?u:i(o,u)}}function c(e,r){if(!0===r)return e.var("props",!0);const n=e.var("props",t._`{}`);return void 0!==r&&u(e,n,r),n}function u(e,r,n){Object.keys(n).forEach((n=>e.assign(t._`${r}${(0,t.getProperty)(n)}`,!0)))}e.toHash=function(e){const t={};for(const r of e)t[r]=!0;return t},e.alwaysValidSchema=function(e,t){return"boolean"==typeof t?t:0===Object.keys(t).length||(n(e,t),!i(t,e.self.RULES.all))},e.checkUnknownRules=n,e.schemaHasRules=i,e.schemaHasRulesButRef=function(e,t){if("boolean"==typeof e)return!e;for(const r in e)if("$ref"!==r&&t.all[r])return!0;return!1},e.schemaRefOrVal=function({topSchemaRef:e,schemaPath:r},n,i,o){if(!o){if("number"==typeof n||"boolean"==typeof n)return n;if("string"==typeof n)return t._`${n}`}return t._`${e}${r}${(0,t.getProperty)(i)}`},e.unescapeFragment=function(e){return a(decodeURIComponent(e))},e.escapeFragment=function(e){return encodeURIComponent(o(e))},e.escapeJsonPointer=o,e.unescapeJsonPointer=a,e.eachItem=function(e,t){if(Array.isArray(e))for(const r of e)t(r);else t(e)},e.mergeEvaluated={props:s({mergeNames:(e,r,n)=>e.if(t._`${n} !== true && ${r} !== undefined`,(()=>{e.if(t._`${r} === true`,(()=>e.assign(n,!0)),(()=>e.assign(n,t._`${n} || {}`).code(t._`Object.assign(${n}, ${r})`)))})),mergeToName:(e,r,n)=>e.if(t._`${n} !== true`,(()=>{!0===r?e.assign(n,!0):(e.assign(n,t._`${n} || {}`),u(e,n,r))})),mergeValues:(e,t)=>!0===e||{...e,...t},resultToName:c}),items:s({mergeNames:(e,r,n)=>e.if(t._`${n} !== true && ${r} !== undefined`,(()=>e.assign(n,t._`${r} === true ? true : ${n} > ${r} ? ${n} : ${r}`))),mergeToName:(e,r,n)=>e.if(t._`${n} !== true`,(()=>e.assign(n,!0===r||t._`${n} > ${r} ? ${n} : ${r}`))),mergeValues:(e,t)=>!0===e||Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})},e.evaluatedPropsToName=c,e.setEvaluated=u;const f={};var d;function l(e,t,r=e.opts.strictSchema){if(r){if(t=`strict mode: ${t}`,!0===r)throw new Error(t);e.self.logger.warn(t)}}e.useFunc=function(e,t){return e.scopeValue("func",{ref:t,code:f[t.code]||(f[t.code]=new r._Code(t.code))})},function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"}(d=e.Type||(e.Type={})),e.getErrorPath=function(e,r,n){if(e instanceof t.Name){const i=r===d.Num;return n?i?t._`"[" + ${e} + "]"`:t._`"['" + ${e} + "']"`:i?t._`"/" + ${e}`:t._`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return n?(0,t.getProperty)(e).toString():"/"+o(e)},e.checkStrictMode=l}(Lp);var qp={};Object.defineProperty(qp,"__esModule",{value:!0});const Hp=Fp,Kp={data:new Hp.Name("data"),valCxt:new Hp.Name("valCxt"),instancePath:new Hp.Name("instancePath"),parentData:new Hp.Name("parentData"),parentDataProperty:new Hp.Name("parentDataProperty"),rootData:new Hp.Name("rootData"),dynamicAnchors:new Hp.Name("dynamicAnchors"),vErrors:new Hp.Name("vErrors"),errors:new Hp.Name("errors"),this:new Hp.Name("this"),self:new Hp.Name("self"),scope:new Hp.Name("scope"),json:new Hp.Name("json"),jsonPos:new Hp.Name("jsonPos"),jsonLen:new Hp.Name("jsonLen"),jsonPart:new Hp.Name("jsonPart")};qp.default=Kp,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;const t=Fp,r=Lp,n=qp;function i(e,r){const i=e.const("err",r);e.if(t._`${n.default.vErrors} === null`,(()=>e.assign(n.default.vErrors,t._`[${i}]`)),t._`${n.default.vErrors}.push(${i})`),e.code(t._`${n.default.errors}++`)}function o(e,r){const{gen:n,validateName:i,schemaEnv:o}=e;o.$async?n.throw(t._`new ${e.ValidationError}(${r})`):(n.assign(t._`${i}.errors`,r),n.return(!1))}e.keywordError={message:({keyword:e})=>t.str`must pass "${e}" keyword validation`},e.keyword$DataError={message:({keyword:e,schemaType:r})=>r?t.str`"${e}" keyword must be ${r} ($data)`:t.str`"${e}" keyword is invalid ($data)`},e.reportError=function(r,n=e.keywordError,a,c){const{it:u}=r,{gen:f,compositeRule:d,allErrors:l}=u,h=s(r,n,a);(null!=c?c:d||l)?i(f,h):o(u,t._`[${h}]`)},e.reportExtraError=function(t,r=e.keywordError,a){const{it:c}=t,{gen:u,compositeRule:f,allErrors:d}=c;i(u,s(t,r,a)),f||d||o(c,n.default.vErrors)},e.resetErrorsCount=function(e,r){e.assign(n.default.errors,r),e.if(t._`${n.default.vErrors} !== null`,(()=>e.if(r,(()=>e.assign(t._`${n.default.vErrors}.length`,r)),(()=>e.assign(n.default.vErrors,null)))))},e.extendErrors=function({gen:e,keyword:r,schemaValue:i,data:o,errsCount:a,it:s}){if(void 0===a)throw new Error("ajv implementation error");const c=e.name("err");e.forRange("i",a,n.default.errors,(a=>{e.const(c,t._`${n.default.vErrors}[${a}]`),e.if(t._`${c}.instancePath === undefined`,(()=>e.assign(t._`${c}.instancePath`,(0,t.strConcat)(n.default.instancePath,s.errorPath)))),e.assign(t._`${c}.schemaPath`,t.str`${s.errSchemaPath}/${r}`),s.opts.verbose&&(e.assign(t._`${c}.schema`,i),e.assign(t._`${c}.data`,o))}))};const a={keyword:new t.Name("keyword"),schemaPath:new t.Name("schemaPath"),params:new t.Name("params"),propertyName:new t.Name("propertyName"),message:new t.Name("message"),schema:new t.Name("schema"),parentSchema:new t.Name("parentSchema")};function s(e,r,i){const{createErrors:o}=e.it;return!1===o?t._`{}`:function(e,r,i={}){const{gen:o,it:s}=e,f=[c(s,i),u(e,i)];return function(e,{params:r,message:i},o){const{keyword:s,data:c,schemaValue:u,it:f}=e,{opts:d,propertyName:l,topSchemaRef:h,schemaPath:p}=f;o.push([a.keyword,s],[a.params,"function"==typeof r?r(e):r||t._`{}`]),d.messages&&o.push([a.message,"function"==typeof i?i(e):i]);d.verbose&&o.push([a.schema,u],[a.parentSchema,t._`${h}${p}`],[n.default.data,c]);l&&o.push([a.propertyName,l])}(e,r,f),o.object(...f)}(e,r,i)}function c({errorPath:e},{instancePath:i}){const o=i?t.str`${e}${(0,r.getErrorPath)(i,r.Type.Str)}`:e;return[n.default.instancePath,(0,t.strConcat)(n.default.instancePath,o)]}function u({keyword:e,it:{errSchemaPath:n}},{schemaPath:i,parentSchema:o}){let s=o?n:t.str`${n}/${e}`;return i&&(s=t.str`${s}${(0,r.getErrorPath)(i,r.Type.Str)}`),[a.schemaPath,s]}}(Bp),Object.defineProperty($p,"__esModule",{value:!0}),$p.boolOrEmptySchema=$p.topBoolOrEmptySchema=void 0;const Jp=Bp,Wp=Fp,Gp=qp,Vp={message:"boolean schema is false"};function Zp(e,t){const{gen:r,data:n}=e,i={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,Jp.reportError)(i,Vp,void 0,t)}$p.topBoolOrEmptySchema=function(e){const{gen:t,schema:r,validateName:n}=e;!1===r?Zp(e,!1):"object"==typeof r&&!0===r.$async?t.return(Gp.default.data):(t.assign(Wp._`${n}.errors`,null),t.return(!0))},$p.boolOrEmptySchema=function(e,t){const{gen:r,schema:n}=e;!1===n?(r.var(t,!1),Zp(e)):r.var(t,!0)};var Xp={},Qp={};Object.defineProperty(Qp,"__esModule",{value:!0}),Qp.getRules=Qp.isJSONType=void 0;const Yp=new Set(["string","number","integer","boolean","null","object","array"]);Qp.isJSONType=function(e){return"string"==typeof e&&Yp.has(e)},Qp.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:{}}};var em={};function tm(e,t){return t.rules.some((t=>rm(e,t)))}function rm(e,t){var r;return void 0!==e[t.keyword]||(null===(r=t.definition.implements)||void 0===r?void 0:r.some((t=>void 0!==e[t])))}Object.defineProperty(em,"__esModule",{value:!0}),em.shouldUseRule=em.shouldUseGroup=em.schemaHasRulesForType=void 0,em.schemaHasRulesForType=function({schema:e,self:t},r){const n=t.RULES.types[r];return n&&!0!==n&&tm(e,n)},em.shouldUseGroup=tm,em.shouldUseRule=rm,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.reportTypeError=e.checkDataTypes=e.checkDataType=e.coerceAndCheckDataType=e.getJSONTypes=e.getSchemaTypes=e.DataType=void 0;const t=Qp,r=em,n=Bp,i=Fp,o=Lp;var a;function s(e){const r=Array.isArray(e)?e:e?[e]:[];if(r.every(t.isJSONType))return r;throw new Error("type must be JSONType or JSONType[]: "+r.join(","))}!function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"}(a=e.DataType||(e.DataType={})),e.getSchemaTypes=function(e){const t=s(e.type);if(t.includes("null")){if(!1===e.nullable)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&void 0!==e.nullable)throw new Error('"nullable" cannot be used without "type"');!0===e.nullable&&t.push("null")}return t},e.getJSONTypes=s,e.coerceAndCheckDataType=function(e,t){const{gen:n,data:o,opts:s}=e,u=function(e,t){return t?e.filter((e=>c.has(e)||"array"===t&&"array"===e)):[]}(t,s.coerceTypes),d=t.length>0&&!(0===u.length&&1===t.length&&(0,r.schemaHasRulesForType)(e,t[0]));if(d){const r=f(t,o,s.strictNumbers,a.Wrong);n.if(r,(()=>{u.length?function(e,t,r){const{gen:n,data:o,opts:a}=e,s=n.let("dataType",i._`typeof ${o}`),u=n.let("coerced",i._`undefined`);"array"===a.coerceTypes&&n.if(i._`${s} == 'object' && Array.isArray(${o}) && ${o}.length == 1`,(()=>n.assign(o,i._`${o}[0]`).assign(s,i._`typeof ${o}`).if(f(t,o,a.strictNumbers),(()=>n.assign(u,o)))));n.if(i._`${u} !== undefined`);for(const e of r)(c.has(e)||"array"===e&&"array"===a.coerceTypes)&&d(e);function d(e){switch(e){case"string":return void n.elseIf(i._`${s} == "number" || ${s} == "boolean"`).assign(u,i._`"" + ${o}`).elseIf(i._`${o} === null`).assign(u,i._`""`);case"number":return void n.elseIf(i._`${s} == "boolean" || ${o} === null + * [js-sha3]{@link https://github.com/emn178/js-sha3} + * + * @version 0.8.0 + * @author Chen, Yi-Cyuan [emn178@gmail.com] + * @copyright Chen, Yi-Cyuan 2015-2018 + * @license MIT + */!function(e){!function(){var t="input is invalid type",r="object"==typeof window,n=r?window:{};n.JS_SHA3_NO_WINDOW&&(r=!1);var i=!r&&"object"==typeof self;!n.JS_SHA3_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node?n=u:i&&(n=self);var o=!n.JS_SHA3_NO_COMMON_JS&&e.exports,a=!n.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,s="0123456789abcdef".split(""),c=[4,1024,262144,67108864],f=[0,8,16,24],d=[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],l=[224,256,384,512],h=[128,256],p=["hex","buffer","arrayBuffer","array","digest"],m={128:168,256:136};!n.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!a||!n.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 g=function(e,t,r){return function(n){return new R(e,t,e).update(n)[r]()}},y=function(e,t,r){return function(n,i){return new R(e,t,i).update(n)[r]()}},b=function(e,t,r){return function(t,n,i,o){return E["cshake"+e].update(t,n,i,o)[r]()}},v=function(e,t,r){return function(t,n,i,o){return E["kmac"+e].update(t,n,i,o)[r]()}},w=function(e,t,r,n){for(var i=0;i>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var n=0;n<50;++n)this.s[n]=0}function N(e,t,r){R.call(this,e,t,r)}R.prototype.update=function(e){if(this.finalized)throw new Error("finalize already called");var r,n=typeof e;if("string"!==n){if("object"!==n)throw new Error(t);if(null===e)throw new Error(t);if(a&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||a&&ArrayBuffer.isView(e)))throw new Error(t);r=!0}for(var i,o,s=this.blocks,c=this.byteCount,u=e.length,d=this.blockCount,l=0,h=this.s;l>2]|=e[l]<>2]|=o<>2]|=(192|o>>6)<>2]|=(128|63&o)<=57344?(s[i>>2]|=(224|o>>12)<>2]|=(128|o>>6&63)<>2]|=(128|63&o)<>2]|=(240|o>>18)<>2]|=(128|o>>12&63)<>2]|=(128|o>>6&63)<>2]|=(128|63&o)<=c){for(this.start=i-c,this.block=s[d],i=0;i>=8);r>0;)i.unshift(r),r=255&(e>>=8),++n;return t?i.push(n):i.unshift(n),this.update(i),i.length},R.prototype.encodeString=function(e){var r,n=typeof e;if("string"!==n){if("object"!==n)throw new Error(t);if(null===e)throw new Error(t);if(a&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||a&&ArrayBuffer.isView(e)))throw new Error(t);r=!0}var i=0,o=e.length;if(r)i=o;else for(var s=0;s=57344?i+=3:(c=65536+((1023&c)<<10|1023&e.charCodeAt(++s)),i+=4)}return i+=this.encode(8*i),this.update(e),i},R.prototype.bytepad=function(e,t){for(var r=this.encode(t),n=0;n>2]|=this.padding[3&t],this.lastByteIndex===this.byteCount)for(e[0]=e[r],t=1;t>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];a%t==0&&(O(r),o=0)}return i&&(e=r[o],c+=s[e>>4&15]+s[15&e],i>1&&(c+=s[e>>12&15]+s[e>>8&15]),i>2&&(c+=s[e>>20&15]+s[e>>16&15])),c},R.prototype.arrayBuffer=function(){this.finalize();var e,t=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,a=0,s=this.outputBits>>3;e=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(s);for(var c=new Uint32Array(e);a>8&255,c[e+2]=t>>16&255,c[e+3]=t>>24&255;s%r==0&&O(n)}return o&&(e=s<<2,t=n[a],c[e]=255&t,o>1&&(c[e+1]=t>>8&255),o>2&&(c[e+2]=t>>16&255)),c},N.prototype=new R,N.prototype.finalize=function(){return this.encode(this.outputBits,!0),R.prototype.finalize.call(this)};var O=function(e){var t,r,n,i,o,a,s,c,u,f,l,h,p,m,g,y,b,v,w,A,_,E,S,P,x,k,M,C,I,R,N,O,T,j,D,$,B,F,z,U,L,q,H,K,J,W,G,V,Z,X,Q,Y,ee,te,re,ne,ie,oe,ae,se,ce,ue,fe;for(n=0;n<48;n+=2)i=e[0]^e[10]^e[20]^e[30]^e[40],o=e[1]^e[11]^e[21]^e[31]^e[41],a=e[2]^e[12]^e[22]^e[32]^e[42],s=e[3]^e[13]^e[23]^e[33]^e[43],c=e[4]^e[14]^e[24]^e[34]^e[44],u=e[5]^e[15]^e[25]^e[35]^e[45],f=e[6]^e[16]^e[26]^e[36]^e[46],l=e[7]^e[17]^e[27]^e[37]^e[47],t=(h=e[8]^e[18]^e[28]^e[38]^e[48])^(a<<1|s>>>31),r=(p=e[9]^e[19]^e[29]^e[39]^e[49])^(s<<1|a>>>31),e[0]^=t,e[1]^=r,e[10]^=t,e[11]^=r,e[20]^=t,e[21]^=r,e[30]^=t,e[31]^=r,e[40]^=t,e[41]^=r,t=i^(c<<1|u>>>31),r=o^(u<<1|c>>>31),e[2]^=t,e[3]^=r,e[12]^=t,e[13]^=r,e[22]^=t,e[23]^=r,e[32]^=t,e[33]^=r,e[42]^=t,e[43]^=r,t=a^(f<<1|l>>>31),r=s^(l<<1|f>>>31),e[4]^=t,e[5]^=r,e[14]^=t,e[15]^=r,e[24]^=t,e[25]^=r,e[34]^=t,e[35]^=r,e[44]^=t,e[45]^=r,t=c^(h<<1|p>>>31),r=u^(p<<1|h>>>31),e[6]^=t,e[7]^=r,e[16]^=t,e[17]^=r,e[26]^=t,e[27]^=r,e[36]^=t,e[37]^=r,e[46]^=t,e[47]^=r,t=f^(i<<1|o>>>31),r=l^(o<<1|i>>>31),e[8]^=t,e[9]^=r,e[18]^=t,e[19]^=r,e[28]^=t,e[29]^=r,e[38]^=t,e[39]^=r,e[48]^=t,e[49]^=r,m=e[0],g=e[1],W=e[11]<<4|e[10]>>>28,G=e[10]<<4|e[11]>>>28,C=e[20]<<3|e[21]>>>29,I=e[21]<<3|e[20]>>>29,se=e[31]<<9|e[30]>>>23,ce=e[30]<<9|e[31]>>>23,q=e[40]<<18|e[41]>>>14,H=e[41]<<18|e[40]>>>14,j=e[2]<<1|e[3]>>>31,D=e[3]<<1|e[2]>>>31,y=e[13]<<12|e[12]>>>20,b=e[12]<<12|e[13]>>>20,V=e[22]<<10|e[23]>>>22,Z=e[23]<<10|e[22]>>>22,R=e[33]<<13|e[32]>>>19,N=e[32]<<13|e[33]>>>19,ue=e[42]<<2|e[43]>>>30,fe=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,re=e[4]<<30|e[5]>>>2,$=e[14]<<6|e[15]>>>26,B=e[15]<<6|e[14]>>>26,v=e[25]<<11|e[24]>>>21,w=e[24]<<11|e[25]>>>21,X=e[34]<<15|e[35]>>>17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e[38]=Y^~K&W,e[39]=ee^~J&G,e[48]=ue^~te&ne,e[49]=fe^~re&ie,e[0]^=d[n],e[1]^=d[n+1]};if(o)e.exports=E;else for(P=0;P>=8;return t}function cs(e,t,r){let n=0;for(let i=0;it+1+n&&as.throwError("child data too short",wo.errors.BUFFER_OVERRUN,{})}return{consumed:1+n,result:i}}function ls(e,t){if(0===e.length&&as.throwError("data too short",wo.errors.BUFFER_OVERRUN,{}),e[t]>=248){const r=e[t]-247;t+1+r>e.length&&as.throwError("data short segment too short",wo.errors.BUFFER_OVERRUN,{});const n=cs(e,t+1,r);return t+1+r+n>e.length&&as.throwError("data long segment too short",wo.errors.BUFFER_OVERRUN,{}),ds(e,t,t+1+r,r+n)}if(e[t]>=192){const r=e[t]-192;return t+1+r>e.length&&as.throwError("data array too short",wo.errors.BUFFER_OVERRUN,{}),ds(e,t,t+1,r)}if(e[t]>=184){const r=e[t]-183;t+1+r>e.length&&as.throwError("data array too short",wo.errors.BUFFER_OVERRUN,{});const n=cs(e,t+1,r);t+1+r+n>e.length&&as.throwError("data array too short",wo.errors.BUFFER_OVERRUN,{});return{consumed:1+r+n,result:To(e.slice(t+1+r,t+1+r+n))}}if(e[t]>=128){const r=e[t]-128;t+1+r>e.length&&as.throwError("data too short",wo.errors.BUFFER_OVERRUN,{});return{consumed:1+r,result:To(e.slice(t+1,t+1+r))}}return{consumed:1,result:To(e[t])}}function hs(e){const t=Mo(e),r=ls(t,0);return r.consumed!==t.length&&as.throwArgumentError("invalid rlp data","data",e),r.result}var ps=Object.freeze({__proto__:null,decode:hs,encode:fs});const ms=new wo("address/5.7.0");function gs(e){No(e,20)||ms.throwArgumentError("invalid address","address",e);const t=(e=e.toLowerCase()).substring(2).split(""),r=new Uint8Array(40);for(let e=0;e<40;e++)r[e]=t[e].charCodeAt(0);const n=Mo(is(r));for(let e=0;e<40;e+=2)n[e>>1]>>4>=8&&(t[e]=t[e].toUpperCase()),(15&n[e>>1])>=8&&(t[e+1]=t[e+1].toUpperCase());return"0x"+t.join("")}const ys={};for(let e=0;e<10;e++)ys[String(e)]=String(e);for(let e=0;e<26;e++)ys[String.fromCharCode(65+e)]=String(10+e);const bs=Math.floor(function(e){return Math.log10?Math.log10(e):Math.log(e)/Math.LN10}(9007199254740991));function vs(e){let t=(e=(e=e.toUpperCase()).substring(4)+e.substring(0,2)+"00").split("").map((e=>ys[e])).join("");for(;t.length>=bs;){let e=t.substring(0,bs);t=parseInt(e,10)%97+t.substring(e.length)}let r=String(98-parseInt(t,10)%97);for(;r.length<2;)r="0"+r;return r}function ws(e){let t=null;if("string"!=typeof e&&ms.throwArgumentError("invalid address","address",e),e.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==e.substring(0,2)&&(e="0x"+e),t=gs(e),e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==e&&ms.throwArgumentError("bad address checksum","address",e);else if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(e.substring(2,4)!==vs(e)&&ms.throwArgumentError("bad icap checksum","address",e),r=e.substring(4),t=new Ko(r,36).toString(16);t.length<40;)t="0"+t;t=gs("0x"+t)}else ms.throwArgumentError("invalid address","address",e);var r;return t}function As(e){let t=null;try{t=ws(e.from)}catch(t){ms.throwArgumentError("missing from address","transaction",e)}return ws(Do(is(fs([t,Io(Mo(Zo.from(e.nonce).toHexString()))])),12))}var _s=Object.freeze({__proto__:null,getAddress:ws,getContractAddress:As,getCreate2Address:function(e,t,r){return 32!==jo(t)&&ms.throwArgumentError("salt must be 32 bytes","salt",t),32!==jo(r)&&ms.throwArgumentError("initCodeHash must be 32 bytes","initCodeHash",r),ws(Do(is(Co(["0xff",ws(e),t,r])),12))},getIcapAddress:function(e){let t=(r=ws(e).substring(2),new Ko(r,16).toString(36)).toUpperCase();for(var r;t.length<30;)t="0"+t;return"XE"+vs("XE00"+t)+t},isAddress:function(e){try{return ws(e),!0}catch(e){}return!1}});class Es extends Ya{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,t){try{t=ws(t)}catch(e){this._throwError(e.message,t)}return e.writeValue(t)}decode(e){return ws(zo(e.readValue().toHexString(),20))}}class Ss extends Ya{constructor(e){super(e.name,e.type,void 0,e.dynamic),this.coder=e}defaultValue(){return this.coder.defaultValue()}encode(e,t){return this.coder.encode(e,t)}decode(e){return this.coder.decode(e)}}const Ps=new wo(ka);function xs(e,t,r){let n=null;if(Array.isArray(r))n=r;else if(r&&"object"==typeof r){let e={};n=t.map((t=>{const n=t.localName;return n||Ps.throwError("cannot encode object for signature with missing names",wo.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:r}),e[n]&&Ps.throwError("cannot encode object for signature with duplicate names",wo.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:r}),e[n]=!0,r[n]}))}else Ps.throwArgumentError("invalid tuple value","tuple",r);t.length!==n.length&&Ps.throwArgumentError("types/value length mismatch","tuple",r);let i=new es(e.wordSize),o=new es(e.wordSize),a=[];t.forEach(((e,t)=>{let r=n[t];if(e.dynamic){let t=o.length;e.encode(o,r);let n=i.writeUpdatableValue();a.push((e=>{n(e+t)}))}else e.encode(i,r)})),a.forEach((e=>{e(i.length)}));let s=e.appendWriter(i);return s+=e.appendWriter(o),s}function ks(e,t){let r=[],n=e.subReader(0);t.forEach((t=>{let i=null;if(t.dynamic){let r=e.readValue(),o=n.subReader(r.toNumber());try{i=t.decode(o)}catch(e){if(e.code===wo.errors.BUFFER_OVERRUN)throw e;i=e,i.baseType=t.name,i.name=t.localName,i.type=t.type}}else try{i=t.decode(e)}catch(e){if(e.code===wo.errors.BUFFER_OVERRUN)throw e;i=e,i.baseType=t.name,i.name=t.localName,i.type=t.type}null!=i&&r.push(i)}));const i=t.reduce(((e,t)=>{const r=t.localName;return r&&(e[r]||(e[r]=0),e[r]++),e}),{});t.forEach(((e,t)=>{let n=e.localName;if(!n||1!==i[n])return;if("length"===n&&(n="_length"),null!=r[n])return;const o=r[t];o instanceof Error?Object.defineProperty(r,n,{enumerable:!0,get:()=>{throw o}}):r[n]=o}));for(let e=0;e{throw t}})}return Object.freeze(r)}class Ms extends Ya{constructor(e,t,r){super("array",e.type+"["+(t>=0?t:"")+"]",r,-1===t||e.dynamic),this.coder=e,this.length=t}defaultValue(){const e=this.coder.defaultValue(),t=[];for(let r=0;re._data.length&&Ps.throwError("insufficient data length",wo.errors.BUFFER_OVERRUN,{length:e._data.length,count:t}));let r=[];for(let e=0;e>6==2;n++)e++;return e}return e===Ls.OVERRUN?r.length-t-1:0}!function(e){e.current="",e.NFC="NFC",e.NFD="NFD",e.NFKC="NFKC",e.NFKD="NFKD"}(Us||(Us={})),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"}(Ls||(Ls={}));const Hs=Object.freeze({error:function(e,t,r,n,i){return zs.throwArgumentError(`invalid codepoint at offset ${t}; ${e}`,"bytes",r)},ignore:qs,replace:function(e,t,r,n,i){return e===Ls.OVERLONG?(n.push(i),0):(n.push(65533),qs(e,t,r))}});function Ks(e,t){null==t&&(t=Hs.error),e=Mo(e);const r=[];let n=0;for(;n>7==0){r.push(i);continue}let o=null,a=null;if(192==(224&i))o=1,a=127;else if(224==(240&i))o=2,a=2047;else{if(240!=(248&i)){n+=t(128==(192&i)?Ls.UNEXPECTED_CONTINUE:Ls.BAD_PREFIX,n-1,e,r);continue}o=3,a=65535}if(n-1+o>=e.length){n+=t(Ls.OVERRUN,n-1,e,r);continue}let s=i&(1<<8-o-1)-1;for(let i=0;i1114111?n+=t(Ls.OUT_OF_RANGE,n-1-o,e,r,s):s>=55296&&s<=57343?n+=t(Ls.UTF16_SURROGATE,n-1-o,e,r,s):s<=a?n+=t(Ls.OVERLONG,n-1-o,e,r,s):r.push(s))}return r}function Js(e,t=Us.current){t!=Us.current&&(zs.checkNormalize(),e=e.normalize(t));let r=[];for(let t=0;t>6|192),r.push(63&n|128);else if(55296==(64512&n)){t++;const i=e.charCodeAt(t);if(t>=e.length||56320!=(64512&i))throw new Error("invalid utf-8 string");const o=65536+((1023&n)<<10)+(1023&i);r.push(o>>18|240),r.push(o>>12&63|128),r.push(o>>6&63|128),r.push(63&o|128)}else r.push(n>>12|224),r.push(n>>6&63|128),r.push(63&n|128)}return Mo(r)}function Ws(e){const t="0000"+e.toString(16);return"\\u"+t.substring(t.length-4)}function Gs(e){return e.map((e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10&1023),56320+(1023&e))))).join("")}function Vs(e,t){return Gs(Ks(e,t))}function Zs(e,t=Us.current){return Ks(Js(e,t))}function Xs(e,t){t||(t=function(e){return[parseInt(e,16)]});let r=0,n={};return e.split(",").forEach((e=>{let i=e.split(":");r+=parseInt(i[0],16),n[r]=t(i[1])})),n}function Qs(e){let t=0;return e.split(",").map((e=>{let r=e.split("-");1===r.length?r[1]="0":""===r[1]&&(r[1]="1");let n=t+parseInt(r[0],16);return t=parseInt(r[1],16),{l:n,h:t}}))}function Ys(e,t){let r=0;for(let n=0;n=r&&e<=r+i.h&&(e-r)%(i.d||1)==0){if(i.e&&-1!==i.e.indexOf(e-r))continue;return i}}return null}const ec=Qs("221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d"),tc="ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map((e=>parseInt(e,16))),rc=[{h:25,s:32,l:65},{h:30,s:32,e:[23],l:127},{h:54,s:1,e:[48],l:64,d:2},{h:14,s:1,l:57,d:2},{h:44,s:1,l:17,d:2},{h:10,s:1,e:[2,6,8],l:61,d:2},{h:16,s:1,l:68,d:2},{h:84,s:1,e:[18,24,66],l:19,d:2},{h:26,s:32,e:[17],l:435},{h:22,s:1,l:71,d:2},{h:15,s:80,l:40},{h:31,s:32,l:16},{h:32,s:1,l:80,d:2},{h:52,s:1,l:42,d:2},{h:12,s:1,l:55,d:2},{h:40,s:1,e:[38],l:15,d:2},{h:14,s:1,l:48,d:2},{h:37,s:48,l:49},{h:148,s:1,l:6351,d:2},{h:88,s:1,l:160,d:2},{h:15,s:16,l:704},{h:25,s:26,l:854},{h:25,s:32,l:55915},{h:37,s:40,l:1247},{h:25,s:-119711,l:53248},{h:25,s:-119763,l:52},{h:25,s:-119815,l:52},{h:25,s:-119867,e:[1,4,5,7,8,11,12,17],l:52},{h:25,s:-119919,l:52},{h:24,s:-119971,e:[2,7,8,17],l:52},{h:24,s:-120023,e:[2,7,13,15,16,17],l:52},{h:25,s:-120075,l:52},{h:25,s:-120127,l:52},{h:25,s:-120179,l:52},{h:25,s:-120231,l:52},{h:25,s:-120283,l:52},{h:25,s:-120335,l:52},{h:24,s:-119543,e:[17],l:56},{h:24,s:-119601,e:[17],l:58},{h:24,s:-119659,e:[17],l:58},{h:24,s:-119717,e:[17],l:58},{h:24,s:-119775,e:[17],l:58}],nc=Xs("b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3"),ic=Xs("179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7"),oc=Xs("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D",(function(e){if(e.length%4!=0)throw new Error("bad data");let t=[];for(let r=0;r{if(e<256){switch(e){case 8:return"\\b";case 9:return"\\t";case 10:return"\\n";case 13:return"\\r";case 34:return'\\"';case 92:return"\\\\"}if(e>=32&&e<127)return String.fromCharCode(e)}return e<=65535?Ws(e):Ws(55296+((e-=65536)>>10&1023))+Ws(56320+(1023&e))})).join("")+'"'},formatBytes32String:function(e){const t=Js(e);if(t.length>31)throw new Error("bytes32 string must be less than 32 bytes");return To(Co([t,Bs]).slice(0,32))},nameprep:function(e){if(e.match(/^[a-z0-9-]*$/i)&&e.length<=59)return e.toLowerCase();let t=Zs(e);var r;r=t.map((e=>{if(tc.indexOf(e)>=0)return[];if(e>=65024&&e<=65039)return[];let t=function(e){let t=Ys(e,rc);if(t)return[e+t.s];let r=nc[e];if(r)return r;let n=ic[e];return n?[e+n[0]]:oc[e]||null}(e);return t||[e]})),t=r.reduce(((e,t)=>(t.forEach((t=>{e.push(t)})),e)),[]),t=Zs(Gs(t),Us.NFKC),t.forEach((e=>{if(Ys(e,ac))throw new Error("STRINGPREP_CONTAINS_PROHIBITED")})),t.forEach((e=>{if(Ys(e,ec))throw new Error("STRINGPREP_CONTAINS_UNASSIGNED")}));let n=Gs(t);if("-"===n.substring(0,1)||"--"===n.substring(2,4)||"-"===n.substring(n.length-1))throw new Error("invalid hyphen");return n},parseBytes32String:function(e){const t=Mo(e);if(32!==t.length)throw new Error("invalid bytes32 - not 32 bytes long");if(0!==t[31])throw new Error("invalid bytes32 string - no null terminator");let r=31;for(;0===t[r-1];)r--;return Vs(t.slice(0,r))},toUtf8Bytes:Js,toUtf8CodePoints:Zs,toUtf8String:Vs});class cc extends Is{constructor(e){super("string",e)}defaultValue(){return""}encode(e,t){return super.encode(e,Js(t))}decode(e){return Vs(super.decode(e))}}class uc extends Ya{constructor(e,t){let r=!1;const n=[];e.forEach((e=>{e.dynamic&&(r=!0),n.push(e.type)}));super("tuple","tuple("+n.join(",")+")",t,r),this.coders=e}defaultValue(){const e=[];this.coders.forEach((t=>{e.push(t.defaultValue())}));const t=this.coders.reduce(((e,t)=>{const r=t.localName;return r&&(e[r]||(e[r]=0),e[r]++),e}),{});return this.coders.forEach(((r,n)=>{let i=r.localName;i&&1===t[i]&&("length"===i&&(i="_length"),null==e[i]&&(e[i]=e[n]))})),Object.freeze(e)}encode(e,t){return xs(e,this.coders,t)}decode(e){return e.coerce(this.name,ks(e,this.coders))}}const fc=new wo(ka),dc=new RegExp(/^bytes([0-9]*)$/),lc=new RegExp(/^(u?int)([0-9]*)$/);class hc{constructor(e){ga(this,"coerceFunc",e||null)}_getCoder(e){switch(e.baseType){case"address":return new Es(e.name);case"bool":return new Cs(e.name);case"string":return new cc(e.name);case"bytes":return new Rs(e.name);case"array":return new Ms(this._getCoder(e.arrayChildren),e.arrayLength,e.name);case"tuple":return new uc((e.components||[]).map((e=>this._getCoder(e))),e.name);case"":return new Os(e.name)}let t=e.type.match(lc);if(t){let r=parseInt(t[2]||"256");return(0===r||r>256||r%8!=0)&&fc.throwArgumentError("invalid "+t[1]+" bit length","param",e),new Fs(r/8,"int"===t[1],e.name)}if(t=e.type.match(dc),t){let r=parseInt(t[1]);return(0===r||r>32)&&fc.throwArgumentError("invalid bytes length","param",e),new Ns(r,e.name)}return fc.throwArgumentError("invalid type","type",e.type)}_getWordSize(){return 32}_getReader(e,t){return new ts(e,this._getWordSize(),this.coerceFunc,t)}_getWriter(){return new es(this._getWordSize())}getDefaultValue(e){const t=e.map((e=>this._getCoder(Da.from(e))));return new uc(t,"_").defaultValue()}encode(e,t){e.length!==t.length&&fc.throwError("types/values length mismatch",wo.errors.INVALID_ARGUMENT,{count:{types:e.length,values:t.length},value:{types:e,values:t}});const r=e.map((e=>this._getCoder(Da.from(e)))),n=new uc(r,"_"),i=this._getWriter();return n.encode(i,t),i.data}decode(e,t,r){const n=e.map((e=>this._getCoder(Da.from(e))));return new uc(n,"_").decode(this._getReader(Mo(t),r))}}const pc=new hc;function mc(e){return is(Js(e))}const gc="hash/5.7.0";function yc(e){e=atob(e);const t=[];for(let r=0;r0&&Array.isArray(e)?i(e,t-1):r.push(e)}))};return i(e,t),r}function Ac(e){return function(e){let t=0;return()=>e[t++]}(function(e){let t=0;function r(){return e[t++]<<8|e[t++]}let n=r(),i=1,o=[0,1];for(let e=1;e>--c&1}const d=Math.pow(2,31),l=d>>>1,h=l>>1,p=d-1;let m=0;for(let e=0;e<31;e++)m=m<<1|f();let g=[],y=0,b=d;for(;;){let e=Math.floor(((m-y+1)*i-1)/b),t=0,r=n;for(;r-t>1;){let n=t+r>>>1;e>>1|f(),a=a<<1^l,s=(s^l)<<1|l|1;y=a,b=1+s-a}let v=n-4;return g.map((t=>{switch(t-v){case 3:return v+65792+(e[s++]<<16|e[s++]<<8|e[s++]);case 2:return v+256+(e[s++]<<8|e[s++]);case 1:return v+e[s++];default:return t-1}}))}(e))}function _c(e){return 1&e?~e>>1:e>>1}function Ec(e,t){let r=Array(e);for(let n=0,i=-1;nt[e])):r}function xc(e,t,r){let n=Array(e).fill(void 0).map((()=>[]));for(let i=0;in[t].push(e)));return n}function kc(e,t){let r=1+t(),n=t(),i=function(e){let t=[];for(;;){let r=e();if(0==r)break;t.push(r)}return t}(t);return wc(xc(i.length,1+e,t).map(((e,t)=>{const o=e[0],a=e.slice(1);return Array(i[t]).fill(void 0).map(((e,t)=>{let i=t*n;return[o+t*r,a.map((e=>e+i))]}))})))}function Mc(e,t){return xc(1+t(),1+e,t).map((e=>[e[0],e.slice(1)]))}const Cc=Ac(yc("AEQF2AO2DEsA2wIrAGsBRABxAN8AZwCcAEwAqgA0AGwAUgByADcATAAVAFYAIQAyACEAKAAYAFgAGwAjABQAMAAmADIAFAAfABQAKwATACoADgAbAA8AHQAYABoAGQAxADgALAAoADwAEwA9ABMAGgARAA4ADwAWABMAFgAIAA8AHgQXBYMA5BHJAS8JtAYoAe4AExozi0UAH21tAaMnBT8CrnIyhrMDhRgDygIBUAEHcoFHUPe8AXBjAewCjgDQR8IICIcEcQLwATXCDgzvHwBmBoHNAqsBdBcUAykgDhAMShskMgo8AY8jqAQfAUAfHw8BDw87MioGlCIPBwZCa4ELatMAAMspJVgsDl8AIhckSg8XAHdvTwBcIQEiDT4OPhUqbyECAEoAS34Aej8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E2N9ORY6DfeLRC4l9Rvr5h95XDWB2mR1d4WFudpsgVYwiTwT31ljskD8ZyDOlm5DkGh9N/UB/0AI5Xvb8ZBmai2hQ4BWMqFwYnzxwB26YHSOv9WgY3JXnvoN+2R4rqGVh/LLDMtpFP+SpMGJNWvbIl5SOodbCczW2RKleksPoUeGEzrjtKHVdtZA+kfqO+rVx/iclCqwoopepvJpSTDjT+b9GWylGRF8EDbGlw6eUzmJM95Ovoz+kwLX3c2fTjFeYEsE7vUZm3mqdGJuKh2w9/QGSaqRHs99aScGOdDqkFcACoqdbBoQqqjamhH6Q9ng39JCg3lrGJwd50Qk9ovnqBTr8MME7Ps2wiVfygUmPoUBJJfJWX5Nda0nuncbFkA==")),Ic=new Set(Pc(Cc)),Rc=new Set(Pc(Cc)),Nc=function(e){let t=[];for(;;){let r=e();if(0==r)break;t.push(kc(r,e))}for(;;){let r=e()-1;if(r<0)break;t.push(Mc(r,e))}return function(e){const t={};for(let r=0;re-t));return function r(){let n=[];for(;;){let i=Pc(e,t);if(0==i.length)break;n.push({set:new Set(i),node:r()})}n.sort(((e,t)=>t.set.size-e.set.size));let i=e(),o=i%3;i=i/3|0;let a=!!(1&i);return i>>=1,{branches:n,valid:o,fe0f:a,save:1==i,check:2==i}}()}(Cc),Tc=45,jc=95;function Dc(e){return Zs(e)}function $c(e){return e.filter((e=>65039!=e))}function Bc(e){for(let t of e.split(".")){let e=Dc(t);try{for(let t=e.lastIndexOf(jc)-1;t>=0;t--)if(e[t]!==jc)throw new Error("underscore only allowed at start");if(e.length>=4&&e.every((e=>e<128))&&e[2]===Tc&&e[3]===Tc)throw new Error("invalid label extension")}catch(e){throw new Error(`Invalid label "${t}": ${e.message}`)}}return e}function Fc(e){return Bc(function(e,t){let r=Dc(e).reverse(),n=[];for(;r.length;){let e=zc(r);if(e){n.push(...t(e));continue}let i=r.pop();if(Ic.has(i)){n.push(i);continue}if(Rc.has(i))continue;let o=Nc[i];if(!o)throw new Error(`Disallowed codepoint: 0x${i.toString(16).toUpperCase()}`);n.push(...o)}return Bc(function(e){return e.normalize("NFC")}(String.fromCodePoint(...n)))}(e,$c))}function zc(e,t){var r;let n,i,o=Oc,a=[],s=e.length;for(t&&(t.length=0);s;){let c=e[--s];if(o=null===(r=o.branches.find((e=>e.set.has(c))))||void 0===r?void 0:r.node,!o)break;if(o.save)i=c;else if(o.check&&c===i)break;a.push(c),o.fe0f&&(a.push(65039),s>0&&65039==e[s-1]&&s--),o.valid&&(n=a.slice(),2==o.valid&&n.splice(1,1),t&&t.push(...e.slice(s).reverse()),e.length=s)}return n}const Uc=new wo(gc),Lc=new Uint8Array(32);function qc(e){if(0===e.length)throw new Error("invalid ENS name; empty component");return e}function Hc(e){const t=Js(Fc(e)),r=[];if(0===e.length)return r;let n=0;for(let e=0;e=t.length)throw new Error("invalid ENS name; empty component");return r.push(qc(t.slice(n))),r}function Kc(e){"string"!=typeof e&&Uc.throwArgumentError("invalid ENS name; not a string","name",e);let t=Lc;const r=Hc(e);for(;r.length;)t=is(Co([t,is(r.pop())]));return To(t)}function Jc(e){return To(Co(Hc(e).map((e=>{if(e.length>63)throw new Error("invalid DNS encoded entry; length exceeds 63 bytes");const t=new Uint8Array(e.length+1);return t.set(e,1),t[0]=t.length-1,t}))))+"00"}Lc.fill(0);const Wc="Ethereum Signed Message:\n";function Gc(e){return"string"==typeof e&&(e=Js(e)),is(Co([Js(Wc),Js(String(e.length)),e]))}var Vc=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))};const Zc=new wo(gc),Xc=new Uint8Array(32);Xc.fill(0);const Qc=Zo.from(-1),Yc=Zo.from(0),eu=Zo.from(1),tu=Zo.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");const ru=zo(eu.toHexString(),32),nu=zo(Yc.toHexString(),32),iu={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},ou=["name","version","chainId","verifyingContract","salt"];function au(e){return function(t){return"string"!=typeof t&&Zc.throwArgumentError(`invalid domain value for ${JSON.stringify(e)}`,`domain.${e}`,t),t}}const su={name:au("name"),version:au("version"),chainId:function(e){try{return Zo.from(e).toString()}catch(e){}return Zc.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",e)},verifyingContract:function(e){try{return ws(e).toLowerCase()}catch(e){}return Zc.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",e)},salt:function(e){try{const t=Mo(e);if(32!==t.length)throw new Error("bad length");return To(t)}catch(e){}return Zc.throwArgumentError('invalid domain value "salt"',"domain.salt",e)}};function cu(e){{const t=e.match(/^(u?)int(\d*)$/);if(t){const r=""===t[1],n=parseInt(t[2]||"256");(n%8!=0||n>256||t[2]&&t[2]!==String(n))&&Zc.throwArgumentError("invalid numeric width","type",e);const i=tu.mask(r?n-1:n),o=r?i.add(eu).mul(Qc):Yc;return function(t){const r=Zo.from(t);return(r.lt(o)||r.gt(i))&&Zc.throwArgumentError(`value out-of-bounds for ${e}`,"value",t),zo(r.toTwos(256).toHexString(),32)}}}{const t=e.match(/^bytes(\d+)$/);if(t){const r=parseInt(t[1]);return(0===r||r>32||t[1]!==String(r))&&Zc.throwArgumentError("invalid bytes width","type",e),function(t){return Mo(t).length!==r&&Zc.throwArgumentError(`invalid length for ${e}`,"value",t),function(e){const t=Mo(e),r=t.length%32;return r?$o([t,Xc.slice(r)]):To(t)}(t)}}}switch(e){case"address":return function(e){return zo(ws(e),32)};case"bool":return function(e){return e?ru:nu};case"bytes":return function(e){return is(e)};case"string":return function(e){return mc(e)}}return null}function uu(e,t){return`${e}(${t.map((({name:e,type:t})=>t+" "+e)).join(",")})`}class fu{constructor(e){ga(this,"types",Object.freeze(Sa(e))),ga(this,"_encoderCache",{}),ga(this,"_types",{});const t={},r={},n={};Object.keys(e).forEach((e=>{t[e]={},r[e]=[],n[e]={}}));for(const n in e){const i={};e[n].forEach((o=>{i[o.name]&&Zc.throwArgumentError(`duplicate variable name ${JSON.stringify(o.name)} in ${JSON.stringify(n)}`,"types",e),i[o.name]=!0;const a=o.type.match(/^([^\x5b]*)(\x5b|$)/)[1];a===n&&Zc.throwArgumentError(`circular type reference to ${JSON.stringify(a)}`,"types",e);cu(a)||(r[a]||Zc.throwArgumentError(`unknown type ${JSON.stringify(a)}`,"types",e),r[a].push(n),t[n][a]=!0)}))}const i=Object.keys(r).filter((e=>0===r[e].length));0===i.length?Zc.throwArgumentError("missing primary type","types",e):i.length>1&&Zc.throwArgumentError(`ambiguous primary types or unused types: ${i.map((e=>JSON.stringify(e))).join(", ")}`,"types",e),ga(this,"primaryType",i[0]),function i(o,a){a[o]&&Zc.throwArgumentError(`circular type reference to ${JSON.stringify(o)}`,"types",e),a[o]=!0,Object.keys(t[o]).forEach((e=>{r[e]&&(i(e,a),Object.keys(a).forEach((t=>{n[t][e]=!0})))})),delete a[o]}(this.primaryType,{});for(const t in n){const r=Object.keys(n[t]);r.sort(),this._types[t]=uu(t,e[t])+r.map((t=>uu(t,e[t]))).join("")}}getEncoder(e){let t=this._encoderCache[e];return t||(t=this._encoderCache[e]=this._getEncoder(e)),t}_getEncoder(e){{const t=cu(e);if(t)return t}const t=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(t){const e=t[1],r=this.getEncoder(e),n=parseInt(t[3]);return t=>{n>=0&&t.length!==n&&Zc.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",t);let i=t.map(r);return this._types[e]&&(i=i.map(is)),is($o(i))}}const r=this.types[e];if(r){const t=mc(this._types[e]);return e=>{const n=r.map((({name:t,type:r})=>{const n=this.getEncoder(r)(e[t]);return this._types[r]?is(n):n}));return n.unshift(t),$o(n)}}return Zc.throwArgumentError(`unknown type: ${e}`,"type",e)}encodeType(e){const t=this._types[e];return t||Zc.throwArgumentError(`unknown type: ${JSON.stringify(e)}`,"name",e),t}encodeData(e,t){return this.getEncoder(e)(t)}hashStruct(e,t){return is(this.encodeData(e,t))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,t,r){if(cu(e))return r(e,t);const n=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(n){const e=n[1],i=parseInt(n[3]);return i>=0&&t.length!==i&&Zc.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",t),t.map((t=>this._visit(e,t,r)))}const i=this.types[e];return i?i.reduce(((e,{name:n,type:i})=>(e[n]=this._visit(i,t[n],r),e)),{}):Zc.throwArgumentError(`unknown type: ${e}`,"type",e)}visit(e,t){return this._visit(this.primaryType,e,t)}static from(e){return new fu(e)}static getPrimaryType(e){return fu.from(e).primaryType}static hashStruct(e,t,r){return fu.from(t).hashStruct(e,r)}static hashDomain(e){const t=[];for(const r in e){const n=iu[r];n||Zc.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(r)}`,"domain",e),t.push({name:r,type:n})}return t.sort(((e,t)=>ou.indexOf(e.name)-ou.indexOf(t.name))),fu.hashStruct("EIP712Domain",{EIP712Domain:t},e)}static encode(e,t,r){return $o(["0x1901",fu.hashDomain(e),fu.from(t).hash(r)])}static hash(e,t,r){return is(fu.encode(e,t,r))}static resolveNames(e,t,r,n){return Vc(this,void 0,void 0,(function*(){e=wa(e);const i={};e.verifyingContract&&!No(e.verifyingContract,20)&&(i[e.verifyingContract]="0x");const o=fu.from(t);o.visit(r,((e,t)=>("address"!==e||No(t,20)||(i[t]="0x"),t)));for(const e in i)i[e]=yield n(e);return e.verifyingContract&&i[e.verifyingContract]&&(e.verifyingContract=i[e.verifyingContract]),r=o.visit(r,((e,t)=>"address"===e&&i[t]?i[t]:t)),{domain:e,value:r}}))}static getPayload(e,t,r){fu.hashDomain(e);const n={},i=[];ou.forEach((t=>{const r=e[t];null!=r&&(n[t]=su[t](r),i.push({name:t,type:iu[t]}))}));const o=fu.from(t),a=wa(t);return a.EIP712Domain?Zc.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",t):a.EIP712Domain=i,o.encode(r),{types:a,domain:n,primaryType:o.primaryType,message:o.visit(r,((e,t)=>{if(e.match(/^bytes(\d*)/))return To(Mo(t));if(e.match(/^u?int/))return Zo.from(t).toString();switch(e){case"address":return t.toLowerCase();case"bool":return!!t;case"string":return"string"!=typeof t&&Zc.throwArgumentError("invalid string","value",t),t}return Zc.throwArgumentError("unsupported type","type",e)}))}}}var du=Object.freeze({__proto__:null,_TypedDataEncoder:fu,dnsEncode:Jc,ensNormalize:function(e){return Hc(e).map((e=>Vs(e))).join(".")},hashMessage:Gc,id:mc,isValidName:function(e){try{return 0!==Hc(e).length}catch(e){}return!1},messagePrefix:Wc,namehash:Kc});const lu=new wo(ka);class hu extends Pa{}class pu extends Pa{}class mu extends Pa{}class gu extends Pa{static isIndexed(e){return!(!e||!e._isIndexed)}}const yu={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function bu(e,t){const r=new Error(`deferred error during ABI decoding triggered accessing ${e}`);return r.error=t,r}class vu{constructor(e){let t=[];t="string"==typeof e?JSON.parse(e):e,ga(this,"fragments",t.map((e=>Ba.from(e))).filter((e=>null!=e))),ga(this,"_abiCoder",ya(new.target,"getAbiCoder")()),ga(this,"functions",{}),ga(this,"errors",{}),ga(this,"events",{}),ga(this,"structs",{}),this.fragments.forEach((e=>{let t=null;switch(e.type){case"constructor":return this.deploy?void lu.warn("duplicate definition - constructor"):void ga(this,"deploy",e);case"function":t=this.functions;break;case"event":t=this.events;break;case"error":t=this.errors;break;default:return}let r=e.format();t[r]?lu.warn("duplicate definition - "+r):t[r]=e})),this.deploy||ga(this,"deploy",qa.from({payable:!1,type:"constructor"})),ga(this,"_isInterface",!0)}format(e){e||(e=Ta.full),e===Ta.sighash&&lu.throwArgumentError("interface does not support formatting sighash","format",e);const t=this.fragments.map((t=>t.format(e)));return e===Ta.json?JSON.stringify(t.map((e=>JSON.parse(e)))):t}static getAbiCoder(){return pc}static getAddress(e){return ws(e)}static getSighash(e){return Do(mc(e.format()),0,4)}static getEventTopic(e){return mc(e.format())}getFunction(e){if(No(e)){for(const t in this.functions)if(e===this.getSighash(t))return this.functions[t];lu.throwArgumentError("no matching function","sighash",e)}if(-1===e.indexOf("(")){const t=e.trim(),r=Object.keys(this.functions).filter((e=>e.split("(")[0]===t));return 0===r.length?lu.throwArgumentError("no matching function","name",t):r.length>1&&lu.throwArgumentError("multiple matching functions","name",t),this.functions[r[0]]}const t=this.functions[Ha.fromString(e).format()];return t||lu.throwArgumentError("no matching function","signature",e),t}getEvent(e){if(No(e)){const t=e.toLowerCase();for(const e in this.events)if(t===this.getEventTopic(e))return this.events[e];lu.throwArgumentError("no matching event","topichash",t)}if(-1===e.indexOf("(")){const t=e.trim(),r=Object.keys(this.events).filter((e=>e.split("(")[0]===t));return 0===r.length?lu.throwArgumentError("no matching event","name",t):r.length>1&&lu.throwArgumentError("multiple matching events","name",t),this.events[r[0]]}const t=this.events[Fa.fromString(e).format()];return t||lu.throwArgumentError("no matching event","signature",e),t}getError(e){if(No(e)){const t=ya(this.constructor,"getSighash");for(const r in this.errors){if(e===t(this.errors[r]))return this.errors[r]}lu.throwArgumentError("no matching error","sighash",e)}if(-1===e.indexOf("(")){const t=e.trim(),r=Object.keys(this.errors).filter((e=>e.split("(")[0]===t));return 0===r.length?lu.throwArgumentError("no matching error","name",t):r.length>1&&lu.throwArgumentError("multiple matching errors","name",t),this.errors[r[0]]}const t=this.errors[Ha.fromString(e).format()];return t||lu.throwArgumentError("no matching error","signature",e),t}getSighash(e){if("string"==typeof e)try{e=this.getFunction(e)}catch(t){try{e=this.getError(e)}catch(e){throw t}}return ya(this.constructor,"getSighash")(e)}getEventTopic(e){return"string"==typeof e&&(e=this.getEvent(e)),ya(this.constructor,"getEventTopic")(e)}_decodeParams(e,t){return this._abiCoder.decode(e,t)}_encodeParams(e,t){return this._abiCoder.encode(e,t)}encodeDeploy(e){return this._encodeParams(this.deploy.inputs,e||[])}decodeErrorResult(e,t){"string"==typeof e&&(e=this.getError(e));const r=Mo(t);return To(r.slice(0,4))!==this.getSighash(e)&&lu.throwArgumentError(`data signature does not match error ${e.name}.`,"data",To(r)),this._decodeParams(e.inputs,r.slice(4))}encodeErrorResult(e,t){return"string"==typeof e&&(e=this.getError(e)),To(Co([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}decodeFunctionData(e,t){"string"==typeof e&&(e=this.getFunction(e));const r=Mo(t);return To(r.slice(0,4))!==this.getSighash(e)&&lu.throwArgumentError(`data signature does not match function ${e.name}.`,"data",To(r)),this._decodeParams(e.inputs,r.slice(4))}encodeFunctionData(e,t){return"string"==typeof e&&(e=this.getFunction(e)),To(Co([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}decodeFunctionResult(e,t){"string"==typeof e&&(e=this.getFunction(e));let r=Mo(t),n=null,i="",o=null,a=null,s=null;switch(r.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(e.outputs,r)}catch(e){}break;case 4:{const e=To(r.slice(0,4)),t=yu[e];if(t)o=this._abiCoder.decode(t.inputs,r.slice(4)),a=t.name,s=t.signature,t.reason&&(n=o[0]),"Error"===a?i=`; VM Exception while processing transaction: reverted with reason string ${JSON.stringify(o[0])}`:"Panic"===a&&(i=`; VM Exception while processing transaction: reverted with panic code ${o[0]}`);else try{const t=this.getError(e);o=this._abiCoder.decode(t.inputs,r.slice(4)),a=t.name,s=t.format()}catch(e){}break}}return lu.throwError("call revert exception"+i,wo.errors.CALL_EXCEPTION,{method:e.format(),data:To(t),errorArgs:o,errorName:a,errorSignature:s,reason:n})}encodeFunctionResult(e,t){return"string"==typeof e&&(e=this.getFunction(e)),To(this._abiCoder.encode(e.outputs,t||[]))}encodeFilterTopics(e,t){"string"==typeof e&&(e=this.getEvent(e)),t.length>e.inputs.length&&lu.throwError("too many arguments for "+e.format(),wo.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:t});let r=[];e.anonymous||r.push(this.getEventTopic(e));const n=(e,t)=>"string"===e.type?mc(t):"bytes"===e.type?is(To(t)):("bool"===e.type&&"boolean"==typeof t&&(t=t?"0x01":"0x00"),e.type.match(/^u?int/)&&(t=Zo.from(t).toHexString()),"address"===e.type&&this._abiCoder.encode(["address"],[t]),zo(To(t),32));for(t.forEach(((t,i)=>{let o=e.inputs[i];o.indexed?null==t?r.push(null):"array"===o.baseType||"tuple"===o.baseType?lu.throwArgumentError("filtering with tuples or arrays not supported","contract."+o.name,t):Array.isArray(t)?r.push(t.map((e=>n(o,e)))):r.push(n(o,t)):null!=t&&lu.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+o.name,t)}));r.length&&null===r[r.length-1];)r.pop();return r}encodeEventLog(e,t){"string"==typeof e&&(e=this.getEvent(e));const r=[],n=[],i=[];return e.anonymous||r.push(this.getEventTopic(e)),t.length!==e.inputs.length&&lu.throwArgumentError("event arguments/values mismatch","values",t),e.inputs.forEach(((e,o)=>{const a=t[o];if(e.indexed)if("string"===e.type)r.push(mc(a));else if("bytes"===e.type)r.push(is(a));else{if("tuple"===e.baseType||"array"===e.baseType)throw new Error("not implemented");r.push(this._abiCoder.encode([e.type],[a]))}else n.push(e),i.push(a)})),{data:this._abiCoder.encode(n,i),topics:r}}decodeEventLog(e,t,r){if("string"==typeof e&&(e=this.getEvent(e)),null!=r&&!e.anonymous){let t=this.getEventTopic(e);No(r[0],32)&&r[0].toLowerCase()===t||lu.throwError("fragment/topic mismatch",wo.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:t,value:r[0]}),r=r.slice(1)}let n=[],i=[],o=[];e.inputs.forEach(((e,t)=>{e.indexed?"string"===e.type||"bytes"===e.type||"tuple"===e.baseType||"array"===e.baseType?(n.push(Da.fromObject({type:"bytes32",name:e.name})),o.push(!0)):(n.push(e),o.push(!1)):(i.push(e),o.push(!1))}));let a=null!=r?this._abiCoder.decode(n,Co(r)):null,s=this._abiCoder.decode(i,t,!0),c=[],u=0,f=0;e.inputs.forEach(((e,t)=>{if(e.indexed)if(null==a)c[t]=new gu({_isIndexed:!0,hash:null});else if(o[t])c[t]=new gu({_isIndexed:!0,hash:a[f++]});else try{c[t]=a[f++]}catch(e){c[t]=e}else try{c[t]=s[u++]}catch(e){c[t]=e}if(e.name&&null==c[e.name]){const r=c[t];r instanceof Error?Object.defineProperty(c,e.name,{enumerable:!0,get:()=>{throw bu(`property ${JSON.stringify(e.name)}`,r)}}):c[e.name]=r}}));for(let e=0;e{throw bu(`index ${e}`,t)}})}return Object.freeze(c)}parseTransaction(e){let t=this.getFunction(e.data.substring(0,10).toLowerCase());return t?new pu({args:this._abiCoder.decode(t.inputs,"0x"+e.data.substring(10)),functionFragment:t,name:t.name,signature:t.format(),sighash:this.getSighash(t),value:Zo.from(e.value||"0")}):null}parseLog(e){let t=this.getEvent(e.topics[0]);return!t||t.anonymous?null:new hu({eventFragment:t,name:t.name,signature:t.format(),topic:this.getEventTopic(t),args:this.decodeEventLog(t,e.data,e.topics)})}parseError(e){const t=To(e);let r=this.getError(t.substring(0,10).toLowerCase());return r?new mu({args:this._abiCoder.decode(r.inputs,"0x"+t.substring(10)),errorFragment:r,name:r.name,signature:r.format(),sighash:this.getSighash(r)}):null}static isInterface(e){return!(!e||!e._isInterface)}}var wu=Object.freeze({__proto__:null,AbiCoder:hc,ConstructorFragment:qa,ErrorFragment:Ja,EventFragment:Fa,FormatTypes:Ta,Fragment:Ba,FunctionFragment:Ha,Indexed:gu,Interface:vu,LogDescription:hu,ParamType:Da,TransactionDescription:pu,checkResultErrors:Qa,defaultAbiCoder:pc});var Au=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))};const _u=new wo("abstract-provider/5.7.0");class Eu extends Pa{static isForkEvent(e){return!(!e||!e._isForkEvent)}}class Su{constructor(){_u.checkAbstract(new.target,Su),ga(this,"_isProvider",!0)}getFeeData(){return Au(this,void 0,void 0,(function*(){const{block:e,gasPrice:t}=yield ba({block:this.getBlock("latest"),gasPrice:this.getGasPrice().catch((e=>null))});let r=null,n=null,i=null;return e&&e.baseFeePerGas&&(r=e.baseFeePerGas,i=Zo.from("1500000000"),n=e.baseFeePerGas.mul(2).add(i)),{lastBaseFeePerGas:r,maxFeePerGas:n,maxPriorityFeePerGas:i,gasPrice:t}}))}addListener(e,t){return this.on(e,t)}removeListener(e,t){return this.off(e,t)}static isProvider(e){return!(!e||!e._isProvider)}}var Pu=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))};const xu=new wo("abstract-signer/5.7.0"),ku=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],Mu=[wo.errors.INSUFFICIENT_FUNDS,wo.errors.NONCE_EXPIRED,wo.errors.REPLACEMENT_UNDERPRICED];class Cu{constructor(){xu.checkAbstract(new.target,Cu),ga(this,"_isSigner",!0)}getBalance(e){return Pu(this,void 0,void 0,(function*(){return this._checkProvider("getBalance"),yield this.provider.getBalance(this.getAddress(),e)}))}getTransactionCount(e){return Pu(this,void 0,void 0,(function*(){return this._checkProvider("getTransactionCount"),yield this.provider.getTransactionCount(this.getAddress(),e)}))}estimateGas(e){return Pu(this,void 0,void 0,(function*(){this._checkProvider("estimateGas");const t=yield ba(this.checkTransaction(e));return yield this.provider.estimateGas(t)}))}call(e,t){return Pu(this,void 0,void 0,(function*(){this._checkProvider("call");const r=yield ba(this.checkTransaction(e));return yield this.provider.call(r,t)}))}sendTransaction(e){return Pu(this,void 0,void 0,(function*(){this._checkProvider("sendTransaction");const t=yield this.populateTransaction(e),r=yield this.signTransaction(t);return yield this.provider.sendTransaction(r)}))}getChainId(){return Pu(this,void 0,void 0,(function*(){this._checkProvider("getChainId");return(yield this.provider.getNetwork()).chainId}))}getGasPrice(){return Pu(this,void 0,void 0,(function*(){return this._checkProvider("getGasPrice"),yield this.provider.getGasPrice()}))}getFeeData(){return Pu(this,void 0,void 0,(function*(){return this._checkProvider("getFeeData"),yield this.provider.getFeeData()}))}resolveName(e){return Pu(this,void 0,void 0,(function*(){return this._checkProvider("resolveName"),yield this.provider.resolveName(e)}))}checkTransaction(e){for(const t in e)-1===ku.indexOf(t)&&xu.throwArgumentError("invalid transaction key: "+t,"transaction",e);const t=wa(e);return null==t.from?t.from=this.getAddress():t.from=Promise.all([Promise.resolve(t.from),this.getAddress()]).then((t=>(t[0].toLowerCase()!==t[1].toLowerCase()&&xu.throwArgumentError("from address mismatch","transaction",e),t[0]))),t}populateTransaction(e){return Pu(this,void 0,void 0,(function*(){const t=yield ba(this.checkTransaction(e));null!=t.to&&(t.to=Promise.resolve(t.to).then((e=>Pu(this,void 0,void 0,(function*(){if(null==e)return null;const t=yield this.resolveName(e);return null==t&&xu.throwArgumentError("provided ENS name resolves to null","tx.to",e),t})))),t.to.catch((e=>{})));const r=null!=t.maxFeePerGas||null!=t.maxPriorityFeePerGas;if(null==t.gasPrice||2!==t.type&&!r?0!==t.type&&1!==t.type||!r||xu.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",e):xu.throwArgumentError("eip-1559 transaction do not support gasPrice","transaction",e),2!==t.type&&null!=t.type||null==t.maxFeePerGas||null==t.maxPriorityFeePerGas)if(0===t.type||1===t.type)null==t.gasPrice&&(t.gasPrice=this.getGasPrice());else{const e=yield this.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?(r&&xu.throwError("network does not support EIP-1559",wo.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),null==t.gasPrice&&(t.gasPrice=e.gasPrice),t.type=0):xu.throwError("failed to get consistent fee data",wo.errors.UNSUPPORTED_OPERATION,{operation:"signer.getFeeData"});else 2===t.type&&(null==t.maxFeePerGas&&(t.maxFeePerGas=e.maxFeePerGas),null==t.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=e.maxPriorityFeePerGas))}else t.type=2;return null==t.nonce&&(t.nonce=this.getTransactionCount("pending")),null==t.gasLimit&&(t.gasLimit=this.estimateGas(t).catch((e=>{if(Mu.indexOf(e.code)>=0)throw e;return xu.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",wo.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,tx:t})}))),null==t.chainId?t.chainId=this.getChainId():t.chainId=Promise.all([Promise.resolve(t.chainId),this.getChainId()]).then((t=>(0!==t[1]&&t[0]!==t[1]&&xu.throwArgumentError("chainId address mismatch","transaction",e),t[0]))),yield ba(t)}))}_checkProvider(e){this.provider||xu.throwError("missing provider",wo.errors.UNSUPPORTED_OPERATION,{operation:e||"_checkProvider"})}static isSigner(e){return!(!e||!e._isSigner)}}class Iu extends Cu{constructor(e,t){super(),ga(this,"address",e),ga(this,"provider",t||null)}getAddress(){return Promise.resolve(this.address)}_fail(e,t){return Promise.resolve().then((()=>{xu.throwError(e,wo.errors.UNSUPPORTED_OPERATION,{operation:t})}))}signMessage(e){return this._fail("VoidSigner cannot sign messages","signMessage")}signTransaction(e){return this._fail("VoidSigner cannot sign transactions","signTransaction")}_signTypedData(e,t,r){return this._fail("VoidSigner cannot sign typed data","signTypedData")}connect(e){return new Iu(this.address,e)}}function Ru(e,t,r){return r={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&r.path)}},e(r,r.exports),r.exports}var Nu=Ou;function Ou(e,t){if(!e)throw new Error(t||"Assertion failed")}Ou.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)};var Tu=Ru((function(e,t){var r=t;function n(e){return 1===e.length?"0"+e:e}function i(e){for(var t="",r=0;r>8,a=255&i;o?r.push(o,a):r.push(a)}return r},r.zero2=n,r.toHex=i,r.encode=function(e,t){return"hex"===t?i(e):e}})),ju=Ru((function(e,t){var r=t;r.assert=Nu,r.toArray=Tu.toArray,r.zero2=Tu.zero2,r.toHex=Tu.toHex,r.encode=Tu.encode,r.getNAF=function(e,t,r){var n=new Array(Math.max(e.bitLength(),r)+1);n.fill(0);for(var i=1<(i>>1)-1?(i>>1)-c:c,o.isubn(s)):s=0,n[a]=s,o.iushrn(1)}return n},r.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n,i=0,o=0;e.cmpn(-i)>0||t.cmpn(-o)>0;){var a,s,c=e.andln(3)+i&3,u=t.andln(3)+o&3;3===c&&(c=-1),3===u&&(u=-1),a=0==(1&c)?0:3!==(n=e.andln(7)+i&7)&&5!==n||2!==u?c:-c,r[0].push(a),s=0==(1&u)?0:3!==(n=t.andln(7)+o&7)&&5!==n||2!==c?u:-u,r[1].push(s),2*i===a+1&&(i=1-i),2*o===s+1&&(o=1-o),e.iushrn(1),t.iushrn(1)}return r},r.cachedProperty=function(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},r.parseBytes=function(e){return"string"==typeof e?r.toArray(e,"hex"):e},r.intFromLE=function(e){return new uo(e,"hex","le")}})),Du=ju.getNAF,$u=ju.getJSF,Bu=ju.assert;function Fu(e,t){this.type=e,this.p=new uo(t.p,16),this.red=t.prime?uo.red(t.prime):uo.mont(this.p),this.zero=new uo(0).toRed(this.red),this.one=new uo(1).toRed(this.red),this.two=new uo(2).toRed(this.red),this.n=t.n&&new uo(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var zu=Fu;function Uu(e,t){this.curve=e,this.type=t,this.precomputed=null}Fu.prototype.point=function(){throw new Error("Not implemented")},Fu.prototype.validate=function(){throw new Error("Not implemented")},Fu.prototype._fixedNafMul=function(e,t){Bu(e.precomputed);var r=e._getDoubles(),n=Du(t,1,this._bitLength),i=(1<=o;c--)a=(a<<1)+n[c];s.push(a)}for(var u=this.jpoint(null,null,null),f=this.jpoint(null,null,null),d=i;d>0;d--){for(o=0;o=0;s--){for(var c=0;s>=0&&0===o[s];s--)c++;if(s>=0&&c++,a=a.dblp(c),s<0)break;var u=o[s];Bu(0!==u),a="affine"===e.type?u>0?a.mixedAdd(i[u-1>>1]):a.mixedAdd(i[-u-1>>1].neg()):u>0?a.add(i[u-1>>1]):a.add(i[-u-1>>1].neg())}return"affine"===e.type?a.toP():a},Fu.prototype._wnafMulAdd=function(e,t,r,n,i){var o,a,s,c=this._wnafT1,u=this._wnafT2,f=this._wnafT3,d=0;for(o=0;o=1;o-=2){var h=o-1,p=o;if(1===c[h]&&1===c[p]){var m=[t[h],null,null,t[p]];0===t[h].y.cmp(t[p].y)?(m[1]=t[h].add(t[p]),m[2]=t[h].toJ().mixedAdd(t[p].neg())):0===t[h].y.cmp(t[p].y.redNeg())?(m[1]=t[h].toJ().mixedAdd(t[p]),m[2]=t[h].add(t[p].neg())):(m[1]=t[h].toJ().mixedAdd(t[p]),m[2]=t[h].toJ().mixedAdd(t[p].neg()));var g=[-3,-1,-5,-7,0,7,5,1,3],y=$u(r[h],r[p]);for(d=Math.max(y[0].length,d),f[h]=new Array(d),f[p]=new Array(d),a=0;a=0;o--){for(var _=0;o>=0;){var E=!0;for(a=0;a=0&&_++,w=w.dblp(_),o<0)break;for(a=0;a0?s=u[a][S-1>>1]:S<0&&(s=u[a][-S-1>>1].neg()),w="affine"===s.type?w.mixedAdd(s):w.add(s))}}for(o=0;o=Math.ceil((e.bitLength()+1)/t.step)},Uu.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i=0&&(o=t,a=r),n.negative&&(n=n.neg(),i=i.neg()),o.negative&&(o=o.neg(),a=a.neg()),[{a:n,b:i},{a:o,b:a}]},Hu.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],i=n.b.mul(e).divRound(this.n),o=r.b.neg().mul(e).divRound(this.n),a=i.mul(r.a),s=o.mul(n.a),c=i.mul(r.b),u=o.mul(n.b);return{k1:e.sub(a).sub(s),k2:c.add(u).neg()}},Hu.prototype.pointFromX=function(e,t){(e=new uo(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var i=n.fromRed().isOdd();return(t&&!i||!t&&i)&&(n=n.redNeg()),this.point(e,n)},Hu.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},Hu.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o":""},Ju.prototype.isInfinity=function(){return this.inf},Ju.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},Ju.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),a=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)},Ju.prototype.getX=function(){return this.x.fromRed()},Ju.prototype.getY=function(){return this.y.fromRed()},Ju.prototype.mul=function(e){return e=new uo(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)},Ju.prototype.mulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},Ju.prototype.jmulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},Ju.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))},Ju.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,n=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return t},Ju.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},Lu(Wu,zu.BasePoint),Hu.prototype.jpoint=function(e,t,r){return new Wu(this,e,t,r)},Wu.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},Wu.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},Wu.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),i=e.x.redMul(r),o=this.y.redMul(t.redMul(e.z)),a=e.y.redMul(r.redMul(this.z)),s=n.redSub(i),c=o.redSub(a);if(0===s.cmpn(0))return 0!==c.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=s.redSqr(),f=u.redMul(s),d=n.redMul(u),l=c.redSqr().redIAdd(f).redISub(d).redISub(d),h=c.redMul(d.redISub(l)).redISub(o.redMul(f)),p=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(l,h,p)},Wu.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),i=this.y,o=e.y.redMul(t).redMul(this.z),a=r.redSub(n),s=i.redSub(o);if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=a.redSqr(),u=c.redMul(a),f=r.redMul(c),d=s.redSqr().redIAdd(u).redISub(f).redISub(f),l=s.redMul(f.redISub(d)).redISub(i.redMul(u)),h=this.z.redMul(a);return this.curve.jpoint(d,l,h)},Wu.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var r=this;for(t=0;t=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},Wu.prototype.inspect=function(){return this.isInfinity()?"":""},Wu.prototype.isInfinity=function(){return 0===this.z.cmpn(0)};var Gu=Ru((function(e,t){var r=t;r.base=zu,r.short=Ku,r.mont=null,r.edwards=null})),Vu=Ru((function(e,t){var r,n=t,i=ju.assert;function o(e){"short"===e.type?this.curve=new Gu.short(e):"edwards"===e.type?this.curve=new Gu.edwards(e):this.curve=new Gu.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,i(this.g.validate(),"Invalid curve"),i(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function a(e,t){Object.defineProperty(n,e,{configurable:!0,enumerable:!0,get:function(){var r=new o(t);return Object.defineProperty(n,e,{configurable:!0,enumerable:!0,value:r}),r}})}n.PresetCurve=o,a("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:ir.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),a("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:ir.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),a("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:ir.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),a("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:ir.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"]}),a("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:ir.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"]}),a("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:ir.sha256,gRed:!1,g:["9"]}),a("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:ir.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{r=null.crash()}catch(e){r=void 0}a("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:ir.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})}));function Zu(e){if(!(this instanceof Zu))return new Zu(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=Tu.toArray(e.entropy,e.entropyEnc||"hex"),r=Tu.toArray(e.nonce,e.nonceEnc||"hex"),n=Tu.toArray(e.pers,e.persEnc||"hex");Nu(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}var Xu=Zu;Zu.prototype._init=function(e,t,r){var n=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},Zu.prototype.generate=function(e,t,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(n=r,r=t,t=null),r&&(r=Tu.toArray(r,n||"hex"),this._update(r));for(var i=[];i.length"};var tf=ju.assert;function rf(e,t){if(e instanceof rf)return e;this._importDER(e,t)||(tf(e.r&&e.s,"Signature without r or s"),this.r=new uo(e.r,16),this.s=new uo(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}var nf=rf;function of(){this.place=0}function af(e,t){var r=e[t.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var i=0,o=0,a=t.place;o>>=0;return!(i<=127)&&(t.place=a,i)}function sf(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}rf.prototype._importDER=function(e,t){e=ju.toArray(e,t);var r=new of;if(48!==e[r.place++])return!1;var n=af(e,r);if(!1===n)return!1;if(n+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var i=af(e,r);if(!1===i)return!1;var o=e.slice(r.place,i+r.place);if(r.place+=i,2!==e[r.place++])return!1;var a=af(e,r);if(!1===a)return!1;if(e.length!==a+r.place)return!1;var s=e.slice(r.place,a+r.place);if(0===o[0]){if(!(128&o[1]))return!1;o=o.slice(1)}if(0===s[0]){if(!(128&s[1]))return!1;s=s.slice(1)}return this.r=new uo(o),this.s=new uo(s),this.recoveryParam=null,!0},rf.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=sf(t),r=sf(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];cf(n,t.length),(n=n.concat(t)).push(2),cf(n,r.length);var i=n.concat(r),o=[48];return cf(o,i.length),o=o.concat(i),ju.encode(o,e)};var uf=function(){throw new Error("unsupported")},ff=ju.assert;function df(e){if(!(this instanceof df))return new df(e);"string"==typeof e&&(ff(Object.prototype.hasOwnProperty.call(Vu,e),"Unknown curve "+e),e=Vu[e]),e instanceof Vu.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}var lf=df;df.prototype.keyPair=function(e){return new ef(this,e)},df.prototype.keyFromPrivate=function(e,t){return ef.fromPrivate(this,e,t)},df.prototype.keyFromPublic=function(e,t){return ef.fromPublic(this,e,t)},df.prototype.genKeyPair=function(e){e||(e={});for(var t=new Xu({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||uf(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),n=this.n.sub(new uo(2));;){var i=new uo(t.generate(r));if(!(i.cmp(n)>0))return i.iaddn(1),this.keyFromPrivate(i)}},df.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},df.prototype.sign=function(e,t,r,n){"object"==typeof r&&(n=r,r=null),n||(n={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new uo(e,16));for(var i=this.n.byteLength(),o=t.getPrivate().toArray("be",i),a=e.toArray("be",i),s=new Xu({hash:this.hash,entropy:o,nonce:a,pers:n.pers,persEnc:n.persEnc||"utf8"}),c=this.n.sub(new uo(1)),u=0;;u++){var f=n.k?n.k(u):new uo(s.generate(this.n.byteLength()));if(!((f=this._truncateToN(f,!0)).cmpn(1)<=0||f.cmp(c)>=0)){var d=this.g.mul(f);if(!d.isInfinity()){var l=d.getX(),h=l.umod(this.n);if(0!==h.cmpn(0)){var p=f.invm(this.n).mul(h.mul(t.getPrivate()).iadd(e));if(0!==(p=p.umod(this.n)).cmpn(0)){var m=(d.getY().isOdd()?1:0)|(0!==l.cmp(h)?2:0);return n.canonical&&p.cmp(this.nh)>0&&(p=this.n.sub(p),m^=1),new nf({r:h,s:p,recoveryParam:m})}}}}}},df.prototype.verify=function(e,t,r,n){e=this._truncateToN(new uo(e,16)),r=this.keyFromPublic(r,n);var i=(t=new nf(t,"hex")).r,o=t.s;if(i.cmpn(1)<0||i.cmp(this.n)>=0)return!1;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var a,s=o.invm(this.n),c=s.mul(e).umod(this.n),u=s.mul(i).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(c,r.getPublic(),u)).isInfinity()&&a.eqXToP(i):!(a=this.g.mulAdd(c,r.getPublic(),u)).isInfinity()&&0===a.getX().umod(this.n).cmp(i)},df.prototype.recoverPubKey=function(e,t,r,n){ff((3&r)===r,"The recovery param is more than two bits"),t=new nf(t,n);var i=this.n,o=new uo(e),a=t.r,s=t.s,c=1&r,u=r>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&u)throw new Error("Unable to find sencond key candinate");a=u?this.curve.pointFromX(a.add(this.curve.n),c):this.curve.pointFromX(a,c);var f=t.r.invm(i),d=i.sub(o).mul(f).umod(i),l=s.mul(f).umod(i);return this.g.mulAdd(d,a,l)},df.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new nf(t,n)).recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(e,t,i)}catch(e){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")};var hf=Ru((function(e,t){var r=t;r.version="6.5.4",r.utils=ju,r.rand=function(){throw new Error("unsupported")},r.curve=Gu,r.curves=Vu,r.ec=lf,r.eddsa=null})),pf=hf.ec;const mf=new wo("signing-key/5.7.0");let gf=null;function yf(){return gf||(gf=new pf("secp256k1")),gf}class bf{constructor(e){ga(this,"curve","secp256k1"),ga(this,"privateKey",To(e)),32!==jo(this.privateKey)&&mf.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const t=yf().keyFromPrivate(Mo(this.privateKey));ga(this,"publicKey","0x"+t.getPublic(!1,"hex")),ga(this,"compressedPublicKey","0x"+t.getPublic(!0,"hex")),ga(this,"_isSigningKey",!0)}_addPoint(e){const t=yf().keyFromPublic(Mo(this.publicKey)),r=yf().keyFromPublic(Mo(e));return"0x"+t.pub.add(r.pub).encodeCompressed("hex")}signDigest(e){const t=yf().keyFromPrivate(Mo(this.privateKey)),r=Mo(e);32!==r.length&&mf.throwArgumentError("bad digest length","digest",e);const n=t.sign(r,{canonical:!0});return Uo({recoveryParam:n.recoveryParam,r:zo("0x"+n.r.toString(16),32),s:zo("0x"+n.s.toString(16),32)})}computeSharedSecret(e){const t=yf().keyFromPrivate(Mo(this.privateKey)),r=yf().keyFromPublic(Mo(wf(e)));return zo("0x"+t.derive(r.getPublic()).toString(16),32)}static isSigningKey(e){return!(!e||!e._isSigningKey)}}function vf(e,t){const r=Uo(t),n={r:Mo(r.r),s:Mo(r.s)};return"0x"+yf().recoverPubKey(Mo(e),n,r.recoveryParam).encode("hex",!1)}function wf(e,t){const r=Mo(e);if(32===r.length){const e=new bf(r);return t?"0x"+yf().keyFromPrivate(r).getPublic(!0,"hex"):e.publicKey}return 33===r.length?t?To(r):"0x"+yf().keyFromPublic(r).getPublic(!1,"hex"):65===r.length?t?"0x"+yf().keyFromPublic(r).getPublic(!0,"hex"):To(r):mf.throwArgumentError("invalid public or private key","key","[REDACTED]")}var Af=Object.freeze({__proto__:null,SigningKey:bf,computePublicKey:wf,recoverPublicKey:vf});const _f=new wo("transactions/5.7.0");var Ef;function Sf(e){return"0x"===e?null:ws(e)}function Pf(e){return"0x"===e?js:Zo.from(e)}!function(e){e[e.legacy=0]="legacy",e[e.eip2930=1]="eip2930",e[e.eip1559=2]="eip1559"}(Ef||(Ef={}));const xf=[{name:"nonce",maxLength:32,numeric:!0},{name:"gasPrice",maxLength:32,numeric:!0},{name:"gasLimit",maxLength:32,numeric:!0},{name:"to",length:20},{name:"value",maxLength:32,numeric:!0},{name:"data"}],kf={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,type:!0,value:!0};function Mf(e){return ws(Do(is(Do(wf(e),1)),12))}function Cf(e,t){return Mf(vf(Mo(e),t))}function If(e,t){const r=Io(Zo.from(e).toHexString());return r.length>32&&_f.throwArgumentError("invalid length for "+t,"transaction:"+t,e),r}function Rf(e,t){return{address:ws(e),storageKeys:(t||[]).map(((t,r)=>(32!==jo(t)&&_f.throwArgumentError("invalid access list storageKey",`accessList[${e}:${r}]`,t),t.toLowerCase())))}}function Nf(e){if(Array.isArray(e))return e.map(((e,t)=>Array.isArray(e)?(e.length>2&&_f.throwArgumentError("access list expected to be [ address, storageKeys[] ]",`value[${t}]`,e),Rf(e[0],e[1])):Rf(e.address,e.storageKeys)));const t=Object.keys(e).map((t=>{const r=e[t].reduce(((e,t)=>(e[t]=!0,e)),{});return Rf(t,Object.keys(r).sort())}));return t.sort(((e,t)=>e.address.localeCompare(t.address))),t}function Of(e){return Nf(e).map((e=>[e.address,e.storageKeys]))}function Tf(e,t){if(null!=e.gasPrice){const t=Zo.from(e.gasPrice),r=Zo.from(e.maxFeePerGas||0);t.eq(r)||_f.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:t,maxFeePerGas:r})}const r=[If(e.chainId||0,"chainId"),If(e.nonce||0,"nonce"),If(e.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),If(e.maxFeePerGas||0,"maxFeePerGas"),If(e.gasLimit||0,"gasLimit"),null!=e.to?ws(e.to):"0x",If(e.value||0,"value"),e.data||"0x",Of(e.accessList||[])];if(t){const e=Uo(t);r.push(If(e.recoveryParam,"recoveryParam")),r.push(Io(e.r)),r.push(Io(e.s))}return $o(["0x02",fs(r)])}function jf(e,t){const r=[If(e.chainId||0,"chainId"),If(e.nonce||0,"nonce"),If(e.gasPrice||0,"gasPrice"),If(e.gasLimit||0,"gasLimit"),null!=e.to?ws(e.to):"0x",If(e.value||0,"value"),e.data||"0x",Of(e.accessList||[])];if(t){const e=Uo(t);r.push(If(e.recoveryParam,"recoveryParam")),r.push(Io(e.r)),r.push(Io(e.s))}return $o(["0x01",fs(r)])}function Df(e,t){if(null==e.type||0===e.type)return null!=e.accessList&&_f.throwArgumentError("untyped transactions do not support accessList; include type: 1","transaction",e),function(e,t){va(e,kf);const r=[];xf.forEach((function(t){let n=e[t.name]||[];const i={};t.numeric&&(i.hexPad="left"),n=Mo(To(n,i)),t.length&&n.length!==t.length&&n.length>0&&_f.throwArgumentError("invalid length for "+t.name,"transaction:"+t.name,n),t.maxLength&&(n=Io(n),n.length>t.maxLength&&_f.throwArgumentError("invalid length for "+t.name,"transaction:"+t.name,n)),r.push(To(n))}));let n=0;if(null!=e.chainId?(n=e.chainId,"number"!=typeof n&&_f.throwArgumentError("invalid transaction.chainId","transaction",e)):t&&!Po(t)&&t.v>28&&(n=Math.floor((t.v-35)/2)),0!==n&&(r.push(To(n)),r.push("0x"),r.push("0x")),!t)return fs(r);const i=Uo(t);let o=27+i.recoveryParam;return 0!==n?(r.pop(),r.pop(),r.pop(),o+=2*n+8,i.v>28&&i.v!==o&&_f.throwArgumentError("transaction.chainId/signature.v mismatch","signature",t)):i.v!==o&&_f.throwArgumentError("transaction.chainId/signature.v mismatch","signature",t),r.push(To(o)),r.push(Io(Mo(i.r))),r.push(Io(Mo(i.s))),fs(r)}(e,t);switch(e.type){case 1:return jf(e,t);case 2:return Tf(e,t)}return _f.throwError(`unsupported transaction type: ${e.type}`,wo.errors.UNSUPPORTED_OPERATION,{operation:"serializeTransaction",transactionType:e.type})}function $f(e,t,r){try{const r=Pf(t[0]).toNumber();if(0!==r&&1!==r)throw new Error("bad recid");e.v=r}catch(e){_f.throwArgumentError("invalid v for transaction type: 1","v",t[0])}e.r=zo(t[1],32),e.s=zo(t[2],32);try{const t=is(r(e));e.from=Cf(t,{r:e.r,s:e.s,recoveryParam:e.v})}catch(e){}}function Bf(e){const t=Mo(e);if(t[0]>127)return function(e){const t=hs(e);9!==t.length&&6!==t.length&&_f.throwArgumentError("invalid raw transaction","rawTransaction",e);const r={nonce:Pf(t[0]).toNumber(),gasPrice:Pf(t[1]),gasLimit:Pf(t[2]),to:Sf(t[3]),value:Pf(t[4]),data:t[5],chainId:0};if(6===t.length)return r;try{r.v=Zo.from(t[6]).toNumber()}catch(e){return r}if(r.r=zo(t[7],32),r.s=zo(t[8],32),Zo.from(r.r).isZero()&&Zo.from(r.s).isZero())r.chainId=r.v,r.v=0;else{r.chainId=Math.floor((r.v-35)/2),r.chainId<0&&(r.chainId=0);let n=r.v-27;const i=t.slice(0,6);0!==r.chainId&&(i.push(To(r.chainId)),i.push("0x"),i.push("0x"),n-=2*r.chainId+8);const o=is(fs(i));try{r.from=Cf(o,{r:To(r.r),s:To(r.s),recoveryParam:n})}catch(e){}r.hash=is(e)}return r.type=null,r}(t);switch(t[0]){case 1:return function(e){const t=hs(e.slice(1));8!==t.length&&11!==t.length&&_f.throwArgumentError("invalid component count for transaction type: 1","payload",To(e));const r={type:1,chainId:Pf(t[0]).toNumber(),nonce:Pf(t[1]).toNumber(),gasPrice:Pf(t[2]),gasLimit:Pf(t[3]),to:Sf(t[4]),value:Pf(t[5]),data:t[6],accessList:Nf(t[7])};return 8===t.length||(r.hash=is(e),$f(r,t.slice(8),jf)),r}(t);case 2:return function(e){const t=hs(e.slice(1));9!==t.length&&12!==t.length&&_f.throwArgumentError("invalid component count for transaction type: 2","payload",To(e));const r=Pf(t[2]),n=Pf(t[3]),i={type:2,chainId:Pf(t[0]).toNumber(),nonce:Pf(t[1]).toNumber(),maxPriorityFeePerGas:r,maxFeePerGas:n,gasPrice:null,gasLimit:Pf(t[4]),to:Sf(t[5]),value:Pf(t[6]),data:t[7],accessList:Nf(t[8])};return 9===t.length||(i.hash=is(e),$f(i,t.slice(9),Tf)),i}(t)}return _f.throwError(`unsupported transaction type: ${t[0]}`,wo.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:t[0]})}var Ff=Object.freeze({__proto__:null,get TransactionTypes(){return Ef},accessListify:Nf,computeAddress:Mf,parse:Bf,recoverAddress:Cf,serialize:Df});var zf=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))};const Uf=new wo("contracts/5.7.0");function Lf(e,t){return zf(this,void 0,void 0,(function*(){const r=yield t;"string"!=typeof r&&Uf.throwArgumentError("invalid address or ENS name","name",r);try{return ws(r)}catch(e){}e||Uf.throwError("a provider or signer is needed to resolve ENS names",wo.errors.UNSUPPORTED_OPERATION,{operation:"resolveName"});const n=yield e.resolveName(r);return null==n&&Uf.throwArgumentError("resolver or addr is not configured for ENS name","name",r),n}))}function qf(e,t,r){return zf(this,void 0,void 0,(function*(){return Array.isArray(r)?yield Promise.all(r.map(((r,n)=>qf(e,Array.isArray(t)?t[n]:t[r.name],r)))):"address"===r.type?yield Lf(e,t):"tuple"===r.type?yield qf(e,t,r.components):"array"===r.baseType?Array.isArray(t)?yield Promise.all(t.map((t=>qf(e,t,r.arrayChildren)))):Promise.reject(Uf.makeError("invalid value for array",wo.errors.INVALID_ARGUMENT,{argument:"value",value:t})):t}))}function Hf(e,t,r){return zf(this,void 0,void 0,(function*(){let n={};r.length===t.inputs.length+1&&"object"==typeof r[r.length-1]&&(n=wa(r.pop())),Uf.checkArgumentCount(r.length,t.inputs.length,"passed to contract"),e.signer?n.from?n.from=ba({override:Lf(e.signer,n.from),signer:e.signer.getAddress()}).then((e=>zf(this,void 0,void 0,(function*(){return ws(e.signer)!==e.override&&Uf.throwError("Contract with a Signer cannot override from",wo.errors.UNSUPPORTED_OPERATION,{operation:"overrides.from"}),e.override})))):n.from=e.signer.getAddress():n.from&&(n.from=Lf(e.provider,n.from));const i=yield ba({args:qf(e.signer||e.provider,r,t.inputs),address:e.resolvedAddress,overrides:ba(n)||{}}),o=e.interface.encodeFunctionData(t,i.args),a={data:o,to:i.address},s=i.overrides;if(null!=s.nonce&&(a.nonce=Zo.from(s.nonce).toNumber()),null!=s.gasLimit&&(a.gasLimit=Zo.from(s.gasLimit)),null!=s.gasPrice&&(a.gasPrice=Zo.from(s.gasPrice)),null!=s.maxFeePerGas&&(a.maxFeePerGas=Zo.from(s.maxFeePerGas)),null!=s.maxPriorityFeePerGas&&(a.maxPriorityFeePerGas=Zo.from(s.maxPriorityFeePerGas)),null!=s.from&&(a.from=s.from),null!=s.type&&(a.type=s.type),null!=s.accessList&&(a.accessList=Nf(s.accessList)),null==a.gasLimit&&null!=t.gas){let e=21e3;const r=Mo(o);for(let t=0;tnull!=n[e]));return c.length&&Uf.throwError(`cannot override ${c.map((e=>JSON.stringify(e))).join(",")}`,wo.errors.UNSUPPORTED_OPERATION,{operation:"overrides",overrides:c}),a}))}function Kf(e,t,r){const n=e.signer||e.provider;return function(...i){return zf(this,void 0,void 0,(function*(){let o;if(i.length===t.inputs.length+1&&"object"==typeof i[i.length-1]){const e=wa(i.pop());null!=e.blockTag&&(o=yield e.blockTag),delete e.blockTag,i.push(e)}null!=e.deployTransaction&&(yield e._deployed(o));const a=yield Hf(e,t,i),s=yield n.call(a,o);try{let n=e.interface.decodeFunctionResult(t,s);return r&&1===t.outputs.length&&(n=n[0]),n}catch(t){throw t.code===wo.errors.CALL_EXCEPTION&&(t.address=e.address,t.args=i,t.transaction=a),t}}))}}function Jf(e,t){return function(...r){return zf(this,void 0,void 0,(function*(){e.signer||Uf.throwError("sending a transaction requires a signer",wo.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction"}),null!=e.deployTransaction&&(yield e._deployed());const n=yield Hf(e,t,r),i=yield e.signer.sendTransaction(n);return function(e,t){const r=t.wait.bind(t);t.wait=t=>r(t).then((t=>(t.events=t.logs.map((r=>{let n=Sa(r),i=null;try{i=e.interface.parseLog(r)}catch(e){}return i&&(n.args=i.args,n.decode=(t,r)=>e.interface.decodeEventLog(i.eventFragment,t,r),n.event=i.name,n.eventSignature=i.signature),n.removeListener=()=>e.provider,n.getBlock=()=>e.provider.getBlock(t.blockHash),n.getTransaction=()=>e.provider.getTransaction(t.transactionHash),n.getTransactionReceipt=()=>Promise.resolve(t),n})),t)))}(e,i),i}))}}function Wf(e,t,r){return t.constant?Kf(e,t,r):Jf(e,t)}function Gf(e){return!e.address||null!=e.topics&&0!==e.topics.length?(e.address||"*")+"@"+(e.topics?e.topics.map((e=>Array.isArray(e)?e.join("|"):e)).join(":"):""):"*"}class Vf{constructor(e,t){ga(this,"tag",e),ga(this,"filter",t),this._listeners=[]}addListener(e,t){this._listeners.push({listener:e,once:t})}removeListener(e){let t=!1;this._listeners=this._listeners.filter((r=>!(!t&&r.listener===e)||(t=!0,!1)))}removeAllListeners(){this._listeners=[]}listeners(){return this._listeners.map((e=>e.listener))}listenerCount(){return this._listeners.length}run(e){const t=this.listenerCount();return this._listeners=this._listeners.filter((t=>{const r=e.slice();return setTimeout((()=>{t.listener.apply(this,r)}),0),!t.once})),t}prepareEvent(e){}getEmit(e){return[e]}}class Zf extends Vf{constructor(){super("error",null)}}class Xf extends Vf{constructor(e,t,r,n){const i={address:e};let o=t.getEventTopic(r);n?(o!==n[0]&&Uf.throwArgumentError("topic mismatch","topics",n),i.topics=n.slice()):i.topics=[o],super(Gf(i),i),ga(this,"address",e),ga(this,"interface",t),ga(this,"fragment",r)}prepareEvent(e){super.prepareEvent(e),e.event=this.fragment.name,e.eventSignature=this.fragment.format(),e.decode=(e,t)=>this.interface.decodeEventLog(this.fragment,e,t);try{e.args=this.interface.decodeEventLog(this.fragment,e.data,e.topics)}catch(t){e.args=null,e.decodeError=t}}getEmit(e){const t=Qa(e.args);if(t.length)throw t[0].error;const r=(e.args||[]).slice();return r.push(e),r}}class Qf extends Vf{constructor(e,t){super("*",{address:e}),ga(this,"address",e),ga(this,"interface",t)}prepareEvent(e){super.prepareEvent(e);try{const t=this.interface.parseLog(e);e.event=t.name,e.eventSignature=t.signature,e.decode=(e,r)=>this.interface.decodeEventLog(t.eventFragment,e,r),e.args=t.args}catch(e){}}}class Yf{constructor(e,t,r){ga(this,"interface",ya(new.target,"getInterface")(t)),null==r?(ga(this,"provider",null),ga(this,"signer",null)):Cu.isSigner(r)?(ga(this,"provider",r.provider||null),ga(this,"signer",r)):Su.isProvider(r)?(ga(this,"provider",r),ga(this,"signer",null)):Uf.throwArgumentError("invalid signer or provider","signerOrProvider",r),ga(this,"callStatic",{}),ga(this,"estimateGas",{}),ga(this,"functions",{}),ga(this,"populateTransaction",{}),ga(this,"filters",{});{const e={};Object.keys(this.interface.events).forEach((t=>{const r=this.interface.events[t];ga(this.filters,t,((...e)=>({address:this.address,topics:this.interface.encodeFilterTopics(r,e)}))),e[r.name]||(e[r.name]=[]),e[r.name].push(t)})),Object.keys(e).forEach((t=>{const r=e[t];1===r.length?ga(this.filters,t,this.filters[r[0]]):Uf.warn(`Duplicate definition of ${t} (${r.join(", ")})`)}))}if(ga(this,"_runningEvents",{}),ga(this,"_wrappedEmits",{}),null==e&&Uf.throwArgumentError("invalid contract address or ENS name","addressOrName",e),ga(this,"address",e),this.provider)ga(this,"resolvedAddress",Lf(this.provider,e));else try{ga(this,"resolvedAddress",Promise.resolve(ws(e)))}catch(e){Uf.throwError("provider is required to use ENS name as contract address",wo.errors.UNSUPPORTED_OPERATION,{operation:"new Contract"})}this.resolvedAddress.catch((e=>{}));const n={},i={};Object.keys(this.interface.functions).forEach((e=>{const t=this.interface.functions[e];if(i[e])Uf.warn(`Duplicate ABI entry for ${JSON.stringify(e)}`);else{i[e]=!0;{const r=t.name;n[`%${r}`]||(n[`%${r}`]=[]),n[`%${r}`].push(e)}null==this[e]&&ga(this,e,Wf(this,t,!0)),null==this.functions[e]&&ga(this.functions,e,Wf(this,t,!1)),null==this.callStatic[e]&&ga(this.callStatic,e,Kf(this,t,!0)),null==this.populateTransaction[e]&&ga(this.populateTransaction,e,function(e,t){return function(...r){return Hf(e,t,r)}}(this,t)),null==this.estimateGas[e]&&ga(this.estimateGas,e,function(e,t){const r=e.signer||e.provider;return function(...n){return zf(this,void 0,void 0,(function*(){r||Uf.throwError("estimate require a provider or signer",wo.errors.UNSUPPORTED_OPERATION,{operation:"estimateGas"});const i=yield Hf(e,t,n);return yield r.estimateGas(i)}))}}(this,t))}})),Object.keys(n).forEach((e=>{const t=n[e];if(t.length>1)return;e=e.substring(1);const r=t[0];try{null==this[e]&&ga(this,e,this[r])}catch(e){}null==this.functions[e]&&ga(this.functions,e,this.functions[r]),null==this.callStatic[e]&&ga(this.callStatic,e,this.callStatic[r]),null==this.populateTransaction[e]&&ga(this.populateTransaction,e,this.populateTransaction[r]),null==this.estimateGas[e]&&ga(this.estimateGas,e,this.estimateGas[r])}))}static getContractAddress(e){return As(e)}static getInterface(e){return vu.isInterface(e)?e:new vu(e)}deployed(){return this._deployed()}_deployed(e){return this._deployedPromise||(this.deployTransaction?this._deployedPromise=this.deployTransaction.wait().then((()=>this)):this._deployedPromise=this.provider.getCode(this.address,e).then((e=>("0x"===e&&Uf.throwError("contract not deployed",wo.errors.UNSUPPORTED_OPERATION,{contractAddress:this.address,operation:"getDeployed"}),this)))),this._deployedPromise}fallback(e){this.signer||Uf.throwError("sending a transactions require a signer",wo.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction(fallback)"});const t=wa(e||{});return["from","to"].forEach((function(e){null!=t[e]&&Uf.throwError("cannot override "+e,wo.errors.UNSUPPORTED_OPERATION,{operation:e})})),t.to=this.resolvedAddress,this.deployed().then((()=>this.signer.sendTransaction(t)))}connect(e){"string"==typeof e&&(e=new Iu(e,this.provider));const t=new this.constructor(this.address,this.interface,e);return this.deployTransaction&&ga(t,"deployTransaction",this.deployTransaction),t}attach(e){return new this.constructor(e,this.interface,this.signer||this.provider)}static isIndexed(e){return gu.isIndexed(e)}_normalizeRunningEvent(e){return this._runningEvents[e.tag]?this._runningEvents[e.tag]:e}_getRunningEvent(e){if("string"==typeof e){if("error"===e)return this._normalizeRunningEvent(new Zf);if("event"===e)return this._normalizeRunningEvent(new Vf("event",null));if("*"===e)return this._normalizeRunningEvent(new Qf(this.address,this.interface));const t=this.interface.getEvent(e);return this._normalizeRunningEvent(new Xf(this.address,this.interface,t))}if(e.topics&&e.topics.length>0){try{const t=e.topics[0];if("string"!=typeof t)throw new Error("invalid topic");const r=this.interface.getEvent(t);return this._normalizeRunningEvent(new Xf(this.address,this.interface,r,e.topics))}catch(e){}const t={address:this.address,topics:e.topics};return this._normalizeRunningEvent(new Vf(Gf(t),t))}return this._normalizeRunningEvent(new Qf(this.address,this.interface))}_checkRunningEvents(e){if(0===e.listenerCount()){delete this._runningEvents[e.tag];const t=this._wrappedEmits[e.tag];t&&e.filter&&(this.provider.off(e.filter,t),delete this._wrappedEmits[e.tag])}}_wrapEvent(e,t,r){const n=Sa(t);return n.removeListener=()=>{r&&(e.removeListener(r),this._checkRunningEvents(e))},n.getBlock=()=>this.provider.getBlock(t.blockHash),n.getTransaction=()=>this.provider.getTransaction(t.transactionHash),n.getTransactionReceipt=()=>this.provider.getTransactionReceipt(t.transactionHash),e.prepareEvent(n),n}_addEventListener(e,t,r){if(this.provider||Uf.throwError("events require a provider or a signer with a provider",wo.errors.UNSUPPORTED_OPERATION,{operation:"once"}),e.addListener(t,r),this._runningEvents[e.tag]=e,!this._wrappedEmits[e.tag]){const r=r=>{let n=this._wrapEvent(e,r,t);if(null==n.decodeError)try{const t=e.getEmit(n);this.emit(e.filter,...t)}catch(e){n.decodeError=e.error}null!=e.filter&&this.emit("event",n),null!=n.decodeError&&this.emit("error",n.decodeError,n)};this._wrappedEmits[e.tag]=r,null!=e.filter&&this.provider.on(e.filter,r)}}queryFilter(e,t,r){const n=this._getRunningEvent(e),i=wa(n.filter);return"string"==typeof t&&No(t,32)?(null!=r&&Uf.throwArgumentError("cannot specify toBlock with blockhash","toBlock",r),i.blockHash=t):(i.fromBlock=null!=t?t:0,i.toBlock=null!=r?r:"latest"),this.provider.getLogs(i).then((e=>e.map((e=>this._wrapEvent(n,e,null)))))}on(e,t){return this._addEventListener(this._getRunningEvent(e),t,!1),this}once(e,t){return this._addEventListener(this._getRunningEvent(e),t,!0),this}emit(e,...t){if(!this.provider)return!1;const r=this._getRunningEvent(e),n=r.run(t)>0;return this._checkRunningEvents(r),n}listenerCount(e){return this.provider?null==e?Object.keys(this._runningEvents).reduce(((e,t)=>e+this._runningEvents[t].listenerCount()),0):this._getRunningEvent(e).listenerCount():0}listeners(e){if(!this.provider)return[];if(null==e){const e=[];for(let t in this._runningEvents)this._runningEvents[t].listeners().forEach((t=>{e.push(t)}));return e}return this._getRunningEvent(e).listeners()}removeAllListeners(e){if(!this.provider)return this;if(null==e){for(const e in this._runningEvents){const t=this._runningEvents[e];t.removeAllListeners(),this._checkRunningEvents(t)}return this}const t=this._getRunningEvent(e);return t.removeAllListeners(),this._checkRunningEvents(t),this}off(e,t){if(!this.provider)return this;const r=this._getRunningEvent(e);return r.removeListener(t),this._checkRunningEvents(r),this}removeListener(e,t){return this.off(e,t)}}class ed extends Yf{}class td{constructor(e){ga(this,"alphabet",e),ga(this,"base",e.length),ga(this,"_alphabetMap",{}),ga(this,"_leader",e.charAt(0));for(let t=0;t0;)r.push(n%this.base),n=n/this.base|0}let n="";for(let e=0;0===t[e]&&e=0;--e)n+=this.alphabet[r[e]];return n}decode(e){if("string"!=typeof e)throw new TypeError("Expected String");let t=[];if(0===e.length)return new Uint8Array(t);t.push(0);for(let r=0;r>=8;for(;i>0;)t.push(255&i),i>>=8}for(let r=0;e[r]===this._leader&&r>24&255,c[t.length+1]=d>>16&255,c[t.length+2]=d>>8&255,c[t.length+3]=255&d;let l=Mo(ud(i,e,c));o||(o=l.length,f=new Uint8Array(o),a=Math.ceil(n/o),u=n-(a-1)*o),f.set(l);for(let t=1;t=256)throw new Error("Depth too large!");return Sd(Co([null!=this.privateKey?"0x0488ADE4":"0x0488B21E",To(this.depth),this.parentFingerprint,zo(To(this.index),4),this.chainCode,null!=this.privateKey?Co(["0x00",this.privateKey]):this.publicKey]))}neuter(){return new Md(xd,null,this.publicKey,this.parentFingerprint,this.chainCode,this.index,this.depth,this.path)}_derive(e){if(e>4294967295)throw new Error("invalid index - "+String(e));let t=this.path;t&&(t+="/"+(2147483647&e));const r=new Uint8Array(37);if(e&Ad){if(!this.privateKey)throw new Error("cannot derive child of neutered node");r.set(Mo(this.privateKey),1),t&&(t+="'")}else r.set(Mo(this.publicKey));for(let t=24;t>=0;t-=8)r[33+(t>>3)]=e>>24-t&255;const n=Mo(ud(id.sha512,this.chainCode,r)),i=n.slice(0,32),o=n.slice(32);let a=null,s=null;if(this.privateKey)a=Ed(Zo.from(i).add(this.privateKey).mod(vd));else{s=new bf(To(i))._addPoint(this.publicKey)}let c=t;const u=this.mnemonic;return u&&(c=Object.freeze({phrase:u.phrase,path:t,locale:u.locale||"en"})),new Md(xd,a,s,this.fingerprint,Ed(o),e,this.depth+1,c)}derivePath(e){const t=e.split("/");if(0===t.length||"m"===t[0]&&0!==this.depth)throw new Error("invalid path - "+e);"m"===t[0]&&t.shift();let r=this;for(let e=0;e=Ad)throw new Error("invalid path index - "+n);r=r._derive(Ad+e)}else{if(!n.match(/^[0-9]+$/))throw new Error("invalid path component - "+n);{const e=parseInt(n);if(e>=Ad)throw new Error("invalid path index - "+n);r=r._derive(e)}}}return r}static _fromSeed(e,t){const r=Mo(e);if(r.length<16||r.length>64)throw new Error("invalid seed");const n=Mo(ud(id.sha512,wd,r));return new Md(xd,Ed(n.slice(0,32)),null,"0x00000000",Ed(n.slice(32)),0,0,t)}static fromMnemonic(e,t,r){return e=Rd(Id(e,r=Pd(r)),r),Md._fromSeed(Cd(e,t),{phrase:e,path:"m",locale:r.locale})}static fromSeed(e){return Md._fromSeed(e,null)}static fromExtendedKey(e){const t=nd.decode(e);82===t.length&&Sd(t.slice(0,78))===e||bd.throwArgumentError("invalid extended key","extendedKey","[REDACTED]");const r=t[4],n=To(t.slice(5,9)),i=parseInt(To(t.slice(9,13)).substring(2),16),o=To(t.slice(13,45)),a=t.slice(45,78);switch(To(t.slice(0,4))){case"0x0488b21e":case"0x043587cf":return new Md(xd,null,To(a),n,o,i,r,null);case"0x0488ade4":case"0x04358394 ":if(0!==a[0])break;return new Md(xd,To(a.slice(1)),null,n,o,i,r,null)}return bd.throwArgumentError("invalid extended key","extendedKey","[REDACTED]")}}function Cd(e,t){t||(t="");const r=Js("mnemonic"+t,Us.NFKD);return dd(Js(e,Us.NFKD),r,2048,64,"sha512")}function Id(e,t){t=Pd(t),bd.checkNormalize();const r=t.split(e);if(r.length%3!=0)throw new Error("invalid mnemonic");const n=Mo(new Uint8Array(Math.ceil(11*r.length/8)));let i=0;for(let e=0;e>3]|=1<<7-i%8),i++}const o=32*r.length/3,a=_d(r.length/3);if((Mo(cd(n.slice(0,o/8)))[0]&a)!==(n[n.length-1]&a))throw new Error("invalid checksum");return To(n.slice(0,o/8))}function Rd(e,t){if(t=Pd(t),(e=Mo(e)).length%4!=0||e.length<16||e.length>32)throw new Error("invalid entropy");const r=[0];let n=11;for(let t=0;t8?(r[r.length-1]<<=8,r[r.length-1]|=e[t],n-=8):(r[r.length-1]<<=n,r[r.length-1]|=e[t]>>8-n,r.push(e[t]&(1<<8-n)-1),n+=3);const i=e.length/4,o=Mo(cd(e))[0]&_d(i);return r[r.length-1]<<=i,r[r.length-1]|=o>>8-i,t.join(r.map((e=>t.getWord(e))))}var Nd=Object.freeze({__proto__:null,HDNode:Md,defaultPath:kd,entropyToMnemonic:Rd,getAccountPath:function(e){return("number"!=typeof e||e<0||e>=Ad||e%1)&&bd.throwArgumentError("invalid account index","index",e),`m/44'/60'/${e}'/0/0`},isValidMnemonic:function(e,t){try{return Id(e,t),!0}catch(e){}return!1},mnemonicToEntropy:Id,mnemonicToSeed:Cd});const Od=new wo("random/5.7.0");const Td=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")}();let jd=Td.crypto||Td.msCrypto;function Dd(e){(e<=0||e>1024||e%1||e!=e)&&Od.throwArgumentError("invalid length","length",e);const t=new Uint8Array(e);return jd.getRandomValues(t),Mo(t)}jd&&jd.getRandomValues||(Od.warn("WARNING: Missing strong random number source"),jd={getRandomValues:function(e){return Od.throwError("no secure random source avaialble",wo.errors.UNSUPPORTED_OPERATION,{operation:"crypto.getRandomValues"})}});var $d=Object.freeze({__proto__:null,randomBytes:Dd,shuffled:function(e){for(let t=(e=e.slice()).length-1;t>0;t--){const r=Math.floor(Math.random()*(t+1)),n=e[t];e[t]=e[r],e[r]=n}return e}}),Bd={exports:{}};!function(e,t){!function(t){function r(e){return parseInt(e)===e}function n(e){if(!r(e.length))return!1;for(var t=0;t255)return!1;return!0}function i(e,t){if(e.buffer&&ArrayBuffer.isView(e)&&"Uint8Array"===e.name)return t&&(e=e.slice?e.slice():Array.prototype.slice.call(e)),e;if(Array.isArray(e)){if(!n(e))throw new Error("Array contains invalid value: "+e);return new Uint8Array(e)}if(r(e.length)&&n(e))return new Uint8Array(e);throw new Error("unsupported array-like object")}function o(e){return new Uint8Array(e)}function a(e,t,r,n,i){null==n&&null==i||(e=e.slice?e.slice(n,i):Array.prototype.slice.call(e,n,i)),t.set(e,r)}var s,c={toBytes:function(e){var t=[],r=0;for(e=encodeURI(e);r191&&n<224?(t.push(String.fromCharCode((31&n)<<6|63&e[r+1])),r+=2):(t.push(String.fromCharCode((15&n)<<12|(63&e[r+1])<<6|63&e[r+2])),r+=3)}return t.join("")}},u=(s="0123456789abcdef",{toBytes:function(e){for(var t=[],r=0;r>4]+s[15&n])}return t.join("")}}),f={16:10,24:12,32:14},d=[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],l=[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],h=[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],p=[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],m=[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],g=[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],y=[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],b=[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],v=[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],w=[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],A=[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],_=[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],E=[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],S=[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],P=[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 x(e){for(var t=[],r=0;r>2,this._Ke[r][t%4]=o[t],this._Kd[e-r][t%4]=o[t];for(var a,s=0,c=i;c>16&255]<<24^l[a>>8&255]<<16^l[255&a]<<8^l[a>>24&255]^d[s]<<24,s+=1,8!=i)for(t=1;t>8&255]<<8^l[a>>16&255]<<16^l[a>>24&255]<<24;for(t=i/2+1;t>2,h=c%4,this._Ke[u][h]=o[t],this._Kd[e-u][h]=o[t++],c++}for(var u=1;u>24&255]^E[a>>16&255]^S[a>>8&255]^P[255&a]},k.prototype.encrypt=function(e){if(16!=e.length)throw new Error("invalid plaintext size (must be 16 bytes)");for(var t=this._Ke.length-1,r=[0,0,0,0],n=x(e),i=0;i<4;i++)n[i]^=this._Ke[0][i];for(var a=1;a>24&255]^m[n[(i+1)%4]>>16&255]^g[n[(i+2)%4]>>8&255]^y[255&n[(i+3)%4]]^this._Ke[a][i];n=r.slice()}var s,c=o(16);for(i=0;i<4;i++)s=this._Ke[t][i],c[4*i]=255&(l[n[i]>>24&255]^s>>24),c[4*i+1]=255&(l[n[(i+1)%4]>>16&255]^s>>16),c[4*i+2]=255&(l[n[(i+2)%4]>>8&255]^s>>8),c[4*i+3]=255&(l[255&n[(i+3)%4]]^s);return c},k.prototype.decrypt=function(e){if(16!=e.length)throw new Error("invalid ciphertext size (must be 16 bytes)");for(var t=this._Kd.length-1,r=[0,0,0,0],n=x(e),i=0;i<4;i++)n[i]^=this._Kd[0][i];for(var a=1;a>24&255]^v[n[(i+3)%4]>>16&255]^w[n[(i+2)%4]>>8&255]^A[255&n[(i+1)%4]]^this._Kd[a][i];n=r.slice()}var s,c=o(16);for(i=0;i<4;i++)s=this._Kd[t][i],c[4*i]=255&(h[n[i]>>24&255]^s>>24),c[4*i+1]=255&(h[n[(i+3)%4]>>16&255]^s>>16),c[4*i+2]=255&(h[n[(i+2)%4]>>8&255]^s>>8),c[4*i+3]=255&(h[255&n[(i+1)%4]]^s);return c};var M=function(e){if(!(this instanceof M))throw Error("AES must be instanitated with `new`");this.description="Electronic Code Block",this.name="ecb",this._aes=new k(e)};M.prototype.encrypt=function(e){if((e=i(e)).length%16!=0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var t=o(e.length),r=o(16),n=0;n=0;--t)this._counter[t]=e%256,e>>=8},N.prototype.setBytes=function(e){if(16!=(e=i(e,!0)).length)throw new Error("invalid counter bytes size (must be 16 bytes)");this._counter=e},N.prototype.increment=function(){for(var e=15;e>=0;e--){if(255!==this._counter[e]){this._counter[e]++;break}this._counter[e]=0}};var O=function(e,t){if(!(this instanceof O))throw Error("AES must be instanitated with `new`");this.description="Counter",this.name="ctr",t instanceof N||(t=new N(t)),this._counter=t,this._remainingCounter=null,this._remainingCounterIndex=16,this._aes=new k(e)};O.prototype.encrypt=function(e){for(var t=i(e,!0),r=0;r16)throw new Error("PKCS#7 padding byte out of range");for(var r=e.length-t,n=0;n=64;){let h,p,m,g,y,b=r,v=n,w=i,A=o,_=a,E=s,S=c,P=u;for(p=0;p<16;p++)m=d+4*p,f[p]=(255&e[m])<<24|(255&e[m+1])<<16|(255&e[m+2])<<8|255&e[m+3];for(p=16;p<64;p++)h=f[p-2],g=(h>>>17|h<<15)^(h>>>19|h<<13)^h>>>10,h=f[p-15],y=(h>>>7|h<<25)^(h>>>18|h<<14)^h>>>3,f[p]=(g+f[p-7]|0)+(y+f[p-16]|0)|0;for(p=0;p<64;p++)g=(((_>>>6|_<<26)^(_>>>11|_<<21)^(_>>>25|_<<7))+(_&E^~_&S)|0)+(P+(t[p]+f[p]|0)|0)|0,y=((b>>>2|b<<30)^(b>>>13|b<<19)^(b>>>22|b<<10))+(b&v^b&w^v&w)|0,P=S,S=E,E=_,_=A+g|0,A=w,w=v,v=b,b=g+y|0;r=r+b|0,n=n+v|0,i=i+w|0,o=o+A|0,a=a+_|0,s=s+E|0,c=c+S|0,u=u+P|0,d+=64,l-=64}}d(e);let l,h=e.length%64,p=e.length/536870912|0,m=e.length<<3,g=h<56?56:120,y=e.slice(e.length-h,e.length);for(y.push(128),l=h+1;l>>24&255),y.push(p>>>16&255),y.push(p>>>8&255),y.push(p>>>0&255),y.push(m>>>24&255),y.push(m>>>16&255),y.push(m>>>8&255),y.push(m>>>0&255),d(y),[r>>>24&255,r>>>16&255,r>>>8&255,r>>>0&255,n>>>24&255,n>>>16&255,n>>>8&255,n>>>0&255,i>>>24&255,i>>>16&255,i>>>8&255,i>>>0&255,o>>>24&255,o>>>16&255,o>>>8&255,o>>>0&255,a>>>24&255,a>>>16&255,a>>>8&255,a>>>0&255,s>>>24&255,s>>>16&255,s>>>8&255,s>>>0&255,c>>>24&255,c>>>16&255,c>>>8&255,c>>>0&255,u>>>24&255,u>>>16&255,u>>>8&255,u>>>0&255]}function i(e,t,r){e=e.length<=64?e:n(e);const i=64+t.length+4,o=new Array(i),a=new Array(64);let s,c=[];for(s=0;s<64;s++)o[s]=54;for(s=0;s=i-4;e--){if(o[e]++,o[e]<=255)return;o[e]=0}}for(;r>=32;)u(),c=c.concat(n(a.concat(n(o)))),r-=32;return r>0&&(u(),c=c.concat(n(a.concat(n(o))).slice(0,r))),c}function o(e,t,r,n,i){let o;for(u(e,16*(2*r-1),i,0,16),o=0;o<2*r;o++)c(e,16*o,i,16),s(i,n),u(i,0,e,t+16*o,16);for(o=0;o>>32-t}function s(e,t){u(e,0,t,0,16);for(let e=8;e>0;e-=2)t[4]^=a(t[0]+t[12],7),t[8]^=a(t[4]+t[0],9),t[12]^=a(t[8]+t[4],13),t[0]^=a(t[12]+t[8],18),t[9]^=a(t[5]+t[1],7),t[13]^=a(t[9]+t[5],9),t[1]^=a(t[13]+t[9],13),t[5]^=a(t[1]+t[13],18),t[14]^=a(t[10]+t[6],7),t[2]^=a(t[14]+t[10],9),t[6]^=a(t[2]+t[14],13),t[10]^=a(t[6]+t[2],18),t[3]^=a(t[15]+t[11],7),t[7]^=a(t[3]+t[15],9),t[11]^=a(t[7]+t[3],13),t[15]^=a(t[11]+t[7],18),t[1]^=a(t[0]+t[3],7),t[2]^=a(t[1]+t[0],9),t[3]^=a(t[2]+t[1],13),t[0]^=a(t[3]+t[2],18),t[6]^=a(t[5]+t[4],7),t[7]^=a(t[6]+t[5],9),t[4]^=a(t[7]+t[6],13),t[5]^=a(t[4]+t[7],18),t[11]^=a(t[10]+t[9],7),t[8]^=a(t[11]+t[10],9),t[9]^=a(t[8]+t[11],13),t[10]^=a(t[9]+t[8],18),t[12]^=a(t[15]+t[14],7),t[13]^=a(t[12]+t[15],9),t[14]^=a(t[13]+t[12],13),t[15]^=a(t[14]+t[13],18);for(let r=0;r<16;++r)e[r]+=t[r]}function c(e,t,r,n){for(let i=0;i=256)return!1}return!0}function d(e,t){if("number"!=typeof e||e%1)throw new Error("invalid "+t);return e}function l(e,t,n,a,s,l,h){if(n=d(n,"N"),a=d(a,"r"),s=d(s,"p"),l=d(l,"dkLen"),0===n||0!=(n&n-1))throw new Error("N must be power of 2");if(n>r/128/a)throw new Error("N too large");if(a>r/128/s)throw new Error("r too large");if(!f(e))throw new Error("password must be an array or buffer");if(e=Array.prototype.slice.call(e),!f(t))throw new Error("salt must be an array or buffer");t=Array.prototype.slice.call(t);let p=i(e,t,128*s*a);const m=new Uint32Array(32*s*a);for(let e=0;eC&&(t=C);for(let e=0;eC&&(t=C);for(let e=0;e>0&255),p.push(m[e]>>8&255),p.push(m[e]>>16&255),p.push(m[e]>>24&255);const r=i(e,p,l);return h&&h(null,1,r),r}h&&I(R)};if(!h)for(;;){const e=R();if(null!=e)return e}R()}const h={scrypt:function(e,t,r,n,i,o,a){return new Promise((function(s,c){let u=0;a&&a(0),l(e,t,r,n,i,o,(function(e,t,r){if(e)c(e);else if(r)a&&1!==u&&a(1),s(new Uint8Array(r));else if(a&&t!==u)return u=t,a(t)}))}))},syncScrypt:function(e,t,r,n,i,o){return new Uint8Array(l(e,t,r,n,i,o))}};e.exports=h}()}(Xd);var Qd=f(Xd.exports),Yd=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))};const el=new wo(zd);function tl(e){return null!=e&&e.mnemonic&&e.mnemonic.phrase}class rl extends Pa{isKeystoreAccount(e){return!(!e||!e._isKeystoreAccount)}}function nl(e,t){const r=Ud(Hd(e,"crypto/ciphertext"));if(To(is(Co([t.slice(16,32),r]))).substring(2)!==Hd(e,"crypto/mac").toLowerCase())throw new Error("invalid password");const n=function(e,t,r){if("aes-128-ctr"===Hd(e,"crypto/cipher")){const n=Ud(Hd(e,"crypto/cipherparams/iv")),i=new Fd.Counter(n);return Mo(new Fd.ModeOfOperation.ctr(t,i).decrypt(r))}return null}(e,t.slice(0,16),r);n||el.throwError("unsupported cipher",wo.errors.UNSUPPORTED_OPERATION,{operation:"decrypt"});const i=t.slice(32,64),o=Mf(n);if(e.address){let t=e.address.toLowerCase();if("0x"!==t.substring(0,2)&&(t="0x"+t),ws(t)!==o)throw new Error("address mismatch")}const a={_isKeystoreAccount:!0,address:o,privateKey:To(n)};if("0.1"===Hd(e,"x-ethers/version")){const t=Ud(Hd(e,"x-ethers/mnemonicCiphertext")),r=Ud(Hd(e,"x-ethers/mnemonicCounter")),n=new Fd.Counter(r),o=new Fd.ModeOfOperation.ctr(i,n),s=Hd(e,"x-ethers/path")||kd,c=Hd(e,"x-ethers/locale")||"en",u=Mo(o.decrypt(t));try{const e=Rd(u,c),t=Md.fromMnemonic(e,null,c).derivePath(s);if(t.privateKey!=a.privateKey)throw new Error("mnemonic mismatch");a.mnemonic=t.mnemonic}catch(e){if(e.code!==wo.errors.INVALID_ARGUMENT||"wordlist"!==e.argument)throw e}}return new rl(a)}function il(e,t,r,n,i){return Mo(dd(e,t,r,n,i))}function ol(e,t,r,n,i){return Promise.resolve(il(e,t,r,n,i))}function al(e,t,r,n,i){const o=qd(t),a=Hd(e,"crypto/kdf");if(a&&"string"==typeof a){const t=function(e,t){return el.throwArgumentError("invalid key-derivation function parameters",e,t)};if("scrypt"===a.toLowerCase()){const r=Ud(Hd(e,"crypto/kdfparams/salt")),s=parseInt(Hd(e,"crypto/kdfparams/n")),c=parseInt(Hd(e,"crypto/kdfparams/r")),u=parseInt(Hd(e,"crypto/kdfparams/p"));s&&c&&u||t("kdf",a),0!=(s&s-1)&&t("N",s);const f=parseInt(Hd(e,"crypto/kdfparams/dklen"));return 32!==f&&t("dklen",f),n(o,r,s,c,u,64,i)}if("pbkdf2"===a.toLowerCase()){const n=Ud(Hd(e,"crypto/kdfparams/salt"));let i=null;const a=Hd(e,"crypto/kdfparams/prf");"hmac-sha256"===a?i="sha256":"hmac-sha512"===a?i="sha512":t("prf",a);const s=parseInt(Hd(e,"crypto/kdfparams/c")),c=parseInt(Hd(e,"crypto/kdfparams/dklen"));return 32!==c&&t("dklen",c),r(o,n,s,c,i)}}return el.throwArgumentError("unsupported key-derivation function","kdf",a)}function sl(e,t){const r=JSON.parse(e);return nl(r,al(r,t,il,Qd.syncScrypt))}function cl(e,t,r){return Yd(this,void 0,void 0,(function*(){const n=JSON.parse(e);return nl(n,yield al(n,t,ol,Qd.scrypt,r))}))}function ul(e,t,r,n){try{if(ws(e.address)!==Mf(e.privateKey))throw new Error("address/privateKey mismatch");if(tl(e)){const t=e.mnemonic;if(Md.fromMnemonic(t.phrase,null,t.locale).derivePath(t.path||kd).privateKey!=e.privateKey)throw new Error("mnemonic mismatch")}}catch(e){return Promise.reject(e)}"function"!=typeof r||n||(n=r,r={}),r||(r={});const i=Mo(e.privateKey),o=qd(t);let a=null,s=null,c=null;if(tl(e)){const t=e.mnemonic;a=Mo(Id(t.phrase,t.locale||"en")),s=t.path||kd,c=t.locale||"en"}let u=r.client;u||(u="ethers.js");let f=null;f=r.salt?Mo(r.salt):Dd(32);let d=null;if(r.iv){if(d=Mo(r.iv),16!==d.length)throw new Error("invalid iv")}else d=Dd(16);let l=null;if(r.uuid){if(l=Mo(r.uuid),16!==l.length)throw new Error("invalid uuid")}else l=Dd(16);let h=1<<17,p=8,m=1;return r.scrypt&&(r.scrypt.N&&(h=r.scrypt.N),r.scrypt.r&&(p=r.scrypt.r),r.scrypt.p&&(m=r.scrypt.p)),Qd.scrypt(o,f,h,p,m,64,n).then((t=>{const r=(t=Mo(t)).slice(0,16),n=t.slice(16,32),o=t.slice(32,64),g=new Fd.Counter(d),y=Mo(new Fd.ModeOfOperation.ctr(r,g).encrypt(i)),b=is(Co([n,y])),v={address:e.address.substring(2).toLowerCase(),id:Kd(l),version:3,crypto:{cipher:"aes-128-ctr",cipherparams:{iv:To(d).substring(2)},ciphertext:To(y).substring(2),kdf:"scrypt",kdfparams:{salt:To(f).substring(2),n:h,dklen:32,p:m,r:p},mac:b.substring(2)}};if(a){const e=Dd(16),t=new Fd.Counter(e),r=Mo(new Fd.ModeOfOperation.ctr(o,t).encrypt(a)),n=new Date,i=n.getUTCFullYear()+"-"+Ld(n.getUTCMonth()+1,2)+"-"+Ld(n.getUTCDate(),2)+"T"+Ld(n.getUTCHours(),2)+"-"+Ld(n.getUTCMinutes(),2)+"-"+Ld(n.getUTCSeconds(),2)+".0Z";v["x-ethers"]={client:u,gethFilename:"UTC--"+i+"--"+v.address,mnemonicCounter:To(e).substring(2),mnemonicCiphertext:To(r).substring(2),path:s,locale:c,version:"0.1"}}return JSON.stringify(v)}))}function fl(e,t,r){if(Vd(e)){r&&r(0);const n=Gd(e,t);return r&&r(1),Promise.resolve(n)}return Zd(e)?cl(e,t,r):Promise.reject(new Error("invalid JSON wallet"))}function dl(e,t){if(Vd(e))return Gd(e,t);if(Zd(e))return sl(e,t);throw new Error("invalid JSON wallet")}var ll=Object.freeze({__proto__:null,decryptCrowdsale:Gd,decryptJsonWallet:fl,decryptJsonWalletSync:dl,decryptKeystore:cl,decryptKeystoreSync:sl,encryptKeystore:ul,getJsonWalletAddress:function(e){if(Vd(e))try{return ws(JSON.parse(e).ethaddr)}catch(e){return null}if(Zd(e))try{return ws(JSON.parse(e).address)}catch(e){return null}return null},isCrowdsaleWallet:Vd,isKeystoreWallet:Zd});var hl=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))};const pl=new wo("wallet/5.7.0");class ml extends Cu{constructor(e,t){if(super(),null!=(r=e)&&No(r.privateKey,32)&&null!=r.address){const t=new bf(e.privateKey);if(ga(this,"_signingKey",(()=>t)),ga(this,"address",Mf(this.publicKey)),this.address!==ws(e.address)&&pl.throwArgumentError("privateKey/address mismatch","privateKey","[REDACTED]"),function(e){const t=e.mnemonic;return t&&t.phrase}(e)){const t=e.mnemonic;ga(this,"_mnemonic",(()=>({phrase:t.phrase,path:t.path||kd,locale:t.locale||"en"})));const r=this.mnemonic;Mf(Md.fromMnemonic(r.phrase,null,r.locale).derivePath(r.path).privateKey)!==this.address&&pl.throwArgumentError("mnemonic/address mismatch","privateKey","[REDACTED]")}else ga(this,"_mnemonic",(()=>null))}else{if(bf.isSigningKey(e))"secp256k1"!==e.curve&&pl.throwArgumentError("unsupported curve; must be secp256k1","privateKey","[REDACTED]"),ga(this,"_signingKey",(()=>e));else{"string"==typeof e&&e.match(/^[0-9a-f]*$/i)&&64===e.length&&(e="0x"+e);const t=new bf(e);ga(this,"_signingKey",(()=>t))}ga(this,"_mnemonic",(()=>null)),ga(this,"address",Mf(this.publicKey))}var r;t&&!Su.isProvider(t)&&pl.throwArgumentError("invalid provider","provider",t),ga(this,"provider",t||null)}get mnemonic(){return this._mnemonic()}get privateKey(){return this._signingKey().privateKey}get publicKey(){return this._signingKey().publicKey}getAddress(){return Promise.resolve(this.address)}connect(e){return new ml(this,e)}signTransaction(e){return ba(e).then((t=>{null!=t.from&&(ws(t.from)!==this.address&&pl.throwArgumentError("transaction from address mismatch","transaction.from",e.from),delete t.from);const r=this._signingKey().signDigest(is(Df(t)));return Df(t,r)}))}signMessage(e){return hl(this,void 0,void 0,(function*(){return Lo(this._signingKey().signDigest(Gc(e)))}))}_signTypedData(e,t,r){return hl(this,void 0,void 0,(function*(){const n=yield fu.resolveNames(e,t,r,(e=>(null==this.provider&&pl.throwError("cannot resolve ENS names without a provider",wo.errors.UNSUPPORTED_OPERATION,{operation:"resolveName",value:e}),this.provider.resolveName(e))));return Lo(this._signingKey().signDigest(fu.hash(n.domain,t,n.value)))}))}encrypt(e,t,r){if("function"!=typeof t||r||(r=t,t={}),r&&"function"!=typeof r)throw new Error("invalid callback");return t||(t={}),ul(this,e,t,r)}static createRandom(e){let t=Dd(16);e||(e={}),e.extraEntropy&&(t=Mo(Do(is(Co([t,e.extraEntropy])),0,16)));const r=Rd(t,e.locale);return ml.fromMnemonic(r,e.path,e.locale)}static fromEncryptedJson(e,t,r){return fl(e,t,r).then((e=>new ml(e)))}static fromEncryptedJsonSync(e,t){return new ml(dl(e,t))}static fromMnemonic(e,t,r){return t||(t=kd),new ml(Md.fromMnemonic(e,null,r).derivePath(t))}}var gl=Object.freeze({__proto__:null,Wallet:ml,verifyMessage:function(e,t){return Cf(Gc(e),t)},verifyTypedData:function(e,t,r,n){return Cf(fu.hash(e,t,r),n)}});const yl=new wo("networks/5.7.1");function bl(e){const t=function(t,r){null==r&&(r={});const n=[];if(t.InfuraProvider&&"-"!==r.infura)try{n.push(new t.InfuraProvider(e,r.infura))}catch(e){}if(t.EtherscanProvider&&"-"!==r.etherscan)try{n.push(new t.EtherscanProvider(e,r.etherscan))}catch(e){}if(t.AlchemyProvider&&"-"!==r.alchemy)try{n.push(new t.AlchemyProvider(e,r.alchemy))}catch(e){}if(t.PocketProvider&&"-"!==r.pocket){const i=["goerli","ropsten","rinkeby","sepolia"];try{const o=new t.PocketProvider(e,r.pocket);o.network&&-1===i.indexOf(o.network.name)&&n.push(o)}catch(e){}}if(t.CloudflareProvider&&"-"!==r.cloudflare)try{n.push(new t.CloudflareProvider(e))}catch(e){}if(t.AnkrProvider&&"-"!==r.ankr)try{const i=["ropsten"],o=new t.AnkrProvider(e,r.ankr);o.network&&-1===i.indexOf(o.network.name)&&n.push(o)}catch(e){}if(0===n.length)return null;if(t.FallbackProvider){let i=1;return null!=r.quorum?i=r.quorum:"homestead"===e&&(i=2),new t.FallbackProvider(n,i)}return n[0]};return t.renetwork=function(e){return bl(e)},t}function vl(e,t){const r=function(r,n){return r.JsonRpcProvider?new r.JsonRpcProvider(e,t):null};return r.renetwork=function(t){return vl(e,t)},r}const wl={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:bl("homestead")},Al={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:bl("ropsten")},_l={chainId:63,name:"classicMordor",_defaultProvider:vl("https://www.ethercluster.com/mordor","classicMordor")},El={unspecified:{chainId:0,name:"unspecified"},homestead:wl,mainnet:wl,morden:{chainId:2,name:"morden"},ropsten:Al,testnet:Al,rinkeby:{chainId:4,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"rinkeby",_defaultProvider:bl("rinkeby")},kovan:{chainId:42,name:"kovan",_defaultProvider:bl("kovan")},goerli:{chainId:5,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"goerli",_defaultProvider:bl("goerli")},kintsugi:{chainId:1337702,name:"kintsugi"},sepolia:{chainId:11155111,name:"sepolia",_defaultProvider:bl("sepolia")},classic:{chainId:61,name:"classic",_defaultProvider:vl("https://www.ethercluster.com/etc","classic")},classicMorden:{chainId:62,name:"classicMorden"},classicMordor:_l,classicTestnet:_l,classicKotti:{chainId:6,name:"classicKotti",_defaultProvider:vl("https://www.ethercluster.com/kotti","classicKotti")},xdai:{chainId:100,name:"xdai"},matic:{chainId:137,name:"matic",_defaultProvider:bl("matic")},maticmum:{chainId:80001,name:"maticmum"},optimism:{chainId:10,name:"optimism",_defaultProvider:bl("optimism")},"optimism-kovan":{chainId:69,name:"optimism-kovan"},"optimism-goerli":{chainId:420,name:"optimism-goerli"},arbitrum:{chainId:42161,name:"arbitrum"},"arbitrum-rinkeby":{chainId:421611,name:"arbitrum-rinkeby"},"arbitrum-goerli":{chainId:421613,name:"arbitrum-goerli"},bnb:{chainId:56,name:"bnb"},bnbt:{chainId:97,name:"bnbt"}};var Sl=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))};function Pl(e,t){return Sl(this,void 0,void 0,(function*(){null==t&&(t={});const r={method:t.method||"GET",headers:t.headers||{},body:t.body||void 0};if(!0!==t.skipFetchSetup&&(r.mode="cors",r.cache="no-cache",r.credentials="same-origin",r.redirect="follow",r.referrer="client"),null!=t.fetchOptions){const e=t.fetchOptions;e.mode&&(r.mode=e.mode),e.cache&&(r.cache=e.cache),e.credentials&&(r.credentials=e.credentials),e.redirect&&(r.redirect=e.redirect),e.referrer&&(r.referrer=e.referrer)}const n=yield fetch(e,r),i=yield n.arrayBuffer(),o={};return n.headers.forEach?n.headers.forEach(((e,t)=>{o[t.toLowerCase()]=e})):n.headers.keys().forEach((e=>{o[e.toLowerCase()]=n.headers.get(e)})),{headers:o,statusCode:n.status,statusMessage:n.statusText,body:Mo(new Uint8Array(i))}}))}var xl=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))};const kl=new wo("web/5.7.1");function Ml(e){return new Promise((t=>{setTimeout(t,e)}))}function Cl(e,t){if(null==e)return null;if("string"==typeof e)return e;if(Po(e)){if(t&&("text"===t.split("/")[0]||"application/json"===t.split(";")[0].trim()))try{return Vs(e)}catch(e){}return To(e)}return e}function Il(e,t,r){const n="object"==typeof e&&null!=e.throttleLimit?e.throttleLimit:12;kl.assertArgument(n>0&&n%1==0,"invalid connection throttle limit","connection.throttleLimit",n);const i="object"==typeof e?e.throttleCallback:null,o="object"==typeof e&&"number"==typeof e.throttleSlotInterval?e.throttleSlotInterval:100;kl.assertArgument(o>0&&o%1==0,"invalid connection throttle slot interval","connection.throttleSlotInterval",o);const a="object"==typeof e&&!!e.errorPassThrough,s={};let c=null;const u={method:"GET"};let f=!1,d=12e4;if("string"==typeof e)c=e;else if("object"==typeof e){if(null!=e&&null!=e.url||kl.throwArgumentError("missing URL","connection.url",e),c=e.url,"number"==typeof e.timeout&&e.timeout>0&&(d=e.timeout),e.headers)for(const t in e.headers)s[t.toLowerCase()]={key:t,value:String(e.headers[t])},["if-none-match","if-modified-since"].indexOf(t.toLowerCase())>=0&&(f=!0);if(u.allowGzip=!!e.allowGzip,null!=e.user&&null!=e.password){"https:"!==c.substring(0,6)&&!0!==e.allowInsecureAuthentication&&kl.throwError("basic authentication requires a secure https url",wo.errors.INVALID_ARGUMENT,{argument:"url",url:c,user:e.user,password:"[REDACTED]"});const t=e.user+":"+e.password;s.authorization={key:"Authorization",value:"Basic "+bc(Js(t))}}null!=e.skipFetchSetup&&(u.skipFetchSetup=!!e.skipFetchSetup),null!=e.fetchOptions&&(u.fetchOptions=wa(e.fetchOptions))}const l=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),h=c?c.match(l):null;if(h)try{const e={statusCode:200,statusMessage:"OK",headers:{"content-type":h[1]||"text/plain"},body:h[2]?yc(h[3]):(p=h[3],Js(p.replace(/%([0-9a-f][0-9a-f])/gi,((e,t)=>String.fromCharCode(parseInt(t,16))))))};let t=e.body;return r&&(t=r(e.body,e)),Promise.resolve(t)}catch(e){kl.throwError("processing response error",wo.errors.SERVER_ERROR,{body:Cl(h[1],h[2]),error:e,requestBody:null,requestMethod:"GET",url:c})}var p;t&&(u.method="POST",u.body=t,null==s["content-type"]&&(s["content-type"]={key:"Content-Type",value:"application/octet-stream"}),null==s["content-length"]&&(s["content-length"]={key:"Content-Length",value:String(t.length)}));const m={};Object.keys(s).forEach((e=>{const t=s[e];m[t.key]=t.value})),u.headers=m;const g=function(){let e=null;return{promise:new Promise((function(t,r){d&&(e=setTimeout((()=>{null!=e&&(e=null,r(kl.makeError("timeout",wo.errors.TIMEOUT,{requestBody:Cl(u.body,m["content-type"]),requestMethod:u.method,timeout:d,url:c})))}),d))})),cancel:function(){null!=e&&(clearTimeout(e),e=null)}}}(),y=function(){return xl(this,void 0,void 0,(function*(){for(let e=0;e=300)&&(g.cancel(),kl.throwError("bad response",wo.errors.SERVER_ERROR,{status:t.statusCode,headers:t.headers,body:Cl(s,t.headers?t.headers["content-type"]:null),requestBody:Cl(u.body,m["content-type"]),requestMethod:u.method,url:c})),r)try{const e=yield r(s,t);return g.cancel(),e}catch(r){if(r.throttleRetry&&e"content-type"===e.toLowerCase())).length||(r.headers=wa(r.headers),r.headers["content-type"]="application/json")}else r.headers={"content-type":"application/json"};e=r}return Il(e,n,((e,t)=>{let n=null;if(null!=e)try{n=JSON.parse(Vs(e))}catch(t){kl.throwError("invalid JSON",wo.errors.SERVER_ERROR,{body:e,error:t})}return r&&(n=r(n,t)),n}))}function Nl(e,t){return t||(t={}),null==(t=wa(t)).floor&&(t.floor=0),null==t.ceiling&&(t.ceiling=1e4),null==t.interval&&(t.interval=250),new Promise((function(r,n){let i=null,o=!1;const a=()=>!o&&(o=!0,i&&clearTimeout(i),!0);t.timeout&&(i=setTimeout((()=>{a()&&n(new Error("timeout"))}),t.timeout));const s=t.retryLimit;let c=0;!function i(){return e().then((function(e){if(void 0!==e)a()&&r(e);else if(t.oncePoll)t.oncePoll.once("poll",i);else if(t.onceBlock)t.onceBlock.once("block",i);else if(!o){if(c++,c>s)return void(a()&&n(new Error("retry limit reached")));let e=t.interval*parseInt(String(Math.random()*Math.pow(2,c)));et.ceiling&&(e=t.ceiling),setTimeout(i,e)}return null}),(function(e){a()&&n(e)}))}()}))}for(var Ol=Object.freeze({__proto__:null,_fetchData:Il,fetchJson:Rl,poll:Nl}),Tl="qpzry9x8gf2tvdw0s3jn54khce6mua7l",jl={},Dl=0;Dl>25;return(33554431&e)<<5^996825010&-(t>>0&1)^642813549&-(t>>1&1)^513874426&-(t>>2&1)^1027748829&-(t>>3&1)^705979059&-(t>>4&1)}function Fl(e){for(var t=1,r=0;r126)return"Invalid prefix ("+e+")";t=Bl(t)^n>>5}for(t=Bl(t),r=0;rt)return"Exceeds length limit";var r=e.toLowerCase(),n=e.toUpperCase();if(e!==r&&e!==n)return"Mixed-case string "+e;var i=(e=r).lastIndexOf("1");if(-1===i)return"No separator character for "+e;if(0===i)return"Missing prefix for "+e;var o=e.slice(0,i),a=e.slice(i+1);if(a.length<6)return"Data too short";var s=Fl(o);if("string"==typeof s)return s;for(var c=[],u=0;u=a.length||c.push(d)}return 1!==s?"Invalid checksum for "+e:{prefix:o,words:c}}function Ul(e,t,r,n){for(var i=0,o=0,a=(1<=r;)o-=r,s.push(i>>o&a);if(n)o>0&&s.push(i<=t)return"Excess padding";if(i<r)throw new TypeError("Exceeds length limit");var n=Fl(e=e.toLowerCase());if("string"==typeof n)throw new Error(n);for(var i=e+"1",o=0;o>5!=0)throw new Error("Non 5-bit word");n=Bl(n)^a,i+=Tl.charAt(a)}for(o=0;o<6;++o)n=Bl(n);for(n^=1,o=0;o<6;++o){i+=Tl.charAt(n>>5*(5-o)&31)}return i},toWordsUnsafe:function(e){var t=Ul(e,8,5,!0);if(Array.isArray(t))return t},toWords:function(e){var t=Ul(e,8,5,!0);if(Array.isArray(t))return t;throw new Error(t)},fromWordsUnsafe:function(e){var t=Ul(e,5,8,!1);if(Array.isArray(t))return t},fromWords:function(e){var t=Ul(e,5,8,!1);if(Array.isArray(t))return t;throw new Error(t)}},ql=f(Ll);const Hl="providers/5.7.2",Kl=new wo(Hl);class Jl{constructor(){this.formats=this.getDefaultFormats()}getDefaultFormats(){const e={},t=this.address.bind(this),r=this.bigNumber.bind(this),n=this.blockTag.bind(this),i=this.data.bind(this),o=this.hash.bind(this),a=this.hex.bind(this),s=this.number.bind(this),c=this.type.bind(this);return e.transaction={hash:o,type:c,accessList:Jl.allowNull(this.accessList.bind(this),null),blockHash:Jl.allowNull(o,null),blockNumber:Jl.allowNull(s,null),transactionIndex:Jl.allowNull(s,null),confirmations:Jl.allowNull(s,null),from:t,gasPrice:Jl.allowNull(r),maxPriorityFeePerGas:Jl.allowNull(r),maxFeePerGas:Jl.allowNull(r),gasLimit:r,to:Jl.allowNull(t,null),value:r,nonce:s,data:i,r:Jl.allowNull(this.uint256),s:Jl.allowNull(this.uint256),v:Jl.allowNull(s),creates:Jl.allowNull(t,null),raw:Jl.allowNull(i)},e.transactionRequest={from:Jl.allowNull(t),nonce:Jl.allowNull(s),gasLimit:Jl.allowNull(r),gasPrice:Jl.allowNull(r),maxPriorityFeePerGas:Jl.allowNull(r),maxFeePerGas:Jl.allowNull(r),to:Jl.allowNull(t),value:Jl.allowNull(r),data:Jl.allowNull((e=>this.data(e,!0))),type:Jl.allowNull(s),accessList:Jl.allowNull(this.accessList.bind(this),null)},e.receiptLog={transactionIndex:s,blockNumber:s,transactionHash:o,address:t,topics:Jl.arrayOf(o),data:i,logIndex:s,blockHash:o},e.receipt={to:Jl.allowNull(this.address,null),from:Jl.allowNull(this.address,null),contractAddress:Jl.allowNull(t,null),transactionIndex:s,root:Jl.allowNull(a),gasUsed:r,logsBloom:Jl.allowNull(i),blockHash:o,transactionHash:o,logs:Jl.arrayOf(this.receiptLog.bind(this)),blockNumber:s,confirmations:Jl.allowNull(s,null),cumulativeGasUsed:r,effectiveGasPrice:Jl.allowNull(r),status:Jl.allowNull(s),type:c},e.block={hash:Jl.allowNull(o),parentHash:o,number:s,timestamp:s,nonce:Jl.allowNull(a),difficulty:this.difficulty.bind(this),gasLimit:r,gasUsed:r,miner:Jl.allowNull(t),extraData:i,transactions:Jl.allowNull(Jl.arrayOf(o)),baseFeePerGas:Jl.allowNull(r)},e.blockWithTransactions=wa(e.block),e.blockWithTransactions.transactions=Jl.allowNull(Jl.arrayOf(this.transactionResponse.bind(this))),e.filter={fromBlock:Jl.allowNull(n,void 0),toBlock:Jl.allowNull(n,void 0),blockHash:Jl.allowNull(o,void 0),address:Jl.allowNull(t,void 0),topics:Jl.allowNull(this.topics.bind(this),void 0)},e.filterLog={blockNumber:Jl.allowNull(s),blockHash:Jl.allowNull(o),transactionIndex:s,removed:Jl.allowNull(this.boolean.bind(this)),address:t,data:Jl.allowFalsish(i,"0x"),topics:Jl.arrayOf(o),transactionHash:o,logIndex:s},e}accessList(e){return Nf(e||[])}number(e){return"0x"===e?0:Zo.from(e).toNumber()}type(e){return"0x"===e||null==e?0:Zo.from(e).toNumber()}bigNumber(e){return Zo.from(e)}boolean(e){if("boolean"==typeof e)return e;if("string"==typeof e){if("true"===(e=e.toLowerCase()))return!0;if("false"===e)return!1}throw new Error("invalid boolean - "+e)}hex(e,t){return"string"==typeof e&&(t||"0x"===e.substring(0,2)||(e="0x"+e),No(e))?e.toLowerCase():Kl.throwArgumentError("invalid hash","value",e)}data(e,t){const r=this.hex(e,t);if(r.length%2!=0)throw new Error("invalid data; odd-length - "+e);return r}address(e){return ws(e)}callAddress(e){if(!No(e,32))return null;const t=ws(Do(e,12));return"0x0000000000000000000000000000000000000000"===t?null:t}contractAddress(e){return As(e)}blockTag(e){if(null==e)return"latest";if("earliest"===e)return"0x0";switch(e){case"earliest":return"0x0";case"latest":case"pending":case"safe":case"finalized":return e}if("number"==typeof e||No(e))return Bo(e);throw new Error("invalid blockTag")}hash(e,t){const r=this.hex(e,t);return 32!==jo(r)?Kl.throwArgumentError("invalid hash","value",e):r}difficulty(e){if(null==e)return null;const t=Zo.from(e);try{return t.toNumber()}catch(e){}return null}uint256(e){if(!No(e))throw new Error("invalid uint256");return zo(e,32)}_block(e,t){null!=e.author&&null==e.miner&&(e.miner=e.author);const r=null!=e._difficulty?e._difficulty:e.difficulty,n=Jl.check(t,e);return n._difficulty=null==r?null:Zo.from(r),n}block(e){return this._block(e,this.formats.block)}blockWithTransactions(e){return this._block(e,this.formats.blockWithTransactions)}transactionRequest(e){return Jl.check(this.formats.transactionRequest,e)}transactionResponse(e){null!=e.gas&&null==e.gasLimit&&(e.gasLimit=e.gas),e.to&&Zo.from(e.to).isZero()&&(e.to="0x0000000000000000000000000000000000000000"),null!=e.input&&null==e.data&&(e.data=e.input),null==e.to&&null==e.creates&&(e.creates=this.contractAddress(e)),1!==e.type&&2!==e.type||null!=e.accessList||(e.accessList=[]);const t=Jl.check(this.formats.transaction,e);if(null!=e.chainId){let r=e.chainId;No(r)&&(r=Zo.from(r).toNumber()),t.chainId=r}else{let r=e.networkId;null==r&&null==t.v&&(r=e.chainId),No(r)&&(r=Zo.from(r).toNumber()),"number"!=typeof r&&null!=t.v&&(r=(t.v-35)/2,r<0&&(r=0),r=parseInt(r)),"number"!=typeof r&&(r=0),t.chainId=r}return t.blockHash&&"x"===t.blockHash.replace(/0/g,"")&&(t.blockHash=null),t}transaction(e){return Bf(e)}receiptLog(e){return Jl.check(this.formats.receiptLog,e)}receipt(e){const t=Jl.check(this.formats.receipt,e);if(null!=t.root)if(t.root.length<=4){const e=Zo.from(t.root).toNumber();0===e||1===e?(null!=t.status&&t.status!==e&&Kl.throwArgumentError("alt-root-status/status mismatch","value",{root:t.root,status:t.status}),t.status=e,delete t.root):Kl.throwArgumentError("invalid alt-root-status","value.root",t.root)}else 66!==t.root.length&&Kl.throwArgumentError("invalid root hash","value.root",t.root);return null!=t.status&&(t.byzantium=!0),t}topics(e){return Array.isArray(e)?e.map((e=>this.topics(e))):null!=e?this.hash(e,!0):null}filter(e){return Jl.check(this.formats.filter,e)}filterLog(e){return Jl.check(this.formats.filterLog,e)}static check(e,t){const r={};for(const n in e)try{const i=e[n](t[n]);void 0!==i&&(r[n]=i)}catch(e){throw e.checkKey=n,e.checkValue=t[n],e}return r}static allowNull(e,t){return function(r){return null==r?t:e(r)}}static allowFalsish(e,t){return function(r){return r?e(r):t}}static arrayOf(e){return function(t){if(!Array.isArray(t))throw new Error("not an array");const r=[];return t.forEach((function(t){r.push(e(t))})),r}}}var Wl=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))};const Gl=new wo(Hl);function Vl(e){return null==e?"null":(32!==jo(e)&&Gl.throwArgumentError("invalid topic","topic",e),e.toLowerCase())}function Zl(e){for(e=e.slice();e.length>0&&null==e[e.length-1];)e.pop();return e.map((e=>{if(Array.isArray(e)){const t={};e.forEach((e=>{t[Vl(e)]=!0}));const r=Object.keys(t);return r.sort(),r.join("|")}return Vl(e)})).join("&")}function Xl(e){if("string"==typeof e){if(32===jo(e=e.toLowerCase()))return"tx:"+e;if(-1===e.indexOf(":"))return e}else{if(Array.isArray(e))return"filter:*:"+Zl(e);if(Eu.isForkEvent(e))throw Gl.warn("not implemented"),new Error("not implemented");if(e&&"object"==typeof e)return"filter:"+(e.address||"*")+":"+Zl(e.topics||[])}throw new Error("invalid event - "+e)}function Ql(){return(new Date).getTime()}function Yl(e){return new Promise((t=>{setTimeout(t,e)}))}const eh=["block","network","pending","poll"];class th{constructor(e,t,r){ga(this,"tag",e),ga(this,"listener",t),ga(this,"once",r),this._lastBlockNumber=-2,this._inflight=!1}get event(){switch(this.type){case"tx":return this.hash;case"filter":return this.filter}return this.tag}get type(){return this.tag.split(":")[0]}get hash(){const e=this.tag.split(":");return"tx"!==e[0]?null:e[1]}get filter(){const e=this.tag.split(":");if("filter"!==e[0])return null;const t=e[1],r=""===(n=e[2])?[]:n.split(/&/g).map((e=>{if(""===e)return[];const t=e.split("|").map((e=>"null"===e?null:e));return 1===t.length?t[0]:t}));var n;const i={};return r.length>0&&(i.topics=r),t&&"*"!==t&&(i.address=t),i}pollable(){return this.tag.indexOf(":")>=0||eh.indexOf(this.tag)>=0}}const rh={0:{symbol:"btc",p2pkh:0,p2sh:5,prefix:"bc"},2:{symbol:"ltc",p2pkh:48,p2sh:50,prefix:"ltc"},3:{symbol:"doge",p2pkh:30,p2sh:22},60:{symbol:"eth",ilk:"eth"},61:{symbol:"etc",ilk:"eth"},700:{symbol:"xdai",ilk:"eth"}};function nh(e){return zo(Zo.from(e).toHexString(),32)}function ih(e){return nd.encode(Co([e,Do(cd(cd(e)),0,4)]))}const oh=new RegExp("^(ipfs)://(.*)$","i"),ah=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),oh,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function sh(e,t){try{return Vs(ch(e,t))}catch(e){}return null}function ch(e,t){if("0x"===e)return null;const r=Zo.from(Do(e,t,t+32)).toNumber(),n=Zo.from(Do(e,r,r+32)).toNumber();return Do(e,r+32,r+32+n)}function uh(e){return e.match(/^ipfs:\/\/ipfs\//i)?e=e.substring(12):e.match(/^ipfs:\/\//i)?e=e.substring(7):Gl.throwArgumentError("unsupported IPFS format","link",e),`https://gateway.ipfs.io/ipfs/${e}`}function fh(e){const t=Mo(e);if(t.length>32)throw new Error("internal; should not happen");const r=new Uint8Array(32);return r.set(t,32-t.length),r}function dh(e){if(e.length%32==0)return e;const t=new Uint8Array(32*Math.ceil(e.length/32));return t.set(e),t}function lh(e){const t=[];let r=0;for(let n=0;nZo.from(e).eq(1))).catch((e=>{if(e.code===wo.errors.CALL_EXCEPTION)return!1;throw this._supportsEip2544=null,e}))),this._supportsEip2544}_fetch(e,t){return Wl(this,void 0,void 0,(function*(){const r={to:this.address,ccipReadEnabled:!0,data:$o([e,Kc(this.name),t||"0x"])};let n=!1;(yield this.supportsWildcard())&&(n=!0,r.data=$o(["0x9061b923",lh([Jc(this.name),r.data])]));try{let e=yield this.provider.call(r);return Mo(e).length%32==4&&Gl.throwError("resolver threw error",wo.errors.CALL_EXCEPTION,{transaction:r,data:e}),n&&(e=ch(e,0)),e}catch(e){if(e.code===wo.errors.CALL_EXCEPTION)return null;throw e}}))}_fetchBytes(e,t){return Wl(this,void 0,void 0,(function*(){const r=yield this._fetch(e,t);return null!=r?ch(r,0):null}))}_getAddress(e,t){const r=rh[String(e)];if(null==r&&Gl.throwError(`unsupported coin type: ${e}`,wo.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`}),"eth"===r.ilk)return this.provider.formatter.address(t);const n=Mo(t);if(null!=r.p2pkh){const e=t.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);if(e){const t=parseInt(e[1],16);if(e[2].length===2*t&&t>=1&&t<=75)return ih(Co([[r.p2pkh],"0x"+e[2]]))}}if(null!=r.p2sh){const e=t.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(e){const t=parseInt(e[1],16);if(e[2].length===2*t&&t>=1&&t<=75)return ih(Co([[r.p2sh],"0x"+e[2]]))}}if(null!=r.prefix){const e=n[1];let t=n[0];if(0===t?20!==e&&32!==e&&(t=-1):t=-1,t>=0&&n.length===2+e&&e>=1&&e<=75){const e=ql.toWords(n.slice(2));return e.unshift(t),ql.encode(r.prefix,e)}}return null}getAddress(e){return Wl(this,void 0,void 0,(function*(){if(null==e&&(e=60),60===e)try{const e=yield this._fetch("0x3b3b57de");return"0x"===e||e===Bs?null:this.provider.formatter.callAddress(e)}catch(e){if(e.code===wo.errors.CALL_EXCEPTION)return null;throw e}const t=yield this._fetchBytes("0xf1cb7e06",nh(e));if(null==t||"0x"===t)return null;const r=this._getAddress(e,t);return null==r&&Gl.throwError("invalid or unsupported coin data",wo.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`,coinType:e,data:t}),r}))}getAvatar(){return Wl(this,void 0,void 0,(function*(){const e=[{type:"name",content:this.name}];try{const t=yield this.getText("avatar");if(null==t)return null;for(let r=0;re[t]))}return Gl.throwError("invalid or unsupported content hash data",wo.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:e})}))}getText(e){return Wl(this,void 0,void 0,(function*(){let t=Js(e);t=Co([nh(64),nh(t.length),t]),t.length%32!=0&&(t=Co([t,zo("0x",32-e.length%32)]));const r=yield this._fetchBytes("0x59d1d43c",To(t));return null==r||"0x"===r?null:Vs(r)}))}}let ph=null,mh=1;class gh extends Su{constructor(e){if(super(),this._events=[],this._emitted={block:-2},this.disableCcipRead=!1,this.formatter=new.target.getFormatter(),ga(this,"anyNetwork","any"===e),this.anyNetwork&&(e=this.detectNetwork()),e instanceof Promise)this._networkPromise=e,e.catch((e=>{})),this._ready().catch((e=>{}));else{const t=ya(new.target,"getNetwork")(e);t?(ga(this,"_network",t),this.emit("network",t,null)):Gl.throwArgumentError("invalid network","network",e)}this._maxInternalBlockNumber=-1024,this._lastBlockNumber=-2,this._maxFilterBlockRange=10,this._pollingInterval=4e3,this._fastQueryDate=0}_ready(){return Wl(this,void 0,void 0,(function*(){if(null==this._network){let e=null;if(this._networkPromise)try{e=yield this._networkPromise}catch(e){}null==e&&(e=yield this.detectNetwork()),e||Gl.throwError("no network detected",wo.errors.UNKNOWN_ERROR,{}),null==this._network&&(this.anyNetwork?this._network=e:ga(this,"_network",e),this.emit("network",e,null))}return this._network}))}get ready(){return Nl((()=>this._ready().then((e=>e),(e=>{if(e.code!==wo.errors.NETWORK_ERROR||"noNetwork"!==e.event)throw e}))))}static getFormatter(){return null==ph&&(ph=new Jl),ph}static getNetwork(e){return function(e){if(null==e)return null;if("number"==typeof e){for(const t in El){const r=El[t];if(r.chainId===e)return{name:r.name,chainId:r.chainId,ensAddress:r.ensAddress||null,_defaultProvider:r._defaultProvider||null}}return{chainId:e,name:"unknown"}}if("string"==typeof e){const t=El[e];return null==t?null:{name:t.name,chainId:t.chainId,ensAddress:t.ensAddress,_defaultProvider:t._defaultProvider||null}}const t=El[e.name];if(!t)return"number"!=typeof e.chainId&&yl.throwArgumentError("invalid network chainId","network",e),e;0!==e.chainId&&e.chainId!==t.chainId&&yl.throwArgumentError("network chainId mismatch","network",e);let r=e._defaultProvider||null;var n;return null==r&&t._defaultProvider&&(r=(n=t._defaultProvider)&&"function"==typeof n.renetwork?t._defaultProvider.renetwork(e):t._defaultProvider),{name:e.name,chainId:t.chainId,ensAddress:e.ensAddress||t.ensAddress||null,_defaultProvider:r}}(null==e?"homestead":e)}ccipReadFetch(e,t,r){return Wl(this,void 0,void 0,(function*(){if(this.disableCcipRead||0===r.length)return null;const n=e.to.toLowerCase(),i=t.toLowerCase(),o=[];for(let e=0;e=0?null:JSON.stringify({data:i,sender:n}),c=yield Rl({url:a,errorPassThrough:!0},s,((e,t)=>(e.status=t.statusCode,e)));if(c.data)return c.data;const u=c.message||"unknown error";if(c.status>=400&&c.status<500)return Gl.throwError(`response not found during CCIP fetch: ${u}`,wo.errors.SERVER_ERROR,{url:t,errorMessage:u});o.push(u)}return Gl.throwError(`error encountered during CCIP fetch: ${o.map((e=>JSON.stringify(e))).join(", ")}`,wo.errors.SERVER_ERROR,{urls:r,errorMessages:o})}))}_getInternalBlockNumber(e){return Wl(this,void 0,void 0,(function*(){if(yield this._ready(),e>0)for(;this._internalBlockNumber;){const t=this._internalBlockNumber;try{const r=yield t;if(Ql()-r.respTime<=e)return r.blockNumber;break}catch(e){if(this._internalBlockNumber===t)break}}const t=Ql(),r=ba({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then((e=>null),(e=>e))}).then((({blockNumber:e,networkError:n})=>{if(n)throw this._internalBlockNumber===r&&(this._internalBlockNumber=null),n;const i=Ql();return(e=Zo.from(e).toNumber()){this._internalBlockNumber===r&&(this._internalBlockNumber=null)})),(yield r).blockNumber}))}poll(){return Wl(this,void 0,void 0,(function*(){const e=mh++,t=[];let r=null;try{r=yield this._getInternalBlockNumber(100+this.pollingInterval/2)}catch(e){return void this.emit("error",e)}if(this._setFastBlockNumber(r),this.emit("poll",e,r),r!==this._lastBlockNumber){if(-2===this._emitted.block&&(this._emitted.block=r-1),Math.abs(this._emitted.block-r)>1e3)Gl.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${r})`),this.emit("error",Gl.makeError("network block skew detected",wo.errors.NETWORK_ERROR,{blockNumber:r,event:"blockSkew",previousBlockNumber:this._emitted.block})),this.emit("block",r);else for(let e=this._emitted.block+1;e<=r;e++)this.emit("block",e);this._emitted.block!==r&&(this._emitted.block=r,Object.keys(this._emitted).forEach((e=>{if("block"===e)return;const t=this._emitted[e];"pending"!==t&&r-t>12&&delete this._emitted[e]}))),-2===this._lastBlockNumber&&(this._lastBlockNumber=r-1),this._events.forEach((e=>{switch(e.type){case"tx":{const r=e.hash;let n=this.getTransactionReceipt(r).then((e=>e&&null!=e.blockNumber?(this._emitted["t:"+r]=e.blockNumber,this.emit(r,e),null):null)).catch((e=>{this.emit("error",e)}));t.push(n);break}case"filter":if(!e._inflight){e._inflight=!0,-2===e._lastBlockNumber&&(e._lastBlockNumber=r-1);const n=e.filter;n.fromBlock=e._lastBlockNumber+1,n.toBlock=r;const i=n.toBlock-this._maxFilterBlockRange;i>n.fromBlock&&(n.fromBlock=i),n.fromBlock<0&&(n.fromBlock=0);const o=this.getLogs(n).then((t=>{e._inflight=!1,0!==t.length&&t.forEach((t=>{t.blockNumber>e._lastBlockNumber&&(e._lastBlockNumber=t.blockNumber),this._emitted["b:"+t.blockHash]=t.blockNumber,this._emitted["t:"+t.transactionHash]=t.blockNumber,this.emit(n,t)}))})).catch((t=>{this.emit("error",t),e._inflight=!1}));t.push(o)}}})),this._lastBlockNumber=r,Promise.all(t).then((()=>{this.emit("didPoll",e)})).catch((e=>{this.emit("error",e)}))}else this.emit("didPoll",e)}))}resetEventsBlock(e){this._lastBlockNumber=e-1,this.polling&&this.poll()}get network(){return this._network}detectNetwork(){return Wl(this,void 0,void 0,(function*(){return Gl.throwError("provider does not support network detection",wo.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"})}))}getNetwork(){return Wl(this,void 0,void 0,(function*(){const e=yield this._ready(),t=yield this.detectNetwork();if(e.chainId!==t.chainId){if(this.anyNetwork)return this._network=t,this._lastBlockNumber=-2,this._fastBlockNumber=null,this._fastBlockNumberPromise=null,this._fastQueryDate=0,this._emitted.block=-2,this._maxInternalBlockNumber=-1024,this._internalBlockNumber=null,this.emit("network",t,e),yield Yl(0),this._network;const r=Gl.makeError("underlying network changed",wo.errors.NETWORK_ERROR,{event:"changed",network:e,detectedNetwork:t});throw this.emit("error",r),r}return e}))}get blockNumber(){return this._getInternalBlockNumber(100+this.pollingInterval/2).then((e=>{this._setFastBlockNumber(e)}),(e=>{})),null!=this._fastBlockNumber?this._fastBlockNumber:-1}get polling(){return null!=this._poller}set polling(e){e&&!this._poller?(this._poller=setInterval((()=>{this.poll()}),this.pollingInterval),this._bootstrapPoll||(this._bootstrapPoll=setTimeout((()=>{this.poll(),this._bootstrapPoll=setTimeout((()=>{this._poller||this.poll(),this._bootstrapPoll=null}),this.pollingInterval)}),0))):!e&&this._poller&&(clearInterval(this._poller),this._poller=null)}get pollingInterval(){return this._pollingInterval}set pollingInterval(e){if("number"!=typeof e||e<=0||parseInt(String(e))!=e)throw new Error("invalid polling interval");this._pollingInterval=e,this._poller&&(clearInterval(this._poller),this._poller=setInterval((()=>{this.poll()}),this._pollingInterval))}_getFastBlockNumber(){const e=Ql();return e-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=e,this._fastBlockNumberPromise=this.getBlockNumber().then((e=>((null==this._fastBlockNumber||e>this._fastBlockNumber)&&(this._fastBlockNumber=e),this._fastBlockNumber)))),this._fastBlockNumberPromise}_setFastBlockNumber(e){null!=this._fastBlockNumber&&ethis._fastBlockNumber)&&(this._fastBlockNumber=e,this._fastBlockNumberPromise=Promise.resolve(e)))}waitForTransaction(e,t,r){return Wl(this,void 0,void 0,(function*(){return this._waitForTransaction(e,null==t?1:t,r||0,null)}))}_waitForTransaction(e,t,r,n){return Wl(this,void 0,void 0,(function*(){const i=yield this.getTransactionReceipt(e);return(i?i.confirmations:0)>=t?i:new Promise(((i,o)=>{const a=[];let s=!1;const c=function(){return!!s||(s=!0,a.forEach((e=>{e()})),!1)},u=e=>{e.confirmations{this.removeListener(e,u)})),n){let r=n.startBlock,i=null;const u=a=>Wl(this,void 0,void 0,(function*(){s||(yield Yl(1e3),this.getTransactionCount(n.from).then((f=>Wl(this,void 0,void 0,(function*(){if(!s){if(f<=n.nonce)r=a;else{{const t=yield this.getTransaction(e);if(t&&null!=t.blockNumber)return}for(null==i&&(i=r-3,i{s||this.once("block",u)})))}));if(s)return;this.once("block",u),a.push((()=>{this.removeListener("block",u)}))}if("number"==typeof r&&r>0){const e=setTimeout((()=>{c()||o(Gl.makeError("timeout exceeded",wo.errors.TIMEOUT,{timeout:r}))}),r);e.unref&&e.unref(),a.push((()=>{clearTimeout(e)}))}}))}))}getBlockNumber(){return Wl(this,void 0,void 0,(function*(){return this._getInternalBlockNumber(0)}))}getGasPrice(){return Wl(this,void 0,void 0,(function*(){yield this.getNetwork();const e=yield this.perform("getGasPrice",{});try{return Zo.from(e)}catch(t){return Gl.throwError("bad result from backend",wo.errors.SERVER_ERROR,{method:"getGasPrice",result:e,error:t})}}))}getBalance(e,t){return Wl(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield ba({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),n=yield this.perform("getBalance",r);try{return Zo.from(n)}catch(e){return Gl.throwError("bad result from backend",wo.errors.SERVER_ERROR,{method:"getBalance",params:r,result:n,error:e})}}))}getTransactionCount(e,t){return Wl(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield ba({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),n=yield this.perform("getTransactionCount",r);try{return Zo.from(n).toNumber()}catch(e){return Gl.throwError("bad result from backend",wo.errors.SERVER_ERROR,{method:"getTransactionCount",params:r,result:n,error:e})}}))}getCode(e,t){return Wl(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield ba({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),n=yield this.perform("getCode",r);try{return To(n)}catch(e){return Gl.throwError("bad result from backend",wo.errors.SERVER_ERROR,{method:"getCode",params:r,result:n,error:e})}}))}getStorageAt(e,t,r){return Wl(this,void 0,void 0,(function*(){yield this.getNetwork();const n=yield ba({address:this._getAddress(e),blockTag:this._getBlockTag(r),position:Promise.resolve(t).then((e=>Bo(e)))}),i=yield this.perform("getStorageAt",n);try{return To(i)}catch(e){return Gl.throwError("bad result from backend",wo.errors.SERVER_ERROR,{method:"getStorageAt",params:n,result:i,error:e})}}))}_wrapTransaction(e,t,r){if(null!=t&&32!==jo(t))throw new Error("invalid response - sendTransaction");const n=e;return null!=t&&e.hash!==t&&Gl.throwError("Transaction hash mismatch from Provider.sendTransaction.",wo.errors.UNKNOWN_ERROR,{expectedHash:e.hash,returnedHash:t}),n.wait=(t,n)=>Wl(this,void 0,void 0,(function*(){let i;null==t&&(t=1),null==n&&(n=0),0!==t&&null!=r&&(i={data:e.data,from:e.from,nonce:e.nonce,to:e.to,value:e.value,startBlock:r});const o=yield this._waitForTransaction(e.hash,t,n,i);return null==o&&0===t?null:(this._emitted["t:"+e.hash]=o.blockNumber,0===o.status&&Gl.throwError("transaction failed",wo.errors.CALL_EXCEPTION,{transactionHash:e.hash,transaction:e,receipt:o}),o)})),n}sendTransaction(e){return Wl(this,void 0,void 0,(function*(){yield this.getNetwork();const t=yield Promise.resolve(e).then((e=>To(e))),r=this.formatter.transaction(e);null==r.confirmations&&(r.confirmations=0);const n=yield this._getInternalBlockNumber(100+2*this.pollingInterval);try{const e=yield this.perform("sendTransaction",{signedTransaction:t});return this._wrapTransaction(r,e,n)}catch(e){throw e.transaction=r,e.transactionHash=r.hash,e}}))}_getTransactionRequest(e){return Wl(this,void 0,void 0,(function*(){const t=yield e,r={};return["from","to"].forEach((e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then((e=>e?this._getAddress(e):null)))})),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach((e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then((e=>e?Zo.from(e):null)))})),["type"].forEach((e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then((e=>null!=e?e:null)))})),t.accessList&&(r.accessList=this.formatter.accessList(t.accessList)),["data"].forEach((e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then((e=>e?To(e):null)))})),this.formatter.transactionRequest(yield ba(r))}))}_getFilter(e){return Wl(this,void 0,void 0,(function*(){e=yield e;const t={};return null!=e.address&&(t.address=this._getAddress(e.address)),["blockHash","topics"].forEach((r=>{null!=e[r]&&(t[r]=e[r])})),["fromBlock","toBlock"].forEach((r=>{null!=e[r]&&(t[r]=this._getBlockTag(e[r]))})),this.formatter.filter(yield ba(t))}))}_call(e,t,r){return Wl(this,void 0,void 0,(function*(){r>=10&&Gl.throwError("CCIP read exceeded maximum redirections",wo.errors.SERVER_ERROR,{redirects:r,transaction:e});const n=e.to,i=yield this.perform("call",{transaction:e,blockTag:t});if(r>=0&&"latest"===t&&null!=n&&"0x556f1830"===i.substring(0,10)&&jo(i)%32==4)try{const o=Do(i,4),a=Do(o,0,32);Zo.from(a).eq(n)||Gl.throwError("CCIP Read sender did not match",wo.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:i});const s=[],c=Zo.from(Do(o,32,64)).toNumber(),u=Zo.from(Do(o,c,c+32)).toNumber(),f=Do(o,c+32);for(let t=0;tWl(this,void 0,void 0,(function*(){const e=yield this.perform("getBlock",n);if(null==e)return null!=n.blockHash&&null==this._emitted["b:"+n.blockHash]||null!=n.blockTag&&r>this._emitted.block?null:void 0;if(t){let t=null;for(let r=0;rthis._wrapTransaction(e))),r}return this.formatter.block(e)}))),{oncePoll:this})}))}getBlock(e){return this._getBlock(e,!1)}getBlockWithTransactions(e){return this._getBlock(e,!0)}getTransaction(e){return Wl(this,void 0,void 0,(function*(){yield this.getNetwork(),e=yield e;const t={transactionHash:this.formatter.hash(e,!0)};return Nl((()=>Wl(this,void 0,void 0,(function*(){const r=yield this.perform("getTransaction",t);if(null==r)return null==this._emitted["t:"+e]?null:void 0;const n=this.formatter.transactionResponse(r);if(null==n.blockNumber)n.confirmations=0;else if(null==n.confirmations){let e=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-n.blockNumber+1;e<=0&&(e=1),n.confirmations=e}return this._wrapTransaction(n)}))),{oncePoll:this})}))}getTransactionReceipt(e){return Wl(this,void 0,void 0,(function*(){yield this.getNetwork(),e=yield e;const t={transactionHash:this.formatter.hash(e,!0)};return Nl((()=>Wl(this,void 0,void 0,(function*(){const r=yield this.perform("getTransactionReceipt",t);if(null==r)return null==this._emitted["t:"+e]?null:void 0;if(null==r.blockHash)return;const n=this.formatter.receipt(r);if(null==n.blockNumber)n.confirmations=0;else if(null==n.confirmations){let e=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-n.blockNumber+1;e<=0&&(e=1),n.confirmations=e}return n}))),{oncePoll:this})}))}getLogs(e){return Wl(this,void 0,void 0,(function*(){yield this.getNetwork();const t=yield ba({filter:this._getFilter(e)}),r=yield this.perform("getLogs",t);return r.forEach((e=>{null==e.removed&&(e.removed=!1)})),Jl.arrayOf(this.formatter.filterLog.bind(this.formatter))(r)}))}getEtherPrice(){return Wl(this,void 0,void 0,(function*(){return yield this.getNetwork(),this.perform("getEtherPrice",{})}))}_getBlockTag(e){return Wl(this,void 0,void 0,(function*(){if("number"==typeof(e=yield e)&&e<0){e%1&&Gl.throwArgumentError("invalid BlockTag","blockTag",e);let t=yield this._getInternalBlockNumber(100+2*this.pollingInterval);return t+=e,t<0&&(t=0),this.formatter.blockTag(t)}return this.formatter.blockTag(e)}))}getResolver(e){return Wl(this,void 0,void 0,(function*(){let t=e;for(;;){if(""===t||"."===t)return null;if("eth"!==e&&"eth"===t)return null;const r=yield this._getResolver(t,"getResolver");if(null!=r){const n=new hh(this,r,e);return t===e||(yield n.supportsWildcard())?n:null}t=t.split(".").slice(1).join(".")}}))}_getResolver(e,t){return Wl(this,void 0,void 0,(function*(){null==t&&(t="ENS");const r=yield this.getNetwork();r.ensAddress||Gl.throwError("network does not support ENS",wo.errors.UNSUPPORTED_OPERATION,{operation:t,network:r.name});try{const t=yield this.call({to:r.ensAddress,data:"0x0178b8bf"+Kc(e).substring(2)});return this.formatter.callAddress(t)}catch(e){}return null}))}resolveName(e){return Wl(this,void 0,void 0,(function*(){e=yield e;try{return Promise.resolve(this.formatter.address(e))}catch(t){if(No(e))throw t}"string"!=typeof e&&Gl.throwArgumentError("invalid ENS name","name",e);const t=yield this.getResolver(e);return t?yield t.getAddress():null}))}lookupAddress(e){return Wl(this,void 0,void 0,(function*(){e=yield e;const t=(e=this.formatter.address(e)).substring(2).toLowerCase()+".addr.reverse",r=yield this._getResolver(t,"lookupAddress");if(null==r)return null;const n=sh(yield this.call({to:r,data:"0x691f3431"+Kc(t).substring(2)}),0);return(yield this.resolveName(n))!=e?null:n}))}getAvatar(e){return Wl(this,void 0,void 0,(function*(){let t=null;if(No(e)){const r=this.formatter.address(e).substring(2).toLowerCase()+".addr.reverse",n=yield this._getResolver(r,"getAvatar");if(!n)return null;t=new hh(this,n,r);try{const e=yield t.getAvatar();if(e)return e.url}catch(e){if(e.code!==wo.errors.CALL_EXCEPTION)throw e}try{const e=sh(yield this.call({to:n,data:"0x691f3431"+Kc(r).substring(2)}),0);t=yield this.getResolver(e)}catch(e){if(e.code!==wo.errors.CALL_EXCEPTION)throw e;return null}}else if(t=yield this.getResolver(e),!t)return null;const r=yield t.getAvatar();return null==r?null:r.url}))}perform(e,t){return Gl.throwError(e+" not implemented",wo.errors.NOT_IMPLEMENTED,{operation:e})}_startEvent(e){this.polling=this._events.filter((e=>e.pollable())).length>0}_stopEvent(e){this.polling=this._events.filter((e=>e.pollable())).length>0}_addEventListener(e,t,r){const n=new th(Xl(e),t,r);return this._events.push(n),this._startEvent(n),this}on(e,t){return this._addEventListener(e,t,!1)}once(e,t){return this._addEventListener(e,t,!0)}emit(e,...t){let r=!1,n=[],i=Xl(e);return this._events=this._events.filter((e=>e.tag!==i||(setTimeout((()=>{e.listener.apply(this,t)}),0),r=!0,!e.once||(n.push(e),!1)))),n.forEach((e=>{this._stopEvent(e)})),r}listenerCount(e){if(!e)return this._events.length;let t=Xl(e);return this._events.filter((e=>e.tag===t)).length}listeners(e){if(null==e)return this._events.map((e=>e.listener));let t=Xl(e);return this._events.filter((e=>e.tag===t)).map((e=>e.listener))}off(e,t){if(null==t)return this.removeAllListeners(e);const r=[];let n=!1,i=Xl(e);return this._events=this._events.filter((e=>e.tag!==i||e.listener!=t||(!!n||(n=!0,r.push(e),!1)))),r.forEach((e=>{this._stopEvent(e)})),this}removeAllListeners(e){let t=[];if(null==e)t=this._events,this._events=[];else{const r=Xl(e);this._events=this._events.filter((e=>e.tag!==r||(t.push(e),!1)))}return t.forEach((e=>{this._stopEvent(e)})),this}}var yh=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{c(n.next(e))}catch(e){o(e)}}function s(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))};const bh=new wo(Hl),vh=["call","estimateGas"];function wh(e,t){if(null==e)return null;if("string"==typeof e.message&&e.message.match("reverted")){const r=No(e.data)?e.data:null;if(!t||r)return{message:e.message,data:r}}if("object"==typeof e){for(const r in e){const n=wh(e[r],t);if(n)return n}return null}if("string"==typeof e)try{return wh(JSON.parse(e),t)}catch(e){}return null}function Ah(e,t,r){const n=r.transaction||r.signedTransaction;if("call"===e){const e=wh(t,!0);if(e)return e.data;bh.throwError("missing revert data in call exception; Transaction reverted without a reason string",wo.errors.CALL_EXCEPTION,{data:"0x",transaction:n,error:t})}if("estimateGas"===e){let r=wh(t.body,!1);null==r&&(r=wh(t,!1)),r&&bh.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",wo.errors.UNPREDICTABLE_GAS_LIMIT,{reason:r.message,method:e,transaction:n,error:t})}let i=t.message;throw t.code===wo.errors.SERVER_ERROR&&t.error&&"string"==typeof t.error.message?i=t.error.message:"string"==typeof t.body?i=t.body:"string"==typeof t.responseText&&(i=t.responseText),i=(i||"").toLowerCase(),i.match(/insufficient funds|base fee exceeds gas limit|InsufficientFunds/i)&&bh.throwError("insufficient funds for intrinsic transaction cost",wo.errors.INSUFFICIENT_FUNDS,{error:t,method:e,transaction:n}),i.match(/nonce (is )?too low/i)&&bh.throwError("nonce has already been used",wo.errors.NONCE_EXPIRED,{error:t,method:e,transaction:n}),i.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&bh.throwError("replacement fee too low",wo.errors.REPLACEMENT_UNDERPRICED,{error:t,method:e,transaction:n}),i.match(/only replay-protected/i)&&bh.throwError("legacy pre-eip-155 transactions not supported",wo.errors.UNSUPPORTED_OPERATION,{error:t,method:e,transaction:n}),vh.indexOf(e)>=0&&i.match(/gas required exceeds allowance|always failing transaction|execution reverted|revert/)&&bh.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",wo.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,method:e,transaction:n}),t}function _h(e){return new Promise((function(t){setTimeout(t,e)}))}function Eh(e){if(e.error){const t=new Error(e.error.message);throw t.code=e.error.code,t.data=e.error.data,t}return e.result}function Sh(e){return e?e.toLowerCase():e}const Ph={};class xh extends Cu{constructor(e,t,r){if(super(),e!==Ph)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");ga(this,"provider",t),null==r&&(r=0),"string"==typeof r?(ga(this,"_address",this.provider.formatter.address(r)),ga(this,"_index",null)):"number"==typeof r?(ga(this,"_index",r),ga(this,"_address",null)):bh.throwArgumentError("invalid address or index","addressOrIndex",r)}connect(e){return bh.throwError("cannot alter JSON-RPC Signer connection",wo.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}connectUnchecked(){return new kh(Ph,this.provider,this._address||this._index)}getAddress(){return this._address?Promise.resolve(this._address):this.provider.send("eth_accounts",[]).then((e=>(e.length<=this._index&&bh.throwError("unknown account #"+this._index,wo.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),this.provider.formatter.address(e[this._index]))))}sendUncheckedTransaction(e){e=wa(e);const t=this.getAddress().then((e=>(e&&(e=e.toLowerCase()),e)));if(null==e.gasLimit){const r=wa(e);r.from=t,e.gasLimit=this.provider.estimateGas(r)}return null!=e.to&&(e.to=Promise.resolve(e.to).then((e=>yh(this,void 0,void 0,(function*(){if(null==e)return null;const t=yield this.provider.resolveName(e);return null==t&&bh.throwArgumentError("provided ENS name resolves to null","tx.to",e),t}))))),ba({tx:ba(e),sender:t}).then((({tx:t,sender:r})=>{null!=t.from?t.from.toLowerCase()!==r&&bh.throwArgumentError("from address mismatch","transaction",e):t.from=r;const n=this.provider.constructor.hexlifyTransaction(t,{from:!0});return this.provider.send("eth_sendTransaction",[n]).then((e=>e),(e=>("string"==typeof e.message&&e.message.match(/user denied/i)&&bh.throwError("user rejected transaction",wo.errors.ACTION_REJECTED,{action:"sendTransaction",transaction:t}),Ah("sendTransaction",e,n))))}))}signTransaction(e){return bh.throwError("signing transactions is unsupported",wo.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}sendTransaction(e){return yh(this,void 0,void 0,(function*(){const t=yield this.provider._getInternalBlockNumber(100+2*this.provider.pollingInterval),r=yield this.sendUncheckedTransaction(e);try{return yield Nl((()=>yh(this,void 0,void 0,(function*(){const e=yield this.provider.getTransaction(r);if(null!==e)return this.provider._wrapTransaction(e,r,t)}))),{oncePoll:this.provider})}catch(e){throw e.transactionHash=r,e}}))}signMessage(e){return yh(this,void 0,void 0,(function*(){const t="string"==typeof e?Js(e):e,r=yield this.getAddress();try{return yield this.provider.send("personal_sign",[To(t),r.toLowerCase()])}catch(t){throw"string"==typeof t.message&&t.message.match(/user denied/i)&&bh.throwError("user rejected signing",wo.errors.ACTION_REJECTED,{action:"signMessage",from:r,messageData:e}),t}}))}_legacySignMessage(e){return yh(this,void 0,void 0,(function*(){const t="string"==typeof e?Js(e):e,r=yield this.getAddress();try{return yield this.provider.send("eth_sign",[r.toLowerCase(),To(t)])}catch(t){throw"string"==typeof t.message&&t.message.match(/user denied/i)&&bh.throwError("user rejected signing",wo.errors.ACTION_REJECTED,{action:"_legacySignMessage",from:r,messageData:e}),t}}))}_signTypedData(e,t,r){return yh(this,void 0,void 0,(function*(){const n=yield fu.resolveNames(e,t,r,(e=>this.provider.resolveName(e))),i=yield this.getAddress();try{return yield this.provider.send("eth_signTypedData_v4",[i.toLowerCase(),JSON.stringify(fu.getPayload(n.domain,t,n.value))])}catch(e){throw"string"==typeof e.message&&e.message.match(/user denied/i)&&bh.throwError("user rejected signing",wo.errors.ACTION_REJECTED,{action:"_signTypedData",from:i,messageData:{domain:n.domain,types:t,value:n.value}}),e}}))}unlock(e){return yh(this,void 0,void 0,(function*(){const t=this.provider,r=yield this.getAddress();return t.send("personal_unlockAccount",[r.toLowerCase(),e,null])}))}}class kh extends xh{sendTransaction(e){return this.sendUncheckedTransaction(e).then((e=>({hash:e,nonce:null,gasLimit:null,gasPrice:null,data:null,value:null,chainId:null,confirmations:0,from:null,wait:t=>this.provider.waitForTransaction(e,t)})))}}const Mh={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0};class Ch extends gh{constructor(e,t){let r=t;null==r&&(r=new Promise(((e,t)=>{setTimeout((()=>{this.detectNetwork().then((t=>{e(t)}),(e=>{t(e)}))}),0)}))),super(r),e||(e=ya(this.constructor,"defaultUrl")()),ga(this,"connection","string"==typeof e?Object.freeze({url:e}):Object.freeze(wa(e))),this._nextId=42}get _cache(){return null==this._eventLoopCache&&(this._eventLoopCache={}),this._eventLoopCache}static defaultUrl(){return"http://localhost:8545"}detectNetwork(){return this._cache.detectNetwork||(this._cache.detectNetwork=this._uncachedDetectNetwork(),setTimeout((()=>{this._cache.detectNetwork=null}),0)),this._cache.detectNetwork}_uncachedDetectNetwork(){return yh(this,void 0,void 0,(function*(){yield _h(0);let e=null;try{e=yield this.send("eth_chainId",[])}catch(t){try{e=yield this.send("net_version",[])}catch(e){}}if(null!=e){const t=ya(this.constructor,"getNetwork");try{return t(Zo.from(e).toNumber())}catch(t){return bh.throwError("could not detect network",wo.errors.NETWORK_ERROR,{chainId:e,event:"invalidNetwork",serverError:t})}}return bh.throwError("could not detect network",wo.errors.NETWORK_ERROR,{event:"noNetwork"})}))}getSigner(e){return new xh(Ph,this,e)}getUncheckedSigner(e){return this.getSigner(e).connectUnchecked()}listAccounts(){return this.send("eth_accounts",[]).then((e=>e.map((e=>this.formatter.address(e)))))}send(e,t){const r={method:e,params:t,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:Sa(r),provider:this});const n=["eth_chainId","eth_blockNumber"].indexOf(e)>=0;if(n&&this._cache[e])return this._cache[e];const i=Rl(this.connection,JSON.stringify(r),Eh).then((e=>(this.emit("debug",{action:"response",request:r,response:e,provider:this}),e)),(e=>{throw this.emit("debug",{action:"response",error:e,request:r,provider:this}),e}));return n&&(this._cache[e]=i,setTimeout((()=>{this._cache[e]=null}),0)),i}prepareRequest(e,t){switch(e){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[Sh(t.address),t.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[Sh(t.address),t.blockTag]];case"getCode":return["eth_getCode",[Sh(t.address),t.blockTag]];case"getStorageAt":return["eth_getStorageAt",[Sh(t.address),zo(t.position,32),t.blockTag]];case"sendTransaction":return["eth_sendRawTransaction",[t.signedTransaction]];case"getBlock":return t.blockTag?["eth_getBlockByNumber",[t.blockTag,!!t.includeTransactions]]:t.blockHash?["eth_getBlockByHash",[t.blockHash,!!t.includeTransactions]]:null;case"getTransaction":return["eth_getTransactionByHash",[t.transactionHash]];case"getTransactionReceipt":return["eth_getTransactionReceipt",[t.transactionHash]];case"call":return["eth_call",[ya(this.constructor,"hexlifyTransaction")(t.transaction,{from:!0}),t.blockTag]];case"estimateGas":return["eth_estimateGas",[ya(this.constructor,"hexlifyTransaction")(t.transaction,{from:!0})]];case"getLogs":return t.filter&&null!=t.filter.address&&(t.filter.address=Sh(t.filter.address)),["eth_getLogs",[t.filter]]}return null}perform(e,t){return yh(this,void 0,void 0,(function*(){if("call"===e||"estimateGas"===e){const e=t.transaction;if(e&&null!=e.type&&Zo.from(e.type).isZero()&&null==e.maxFeePerGas&&null==e.maxPriorityFeePerGas){const r=yield this.getFeeData();null==r.maxFeePerGas&&null==r.maxPriorityFeePerGas&&((t=wa(t)).transaction=wa(e),delete t.transaction.type)}}const r=this.prepareRequest(e,t);null==r&&bh.throwError(e+" not implemented",wo.errors.NOT_IMPLEMENTED,{operation:e});try{return yield this.send(r[0],r[1])}catch(r){return Ah(e,r,t)}}))}_startEvent(e){"pending"===e.tag&&this._startPending(),super._startEvent(e)}_startPending(){if(null!=this._pendingFilter)return;const e=this,t=this.send("eth_newPendingTransactionFilter",[]);this._pendingFilter=t,t.then((function(r){return function n(){e.send("eth_getFilterChanges",[r]).then((function(r){if(e._pendingFilter!=t)return null;let n=Promise.resolve();return r.forEach((function(t){e._emitted["t:"+t.toLowerCase()]="pending",n=n.then((function(){return e.getTransaction(t).then((function(t){return e.emit("pending",t),null}))}))})),n.then((function(){return _h(1e3)}))})).then((function(){if(e._pendingFilter==t)return setTimeout((function(){n()}),0),null;e.send("eth_uninstallFilter",[r])})).catch((e=>{}))}(),r})).catch((e=>{}))}_stopEvent(e){"pending"===e.tag&&0===this.listenerCount("pending")&&(this._pendingFilter=null),super._stopEvent(e)}static hexlifyTransaction(e,t){const r=wa(Mh);if(t)for(const e in t)t[e]&&(r[e]=!0);va(e,r);const n={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach((function(t){if(null==e[t])return;const r=Bo(Zo.from(e[t]));"gasLimit"===t&&(t="gas"),n[t]=r})),["from","to","data"].forEach((function(t){null!=e[t]&&(n[t]=To(e[t]))})),e.accessList&&(n.accessList=Nf(e.accessList)),n}}const Ih=new RegExp("^bytes([0-9]+)$"),Rh=new RegExp("^(u?int)([0-9]*)$"),Nh=new RegExp("^(.*)\\[([0-9]*)\\]$"),Oh="0000000000000000000000000000000000000000000000000000000000000000",Th=new wo("solidity/5.7.0");function jh(e,t,r){switch(e){case"address":return r?Ro(t,32):Mo(t);case"string":return Js(t);case"bytes":return Mo(t);case"bool":return t=t?"0x01":"0x00",r?Ro(t,32):Mo(t)}let n=e.match(Rh);if(n){let i=parseInt(n[2]||"256");return(n[2]&&String(i)!==n[2]||i%8!=0||0===i||i>256)&&Th.throwArgumentError("invalid number type","type",e),r&&(i=256),Ro(t=Zo.from(t).toTwos(i),i/8)}if(n=e.match(Ih),n){const i=parseInt(n[1]);return(String(i)!==n[1]||0===i||i>32)&&Th.throwArgumentError("invalid bytes type","type",e),Mo(t).byteLength!==i&&Th.throwArgumentError(`invalid value for ${e}`,"value",t),r?Mo((t+Oh).substring(0,66)):t}if(n=e.match(Nh),n&&Array.isArray(t)){const r=n[1];parseInt(n[2]||String(t.length))!=t.length&&Th.throwArgumentError(`invalid array length for ${e}`,"value",t);const i=[];return t.forEach((function(e){i.push(jh(r,e,!0))})),Co(i)}return Th.throwArgumentError("invalid type","type",e)}function Dh(e,t){e.length!=t.length&&Th.throwArgumentError("wrong number of values; expected ${ types.length }","values",t);const r=[];return e.forEach((function(e,n){r.push(jh(e,t[n]))})),To(Co(r))}var $h=Object.freeze({__proto__:null,keccak256:function(e,t){return is(Dh(e,t))},pack:Dh,sha256:function(e,t){return cd(Dh(e,t))}});const Bh=new wo("units/5.7.0"),Fh=["wei","kwei","mwei","gwei","szabo","finney","ether"];function zh(e,t){if("string"==typeof t){const e=Fh.indexOf(t);-1!==e&&(t=3*e)}return ca(e,null!=t?t:18)}function Uh(e,t){if("string"!=typeof e&&Bh.throwArgumentError("value must be a string","value",e),"string"==typeof t){const e=Fh.indexOf(t);-1!==e&&(t=3*e)}return ua(e,null!=t?t:18)}var Lh=Object.freeze({__proto__:null,commify:function(e){const t=String(e).split(".");(t.length>2||!t[0].match(/^-?[0-9]*$/)||t[1]&&!t[1].match(/^[0-9]*$/)||"."===e||"-."===e)&&Bh.throwArgumentError("invalid value","value",e);let r=t[0],n="";for("-"===r.substring(0,1)&&(n="-",r=r.substring(1));"0"===r.substring(0,1);)r=r.substring(1);""===r&&(r="0");let i="";for(2===t.length&&(i="."+(t[1]||"0"));i.length>2&&"0"===i[i.length-1];)i=i.substring(0,i.length-1);const o=[];for(;r.length;){if(r.length<=3){o.unshift(r);break}{const e=r.length-3;o.unshift(r.substring(e)),r=r.substring(0,e)}}return n+o.join(",")+i},formatEther:function(e){return zh(e,18)},formatUnits:zh,parseEther:function(e){return Uh(e,18)},parseUnits:Uh});function qh(e){if(null==e.match(/^(0x)?([\da-fA-F]{40})$/))throw new RangeError("incorrect address format");try{return ws(oo(e,!0,20))}catch(e){throw new an(e,["invalid EIP-55 address"])}}async function Hh(e){return n(await so(ro(e),"SHA-256"),!0,!1)}async function Kh(e,t){if(void 0===e.iss)throw new Error('Payload iss should be set to either "orig" or "dest"');const r=JSON.parse(e.exchange[e.iss]);await Yi(r,t);const n=await Wi(t),i=t.alg,o={...e,iat:Math.floor(Date.now()/1e3)};return{jws:await new Hi(o).setProtectedHeader({alg:i}).setIssuedAt(o.iat).sign(n),payload:o}}async function Jh(e,t,r){const n=JSON.parse(t.exchange[t.iss]),i=await Zi(e,n);if(void 0===i.payload.iss)throw new Error('Property "iss" missing');if(void 0===i.payload.iat)throw new Error("Property claim iat missing");if(void 0!==r){no("iat"===r.timestamp?1e3*i.payload.iat:r.timestamp,"iat"===r.notBefore?1e3*i.payload.iat:r.notBefore,"iat"===r.notAfter?1e3*i.payload.iat:r.notAfter,r.tolerance)}const o=i.payload,a=o.exchange[o.iss];if(ro(n)!==ro(JSON.parse(a)))throw new Error(`The proof is issued by ${a} instead of ${JSON.stringify(n)}`);const s=t;for(const e in s){if(void 0===o[e])throw new Error(`Expected key '${e}' not found in proof`);if("exchange"===e){const e=t.exchange;Wh(o.exchange,e)}else if(""!==s[e]&&ro(s[e])!==ro(o[e]))throw new Error(`Proof's ${e}: ${JSON.stringify(o[e],void 0,2)} does not meet provided value ${JSON.stringify(s[e],void 0,2)}`)}return i}function Wh(e,t){const r=["id","orig","dest","hashAlg","cipherblockDgst","blockCommitment","blockCommitment","secretCommitment","schema"];for(const t of r)if("schema"!==t&&(void 0===e[t]||""===e[t]))throw new Error(`${t} is missing on dataExchange.\ndataExchange: ${JSON.stringify(e,void 0,2)}`);for(const r in t)if(""!==t[r]&&ro(t[r])!==ro(e[r]))throw new Error(`dataExchange's ${r}: ${JSON.stringify(e[r],void 0,2)} does not meet expected value ${JSON.stringify(t[r],void 0,2)}`)}async function Gh(e,t,r=10){const{payload:n}=await Zi(e),i=n.exchange,o={...i};delete o.id;if(await Hh(o)!==i.id)throw new an(new Error("data exchange integrity failed"),["dataExchange integrity violated"]);const a=JSON.parse(i.dest),s=JSON.parse(i.orig);let c,u,f;try{c=(await Jh(n.poo,{iss:"orig",proofType:"PoO",exchange:i})).payload}catch(e){throw new an(e,["invalid poo"])}try{await Jh(e,{iss:"dest",proofType:"PoR",exchange:i},{timestamp:"iat",notBefore:1e3*c.iat,notAfter:1e3*c.iat+i.pooToPorDelay})}catch(e){throw new an(e,["invalid por"])}try{const e=await t.getSecretFromLedger(Xi(i.encAlg),i.ledgerSignerAddress,i.id,r);u=e.hex,f=e.iat}catch(e){throw new an(e,["cannot verify"])}try{no(1e3*f,1e3*n.iat,1e3*c.iat+i.pooToSecretDelay)}catch(e){throw new an(`Although the secret has been obtained (and you could try to decrypt the cipherblock), it's been published later than agreed: ${new Date(1e3*f).toUTCString()} > ${new Date(1e3*c.iat+i.pooToSecretDelay).toUTCString()}`,["secret not published in time"])}return{pooPayload:c,porPayload:n,secretHex:u,destPublicJwk:a,origPublicJwk:s}}async function Vh(e,t,r=10){let n,i,o,a,s;try{n=(await Zi(e)).payload}catch(e){throw new an(e,["invalid verification request"])}try{const e=await Gh(n.por,t,r);i=e.destPublicJwk,o=e.origPublicJwk,a=e.pooPayload,s=e.porPayload}catch(e){throw new an(e,["invalid por","invalid verification request"])}try{await Zi(e,"dest"===n.iss?i:o)}catch(e){throw new an(e,["invalid verification request"])}return{pooPayload:a,porPayload:s,vrPayload:n,destPublicJwk:i,origPublicJwk:o}}async function Zh(e,t){const{payload:r}=await Zi(e),{destPublicJwk:i,origPublicJwk:o,secretHex:a,pooPayload:s,porPayload:c}=await Gh(r.por,t);try{await Zi(e,i)}catch(e){throw e instanceof an&&e.add("invalid dispute request"),e}if(n(await so(r.cipherblock,c.exchange.hashAlg),!0,!1)!==c.exchange.cipherblockDgst)throw new an(new Error("cipherblock does not meet the committed (and already accepted) one"),["invalid dispute request"]);return await Vi(r.cipherblock,(await Qi(c.exchange.encAlg,a)).jwk),{pooPayload:s,porPayload:c,drPayload:r,destPublicJwk:i,origPublicJwk:o}}async function Xh(e,t,r,n){const i={proofType:"request",iss:e,dataExchangeId:t,por:r,type:"verificationRequest",iat:Math.floor(Date.now()/1e3)},o=await mi(n);return await new Hi(i).setProtectedHeader({alg:n.alg}).setIssuedAt(i.iat).sign(o)}var Qh=Object.freeze({__proto__:null,ConflictResolver:class{constructor(e,t){this.jwkPair=e,this.dltAgent=t,this.initialized=new Promise(((e,t)=>{this.init().then((()=>{e(!0)})).catch((e=>{t(e)}))}))}async init(){await Yi(this.jwkPair.publicJwk,this.jwkPair.privateJwk)}async resolveCompleteness(e){await this.initialized;const{payload:t}=await Zi(e);let r;try{r=(await Zi(t.por)).payload}catch(e){throw new an(e,["invalid por"])}const n={...await this._resolution(t.dataExchangeId,r.exchange[t.iss]),resolution:"not completed",type:"verification"};try{await Vh(e,this.dltAgent),n.resolution="completed"}catch(e){if(!(e instanceof an)||e.nrErrors.includes("invalid verification request")||e.nrErrors.includes("unexpected error"))throw e}const i=await mi(this.jwkPair.privateJwk);return await new Hi(n).setProtectedHeader({alg:this.jwkPair.privateJwk.alg}).setIssuedAt(n.iat).sign(i)}async resolveDispute(e){await this.initialized;const{payload:t}=await Zi(e);let r;try{r=(await Zi(t.por)).payload}catch(e){throw new an(e,["invalid por"])}const n={...await this._resolution(t.dataExchangeId,r.exchange[t.iss]),resolution:"denied",type:"dispute"};try{await Zh(e,this.dltAgent)}catch(e){if(!(e instanceof an&&e.nrErrors.includes("decryption failed")))throw new an(e,["cannot verify"]);n.resolution="accepted"}const i=await mi(this.jwkPair.privateJwk);return await new Hi(n).setProtectedHeader({alg:this.jwkPair.privateJwk.alg}).setIssuedAt(n.iat).sign(i)}async _resolution(e,t){return{proofType:"resolution",dataExchangeId:e,iat:Math.floor(Date.now()/1e3),iss:await ao(this.jwkPair.publicJwk,!0),sub:t}}},checkCompleteness:Vh,checkDecryption:Zh,generateVerificationRequest:Xh,verifyPor:Gh,verifyResolution:async function(e,t){return await Zi(e,t??((e,t)=>JSON.parse(t.iss)))}});const Yh={gasLimit:125e5,contract:{address:"0x8d407A1722633bDD1dcf221474be7a44C05d7c2F",abi:[{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"sender",type:"address"},{indexed:!1,internalType:"uint256",name:"dataExchangeId",type:"uint256"},{indexed:!1,internalType:"uint256",name:"timestamp",type:"uint256"},{indexed:!1,internalType:"uint256",name:"secret",type:"uint256"}],name:"Registration",type:"event"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"uint256",name:"",type:"uint256"}],name:"registry",outputs:[{internalType:"uint256",name:"timestamp",type:"uint256"},{internalType:"uint256",name:"secret",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"_dataExchangeId",type:"uint256"},{internalType:"uint256",name:"_secret",type:"uint256"}],name:"setRegistry",outputs:[],stateMutability:"nonpayable",type:"function"}],transactionHash:"0x6a3828f8fe232819dc40ca66f93930b3bd1619db31a67ec34b44446b3e7c8289",receipt:{to:null,from:"0x17bd12C2134AfC1f6E9302a532eFE30C19B9E903",contractAddress:"0x8d407A1722633bDD1dcf221474be7a44C05d7c2F",transactionIndex:0,gasUsed:"253928",logsBloom:"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",blockHash:"0x0118672bb9b27679e616831d056d36291dd20cfe88c3ee2abd8f2dfce579cad4",transactionHash:"0x6a3828f8fe232819dc40ca66f93930b3bd1619db31a67ec34b44446b3e7c8289",logs:[],blockNumber:119389,cumulativeGasUsed:"253928",status:1,byzantium:!0},args:[],solcInputHash:"c528a37588793ef74285d75e08d6b8eb",metadata:'{"compiler":{"version":"0.8.4+commit.c7e474f2"},"language":"Solidity","output":{"abi":[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"dataExchangeId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"secret","type":"uint256"}],"name":"Registration","type":"event"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"registry","outputs":[{"internalType":"uint256","name":"timestamp","type":"uint256"},{"internalType":"uint256","name":"secret","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_dataExchangeId","type":"uint256"},{"internalType":"uint256","name":"_secret","type":"uint256"}],"name":"setRegistry","outputs":[],"stateMutability":"nonpayable","type":"function"}],"devdoc":{"kind":"dev","methods":{},"version":1},"userdoc":{"kind":"user","methods":{},"version":1}},"settings":{"compilationTarget":{"contracts/NonRepudiation.sol":"NonRepudiation"},"evmVersion":"istanbul","libraries":{},"metadata":{"bytecodeHash":"ipfs","useLiteralContent":true},"optimizer":{"enabled":false,"runs":200},"remappings":[]},"sources":{"contracts/NonRepudiation.sol":{"content":"//SPDX-License-Identifier: Unlicense\\npragma solidity ^0.8.0;\\n\\ncontract NonRepudiation {\\n struct Proof {\\n uint256 timestamp;\\n uint256 secret;\\n }\\n mapping(address => mapping (uint256 => Proof)) public registry;\\n event Registration(address sender, uint256 dataExchangeId, uint256 timestamp, uint256 secret);\\n\\n function setRegistry(uint256 _dataExchangeId, uint256 _secret) public {\\n require(registry[msg.sender][_dataExchangeId].secret == 0);\\n registry[msg.sender][_dataExchangeId] = Proof(block.timestamp, _secret);\\n emit Registration(msg.sender, _dataExchangeId, block.timestamp, _secret);\\n }\\n}\\n","keccak256":"0x8d371257a9b03c9102f158323e61f56ce49dd8489bd92c5a7d8abc3d9f6f8399","license":"Unlicense"}},"version":1}',bytecode:"0x608060405234801561001057600080fd5b506103a2806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c8063032439371461003b578063d05cb54514610057575b600080fd5b6100556004803603810190610050919061023a565b610088565b005b610071600480360381019061006c91906101fe565b6101a3565b60405161007f9291906102d9565b60405180910390f35b60008060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002060010154146100e757600080fd5b6040518060400160405280428152602001828152506000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002060008201518160000155602082015181600101559050507faa58599838af2e5e0f3251cfbb4eac5d5d447ded49f6b0ac28d6b44098224e63338342846040516101979493929190610294565b60405180910390a15050565b6000602052816000526040600020602052806000526040600020600091509150508060000154908060010154905082565b6000813590506101e38161033e565b92915050565b6000813590506101f881610355565b92915050565b6000806040838503121561021157600080fd5b600061021f858286016101d4565b9250506020610230858286016101e9565b9150509250929050565b6000806040838503121561024d57600080fd5b600061025b858286016101e9565b925050602061026c858286016101e9565b9150509250929050565b61027f81610302565b82525050565b61028e81610334565b82525050565b60006080820190506102a96000830187610276565b6102b66020830186610285565b6102c36040830185610285565b6102d06060830184610285565b95945050505050565b60006040820190506102ee6000830185610285565b6102fb6020830184610285565b9392505050565b600061030d82610314565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b61034781610302565b811461035257600080fd5b50565b61035e81610334565b811461036957600080fd5b5056fea26469706673582212204fd0fc653fb487221da9a14a4ca5d5499f9e9bc7b27ac8ab0f8d397fd6e3148564736f6c63430008040033",deployedBytecode:"0x608060405234801561001057600080fd5b50600436106100365760003560e01c8063032439371461003b578063d05cb54514610057575b600080fd5b6100556004803603810190610050919061023a565b610088565b005b610071600480360381019061006c91906101fe565b6101a3565b60405161007f9291906102d9565b60405180910390f35b60008060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002060010154146100e757600080fd5b6040518060400160405280428152602001828152506000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002060008201518160000155602082015181600101559050507faa58599838af2e5e0f3251cfbb4eac5d5d447ded49f6b0ac28d6b44098224e63338342846040516101979493929190610294565b60405180910390a15050565b6000602052816000526040600020602052806000526040600020600091509150508060000154908060010154905082565b6000813590506101e38161033e565b92915050565b6000813590506101f881610355565b92915050565b6000806040838503121561021157600080fd5b600061021f858286016101d4565b9250506020610230858286016101e9565b9150509250929050565b6000806040838503121561024d57600080fd5b600061025b858286016101e9565b925050602061026c858286016101e9565b9150509250929050565b61027f81610302565b82525050565b61028e81610334565b82525050565b60006080820190506102a96000830187610276565b6102b66020830186610285565b6102c36040830185610285565b6102d06060830184610285565b95945050505050565b60006040820190506102ee6000830185610285565b6102fb6020830184610285565b9392505050565b600061030d82610314565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b61034781610302565b811461035257600080fd5b50565b61035e81610334565b811461036957600080fd5b5056fea26469706673582212204fd0fc653fb487221da9a14a4ca5d5499f9e9bc7b27ac8ab0f8d397fd6e3148564736f6c63430008040033",devdoc:{kind:"dev",methods:{},version:1},userdoc:{kind:"user",methods:{},version:1},storageLayout:{storage:[{astId:13,contract:"contracts/NonRepudiation.sol:NonRepudiation",label:"registry",offset:0,slot:"0",type:"t_mapping(t_address,t_mapping(t_uint256,t_struct(Proof)6_storage))"}],types:{t_address:{encoding:"inplace",label:"address",numberOfBytes:"20"},"t_mapping(t_address,t_mapping(t_uint256,t_struct(Proof)6_storage))":{encoding:"mapping",key:"t_address",label:"mapping(address => mapping(uint256 => struct NonRepudiation.Proof))",numberOfBytes:"32",value:"t_mapping(t_uint256,t_struct(Proof)6_storage)"},"t_mapping(t_uint256,t_struct(Proof)6_storage)":{encoding:"mapping",key:"t_uint256",label:"mapping(uint256 => struct NonRepudiation.Proof)",numberOfBytes:"32",value:"t_struct(Proof)6_storage"},"t_struct(Proof)6_storage":{encoding:"inplace",label:"struct NonRepudiation.Proof",members:[{astId:3,contract:"contracts/NonRepudiation.sol:NonRepudiation",label:"timestamp",offset:0,slot:"0",type:"t_uint256"},{astId:5,contract:"contracts/NonRepudiation.sol:NonRepudiation",label:"secret",offset:0,slot:"1",type:"t_uint256"}],numberOfBytes:"64"},t_uint256:{encoding:"inplace",label:"uint256",numberOfBytes:"32"}}}}};async function ep(e,t,r,n,o){let s=Zo.from(0),c=Zo.from(0);const u=oo(a(i(r)),!0);let f=0;do{try{({secret:s,timestamp:c}=await e.registry(oo(t,!0),u))}catch(e){throw new an(e,["cannot contact the ledger"])}s.isZero()&&(f++,await new Promise((e=>setTimeout(e,1e3))))}while(s.isZero()&&f{null!==e&&"object"==typeof e&&"function"==typeof e.then?e.then((e=>{this.dltConfig={...Yh,...e},this.provider=new Ch(this.dltConfig.rpcProviderUrl),this.contract=new ed(this.dltConfig.contract.address,this.dltConfig.contract.abi,this.provider),t(!0)})).catch((e=>r(e))):(this.dltConfig={...Yh,...e},this.provider=new Ch(this.dltConfig.rpcProviderUrl),this.contract=new ed(this.dltConfig.contract.address,this.dltConfig.contract.abi,this.provider),t(!0))}))}async getContractAddress(){return await this.initialized,this.contract.address}}class ip extends np{async getSecretFromLedger(e,t,r,n){return await this.initialized,await ep(this.contract,t,r,n,e)}}class op extends np{constructor(e,t,r){const n=new Promise(((t,n)=>{e.providerinfo.get().then((e=>{const i=e.rpcUrl;void 0===i?n(new Error("wallet is not connected to RPC endpoint")):t({...r,rpcProviderUrl:"string"==typeof i?i:i[0]})})).catch((e=>{n(e)}))}));super(n),this.wallet=e,this.did=t}}class ap extends op{async getSecretFromLedger(e,t,r,n){return await this.initialized,await ep(this.contract,t,r,n,e)}}class sp extends np{constructor(e,t,r){const n=new Promise(((t,n)=>{e.providerinfoGet().then((e=>{const i=e.rpcUrl;void 0===i?n(new Error("wallet is not connected to RPC endpoint")):t({...r,rpcProviderUrl:"string"==typeof i?i:i[0]})})).catch((e=>{n(e)}))}));super(n),this.wallet=e,this.did=t}}class cp extends sp{async getSecretFromLedger(e,t,r,n){return await this.initialized,await ep(this.contract,t,r,n,e)}}var up={},fp=d(wu),dp=d(_s),lp=d(vc),hp=d(od),pp=d(qo),mp=d(du),gp=d(Nd),yp=d(ll),bp=d(os),vp=d(Ao),wp=d(fd),Ap=d($h),_p=d($d),Ep=d(xa),Sp=d(ps),Pp=d(Af),xp=d(sc),kp=d(Ff),Mp=d(Lh),Cp=d(gl),Ip=d(Ol);!function(e){var t=u&&u.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),r=u&&u.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=u&&u.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&t(n,e,i);return r(n,e),n};Object.defineProperty(e,"__esModule",{value:!0}),e.formatBytes32String=e.Utf8ErrorFuncs=e.toUtf8String=e.toUtf8CodePoints=e.toUtf8Bytes=e._toEscapedUtf8String=e.nameprep=e.hexDataSlice=e.hexDataLength=e.hexZeroPad=e.hexValue=e.hexStripZeros=e.hexConcat=e.isHexString=e.hexlify=e.base64=e.base58=e.TransactionDescription=e.LogDescription=e.Interface=e.SigningKey=e.HDNode=e.defaultPath=e.isBytesLike=e.isBytes=e.zeroPad=e.stripZeros=e.concat=e.arrayify=e.shallowCopy=e.resolveProperties=e.getStatic=e.defineReadOnly=e.deepCopy=e.checkProperties=e.poll=e.fetchJson=e._fetchData=e.RLP=e.Logger=e.checkResultErrors=e.FormatTypes=e.ParamType=e.FunctionFragment=e.EventFragment=e.ErrorFragment=e.ConstructorFragment=e.Fragment=e.defaultAbiCoder=e.AbiCoder=void 0,e.Indexed=e.Utf8ErrorReason=e.UnicodeNormalizationForm=e.SupportedAlgorithm=e.mnemonicToSeed=e.isValidMnemonic=e.entropyToMnemonic=e.mnemonicToEntropy=e.getAccountPath=e.verifyTypedData=e.verifyMessage=e.recoverPublicKey=e.computePublicKey=e.recoverAddress=e.computeAddress=e.getJsonWalletAddress=e.TransactionTypes=e.serializeTransaction=e.parseTransaction=e.accessListify=e.joinSignature=e.splitSignature=e.soliditySha256=e.solidityKeccak256=e.solidityPack=e.shuffled=e.randomBytes=e.sha512=e.sha256=e.ripemd160=e.keccak256=e.computeHmac=e.commify=e.parseUnits=e.formatUnits=e.parseEther=e.formatEther=e.isAddress=e.getCreate2Address=e.getContractAddress=e.getIcapAddress=e.getAddress=e._TypedDataEncoder=e.id=e.isValidName=e.namehash=e.hashMessage=e.dnsEncode=e.parseBytes32String=void 0;var i=fp;Object.defineProperty(e,"AbiCoder",{enumerable:!0,get:function(){return i.AbiCoder}}),Object.defineProperty(e,"checkResultErrors",{enumerable:!0,get:function(){return i.checkResultErrors}}),Object.defineProperty(e,"ConstructorFragment",{enumerable:!0,get:function(){return i.ConstructorFragment}}),Object.defineProperty(e,"defaultAbiCoder",{enumerable:!0,get:function(){return i.defaultAbiCoder}}),Object.defineProperty(e,"ErrorFragment",{enumerable:!0,get:function(){return i.ErrorFragment}}),Object.defineProperty(e,"EventFragment",{enumerable:!0,get:function(){return i.EventFragment}}),Object.defineProperty(e,"FormatTypes",{enumerable:!0,get:function(){return i.FormatTypes}}),Object.defineProperty(e,"Fragment",{enumerable:!0,get:function(){return i.Fragment}}),Object.defineProperty(e,"FunctionFragment",{enumerable:!0,get:function(){return i.FunctionFragment}}),Object.defineProperty(e,"Indexed",{enumerable:!0,get:function(){return i.Indexed}}),Object.defineProperty(e,"Interface",{enumerable:!0,get:function(){return i.Interface}}),Object.defineProperty(e,"LogDescription",{enumerable:!0,get:function(){return i.LogDescription}}),Object.defineProperty(e,"ParamType",{enumerable:!0,get:function(){return i.ParamType}}),Object.defineProperty(e,"TransactionDescription",{enumerable:!0,get:function(){return i.TransactionDescription}});var o=dp;Object.defineProperty(e,"getAddress",{enumerable:!0,get:function(){return o.getAddress}}),Object.defineProperty(e,"getCreate2Address",{enumerable:!0,get:function(){return o.getCreate2Address}}),Object.defineProperty(e,"getContractAddress",{enumerable:!0,get:function(){return o.getContractAddress}}),Object.defineProperty(e,"getIcapAddress",{enumerable:!0,get:function(){return o.getIcapAddress}}),Object.defineProperty(e,"isAddress",{enumerable:!0,get:function(){return o.isAddress}});var a=n(lp);e.base64=a;var s=hp;Object.defineProperty(e,"base58",{enumerable:!0,get:function(){return s.Base58}});var c=pp;Object.defineProperty(e,"arrayify",{enumerable:!0,get:function(){return c.arrayify}}),Object.defineProperty(e,"concat",{enumerable:!0,get:function(){return c.concat}}),Object.defineProperty(e,"hexConcat",{enumerable:!0,get:function(){return c.hexConcat}}),Object.defineProperty(e,"hexDataSlice",{enumerable:!0,get:function(){return c.hexDataSlice}}),Object.defineProperty(e,"hexDataLength",{enumerable:!0,get:function(){return c.hexDataLength}}),Object.defineProperty(e,"hexlify",{enumerable:!0,get:function(){return c.hexlify}}),Object.defineProperty(e,"hexStripZeros",{enumerable:!0,get:function(){return c.hexStripZeros}}),Object.defineProperty(e,"hexValue",{enumerable:!0,get:function(){return c.hexValue}}),Object.defineProperty(e,"hexZeroPad",{enumerable:!0,get:function(){return c.hexZeroPad}}),Object.defineProperty(e,"isBytes",{enumerable:!0,get:function(){return c.isBytes}}),Object.defineProperty(e,"isBytesLike",{enumerable:!0,get:function(){return c.isBytesLike}}),Object.defineProperty(e,"isHexString",{enumerable:!0,get:function(){return c.isHexString}}),Object.defineProperty(e,"joinSignature",{enumerable:!0,get:function(){return c.joinSignature}}),Object.defineProperty(e,"zeroPad",{enumerable:!0,get:function(){return c.zeroPad}}),Object.defineProperty(e,"splitSignature",{enumerable:!0,get:function(){return c.splitSignature}}),Object.defineProperty(e,"stripZeros",{enumerable:!0,get:function(){return c.stripZeros}});var f=mp;Object.defineProperty(e,"_TypedDataEncoder",{enumerable:!0,get:function(){return f._TypedDataEncoder}}),Object.defineProperty(e,"dnsEncode",{enumerable:!0,get:function(){return f.dnsEncode}}),Object.defineProperty(e,"hashMessage",{enumerable:!0,get:function(){return f.hashMessage}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return f.id}}),Object.defineProperty(e,"isValidName",{enumerable:!0,get:function(){return f.isValidName}}),Object.defineProperty(e,"namehash",{enumerable:!0,get:function(){return f.namehash}});var d=gp;Object.defineProperty(e,"defaultPath",{enumerable:!0,get:function(){return d.defaultPath}}),Object.defineProperty(e,"entropyToMnemonic",{enumerable:!0,get:function(){return d.entropyToMnemonic}}),Object.defineProperty(e,"getAccountPath",{enumerable:!0,get:function(){return d.getAccountPath}}),Object.defineProperty(e,"HDNode",{enumerable:!0,get:function(){return d.HDNode}}),Object.defineProperty(e,"isValidMnemonic",{enumerable:!0,get:function(){return d.isValidMnemonic}}),Object.defineProperty(e,"mnemonicToEntropy",{enumerable:!0,get:function(){return d.mnemonicToEntropy}}),Object.defineProperty(e,"mnemonicToSeed",{enumerable:!0,get:function(){return d.mnemonicToSeed}});var l=yp;Object.defineProperty(e,"getJsonWalletAddress",{enumerable:!0,get:function(){return l.getJsonWalletAddress}});var h=bp;Object.defineProperty(e,"keccak256",{enumerable:!0,get:function(){return h.keccak256}});var p=vp;Object.defineProperty(e,"Logger",{enumerable:!0,get:function(){return p.Logger}});var m=wp;Object.defineProperty(e,"computeHmac",{enumerable:!0,get:function(){return m.computeHmac}}),Object.defineProperty(e,"ripemd160",{enumerable:!0,get:function(){return m.ripemd160}}),Object.defineProperty(e,"sha256",{enumerable:!0,get:function(){return m.sha256}}),Object.defineProperty(e,"sha512",{enumerable:!0,get:function(){return m.sha512}});var g=Ap;Object.defineProperty(e,"solidityKeccak256",{enumerable:!0,get:function(){return g.keccak256}}),Object.defineProperty(e,"solidityPack",{enumerable:!0,get:function(){return g.pack}}),Object.defineProperty(e,"soliditySha256",{enumerable:!0,get:function(){return g.sha256}});var y=_p;Object.defineProperty(e,"randomBytes",{enumerable:!0,get:function(){return y.randomBytes}}),Object.defineProperty(e,"shuffled",{enumerable:!0,get:function(){return y.shuffled}});var b=Ep;Object.defineProperty(e,"checkProperties",{enumerable:!0,get:function(){return b.checkProperties}}),Object.defineProperty(e,"deepCopy",{enumerable:!0,get:function(){return b.deepCopy}}),Object.defineProperty(e,"defineReadOnly",{enumerable:!0,get:function(){return b.defineReadOnly}}),Object.defineProperty(e,"getStatic",{enumerable:!0,get:function(){return b.getStatic}}),Object.defineProperty(e,"resolveProperties",{enumerable:!0,get:function(){return b.resolveProperties}}),Object.defineProperty(e,"shallowCopy",{enumerable:!0,get:function(){return b.shallowCopy}});var v=n(Sp);e.RLP=v;var w=Pp;Object.defineProperty(e,"computePublicKey",{enumerable:!0,get:function(){return w.computePublicKey}}),Object.defineProperty(e,"recoverPublicKey",{enumerable:!0,get:function(){return w.recoverPublicKey}}),Object.defineProperty(e,"SigningKey",{enumerable:!0,get:function(){return w.SigningKey}});var A=xp;Object.defineProperty(e,"formatBytes32String",{enumerable:!0,get:function(){return A.formatBytes32String}}),Object.defineProperty(e,"nameprep",{enumerable:!0,get:function(){return A.nameprep}}),Object.defineProperty(e,"parseBytes32String",{enumerable:!0,get:function(){return A.parseBytes32String}}),Object.defineProperty(e,"_toEscapedUtf8String",{enumerable:!0,get:function(){return A._toEscapedUtf8String}}),Object.defineProperty(e,"toUtf8Bytes",{enumerable:!0,get:function(){return A.toUtf8Bytes}}),Object.defineProperty(e,"toUtf8CodePoints",{enumerable:!0,get:function(){return A.toUtf8CodePoints}}),Object.defineProperty(e,"toUtf8String",{enumerable:!0,get:function(){return A.toUtf8String}}),Object.defineProperty(e,"Utf8ErrorFuncs",{enumerable:!0,get:function(){return A.Utf8ErrorFuncs}});var _=kp;Object.defineProperty(e,"accessListify",{enumerable:!0,get:function(){return _.accessListify}}),Object.defineProperty(e,"computeAddress",{enumerable:!0,get:function(){return _.computeAddress}}),Object.defineProperty(e,"parseTransaction",{enumerable:!0,get:function(){return _.parse}}),Object.defineProperty(e,"recoverAddress",{enumerable:!0,get:function(){return _.recoverAddress}}),Object.defineProperty(e,"serializeTransaction",{enumerable:!0,get:function(){return _.serialize}}),Object.defineProperty(e,"TransactionTypes",{enumerable:!0,get:function(){return _.TransactionTypes}});var E=Mp;Object.defineProperty(e,"commify",{enumerable:!0,get:function(){return E.commify}}),Object.defineProperty(e,"formatEther",{enumerable:!0,get:function(){return E.formatEther}}),Object.defineProperty(e,"parseEther",{enumerable:!0,get:function(){return E.parseEther}}),Object.defineProperty(e,"formatUnits",{enumerable:!0,get:function(){return E.formatUnits}}),Object.defineProperty(e,"parseUnits",{enumerable:!0,get:function(){return E.parseUnits}});var S=Cp;Object.defineProperty(e,"verifyMessage",{enumerable:!0,get:function(){return S.verifyMessage}}),Object.defineProperty(e,"verifyTypedData",{enumerable:!0,get:function(){return S.verifyTypedData}});var P=Ip;Object.defineProperty(e,"_fetchData",{enumerable:!0,get:function(){return P._fetchData}}),Object.defineProperty(e,"fetchJson",{enumerable:!0,get:function(){return P.fetchJson}}),Object.defineProperty(e,"poll",{enumerable:!0,get:function(){return P.poll}});var x=wp;Object.defineProperty(e,"SupportedAlgorithm",{enumerable:!0,get:function(){return x.SupportedAlgorithm}});var k=xp;Object.defineProperty(e,"UnicodeNormalizationForm",{enumerable:!0,get:function(){return k.UnicodeNormalizationForm}}),Object.defineProperty(e,"Utf8ErrorReason",{enumerable:!0,get:function(){return k.Utf8ErrorReason}})}(up);class Rp extends np{constructor(e,t){let r;super(e),this.count=-1,r=void 0===t?function(e,t=!1){if(e<1)throw new RangeError("byteLength MUST be > 0");{const r=new Uint8Array(e);if(e<=65536)self.crypto.getRandomValues(r);else for(let t=0;tthis.count&&(this.count=e),this.count}}class Np extends op{constructor(){super(...arguments),this.count=-1}async deploySecret(e,t){await this.initialized;const r=await tp(e,t,this),n=(await this.wallet.identities.sign({did:this.did},{type:"Transaction",data:r})).signature,i=await this.provider.sendTransaction(n);return this.count=this.count+1,i.hash}async getAddress(){await this.initialized;const e=await this.wallet.identities.info({did:this.did});if(void 0===e.addresses)throw new an(new Error("no addresses for did "+this.did),["unexpected error"]);return e.addresses[0]}async nextNonce(){await this.initialized;const e=await this.provider.getTransactionCount(await this.getAddress(),"pending");return e>this.count&&(this.count=e),this.count}}class Op extends sp{constructor(){super(...arguments),this.count=-1}async deploySecret(e,t){await this.initialized;const r=await tp(e,t,this),n=(await this.wallet.identitySign({did:this.did},{type:"Transaction",data:r})).signature,i=await this.provider.sendTransaction(n);return this.count=this.count+1,i.hash}async getAddress(){await this.initialized;const e=await this.wallet.identityInfo({did:this.did});if(void 0===e.addresses)throw new an(`Can't get address for did: ${this.did}`,["unexpected error"]);return e.addresses[0]}async nextNonce(){await this.initialized;const e=await this.provider.getTransactionCount(await this.getAddress(),"pending");return e>this.count&&(this.count=e),this.count}}var Tp=Object.freeze({__proto__:null,EthersIoAgentDest:ip,EthersIoAgentOrig:Rp,I3mServerWalletAgentDest:cp,I3mServerWalletAgentOrig:Op,I3mWalletAgentDest:ap,I3mWalletAgentOrig:Np}),jp={schemas:{IdentitySelectOutput:{title:"IdentitySelectOutput",type:"object",properties:{did:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},required:["did"]},SignInput:{title:"SignInput",oneOf:[{title:"SignTransaction",type:"object",properties:{type:{enum:["Transaction"]},data:{title:"Transaction",type:"object",additionalProperties:!0,properties:{from:{type:"string"},to:{type:"string"},nonce:{type:"number"}}}},required:["type","data"]},{title:"SignRaw",type:"object",properties:{type:{enum:["Raw"]},data:{type:"object",properties:{payload:{description:"Base64Url encoded data to sign",type:"string",pattern:"^[A-Za-z0-9_-]+$"}},required:["payload"]}},required:["type","data"]},{title:"SignJWT",type:"object",properties:{type:{enum:["JWT"]},data:{type:"object",properties:{header:{description:'header fields to be added to the JWS header. "alg" and "kid" will be ignored since they are automatically added by the wallet.',type:"object",additionalProperties:!0},payload:{description:"A JSON object to be signed by the wallet. It will become the payload of the generated JWS. 'iss' (issuer) and 'iat' (issued at) will be automatically added by the wallet and will override provided values.",type:"object",additionalProperties:!0}},required:["payload"]}},required:["type","data"]}]},SignRaw:{title:"SignRaw",type:"object",properties:{type:{enum:["Raw"]},data:{type:"object",properties:{payload:{description:"Base64Url encoded data to sign",type:"string",pattern:"^[A-Za-z0-9_-]+$"}},required:["payload"]}},required:["type","data"]},SignTransaction:{title:"SignTransaction",type:"object",properties:{type:{enum:["Transaction"]},data:{title:"Transaction",type:"object",additionalProperties:!0,properties:{from:{type:"string"},to:{type:"string"},nonce:{type:"number"}}}},required:["type","data"]},SignJWT:{title:"SignJWT",type:"object",properties:{type:{enum:["JWT"]},data:{type:"object",properties:{header:{description:'header fields to be added to the JWS header. "alg" and "kid" will be ignored since they are automatically added by the wallet.',type:"object",additionalProperties:!0},payload:{description:"A JSON object to be signed by the wallet. It will become the payload of the generated JWS. 'iss' (issuer) and 'iat' (issued at) will be automatically added by the wallet and will override provided values.",type:"object",additionalProperties:!0}},required:["payload"]}},required:["type","data"]},Transaction:{title:"Transaction",type:"object",additionalProperties:!0,properties:{from:{type:"string"},to:{type:"string"},nonce:{type:"number"}}},SignOutput:{title:"SignOutput",type:"object",properties:{signature:{type:"string"}},required:["signature"]},Receipt:{title:"Receipt",type:"object",properties:{receipt:{type:"string"}},required:["receipt"]},SignTypes:{title:"SignTypes",type:"string",enum:["Transaction","Raw","JWT"]},IdentityListInput:{title:"IdentityListInput",description:"A list of DIDs",type:"array",items:{type:"object",properties:{did:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},required:["did"]}},IdentityCreateInput:{title:"IdentityCreateInput",description:'Besides the here defined options, provider specific properties should be added here if necessary, e.g. "path" for BIP21 wallets, or the key algorithm (if the wallet supports multiple algorithm).\n',type:"object",properties:{alias:{type:"string"}},additionalProperties:!0},IdentityCreateOutput:{title:"IdentityCreateOutput",description:"It returns the account id and type\n",type:"object",properties:{did:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},additionalProperties:!0,required:["did"]},ResourceListOutput:{title:"ResourceListOutput",description:"A list of resources",type:"array",items:{title:"Resource",anyOf:[{title:"VerifiableCredential",type:"object",properties:{type:{example:"VerifiableCredential",enum:["VerifiableCredential"]},name:{type:"string",example:"Resource name"},resource:{type:"object",properties:{"@context":{type:"array",items:{type:"string"},example:["https://www.w3.org/2018/credentials/v1"]},id:{type:"string",example:"http://example.edu/credentials/1872"},type:{type:"array",items:{type:"string"},example:["VerifiableCredential"]},issuer:{type:"object",properties:{id:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},additionalProperties:!0,required:["id"]},issuanceDate:{type:"string",format:"date-time",example:"2021-06-10T19:07:28.000Z"},credentialSubject:{type:"object",properties:{id:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},required:["id"],additionalProperties:!0},proof:{type:"object",properties:{type:{type:"string",enum:["JwtProof2020"]}},required:["type"],additionalProperties:!0}},additionalProperties:!0,required:["@context","type","issuer","issuanceDate","credentialSubject","proof"]}},required:["type","resource"]},{title:"ObjectResource",type:"object",properties:{type:{example:"Object",enum:["Object"]},name:{type:"string",example:"Resource name"},parentResource:{type:"string"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",additionalProperties:!0}},required:["type","resource"]},{title:"JWK pair",type:"object",properties:{type:{example:"KeyPair",enum:["KeyPair"]},name:{type:"string",example:"Resource name"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",properties:{keyPair:{type:"object",properties:{privateJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents a private key (complementary to `publicJwk`)\n",example:'{"alg":"ES256","crv":"P-256","d":"rQp_3eZzvXwt1sK7WWsRhVYipqNGblzYDKKaYirlqs0","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'},publicJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents the public key (complementary to `privateJwk`).\n",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'}},required:["privateJwk","publicJwk"]}},required:["keyPair"]}},required:["type","resource"]},{title:"Contract",type:"object",properties:{type:{example:"Contract",enum:["Contract"]},name:{type:"string",example:"Resource name"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",properties:{dataSharingAgreement:{type:"object",required:["dataOfferingDescription","parties","purpose","duration","intendedUse","licenseGrant","dataStream","personalData","pricingModel","dataExchangeAgreement","signatures"],properties:{dataOfferingDescription:{type:"object",required:["dataOfferingId","version","active"],properties:{dataOfferingId:{type:"string"},version:{type:"integer"},category:{type:"string"},active:{type:"boolean"},title:{type:"string"}}},parties:{type:"object",required:["providerDid","consumerDid"],properties:{providerDid:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},consumerDid:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}}},purpose:{type:"string"},duration:{type:"object",required:["creationDate","startDate","endDate"],properties:{creationDate:{type:"integer"},startDate:{type:"integer"},endDate:{type:"integer"}}},intendedUse:{type:"object",required:["processData","shareDataWithThirdParty","editData"],properties:{processData:{type:"boolean"},shareDataWithThirdParty:{type:"boolean"},editData:{type:"boolean"}}},licenseGrant:{type:"object",required:["transferable","exclusiveness","paidUp","revocable","processing","modifying","analyzing","storingData","storingCopy","reproducing","distributing","loaning","selling","renting","furtherLicensing","leasing"],properties:{transferable:{type:"boolean"},exclusiveness:{type:"boolean"},paidUp:{type:"boolean"},revocable:{type:"boolean"},processing:{type:"boolean"},modifying:{type:"boolean"},analyzing:{type:"boolean"},storingData:{type:"boolean"},storingCopy:{type:"boolean"},reproducing:{type:"boolean"},distributing:{type:"boolean"},loaning:{type:"boolean"},selling:{type:"boolean"},renting:{type:"boolean"},furtherLicensing:{type:"boolean"},leasing:{type:"boolean"}}},dataStream:{type:"boolean"},personalData:{type:"boolean"},pricingModel:{type:"object",required:["basicPrice","currency","hasFreePrice"],properties:{paymentType:{type:"string"},pricingModelName:{type:"string"},basicPrice:{type:"number",format:"float"},currency:{type:"string"},fee:{type:"number",format:"float"},hasPaymentOnSubscription:{type:"object",properties:{paymentOnSubscriptionName:{type:"string"},paymentType:{type:"string"},timeDuration:{type:"string"},description:{type:"string"},repeat:{type:"string"},hasSubscriptionPrice:{type:"number"}}},hasFreePrice:{type:"object",properties:{hasPriceFree:{type:"boolean"}}}}},dataExchangeAgreement:{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},signatures:{type:"object",required:["providerSignature","consumerSignature"],properties:{providerSignature:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"},consumerSignature:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"}}}}},keyPair:{type:"object",properties:{privateJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents a private key (complementary to `publicJwk`)\n",example:'{"alg":"ES256","crv":"P-256","d":"rQp_3eZzvXwt1sK7WWsRhVYipqNGblzYDKKaYirlqs0","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'},publicJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents the public key (complementary to `privateJwk`).\n",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'}},required:["privateJwk","publicJwk"]}},required:["dataSharingAgreement"]}},required:["type","resource"]},{title:"NonRepudiationProof",type:"object",properties:{type:{example:"NonRepudiationProof",enum:["NonRepudiationProof"]},name:{type:"string",example:"Resource name"},resource:{description:"a non-repudiation proof (either a PoO, a PoR or a PoP) as a compact JWS"}},required:["type","resource"]},{title:"DataExchangeResource",type:"object",properties:{type:{example:"DataExchange",enum:["DataExchange"]},name:{type:"string",example:"Resource name"},resource:{allOf:[{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},{type:"object",properties:{cipherblockDgst:{type:"string",description:"hash of the cipherblock in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"},blockCommitment:{type:"string",description:"hash of the plaintext block in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"},secretCommitment:{type:"string",description:"ash of the secret that can be used to decrypt the block in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"}},required:["cipherblockDgst","blockCommitment","secretCommitment"]}]}},required:["type","resource"]}]}},Resource:{title:"Resource",anyOf:[{title:"VerifiableCredential",type:"object",properties:{type:{example:"VerifiableCredential",enum:["VerifiableCredential"]},name:{type:"string",example:"Resource name"},resource:{type:"object",properties:{"@context":{type:"array",items:{type:"string"},example:["https://www.w3.org/2018/credentials/v1"]},id:{type:"string",example:"http://example.edu/credentials/1872"},type:{type:"array",items:{type:"string"},example:["VerifiableCredential"]},issuer:{type:"object",properties:{id:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},additionalProperties:!0,required:["id"]},issuanceDate:{type:"string",format:"date-time",example:"2021-06-10T19:07:28.000Z"},credentialSubject:{type:"object",properties:{id:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},required:["id"],additionalProperties:!0},proof:{type:"object",properties:{type:{type:"string",enum:["JwtProof2020"]}},required:["type"],additionalProperties:!0}},additionalProperties:!0,required:["@context","type","issuer","issuanceDate","credentialSubject","proof"]}},required:["type","resource"]},{title:"ObjectResource",type:"object",properties:{type:{example:"Object",enum:["Object"]},name:{type:"string",example:"Resource name"},parentResource:{type:"string"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",additionalProperties:!0}},required:["type","resource"]},{title:"JWK pair",type:"object",properties:{type:{example:"KeyPair",enum:["KeyPair"]},name:{type:"string",example:"Resource name"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",properties:{keyPair:{type:"object",properties:{privateJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents a private key (complementary to `publicJwk`)\n",example:'{"alg":"ES256","crv":"P-256","d":"rQp_3eZzvXwt1sK7WWsRhVYipqNGblzYDKKaYirlqs0","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'},publicJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents the public key (complementary to `privateJwk`).\n",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'}},required:["privateJwk","publicJwk"]}},required:["keyPair"]}},required:["type","resource"]},{title:"Contract",type:"object",properties:{type:{example:"Contract",enum:["Contract"]},name:{type:"string",example:"Resource name"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",properties:{dataSharingAgreement:{type:"object",required:["dataOfferingDescription","parties","purpose","duration","intendedUse","licenseGrant","dataStream","personalData","pricingModel","dataExchangeAgreement","signatures"],properties:{dataOfferingDescription:{type:"object",required:["dataOfferingId","version","active"],properties:{dataOfferingId:{type:"string"},version:{type:"integer"},category:{type:"string"},active:{type:"boolean"},title:{type:"string"}}},parties:{type:"object",required:["providerDid","consumerDid"],properties:{providerDid:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},consumerDid:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}}},purpose:{type:"string"},duration:{type:"object",required:["creationDate","startDate","endDate"],properties:{creationDate:{type:"integer"},startDate:{type:"integer"},endDate:{type:"integer"}}},intendedUse:{type:"object",required:["processData","shareDataWithThirdParty","editData"],properties:{processData:{type:"boolean"},shareDataWithThirdParty:{type:"boolean"},editData:{type:"boolean"}}},licenseGrant:{type:"object",required:["transferable","exclusiveness","paidUp","revocable","processing","modifying","analyzing","storingData","storingCopy","reproducing","distributing","loaning","selling","renting","furtherLicensing","leasing"],properties:{transferable:{type:"boolean"},exclusiveness:{type:"boolean"},paidUp:{type:"boolean"},revocable:{type:"boolean"},processing:{type:"boolean"},modifying:{type:"boolean"},analyzing:{type:"boolean"},storingData:{type:"boolean"},storingCopy:{type:"boolean"},reproducing:{type:"boolean"},distributing:{type:"boolean"},loaning:{type:"boolean"},selling:{type:"boolean"},renting:{type:"boolean"},furtherLicensing:{type:"boolean"},leasing:{type:"boolean"}}},dataStream:{type:"boolean"},personalData:{type:"boolean"},pricingModel:{type:"object",required:["basicPrice","currency","hasFreePrice"],properties:{paymentType:{type:"string"},pricingModelName:{type:"string"},basicPrice:{type:"number",format:"float"},currency:{type:"string"},fee:{type:"number",format:"float"},hasPaymentOnSubscription:{type:"object",properties:{paymentOnSubscriptionName:{type:"string"},paymentType:{type:"string"},timeDuration:{type:"string"},description:{type:"string"},repeat:{type:"string"},hasSubscriptionPrice:{type:"number"}}},hasFreePrice:{type:"object",properties:{hasPriceFree:{type:"boolean"}}}}},dataExchangeAgreement:{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},signatures:{type:"object",required:["providerSignature","consumerSignature"],properties:{providerSignature:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"},consumerSignature:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"}}}}},keyPair:{type:"object",properties:{privateJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents a private key (complementary to `publicJwk`)\n",example:'{"alg":"ES256","crv":"P-256","d":"rQp_3eZzvXwt1sK7WWsRhVYipqNGblzYDKKaYirlqs0","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'},publicJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents the public key (complementary to `privateJwk`).\n",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'}},required:["privateJwk","publicJwk"]}},required:["dataSharingAgreement"]}},required:["type","resource"]},{title:"NonRepudiationProof",type:"object",properties:{type:{example:"NonRepudiationProof",enum:["NonRepudiationProof"]},name:{type:"string",example:"Resource name"},resource:{description:"a non-repudiation proof (either a PoO, a PoR or a PoP) as a compact JWS"}},required:["type","resource"]},{title:"DataExchangeResource",type:"object",properties:{type:{example:"DataExchange",enum:["DataExchange"]},name:{type:"string",example:"Resource name"},resource:{allOf:[{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},{type:"object",properties:{cipherblockDgst:{type:"string",description:"hash of the cipherblock in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"},blockCommitment:{type:"string",description:"hash of the plaintext block in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"},secretCommitment:{type:"string",description:"ash of the secret that can be used to decrypt the block in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"}},required:["cipherblockDgst","blockCommitment","secretCommitment"]}]}},required:["type","resource"]}]},VerifiableCredential:{title:"VerifiableCredential",type:"object",properties:{type:{example:"VerifiableCredential",enum:["VerifiableCredential"]},name:{type:"string",example:"Resource name"},resource:{type:"object",properties:{"@context":{type:"array",items:{type:"string"},example:["https://www.w3.org/2018/credentials/v1"]},id:{type:"string",example:"http://example.edu/credentials/1872"},type:{type:"array",items:{type:"string"},example:["VerifiableCredential"]},issuer:{type:"object",properties:{id:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},additionalProperties:!0,required:["id"]},issuanceDate:{type:"string",format:"date-time",example:"2021-06-10T19:07:28.000Z"},credentialSubject:{type:"object",properties:{id:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},required:["id"],additionalProperties:!0},proof:{type:"object",properties:{type:{type:"string",enum:["JwtProof2020"]}},required:["type"],additionalProperties:!0}},additionalProperties:!0,required:["@context","type","issuer","issuanceDate","credentialSubject","proof"]}},required:["type","resource"]},ObjectResource:{title:"ObjectResource",type:"object",properties:{type:{example:"Object",enum:["Object"]},name:{type:"string",example:"Resource name"},parentResource:{type:"string"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",additionalProperties:!0}},required:["type","resource"]},KeyPair:{title:"JWK pair",type:"object",properties:{type:{example:"KeyPair",enum:["KeyPair"]},name:{type:"string",example:"Resource name"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",properties:{keyPair:{type:"object",properties:{privateJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents a private key (complementary to `publicJwk`)\n",example:'{"alg":"ES256","crv":"P-256","d":"rQp_3eZzvXwt1sK7WWsRhVYipqNGblzYDKKaYirlqs0","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'},publicJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents the public key (complementary to `privateJwk`).\n",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'}},required:["privateJwk","publicJwk"]}},required:["keyPair"]}},required:["type","resource"]},Contract:{title:"Contract",type:"object",properties:{type:{example:"Contract",enum:["Contract"]},name:{type:"string",example:"Resource name"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",properties:{dataSharingAgreement:{type:"object",required:["dataOfferingDescription","parties","purpose","duration","intendedUse","licenseGrant","dataStream","personalData","pricingModel","dataExchangeAgreement","signatures"],properties:{dataOfferingDescription:{type:"object",required:["dataOfferingId","version","active"],properties:{dataOfferingId:{type:"string"},version:{type:"integer"},category:{type:"string"},active:{type:"boolean"},title:{type:"string"}}},parties:{type:"object",required:["providerDid","consumerDid"],properties:{providerDid:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},consumerDid:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}}},purpose:{type:"string"},duration:{type:"object",required:["creationDate","startDate","endDate"],properties:{creationDate:{type:"integer"},startDate:{type:"integer"},endDate:{type:"integer"}}},intendedUse:{type:"object",required:["processData","shareDataWithThirdParty","editData"],properties:{processData:{type:"boolean"},shareDataWithThirdParty:{type:"boolean"},editData:{type:"boolean"}}},licenseGrant:{type:"object",required:["transferable","exclusiveness","paidUp","revocable","processing","modifying","analyzing","storingData","storingCopy","reproducing","distributing","loaning","selling","renting","furtherLicensing","leasing"],properties:{transferable:{type:"boolean"},exclusiveness:{type:"boolean"},paidUp:{type:"boolean"},revocable:{type:"boolean"},processing:{type:"boolean"},modifying:{type:"boolean"},analyzing:{type:"boolean"},storingData:{type:"boolean"},storingCopy:{type:"boolean"},reproducing:{type:"boolean"},distributing:{type:"boolean"},loaning:{type:"boolean"},selling:{type:"boolean"},renting:{type:"boolean"},furtherLicensing:{type:"boolean"},leasing:{type:"boolean"}}},dataStream:{type:"boolean"},personalData:{type:"boolean"},pricingModel:{type:"object",required:["basicPrice","currency","hasFreePrice"],properties:{paymentType:{type:"string"},pricingModelName:{type:"string"},basicPrice:{type:"number",format:"float"},currency:{type:"string"},fee:{type:"number",format:"float"},hasPaymentOnSubscription:{type:"object",properties:{paymentOnSubscriptionName:{type:"string"},paymentType:{type:"string"},timeDuration:{type:"string"},description:{type:"string"},repeat:{type:"string"},hasSubscriptionPrice:{type:"number"}}},hasFreePrice:{type:"object",properties:{hasPriceFree:{type:"boolean"}}}}},dataExchangeAgreement:{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},signatures:{type:"object",required:["providerSignature","consumerSignature"],properties:{providerSignature:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"},consumerSignature:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"}}}}},keyPair:{type:"object",properties:{privateJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents a private key (complementary to `publicJwk`)\n",example:'{"alg":"ES256","crv":"P-256","d":"rQp_3eZzvXwt1sK7WWsRhVYipqNGblzYDKKaYirlqs0","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'},publicJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents the public key (complementary to `privateJwk`).\n",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'}},required:["privateJwk","publicJwk"]}},required:["dataSharingAgreement"]}},required:["type","resource"]},DataExchangeResource:{title:"DataExchangeResource",type:"object",properties:{type:{example:"DataExchange",enum:["DataExchange"]},name:{type:"string",example:"Resource name"},resource:{allOf:[{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},{type:"object",properties:{cipherblockDgst:{type:"string",description:"hash of the cipherblock in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"},blockCommitment:{type:"string",description:"hash of the plaintext block in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"},secretCommitment:{type:"string",description:"ash of the secret that can be used to decrypt the block in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"}},required:["cipherblockDgst","blockCommitment","secretCommitment"]}]}},required:["type","resource"]},NonRepudiationProof:{title:"NonRepudiationProof",type:"object",properties:{type:{example:"NonRepudiationProof",enum:["NonRepudiationProof"]},name:{type:"string",example:"Resource name"},resource:{description:"a non-repudiation proof (either a PoO, a PoR or a PoP) as a compact JWS"}},required:["type","resource"]},ResourceId:{type:"object",properties:{id:{type:"string"}},required:["id"]},ResourceType:{type:"string",enum:["VerifiableCredential","Object","KeyPair","Contract","DataExchange","NonRepudiationProof"]},SignedTransaction:{title:"SignedTransaction",description:"A list of resources",type:"object",properties:{transaction:{type:"string",pattern:"^0x(?:[A-Fa-f0-9])+$"}}},DecodedJwt:{title:"JwtPayload",type:"object",properties:{header:{type:"object",properties:{typ:{type:"string",enum:["JWT"]},alg:{type:"string",enum:["ES256K"]}},required:["typ","alg"],additionalProperties:!0},payload:{type:"object",properties:{iss:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},required:["iss"],additionalProperties:!0},signature:{type:"string",format:"^[A-Za-z0-9_-]+$"},data:{type:"string",format:"^[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+$",description:"."}},required:["signature","data"]},VerificationOutput:{title:"VerificationOutput",type:"object",properties:{verification:{type:"string",enum:["success","failed"],description:"whether verification has been successful or has failed"},error:{type:"string",description:"error message if verification failed"},decodedJwt:{description:"the decoded JWT"}},required:["verification"]},ProviderData:{title:"ProviderData",description:"A JSON object with information of the DLT provider currently in use.",type:"object",properties:{provider:{type:"string",example:"did:ethr:i3m"},network:{type:"string",example:"i3m"},rpcUrl:{type:"string",example:"http://95.211.3.250:8545"}},additionalProperties:!0},EthereumAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},did:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},IdentityData:{title:"Identity Data",type:"object",properties:{did:{type:"string",example:"did:ethr:i3m:0x03142f480f831e835822fc0cd35726844a7069d28df58fb82037f1598812e1ade8"},alias:{type:"string",example:"identity1"},provider:{type:"string",example:"did:ethr:i3m"},addresses:{type:"array",items:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},example:["0x8646cAcF516de1292be1D30AB68E7Ea51e9B1BE7"]}},required:["did"]},ApiError:{type:"object",title:"Error",required:["code","message"],properties:{code:{type:"integer",format:"int32"},message:{type:"string"}}},JwkPair:{type:"object",properties:{privateJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents a private key (complementary to `publicJwk`)\n",example:'{"alg":"ES256","crv":"P-256","d":"rQp_3eZzvXwt1sK7WWsRhVYipqNGblzYDKKaYirlqs0","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'},publicJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents the public key (complementary to `privateJwk`).\n",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'}},required:["privateJwk","publicJwk"]},CompactJWS:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"},DataExchangeAgreement:{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},DataSharingAgreement:{type:"object",required:["dataOfferingDescription","parties","purpose","duration","intendedUse","licenseGrant","dataStream","personalData","pricingModel","dataExchangeAgreement","signatures"],properties:{dataOfferingDescription:{type:"object",required:["dataOfferingId","version","active"],properties:{dataOfferingId:{type:"string"},version:{type:"integer"},category:{type:"string"},active:{type:"boolean"},title:{type:"string"}}},parties:{type:"object",required:["providerDid","consumerDid"],properties:{providerDid:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},consumerDid:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}}},purpose:{type:"string"},duration:{type:"object",required:["creationDate","startDate","endDate"],properties:{creationDate:{type:"integer"},startDate:{type:"integer"},endDate:{type:"integer"}}},intendedUse:{type:"object",required:["processData","shareDataWithThirdParty","editData"],properties:{processData:{type:"boolean"},shareDataWithThirdParty:{type:"boolean"},editData:{type:"boolean"}}},licenseGrant:{type:"object",required:["transferable","exclusiveness","paidUp","revocable","processing","modifying","analyzing","storingData","storingCopy","reproducing","distributing","loaning","selling","renting","furtherLicensing","leasing"],properties:{transferable:{type:"boolean"},exclusiveness:{type:"boolean"},paidUp:{type:"boolean"},revocable:{type:"boolean"},processing:{type:"boolean"},modifying:{type:"boolean"},analyzing:{type:"boolean"},storingData:{type:"boolean"},storingCopy:{type:"boolean"},reproducing:{type:"boolean"},distributing:{type:"boolean"},loaning:{type:"boolean"},selling:{type:"boolean"},renting:{type:"boolean"},furtherLicensing:{type:"boolean"},leasing:{type:"boolean"}}},dataStream:{type:"boolean"},personalData:{type:"boolean"},pricingModel:{type:"object",required:["basicPrice","currency","hasFreePrice"],properties:{paymentType:{type:"string"},pricingModelName:{type:"string"},basicPrice:{type:"number",format:"float"},currency:{type:"string"},fee:{type:"number",format:"float"},hasPaymentOnSubscription:{type:"object",properties:{paymentOnSubscriptionName:{type:"string"},paymentType:{type:"string"},timeDuration:{type:"string"},description:{type:"string"},repeat:{type:"string"},hasSubscriptionPrice:{type:"number"}}},hasFreePrice:{type:"object",properties:{hasPriceFree:{type:"boolean"}}}}},dataExchangeAgreement:{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},signatures:{type:"object",required:["providerSignature","consumerSignature"],properties:{providerSignature:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"},consumerSignature:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"}}}}},DataExchange:{allOf:[{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},{type:"object",properties:{cipherblockDgst:{type:"string",description:"hash of the cipherblock in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"},blockCommitment:{type:"string",description:"hash of the plaintext block in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"},secretCommitment:{type:"string",description:"ash of the secret that can be used to decrypt the block in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"}},required:["cipherblockDgst","blockCommitment","secretCommitment"]}]}}},Dp={exports:{}},$p={},Bp={},Fp={},zp={},Up={},Lp={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;class t{}e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class r extends t{constructor(t){if(super(),!e.IDENTIFIER.test(t))throw new Error("CodeGen: name must be a valid identifier");this.str=t}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=r;class n 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,t)=>`${e}${t}`),"")}get names(){var e;return null!==(e=this._names)&&void 0!==e?e:this._names=this._items.reduce(((e,t)=>(t instanceof r&&(e[t.str]=(e[t.str]||0)+1),e)),{})}}function i(e,...t){const r=[e[0]];let i=0;for(;i{if(void 0===r.scopePath)throw new Error(`CodeGen: name "${r}" has no value`);return t._`${e}${r.scopePath}`}))}scopeCode(e=this._values,t,r){return this._reduceValues(e,(e=>{if(void 0===e.value)throw new Error(`CodeGen: name "${e}" has no value`);return e.value.code}),t,r)}_reduceValues(i,o,a={},s){let c=t.nil;for(const u in i){const f=i[u];if(!f)continue;const d=a[u]=a[u]||new Map;f.forEach((i=>{if(d.has(i))return;d.set(i,n.Started);let a=o(i);if(a){const r=this.opts.es5?e.varKinds.var:e.varKinds.const;c=t._`${c}${r} ${i} = ${a};${this.opts._n}`}else{if(!(a=null==s?void 0:s(i)))throw new r(i);c=t._`${c}${a}${this.opts._n}`}d.set(i,n.Completed)}))}return c}}}(qp),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;const t=Lp,r=qp;var n=Lp;Object.defineProperty(e,"_",{enumerable:!0,get:function(){return n._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return n.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return n.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return n.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return n.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return n.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return n.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return n.Name}});var i=qp;Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return i.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return i.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return i.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return i.varKinds}}),e.operators={GT:new t._Code(">"),GTE:new t._Code(">="),LT:new t._Code("<"),LTE:new t._Code("<="),EQ:new t._Code("==="),NEQ:new t._Code("!=="),NOT:new t._Code("!"),OR:new t._Code("||"),AND:new t._Code("&&"),ADD:new t._Code("+")};class o{optimizeNodes(){return this}optimizeNames(e,t){return this}}class a extends o{constructor(e,t,r){super(),this.varKind=e,this.name=t,this.rhs=r}render({es5:e,_n:t}){const n=e?r.varKinds.var:this.varKind,i=void 0===this.rhs?"":` = ${this.rhs}`;return`${n} ${this.name}${i};`+t}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&(this.rhs=C(this.rhs,e,t)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class s extends o{constructor(e,t,r){super(),this.lhs=e,this.rhs=t,this.sideEffects=r}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof t.Name)||e[this.lhs.str]||this.sideEffects)return this.rhs=C(this.rhs,e,r),this}get names(){return M(this.lhs instanceof t.Name?{}:{...this.lhs.names},this.rhs)}}class c extends s{constructor(e,t,r,n){super(e,r,n),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class u extends o{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class f extends o{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class d extends o{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class l extends o{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=C(this.code,e,t),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class h extends o{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce(((t,r)=>t+r.render(e)),"")}optimizeNodes(){const{nodes:e}=this;let t=e.length;for(;t--;){const r=e[t].optimizeNodes();Array.isArray(r)?e.splice(t,1,...r):r?e[t]=r:e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){const{nodes:r}=this;let n=r.length;for(;n--;){const i=r[n];i.optimizeNames(e,t)||(I(e,i.names),r.splice(n,1))}return r.length>0?this:void 0}get names(){return this.nodes.reduce(((e,t)=>k(e,t.names)),{})}}class p extends h{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class m extends h{}class g extends p{}g.kind="else";class y extends p{constructor(e,t){super(t),this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);return this.else&&(t+="else "+this.else.render(e)),t}optimizeNodes(){super.optimizeNodes();const e=this.condition;if(!0===e)return this.nodes;let t=this.else;if(t){const e=t.optimizeNodes();t=this.else=Array.isArray(e)?new g(e):e}return t?!1===e?t instanceof y?t:t.nodes:this.nodes.length?this:new y(R(e),t instanceof y?[t]:t.nodes):!1!==e&&this.nodes.length?this:void 0}optimizeNames(e,t){var r;if(this.else=null===(r=this.else)||void 0===r?void 0:r.optimizeNames(e,t),super.optimizeNames(e,t)||this.else)return this.condition=C(this.condition,e,t),this}get names(){const e=super.names;return M(e,this.condition),this.else&&k(e,this.else.names),e}}y.kind="if";class b extends p{}b.kind="for";class v extends b{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iteration=C(this.iteration,e,t),this}get names(){return k(super.names,this.iteration.names)}}class w extends b{constructor(e,t,r,n){super(),this.varKind=e,this.name=t,this.from=r,this.to=n}render(e){const t=e.es5?r.varKinds.var:this.varKind,{name:n,from:i,to:o}=this;return`for(${t} ${n}=${i}; ${n}<${o}; ${n}++)`+super.render(e)}get names(){const e=M(super.names,this.from);return M(e,this.to)}}class A extends b{constructor(e,t,r,n){super(),this.loop=e,this.varKind=t,this.name=r,this.iterable=n}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iterable=C(this.iterable,e,t),this}get names(){return k(super.names,this.iterable.names)}}class _ extends p{constructor(e,t,r){super(),this.name=e,this.args=t,this.async=r}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}}_.kind="func";class E extends h{render(e){return"return "+super.render(e)}}E.kind="return";class S extends p{render(e){let t="try"+super.render(e);return this.catch&&(t+=this.catch.render(e)),this.finally&&(t+=this.finally.render(e)),t}optimizeNodes(){var e,t;return super.optimizeNodes(),null===(e=this.catch)||void 0===e||e.optimizeNodes(),null===(t=this.finally)||void 0===t||t.optimizeNodes(),this}optimizeNames(e,t){var r,n;return super.optimizeNames(e,t),null===(r=this.catch)||void 0===r||r.optimizeNames(e,t),null===(n=this.finally)||void 0===n||n.optimizeNames(e,t),this}get names(){const e=super.names;return this.catch&&k(e,this.catch.names),this.finally&&k(e,this.finally.names),e}}class P extends p{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}P.kind="catch";class x extends p{render(e){return"finally"+super.render(e)}}x.kind="finally";function k(e,t){for(const r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function M(e,r){return r instanceof t._CodeOrName?k(e,r.names):e}function C(e,r,n){return e instanceof t.Name?o(e):(i=e)instanceof t._Code&&i._items.some((e=>e instanceof t.Name&&1===r[e.str]&&void 0!==n[e.str]))?new t._Code(e._items.reduce(((e,r)=>(r instanceof t.Name&&(r=o(r)),r instanceof t._Code?e.push(...r._items):e.push(r),e)),[])):e;var i;function o(e){const t=n[e.str];return void 0===t||1!==r[e.str]?e:(delete r[e.str],t)}}function I(e,t){for(const r in t)e[r]=(e[r]||0)-(t[r]||0)}function R(e){return"boolean"==typeof e||"number"==typeof e||null===e?!e:t._`!${j(e)}`}e.CodeGen=class{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?"\n":""},this._extScope=e,this._scope=new r.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,t){const r=this._extScope.value(e,t);return(this._values[r.prefix]||(this._values[r.prefix]=new Set)).add(r),r}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,r,n){const i=this._scope.toName(t);return void 0!==r&&n&&(this._constants[i.str]=r),this._leafNode(new a(e,i,r)),i}const(e,t,n){return this._def(r.varKinds.const,e,t,n)}let(e,t,n){return this._def(r.varKinds.let,e,t,n)}var(e,t,n){return this._def(r.varKinds.var,e,t,n)}assign(e,t,r){return this._leafNode(new s(e,t,r))}add(t,r){return this._leafNode(new c(t,e.operators.ADD,r))}code(e){return"function"==typeof e?e():e!==t.nil&&this._leafNode(new l(e)),this}object(...e){const r=["{"];for(const[n,i]of e)r.length>1&&r.push(","),r.push(n),(n!==i||this.opts.es5)&&(r.push(":"),(0,t.addCodeArg)(r,i));return r.push("}"),new t._Code(r)}if(e,t,r){if(this._blockNode(new y(e)),t&&r)this.code(t).else().code(r).endIf();else if(t)this.code(t).endIf();else if(r)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new y(e))}else(){return this._elseNode(new g)}endIf(){return this._endBlockNode(y,g)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new v(e),t)}forRange(e,t,n,i,o=(this.opts.es5?r.varKinds.var:r.varKinds.let)){const a=this._scope.toName(e);return this._for(new w(o,a,t,n),(()=>i(a)))}forOf(e,n,i,o=r.varKinds.const){const a=this._scope.toName(e);if(this.opts.es5){const e=n instanceof t.Name?n:this.var("_arr",n);return this.forRange("_i",0,t._`${e}.length`,(r=>{this.var(a,t._`${e}[${r}]`),i(a)}))}return this._for(new A("of",o,a,n),(()=>i(a)))}forIn(e,n,i,o=(this.opts.es5?r.varKinds.var:r.varKinds.const)){if(this.opts.ownProperties)return this.forOf(e,t._`Object.keys(${n})`,i);const a=this._scope.toName(e);return this._for(new A("in",o,a,n),(()=>i(a)))}endFor(){return this._endBlockNode(b)}label(e){return this._leafNode(new u(e))}break(e){return this._leafNode(new f(e))}return(e){const t=new E;if(this._blockNode(t),this.code(e),1!==t.nodes.length)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(E)}try(e,t,r){if(!t&&!r)throw new Error('CodeGen: "try" without "catch" and "finally"');const n=new S;if(this._blockNode(n),this.code(e),t){const e=this.name("e");this._currNode=n.catch=new P(e),t(e)}return r&&(this._currNode=n.finally=new x,this.code(r)),this._endBlockNode(P,x)}throw(e){return this._leafNode(new d(e))}block(e,t){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(t),this}endBlock(e){const t=this._blockStarts.pop();if(void 0===t)throw new Error("CodeGen: not in self-balancing block");const r=this._nodes.length-t;if(r<0||void 0!==e&&r!==e)throw new Error(`CodeGen: wrong number of nodes: ${r} vs ${e} expected`);return this._nodes.length=t,this}func(e,r=t.nil,n,i){return this._blockNode(new _(e,r,n)),i&&this.code(i).endFunc(),this}endFunc(){return this._endBlockNode(_)}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,t){const r=this._currNode;if(r instanceof e||t&&r instanceof t)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){const t=this._currNode;if(!(t instanceof y))throw new Error('CodeGen: "else" without "if"');return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){const e=this._nodes;return e[e.length-1]}set _currNode(e){const t=this._nodes;t[t.length-1]=e}},e.not=R;const N=T(e.operators.AND);e.and=function(...e){return e.reduce(N)};const O=T(e.operators.OR);function T(e){return(r,n)=>r===t.nil?n:n===t.nil?r:t._`${j(r)} ${e} ${j(n)}`}function j(e){return e instanceof t.Name?e:t._`(${e})`}e.or=function(...e){return e.reduce(O)}}(Up);var Hp={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.checkStrictMode=e.getErrorPath=e.Type=e.useFunc=e.setEvaluated=e.evaluatedPropsToName=e.mergeEvaluated=e.eachItem=e.unescapeJsonPointer=e.escapeJsonPointer=e.escapeFragment=e.unescapeFragment=e.schemaRefOrVal=e.schemaHasRulesButRef=e.schemaHasRules=e.checkUnknownRules=e.alwaysValidSchema=e.toHash=void 0;const t=Up,r=Lp;function n(e,t=e.schema){const{opts:r,self:n}=e;if(!r.strictSchema)return;if("boolean"==typeof t)return;const i=n.RULES.keywords;for(const r in t)i[r]||l(e,`unknown keyword: "${r}"`)}function i(e,t){if("boolean"==typeof e)return!e;for(const r in e)if(t[r])return!0;return!1}function o(e){return"number"==typeof e?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}function a(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function s({mergeNames:e,mergeToName:r,mergeValues:n,resultToName:i}){return(o,a,s,c)=>{const u=void 0===s?a:s instanceof t.Name?(a instanceof t.Name?e(o,a,s):r(o,a,s),s):a instanceof t.Name?(r(o,s,a),a):n(a,s);return c!==t.Name||u instanceof t.Name?u:i(o,u)}}function c(e,r){if(!0===r)return e.var("props",!0);const n=e.var("props",t._`{}`);return void 0!==r&&u(e,n,r),n}function u(e,r,n){Object.keys(n).forEach((n=>e.assign(t._`${r}${(0,t.getProperty)(n)}`,!0)))}e.toHash=function(e){const t={};for(const r of e)t[r]=!0;return t},e.alwaysValidSchema=function(e,t){return"boolean"==typeof t?t:0===Object.keys(t).length||(n(e,t),!i(t,e.self.RULES.all))},e.checkUnknownRules=n,e.schemaHasRules=i,e.schemaHasRulesButRef=function(e,t){if("boolean"==typeof e)return!e;for(const r in e)if("$ref"!==r&&t.all[r])return!0;return!1},e.schemaRefOrVal=function({topSchemaRef:e,schemaPath:r},n,i,o){if(!o){if("number"==typeof n||"boolean"==typeof n)return n;if("string"==typeof n)return t._`${n}`}return t._`${e}${r}${(0,t.getProperty)(i)}`},e.unescapeFragment=function(e){return a(decodeURIComponent(e))},e.escapeFragment=function(e){return encodeURIComponent(o(e))},e.escapeJsonPointer=o,e.unescapeJsonPointer=a,e.eachItem=function(e,t){if(Array.isArray(e))for(const r of e)t(r);else t(e)},e.mergeEvaluated={props:s({mergeNames:(e,r,n)=>e.if(t._`${n} !== true && ${r} !== undefined`,(()=>{e.if(t._`${r} === true`,(()=>e.assign(n,!0)),(()=>e.assign(n,t._`${n} || {}`).code(t._`Object.assign(${n}, ${r})`)))})),mergeToName:(e,r,n)=>e.if(t._`${n} !== true`,(()=>{!0===r?e.assign(n,!0):(e.assign(n,t._`${n} || {}`),u(e,n,r))})),mergeValues:(e,t)=>!0===e||{...e,...t},resultToName:c}),items:s({mergeNames:(e,r,n)=>e.if(t._`${n} !== true && ${r} !== undefined`,(()=>e.assign(n,t._`${r} === true ? true : ${n} > ${r} ? ${n} : ${r}`))),mergeToName:(e,r,n)=>e.if(t._`${n} !== true`,(()=>e.assign(n,!0===r||t._`${n} > ${r} ? ${n} : ${r}`))),mergeValues:(e,t)=>!0===e||Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})},e.evaluatedPropsToName=c,e.setEvaluated=u;const f={};var d;function l(e,t,r=e.opts.strictSchema){if(r){if(t=`strict mode: ${t}`,!0===r)throw new Error(t);e.self.logger.warn(t)}}e.useFunc=function(e,t){return e.scopeValue("func",{ref:t,code:f[t.code]||(f[t.code]=new r._Code(t.code))})},function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"}(d=e.Type||(e.Type={})),e.getErrorPath=function(e,r,n){if(e instanceof t.Name){const i=r===d.Num;return n?i?t._`"[" + ${e} + "]"`:t._`"['" + ${e} + "']"`:i?t._`"/" + ${e}`:t._`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return n?(0,t.getProperty)(e).toString():"/"+o(e)},e.checkStrictMode=l}(Hp);var Kp={};Object.defineProperty(Kp,"__esModule",{value:!0});const Jp=Up,Wp={data:new Jp.Name("data"),valCxt:new Jp.Name("valCxt"),instancePath:new Jp.Name("instancePath"),parentData:new Jp.Name("parentData"),parentDataProperty:new Jp.Name("parentDataProperty"),rootData:new Jp.Name("rootData"),dynamicAnchors:new Jp.Name("dynamicAnchors"),vErrors:new Jp.Name("vErrors"),errors:new Jp.Name("errors"),this:new Jp.Name("this"),self:new Jp.Name("self"),scope:new Jp.Name("scope"),json:new Jp.Name("json"),jsonPos:new Jp.Name("jsonPos"),jsonLen:new Jp.Name("jsonLen"),jsonPart:new Jp.Name("jsonPart")};Kp.default=Wp,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;const t=Up,r=Hp,n=Kp;function i(e,r){const i=e.const("err",r);e.if(t._`${n.default.vErrors} === null`,(()=>e.assign(n.default.vErrors,t._`[${i}]`)),t._`${n.default.vErrors}.push(${i})`),e.code(t._`${n.default.errors}++`)}function o(e,r){const{gen:n,validateName:i,schemaEnv:o}=e;o.$async?n.throw(t._`new ${e.ValidationError}(${r})`):(n.assign(t._`${i}.errors`,r),n.return(!1))}e.keywordError={message:({keyword:e})=>t.str`must pass "${e}" keyword validation`},e.keyword$DataError={message:({keyword:e,schemaType:r})=>r?t.str`"${e}" keyword must be ${r} ($data)`:t.str`"${e}" keyword is invalid ($data)`},e.reportError=function(r,n=e.keywordError,a,c){const{it:u}=r,{gen:f,compositeRule:d,allErrors:l}=u,h=s(r,n,a);(null!=c?c:d||l)?i(f,h):o(u,t._`[${h}]`)},e.reportExtraError=function(t,r=e.keywordError,a){const{it:c}=t,{gen:u,compositeRule:f,allErrors:d}=c;i(u,s(t,r,a)),f||d||o(c,n.default.vErrors)},e.resetErrorsCount=function(e,r){e.assign(n.default.errors,r),e.if(t._`${n.default.vErrors} !== null`,(()=>e.if(r,(()=>e.assign(t._`${n.default.vErrors}.length`,r)),(()=>e.assign(n.default.vErrors,null)))))},e.extendErrors=function({gen:e,keyword:r,schemaValue:i,data:o,errsCount:a,it:s}){if(void 0===a)throw new Error("ajv implementation error");const c=e.name("err");e.forRange("i",a,n.default.errors,(a=>{e.const(c,t._`${n.default.vErrors}[${a}]`),e.if(t._`${c}.instancePath === undefined`,(()=>e.assign(t._`${c}.instancePath`,(0,t.strConcat)(n.default.instancePath,s.errorPath)))),e.assign(t._`${c}.schemaPath`,t.str`${s.errSchemaPath}/${r}`),s.opts.verbose&&(e.assign(t._`${c}.schema`,i),e.assign(t._`${c}.data`,o))}))};const a={keyword:new t.Name("keyword"),schemaPath:new t.Name("schemaPath"),params:new t.Name("params"),propertyName:new t.Name("propertyName"),message:new t.Name("message"),schema:new t.Name("schema"),parentSchema:new t.Name("parentSchema")};function s(e,r,i){const{createErrors:o}=e.it;return!1===o?t._`{}`:function(e,r,i={}){const{gen:o,it:s}=e,f=[c(s,i),u(e,i)];return function(e,{params:r,message:i},o){const{keyword:s,data:c,schemaValue:u,it:f}=e,{opts:d,propertyName:l,topSchemaRef:h,schemaPath:p}=f;o.push([a.keyword,s],[a.params,"function"==typeof r?r(e):r||t._`{}`]),d.messages&&o.push([a.message,"function"==typeof i?i(e):i]);d.verbose&&o.push([a.schema,u],[a.parentSchema,t._`${h}${p}`],[n.default.data,c]);l&&o.push([a.propertyName,l])}(e,r,f),o.object(...f)}(e,r,i)}function c({errorPath:e},{instancePath:i}){const o=i?t.str`${e}${(0,r.getErrorPath)(i,r.Type.Str)}`:e;return[n.default.instancePath,(0,t.strConcat)(n.default.instancePath,o)]}function u({keyword:e,it:{errSchemaPath:n}},{schemaPath:i,parentSchema:o}){let s=o?n:t.str`${n}/${e}`;return i&&(s=t.str`${s}${(0,r.getErrorPath)(i,r.Type.Str)}`),[a.schemaPath,s]}}(zp),Object.defineProperty(Fp,"__esModule",{value:!0}),Fp.boolOrEmptySchema=Fp.topBoolOrEmptySchema=void 0;const Gp=zp,Vp=Up,Zp=Kp,Xp={message:"boolean schema is false"};function Qp(e,t){const{gen:r,data:n}=e,i={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,Gp.reportError)(i,Xp,void 0,t)}Fp.topBoolOrEmptySchema=function(e){const{gen:t,schema:r,validateName:n}=e;!1===r?Qp(e,!1):"object"==typeof r&&!0===r.$async?t.return(Zp.default.data):(t.assign(Vp._`${n}.errors`,null),t.return(!0))},Fp.boolOrEmptySchema=function(e,t){const{gen:r,schema:n}=e;!1===n?(r.var(t,!1),Qp(e)):r.var(t,!0)};var Yp={},em={};Object.defineProperty(em,"__esModule",{value:!0}),em.getRules=em.isJSONType=void 0;const tm=new Set(["string","number","integer","boolean","null","object","array"]);em.isJSONType=function(e){return"string"==typeof e&&tm.has(e)},em.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:{}}};var rm={};function nm(e,t){return t.rules.some((t=>im(e,t)))}function im(e,t){var r;return void 0!==e[t.keyword]||(null===(r=t.definition.implements)||void 0===r?void 0:r.some((t=>void 0!==e[t])))}Object.defineProperty(rm,"__esModule",{value:!0}),rm.shouldUseRule=rm.shouldUseGroup=rm.schemaHasRulesForType=void 0,rm.schemaHasRulesForType=function({schema:e,self:t},r){const n=t.RULES.types[r];return n&&!0!==n&&nm(e,n)},rm.shouldUseGroup=nm,rm.shouldUseRule=im,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.reportTypeError=e.checkDataTypes=e.checkDataType=e.coerceAndCheckDataType=e.getJSONTypes=e.getSchemaTypes=e.DataType=void 0;const t=em,r=rm,n=zp,i=Up,o=Hp;var a;function s(e){const r=Array.isArray(e)?e:e?[e]:[];if(r.every(t.isJSONType))return r;throw new Error("type must be JSONType or JSONType[]: "+r.join(","))}!function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"}(a=e.DataType||(e.DataType={})),e.getSchemaTypes=function(e){const t=s(e.type);if(t.includes("null")){if(!1===e.nullable)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&void 0!==e.nullable)throw new Error('"nullable" cannot be used without "type"');!0===e.nullable&&t.push("null")}return t},e.getJSONTypes=s,e.coerceAndCheckDataType=function(e,t){const{gen:n,data:o,opts:s}=e,u=function(e,t){return t?e.filter((e=>c.has(e)||"array"===t&&"array"===e)):[]}(t,s.coerceTypes),d=t.length>0&&!(0===u.length&&1===t.length&&(0,r.schemaHasRulesForType)(e,t[0]));if(d){const r=f(t,o,s.strictNumbers,a.Wrong);n.if(r,(()=>{u.length?function(e,t,r){const{gen:n,data:o,opts:a}=e,s=n.let("dataType",i._`typeof ${o}`),u=n.let("coerced",i._`undefined`);"array"===a.coerceTypes&&n.if(i._`${s} == 'object' && Array.isArray(${o}) && ${o}.length == 1`,(()=>n.assign(o,i._`${o}[0]`).assign(s,i._`typeof ${o}`).if(f(t,o,a.strictNumbers),(()=>n.assign(u,o)))));n.if(i._`${u} !== undefined`);for(const e of r)(c.has(e)||"array"===e&&"array"===a.coerceTypes)&&d(e);function d(e){switch(e){case"string":return void n.elseIf(i._`${s} == "number" || ${s} == "boolean"`).assign(u,i._`"" + ${o}`).elseIf(i._`${o} === null`).assign(u,i._`""`);case"number":return void n.elseIf(i._`${s} == "boolean" || ${o} === null || (${s} == "string" && ${o} && ${o} == +${o})`).assign(u,i._`+${o}`);case"integer":return void n.elseIf(i._`${s} === "boolean" || ${o} === null || (${s} === "string" && ${o} && ${o} == +${o} && !(${o} % 1))`).assign(u,i._`+${o}`);case"boolean":return void n.elseIf(i._`${o} === "false" || ${o} === 0 || ${o} === null`).assign(u,!1).elseIf(i._`${o} === "true" || ${o} === 1`).assign(u,!0);case"null":return n.elseIf(i._`${o} === "" || ${o} === 0 || ${o} === false`),void n.assign(u,null);case"array":n.elseIf(i._`${s} === "string" || ${s} === "number" - || ${s} === "boolean" || ${o} === null`).assign(u,i._`[${o}]`)}}n.else(),l(e),n.endIf(),n.if(i._`${u} !== undefined`,(()=>{n.assign(o,u),function({gen:e,parentData:t,parentDataProperty:r},n){e.if(i._`${t} !== undefined`,(()=>e.assign(i._`${t}[${r}]`,n)))}(e,u)}))}(e,t,u):l(e)}))}return d};const c=new Set(["string","number","integer","boolean","null"]);function u(e,t,r,n=a.Correct){const o=n===a.Correct?i.operators.EQ:i.operators.NEQ;let s;switch(e){case"null":return i._`${t} ${o} null`;case"array":s=i._`Array.isArray(${t})`;break;case"object":s=i._`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":s=c(i._`!(${t} % 1) && !isNaN(${t})`);break;case"number":s=c();break;default:return i._`typeof ${t} ${o} ${e}`}return n===a.Correct?s:(0,i.not)(s);function c(e=i.nil){return(0,i.and)(i._`typeof ${t} == "number"`,e,r?i._`isFinite(${t})`:i.nil)}}function f(e,t,r,n){if(1===e.length)return u(e[0],t,r,n);let a;const s=(0,o.toHash)(e);if(s.array&&s.object){const e=i._`typeof ${t} != "object"`;a=s.null?e:i._`!${t} || ${e}`,delete s.null,delete s.array,delete s.object}else a=i.nil;s.number&&delete s.integer;for(const e in s)a=(0,i.and)(a,u(e,t,r,n));return a}e.checkDataType=u,e.checkDataTypes=f;const d={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>"string"==typeof e?i._`{type: ${e}}`:i._`{type: ${t}}`};function l(e){const t=function(e){const{gen:t,data:r,schema:n}=e,i=(0,o.schemaRefOrVal)(e,n,"type");return{gen:t,keyword:"type",data:r,schema:n.type,schemaCode:i,schemaValue:i,parentSchema:n,params:{},it:e}}(e);(0,n.reportError)(t,d)}e.reportTypeError=l}(Xp);var nm={};Object.defineProperty(nm,"__esModule",{value:!0}),nm.assignDefaults=void 0;const im=Fp,om=Lp;function am(e,t,r){const{gen:n,compositeRule:i,data:o,opts:a}=e;if(void 0===r)return;const s=im._`${o}${(0,im.getProperty)(t)}`;if(i)return void(0,om.checkStrictMode)(e,`default is ignored for: ${s}`);let c=im._`${s} === undefined`;"empty"===a.useDefaults&&(c=im._`${c} || ${s} === null || ${s} === ""`),n.if(c,im._`${s} = ${(0,im.stringify)(r)}`)}nm.assignDefaults=function(e,t){const{properties:r,items:n}=e.schema;if("object"===t&&r)for(const t in r)am(e,t,r[t].default);else"array"===t&&Array.isArray(n)&&n.forEach(((t,r)=>am(e,r,t.default)))};var sm={},cm={};Object.defineProperty(cm,"__esModule",{value:!0}),cm.validateUnion=cm.validateArray=cm.usePattern=cm.callValidateCode=cm.schemaProperties=cm.allSchemaProperties=cm.noPropertyInData=cm.propertyInData=cm.isOwnProperty=cm.hasPropFunc=cm.reportMissingProp=cm.checkMissingProp=cm.checkReportMissingProp=void 0;const um=Fp,fm=Lp,dm=qp,lm=Lp;function hm(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:um._`Object.prototype.hasOwnProperty`})}function pm(e,t,r){return um._`${hm(e)}.call(${t}, ${r})`}function mm(e,t,r,n){const i=um._`${t}${(0,um.getProperty)(r)} === undefined`;return n?(0,um.or)(i,(0,um.not)(pm(e,t,r))):i}function gm(e){return e?Object.keys(e).filter((e=>"__proto__"!==e)):[]}cm.checkReportMissingProp=function(e,t){const{gen:r,data:n,it:i}=e;r.if(mm(r,n,t,i.opts.ownProperties),(()=>{e.setParams({missingProperty:um._`${t}`},!0),e.error()}))},cm.checkMissingProp=function({gen:e,data:t,it:{opts:r}},n,i){return(0,um.or)(...n.map((n=>(0,um.and)(mm(e,t,n,r.ownProperties),um._`${i} = ${n}`))))},cm.reportMissingProp=function(e,t){e.setParams({missingProperty:t},!0),e.error()},cm.hasPropFunc=hm,cm.isOwnProperty=pm,cm.propertyInData=function(e,t,r,n){const i=um._`${t}${(0,um.getProperty)(r)} !== undefined`;return n?um._`${i} && ${pm(e,t,r)}`:i},cm.noPropertyInData=mm,cm.allSchemaProperties=gm,cm.schemaProperties=function(e,t){return gm(t).filter((r=>!(0,fm.alwaysValidSchema)(e,t[r])))},cm.callValidateCode=function({schemaCode:e,data:t,it:{gen:r,topSchemaRef:n,schemaPath:i,errorPath:o},it:a},s,c,u){const f=u?um._`${e}, ${t}, ${n}${i}`:t,d=[[dm.default.instancePath,(0,um.strConcat)(dm.default.instancePath,o)],[dm.default.parentData,a.parentData],[dm.default.parentDataProperty,a.parentDataProperty],[dm.default.rootData,dm.default.rootData]];a.opts.dynamicRef&&d.push([dm.default.dynamicAnchors,dm.default.dynamicAnchors]);const l=um._`${f}, ${r.object(...d)}`;return c!==um.nil?um._`${s}.call(${c}, ${l})`:um._`${s}(${l})`};const ym=um._`new RegExp`;cm.usePattern=function({gen:e,it:{opts:t}},r){const n=t.unicodeRegExp?"u":"",{regExp:i}=t.code,o=i(r,n);return e.scopeValue("pattern",{key:o.toString(),ref:o,code:um._`${"new RegExp"===i.code?ym:(0,lm.useFunc)(e,i)}(${r}, ${n})`})},cm.validateArray=function(e){const{gen:t,data:r,keyword:n,it:i}=e,o=t.name("valid");if(i.allErrors){const e=t.let("valid",!0);return a((()=>t.assign(e,!1))),e}return t.var(o,!0),a((()=>t.break())),o;function a(i){const a=t.const("len",um._`${r}.length`);t.forRange("i",0,a,(r=>{e.subschema({keyword:n,dataProp:r,dataPropType:fm.Type.Num},o),t.if((0,um.not)(o),i)}))}},cm.validateUnion=function(e){const{gen:t,schema:r,keyword:n,it:i}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some((e=>(0,fm.alwaysValidSchema)(i,e)))&&!i.opts.unevaluated)return;const o=t.let("valid",!1),a=t.name("_valid");t.block((()=>r.forEach(((r,i)=>{const s=e.subschema({keyword:n,schemaProp:i,compositeRule:!0},a);t.assign(o,um._`${o} || ${a}`);e.mergeValidEvaluated(s,a)||t.if((0,um.not)(o))})))),e.result(o,(()=>e.reset()),(()=>e.error(!0)))},Object.defineProperty(sm,"__esModule",{value:!0}),sm.validateKeywordUsage=sm.validSchemaType=sm.funcKeywordCode=sm.macroKeywordCode=void 0;const bm=Fp,vm=qp,wm=cm,Am=Bp;function _m(e){const{gen:t,data:r,it:n}=e;t.if(n.parentData,(()=>t.assign(r,bm._`${n.parentData}[${n.parentDataProperty}]`)))}function Em(e,t,r){if(void 0===r)throw new Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword","function"==typeof r?{ref:r}:{ref:r,code:(0,bm.stringify)(r)})}sm.macroKeywordCode=function(e,t){const{gen:r,keyword:n,schema:i,parentSchema:o,it:a}=e,s=t.macro.call(a.self,i,o,a),c=Em(r,n,s);!1!==a.opts.validateSchema&&a.self.validateSchema(s,!0);const u=r.name("valid");e.subschema({schema:s,schemaPath:bm.nil,errSchemaPath:`${a.errSchemaPath}/${n}`,topSchemaRef:c,compositeRule:!0},u),e.pass(u,(()=>e.error(!0)))},sm.funcKeywordCode=function(e,t){var r;const{gen:n,keyword:i,schema:o,parentSchema:a,$data:s,it:c}=e;!function({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}(c,t);const u=!s&&t.compile?t.compile.call(c.self,o,a,c):t.validate,f=Em(n,i,u),d=n.let("valid");function l(r=(t.async?bm._`await `:bm.nil)){const i=c.opts.passContext?vm.default.this:vm.default.self,o=!("compile"in t&&!s||!1===t.schema);n.assign(d,bm._`${r}${(0,wm.callValidateCode)(e,f,i,o)}`,t.modifying)}function h(e){var r;n.if((0,bm.not)(null!==(r=t.valid)&&void 0!==r?r:d),e)}e.block$data(d,(function(){if(!1===t.errors)l(),t.modifying&&_m(e),h((()=>e.error()));else{const r=t.async?function(){const e=n.let("ruleErrs",null);return n.try((()=>l(bm._`await `)),(t=>n.assign(d,!1).if(bm._`${t} instanceof ${c.ValidationError}`,(()=>n.assign(e,bm._`${t}.errors`)),(()=>n.throw(t))))),e}():function(){const e=bm._`${f}.errors`;return n.assign(e,null),l(bm.nil),e}();t.modifying&&_m(e),h((()=>function(e,t){const{gen:r}=e;r.if(bm._`Array.isArray(${t})`,(()=>{r.assign(vm.default.vErrors,bm._`${vm.default.vErrors} === null ? ${t} : ${vm.default.vErrors}.concat(${t})`).assign(vm.default.errors,bm._`${vm.default.vErrors}.length`),(0,Am.extendErrors)(e)}),(()=>e.error()))}(e,r)))}})),e.ok(null!==(r=t.valid)&&void 0!==r?r:d)},sm.validSchemaType=function(e,t,r=!1){return!t.length||t.some((t=>"array"===t?Array.isArray(e):"object"===t?e&&"object"==typeof e&&!Array.isArray(e):typeof e==t||r&&void 0===e))},sm.validateKeywordUsage=function({schema:e,opts:t,self:r,errSchemaPath:n},i,o){if(Array.isArray(i.keyword)?!i.keyword.includes(o):i.keyword!==o)throw new Error("ajv implementation error");const a=i.dependencies;if(null==a?void 0:a.some((t=>!Object.prototype.hasOwnProperty.call(e,t))))throw new Error(`parent schema must have dependencies of ${o}: ${a.join(",")}`);if(i.validateSchema){if(!i.validateSchema(e[o])){const e=`keyword "${o}" value is invalid at path "${n}": `+r.errorsText(i.validateSchema.errors);if("log"!==t.validateSchema)throw new Error(e);r.logger.error(e)}}};var Sm={};Object.defineProperty(Sm,"__esModule",{value:!0}),Sm.extendSubschemaMode=Sm.extendSubschemaData=Sm.getSubschema=void 0;const Pm=Fp,xm=Lp;Sm.getSubschema=function(e,{keyword:t,schemaProp:r,schema:n,schemaPath:i,errSchemaPath:o,topSchemaRef:a}){if(void 0!==t&&void 0!==n)throw new Error('both "keyword" and "schema" passed, only one allowed');if(void 0!==t){const n=e.schema[t];return void 0===r?{schema:n,schemaPath:Pm._`${e.schemaPath}${(0,Pm.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:n[r],schemaPath:Pm._`${e.schemaPath}${(0,Pm.getProperty)(t)}${(0,Pm.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,xm.escapeFragment)(r)}`}}if(void 0!==n){if(void 0===i||void 0===o||void 0===a)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:i,topSchemaRef:a,errSchemaPath:o}}throw new Error('either "keyword" or "schema" must be passed')},Sm.extendSubschemaData=function(e,t,{dataProp:r,dataPropType:n,data:i,dataTypes:o,propertyName:a}){if(void 0!==i&&void 0!==r)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:s}=t;if(void 0!==r){const{errorPath:i,dataPathArr:o,opts:a}=t;c(s.let("data",Pm._`${t.data}${(0,Pm.getProperty)(r)}`,!0)),e.errorPath=Pm.str`${i}${(0,xm.getErrorPath)(r,n,a.jsPropertySyntax)}`,e.parentDataProperty=Pm._`${r}`,e.dataPathArr=[...o,e.parentDataProperty]}if(void 0!==i){c(i instanceof Pm.Name?i:s.let("data",i,!0)),void 0!==a&&(e.propertyName=a)}function c(r){e.data=r,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,r]}o&&(e.dataTypes=o)},Sm.extendSubschemaMode=function(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:n,createErrors:i,allErrors:o}){void 0!==n&&(e.compositeRule=n),void 0!==i&&(e.createErrors=i),void 0!==o&&(e.allErrors=o),e.jtdDiscriminator=t,e.jtdMetadata=r};var km={},Mm=function e(t,r){if(t===r)return!0;if(t&&r&&"object"==typeof t&&"object"==typeof r){if(t.constructor!==r.constructor)return!1;var n,i,o;if(Array.isArray(t)){if((n=t.length)!=r.length)return!1;for(i=n;0!=i--;)if(!e(t[i],r[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if((n=(o=Object.keys(t)).length)!==Object.keys(r).length)return!1;for(i=n;0!=i--;)if(!Object.prototype.hasOwnProperty.call(r,o[i]))return!1;for(i=n;0!=i--;){var a=o[i];if(!e(t[a],r[a]))return!1}return!0}return t!=t&&r!=r},Cm={exports:{}},Im=Cm.exports=function(e,t,r){"function"==typeof t&&(r=t,t={}),Rm(t,"function"==typeof(r=t.cb||r)?r:r.pre||function(){},r.post||function(){},e,"",e)};function Rm(e,t,r,n,i,o,a,s,c,u){if(n&&"object"==typeof n&&!Array.isArray(n)){for(var f in t(n,i,o,a,s,c,u),n){var d=n[f];if(Array.isArray(d)){if(f in Im.arrayKeywords)for(var l=0;lt+=Fm(e))),t===1/0))return 1/0}return t}function zm(e,t="",r){!1!==r&&(t=qm(t));const n=e.parse(t);return Um(e,n)}function Um(e,t){return e.serialize(t).split("#")[0]+"#"}km.getFullPath=zm,km._getFullPath=Um;const Lm=/#\/?$/;function qm(e){return e?e.replace(Lm,""):""}km.normalizeId=qm,km.resolveUrl=function(e,t,r){return r=qm(r),e.resolve(t,r)};const Hm=/^[a-z_][-a-z0-9._]*$/i;km.getSchemaRefs=function(e,t){if("boolean"==typeof e)return{};const{schemaId:r,uriResolver:n}=this.opts,i=qm(e[r]||t),o={"":i},a=zm(n,i,!1),s={},c=new Set;return jm(e,{allKeys:!0},((e,t,n,i)=>{if(void 0===i)return;const d=a+t;let l=o[i];function h(t){const r=this.opts.uriResolver.resolve;if(t=qm(l?r(l,t):t),c.has(t))throw f(t);c.add(t);let n=this.refs[t];return"string"==typeof n&&(n=this.refs[n]),"object"==typeof n?u(e,n.schema,t):t!==qm(d)&&("#"===t[0]?(u(e,s[t],t),s[t]=e):this.refs[t]=d),t}function p(e){if("string"==typeof e){if(!Hm.test(e))throw new Error(`invalid anchor "${e}"`);h.call(this,`#${e}`)}}"string"==typeof e[r]&&(l=h.call(this,e[r])),p.call(this,e.$anchor),p.call(this,e.$dynamicAnchor),o[t]=l})),s;function u(e,t,r){if(void 0!==t&&!Tm(e,t))throw f(r)}function f(e){return new Error(`reference "${e}" resolves to more than one schema`)}},Object.defineProperty(Dp,"__esModule",{value:!0}),Dp.getData=Dp.KeywordCxt=Dp.validateFunctionCode=void 0;const Km=$p,Jm=Xp,Wm=em,Gm=Xp,Vm=nm,Zm=sm,Xm=Sm,Qm=Fp,Ym=qp,eg=km,tg=Lp,rg=Bp;function ng({gen:e,validateName:t,schema:r,schemaEnv:n,opts:i},o){i.code.es5?e.func(t,Qm._`${Ym.default.data}, ${Ym.default.valCxt}`,n.$async,(()=>{e.code(Qm._`"use strict"; ${ig(r,i)}`),function(e,t){e.if(Ym.default.valCxt,(()=>{e.var(Ym.default.instancePath,Qm._`${Ym.default.valCxt}.${Ym.default.instancePath}`),e.var(Ym.default.parentData,Qm._`${Ym.default.valCxt}.${Ym.default.parentData}`),e.var(Ym.default.parentDataProperty,Qm._`${Ym.default.valCxt}.${Ym.default.parentDataProperty}`),e.var(Ym.default.rootData,Qm._`${Ym.default.valCxt}.${Ym.default.rootData}`),t.dynamicRef&&e.var(Ym.default.dynamicAnchors,Qm._`${Ym.default.valCxt}.${Ym.default.dynamicAnchors}`)}),(()=>{e.var(Ym.default.instancePath,Qm._`""`),e.var(Ym.default.parentData,Qm._`undefined`),e.var(Ym.default.parentDataProperty,Qm._`undefined`),e.var(Ym.default.rootData,Ym.default.data),t.dynamicRef&&e.var(Ym.default.dynamicAnchors,Qm._`{}`)}))}(e,i),e.code(o)})):e.func(t,Qm._`${Ym.default.data}, ${function(e){return Qm._`{${Ym.default.instancePath}="", ${Ym.default.parentData}, ${Ym.default.parentDataProperty}, ${Ym.default.rootData}=${Ym.default.data}${e.dynamicRef?Qm._`, ${Ym.default.dynamicAnchors}={}`:Qm.nil}}={}`}(i)}`,n.$async,(()=>e.code(ig(r,i)).code(o)))}function ig(e,t){const r="object"==typeof e&&e[t.schemaId];return r&&(t.code.source||t.code.process)?Qm._`/*# sourceURL=${r} */`:Qm.nil}function og(e,t){sg(e)&&(cg(e),ag(e))?function(e,t){const{schema:r,gen:n,opts:i}=e;i.$comment&&r.$comment&&fg(e);(function(e){const t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,eg.resolveUrl)(e.opts.uriResolver,e.baseId,t))})(e),function(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}(e);const o=n.const("_errs",Ym.default.errors);ug(e,o),n.var(t,Qm._`${o} === ${Ym.default.errors}`)}(e,t):(0,Km.boolOrEmptySchema)(e,t)}function ag({schema:e,self:t}){if("boolean"==typeof e)return!e;for(const r in e)if(t.RULES.all[r])return!0;return!1}function sg(e){return"boolean"!=typeof e.schema}function cg(e){(0,tg.checkUnknownRules)(e),function(e){const{schema:t,errSchemaPath:r,opts:n,self:i}=e;t.$ref&&n.ignoreKeywordsWithRef&&(0,tg.schemaHasRulesButRef)(t,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}(e)}function ug(e,t){if(e.opts.jtd)return dg(e,[],!1,t);const r=(0,Jm.getSchemaTypes)(e.schema);dg(e,r,!(0,Jm.coerceAndCheckDataType)(e,r),t)}function fg({gen:e,schemaEnv:t,schema:r,errSchemaPath:n,opts:i}){const o=r.$comment;if(!0===i.$comment)e.code(Qm._`${Ym.default.self}.logger.log(${o})`);else if("function"==typeof i.$comment){const r=Qm.str`${n}/$comment`,i=e.scopeValue("root",{ref:t.root});e.code(Qm._`${Ym.default.self}.opts.$comment(${o}, ${r}, ${i}.schema)`)}}function dg(e,t,r,n){const{gen:i,schema:o,data:a,allErrors:s,opts:c,self:u}=e,{RULES:f}=u;function d(u){(0,Wm.shouldUseGroup)(o,u)&&(u.type?(i.if((0,Gm.checkDataType)(u.type,a,c.strictNumbers)),lg(e,u),1===t.length&&t[0]===u.type&&r&&(i.else(),(0,Gm.reportTypeError)(e)),i.endIf()):lg(e,u),s||i.if(Qm._`${Ym.default.errors} === ${n||0}`))}!o.$ref||!c.ignoreKeywordsWithRef&&(0,tg.schemaHasRulesButRef)(o,f)?(c.jtd||function(e,t){if(e.schemaEnv.meta||!e.opts.strictTypes)return;(function(e,t){if(!t.length)return;if(!e.dataTypes.length)return void(e.dataTypes=t);t.forEach((t=>{pg(e.dataTypes,t)||mg(e,`type "${t}" not allowed by context "${e.dataTypes.join(",")}"`)})),function(e,t){const r=[];for(const n of e.dataTypes)pg(t,n)?r.push(n):t.includes("integer")&&"number"===n&&r.push("integer");e.dataTypes=r}(e,t)})(e,t),e.opts.allowUnionTypes||function(e,t){t.length>1&&(2!==t.length||!t.includes("null"))&&mg(e,"use allowUnionTypes to allow union type keyword")}(e,t);!function(e,t){const r=e.self.RULES.all;for(const n in r){const i=r[n];if("object"==typeof i&&(0,Wm.shouldUseRule)(e.schema,i)){const{type:r}=i.definition;r.length&&!r.some((e=>hg(t,e)))&&mg(e,`missing type "${r.join(",")}" for keyword "${n}"`)}}}(e,e.dataTypes)}(e,t),i.block((()=>{for(const e of f.rules)d(e);d(f.post)}))):i.block((()=>yg(e,"$ref",f.all.$ref.definition)))}function lg(e,t){const{gen:r,schema:n,opts:{useDefaults:i}}=e;i&&(0,Vm.assignDefaults)(e,t.type),r.block((()=>{for(const r of t.rules)(0,Wm.shouldUseRule)(n,r)&&yg(e,r.keyword,r.definition,t.type)}))}function hg(e,t){return e.includes(t)||"number"===t&&e.includes("integer")}function pg(e,t){return e.includes(t)||"integer"===t&&e.includes("number")}function mg(e,t){t+=` at "${e.schemaEnv.baseId+e.errSchemaPath}" (strictTypes)`,(0,tg.checkStrictMode)(e,t,e.opts.strictTypes)}Dp.validateFunctionCode=function(e){sg(e)&&(cg(e),ag(e))?function(e){const{schema:t,opts:r,gen:n}=e;ng(e,(()=>{r.$comment&&t.$comment&&fg(e),function(e){const{schema:t,opts:r}=e;void 0!==t.default&&r.useDefaults&&r.strictSchema&&(0,tg.checkStrictMode)(e,"default is ignored in the schema root")}(e),n.let(Ym.default.vErrors,null),n.let(Ym.default.errors,0),r.unevaluated&&function(e){const{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",Qm._`${r}.evaluated`),t.if(Qm._`${e.evaluated}.dynamicProps`,(()=>t.assign(Qm._`${e.evaluated}.props`,Qm._`undefined`))),t.if(Qm._`${e.evaluated}.dynamicItems`,(()=>t.assign(Qm._`${e.evaluated}.items`,Qm._`undefined`)))}(e),ug(e),function(e){const{gen:t,schemaEnv:r,validateName:n,ValidationError:i,opts:o}=e;r.$async?t.if(Qm._`${Ym.default.errors} === 0`,(()=>t.return(Ym.default.data)),(()=>t.throw(Qm._`new ${i}(${Ym.default.vErrors})`))):(t.assign(Qm._`${n}.errors`,Ym.default.vErrors),o.unevaluated&&function({gen:e,evaluated:t,props:r,items:n}){r instanceof Qm.Name&&e.assign(Qm._`${t}.props`,r);n instanceof Qm.Name&&e.assign(Qm._`${t}.items`,n)}(e),t.return(Qm._`${Ym.default.errors} === 0`))}(e)}))}(e):ng(e,(()=>(0,Km.topBoolOrEmptySchema)(e)))};class gg{constructor(e,t,r){if((0,Zm.validateKeywordUsage)(e,t,r),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=r,this.data=e.data,this.schema=e.schema[r],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,tg.schemaRefOrVal)(e,this.schema,r,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const("vSchema",wg(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,Zm.validSchemaType)(this.schema,t.schemaType,t.allowUndefined))throw new Error(`${r} value must be ${JSON.stringify(t.schemaType)}`);("code"in t?t.trackErrors:!1!==t.errors)&&(this.errsCount=e.gen.const("_errs",Ym.default.errors))}result(e,t,r){this.failResult((0,Qm.not)(e),t,r)}failResult(e,t,r){this.gen.if(e),r?r():this.error(),t?(this.gen.else(),t(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,t){this.failResult((0,Qm.not)(e),void 0,t)}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:t}=this;this.fail(Qm._`${t} !== undefined && (${(0,Qm.or)(this.invalid$data(),e)})`)}error(e,t,r){if(t)return this.setParams(t),this._error(e,r),void this.setParams({});this._error(e,r)}_error(e,t){(e?rg.reportExtraError:rg.reportError)(this,this.def.error,t)}$dataError(){(0,rg.reportError)(this,this.def.$dataError||rg.keyword$DataError)}reset(){if(void 0===this.errsCount)throw new Error('add "trackErrors" to keyword definition');(0,rg.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,t){t?Object.assign(this.params,e):this.params=e}block$data(e,t,r=Qm.nil){this.gen.block((()=>{this.check$data(e,r),t()}))}check$data(e=Qm.nil,t=Qm.nil){if(!this.$data)return;const{gen:r,schemaCode:n,schemaType:i,def:o}=this;r.if((0,Qm.or)(Qm._`${n} === undefined`,t)),e!==Qm.nil&&r.assign(e,!0),(i.length||o.validateSchema)&&(r.elseIf(this.invalid$data()),this.$dataError(),e!==Qm.nil&&r.assign(e,!1)),r.else()}invalid$data(){const{gen:e,schemaCode:t,schemaType:r,def:n,it:i}=this;return(0,Qm.or)(function(){if(r.length){if(!(t instanceof Qm.Name))throw new Error("ajv implementation error");const e=Array.isArray(r)?r:[r];return Qm._`${(0,Gm.checkDataTypes)(e,t,i.opts.strictNumbers,Gm.DataType.Wrong)}`}return Qm.nil}(),function(){if(n.validateSchema){const r=e.scopeValue("validate$data",{ref:n.validateSchema});return Qm._`!${r}(${t})`}return Qm.nil}())}subschema(e,t){const r=(0,Xm.getSubschema)(this.it,e);(0,Xm.extendSubschemaData)(r,this.it,e),(0,Xm.extendSubschemaMode)(r,e);const n={...this.it,...r,items:void 0,props:void 0};return og(n,t),n}mergeEvaluated(e,t){const{it:r,gen:n}=this;r.opts.unevaluated&&(!0!==r.props&&void 0!==e.props&&(r.props=tg.mergeEvaluated.props(n,e.props,r.props,t)),!0!==r.items&&void 0!==e.items&&(r.items=tg.mergeEvaluated.items(n,e.items,r.items,t)))}mergeValidEvaluated(e,t){const{it:r,gen:n}=this;if(r.opts.unevaluated&&(!0!==r.props||!0!==r.items))return n.if(t,(()=>this.mergeEvaluated(e,Qm.Name))),!0}}function yg(e,t,r,n){const i=new gg(e,r,t);"code"in r?r.code(i,n):i.$data&&r.validate?(0,Zm.funcKeywordCode)(i,r):"macro"in r?(0,Zm.macroKeywordCode)(i,r):(r.compile||r.validate)&&(0,Zm.funcKeywordCode)(i,r)}Dp.KeywordCxt=gg;const bg=/^\/(?:[^~]|~0|~1)*$/,vg=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function wg(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let i,o;if(""===e)return Ym.default.rootData;if("/"===e[0]){if(!bg.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);i=e,o=Ym.default.rootData}else{const a=vg.exec(e);if(!a)throw new Error(`Invalid JSON-pointer: ${e}`);const s=+a[1];if(i=a[2],"#"===i){if(s>=t)throw new Error(c("property/index",s));return n[t-s]}if(s>t)throw new Error(c("data",s));if(o=r[t-s],!i)return o}let a=o;const s=i.split("/");for(const e of s)e&&(o=Qm._`${o}${(0,Qm.getProperty)((0,tg.unescapeJsonPointer)(e))}`,a=Qm._`${a} && ${o}`);return a;function c(e,r){return`Cannot access ${e} ${r} levels up, current level is ${t}`}}Dp.getData=wg;var Ag={};Object.defineProperty(Ag,"__esModule",{value:!0});class _g extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}}Ag.default=_g;var Eg={};Object.defineProperty(Eg,"__esModule",{value:!0});const Sg=km;class Pg extends Error{constructor(e,t,r,n){super(n||`can't resolve reference ${r} from id ${t}`),this.missingRef=(0,Sg.resolveUrl)(e,t,r),this.missingSchema=(0,Sg.normalizeId)((0,Sg.getFullPath)(e,this.missingRef))}}Eg.default=Pg;var xg={};Object.defineProperty(xg,"__esModule",{value:!0}),xg.resolveSchema=xg.getCompilingSchema=xg.resolveRef=xg.compileSchema=xg.SchemaEnv=void 0;const kg=Fp,Mg=Ag,Cg=qp,Ig=km,Rg=Lp,Ng=Dp;class Og{constructor(e){var t;let r;this.refs={},this.dynamicAnchors={},"object"==typeof e.schema&&(r=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=null!==(t=e.baseId)&&void 0!==t?t:(0,Ig.normalizeId)(null==r?void 0:r[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=null==r?void 0:r.$async,this.refs={}}}function Tg(e){const t=Dg.call(this,e);if(t)return t;const r=(0,Ig.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:n,lines:i}=this.opts.code,{ownProperties:o}=this.opts,a=new kg.CodeGen(this.scope,{es5:n,lines:i,ownProperties:o});let s;e.$async&&(s=a.scopeValue("Error",{ref:Mg.default,code:kg._`require("ajv/dist/runtime/validation_error").default`}));const c=a.scopeName("validate");e.validateName=c;const u={gen:a,allErrors:this.opts.allErrors,data:Cg.default.data,parentData:Cg.default.parentData,parentDataProperty:Cg.default.parentDataProperty,dataNames:[Cg.default.data],dataPathArr:[kg.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:a.scopeValue("schema",!0===this.opts.code.source?{ref:e.schema,code:(0,kg.stringify)(e.schema)}:{ref:e.schema}),validateName:c,ValidationError:s,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:kg.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:kg._`""`,opts:this.opts,self:this};let f;try{this._compilations.add(e),(0,Ng.validateFunctionCode)(u),a.optimize(this.opts.code.optimize);const t=a.toString();f=`${a.scopeRefs(Cg.default.scope)}return ${t}`,this.opts.code.process&&(f=this.opts.code.process(f,e));const r=new Function(`${Cg.default.self}`,`${Cg.default.scope}`,f)(this,this.scope.get());if(this.scope.value(c,{ref:r}),r.errors=null,r.schema=e.schema,r.schemaEnv=e,e.$async&&(r.$async=!0),!0===this.opts.code.source&&(r.source={validateName:c,validateCode:t,scopeValues:a._values}),this.opts.unevaluated){const{props:e,items:t}=u;r.evaluated={props:e instanceof kg.Name?void 0:e,items:t instanceof kg.Name?void 0:t,dynamicProps:e instanceof kg.Name,dynamicItems:t instanceof kg.Name},r.source&&(r.source.evaluated=(0,kg.stringify)(r.evaluated))}return e.validate=r,e}catch(t){throw delete e.validate,delete e.validateName,f&&this.logger.error("Error compiling schema, function code:",f),t}finally{this._compilations.delete(e)}}function jg(e){return(0,Ig.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:Tg.call(this,e)}function Dg(e){for(const n of this._compilations)if(r=e,(t=n).schema===r.schema&&t.root===r.root&&t.baseId===r.baseId)return n;var t,r}function $g(e,t){let r;for(;"string"==typeof(r=this.refs[t]);)t=r;return r||this.schemas[t]||Bg.call(this,e,t)}function Bg(e,t){const r=this.opts.uriResolver.parse(t),n=(0,Ig._getFullPath)(this.opts.uriResolver,r);let i=(0,Ig.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===i)return zg.call(this,r,e);const o=(0,Ig.normalizeId)(n),a=this.refs[o]||this.schemas[o];if("string"==typeof a){const t=Bg.call(this,e,a);if("object"!=typeof(null==t?void 0:t.schema))return;return zg.call(this,r,t)}if("object"==typeof(null==a?void 0:a.schema)){if(a.validate||Tg.call(this,a),o===(0,Ig.normalizeId)(t)){const{schema:t}=a,{schemaId:r}=this.opts,n=t[r];return n&&(i=(0,Ig.resolveUrl)(this.opts.uriResolver,i,n)),new Og({schema:t,schemaId:r,root:e,baseId:i})}return zg.call(this,r,a)}}xg.SchemaEnv=Og,xg.compileSchema=Tg,xg.resolveRef=function(e,t,r){var n;r=(0,Ig.resolveUrl)(this.opts.uriResolver,t,r);const i=e.refs[r];if(i)return i;let o=$g.call(this,e,r);if(void 0===o){const i=null===(n=e.localRefs)||void 0===n?void 0:n[r],{schemaId:a}=this.opts;i&&(o=new Og({schema:i,schemaId:a,root:e,baseId:t}))}return void 0!==o?e.refs[r]=jg.call(this,o):void 0},xg.getCompilingSchema=Dg,xg.resolveSchema=Bg;const Fg=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function zg(e,{baseId:t,schema:r,root:n}){var i;if("/"!==(null===(i=e.fragment)||void 0===i?void 0:i[0]))return;for(const n of e.fragment.slice(1).split("/")){if("boolean"==typeof r)return;const e=r[(0,Rg.unescapeFragment)(n)];if(void 0===e)return;const i="object"==typeof(r=e)&&r[this.opts.schemaId];!Fg.has(n)&&i&&(t=(0,Ig.resolveUrl)(this.opts.uriResolver,t,i))}let o;if("boolean"!=typeof r&&r.$ref&&!(0,Rg.schemaHasRulesButRef)(r,this.RULES)){const e=(0,Ig.resolveUrl)(this.opts.uriResolver,t,r.$ref);o=Bg.call(this,n,e)}const{schemaId:a}=this.opts;return o=o||new Og({schema:r,schemaId:a,root:n,baseId:t}),o.schema!==o.root.schema?o:void 0}var Ug={$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:!1},Lg={},qg={exports:{}}; + || ${s} === "boolean" || ${o} === null`).assign(u,i._`[${o}]`)}}n.else(),l(e),n.endIf(),n.if(i._`${u} !== undefined`,(()=>{n.assign(o,u),function({gen:e,parentData:t,parentDataProperty:r},n){e.if(i._`${t} !== undefined`,(()=>e.assign(i._`${t}[${r}]`,n)))}(e,u)}))}(e,t,u):l(e)}))}return d};const c=new Set(["string","number","integer","boolean","null"]);function u(e,t,r,n=a.Correct){const o=n===a.Correct?i.operators.EQ:i.operators.NEQ;let s;switch(e){case"null":return i._`${t} ${o} null`;case"array":s=i._`Array.isArray(${t})`;break;case"object":s=i._`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":s=c(i._`!(${t} % 1) && !isNaN(${t})`);break;case"number":s=c();break;default:return i._`typeof ${t} ${o} ${e}`}return n===a.Correct?s:(0,i.not)(s);function c(e=i.nil){return(0,i.and)(i._`typeof ${t} == "number"`,e,r?i._`isFinite(${t})`:i.nil)}}function f(e,t,r,n){if(1===e.length)return u(e[0],t,r,n);let a;const s=(0,o.toHash)(e);if(s.array&&s.object){const e=i._`typeof ${t} != "object"`;a=s.null?e:i._`!${t} || ${e}`,delete s.null,delete s.array,delete s.object}else a=i.nil;s.number&&delete s.integer;for(const e in s)a=(0,i.and)(a,u(e,t,r,n));return a}e.checkDataType=u,e.checkDataTypes=f;const d={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>"string"==typeof e?i._`{type: ${e}}`:i._`{type: ${t}}`};function l(e){const t=function(e){const{gen:t,data:r,schema:n}=e,i=(0,o.schemaRefOrVal)(e,n,"type");return{gen:t,keyword:"type",data:r,schema:n.type,schemaCode:i,schemaValue:i,parentSchema:n,params:{},it:e}}(e);(0,n.reportError)(t,d)}e.reportTypeError=l}(Yp);var om={};Object.defineProperty(om,"__esModule",{value:!0}),om.assignDefaults=void 0;const am=Up,sm=Hp;function cm(e,t,r){const{gen:n,compositeRule:i,data:o,opts:a}=e;if(void 0===r)return;const s=am._`${o}${(0,am.getProperty)(t)}`;if(i)return void(0,sm.checkStrictMode)(e,`default is ignored for: ${s}`);let c=am._`${s} === undefined`;"empty"===a.useDefaults&&(c=am._`${c} || ${s} === null || ${s} === ""`),n.if(c,am._`${s} = ${(0,am.stringify)(r)}`)}om.assignDefaults=function(e,t){const{properties:r,items:n}=e.schema;if("object"===t&&r)for(const t in r)cm(e,t,r[t].default);else"array"===t&&Array.isArray(n)&&n.forEach(((t,r)=>cm(e,r,t.default)))};var um={},fm={};Object.defineProperty(fm,"__esModule",{value:!0}),fm.validateUnion=fm.validateArray=fm.usePattern=fm.callValidateCode=fm.schemaProperties=fm.allSchemaProperties=fm.noPropertyInData=fm.propertyInData=fm.isOwnProperty=fm.hasPropFunc=fm.reportMissingProp=fm.checkMissingProp=fm.checkReportMissingProp=void 0;const dm=Up,lm=Hp,hm=Kp,pm=Hp;function mm(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:dm._`Object.prototype.hasOwnProperty`})}function gm(e,t,r){return dm._`${mm(e)}.call(${t}, ${r})`}function ym(e,t,r,n){const i=dm._`${t}${(0,dm.getProperty)(r)} === undefined`;return n?(0,dm.or)(i,(0,dm.not)(gm(e,t,r))):i}function bm(e){return e?Object.keys(e).filter((e=>"__proto__"!==e)):[]}fm.checkReportMissingProp=function(e,t){const{gen:r,data:n,it:i}=e;r.if(ym(r,n,t,i.opts.ownProperties),(()=>{e.setParams({missingProperty:dm._`${t}`},!0),e.error()}))},fm.checkMissingProp=function({gen:e,data:t,it:{opts:r}},n,i){return(0,dm.or)(...n.map((n=>(0,dm.and)(ym(e,t,n,r.ownProperties),dm._`${i} = ${n}`))))},fm.reportMissingProp=function(e,t){e.setParams({missingProperty:t},!0),e.error()},fm.hasPropFunc=mm,fm.isOwnProperty=gm,fm.propertyInData=function(e,t,r,n){const i=dm._`${t}${(0,dm.getProperty)(r)} !== undefined`;return n?dm._`${i} && ${gm(e,t,r)}`:i},fm.noPropertyInData=ym,fm.allSchemaProperties=bm,fm.schemaProperties=function(e,t){return bm(t).filter((r=>!(0,lm.alwaysValidSchema)(e,t[r])))},fm.callValidateCode=function({schemaCode:e,data:t,it:{gen:r,topSchemaRef:n,schemaPath:i,errorPath:o},it:a},s,c,u){const f=u?dm._`${e}, ${t}, ${n}${i}`:t,d=[[hm.default.instancePath,(0,dm.strConcat)(hm.default.instancePath,o)],[hm.default.parentData,a.parentData],[hm.default.parentDataProperty,a.parentDataProperty],[hm.default.rootData,hm.default.rootData]];a.opts.dynamicRef&&d.push([hm.default.dynamicAnchors,hm.default.dynamicAnchors]);const l=dm._`${f}, ${r.object(...d)}`;return c!==dm.nil?dm._`${s}.call(${c}, ${l})`:dm._`${s}(${l})`};const vm=dm._`new RegExp`;fm.usePattern=function({gen:e,it:{opts:t}},r){const n=t.unicodeRegExp?"u":"",{regExp:i}=t.code,o=i(r,n);return e.scopeValue("pattern",{key:o.toString(),ref:o,code:dm._`${"new RegExp"===i.code?vm:(0,pm.useFunc)(e,i)}(${r}, ${n})`})},fm.validateArray=function(e){const{gen:t,data:r,keyword:n,it:i}=e,o=t.name("valid");if(i.allErrors){const e=t.let("valid",!0);return a((()=>t.assign(e,!1))),e}return t.var(o,!0),a((()=>t.break())),o;function a(i){const a=t.const("len",dm._`${r}.length`);t.forRange("i",0,a,(r=>{e.subschema({keyword:n,dataProp:r,dataPropType:lm.Type.Num},o),t.if((0,dm.not)(o),i)}))}},fm.validateUnion=function(e){const{gen:t,schema:r,keyword:n,it:i}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some((e=>(0,lm.alwaysValidSchema)(i,e)))&&!i.opts.unevaluated)return;const o=t.let("valid",!1),a=t.name("_valid");t.block((()=>r.forEach(((r,i)=>{const s=e.subschema({keyword:n,schemaProp:i,compositeRule:!0},a);t.assign(o,dm._`${o} || ${a}`);e.mergeValidEvaluated(s,a)||t.if((0,dm.not)(o))})))),e.result(o,(()=>e.reset()),(()=>e.error(!0)))},Object.defineProperty(um,"__esModule",{value:!0}),um.validateKeywordUsage=um.validSchemaType=um.funcKeywordCode=um.macroKeywordCode=void 0;const wm=Up,Am=Kp,_m=fm,Em=zp;function Sm(e){const{gen:t,data:r,it:n}=e;t.if(n.parentData,(()=>t.assign(r,wm._`${n.parentData}[${n.parentDataProperty}]`)))}function Pm(e,t,r){if(void 0===r)throw new Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword","function"==typeof r?{ref:r}:{ref:r,code:(0,wm.stringify)(r)})}um.macroKeywordCode=function(e,t){const{gen:r,keyword:n,schema:i,parentSchema:o,it:a}=e,s=t.macro.call(a.self,i,o,a),c=Pm(r,n,s);!1!==a.opts.validateSchema&&a.self.validateSchema(s,!0);const u=r.name("valid");e.subschema({schema:s,schemaPath:wm.nil,errSchemaPath:`${a.errSchemaPath}/${n}`,topSchemaRef:c,compositeRule:!0},u),e.pass(u,(()=>e.error(!0)))},um.funcKeywordCode=function(e,t){var r;const{gen:n,keyword:i,schema:o,parentSchema:a,$data:s,it:c}=e;!function({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}(c,t);const u=!s&&t.compile?t.compile.call(c.self,o,a,c):t.validate,f=Pm(n,i,u),d=n.let("valid");function l(r=(t.async?wm._`await `:wm.nil)){const i=c.opts.passContext?Am.default.this:Am.default.self,o=!("compile"in t&&!s||!1===t.schema);n.assign(d,wm._`${r}${(0,_m.callValidateCode)(e,f,i,o)}`,t.modifying)}function h(e){var r;n.if((0,wm.not)(null!==(r=t.valid)&&void 0!==r?r:d),e)}e.block$data(d,(function(){if(!1===t.errors)l(),t.modifying&&Sm(e),h((()=>e.error()));else{const r=t.async?function(){const e=n.let("ruleErrs",null);return n.try((()=>l(wm._`await `)),(t=>n.assign(d,!1).if(wm._`${t} instanceof ${c.ValidationError}`,(()=>n.assign(e,wm._`${t}.errors`)),(()=>n.throw(t))))),e}():function(){const e=wm._`${f}.errors`;return n.assign(e,null),l(wm.nil),e}();t.modifying&&Sm(e),h((()=>function(e,t){const{gen:r}=e;r.if(wm._`Array.isArray(${t})`,(()=>{r.assign(Am.default.vErrors,wm._`${Am.default.vErrors} === null ? ${t} : ${Am.default.vErrors}.concat(${t})`).assign(Am.default.errors,wm._`${Am.default.vErrors}.length`),(0,Em.extendErrors)(e)}),(()=>e.error()))}(e,r)))}})),e.ok(null!==(r=t.valid)&&void 0!==r?r:d)},um.validSchemaType=function(e,t,r=!1){return!t.length||t.some((t=>"array"===t?Array.isArray(e):"object"===t?e&&"object"==typeof e&&!Array.isArray(e):typeof e==t||r&&void 0===e))},um.validateKeywordUsage=function({schema:e,opts:t,self:r,errSchemaPath:n},i,o){if(Array.isArray(i.keyword)?!i.keyword.includes(o):i.keyword!==o)throw new Error("ajv implementation error");const a=i.dependencies;if(null==a?void 0:a.some((t=>!Object.prototype.hasOwnProperty.call(e,t))))throw new Error(`parent schema must have dependencies of ${o}: ${a.join(",")}`);if(i.validateSchema){if(!i.validateSchema(e[o])){const e=`keyword "${o}" value is invalid at path "${n}": `+r.errorsText(i.validateSchema.errors);if("log"!==t.validateSchema)throw new Error(e);r.logger.error(e)}}};var xm={};Object.defineProperty(xm,"__esModule",{value:!0}),xm.extendSubschemaMode=xm.extendSubschemaData=xm.getSubschema=void 0;const km=Up,Mm=Hp;xm.getSubschema=function(e,{keyword:t,schemaProp:r,schema:n,schemaPath:i,errSchemaPath:o,topSchemaRef:a}){if(void 0!==t&&void 0!==n)throw new Error('both "keyword" and "schema" passed, only one allowed');if(void 0!==t){const n=e.schema[t];return void 0===r?{schema:n,schemaPath:km._`${e.schemaPath}${(0,km.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:n[r],schemaPath:km._`${e.schemaPath}${(0,km.getProperty)(t)}${(0,km.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,Mm.escapeFragment)(r)}`}}if(void 0!==n){if(void 0===i||void 0===o||void 0===a)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:i,topSchemaRef:a,errSchemaPath:o}}throw new Error('either "keyword" or "schema" must be passed')},xm.extendSubschemaData=function(e,t,{dataProp:r,dataPropType:n,data:i,dataTypes:o,propertyName:a}){if(void 0!==i&&void 0!==r)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:s}=t;if(void 0!==r){const{errorPath:i,dataPathArr:o,opts:a}=t;c(s.let("data",km._`${t.data}${(0,km.getProperty)(r)}`,!0)),e.errorPath=km.str`${i}${(0,Mm.getErrorPath)(r,n,a.jsPropertySyntax)}`,e.parentDataProperty=km._`${r}`,e.dataPathArr=[...o,e.parentDataProperty]}if(void 0!==i){c(i instanceof km.Name?i:s.let("data",i,!0)),void 0!==a&&(e.propertyName=a)}function c(r){e.data=r,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,r]}o&&(e.dataTypes=o)},xm.extendSubschemaMode=function(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:n,createErrors:i,allErrors:o}){void 0!==n&&(e.compositeRule=n),void 0!==i&&(e.createErrors=i),void 0!==o&&(e.allErrors=o),e.jtdDiscriminator=t,e.jtdMetadata=r};var Cm={},Im=function e(t,r){if(t===r)return!0;if(t&&r&&"object"==typeof t&&"object"==typeof r){if(t.constructor!==r.constructor)return!1;var n,i,o;if(Array.isArray(t)){if((n=t.length)!=r.length)return!1;for(i=n;0!=i--;)if(!e(t[i],r[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if((n=(o=Object.keys(t)).length)!==Object.keys(r).length)return!1;for(i=n;0!=i--;)if(!Object.prototype.hasOwnProperty.call(r,o[i]))return!1;for(i=n;0!=i--;){var a=o[i];if(!e(t[a],r[a]))return!1}return!0}return t!=t&&r!=r},Rm={exports:{}},Nm=Rm.exports=function(e,t,r){"function"==typeof t&&(r=t,t={}),Om(t,"function"==typeof(r=t.cb||r)?r:r.pre||function(){},r.post||function(){},e,"",e)};function Om(e,t,r,n,i,o,a,s,c,u){if(n&&"object"==typeof n&&!Array.isArray(n)){for(var f in t(n,i,o,a,s,c,u),n){var d=n[f];if(Array.isArray(d)){if(f in Nm.arrayKeywords)for(var l=0;lt+=Um(e))),t===1/0))return 1/0}return t}function Lm(e,t="",r){!1!==r&&(t=Km(t));const n=e.parse(t);return qm(e,n)}function qm(e,t){return e.serialize(t).split("#")[0]+"#"}Cm.getFullPath=Lm,Cm._getFullPath=qm;const Hm=/#\/?$/;function Km(e){return e?e.replace(Hm,""):""}Cm.normalizeId=Km,Cm.resolveUrl=function(e,t,r){return r=Km(r),e.resolve(t,r)};const Jm=/^[a-z_][-a-z0-9._]*$/i;Cm.getSchemaRefs=function(e,t){if("boolean"==typeof e)return{};const{schemaId:r,uriResolver:n}=this.opts,i=Km(e[r]||t),o={"":i},a=Lm(n,i,!1),s={},c=new Set;return $m(e,{allKeys:!0},((e,t,n,i)=>{if(void 0===i)return;const d=a+t;let l=o[i];function h(t){const r=this.opts.uriResolver.resolve;if(t=Km(l?r(l,t):t),c.has(t))throw f(t);c.add(t);let n=this.refs[t];return"string"==typeof n&&(n=this.refs[n]),"object"==typeof n?u(e,n.schema,t):t!==Km(d)&&("#"===t[0]?(u(e,s[t],t),s[t]=e):this.refs[t]=d),t}function p(e){if("string"==typeof e){if(!Jm.test(e))throw new Error(`invalid anchor "${e}"`);h.call(this,`#${e}`)}}"string"==typeof e[r]&&(l=h.call(this,e[r])),p.call(this,e.$anchor),p.call(this,e.$dynamicAnchor),o[t]=l})),s;function u(e,t,r){if(void 0!==t&&!Dm(e,t))throw f(r)}function f(e){return new Error(`reference "${e}" resolves to more than one schema`)}},Object.defineProperty(Bp,"__esModule",{value:!0}),Bp.getData=Bp.KeywordCxt=Bp.validateFunctionCode=void 0;const Wm=Fp,Gm=Yp,Vm=rm,Zm=Yp,Xm=om,Qm=um,Ym=xm,eg=Up,tg=Kp,rg=Cm,ng=Hp,ig=zp;function og({gen:e,validateName:t,schema:r,schemaEnv:n,opts:i},o){i.code.es5?e.func(t,eg._`${tg.default.data}, ${tg.default.valCxt}`,n.$async,(()=>{e.code(eg._`"use strict"; ${ag(r,i)}`),function(e,t){e.if(tg.default.valCxt,(()=>{e.var(tg.default.instancePath,eg._`${tg.default.valCxt}.${tg.default.instancePath}`),e.var(tg.default.parentData,eg._`${tg.default.valCxt}.${tg.default.parentData}`),e.var(tg.default.parentDataProperty,eg._`${tg.default.valCxt}.${tg.default.parentDataProperty}`),e.var(tg.default.rootData,eg._`${tg.default.valCxt}.${tg.default.rootData}`),t.dynamicRef&&e.var(tg.default.dynamicAnchors,eg._`${tg.default.valCxt}.${tg.default.dynamicAnchors}`)}),(()=>{e.var(tg.default.instancePath,eg._`""`),e.var(tg.default.parentData,eg._`undefined`),e.var(tg.default.parentDataProperty,eg._`undefined`),e.var(tg.default.rootData,tg.default.data),t.dynamicRef&&e.var(tg.default.dynamicAnchors,eg._`{}`)}))}(e,i),e.code(o)})):e.func(t,eg._`${tg.default.data}, ${function(e){return eg._`{${tg.default.instancePath}="", ${tg.default.parentData}, ${tg.default.parentDataProperty}, ${tg.default.rootData}=${tg.default.data}${e.dynamicRef?eg._`, ${tg.default.dynamicAnchors}={}`:eg.nil}}={}`}(i)}`,n.$async,(()=>e.code(ag(r,i)).code(o)))}function ag(e,t){const r="object"==typeof e&&e[t.schemaId];return r&&(t.code.source||t.code.process)?eg._`/*# sourceURL=${r} */`:eg.nil}function sg(e,t){ug(e)&&(fg(e),cg(e))?function(e,t){const{schema:r,gen:n,opts:i}=e;i.$comment&&r.$comment&&lg(e);(function(e){const t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,rg.resolveUrl)(e.opts.uriResolver,e.baseId,t))})(e),function(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}(e);const o=n.const("_errs",tg.default.errors);dg(e,o),n.var(t,eg._`${o} === ${tg.default.errors}`)}(e,t):(0,Wm.boolOrEmptySchema)(e,t)}function cg({schema:e,self:t}){if("boolean"==typeof e)return!e;for(const r in e)if(t.RULES.all[r])return!0;return!1}function ug(e){return"boolean"!=typeof e.schema}function fg(e){(0,ng.checkUnknownRules)(e),function(e){const{schema:t,errSchemaPath:r,opts:n,self:i}=e;t.$ref&&n.ignoreKeywordsWithRef&&(0,ng.schemaHasRulesButRef)(t,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}(e)}function dg(e,t){if(e.opts.jtd)return hg(e,[],!1,t);const r=(0,Gm.getSchemaTypes)(e.schema);hg(e,r,!(0,Gm.coerceAndCheckDataType)(e,r),t)}function lg({gen:e,schemaEnv:t,schema:r,errSchemaPath:n,opts:i}){const o=r.$comment;if(!0===i.$comment)e.code(eg._`${tg.default.self}.logger.log(${o})`);else if("function"==typeof i.$comment){const r=eg.str`${n}/$comment`,i=e.scopeValue("root",{ref:t.root});e.code(eg._`${tg.default.self}.opts.$comment(${o}, ${r}, ${i}.schema)`)}}function hg(e,t,r,n){const{gen:i,schema:o,data:a,allErrors:s,opts:c,self:u}=e,{RULES:f}=u;function d(u){(0,Vm.shouldUseGroup)(o,u)&&(u.type?(i.if((0,Zm.checkDataType)(u.type,a,c.strictNumbers)),pg(e,u),1===t.length&&t[0]===u.type&&r&&(i.else(),(0,Zm.reportTypeError)(e)),i.endIf()):pg(e,u),s||i.if(eg._`${tg.default.errors} === ${n||0}`))}!o.$ref||!c.ignoreKeywordsWithRef&&(0,ng.schemaHasRulesButRef)(o,f)?(c.jtd||function(e,t){if(e.schemaEnv.meta||!e.opts.strictTypes)return;(function(e,t){if(!t.length)return;if(!e.dataTypes.length)return void(e.dataTypes=t);t.forEach((t=>{gg(e.dataTypes,t)||yg(e,`type "${t}" not allowed by context "${e.dataTypes.join(",")}"`)})),function(e,t){const r=[];for(const n of e.dataTypes)gg(t,n)?r.push(n):t.includes("integer")&&"number"===n&&r.push("integer");e.dataTypes=r}(e,t)})(e,t),e.opts.allowUnionTypes||function(e,t){t.length>1&&(2!==t.length||!t.includes("null"))&&yg(e,"use allowUnionTypes to allow union type keyword")}(e,t);!function(e,t){const r=e.self.RULES.all;for(const n in r){const i=r[n];if("object"==typeof i&&(0,Vm.shouldUseRule)(e.schema,i)){const{type:r}=i.definition;r.length&&!r.some((e=>mg(t,e)))&&yg(e,`missing type "${r.join(",")}" for keyword "${n}"`)}}}(e,e.dataTypes)}(e,t),i.block((()=>{for(const e of f.rules)d(e);d(f.post)}))):i.block((()=>vg(e,"$ref",f.all.$ref.definition)))}function pg(e,t){const{gen:r,schema:n,opts:{useDefaults:i}}=e;i&&(0,Xm.assignDefaults)(e,t.type),r.block((()=>{for(const r of t.rules)(0,Vm.shouldUseRule)(n,r)&&vg(e,r.keyword,r.definition,t.type)}))}function mg(e,t){return e.includes(t)||"number"===t&&e.includes("integer")}function gg(e,t){return e.includes(t)||"integer"===t&&e.includes("number")}function yg(e,t){t+=` at "${e.schemaEnv.baseId+e.errSchemaPath}" (strictTypes)`,(0,ng.checkStrictMode)(e,t,e.opts.strictTypes)}Bp.validateFunctionCode=function(e){ug(e)&&(fg(e),cg(e))?function(e){const{schema:t,opts:r,gen:n}=e;og(e,(()=>{r.$comment&&t.$comment&&lg(e),function(e){const{schema:t,opts:r}=e;void 0!==t.default&&r.useDefaults&&r.strictSchema&&(0,ng.checkStrictMode)(e,"default is ignored in the schema root")}(e),n.let(tg.default.vErrors,null),n.let(tg.default.errors,0),r.unevaluated&&function(e){const{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",eg._`${r}.evaluated`),t.if(eg._`${e.evaluated}.dynamicProps`,(()=>t.assign(eg._`${e.evaluated}.props`,eg._`undefined`))),t.if(eg._`${e.evaluated}.dynamicItems`,(()=>t.assign(eg._`${e.evaluated}.items`,eg._`undefined`)))}(e),dg(e),function(e){const{gen:t,schemaEnv:r,validateName:n,ValidationError:i,opts:o}=e;r.$async?t.if(eg._`${tg.default.errors} === 0`,(()=>t.return(tg.default.data)),(()=>t.throw(eg._`new ${i}(${tg.default.vErrors})`))):(t.assign(eg._`${n}.errors`,tg.default.vErrors),o.unevaluated&&function({gen:e,evaluated:t,props:r,items:n}){r instanceof eg.Name&&e.assign(eg._`${t}.props`,r);n instanceof eg.Name&&e.assign(eg._`${t}.items`,n)}(e),t.return(eg._`${tg.default.errors} === 0`))}(e)}))}(e):og(e,(()=>(0,Wm.topBoolOrEmptySchema)(e)))};class bg{constructor(e,t,r){if((0,Qm.validateKeywordUsage)(e,t,r),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=r,this.data=e.data,this.schema=e.schema[r],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,ng.schemaRefOrVal)(e,this.schema,r,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const("vSchema",_g(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,Qm.validSchemaType)(this.schema,t.schemaType,t.allowUndefined))throw new Error(`${r} value must be ${JSON.stringify(t.schemaType)}`);("code"in t?t.trackErrors:!1!==t.errors)&&(this.errsCount=e.gen.const("_errs",tg.default.errors))}result(e,t,r){this.failResult((0,eg.not)(e),t,r)}failResult(e,t,r){this.gen.if(e),r?r():this.error(),t?(this.gen.else(),t(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,t){this.failResult((0,eg.not)(e),void 0,t)}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:t}=this;this.fail(eg._`${t} !== undefined && (${(0,eg.or)(this.invalid$data(),e)})`)}error(e,t,r){if(t)return this.setParams(t),this._error(e,r),void this.setParams({});this._error(e,r)}_error(e,t){(e?ig.reportExtraError:ig.reportError)(this,this.def.error,t)}$dataError(){(0,ig.reportError)(this,this.def.$dataError||ig.keyword$DataError)}reset(){if(void 0===this.errsCount)throw new Error('add "trackErrors" to keyword definition');(0,ig.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,t){t?Object.assign(this.params,e):this.params=e}block$data(e,t,r=eg.nil){this.gen.block((()=>{this.check$data(e,r),t()}))}check$data(e=eg.nil,t=eg.nil){if(!this.$data)return;const{gen:r,schemaCode:n,schemaType:i,def:o}=this;r.if((0,eg.or)(eg._`${n} === undefined`,t)),e!==eg.nil&&r.assign(e,!0),(i.length||o.validateSchema)&&(r.elseIf(this.invalid$data()),this.$dataError(),e!==eg.nil&&r.assign(e,!1)),r.else()}invalid$data(){const{gen:e,schemaCode:t,schemaType:r,def:n,it:i}=this;return(0,eg.or)(function(){if(r.length){if(!(t instanceof eg.Name))throw new Error("ajv implementation error");const e=Array.isArray(r)?r:[r];return eg._`${(0,Zm.checkDataTypes)(e,t,i.opts.strictNumbers,Zm.DataType.Wrong)}`}return eg.nil}(),function(){if(n.validateSchema){const r=e.scopeValue("validate$data",{ref:n.validateSchema});return eg._`!${r}(${t})`}return eg.nil}())}subschema(e,t){const r=(0,Ym.getSubschema)(this.it,e);(0,Ym.extendSubschemaData)(r,this.it,e),(0,Ym.extendSubschemaMode)(r,e);const n={...this.it,...r,items:void 0,props:void 0};return sg(n,t),n}mergeEvaluated(e,t){const{it:r,gen:n}=this;r.opts.unevaluated&&(!0!==r.props&&void 0!==e.props&&(r.props=ng.mergeEvaluated.props(n,e.props,r.props,t)),!0!==r.items&&void 0!==e.items&&(r.items=ng.mergeEvaluated.items(n,e.items,r.items,t)))}mergeValidEvaluated(e,t){const{it:r,gen:n}=this;if(r.opts.unevaluated&&(!0!==r.props||!0!==r.items))return n.if(t,(()=>this.mergeEvaluated(e,eg.Name))),!0}}function vg(e,t,r,n){const i=new bg(e,r,t);"code"in r?r.code(i,n):i.$data&&r.validate?(0,Qm.funcKeywordCode)(i,r):"macro"in r?(0,Qm.macroKeywordCode)(i,r):(r.compile||r.validate)&&(0,Qm.funcKeywordCode)(i,r)}Bp.KeywordCxt=bg;const wg=/^\/(?:[^~]|~0|~1)*$/,Ag=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function _g(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let i,o;if(""===e)return tg.default.rootData;if("/"===e[0]){if(!wg.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);i=e,o=tg.default.rootData}else{const a=Ag.exec(e);if(!a)throw new Error(`Invalid JSON-pointer: ${e}`);const s=+a[1];if(i=a[2],"#"===i){if(s>=t)throw new Error(c("property/index",s));return n[t-s]}if(s>t)throw new Error(c("data",s));if(o=r[t-s],!i)return o}let a=o;const s=i.split("/");for(const e of s)e&&(o=eg._`${o}${(0,eg.getProperty)((0,ng.unescapeJsonPointer)(e))}`,a=eg._`${a} && ${o}`);return a;function c(e,r){return`Cannot access ${e} ${r} levels up, current level is ${t}`}}Bp.getData=_g;var Eg={};Object.defineProperty(Eg,"__esModule",{value:!0});class Sg extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}}Eg.default=Sg;var Pg={};Object.defineProperty(Pg,"__esModule",{value:!0});const xg=Cm;class kg extends Error{constructor(e,t,r,n){super(n||`can't resolve reference ${r} from id ${t}`),this.missingRef=(0,xg.resolveUrl)(e,t,r),this.missingSchema=(0,xg.normalizeId)((0,xg.getFullPath)(e,this.missingRef))}}Pg.default=kg;var Mg={};Object.defineProperty(Mg,"__esModule",{value:!0}),Mg.resolveSchema=Mg.getCompilingSchema=Mg.resolveRef=Mg.compileSchema=Mg.SchemaEnv=void 0;const Cg=Up,Ig=Eg,Rg=Kp,Ng=Cm,Og=Hp,Tg=Bp;class jg{constructor(e){var t;let r;this.refs={},this.dynamicAnchors={},"object"==typeof e.schema&&(r=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=null!==(t=e.baseId)&&void 0!==t?t:(0,Ng.normalizeId)(null==r?void 0:r[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=null==r?void 0:r.$async,this.refs={}}}function Dg(e){const t=Bg.call(this,e);if(t)return t;const r=(0,Ng.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:n,lines:i}=this.opts.code,{ownProperties:o}=this.opts,a=new Cg.CodeGen(this.scope,{es5:n,lines:i,ownProperties:o});let s;e.$async&&(s=a.scopeValue("Error",{ref:Ig.default,code:Cg._`require("ajv/dist/runtime/validation_error").default`}));const c=a.scopeName("validate");e.validateName=c;const u={gen:a,allErrors:this.opts.allErrors,data:Rg.default.data,parentData:Rg.default.parentData,parentDataProperty:Rg.default.parentDataProperty,dataNames:[Rg.default.data],dataPathArr:[Cg.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:a.scopeValue("schema",!0===this.opts.code.source?{ref:e.schema,code:(0,Cg.stringify)(e.schema)}:{ref:e.schema}),validateName:c,ValidationError:s,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:Cg.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:Cg._`""`,opts:this.opts,self:this};let f;try{this._compilations.add(e),(0,Tg.validateFunctionCode)(u),a.optimize(this.opts.code.optimize);const t=a.toString();f=`${a.scopeRefs(Rg.default.scope)}return ${t}`,this.opts.code.process&&(f=this.opts.code.process(f,e));const r=new Function(`${Rg.default.self}`,`${Rg.default.scope}`,f)(this,this.scope.get());if(this.scope.value(c,{ref:r}),r.errors=null,r.schema=e.schema,r.schemaEnv=e,e.$async&&(r.$async=!0),!0===this.opts.code.source&&(r.source={validateName:c,validateCode:t,scopeValues:a._values}),this.opts.unevaluated){const{props:e,items:t}=u;r.evaluated={props:e instanceof Cg.Name?void 0:e,items:t instanceof Cg.Name?void 0:t,dynamicProps:e instanceof Cg.Name,dynamicItems:t instanceof Cg.Name},r.source&&(r.source.evaluated=(0,Cg.stringify)(r.evaluated))}return e.validate=r,e}catch(t){throw delete e.validate,delete e.validateName,f&&this.logger.error("Error compiling schema, function code:",f),t}finally{this._compilations.delete(e)}}function $g(e){return(0,Ng.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:Dg.call(this,e)}function Bg(e){for(const n of this._compilations)if(r=e,(t=n).schema===r.schema&&t.root===r.root&&t.baseId===r.baseId)return n;var t,r}function Fg(e,t){let r;for(;"string"==typeof(r=this.refs[t]);)t=r;return r||this.schemas[t]||zg.call(this,e,t)}function zg(e,t){const r=this.opts.uriResolver.parse(t),n=(0,Ng._getFullPath)(this.opts.uriResolver,r);let i=(0,Ng.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===i)return Lg.call(this,r,e);const o=(0,Ng.normalizeId)(n),a=this.refs[o]||this.schemas[o];if("string"==typeof a){const t=zg.call(this,e,a);if("object"!=typeof(null==t?void 0:t.schema))return;return Lg.call(this,r,t)}if("object"==typeof(null==a?void 0:a.schema)){if(a.validate||Dg.call(this,a),o===(0,Ng.normalizeId)(t)){const{schema:t}=a,{schemaId:r}=this.opts,n=t[r];return n&&(i=(0,Ng.resolveUrl)(this.opts.uriResolver,i,n)),new jg({schema:t,schemaId:r,root:e,baseId:i})}return Lg.call(this,r,a)}}Mg.SchemaEnv=jg,Mg.compileSchema=Dg,Mg.resolveRef=function(e,t,r){var n;r=(0,Ng.resolveUrl)(this.opts.uriResolver,t,r);const i=e.refs[r];if(i)return i;let o=Fg.call(this,e,r);if(void 0===o){const i=null===(n=e.localRefs)||void 0===n?void 0:n[r],{schemaId:a}=this.opts;i&&(o=new jg({schema:i,schemaId:a,root:e,baseId:t}))}return void 0!==o?e.refs[r]=$g.call(this,o):void 0},Mg.getCompilingSchema=Bg,Mg.resolveSchema=zg;const Ug=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Lg(e,{baseId:t,schema:r,root:n}){var i;if("/"!==(null===(i=e.fragment)||void 0===i?void 0:i[0]))return;for(const n of e.fragment.slice(1).split("/")){if("boolean"==typeof r)return;const e=r[(0,Og.unescapeFragment)(n)];if(void 0===e)return;const i="object"==typeof(r=e)&&r[this.opts.schemaId];!Ug.has(n)&&i&&(t=(0,Ng.resolveUrl)(this.opts.uriResolver,t,i))}let o;if("boolean"!=typeof r&&r.$ref&&!(0,Og.schemaHasRulesButRef)(r,this.RULES)){const e=(0,Ng.resolveUrl)(this.opts.uriResolver,t,r.$ref);o=zg.call(this,n,e)}const{schemaId:a}=this.opts;return o=o||new jg({schema:r,schemaId:a,root:n,baseId:t}),o.schema!==o.root.schema?o:void 0}var qg={$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:!1},Hg={},Kg={exports:{}}; /** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */ -!function(e,t){!function(e){function t(){for(var e=arguments.length,t=Array(e),r=0;r1){t[0]=t[0].slice(0,-1);for(var n=t.length-1,i=1;i= 0x80 (not a basic code point)","invalid-input":"Invalid input"},P=h-p,x=Math.floor,k=String.fromCharCode;function M(e){throw new RangeError(S[e])}function C(e,t){for(var r=[],n=e.length;n--;)r[n]=t(e[n]);return r}function I(e,t){var r=e.split("@"),n="";return r.length>1&&(n=r[0]+"@",e=r[1]),n+C((e=e.replace(E,".")).split("."),t).join(".")}function R(e){for(var t=[],r=0,n=e.length;r=55296&&i<=56319&&r>1,e+=x(e/t);e>P*m>>1;n+=h)e=x(e/P);return x(n+(P+1)*e/(e+g))},j=function(e){var t=[],r=e.length,n=0,i=v,o=b,a=e.lastIndexOf(w);a<0&&(a=0);for(var s=0;s=128&&M("not-basic"),t.push(e.charCodeAt(s));for(var c=a>0?a+1:0;c=r&&M("invalid-input");var g=N(e.charCodeAt(c++));(g>=h||g>x((l-n)/f))&&M("overflow"),n+=g*f;var y=d<=o?p:d>=o+m?m:d-o;if(gx(l/A)&&M("overflow"),f*=A}var _=t.length+1;o=T(n-u,_,0==u),x(n/_)>l-i&&M("overflow"),i+=x(n/_),n%=_,t.splice(n++,0,i)}return String.fromCodePoint.apply(String,t)},D=function(e){var t=[],r=(e=R(e)).length,n=v,i=0,o=b,a=!0,s=!1,c=void 0;try{for(var u,f=e[Symbol.iterator]();!(a=(u=f.next()).done);a=!0){var d=u.value;d<128&&t.push(k(d))}}catch(e){s=!0,c=e}finally{try{!a&&f.return&&f.return()}finally{if(s)throw c}}var g=t.length,y=g;for(g&&t.push(w);y=n&&Ix((l-i)/N)&&M("overflow"),i+=(A-n)*N,n=A;var j=!0,D=!1,$=void 0;try{for(var B,F=e[Symbol.iterator]();!(j=(B=F.next()).done);j=!0){var z=B.value;if(zl&&M("overflow"),z==n){for(var U=i,L=h;;L+=h){var q=L<=o?p:L>=o+m?m:L-o;if(U>6|192).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase():"%"+(t>>12|224).toString(16).toUpperCase()+"%"+(t>>6&63|128).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase()}function L(e){for(var t="",r=0,n=e.length;r=194&&i<224){if(n-r>=6){var o=parseInt(e.substr(r+4,2),16);t+=String.fromCharCode((31&i)<<6|63&o)}else t+=e.substr(r,6);r+=6}else if(i>=224){if(n-r>=9){var a=parseInt(e.substr(r+4,2),16),s=parseInt(e.substr(r+7,2),16);t+=String.fromCharCode((15&i)<<12|(63&a)<<6|63&s)}else t+=e.substr(r,9);r+=9}else t+=e.substr(r,3),r+=3}return t}function q(e,t){function r(e){var r=L(e);return r.match(t.UNRESERVED)?r:e}return e.scheme&&(e.scheme=String(e.scheme).replace(t.PCT_ENCODED,r).toLowerCase().replace(t.NOT_SCHEME,"")),void 0!==e.userinfo&&(e.userinfo=String(e.userinfo).replace(t.PCT_ENCODED,r).replace(t.NOT_USERINFO,U).replace(t.PCT_ENCODED,i)),void 0!==e.host&&(e.host=String(e.host).replace(t.PCT_ENCODED,r).toLowerCase().replace(t.NOT_HOST,U).replace(t.PCT_ENCODED,i)),void 0!==e.path&&(e.path=String(e.path).replace(t.PCT_ENCODED,r).replace(e.scheme?t.NOT_PATH:t.NOT_PATH_NOSCHEME,U).replace(t.PCT_ENCODED,i)),void 0!==e.query&&(e.query=String(e.query).replace(t.PCT_ENCODED,r).replace(t.NOT_QUERY,U).replace(t.PCT_ENCODED,i)),void 0!==e.fragment&&(e.fragment=String(e.fragment).replace(t.PCT_ENCODED,r).replace(t.NOT_FRAGMENT,U).replace(t.PCT_ENCODED,i)),e}function H(e){return e.replace(/^0*(.*)/,"$1")||"0"}function K(e,t){var r=e.match(t.IPV4ADDRESS)||[],n=f(r,2)[1];return n?n.split(".").map(H).join("."):e}function J(e,t){var r=e.match(t.IPV6ADDRESS)||[],n=f(r,3),i=n[1],o=n[2];if(i){for(var a=i.toLowerCase().split("::").reverse(),s=f(a,2),c=s[0],u=s[1],d=u?u.split(":").map(H):[],l=c.split(":").map(H),h=t.IPV4ADDRESS.test(l[l.length-1]),p=h?7:8,m=l.length-p,g=Array(p),y=0;y1){var A=g.slice(0,v.index),_=g.slice(v.index+v.length);w=A.join(":")+"::"+_.join(":")}else w=g.join(":");return o&&(w+="%"+o),w}return e}var W=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,G=void 0==="".match(/(){0}/)[1];function V(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={},n=!1!==t.iri?u:c;"suffix"===t.reference&&(e=(t.scheme?t.scheme+":":"")+"//"+e);var i=e.match(W);if(i){G?(r.scheme=i[1],r.userinfo=i[3],r.host=i[4],r.port=parseInt(i[5],10),r.path=i[6]||"",r.query=i[7],r.fragment=i[8],isNaN(r.port)&&(r.port=i[5])):(r.scheme=i[1]||void 0,r.userinfo=-1!==e.indexOf("@")?i[3]:void 0,r.host=-1!==e.indexOf("//")?i[4]:void 0,r.port=parseInt(i[5],10),r.path=i[6]||"",r.query=-1!==e.indexOf("?")?i[7]:void 0,r.fragment=-1!==e.indexOf("#")?i[8]:void 0,isNaN(r.port)&&(r.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?i[4]:void 0)),r.host&&(r.host=J(K(r.host,n),n)),void 0!==r.scheme||void 0!==r.userinfo||void 0!==r.host||void 0!==r.port||r.path||void 0!==r.query?void 0===r.scheme?r.reference="relative":void 0===r.fragment?r.reference="absolute":r.reference="uri":r.reference="same-document",t.reference&&"suffix"!==t.reference&&t.reference!==r.reference&&(r.error=r.error||"URI is not a "+t.reference+" reference.");var o=z[(t.scheme||r.scheme||"").toLowerCase()];if(t.unicodeSupport||o&&o.unicodeSupport)q(r,n);else{if(r.host&&(t.domainHost||o&&o.domainHost))try{r.host=F.toASCII(r.host.replace(n.PCT_ENCODED,L).toLowerCase())}catch(e){r.error=r.error||"Host's domain name can not be converted to ASCII via punycode: "+e}q(r,c)}o&&o.parse&&o.parse(r,t)}else r.error=r.error||"URI can not be parsed.";return r}function Z(e,t){var r=!1!==t.iri?u:c,n=[];return void 0!==e.userinfo&&(n.push(e.userinfo),n.push("@")),void 0!==e.host&&n.push(J(K(String(e.host),r),r).replace(r.IPV6ADDRESS,(function(e,t,r){return"["+t+(r?"%25"+r:"")+"]"}))),"number"!=typeof e.port&&"string"!=typeof e.port||(n.push(":"),n.push(String(e.port))),n.length?n.join(""):void 0}var X=/^\.\.?\//,Q=/^\/\.(\/|$)/,Y=/^\/\.\.(\/|$)/,ee=/^\/?(?:.|\n)*?(?=\/|$)/;function te(e){for(var t=[];e.length;)if(e.match(X))e=e.replace(X,"");else if(e.match(Q))e=e.replace(Q,"/");else if(e.match(Y))e=e.replace(Y,"/"),t.pop();else if("."===e||".."===e)e="";else{var r=e.match(ee);if(!r)throw new Error("Unexpected dot segment condition");var n=r[0];e=e.slice(n.length),t.push(n)}return t.join("")}function re(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.iri?u:c,n=[],i=z[(t.scheme||e.scheme||"").toLowerCase()];if(i&&i.serialize&&i.serialize(e,t),e.host)if(r.IPV6ADDRESS.test(e.host));else if(t.domainHost||i&&i.domainHost)try{e.host=t.iri?F.toUnicode(e.host):F.toASCII(e.host.replace(r.PCT_ENCODED,L).toLowerCase())}catch(r){e.error=e.error||"Host's domain name can not be converted to "+(t.iri?"Unicode":"ASCII")+" via punycode: "+r}q(e,r),"suffix"!==t.reference&&e.scheme&&(n.push(e.scheme),n.push(":"));var o=Z(e,t);if(void 0!==o&&("suffix"!==t.reference&&n.push("//"),n.push(o),e.path&&"/"!==e.path.charAt(0)&&n.push("/")),void 0!==e.path){var a=e.path;t.absolutePath||i&&i.absolutePath||(a=te(a)),void 0===o&&(a=a.replace(/^\/\//,"/%2F")),n.push(a)}return void 0!==e.query&&(n.push("?"),n.push(e.query)),void 0!==e.fragment&&(n.push("#"),n.push(e.fragment)),n.join("")}function ne(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n={};return arguments[3]||(e=V(re(e,r),r),t=V(re(t,r),r)),!(r=r||{}).tolerant&&t.scheme?(n.scheme=t.scheme,n.userinfo=t.userinfo,n.host=t.host,n.port=t.port,n.path=te(t.path||""),n.query=t.query):(void 0!==t.userinfo||void 0!==t.host||void 0!==t.port?(n.userinfo=t.userinfo,n.host=t.host,n.port=t.port,n.path=te(t.path||""),n.query=t.query):(t.path?("/"===t.path.charAt(0)?n.path=te(t.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?n.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:n.path=t.path:n.path="/"+t.path,n.path=te(n.path)),n.query=t.query):(n.path=e.path,void 0!==t.query?n.query=t.query:n.query=e.query),n.userinfo=e.userinfo,n.host=e.host,n.port=e.port),n.scheme=e.scheme),n.fragment=t.fragment,n}function ie(e,t,r){var n=a({scheme:"null"},r);return re(ne(V(e,n),V(t,n),n,!0),n)}function oe(e,t){return"string"==typeof e?e=re(V(e,t),t):"object"===n(e)&&(e=V(re(e,t),t)),e}function ae(e,t,r){return"string"==typeof e?e=re(V(e,r),r):"object"===n(e)&&(e=re(e,r)),"string"==typeof t?t=re(V(t,r),r):"object"===n(t)&&(t=re(t,r)),e===t}function se(e,t){return e&&e.toString().replace(t&&t.iri?u.ESCAPE:c.ESCAPE,U)}function ce(e,t){return e&&e.toString().replace(t&&t.iri?u.PCT_ENCODED:c.PCT_ENCODED,L)}var ue={scheme:"http",domainHost:!0,parse:function(e,t){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e},serialize:function(e,t){var r="https"===String(e.scheme).toLowerCase();return e.port!==(r?443:80)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}},fe={scheme:"https",domainHost:ue.domainHost,parse:ue.parse,serialize:ue.serialize};function de(e){return"boolean"==typeof e.secure?e.secure:"wss"===String(e.scheme).toLowerCase()}var le={scheme:"ws",domainHost:!0,parse:function(e,t){var r=e;return r.secure=de(r),r.resourceName=(r.path||"/")+(r.query?"?"+r.query:""),r.path=void 0,r.query=void 0,r},serialize:function(e,t){if(e.port!==(de(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){var r=e.resourceName.split("?"),n=f(r,2),i=n[0],o=n[1];e.path=i&&"/"!==i?i:void 0,e.query=o,e.resourceName=void 0}return e.fragment=void 0,e}},he={scheme:"wss",domainHost:le.domainHost,parse:le.parse,serialize:le.serialize},pe={},me="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",ge="[0-9A-Fa-f]",ye=r(r("%[EFef]"+ge+"%"+ge+ge+"%"+ge+ge)+"|"+r("%[89A-Fa-f]"+ge+"%"+ge+ge)+"|"+r("%"+ge+ge)),be="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",ve=t("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),we="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",Ae=new RegExp(me,"g"),_e=new RegExp(ye,"g"),Ee=new RegExp(t("[^]",be,"[\\.]",'[\\"]',ve),"g"),Se=new RegExp(t("[^]",me,we),"g"),Pe=Se;function xe(e){var t=L(e);return t.match(Ae)?t:e}var ke={scheme:"mailto",parse:function(e,t){var r=e,n=r.to=r.path?r.path.split(","):[];if(r.path=void 0,r.query){for(var i=!1,o={},a=r.query.split("&"),s=0,c=a.length;snew RegExp(e,t);h.code="new RegExp";const p=["removeAdditional","useDefaults","coerceTypes"],m=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),g={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 b(e){var t,r,n,i,o,a,s,c,u,f,d,p,m,g,y,b,v,w,A,_,E,S,P,x,k;const M=e.strict,C=null===(t=e.code)||void 0===t?void 0:t.optimize,I=!0===C||void 0===C?1:C||0,R=null!==(n=null===(r=e.code)||void 0===r?void 0:r.regExp)&&void 0!==n?n:h,N=null!==(i=e.uriResolver)&&void 0!==i?i:l.default;return{strictSchema:null===(a=null!==(o=e.strictSchema)&&void 0!==o?o:M)||void 0===a||a,strictNumbers:null===(c=null!==(s=e.strictNumbers)&&void 0!==s?s:M)||void 0===c||c,strictTypes:null!==(f=null!==(u=e.strictTypes)&&void 0!==u?u:M)&&void 0!==f?f:"log",strictTuples:null!==(p=null!==(d=e.strictTuples)&&void 0!==d?d:M)&&void 0!==p?p:"log",strictRequired:null!==(g=null!==(m=e.strictRequired)&&void 0!==m?m:M)&&void 0!==g&&g,code:e.code?{...e.code,optimize:I,regExp:R}:{optimize:I,regExp:R},loopRequired:null!==(y=e.loopRequired)&&void 0!==y?y:200,loopEnum:null!==(b=e.loopEnum)&&void 0!==b?b:200,meta:null===(v=e.meta)||void 0===v||v,messages:null===(w=e.messages)||void 0===w||w,inlineRefs:null===(A=e.inlineRefs)||void 0===A||A,schemaId:null!==(_=e.schemaId)&&void 0!==_?_:"$id",addUsedSchema:null===(E=e.addUsedSchema)||void 0===E||E,validateSchema:null===(S=e.validateSchema)||void 0===S||S,validateFormats:null===(P=e.validateFormats)||void 0===P||P,unicodeRegExp:null===(x=e.unicodeRegExp)||void 0===x||x,int32range:null===(k=e.int32range)||void 0===k||k,uriResolver:N}}class v{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...b(e)};const{es5:t,lines:r}=this.opts.code;this.scope=new s.ValueScope({scope:{},prefixes:m,es5:t,lines:r}),this.logger=function(e){if(!1===e)return x;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 n=e.validateFormats;e.validateFormats=!1,this.RULES=(0,o.getRules)(),w.call(this,g,e,"NOT SUPPORTED"),w.call(this,y,e,"DEPRECATED","warn"),this._metaOpts=P.call(this),e.formats&&E.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&S.call(this,e.keywords),"object"==typeof e.meta&&this.addMetaSchema(e.meta),_.call(this),e.validateFormats=n}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:e,meta:t,schemaId:r}=this.opts;let n=d;"id"===r&&(n={...d},n.id=n.$id,delete n.$id),t&&e&&this.addMetaSchema(n,n[r],!1)}defaultMeta(){const{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta="object"==typeof e?e[t]||e:void 0}validate(e,t){let r;if("string"==typeof e){if(r=this.getSchema(e),!r)throw new Error(`no schema with key or ref "${e}"`)}else r=this.compile(e);const n=r(t);return"$async"in r||(this.errors=r.errors),n}compile(e,t){const r=this._addSchema(e,t);return r.validate||this._compileSchemaEnv(r)}compileAsync(e,t){if("function"!=typeof this.opts.loadSchema)throw new Error("options.loadSchema should be a function");const{loadSchema:r}=this.opts;return n.call(this,e,t);async function n(e,t){await o.call(this,e.$schema);const r=this._addSchema(e,t);return r.validate||a.call(this,r)}async function o(e){e&&!this.getSchema(e)&&await n.call(this,{$ref:e},!0)}async function a(e){try{return this._compileSchemaEnv(e)}catch(t){if(!(t instanceof i.default))throw t;return s.call(this,t),await c.call(this,t.missingSchema),a.call(this,e)}}function s({missingSchema:e,missingRef:t}){if(this.refs[e])throw new Error(`AnySchema ${e} is loaded but ${t} cannot be resolved`)}async function c(e){const r=await u.call(this,e);this.refs[e]||await o.call(this,r.$schema),this.refs[e]||this.addSchema(r,e,t)}async function u(e){const t=this._loading[e];if(t)return t;try{return await(this._loading[e]=r(e))}finally{delete this._loading[e]}}}addSchema(e,t,r,n=this.opts.validateSchema){if(Array.isArray(e)){for(const t of e)this.addSchema(t,void 0,r,n);return this}let i;if("object"==typeof e){const{schemaId:t}=this.opts;if(i=e[t],void 0!==i&&"string"!=typeof i)throw new Error(`schema ${t} must be string`)}return t=(0,c.normalizeId)(t||i),this._checkUnique(t),this.schemas[t]=this._addSchema(e,r,t,n,!0),this}addMetaSchema(e,t,r=this.opts.validateSchema){return this.addSchema(e,t,!0,r),this}validateSchema(e,t){if("boolean"==typeof e)return!0;let r;if(r=e.$schema,void 0!==r&&"string"!=typeof r)throw new Error("$schema must be a string");if(r=r||this.opts.defaultMeta||this.defaultMeta(),!r)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const n=this.validate(r,e);if(!n&&t){const e="schema is invalid: "+this.errorsText();if("log"!==this.opts.validateSchema)throw new Error(e);this.logger.error(e)}return n}getSchema(e){let t;for(;"string"==typeof(t=A.call(this,e));)e=t;if(void 0===t){const{schemaId:r}=this.opts,n=new a.SchemaEnv({schema:{},schemaId:r});if(t=a.resolveSchema.call(this,n,e),!t)return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}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 t=A.call(this,e);return"object"==typeof t&&this._cache.delete(t.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{const t=e;this._cache.delete(t);let r=e[this.opts.schemaId];return r&&(r=(0,c.normalizeId)(r),delete this.schemas[r],delete this.refs[r]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(const t of e)this.addKeyword(t);return this}addKeyword(e,t){let r;if("string"==typeof e)r=e,"object"==typeof t&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),t.keyword=r);else{if("object"!=typeof e||void 0!==t)throw new Error("invalid addKeywords parameters");if(r=(t=e).keyword,Array.isArray(r)&&!r.length)throw new Error("addKeywords: keyword must be string or non-empty array")}if(M.call(this,r,t),!t)return(0,f.eachItem)(r,(e=>C.call(this,e))),this;R.call(this,t);const n={...t,type:(0,u.getJSONTypes)(t.type),schemaType:(0,u.getJSONTypes)(t.schemaType)};return(0,f.eachItem)(r,0===n.type.length?e=>C.call(this,e,n):e=>n.type.forEach((t=>C.call(this,e,n,t)))),this}getKeyword(e){const t=this.RULES.all[e];return"object"==typeof t?t.definition:!!t}removeKeyword(e){const{RULES:t}=this;delete t.keywords[e],delete t.all[e];for(const r of t.rules){const t=r.rules.findIndex((t=>t.keyword===e));t>=0&&r.rules.splice(t,1)}return this}addFormat(e,t){return"string"==typeof t&&(t=new RegExp(t)),this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=", ",dataVar:r="data"}={}){return e&&0!==e.length?e.map((e=>`${r}${e.instancePath} ${e.message}`)).reduce(((e,r)=>e+t+r)):"No errors"}$dataMetaSchema(e,t){const r=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(const n of t){const t=n.split("/").slice(1);let i=e;for(const e of t)i=i[e];for(const e in r){const t=r[e];if("object"!=typeof t)continue;const{$data:n}=t.definition,o=i[e];n&&o&&(i[e]=O(o))}}return e}_removeAllSchemas(e,t){for(const r in e){const n=e[r];t&&!t.test(r)||("string"==typeof n?delete e[r]:n&&!n.meta&&(this._cache.delete(n.schema),delete e[r]))}}_addSchema(e,t,r,n=this.opts.validateSchema,i=this.opts.addUsedSchema){let o;const{schemaId:s}=this.opts;if("object"==typeof e)o=e[s];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 u=this._cache.get(e);if(void 0!==u)return u;r=(0,c.normalizeId)(o||r);const f=c.getSchemaRefs.call(this,e,r);return u=new a.SchemaEnv({schema:e,schemaId:s,meta:t,baseId:r,localRefs:f}),this._cache.set(u.schema,u),i&&!r.startsWith("#")&&(r&&this._checkUnique(r),this.refs[r]=u),n&&this.validateSchema(e,!0),u}_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):a.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){const t=this.opts;this.opts=this._metaOpts;try{a.compileSchema.call(this,e)}finally{this.opts=t}}}function w(e,t,r,n="error"){for(const i in e){const o=i;o in t&&this.logger[n](`${r}: option ${i}. ${e[o]}`)}}function A(e){return e=(0,c.normalizeId)(e),this.schemas[e]||this.refs[e]}function _(){const e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(const t in e)this.addSchema(e[t],t)}function E(){for(const e in this.opts.formats){const t=this.opts.formats[e];t&&this.addFormat(e,t)}}function S(e){if(Array.isArray(e))this.addVocabulary(e);else{this.logger.warn("keywords option as map is deprecated, pass array");for(const t in e){const r=e[t];r.keyword||(r.keyword=t),this.addKeyword(r)}}}function P(){const e={...this.opts};for(const t of p)delete e[t];return e}e.default=v,v.ValidationError=n.default,v.MissingRefError=i.default;const x={log(){},warn(){},error(){}};const k=/^[a-z_$][a-z0-9_$:-]*$/i;function M(e,t){const{RULES:r}=this;if((0,f.eachItem)(e,(e=>{if(r.keywords[e])throw new Error(`Keyword ${e} is already defined`);if(!k.test(e))throw new Error(`Keyword ${e} has invalid name`)})),t&&t.$data&&!("code"in t)&&!("validate"in t))throw new Error('$data keyword must have "code" or "validate" function')}function C(e,t,r){var n;const i=null==t?void 0:t.post;if(r&&i)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:o}=this;let a=i?o.post:o.rules.find((({type:e})=>e===r));if(a||(a={type:r,rules:[]},o.rules.push(a)),o.keywords[e]=!0,!t)return;const s={keyword:e,definition:{...t,type:(0,u.getJSONTypes)(t.type),schemaType:(0,u.getJSONTypes)(t.schemaType)}};t.before?I.call(this,a,s,t.before):a.rules.push(s),o.all[e]=s,null===(n=t.implements)||void 0===n||n.forEach((e=>this.addKeyword(e)))}function I(e,t,r){const n=e.rules.findIndex((e=>e.keyword===r));n>=0?e.rules.splice(n,0,t):(e.rules.push(t),this.logger.warn(`rule ${r} is not defined`))}function R(e){let{metaSchema:t}=e;void 0!==t&&(e.$data&&this.opts.$data&&(t=O(t)),e.validateSchema=this.compile(t,!0))}const N={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function O(e){return{anyOf:[e,N]}}}(jp);var Jg={},Wg={},Gg={};Object.defineProperty(Gg,"__esModule",{value:!0}),Gg.callRef=Gg.getValidate=void 0;const Vg=Eg,Zg=cm,Xg=Fp,Qg=qp,Yg=xg,ey=Lp,ty={keyword:"$ref",schemaType:"string",code(e){const{gen:t,schema:r,it:n}=e,{baseId:i,schemaEnv:o,validateName:a,opts:s,self:c}=n,{root:u}=o;if(("#"===r||"#/"===r)&&i===u.baseId)return function(){if(o===u)return ny(e,a,o,o.$async);const r=t.scopeValue("root",{ref:u});return ny(e,Xg._`${r}.validate`,u,u.$async)}();const f=Yg.resolveRef.call(c,u,i,r);if(void 0===f)throw new Vg.default(n.opts.uriResolver,i,r);return f instanceof Yg.SchemaEnv?function(t){const r=ry(e,t);ny(e,r,t,t.$async)}(f):function(n){const i=t.scopeValue("schema",!0===s.code.source?{ref:n,code:(0,Xg.stringify)(n)}:{ref:n}),o=t.name("valid"),a=e.subschema({schema:n,dataTypes:[],schemaPath:Xg.nil,topSchemaRef:i,errSchemaPath:r},o);e.mergeEvaluated(a),e.ok(o)}(f)}};function ry(e,t){const{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):Xg._`${r.scopeValue("wrapper",{ref:t})}.validate`}function ny(e,t,r,n){const{gen:i,it:o}=e,{allErrors:a,schemaEnv:s,opts:c}=o,u=c.passContext?Qg.default.this:Xg.nil;function f(e){const t=Xg._`${e}.errors`;i.assign(Qg.default.vErrors,Xg._`${Qg.default.vErrors} === null ? ${t} : ${Qg.default.vErrors}.concat(${t})`),i.assign(Qg.default.errors,Xg._`${Qg.default.vErrors}.length`)}function d(e){var t;if(!o.opts.unevaluated)return;const n=null===(t=null==r?void 0:r.validate)||void 0===t?void 0:t.evaluated;if(!0!==o.props)if(n&&!n.dynamicProps)void 0!==n.props&&(o.props=ey.mergeEvaluated.props(i,n.props,o.props));else{const t=i.var("props",Xg._`${e}.evaluated.props`);o.props=ey.mergeEvaluated.props(i,t,o.props,Xg.Name)}if(!0!==o.items)if(n&&!n.dynamicItems)void 0!==n.items&&(o.items=ey.mergeEvaluated.items(i,n.items,o.items));else{const t=i.var("items",Xg._`${e}.evaluated.items`);o.items=ey.mergeEvaluated.items(i,t,o.items,Xg.Name)}}n?function(){if(!s.$async)throw new Error("async schema referenced by sync schema");const r=i.let("valid");i.try((()=>{i.code(Xg._`await ${(0,Zg.callValidateCode)(e,t,u)}`),d(t),a||i.assign(r,!0)}),(e=>{i.if(Xg._`!(${e} instanceof ${o.ValidationError})`,(()=>i.throw(e))),f(e),a||i.assign(r,!1)})),e.ok(r)}():e.result((0,Zg.callValidateCode)(e,t,u),(()=>d(t)),(()=>f(t)))}Gg.getValidate=ry,Gg.callRef=ny,Gg.default=ty,Object.defineProperty(Wg,"__esModule",{value:!0});const iy=["$schema","id","$defs",{keyword:"$comment"},"definitions",Gg.default];Wg.default=iy;var oy={},ay={};Object.defineProperty(ay,"__esModule",{value:!0});const sy=jp,cy=Fp.operators,uy={maximum:{exclusive:"exclusiveMaximum",ops:[{okStr:"<=",ok:cy.LTE,fail:cy.GT},{okStr:"<",ok:cy.LT,fail:cy.GTE}]},minimum:{exclusive:"exclusiveMinimum",ops:[{okStr:">=",ok:cy.GTE,fail:cy.LT},{okStr:">",ok:cy.GT,fail:cy.LTE}]}},fy={message:e=>sy.str`must be ${ly(e).okStr} ${e.schemaCode}`,params:e=>sy._`{comparison: ${ly(e).okStr}, limit: ${e.schemaCode}}`},dy={keyword:Object.keys(uy),type:"number",schemaType:"number",$data:!0,error:fy,code(e){const{data:t,schemaCode:r}=e;e.fail$data(sy._`${t} ${ly(e).fail} ${r} || isNaN(${t})`)}};function ly(e){var t;const r=e.keyword,n=(null===(t=e.parentSchema)||void 0===t?void 0:t[uy[r].exclusive])?1:0;return uy[r].ops[n]}ay.default=dy;var hy={};Object.defineProperty(hy,"__esModule",{value:!0});const py={exclusiveMaximum:"maximum",exclusiveMinimum:"minimum"},my={keyword:Object.keys(py),type:"number",schemaType:"boolean",code({keyword:e,parentSchema:t}){const r=py[e];if(void 0===t[r])throw new Error(`${e} can only be used with ${r}`)}};hy.default=my;var gy={};Object.defineProperty(gy,"__esModule",{value:!0});const yy=Fp,by={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:e})=>yy.str`must be multiple of ${e}`,params:({schemaCode:e})=>yy._`{multipleOf: ${e}}`},code(e){const{gen:t,data:r,schemaCode:n,it:i}=e,o=i.opts.multipleOfPrecision,a=t.let("res"),s=o?yy._`Math.abs(Math.round(${a}) - ${a}) > 1e-${o}`:yy._`${a} !== parseInt(${a})`;e.fail$data(yy._`(${n} === 0 || (${a} = ${r}/${n}, ${s}))`)}};gy.default=by;var vy={},wy={};function Ay(e){const t=e.length;let r,n=0,i=0;for(;i=55296&&r<=56319&&i_y.str`must NOT have ${"maxLength"===e?"more":"fewer"} than ${t} characters`,params:({schemaCode:e})=>_y._`{limit: ${e}}`},xy={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:Py,code(e){const{keyword:t,data:r,schemaCode:n,it:i}=e,o="maxLength"===t?_y.operators.GT:_y.operators.LT,a=!1===i.opts.unicode?_y._`${r}.length`:_y._`${(0,Ey.useFunc)(e.gen,Sy.default)}(${r})`;e.fail$data(_y._`${a} ${o} ${n}`)}};vy.default=xy;var ky={};Object.defineProperty(ky,"__esModule",{value:!0});const My=cm,Cy=Fp,Iy={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>Cy.str`must match pattern "${e}"`,params:({schemaCode:e})=>Cy._`{pattern: ${e}}`},code(e){const{data:t,$data:r,schema:n,schemaCode:i,it:o}=e,a=o.opts.unicodeRegExp?"u":"",s=r?Cy._`(new RegExp(${i}, ${a}))`:(0,My.usePattern)(e,n);e.fail$data(Cy._`!${s}.test(${t})`)}};ky.default=Iy;var Ry={};Object.defineProperty(Ry,"__esModule",{value:!0});const Ny=Fp,Oy={message:({keyword:e,schemaCode:t})=>Ny.str`must NOT have ${"maxProperties"===e?"more":"fewer"} than ${t} properties`,params:({schemaCode:e})=>Ny._`{limit: ${e}}`},Ty={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:Oy,code(e){const{keyword:t,data:r,schemaCode:n}=e,i="maxProperties"===t?Ny.operators.GT:Ny.operators.LT;e.fail$data(Ny._`Object.keys(${r}).length ${i} ${n}`)}};Ry.default=Ty;var jy={};Object.defineProperty(jy,"__esModule",{value:!0});const Dy=cm,$y=Fp,By=Lp,Fy={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:e}})=>$y.str`must have required property '${e}'`,params:({params:{missingProperty:e}})=>$y._`{missingProperty: ${e}}`},code(e){const{gen:t,schema:r,schemaCode:n,data:i,$data:o,it:a}=e,{opts:s}=a;if(!o&&0===r.length)return;const c=r.length>=s.loopRequired;if(a.allErrors?function(){if(c||o)e.block$data($y.nil,u);else for(const t of r)(0,Dy.checkReportMissingProp)(e,t)}():function(){const a=t.let("missing");if(c||o){const r=t.let("valid",!0);e.block$data(r,(()=>function(r,o){e.setParams({missingProperty:r}),t.forOf(r,n,(()=>{t.assign(o,(0,Dy.propertyInData)(t,i,r,s.ownProperties)),t.if((0,$y.not)(o),(()=>{e.error(),t.break()}))}),$y.nil)}(a,r))),e.ok(r)}else t.if((0,Dy.checkMissingProp)(e,r,a)),(0,Dy.reportMissingProp)(e,a),t.else()}(),s.strictRequired){const t=e.parentSchema.properties,{definedProperties:n}=e.it;for(const e of r)if(void 0===(null==t?void 0:t[e])&&!n.has(e)){const t=a.schemaEnv.baseId+a.errSchemaPath;(0,By.checkStrictMode)(a,`required property "${e}" is not defined at "${t}" (strictRequired)`,a.opts.strictRequired)}}function u(){t.forOf("prop",n,(r=>{e.setParams({missingProperty:r}),t.if((0,Dy.noPropertyInData)(t,i,r,s.ownProperties),(()=>e.error()))}))}}};jy.default=Fy;var zy={};Object.defineProperty(zy,"__esModule",{value:!0});const Uy=Fp,Ly={message:({keyword:e,schemaCode:t})=>Uy.str`must NOT have ${"maxItems"===e?"more":"fewer"} than ${t} items`,params:({schemaCode:e})=>Uy._`{limit: ${e}}`},qy={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:Ly,code(e){const{keyword:t,data:r,schemaCode:n}=e,i="maxItems"===t?Uy.operators.GT:Uy.operators.LT;e.fail$data(Uy._`${r}.length ${i} ${n}`)}};zy.default=qy;var Hy={},Ky={};Object.defineProperty(Ky,"__esModule",{value:!0});const Jy=Mm;Jy.code='require("ajv/dist/runtime/equal").default',Ky.default=Jy,Object.defineProperty(Hy,"__esModule",{value:!0});const Wy=Xp,Gy=Fp,Vy=Lp,Zy=Ky,Xy={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:e,j:t}})=>Gy.str`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>Gy._`{i: ${e}, j: ${t}}`},code(e){const{gen:t,data:r,$data:n,schema:i,parentSchema:o,schemaCode:a,it:s}=e;if(!n&&!i)return;const c=t.let("valid"),u=o.items?(0,Wy.getSchemaTypes)(o.items):[];function f(n,i){const o=t.name("item"),a=(0,Wy.checkDataTypes)(u,o,s.opts.strictNumbers,Wy.DataType.Wrong),f=t.const("indices",Gy._`{}`);t.for(Gy._`;${n}--;`,(()=>{t.let(o,Gy._`${r}[${n}]`),t.if(a,Gy._`continue`),u.length>1&&t.if(Gy._`typeof ${o} == "string"`,Gy._`${o} += "_"`),t.if(Gy._`typeof ${f}[${o}] == "number"`,(()=>{t.assign(i,Gy._`${f}[${o}]`),e.error(),t.assign(c,!1).break()})).code(Gy._`${f}[${o}] = ${n}`)}))}function d(n,i){const o=(0,Vy.useFunc)(t,Zy.default),a=t.name("outer");t.label(a).for(Gy._`;${n}--;`,(()=>t.for(Gy._`${i} = ${n}; ${i}--;`,(()=>t.if(Gy._`${o}(${r}[${n}], ${r}[${i}])`,(()=>{e.error(),t.assign(c,!1).break(a)}))))))}e.block$data(c,(function(){const n=t.let("i",Gy._`${r}.length`),i=t.let("j");e.setParams({i:n,j:i}),t.assign(c,!0),t.if(Gy._`${n} > 1`,(()=>(u.length>0&&!u.some((e=>"object"===e||"array"===e))?f:d)(n,i)))}),Gy._`${a} === false`),e.ok(c)}};Hy.default=Xy;var Qy={};Object.defineProperty(Qy,"__esModule",{value:!0});const Yy=Fp,eb=Lp,tb=Ky,rb={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:e})=>Yy._`{allowedValue: ${e}}`},code(e){const{gen:t,data:r,$data:n,schemaCode:i,schema:o}=e;n||o&&"object"==typeof o?e.fail$data(Yy._`!${(0,eb.useFunc)(t,tb.default)}(${r}, ${i})`):e.fail(Yy._`${o} !== ${r}`)}};Qy.default=rb;var nb={};Object.defineProperty(nb,"__esModule",{value:!0});const ib=Fp,ob=Lp,ab=Ky,sb={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:e})=>ib._`{allowedValues: ${e}}`},code(e){const{gen:t,data:r,$data:n,schema:i,schemaCode:o,it:a}=e;if(!n&&0===i.length)throw new Error("enum must have non-empty array");const s=i.length>=a.opts.loopEnum;let c;const u=()=>null!=c?c:c=(0,ob.useFunc)(t,ab.default);let f;if(s||n)f=t.let("valid"),e.block$data(f,(function(){t.assign(f,!1),t.forOf("v",o,(e=>t.if(ib._`${u()}(${r}, ${e})`,(()=>t.assign(f,!0).break()))))}));else{if(!Array.isArray(i))throw new Error("ajv implementation error");const e=t.const("vSchema",o);f=(0,ib.or)(...i.map(((t,n)=>function(e,t){const n=i[t];return"object"==typeof n&&null!==n?ib._`${u()}(${r}, ${e}[${t}])`:ib._`${r} === ${n}`}(e,n))))}e.pass(f)}};nb.default=sb,Object.defineProperty(oy,"__esModule",{value:!0});const cb=hy,ub=gy,fb=vy,db=ky,lb=Ry,hb=jy,pb=zy,mb=Hy,gb=Qy,yb=nb,bb=[ay.default,cb.default,ub.default,fb.default,db.default,lb.default,hb.default,pb.default,mb.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},gb.default,yb.default];oy.default=bb;var vb={},wb={};Object.defineProperty(wb,"__esModule",{value:!0}),wb.validateAdditionalItems=void 0;const Ab=Fp,_b=Lp,Eb={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:e}})=>Ab.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>Ab._`{limit: ${e}}`},code(e){const{parentSchema:t,it:r}=e,{items:n}=t;Array.isArray(n)?Sb(e,n):(0,_b.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas')}};function Sb(e,t){const{gen:r,schema:n,data:i,keyword:o,it:a}=e;a.items=!0;const s=r.const("len",Ab._`${i}.length`);if(!1===n)e.setParams({len:t.length}),e.pass(Ab._`${s} <= ${t.length}`);else if("object"==typeof n&&!(0,_b.alwaysValidSchema)(a,n)){const n=r.var("valid",Ab._`${s} <= ${t.length}`);r.if((0,Ab.not)(n),(()=>function(n){r.forRange("i",t.length,s,(t=>{e.subschema({keyword:o,dataProp:t,dataPropType:_b.Type.Num},n),a.allErrors||r.if((0,Ab.not)(n),(()=>r.break()))}))}(n))),e.ok(n)}}wb.validateAdditionalItems=Sb,wb.default=Eb;var Pb={},xb={};Object.defineProperty(xb,"__esModule",{value:!0}),xb.validateTuple=void 0;const kb=Fp,Mb=Lp,Cb=cm,Ib={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){const{schema:t,it:r}=e;if(Array.isArray(t))return Rb(e,"additionalItems",t);r.items=!0,(0,Mb.alwaysValidSchema)(r,t)||e.ok((0,Cb.validateArray)(e))}};function Rb(e,t,r=e.schema){const{gen:n,parentSchema:i,data:o,keyword:a,it:s}=e;!function(e){const{opts:n,errSchemaPath:i}=s,o=r.length,c=o===e.minItems&&(o===e.maxItems||!1===e[t]);if(n.strictTuples&&!c){const e=`"${a}" is ${o}-tuple, but minItems or maxItems/${t} are not specified or different at path "${i}"`;(0,Mb.checkStrictMode)(s,e,n.strictTuples)}}(i),s.opts.unevaluated&&r.length&&!0!==s.items&&(s.items=Mb.mergeEvaluated.items(n,r.length,s.items));const c=n.name("valid"),u=n.const("len",kb._`${o}.length`);r.forEach(((t,r)=>{(0,Mb.alwaysValidSchema)(s,t)||(n.if(kb._`${u} > ${r}`,(()=>e.subschema({keyword:a,schemaProp:r,dataProp:r},c))),e.ok(c))}))}xb.validateTuple=Rb,xb.default=Ib,Object.defineProperty(Pb,"__esModule",{value:!0});const Nb=xb,Ob={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,Nb.validateTuple)(e,"items")};Pb.default=Ob;var Tb={};Object.defineProperty(Tb,"__esModule",{value:!0});const jb=Fp,Db=Lp,$b=cm,Bb=wb,Fb={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:e}})=>jb.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>jb._`{limit: ${e}}`},code(e){const{schema:t,parentSchema:r,it:n}=e,{prefixItems:i}=r;n.items=!0,(0,Db.alwaysValidSchema)(n,t)||(i?(0,Bb.validateAdditionalItems)(e,i):e.ok((0,$b.validateArray)(e)))}};Tb.default=Fb;var zb={};Object.defineProperty(zb,"__esModule",{value:!0});const Ub=Fp,Lb=Lp,qb={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:e,max:t}})=>void 0===t?Ub.str`must contain at least ${e} valid item(s)`:Ub.str`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>void 0===t?Ub._`{minContains: ${e}}`:Ub._`{minContains: ${e}, maxContains: ${t}}`},code(e){const{gen:t,schema:r,parentSchema:n,data:i,it:o}=e;let a,s;const{minContains:c,maxContains:u}=n;o.opts.next?(a=void 0===c?1:c,s=u):a=1;const f=t.const("len",Ub._`${i}.length`);if(e.setParams({min:a,max:s}),void 0===s&&0===a)return void(0,Lb.checkStrictMode)(o,'"minContains" == 0 without "maxContains": "contains" keyword ignored');if(void 0!==s&&a>s)return(0,Lb.checkStrictMode)(o,'"minContains" > "maxContains" is always invalid'),void e.fail();if((0,Lb.alwaysValidSchema)(o,r)){let t=Ub._`${f} >= ${a}`;return void 0!==s&&(t=Ub._`${t} && ${f} <= ${s}`),void e.pass(t)}o.items=!0;const d=t.name("valid");function l(){const e=t.name("_valid"),r=t.let("count",0);h(e,(()=>t.if(e,(()=>function(e){t.code(Ub._`${e}++`),void 0===s?t.if(Ub._`${e} >= ${a}`,(()=>t.assign(d,!0).break())):(t.if(Ub._`${e} > ${s}`,(()=>t.assign(d,!1).break())),1===a?t.assign(d,!0):t.if(Ub._`${e} >= ${a}`,(()=>t.assign(d,!0))))}(r)))))}function h(r,n){t.forRange("i",0,f,(t=>{e.subschema({keyword:"contains",dataProp:t,dataPropType:Lb.Type.Num,compositeRule:!0},r),n()}))}void 0===s&&1===a?h(d,(()=>t.if(d,(()=>t.break())))):0===a?(t.let(d,!0),void 0!==s&&t.if(Ub._`${i}.length > 0`,l)):(t.let(d,!1),l()),e.result(d,(()=>e.reset()))}};zb.default=qb;var Hb={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const t=Fp,r=Lp,n=cm;e.error={message:({params:{property:e,depsCount:r,deps:n}})=>t.str`must have ${1===r?"property":"properties"} ${n} when property ${e} is present`,params:({params:{property:e,depsCount:r,deps:n,missingProperty:i}})=>t._`{property: ${e}, +!function(e,t){!function(e){function t(){for(var e=arguments.length,t=Array(e),r=0;r1){t[0]=t[0].slice(0,-1);for(var n=t.length-1,i=1;i= 0x80 (not a basic code point)","invalid-input":"Invalid input"},P=h-p,x=Math.floor,k=String.fromCharCode;function M(e){throw new RangeError(S[e])}function C(e,t){for(var r=[],n=e.length;n--;)r[n]=t(e[n]);return r}function I(e,t){var r=e.split("@"),n="";return r.length>1&&(n=r[0]+"@",e=r[1]),n+C((e=e.replace(E,".")).split("."),t).join(".")}function R(e){for(var t=[],r=0,n=e.length;r=55296&&i<=56319&&r>1,e+=x(e/t);e>P*m>>1;n+=h)e=x(e/P);return x(n+(P+1)*e/(e+g))},j=function(e){var t=[],r=e.length,n=0,i=v,o=b,a=e.lastIndexOf(w);a<0&&(a=0);for(var s=0;s=128&&M("not-basic"),t.push(e.charCodeAt(s));for(var c=a>0?a+1:0;c=r&&M("invalid-input");var g=N(e.charCodeAt(c++));(g>=h||g>x((l-n)/f))&&M("overflow"),n+=g*f;var y=d<=o?p:d>=o+m?m:d-o;if(gx(l/A)&&M("overflow"),f*=A}var _=t.length+1;o=T(n-u,_,0==u),x(n/_)>l-i&&M("overflow"),i+=x(n/_),n%=_,t.splice(n++,0,i)}return String.fromCodePoint.apply(String,t)},D=function(e){var t=[],r=(e=R(e)).length,n=v,i=0,o=b,a=!0,s=!1,c=void 0;try{for(var u,f=e[Symbol.iterator]();!(a=(u=f.next()).done);a=!0){var d=u.value;d<128&&t.push(k(d))}}catch(e){s=!0,c=e}finally{try{!a&&f.return&&f.return()}finally{if(s)throw c}}var g=t.length,y=g;for(g&&t.push(w);y=n&&Ix((l-i)/N)&&M("overflow"),i+=(A-n)*N,n=A;var j=!0,D=!1,$=void 0;try{for(var B,F=e[Symbol.iterator]();!(j=(B=F.next()).done);j=!0){var z=B.value;if(zl&&M("overflow"),z==n){for(var U=i,L=h;;L+=h){var q=L<=o?p:L>=o+m?m:L-o;if(U>6|192).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase():"%"+(t>>12|224).toString(16).toUpperCase()+"%"+(t>>6&63|128).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase()}function L(e){for(var t="",r=0,n=e.length;r=194&&i<224){if(n-r>=6){var o=parseInt(e.substr(r+4,2),16);t+=String.fromCharCode((31&i)<<6|63&o)}else t+=e.substr(r,6);r+=6}else if(i>=224){if(n-r>=9){var a=parseInt(e.substr(r+4,2),16),s=parseInt(e.substr(r+7,2),16);t+=String.fromCharCode((15&i)<<12|(63&a)<<6|63&s)}else t+=e.substr(r,9);r+=9}else t+=e.substr(r,3),r+=3}return t}function q(e,t){function r(e){var r=L(e);return r.match(t.UNRESERVED)?r:e}return e.scheme&&(e.scheme=String(e.scheme).replace(t.PCT_ENCODED,r).toLowerCase().replace(t.NOT_SCHEME,"")),void 0!==e.userinfo&&(e.userinfo=String(e.userinfo).replace(t.PCT_ENCODED,r).replace(t.NOT_USERINFO,U).replace(t.PCT_ENCODED,i)),void 0!==e.host&&(e.host=String(e.host).replace(t.PCT_ENCODED,r).toLowerCase().replace(t.NOT_HOST,U).replace(t.PCT_ENCODED,i)),void 0!==e.path&&(e.path=String(e.path).replace(t.PCT_ENCODED,r).replace(e.scheme?t.NOT_PATH:t.NOT_PATH_NOSCHEME,U).replace(t.PCT_ENCODED,i)),void 0!==e.query&&(e.query=String(e.query).replace(t.PCT_ENCODED,r).replace(t.NOT_QUERY,U).replace(t.PCT_ENCODED,i)),void 0!==e.fragment&&(e.fragment=String(e.fragment).replace(t.PCT_ENCODED,r).replace(t.NOT_FRAGMENT,U).replace(t.PCT_ENCODED,i)),e}function H(e){return e.replace(/^0*(.*)/,"$1")||"0"}function K(e,t){var r=e.match(t.IPV4ADDRESS)||[],n=f(r,2)[1];return n?n.split(".").map(H).join("."):e}function J(e,t){var r=e.match(t.IPV6ADDRESS)||[],n=f(r,3),i=n[1],o=n[2];if(i){for(var a=i.toLowerCase().split("::").reverse(),s=f(a,2),c=s[0],u=s[1],d=u?u.split(":").map(H):[],l=c.split(":").map(H),h=t.IPV4ADDRESS.test(l[l.length-1]),p=h?7:8,m=l.length-p,g=Array(p),y=0;y1){var A=g.slice(0,v.index),_=g.slice(v.index+v.length);w=A.join(":")+"::"+_.join(":")}else w=g.join(":");return o&&(w+="%"+o),w}return e}var W=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,G=void 0==="".match(/(){0}/)[1];function V(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={},n=!1!==t.iri?u:c;"suffix"===t.reference&&(e=(t.scheme?t.scheme+":":"")+"//"+e);var i=e.match(W);if(i){G?(r.scheme=i[1],r.userinfo=i[3],r.host=i[4],r.port=parseInt(i[5],10),r.path=i[6]||"",r.query=i[7],r.fragment=i[8],isNaN(r.port)&&(r.port=i[5])):(r.scheme=i[1]||void 0,r.userinfo=-1!==e.indexOf("@")?i[3]:void 0,r.host=-1!==e.indexOf("//")?i[4]:void 0,r.port=parseInt(i[5],10),r.path=i[6]||"",r.query=-1!==e.indexOf("?")?i[7]:void 0,r.fragment=-1!==e.indexOf("#")?i[8]:void 0,isNaN(r.port)&&(r.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?i[4]:void 0)),r.host&&(r.host=J(K(r.host,n),n)),void 0!==r.scheme||void 0!==r.userinfo||void 0!==r.host||void 0!==r.port||r.path||void 0!==r.query?void 0===r.scheme?r.reference="relative":void 0===r.fragment?r.reference="absolute":r.reference="uri":r.reference="same-document",t.reference&&"suffix"!==t.reference&&t.reference!==r.reference&&(r.error=r.error||"URI is not a "+t.reference+" reference.");var o=z[(t.scheme||r.scheme||"").toLowerCase()];if(t.unicodeSupport||o&&o.unicodeSupport)q(r,n);else{if(r.host&&(t.domainHost||o&&o.domainHost))try{r.host=F.toASCII(r.host.replace(n.PCT_ENCODED,L).toLowerCase())}catch(e){r.error=r.error||"Host's domain name can not be converted to ASCII via punycode: "+e}q(r,c)}o&&o.parse&&o.parse(r,t)}else r.error=r.error||"URI can not be parsed.";return r}function Z(e,t){var r=!1!==t.iri?u:c,n=[];return void 0!==e.userinfo&&(n.push(e.userinfo),n.push("@")),void 0!==e.host&&n.push(J(K(String(e.host),r),r).replace(r.IPV6ADDRESS,(function(e,t,r){return"["+t+(r?"%25"+r:"")+"]"}))),"number"!=typeof e.port&&"string"!=typeof e.port||(n.push(":"),n.push(String(e.port))),n.length?n.join(""):void 0}var X=/^\.\.?\//,Q=/^\/\.(\/|$)/,Y=/^\/\.\.(\/|$)/,ee=/^\/?(?:.|\n)*?(?=\/|$)/;function te(e){for(var t=[];e.length;)if(e.match(X))e=e.replace(X,"");else if(e.match(Q))e=e.replace(Q,"/");else if(e.match(Y))e=e.replace(Y,"/"),t.pop();else if("."===e||".."===e)e="";else{var r=e.match(ee);if(!r)throw new Error("Unexpected dot segment condition");var n=r[0];e=e.slice(n.length),t.push(n)}return t.join("")}function re(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.iri?u:c,n=[],i=z[(t.scheme||e.scheme||"").toLowerCase()];if(i&&i.serialize&&i.serialize(e,t),e.host)if(r.IPV6ADDRESS.test(e.host));else if(t.domainHost||i&&i.domainHost)try{e.host=t.iri?F.toUnicode(e.host):F.toASCII(e.host.replace(r.PCT_ENCODED,L).toLowerCase())}catch(r){e.error=e.error||"Host's domain name can not be converted to "+(t.iri?"Unicode":"ASCII")+" via punycode: "+r}q(e,r),"suffix"!==t.reference&&e.scheme&&(n.push(e.scheme),n.push(":"));var o=Z(e,t);if(void 0!==o&&("suffix"!==t.reference&&n.push("//"),n.push(o),e.path&&"/"!==e.path.charAt(0)&&n.push("/")),void 0!==e.path){var a=e.path;t.absolutePath||i&&i.absolutePath||(a=te(a)),void 0===o&&(a=a.replace(/^\/\//,"/%2F")),n.push(a)}return void 0!==e.query&&(n.push("?"),n.push(e.query)),void 0!==e.fragment&&(n.push("#"),n.push(e.fragment)),n.join("")}function ne(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n={};return arguments[3]||(e=V(re(e,r),r),t=V(re(t,r),r)),!(r=r||{}).tolerant&&t.scheme?(n.scheme=t.scheme,n.userinfo=t.userinfo,n.host=t.host,n.port=t.port,n.path=te(t.path||""),n.query=t.query):(void 0!==t.userinfo||void 0!==t.host||void 0!==t.port?(n.userinfo=t.userinfo,n.host=t.host,n.port=t.port,n.path=te(t.path||""),n.query=t.query):(t.path?("/"===t.path.charAt(0)?n.path=te(t.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?n.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:n.path=t.path:n.path="/"+t.path,n.path=te(n.path)),n.query=t.query):(n.path=e.path,void 0!==t.query?n.query=t.query:n.query=e.query),n.userinfo=e.userinfo,n.host=e.host,n.port=e.port),n.scheme=e.scheme),n.fragment=t.fragment,n}function ie(e,t,r){var n=a({scheme:"null"},r);return re(ne(V(e,n),V(t,n),n,!0),n)}function oe(e,t){return"string"==typeof e?e=re(V(e,t),t):"object"===n(e)&&(e=V(re(e,t),t)),e}function ae(e,t,r){return"string"==typeof e?e=re(V(e,r),r):"object"===n(e)&&(e=re(e,r)),"string"==typeof t?t=re(V(t,r),r):"object"===n(t)&&(t=re(t,r)),e===t}function se(e,t){return e&&e.toString().replace(t&&t.iri?u.ESCAPE:c.ESCAPE,U)}function ce(e,t){return e&&e.toString().replace(t&&t.iri?u.PCT_ENCODED:c.PCT_ENCODED,L)}var ue={scheme:"http",domainHost:!0,parse:function(e,t){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e},serialize:function(e,t){var r="https"===String(e.scheme).toLowerCase();return e.port!==(r?443:80)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}},fe={scheme:"https",domainHost:ue.domainHost,parse:ue.parse,serialize:ue.serialize};function de(e){return"boolean"==typeof e.secure?e.secure:"wss"===String(e.scheme).toLowerCase()}var le={scheme:"ws",domainHost:!0,parse:function(e,t){var r=e;return r.secure=de(r),r.resourceName=(r.path||"/")+(r.query?"?"+r.query:""),r.path=void 0,r.query=void 0,r},serialize:function(e,t){if(e.port!==(de(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){var r=e.resourceName.split("?"),n=f(r,2),i=n[0],o=n[1];e.path=i&&"/"!==i?i:void 0,e.query=o,e.resourceName=void 0}return e.fragment=void 0,e}},he={scheme:"wss",domainHost:le.domainHost,parse:le.parse,serialize:le.serialize},pe={},me="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",ge="[0-9A-Fa-f]",ye=r(r("%[EFef]"+ge+"%"+ge+ge+"%"+ge+ge)+"|"+r("%[89A-Fa-f]"+ge+"%"+ge+ge)+"|"+r("%"+ge+ge)),be="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",ve=t("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),we="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",Ae=new RegExp(me,"g"),_e=new RegExp(ye,"g"),Ee=new RegExp(t("[^]",be,"[\\.]",'[\\"]',ve),"g"),Se=new RegExp(t("[^]",me,we),"g"),Pe=Se;function xe(e){var t=L(e);return t.match(Ae)?t:e}var ke={scheme:"mailto",parse:function(e,t){var r=e,n=r.to=r.path?r.path.split(","):[];if(r.path=void 0,r.query){for(var i=!1,o={},a=r.query.split("&"),s=0,c=a.length;snew RegExp(e,t);h.code="new RegExp";const p=["removeAdditional","useDefaults","coerceTypes"],m=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),g={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 b(e){var t,r,n,i,o,a,s,c,u,f,d,p,m,g,y,b,v,w,A,_,E,S,P,x,k;const M=e.strict,C=null===(t=e.code)||void 0===t?void 0:t.optimize,I=!0===C||void 0===C?1:C||0,R=null!==(n=null===(r=e.code)||void 0===r?void 0:r.regExp)&&void 0!==n?n:h,N=null!==(i=e.uriResolver)&&void 0!==i?i:l.default;return{strictSchema:null===(a=null!==(o=e.strictSchema)&&void 0!==o?o:M)||void 0===a||a,strictNumbers:null===(c=null!==(s=e.strictNumbers)&&void 0!==s?s:M)||void 0===c||c,strictTypes:null!==(f=null!==(u=e.strictTypes)&&void 0!==u?u:M)&&void 0!==f?f:"log",strictTuples:null!==(p=null!==(d=e.strictTuples)&&void 0!==d?d:M)&&void 0!==p?p:"log",strictRequired:null!==(g=null!==(m=e.strictRequired)&&void 0!==m?m:M)&&void 0!==g&&g,code:e.code?{...e.code,optimize:I,regExp:R}:{optimize:I,regExp:R},loopRequired:null!==(y=e.loopRequired)&&void 0!==y?y:200,loopEnum:null!==(b=e.loopEnum)&&void 0!==b?b:200,meta:null===(v=e.meta)||void 0===v||v,messages:null===(w=e.messages)||void 0===w||w,inlineRefs:null===(A=e.inlineRefs)||void 0===A||A,schemaId:null!==(_=e.schemaId)&&void 0!==_?_:"$id",addUsedSchema:null===(E=e.addUsedSchema)||void 0===E||E,validateSchema:null===(S=e.validateSchema)||void 0===S||S,validateFormats:null===(P=e.validateFormats)||void 0===P||P,unicodeRegExp:null===(x=e.unicodeRegExp)||void 0===x||x,int32range:null===(k=e.int32range)||void 0===k||k,uriResolver:N}}class v{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...b(e)};const{es5:t,lines:r}=this.opts.code;this.scope=new s.ValueScope({scope:{},prefixes:m,es5:t,lines:r}),this.logger=function(e){if(!1===e)return x;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 n=e.validateFormats;e.validateFormats=!1,this.RULES=(0,o.getRules)(),w.call(this,g,e,"NOT SUPPORTED"),w.call(this,y,e,"DEPRECATED","warn"),this._metaOpts=P.call(this),e.formats&&E.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&S.call(this,e.keywords),"object"==typeof e.meta&&this.addMetaSchema(e.meta),_.call(this),e.validateFormats=n}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:e,meta:t,schemaId:r}=this.opts;let n=d;"id"===r&&(n={...d},n.id=n.$id,delete n.$id),t&&e&&this.addMetaSchema(n,n[r],!1)}defaultMeta(){const{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta="object"==typeof e?e[t]||e:void 0}validate(e,t){let r;if("string"==typeof e){if(r=this.getSchema(e),!r)throw new Error(`no schema with key or ref "${e}"`)}else r=this.compile(e);const n=r(t);return"$async"in r||(this.errors=r.errors),n}compile(e,t){const r=this._addSchema(e,t);return r.validate||this._compileSchemaEnv(r)}compileAsync(e,t){if("function"!=typeof this.opts.loadSchema)throw new Error("options.loadSchema should be a function");const{loadSchema:r}=this.opts;return n.call(this,e,t);async function n(e,t){await o.call(this,e.$schema);const r=this._addSchema(e,t);return r.validate||a.call(this,r)}async function o(e){e&&!this.getSchema(e)&&await n.call(this,{$ref:e},!0)}async function a(e){try{return this._compileSchemaEnv(e)}catch(t){if(!(t instanceof i.default))throw t;return s.call(this,t),await c.call(this,t.missingSchema),a.call(this,e)}}function s({missingSchema:e,missingRef:t}){if(this.refs[e])throw new Error(`AnySchema ${e} is loaded but ${t} cannot be resolved`)}async function c(e){const r=await u.call(this,e);this.refs[e]||await o.call(this,r.$schema),this.refs[e]||this.addSchema(r,e,t)}async function u(e){const t=this._loading[e];if(t)return t;try{return await(this._loading[e]=r(e))}finally{delete this._loading[e]}}}addSchema(e,t,r,n=this.opts.validateSchema){if(Array.isArray(e)){for(const t of e)this.addSchema(t,void 0,r,n);return this}let i;if("object"==typeof e){const{schemaId:t}=this.opts;if(i=e[t],void 0!==i&&"string"!=typeof i)throw new Error(`schema ${t} must be string`)}return t=(0,c.normalizeId)(t||i),this._checkUnique(t),this.schemas[t]=this._addSchema(e,r,t,n,!0),this}addMetaSchema(e,t,r=this.opts.validateSchema){return this.addSchema(e,t,!0,r),this}validateSchema(e,t){if("boolean"==typeof e)return!0;let r;if(r=e.$schema,void 0!==r&&"string"!=typeof r)throw new Error("$schema must be a string");if(r=r||this.opts.defaultMeta||this.defaultMeta(),!r)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const n=this.validate(r,e);if(!n&&t){const e="schema is invalid: "+this.errorsText();if("log"!==this.opts.validateSchema)throw new Error(e);this.logger.error(e)}return n}getSchema(e){let t;for(;"string"==typeof(t=A.call(this,e));)e=t;if(void 0===t){const{schemaId:r}=this.opts,n=new a.SchemaEnv({schema:{},schemaId:r});if(t=a.resolveSchema.call(this,n,e),!t)return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}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 t=A.call(this,e);return"object"==typeof t&&this._cache.delete(t.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{const t=e;this._cache.delete(t);let r=e[this.opts.schemaId];return r&&(r=(0,c.normalizeId)(r),delete this.schemas[r],delete this.refs[r]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(const t of e)this.addKeyword(t);return this}addKeyword(e,t){let r;if("string"==typeof e)r=e,"object"==typeof t&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),t.keyword=r);else{if("object"!=typeof e||void 0!==t)throw new Error("invalid addKeywords parameters");if(r=(t=e).keyword,Array.isArray(r)&&!r.length)throw new Error("addKeywords: keyword must be string or non-empty array")}if(M.call(this,r,t),!t)return(0,f.eachItem)(r,(e=>C.call(this,e))),this;R.call(this,t);const n={...t,type:(0,u.getJSONTypes)(t.type),schemaType:(0,u.getJSONTypes)(t.schemaType)};return(0,f.eachItem)(r,0===n.type.length?e=>C.call(this,e,n):e=>n.type.forEach((t=>C.call(this,e,n,t)))),this}getKeyword(e){const t=this.RULES.all[e];return"object"==typeof t?t.definition:!!t}removeKeyword(e){const{RULES:t}=this;delete t.keywords[e],delete t.all[e];for(const r of t.rules){const t=r.rules.findIndex((t=>t.keyword===e));t>=0&&r.rules.splice(t,1)}return this}addFormat(e,t){return"string"==typeof t&&(t=new RegExp(t)),this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=", ",dataVar:r="data"}={}){return e&&0!==e.length?e.map((e=>`${r}${e.instancePath} ${e.message}`)).reduce(((e,r)=>e+t+r)):"No errors"}$dataMetaSchema(e,t){const r=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(const n of t){const t=n.split("/").slice(1);let i=e;for(const e of t)i=i[e];for(const e in r){const t=r[e];if("object"!=typeof t)continue;const{$data:n}=t.definition,o=i[e];n&&o&&(i[e]=O(o))}}return e}_removeAllSchemas(e,t){for(const r in e){const n=e[r];t&&!t.test(r)||("string"==typeof n?delete e[r]:n&&!n.meta&&(this._cache.delete(n.schema),delete e[r]))}}_addSchema(e,t,r,n=this.opts.validateSchema,i=this.opts.addUsedSchema){let o;const{schemaId:s}=this.opts;if("object"==typeof e)o=e[s];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 u=this._cache.get(e);if(void 0!==u)return u;r=(0,c.normalizeId)(o||r);const f=c.getSchemaRefs.call(this,e,r);return u=new a.SchemaEnv({schema:e,schemaId:s,meta:t,baseId:r,localRefs:f}),this._cache.set(u.schema,u),i&&!r.startsWith("#")&&(r&&this._checkUnique(r),this.refs[r]=u),n&&this.validateSchema(e,!0),u}_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):a.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){const t=this.opts;this.opts=this._metaOpts;try{a.compileSchema.call(this,e)}finally{this.opts=t}}}function w(e,t,r,n="error"){for(const i in e){const o=i;o in t&&this.logger[n](`${r}: option ${i}. ${e[o]}`)}}function A(e){return e=(0,c.normalizeId)(e),this.schemas[e]||this.refs[e]}function _(){const e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(const t in e)this.addSchema(e[t],t)}function E(){for(const e in this.opts.formats){const t=this.opts.formats[e];t&&this.addFormat(e,t)}}function S(e){if(Array.isArray(e))this.addVocabulary(e);else{this.logger.warn("keywords option as map is deprecated, pass array");for(const t in e){const r=e[t];r.keyword||(r.keyword=t),this.addKeyword(r)}}}function P(){const e={...this.opts};for(const t of p)delete e[t];return e}e.default=v,v.ValidationError=n.default,v.MissingRefError=i.default;const x={log(){},warn(){},error(){}};const k=/^[a-z_$][a-z0-9_$:-]*$/i;function M(e,t){const{RULES:r}=this;if((0,f.eachItem)(e,(e=>{if(r.keywords[e])throw new Error(`Keyword ${e} is already defined`);if(!k.test(e))throw new Error(`Keyword ${e} has invalid name`)})),t&&t.$data&&!("code"in t)&&!("validate"in t))throw new Error('$data keyword must have "code" or "validate" function')}function C(e,t,r){var n;const i=null==t?void 0:t.post;if(r&&i)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:o}=this;let a=i?o.post:o.rules.find((({type:e})=>e===r));if(a||(a={type:r,rules:[]},o.rules.push(a)),o.keywords[e]=!0,!t)return;const s={keyword:e,definition:{...t,type:(0,u.getJSONTypes)(t.type),schemaType:(0,u.getJSONTypes)(t.schemaType)}};t.before?I.call(this,a,s,t.before):a.rules.push(s),o.all[e]=s,null===(n=t.implements)||void 0===n||n.forEach((e=>this.addKeyword(e)))}function I(e,t,r){const n=e.rules.findIndex((e=>e.keyword===r));n>=0?e.rules.splice(n,0,t):(e.rules.push(t),this.logger.warn(`rule ${r} is not defined`))}function R(e){let{metaSchema:t}=e;void 0!==t&&(e.$data&&this.opts.$data&&(t=O(t)),e.validateSchema=this.compile(t,!0))}const N={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function O(e){return{anyOf:[e,N]}}}($p);var Gg={},Vg={},Zg={};Object.defineProperty(Zg,"__esModule",{value:!0}),Zg.callRef=Zg.getValidate=void 0;const Xg=Pg,Qg=fm,Yg=Up,ey=Kp,ty=Mg,ry=Hp,ny={keyword:"$ref",schemaType:"string",code(e){const{gen:t,schema:r,it:n}=e,{baseId:i,schemaEnv:o,validateName:a,opts:s,self:c}=n,{root:u}=o;if(("#"===r||"#/"===r)&&i===u.baseId)return function(){if(o===u)return oy(e,a,o,o.$async);const r=t.scopeValue("root",{ref:u});return oy(e,Yg._`${r}.validate`,u,u.$async)}();const f=ty.resolveRef.call(c,u,i,r);if(void 0===f)throw new Xg.default(n.opts.uriResolver,i,r);return f instanceof ty.SchemaEnv?function(t){const r=iy(e,t);oy(e,r,t,t.$async)}(f):function(n){const i=t.scopeValue("schema",!0===s.code.source?{ref:n,code:(0,Yg.stringify)(n)}:{ref:n}),o=t.name("valid"),a=e.subschema({schema:n,dataTypes:[],schemaPath:Yg.nil,topSchemaRef:i,errSchemaPath:r},o);e.mergeEvaluated(a),e.ok(o)}(f)}};function iy(e,t){const{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):Yg._`${r.scopeValue("wrapper",{ref:t})}.validate`}function oy(e,t,r,n){const{gen:i,it:o}=e,{allErrors:a,schemaEnv:s,opts:c}=o,u=c.passContext?ey.default.this:Yg.nil;function f(e){const t=Yg._`${e}.errors`;i.assign(ey.default.vErrors,Yg._`${ey.default.vErrors} === null ? ${t} : ${ey.default.vErrors}.concat(${t})`),i.assign(ey.default.errors,Yg._`${ey.default.vErrors}.length`)}function d(e){var t;if(!o.opts.unevaluated)return;const n=null===(t=null==r?void 0:r.validate)||void 0===t?void 0:t.evaluated;if(!0!==o.props)if(n&&!n.dynamicProps)void 0!==n.props&&(o.props=ry.mergeEvaluated.props(i,n.props,o.props));else{const t=i.var("props",Yg._`${e}.evaluated.props`);o.props=ry.mergeEvaluated.props(i,t,o.props,Yg.Name)}if(!0!==o.items)if(n&&!n.dynamicItems)void 0!==n.items&&(o.items=ry.mergeEvaluated.items(i,n.items,o.items));else{const t=i.var("items",Yg._`${e}.evaluated.items`);o.items=ry.mergeEvaluated.items(i,t,o.items,Yg.Name)}}n?function(){if(!s.$async)throw new Error("async schema referenced by sync schema");const r=i.let("valid");i.try((()=>{i.code(Yg._`await ${(0,Qg.callValidateCode)(e,t,u)}`),d(t),a||i.assign(r,!0)}),(e=>{i.if(Yg._`!(${e} instanceof ${o.ValidationError})`,(()=>i.throw(e))),f(e),a||i.assign(r,!1)})),e.ok(r)}():e.result((0,Qg.callValidateCode)(e,t,u),(()=>d(t)),(()=>f(t)))}Zg.getValidate=iy,Zg.callRef=oy,Zg.default=ny,Object.defineProperty(Vg,"__esModule",{value:!0});const ay=["$schema","id","$defs",{keyword:"$comment"},"definitions",Zg.default];Vg.default=ay;var sy={},cy={};Object.defineProperty(cy,"__esModule",{value:!0});const uy=$p,fy=Up.operators,dy={maximum:{exclusive:"exclusiveMaximum",ops:[{okStr:"<=",ok:fy.LTE,fail:fy.GT},{okStr:"<",ok:fy.LT,fail:fy.GTE}]},minimum:{exclusive:"exclusiveMinimum",ops:[{okStr:">=",ok:fy.GTE,fail:fy.LT},{okStr:">",ok:fy.GT,fail:fy.LTE}]}},ly={message:e=>uy.str`must be ${py(e).okStr} ${e.schemaCode}`,params:e=>uy._`{comparison: ${py(e).okStr}, limit: ${e.schemaCode}}`},hy={keyword:Object.keys(dy),type:"number",schemaType:"number",$data:!0,error:ly,code(e){const{data:t,schemaCode:r}=e;e.fail$data(uy._`${t} ${py(e).fail} ${r} || isNaN(${t})`)}};function py(e){var t;const r=e.keyword,n=(null===(t=e.parentSchema)||void 0===t?void 0:t[dy[r].exclusive])?1:0;return dy[r].ops[n]}cy.default=hy;var my={};Object.defineProperty(my,"__esModule",{value:!0});const gy={exclusiveMaximum:"maximum",exclusiveMinimum:"minimum"},yy={keyword:Object.keys(gy),type:"number",schemaType:"boolean",code({keyword:e,parentSchema:t}){const r=gy[e];if(void 0===t[r])throw new Error(`${e} can only be used with ${r}`)}};my.default=yy;var by={};Object.defineProperty(by,"__esModule",{value:!0});const vy=Up,wy={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:e})=>vy.str`must be multiple of ${e}`,params:({schemaCode:e})=>vy._`{multipleOf: ${e}}`},code(e){const{gen:t,data:r,schemaCode:n,it:i}=e,o=i.opts.multipleOfPrecision,a=t.let("res"),s=o?vy._`Math.abs(Math.round(${a}) - ${a}) > 1e-${o}`:vy._`${a} !== parseInt(${a})`;e.fail$data(vy._`(${n} === 0 || (${a} = ${r}/${n}, ${s}))`)}};by.default=wy;var Ay={},_y={};function Ey(e){const t=e.length;let r,n=0,i=0;for(;i=55296&&r<=56319&&iSy.str`must NOT have ${"maxLength"===e?"more":"fewer"} than ${t} characters`,params:({schemaCode:e})=>Sy._`{limit: ${e}}`},My={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:ky,code(e){const{keyword:t,data:r,schemaCode:n,it:i}=e,o="maxLength"===t?Sy.operators.GT:Sy.operators.LT,a=!1===i.opts.unicode?Sy._`${r}.length`:Sy._`${(0,Py.useFunc)(e.gen,xy.default)}(${r})`;e.fail$data(Sy._`${a} ${o} ${n}`)}};Ay.default=My;var Cy={};Object.defineProperty(Cy,"__esModule",{value:!0});const Iy=fm,Ry=Up,Ny={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>Ry.str`must match pattern "${e}"`,params:({schemaCode:e})=>Ry._`{pattern: ${e}}`},code(e){const{data:t,$data:r,schema:n,schemaCode:i,it:o}=e,a=o.opts.unicodeRegExp?"u":"",s=r?Ry._`(new RegExp(${i}, ${a}))`:(0,Iy.usePattern)(e,n);e.fail$data(Ry._`!${s}.test(${t})`)}};Cy.default=Ny;var Oy={};Object.defineProperty(Oy,"__esModule",{value:!0});const Ty=Up,jy={message:({keyword:e,schemaCode:t})=>Ty.str`must NOT have ${"maxProperties"===e?"more":"fewer"} than ${t} properties`,params:({schemaCode:e})=>Ty._`{limit: ${e}}`},Dy={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:jy,code(e){const{keyword:t,data:r,schemaCode:n}=e,i="maxProperties"===t?Ty.operators.GT:Ty.operators.LT;e.fail$data(Ty._`Object.keys(${r}).length ${i} ${n}`)}};Oy.default=Dy;var $y={};Object.defineProperty($y,"__esModule",{value:!0});const By=fm,Fy=Up,zy=Hp,Uy={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:e}})=>Fy.str`must have required property '${e}'`,params:({params:{missingProperty:e}})=>Fy._`{missingProperty: ${e}}`},code(e){const{gen:t,schema:r,schemaCode:n,data:i,$data:o,it:a}=e,{opts:s}=a;if(!o&&0===r.length)return;const c=r.length>=s.loopRequired;if(a.allErrors?function(){if(c||o)e.block$data(Fy.nil,u);else for(const t of r)(0,By.checkReportMissingProp)(e,t)}():function(){const a=t.let("missing");if(c||o){const r=t.let("valid",!0);e.block$data(r,(()=>function(r,o){e.setParams({missingProperty:r}),t.forOf(r,n,(()=>{t.assign(o,(0,By.propertyInData)(t,i,r,s.ownProperties)),t.if((0,Fy.not)(o),(()=>{e.error(),t.break()}))}),Fy.nil)}(a,r))),e.ok(r)}else t.if((0,By.checkMissingProp)(e,r,a)),(0,By.reportMissingProp)(e,a),t.else()}(),s.strictRequired){const t=e.parentSchema.properties,{definedProperties:n}=e.it;for(const e of r)if(void 0===(null==t?void 0:t[e])&&!n.has(e)){const t=a.schemaEnv.baseId+a.errSchemaPath;(0,zy.checkStrictMode)(a,`required property "${e}" is not defined at "${t}" (strictRequired)`,a.opts.strictRequired)}}function u(){t.forOf("prop",n,(r=>{e.setParams({missingProperty:r}),t.if((0,By.noPropertyInData)(t,i,r,s.ownProperties),(()=>e.error()))}))}}};$y.default=Uy;var Ly={};Object.defineProperty(Ly,"__esModule",{value:!0});const qy=Up,Hy={message:({keyword:e,schemaCode:t})=>qy.str`must NOT have ${"maxItems"===e?"more":"fewer"} than ${t} items`,params:({schemaCode:e})=>qy._`{limit: ${e}}`},Ky={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:Hy,code(e){const{keyword:t,data:r,schemaCode:n}=e,i="maxItems"===t?qy.operators.GT:qy.operators.LT;e.fail$data(qy._`${r}.length ${i} ${n}`)}};Ly.default=Ky;var Jy={},Wy={};Object.defineProperty(Wy,"__esModule",{value:!0});const Gy=Im;Gy.code='require("ajv/dist/runtime/equal").default',Wy.default=Gy,Object.defineProperty(Jy,"__esModule",{value:!0});const Vy=Yp,Zy=Up,Xy=Hp,Qy=Wy,Yy={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:e,j:t}})=>Zy.str`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>Zy._`{i: ${e}, j: ${t}}`},code(e){const{gen:t,data:r,$data:n,schema:i,parentSchema:o,schemaCode:a,it:s}=e;if(!n&&!i)return;const c=t.let("valid"),u=o.items?(0,Vy.getSchemaTypes)(o.items):[];function f(n,i){const o=t.name("item"),a=(0,Vy.checkDataTypes)(u,o,s.opts.strictNumbers,Vy.DataType.Wrong),f=t.const("indices",Zy._`{}`);t.for(Zy._`;${n}--;`,(()=>{t.let(o,Zy._`${r}[${n}]`),t.if(a,Zy._`continue`),u.length>1&&t.if(Zy._`typeof ${o} == "string"`,Zy._`${o} += "_"`),t.if(Zy._`typeof ${f}[${o}] == "number"`,(()=>{t.assign(i,Zy._`${f}[${o}]`),e.error(),t.assign(c,!1).break()})).code(Zy._`${f}[${o}] = ${n}`)}))}function d(n,i){const o=(0,Xy.useFunc)(t,Qy.default),a=t.name("outer");t.label(a).for(Zy._`;${n}--;`,(()=>t.for(Zy._`${i} = ${n}; ${i}--;`,(()=>t.if(Zy._`${o}(${r}[${n}], ${r}[${i}])`,(()=>{e.error(),t.assign(c,!1).break(a)}))))))}e.block$data(c,(function(){const n=t.let("i",Zy._`${r}.length`),i=t.let("j");e.setParams({i:n,j:i}),t.assign(c,!0),t.if(Zy._`${n} > 1`,(()=>(u.length>0&&!u.some((e=>"object"===e||"array"===e))?f:d)(n,i)))}),Zy._`${a} === false`),e.ok(c)}};Jy.default=Yy;var eb={};Object.defineProperty(eb,"__esModule",{value:!0});const tb=Up,rb=Hp,nb=Wy,ib={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:e})=>tb._`{allowedValue: ${e}}`},code(e){const{gen:t,data:r,$data:n,schemaCode:i,schema:o}=e;n||o&&"object"==typeof o?e.fail$data(tb._`!${(0,rb.useFunc)(t,nb.default)}(${r}, ${i})`):e.fail(tb._`${o} !== ${r}`)}};eb.default=ib;var ob={};Object.defineProperty(ob,"__esModule",{value:!0});const ab=Up,sb=Hp,cb=Wy,ub={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:e})=>ab._`{allowedValues: ${e}}`},code(e){const{gen:t,data:r,$data:n,schema:i,schemaCode:o,it:a}=e;if(!n&&0===i.length)throw new Error("enum must have non-empty array");const s=i.length>=a.opts.loopEnum;let c;const u=()=>null!=c?c:c=(0,sb.useFunc)(t,cb.default);let f;if(s||n)f=t.let("valid"),e.block$data(f,(function(){t.assign(f,!1),t.forOf("v",o,(e=>t.if(ab._`${u()}(${r}, ${e})`,(()=>t.assign(f,!0).break()))))}));else{if(!Array.isArray(i))throw new Error("ajv implementation error");const e=t.const("vSchema",o);f=(0,ab.or)(...i.map(((t,n)=>function(e,t){const n=i[t];return"object"==typeof n&&null!==n?ab._`${u()}(${r}, ${e}[${t}])`:ab._`${r} === ${n}`}(e,n))))}e.pass(f)}};ob.default=ub,Object.defineProperty(sy,"__esModule",{value:!0});const fb=my,db=by,lb=Ay,hb=Cy,pb=Oy,mb=$y,gb=Ly,yb=Jy,bb=eb,vb=ob,wb=[cy.default,fb.default,db.default,lb.default,hb.default,pb.default,mb.default,gb.default,yb.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},bb.default,vb.default];sy.default=wb;var Ab={},_b={};Object.defineProperty(_b,"__esModule",{value:!0}),_b.validateAdditionalItems=void 0;const Eb=Up,Sb=Hp,Pb={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:e}})=>Eb.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>Eb._`{limit: ${e}}`},code(e){const{parentSchema:t,it:r}=e,{items:n}=t;Array.isArray(n)?xb(e,n):(0,Sb.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas')}};function xb(e,t){const{gen:r,schema:n,data:i,keyword:o,it:a}=e;a.items=!0;const s=r.const("len",Eb._`${i}.length`);if(!1===n)e.setParams({len:t.length}),e.pass(Eb._`${s} <= ${t.length}`);else if("object"==typeof n&&!(0,Sb.alwaysValidSchema)(a,n)){const n=r.var("valid",Eb._`${s} <= ${t.length}`);r.if((0,Eb.not)(n),(()=>function(n){r.forRange("i",t.length,s,(t=>{e.subschema({keyword:o,dataProp:t,dataPropType:Sb.Type.Num},n),a.allErrors||r.if((0,Eb.not)(n),(()=>r.break()))}))}(n))),e.ok(n)}}_b.validateAdditionalItems=xb,_b.default=Pb;var kb={},Mb={};Object.defineProperty(Mb,"__esModule",{value:!0}),Mb.validateTuple=void 0;const Cb=Up,Ib=Hp,Rb=fm,Nb={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){const{schema:t,it:r}=e;if(Array.isArray(t))return Ob(e,"additionalItems",t);r.items=!0,(0,Ib.alwaysValidSchema)(r,t)||e.ok((0,Rb.validateArray)(e))}};function Ob(e,t,r=e.schema){const{gen:n,parentSchema:i,data:o,keyword:a,it:s}=e;!function(e){const{opts:n,errSchemaPath:i}=s,o=r.length,c=o===e.minItems&&(o===e.maxItems||!1===e[t]);if(n.strictTuples&&!c){const e=`"${a}" is ${o}-tuple, but minItems or maxItems/${t} are not specified or different at path "${i}"`;(0,Ib.checkStrictMode)(s,e,n.strictTuples)}}(i),s.opts.unevaluated&&r.length&&!0!==s.items&&(s.items=Ib.mergeEvaluated.items(n,r.length,s.items));const c=n.name("valid"),u=n.const("len",Cb._`${o}.length`);r.forEach(((t,r)=>{(0,Ib.alwaysValidSchema)(s,t)||(n.if(Cb._`${u} > ${r}`,(()=>e.subschema({keyword:a,schemaProp:r,dataProp:r},c))),e.ok(c))}))}Mb.validateTuple=Ob,Mb.default=Nb,Object.defineProperty(kb,"__esModule",{value:!0});const Tb=Mb,jb={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,Tb.validateTuple)(e,"items")};kb.default=jb;var Db={};Object.defineProperty(Db,"__esModule",{value:!0});const $b=Up,Bb=Hp,Fb=fm,zb=_b,Ub={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:e}})=>$b.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>$b._`{limit: ${e}}`},code(e){const{schema:t,parentSchema:r,it:n}=e,{prefixItems:i}=r;n.items=!0,(0,Bb.alwaysValidSchema)(n,t)||(i?(0,zb.validateAdditionalItems)(e,i):e.ok((0,Fb.validateArray)(e)))}};Db.default=Ub;var Lb={};Object.defineProperty(Lb,"__esModule",{value:!0});const qb=Up,Hb=Hp,Kb={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:e,max:t}})=>void 0===t?qb.str`must contain at least ${e} valid item(s)`:qb.str`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>void 0===t?qb._`{minContains: ${e}}`:qb._`{minContains: ${e}, maxContains: ${t}}`},code(e){const{gen:t,schema:r,parentSchema:n,data:i,it:o}=e;let a,s;const{minContains:c,maxContains:u}=n;o.opts.next?(a=void 0===c?1:c,s=u):a=1;const f=t.const("len",qb._`${i}.length`);if(e.setParams({min:a,max:s}),void 0===s&&0===a)return void(0,Hb.checkStrictMode)(o,'"minContains" == 0 without "maxContains": "contains" keyword ignored');if(void 0!==s&&a>s)return(0,Hb.checkStrictMode)(o,'"minContains" > "maxContains" is always invalid'),void e.fail();if((0,Hb.alwaysValidSchema)(o,r)){let t=qb._`${f} >= ${a}`;return void 0!==s&&(t=qb._`${t} && ${f} <= ${s}`),void e.pass(t)}o.items=!0;const d=t.name("valid");function l(){const e=t.name("_valid"),r=t.let("count",0);h(e,(()=>t.if(e,(()=>function(e){t.code(qb._`${e}++`),void 0===s?t.if(qb._`${e} >= ${a}`,(()=>t.assign(d,!0).break())):(t.if(qb._`${e} > ${s}`,(()=>t.assign(d,!1).break())),1===a?t.assign(d,!0):t.if(qb._`${e} >= ${a}`,(()=>t.assign(d,!0))))}(r)))))}function h(r,n){t.forRange("i",0,f,(t=>{e.subschema({keyword:"contains",dataProp:t,dataPropType:Hb.Type.Num,compositeRule:!0},r),n()}))}void 0===s&&1===a?h(d,(()=>t.if(d,(()=>t.break())))):0===a?(t.let(d,!0),void 0!==s&&t.if(qb._`${i}.length > 0`,l)):(t.let(d,!1),l()),e.result(d,(()=>e.reset()))}};Lb.default=Kb;var Jb={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const t=Up,r=Hp,n=fm;e.error={message:({params:{property:e,depsCount:r,deps:n}})=>t.str`must have ${1===r?"property":"properties"} ${n} when property ${e} is present`,params:({params:{property:e,depsCount:r,deps:n,missingProperty:i}})=>t._`{property: ${e}, missingProperty: ${i}, depsCount: ${r}, - deps: ${n}}`};const i={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(e){const[t,r]=function({schema:e}){const t={},r={};for(const n in e){if("__proto__"===n)continue;(Array.isArray(e[n])?t:r)[n]=e[n]}return[t,r]}(e);o(e,t),a(e,r)}};function o(e,r=e.schema){const{gen:i,data:o,it:a}=e;if(0===Object.keys(r).length)return;const s=i.let("missing");for(const c in r){const u=r[c];if(0===u.length)continue;const f=(0,n.propertyInData)(i,o,c,a.opts.ownProperties);e.setParams({property:c,depsCount:u.length,deps:u.join(", ")}),a.allErrors?i.if(f,(()=>{for(const t of u)(0,n.checkReportMissingProp)(e,t)})):(i.if(t._`${f} && (${(0,n.checkMissingProp)(e,u,s)})`),(0,n.reportMissingProp)(e,s),i.else())}}function a(e,t=e.schema){const{gen:i,data:o,keyword:a,it:s}=e,c=i.name("valid");for(const u in t)(0,r.alwaysValidSchema)(s,t[u])||(i.if((0,n.propertyInData)(i,o,u,s.opts.ownProperties),(()=>{const t=e.subschema({keyword:a,schemaProp:u},c);e.mergeValidEvaluated(t,c)}),(()=>i.var(c,!0))),e.ok(c))}e.validatePropertyDeps=o,e.validateSchemaDeps=a,e.default=i}(Hb);var Kb={};Object.defineProperty(Kb,"__esModule",{value:!0});const Jb=Fp,Wb=Lp,Gb={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:e})=>Jb._`{propertyName: ${e.propertyName}}`},code(e){const{gen:t,schema:r,data:n,it:i}=e;if((0,Wb.alwaysValidSchema)(i,r))return;const o=t.name("valid");t.forIn("key",n,(r=>{e.setParams({propertyName:r}),e.subschema({keyword:"propertyNames",data:r,dataTypes:["string"],propertyName:r,compositeRule:!0},o),t.if((0,Jb.not)(o),(()=>{e.error(!0),i.allErrors||t.break()}))})),e.ok(o)}};Kb.default=Gb;var Vb={};Object.defineProperty(Vb,"__esModule",{value:!0});const Zb=cm,Xb=Fp,Qb=qp,Yb=Lp,ev={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:e})=>Xb._`{additionalProperty: ${e.additionalProperty}}`},code(e){const{gen:t,schema:r,parentSchema:n,data:i,errsCount:o,it:a}=e;if(!o)throw new Error("ajv implementation error");const{allErrors:s,opts:c}=a;if(a.props=!0,"all"!==c.removeAdditional&&(0,Yb.alwaysValidSchema)(a,r))return;const u=(0,Zb.allSchemaProperties)(n.properties),f=(0,Zb.allSchemaProperties)(n.patternProperties);function d(e){t.code(Xb._`delete ${i}[${e}]`)}function l(n){if("all"===c.removeAdditional||c.removeAdditional&&!1===r)d(n);else{if(!1===r)return e.setParams({additionalProperty:n}),e.error(),void(s||t.break());if("object"==typeof r&&!(0,Yb.alwaysValidSchema)(a,r)){const r=t.name("valid");"failing"===c.removeAdditional?(h(n,r,!1),t.if((0,Xb.not)(r),(()=>{e.reset(),d(n)}))):(h(n,r),s||t.if((0,Xb.not)(r),(()=>t.break())))}}}function h(t,r,n){const i={keyword:"additionalProperties",dataProp:t,dataPropType:Yb.Type.Str};!1===n&&Object.assign(i,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(i,r)}t.forIn("key",i,(r=>{u.length||f.length?t.if(function(r){let i;if(u.length>8){const e=(0,Yb.schemaRefOrVal)(a,n.properties,"properties");i=(0,Zb.isOwnProperty)(t,e,r)}else i=u.length?(0,Xb.or)(...u.map((e=>Xb._`${r} === ${e}`))):Xb.nil;return f.length&&(i=(0,Xb.or)(i,...f.map((t=>Xb._`${(0,Zb.usePattern)(e,t)}.test(${r})`)))),(0,Xb.not)(i)}(r),(()=>l(r))):l(r)})),e.ok(Xb._`${o} === ${Qb.default.errors}`)}};Vb.default=ev;var tv={};Object.defineProperty(tv,"__esModule",{value:!0});const rv=Dp,nv=cm,iv=Lp,ov=Vb,av={keyword:"properties",type:"object",schemaType:"object",code(e){const{gen:t,schema:r,parentSchema:n,data:i,it:o}=e;"all"===o.opts.removeAdditional&&void 0===n.additionalProperties&&ov.default.code(new rv.KeywordCxt(o,ov.default,"additionalProperties"));const a=(0,nv.allSchemaProperties)(r);for(const e of a)o.definedProperties.add(e);o.opts.unevaluated&&a.length&&!0!==o.props&&(o.props=iv.mergeEvaluated.props(t,(0,iv.toHash)(a),o.props));const s=a.filter((e=>!(0,iv.alwaysValidSchema)(o,r[e])));if(0===s.length)return;const c=t.name("valid");for(const r of s)u(r)?f(r):(t.if((0,nv.propertyInData)(t,i,r,o.opts.ownProperties)),f(r),o.allErrors||t.else().var(c,!0),t.endIf()),e.it.definedProperties.add(r),e.ok(c);function u(e){return o.opts.useDefaults&&!o.compositeRule&&void 0!==r[e].default}function f(t){e.subschema({keyword:"properties",schemaProp:t,dataProp:t},c)}}};tv.default=av;var sv={};Object.defineProperty(sv,"__esModule",{value:!0});const cv=cm,uv=Fp,fv=Lp,dv=Lp,lv={keyword:"patternProperties",type:"object",schemaType:"object",code(e){const{gen:t,schema:r,data:n,parentSchema:i,it:o}=e,{opts:a}=o,s=(0,cv.allSchemaProperties)(r),c=s.filter((e=>(0,fv.alwaysValidSchema)(o,r[e])));if(0===s.length||c.length===s.length&&(!o.opts.unevaluated||!0===o.props))return;const u=a.strictSchema&&!a.allowMatchingProperties&&i.properties,f=t.name("valid");!0===o.props||o.props instanceof uv.Name||(o.props=(0,dv.evaluatedPropsToName)(t,o.props));const{props:d}=o;function l(e){for(const t in u)new RegExp(e).test(t)&&(0,fv.checkStrictMode)(o,`property ${t} matches pattern ${e} (use allowMatchingProperties)`)}function h(r){t.forIn("key",n,(n=>{t.if(uv._`${(0,cv.usePattern)(e,r)}.test(${n})`,(()=>{const i=c.includes(r);i||e.subschema({keyword:"patternProperties",schemaProp:r,dataProp:n,dataPropType:dv.Type.Str},f),o.opts.unevaluated&&!0!==d?t.assign(uv._`${d}[${n}]`,!0):i||o.allErrors||t.if((0,uv.not)(f),(()=>t.break()))}))}))}!function(){for(const e of s)u&&l(e),o.allErrors?h(e):(t.var(f,!0),h(e),t.if(f))}()}};sv.default=lv;var hv={};Object.defineProperty(hv,"__esModule",{value:!0});const pv=Lp,mv={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){const{gen:t,schema:r,it:n}=e;if((0,pv.alwaysValidSchema)(n,r))return void e.fail();const i=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},i),e.failResult(i,(()=>e.reset()),(()=>e.error()))},error:{message:"must NOT be valid"}};hv.default=mv;var gv={};Object.defineProperty(gv,"__esModule",{value:!0});const yv={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:cm.validateUnion,error:{message:"must match a schema in anyOf"}};gv.default=yv;var bv={};Object.defineProperty(bv,"__esModule",{value:!0});const vv=Fp,wv=Lp,Av={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:e})=>vv._`{passingSchemas: ${e.passing}}`},code(e){const{gen:t,schema:r,parentSchema:n,it:i}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(i.opts.discriminator&&n.discriminator)return;const o=r,a=t.let("valid",!1),s=t.let("passing",null),c=t.name("_valid");e.setParams({passing:s}),t.block((function(){o.forEach(((r,n)=>{let o;(0,wv.alwaysValidSchema)(i,r)?t.var(c,!0):o=e.subschema({keyword:"oneOf",schemaProp:n,compositeRule:!0},c),n>0&&t.if(vv._`${c} && ${a}`).assign(a,!1).assign(s,vv._`[${s}, ${n}]`).else(),t.if(c,(()=>{t.assign(a,!0),t.assign(s,n),o&&e.mergeEvaluated(o,vv.Name)}))}))})),e.result(a,(()=>e.reset()),(()=>e.error(!0)))}};bv.default=Av;var _v={};Object.defineProperty(_v,"__esModule",{value:!0});const Ev=Lp,Sv={keyword:"allOf",schemaType:"array",code(e){const{gen:t,schema:r,it:n}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");const i=t.name("valid");r.forEach(((t,r)=>{if((0,Ev.alwaysValidSchema)(n,t))return;const o=e.subschema({keyword:"allOf",schemaProp:r},i);e.ok(i),e.mergeEvaluated(o)}))}};_v.default=Sv;var Pv={};Object.defineProperty(Pv,"__esModule",{value:!0});const xv=Fp,kv=Lp,Mv={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:e})=>xv.str`must match "${e.ifClause}" schema`,params:({params:e})=>xv._`{failingKeyword: ${e.ifClause}}`},code(e){const{gen:t,parentSchema:r,it:n}=e;void 0===r.then&&void 0===r.else&&(0,kv.checkStrictMode)(n,'"if" without "then" and "else" is ignored');const i=Cv(n,"then"),o=Cv(n,"else");if(!i&&!o)return;const a=t.let("valid",!0),s=t.name("_valid");if(function(){const t=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},s);e.mergeEvaluated(t)}(),e.reset(),i&&o){const r=t.let("ifClause");e.setParams({ifClause:r}),t.if(s,c("then",r),c("else",r))}else i?t.if(s,c("then")):t.if((0,xv.not)(s),c("else"));function c(r,n){return()=>{const i=e.subschema({keyword:r},s);t.assign(a,s),e.mergeValidEvaluated(i,a),n?t.assign(n,xv._`${r}`):e.setParams({ifClause:r})}}e.pass(a,(()=>e.error(!0)))}};function Cv(e,t){const r=e.schema[t];return void 0!==r&&!(0,kv.alwaysValidSchema)(e,r)}Pv.default=Mv;var Iv={};Object.defineProperty(Iv,"__esModule",{value:!0});const Rv=Lp,Nv={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){void 0===t.if&&(0,Rv.checkStrictMode)(r,`"${e}" without "if" is ignored`)}};Iv.default=Nv,Object.defineProperty(vb,"__esModule",{value:!0});const Ov=wb,Tv=Pb,jv=xb,Dv=Tb,$v=zb,Bv=Hb,Fv=Kb,zv=Vb,Uv=tv,Lv=sv,qv=hv,Hv=gv,Kv=bv,Jv=_v,Wv=Pv,Gv=Iv;vb.default=function(e=!1){const t=[qv.default,Hv.default,Kv.default,Jv.default,Wv.default,Gv.default,Fv.default,zv.default,Bv.default,Uv.default,Lv.default];return e?t.push(Tv.default,Dv.default):t.push(Ov.default,jv.default),t.push($v.default),t};var Vv={},Zv={};Object.defineProperty(Zv,"__esModule",{value:!0});const Xv=Fp,Qv={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>Xv.str`must match format "${e}"`,params:({schemaCode:e})=>Xv._`{format: ${e}}`},code(e,t){const{gen:r,data:n,$data:i,schema:o,schemaCode:a,it:s}=e,{opts:c,errSchemaPath:u,schemaEnv:f,self:d}=s;c.validateFormats&&(i?function(){const i=r.scopeValue("formats",{ref:d.formats,code:c.code.formats}),o=r.const("fDef",Xv._`${i}[${a}]`),s=r.let("fType"),u=r.let("format");r.if(Xv._`typeof ${o} == "object" && !(${o} instanceof RegExp)`,(()=>r.assign(s,Xv._`${o}.type || "string"`).assign(u,Xv._`${o}.validate`)),(()=>r.assign(s,Xv._`"string"`).assign(u,o))),e.fail$data((0,Xv.or)(!1===c.strictSchema?Xv.nil:Xv._`${a} && !${u}`,function(){const e=f.$async?Xv._`(${o}.async ? await ${u}(${n}) : ${u}(${n}))`:Xv._`${u}(${n})`,r=Xv._`(typeof ${u} == "function" ? ${e} : ${u}.test(${n}))`;return Xv._`${u} && ${u} !== true && ${s} === ${t} && !${r}`}()))}():function(){const i=d.formats[o];if(!i)return void function(){if(!1===c.strictSchema)return void d.logger.warn(e());throw new Error(e());function e(){return`unknown format "${o}" ignored in schema at path "${u}"`}}();if(!0===i)return;const[a,s,l]=function(e){const t=e instanceof RegExp?(0,Xv.regexpCode)(e):c.code.formats?Xv._`${c.code.formats}${(0,Xv.getProperty)(o)}`:void 0,n=r.scopeValue("formats",{key:o,ref:e,code:t});if("object"==typeof e&&!(e instanceof RegExp))return[e.type||"string",e.validate,Xv._`${n}.validate`];return["string",e,n]}(i);a===t&&e.pass(function(){if("object"==typeof i&&!(i instanceof RegExp)&&i.async){if(!f.$async)throw new Error("async format in sync schema");return Xv._`await ${l}(${n})`}return"function"==typeof s?Xv._`${l}(${n})`:Xv._`${l}.test(${n})`}())}())}};Zv.default=Qv,Object.defineProperty(Vv,"__esModule",{value:!0});const Yv=[Zv.default];Vv.default=Yv,Object.defineProperty(Jg,"__esModule",{value:!0});const ew=oy,tw=vb,rw=Vv,nw=[Wg.default,ew.default,tw.default(),rw.default,["title","description","default"]];Jg.default=nw;var iw={},ow={};!function(e){var t;Object.defineProperty(e,"__esModule",{value:!0}),e.DiscrError=void 0,(t=e.DiscrError||(e.DiscrError={})).Tag="tag",t.Mapping="mapping"}(ow),Object.defineProperty(iw,"__esModule",{value:!0});const aw=Fp,sw=ow,cw=xg,uw=Lp,fw={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:e,tagName:t}})=>e===sw.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>aw._`{error: ${e}, tag: ${r}, tagValue: ${t}}`},code(e){const{gen:t,data:r,schema:n,parentSchema:i,it:o}=e,{oneOf:a}=i;if(!o.opts.discriminator)throw new Error("discriminator: requires discriminator option");const s=n.propertyName;if("string"!=typeof s)throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!a)throw new Error("discriminator: requires oneOf keyword");const c=t.let("valid",!1),u=t.const("tag",aw._`${r}${(0,aw.getProperty)(s)}`);function f(r){const n=t.name("valid"),i=e.subschema({keyword:"oneOf",schemaProp:r},n);return e.mergeEvaluated(i,aw.Name),n}t.if(aw._`typeof ${u} == "string"`,(()=>function(){const r=function(){var e;const t={},r=c(i);let n=!0;for(let t=0;te.error(!1,{discrError:sw.DiscrError.Tag,tag:u,tagName:s}))),e.ok(c)}};iw.default=fw;var dw={id:"http://json-schema.org/draft-04/schema#",$schema:"http://json-schema.org/draft-04/schema#",description:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},positiveInteger:{type:"integer",minimum:0},positiveIntegerDefault0:{allOf:[{$ref:"#/definitions/positiveInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},minItems:1,uniqueItems:!0}},type:"object",properties:{id:{type:"string",format:"uri"},$schema:{type:"string",format:"uri"},title:{type:"string"},description:{type:"string"},default:{},multipleOf:{type:"number",minimum:0,exclusiveMinimum:!0},maximum:{type:"number"},exclusiveMaximum:{type:"boolean",default:!1},minimum:{type:"number"},exclusiveMinimum:{type:"boolean",default:!1},maxLength:{$ref:"#/definitions/positiveInteger"},minLength:{$ref:"#/definitions/positiveIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{anyOf:[{type:"boolean"},{$ref:"#"}],default:{}},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:{}},maxItems:{$ref:"#/definitions/positiveInteger"},minItems:{$ref:"#/definitions/positiveIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxProperties:{$ref:"#/definitions/positiveInteger"},minProperties:{$ref:"#/definitions/positiveIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{anyOf:[{type:"boolean"},{$ref:"#"}],default:{}},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},enum:{type:"array",minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},dependencies:{exclusiveMaximum:["maximum"],exclusiveMinimum:["minimum"]},default:{}};!function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;const r=jp,n=Jg,i=iw,o=dw,a=["/properties"],s="http://json-schema.org/draft-04/schema";class c extends r.default{constructor(e={}){super({...e,schemaId:"id"})}_addVocabularies(){super._addVocabularies(),n.default.forEach((e=>this.addVocabulary(e))),this.opts.discriminator&&this.addKeyword(i.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const e=this.opts.$data?this.$dataMetaSchema(o,a):o;this.addMetaSchema(e,s,!1),this.refs["http://json-schema.org/schema"]=s}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(s)?s:void 0)}}e.exports=t=c,Object.defineProperty(t,"__esModule",{value:!0}),t.default=c;var u=jp;Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return u.KeywordCxt}});var f=jp;Object.defineProperty(t,"_",{enumerable:!0,get:function(){return f._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return f.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return f.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return f.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return f.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return f.CodeGen}})}(Tp,Tp.exports);var lw=c(Tp.exports),hw={exports:{}},pw={};!function(e){function t(e,t){return{validate:e,compare:t}}Object.defineProperty(e,"__esModule",{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0,e.fullFormats={date:t(i,o),time:t(s,c),"date-time":t((function(e){const t=e.split(u);return 2===t.length&&i(t[0])&&s(t[1],!0)}),f),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:function(e){return d.test(e)&&l.test(e)},"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+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([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:function(e){if(y.test(e))return!1;try{return new RegExp(e),!0}catch(e){return!1}},uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:function(e){return h.lastIndex=0,h.test(e)},int32:{type:"number",validate:function(e){return Number.isInteger(e)&&e<=m&&e>=p}},int64:{type:"number",validate:function(e){return Number.isInteger(e)}},float:{type:"number",validate:g},double:{type:"number",validate:g},password:!0,binary:!0},e.fastFormats={...e.fullFormats,date:t(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,o),time:t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,c),"date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,f),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},e.formatNames=Object.keys(e.fullFormats);const r=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,n=[0,31,28,31,30,31,30,31,31,30,31,30,31];function i(e){const t=r.exec(e);if(!t)return!1;const i=+t[1],o=+t[2],a=+t[3];return o>=1&&o<=12&&a>=1&&a<=(2===o&&function(e){return e%4==0&&(e%100!=0||e%400==0)}(i)?29:n[o])}function o(e,t){if(e&&t)return e>t?1:e(t=n[1]+n[2]+n[3]+(n[4]||""))?1:e=",ok:xw.GTE,fail:xw.LT},exclusiveMaximum:{okStr:"<",ok:xw.LT,fail:xw.GTE},exclusiveMinimum:{okStr:">",ok:xw.GT,fail:xw.LTE}},Mw={message:({keyword:e,schemaCode:t})=>Pw.str`must be ${kw[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>Pw._`{comparison: ${kw[e].okStr}, limit: ${t}}`},Cw={keyword:Object.keys(kw),type:"number",schemaType:"number",$data:!0,error:Mw,code(e){const{keyword:t,data:r,schemaCode:n}=e;e.fail$data(Pw._`${r} ${kw[t].fail} ${n} || isNaN(${r})`)}};Sw.default=Cw,Object.defineProperty(Ew,"__esModule",{value:!0});const Iw=gy,Rw=vy,Nw=ky,Ow=Ry,Tw=jy,jw=zy,Dw=Hy,$w=Qy,Bw=nb,Fw=[Sw.default,Iw.default,Rw.default,Nw.default,Ow.default,Tw.default,jw.default,Dw.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},$w.default,Bw.default];Ew.default=Fw;var zw={};Object.defineProperty(zw,"__esModule",{value:!0}),zw.contentVocabulary=zw.metadataVocabulary=void 0,zw.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],zw.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"],Object.defineProperty(yw,"__esModule",{value:!0});const Uw=Ew,Lw=vb,qw=Vv,Hw=zw,Kw=[bw.default,Uw.default,(0,Lw.default)(),qw.default,Hw.metadataVocabulary,Hw.contentVocabulary];yw.default=Kw;var Jw={$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:!0,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:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},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:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},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:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},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:!0};!function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;const r=jp,n=yw,i=iw,o=Jw,a=["/properties"],s="http://json-schema.org/draft-07/schema";class c extends r.default{_addVocabularies(){super._addVocabularies(),n.default.forEach((e=>this.addVocabulary(e))),this.opts.discriminator&&this.addKeyword(i.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const e=this.opts.$data?this.$dataMetaSchema(o,a):o;this.addMetaSchema(e,s,!1),this.refs["http://json-schema.org/schema"]=s}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(s)?s:void 0)}}e.exports=t=c,Object.defineProperty(t,"__esModule",{value:!0}),t.default=c;var u=Dp;Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return u.KeywordCxt}});var f=Fp;Object.defineProperty(t,"_",{enumerable:!0,get:function(){return f._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return f.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return f.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return f.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return f.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return f.CodeGen}});var d=Ag;Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return d.default}});var l=Eg;Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return l.default}})}(gw,gw.exports);var Ww=gw.exports;!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;const t=Ww,r=Fp,n=r.operators,i={formatMaximum:{okStr:"<=",ok:n.LTE,fail:n.GT},formatMinimum:{okStr:">=",ok:n.GTE,fail:n.LT},formatExclusiveMaximum:{okStr:"<",ok:n.LT,fail:n.GTE},formatExclusiveMinimum:{okStr:">",ok:n.GT,fail:n.LTE}},o={message:({keyword:e,schemaCode:t})=>r.str`should be ${i[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>r._`{comparison: ${i[e].okStr}, limit: ${t}}`};e.formatLimitDefinition={keyword:Object.keys(i),type:"string",schemaType:"string",$data:!0,error:o,code(e){const{gen:n,data:o,schemaCode:a,keyword:s,it:c}=e,{opts:u,self:f}=c;if(!u.validateFormats)return;const d=new t.KeywordCxt(c,f.RULES.all.format.definition,"format");function l(e){return r._`${e}.compare(${o}, ${a}) ${i[s].fail} 0`}d.$data?function(){const t=n.scopeValue("formats",{ref:f.formats,code:u.code.formats}),i=n.const("fmt",r._`${t}[${d.schemaCode}]`);e.fail$data(r.or(r._`typeof ${i} != "object"`,r._`${i} instanceof RegExp`,r._`typeof ${i}.compare != "function"`,l(i)))}():function(){const t=d.schema,i=f.formats[t];if(!i||!0===i)return;if("object"!=typeof i||i instanceof RegExp||"function"!=typeof i.compare)throw new Error(`"${s}": format "${t}" does not define "compare" function`);const o=n.scopeValue("formats",{key:t,ref:i,code:u.code.formats?r._`${u.code.formats}${r.getProperty(t)}`:void 0});e.fail$data(l(o))}()},dependencies:["format"]};e.default=t=>(t.addKeyword(e.formatLimitDefinition),t)}(mw),function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=pw,n=mw,i=Fp,o=new i.Name("fullFormats"),a=new i.Name("fastFormats"),s=(e,t={keywords:!0})=>{if(Array.isArray(t))return c(e,t,r.fullFormats,o),e;const[i,s]="fast"===t.mode?[r.fastFormats,a]:[r.fullFormats,o];return c(e,t.formats||r.formatNames,i,s),t.keywords&&n.default(e),e};function c(e,t,r,n){var o,a;null!==(o=(a=e.opts.code).formats)&&void 0!==o||(a.formats=i._`require("ajv-formats/dist/formats").${n}`);for(const n of t)e.addFormat(n,r[n])}s.get=(e,t="full")=>{const n=("fast"===t?r.fastFormats:r.fullFormats)[e];if(!n)throw new Error(`Unknown format "${e}"`);return n},e.exports=t=s,Object.defineProperty(t,"__esModule",{value:!0}),t.default=s}(hw,hw.exports);var Gw=c(hw.exports),Vw={exports:{}};!function(e,t){(function(){var r,n="Expected a function",i="__lodash_hash_undefined__",o="__lodash_placeholder__",a=16,c=32,u=64,f=128,d=256,l=1/0,h=9007199254740991,p=NaN,m=4294967295,g=[["ary",f],["bind",1],["bindKey",2],["curry",8],["curryRight",a],["flip",512],["partial",c],["partialRight",u],["rearg",d]],y="[object Arguments]",b="[object Array]",v="[object Boolean]",w="[object Date]",A="[object Error]",_="[object Function]",E="[object GeneratorFunction]",S="[object Map]",P="[object Number]",x="[object Object]",k="[object Promise]",M="[object RegExp]",C="[object Set]",I="[object String]",R="[object Symbol]",N="[object WeakMap]",O="[object ArrayBuffer]",T="[object DataView]",j="[object Float32Array]",D="[object Float64Array]",$="[object Int8Array]",B="[object Int16Array]",F="[object Int32Array]",z="[object Uint8Array]",U="[object Uint8ClampedArray]",L="[object Uint16Array]",q="[object Uint32Array]",H=/\b__p \+= '';/g,K=/\b(__p \+=) '' \+/g,J=/(__e\(.*?\)|\b__t\)) \+\n'';/g,W=/&(?:amp|lt|gt|quot|#39);/g,G=/[&<>"']/g,V=RegExp(W.source),Z=RegExp(G.source),X=/<%-([\s\S]+?)%>/g,Q=/<%([\s\S]+?)%>/g,Y=/<%=([\s\S]+?)%>/g,ee=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,te=/^\w*$/,re=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ne=/[\\^$.*+?()[\]{}|]/g,ie=RegExp(ne.source),oe=/^\s+/,ae=/\s/,se=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ce=/\{\n\/\* \[wrapped with (.+)\] \*/,ue=/,? & /,fe=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,de=/[()=,{}\[\]\/\s]/,le=/\\(\\)?/g,he=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,pe=/\w*$/,me=/^[-+]0x[0-9a-f]+$/i,ge=/^0b[01]+$/i,ye=/^\[object .+?Constructor\]$/,be=/^0o[0-7]+$/i,ve=/^(?:0|[1-9]\d*)$/,we=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Ae=/($^)/,_e=/['\n\r\u2028\u2029\\]/g,Ee="\\ud800-\\udfff",Se="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Pe="\\u2700-\\u27bf",xe="a-z\\xdf-\\xf6\\xf8-\\xff",ke="A-Z\\xc0-\\xd6\\xd8-\\xde",Me="\\ufe0e\\ufe0f",Ce="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ie="['’]",Re="["+Ee+"]",Ne="["+Ce+"]",Oe="["+Se+"]",Te="\\d+",je="["+Pe+"]",De="["+xe+"]",$e="[^"+Ee+Ce+Te+Pe+xe+ke+"]",Be="\\ud83c[\\udffb-\\udfff]",Fe="[^"+Ee+"]",ze="(?:\\ud83c[\\udde6-\\uddff]){2}",Ue="[\\ud800-\\udbff][\\udc00-\\udfff]",Le="["+ke+"]",qe="\\u200d",He="(?:"+De+"|"+$e+")",Ke="(?:"+Le+"|"+$e+")",Je="(?:['’](?:d|ll|m|re|s|t|ve))?",We="(?:['’](?:D|LL|M|RE|S|T|VE))?",Ge="(?:"+Oe+"|"+Be+")"+"?",Ve="["+Me+"]?",Ze=Ve+Ge+("(?:"+qe+"(?:"+[Fe,ze,Ue].join("|")+")"+Ve+Ge+")*"),Xe="(?:"+[je,ze,Ue].join("|")+")"+Ze,Qe="(?:"+[Fe+Oe+"?",Oe,ze,Ue,Re].join("|")+")",Ye=RegExp(Ie,"g"),et=RegExp(Oe,"g"),tt=RegExp(Be+"(?="+Be+")|"+Qe+Ze,"g"),rt=RegExp([Le+"?"+De+"+"+Je+"(?="+[Ne,Le,"$"].join("|")+")",Ke+"+"+We+"(?="+[Ne,Le+He,"$"].join("|")+")",Le+"?"+He+"+"+Je,Le+"+"+We,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Te,Xe].join("|"),"g"),nt=RegExp("["+qe+Ee+Se+Me+"]"),it=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ot=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],at=-1,st={};st[j]=st[D]=st[$]=st[B]=st[F]=st[z]=st[U]=st[L]=st[q]=!0,st[y]=st[b]=st[O]=st[v]=st[T]=st[w]=st[A]=st[_]=st[S]=st[P]=st[x]=st[M]=st[C]=st[I]=st[N]=!1;var ct={};ct[y]=ct[b]=ct[O]=ct[T]=ct[v]=ct[w]=ct[j]=ct[D]=ct[$]=ct[B]=ct[F]=ct[S]=ct[P]=ct[x]=ct[M]=ct[C]=ct[I]=ct[R]=ct[z]=ct[U]=ct[L]=ct[q]=!0,ct[A]=ct[_]=ct[N]=!1;var ut={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ft=parseFloat,dt=parseInt,lt="object"==typeof s&&s&&s.Object===Object&&s,ht="object"==typeof self&&self&&self.Object===Object&&self,pt=lt||ht||Function("return this")(),mt=t&&!t.nodeType&&t,gt=mt&&e&&!e.nodeType&&e,yt=gt&>.exports===mt,bt=yt&<.process,vt=function(){try{var e=gt&>.require&>.require("util").types;return e||bt&&bt.binding&&bt.binding("util")}catch(e){}}(),wt=vt&&vt.isArrayBuffer,At=vt&&vt.isDate,_t=vt&&vt.isMap,Et=vt&&vt.isRegExp,St=vt&&vt.isSet,Pt=vt&&vt.isTypedArray;function xt(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}function kt(e,t,r,n){for(var i=-1,o=null==e?0:e.length;++i-1}function Ot(e,t,r){for(var n=-1,i=null==e?0:e.length;++n-1;);return r}function rr(e,t){for(var r=e.length;r--&&Lt(t,e[r],0)>-1;);return r}var nr=Wt({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),ir=Wt({"&":"&","<":"<",">":">",'"':""","'":"'"});function or(e){return"\\"+ut[e]}function ar(e){return nt.test(e)}function sr(e){var t=-1,r=Array(e.size);return e.forEach((function(e,n){r[++t]=[n,e]})),r}function cr(e,t){return function(r){return e(t(r))}}function ur(e,t){for(var r=-1,n=e.length,i=0,a=[];++r",""":'"',"'":"'"});var gr=function e(t){var s,ae=(t=null==t?pt:gr.defaults(pt.Object(),t,gr.pick(pt,ot))).Array,Ee=t.Date,Se=t.Error,Pe=t.Function,xe=t.Math,ke=t.Object,Me=t.RegExp,Ce=t.String,Ie=t.TypeError,Re=ae.prototype,Ne=Pe.prototype,Oe=ke.prototype,Te=t["__core-js_shared__"],je=Ne.toString,De=Oe.hasOwnProperty,$e=0,Be=(s=/[^.]+$/.exec(Te&&Te.keys&&Te.keys.IE_PROTO||""))?"Symbol(src)_1."+s:"",Fe=Oe.toString,ze=je.call(ke),Ue=pt._,Le=Me("^"+je.call(De).replace(ne,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),qe=yt?t.Buffer:r,He=t.Symbol,Ke=t.Uint8Array,Je=qe?qe.allocUnsafe:r,We=cr(ke.getPrototypeOf,ke),Ge=ke.create,Ve=Oe.propertyIsEnumerable,Ze=Re.splice,Xe=He?He.isConcatSpreadable:r,Qe=He?He.iterator:r,tt=He?He.toStringTag:r,nt=function(){try{var e=ho(ke,"defineProperty");return e({},"",{}),e}catch(e){}}(),ut=t.clearTimeout!==pt.clearTimeout&&t.clearTimeout,lt=Ee&&Ee.now!==pt.Date.now&&Ee.now,ht=t.setTimeout!==pt.setTimeout&&t.setTimeout,mt=xe.ceil,gt=xe.floor,bt=ke.getOwnPropertySymbols,vt=qe?qe.isBuffer:r,Ft=t.isFinite,Wt=Re.join,yr=cr(ke.keys,ke),br=xe.max,vr=xe.min,wr=Ee.now,Ar=t.parseInt,_r=xe.random,Er=Re.reverse,Sr=ho(t,"DataView"),Pr=ho(t,"Map"),xr=ho(t,"Promise"),kr=ho(t,"Set"),Mr=ho(t,"WeakMap"),Cr=ho(ke,"create"),Ir=Mr&&new Mr,Rr={},Nr=Fo(Sr),Or=Fo(Pr),Tr=Fo(xr),jr=Fo(kr),Dr=Fo(Mr),$r=He?He.prototype:r,Br=$r?$r.valueOf:r,Fr=$r?$r.toString:r;function zr(e){if(rs(e)&&!Ka(e)&&!(e instanceof Hr)){if(e instanceof qr)return e;if(De.call(e,"__wrapped__"))return zo(e)}return new qr(e)}var Ur=function(){function e(){}return function(t){if(!ts(t))return{};if(Ge)return Ge(t);e.prototype=t;var n=new e;return e.prototype=r,n}}();function Lr(){}function qr(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=r}function Hr(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=m,this.__views__=[]}function Kr(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t=t?e:t)),e}function un(e,t,n,i,o,a){var s,c=1&t,u=2&t,f=4&t;if(n&&(s=o?n(e,i,o,a):n(e)),s!==r)return s;if(!ts(e))return e;var d=Ka(e);if(d){if(s=function(e){var t=e.length,r=new e.constructor(t);t&&"string"==typeof e[0]&&De.call(e,"index")&&(r.index=e.index,r.input=e.input);return r}(e),!c)return Ii(e,s)}else{var l=go(e),h=l==_||l==E;if(Va(e))return Si(e,c);if(l==x||l==y||h&&!o){if(s=u||h?{}:bo(e),!c)return u?function(e,t){return Ri(e,mo(e),t)}(e,function(e,t){return e&&Ri(t,Os(t),e)}(s,e)):function(e,t){return Ri(e,po(e),t)}(e,on(s,e))}else{if(!ct[l])return o?e:{};s=function(e,t,r){var n=e.constructor;switch(t){case O:return Pi(e);case v:case w:return new n(+e);case T:return function(e,t){var r=t?Pi(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}(e,r);case j:case D:case $:case B:case F:case z:case U:case L:case q:return xi(e,r);case S:return new n;case P:case I:return new n(e);case M:return function(e){var t=new e.constructor(e.source,pe.exec(e));return t.lastIndex=e.lastIndex,t}(e);case C:return new n;case R:return i=e,Br?ke(Br.call(i)):{}}var i}(e,l,c)}}a||(a=new Vr);var p=a.get(e);if(p)return p;a.set(e,s),ss(e)?e.forEach((function(r){s.add(un(r,t,n,r,e,a))})):ns(e)&&e.forEach((function(r,i){s.set(i,un(r,t,n,i,e,a))}));var m=d?r:(f?u?oo:io:u?Os:Ns)(e);return Mt(m||e,(function(r,i){m&&(r=e[i=r]),tn(s,i,un(r,t,n,i,e,a))})),s}function fn(e,t,n){var i=n.length;if(null==e)return!i;for(e=ke(e);i--;){var o=n[i],a=t[o],s=e[o];if(s===r&&!(o in e)||!a(s))return!1}return!0}function dn(e,t,i){if("function"!=typeof e)throw new Ie(n);return No((function(){e.apply(r,i)}),t)}function ln(e,t,r,n){var i=-1,o=Nt,a=!0,s=e.length,c=[],u=t.length;if(!s)return c;r&&(t=Tt(t,Qt(r))),n?(o=Ot,a=!1):t.length>=200&&(o=er,a=!1,t=new Gr(t));e:for(;++i-1},Jr.prototype.set=function(e,t){var r=this.__data__,n=rn(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this},Wr.prototype.clear=function(){this.size=0,this.__data__={hash:new Kr,map:new(Pr||Jr),string:new Kr}},Wr.prototype.delete=function(e){var t=fo(this,e).delete(e);return this.size-=t?1:0,t},Wr.prototype.get=function(e){return fo(this,e).get(e)},Wr.prototype.has=function(e){return fo(this,e).has(e)},Wr.prototype.set=function(e,t){var r=fo(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this},Gr.prototype.add=Gr.prototype.push=function(e){return this.__data__.set(e,i),this},Gr.prototype.has=function(e){return this.__data__.has(e)},Vr.prototype.clear=function(){this.__data__=new Jr,this.size=0},Vr.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},Vr.prototype.get=function(e){return this.__data__.get(e)},Vr.prototype.has=function(e){return this.__data__.has(e)},Vr.prototype.set=function(e,t){var r=this.__data__;if(r instanceof Jr){var n=r.__data__;if(!Pr||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new Wr(n)}return r.set(e,t),this.size=r.size,this};var hn=Ti(An),pn=Ti(_n,!0);function mn(e,t){var r=!0;return hn(e,(function(e,n,i){return r=!!t(e,n,i)})),r}function gn(e,t,n){for(var i=-1,o=e.length;++i0&&r(s)?t>1?bn(s,t-1,r,n,i):jt(i,s):n||(i[i.length]=s)}return i}var vn=ji(),wn=ji(!0);function An(e,t){return e&&vn(e,t,Ns)}function _n(e,t){return e&&wn(e,t,Ns)}function En(e,t){return Rt(t,(function(t){return Qa(e[t])}))}function Sn(e,t){for(var n=0,i=(t=wi(t,e)).length;null!=e&&nt}function Mn(e,t){return null!=e&&De.call(e,t)}function Cn(e,t){return null!=e&&t in ke(e)}function In(e,t,n){for(var i=n?Ot:Nt,o=e[0].length,a=e.length,s=a,c=ae(a),u=1/0,f=[];s--;){var d=e[s];s&&t&&(d=Tt(d,Qt(t))),u=vr(d.length,u),c[s]=!n&&(t||o>=120&&d.length>=120)?new Gr(s&&d):r}d=e[0];var l=-1,h=c[0];e:for(;++l=s?c:c*("desc"==r[n]?-1:1)}return e.index-t.index}(e,t,r)}))}function Jn(e,t,r){for(var n=-1,i=t.length,o={};++n-1;)s!==e&&Ze.call(s,c,1),Ze.call(e,c,1);return e}function Gn(e,t){for(var r=e?t.length:0,n=r-1;r--;){var i=t[r];if(r==n||i!==o){var o=i;wo(i)?Ze.call(e,i,1):li(e,i)}}return e}function Vn(e,t){return e+gt(_r()*(t-e+1))}function Zn(e,t){var r="";if(!e||t<1||t>h)return r;do{t%2&&(r+=e),(t=gt(t/2))&&(e+=e)}while(t);return r}function Xn(e,t){return Oo(Mo(e,t,ic),e+"")}function Qn(e){return Xr(Us(e))}function Yn(e,t){var r=Us(e);return Do(r,cn(t,0,r.length))}function ei(e,t,n,i){if(!ts(e))return e;for(var o=-1,a=(t=wi(t,e)).length,s=a-1,c=e;null!=c&&++oi?0:i+t),(r=r>i?i:r)<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var o=ae(i);++n>>1,a=e[o];null!==a&&!us(a)&&(r?a<=t:a=200){var u=t?null:Zi(e);if(u)return fr(u);a=!1,i=er,c=new Gr}else c=t?[]:s;e:for(;++n=i?e:ii(e,t,n)}var Ei=ut||function(e){return pt.clearTimeout(e)};function Si(e,t){if(t)return e.slice();var r=e.length,n=Je?Je(r):new e.constructor(r);return e.copy(n),n}function Pi(e){var t=new e.constructor(e.byteLength);return new Ke(t).set(new Ke(e)),t}function xi(e,t){var r=t?Pi(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function ki(e,t){if(e!==t){var n=e!==r,i=null===e,o=e==e,a=us(e),s=t!==r,c=null===t,u=t==t,f=us(t);if(!c&&!f&&!a&&e>t||a&&s&&u&&!c&&!f||i&&s&&u||!n&&u||!o)return 1;if(!i&&!a&&!f&&e1?n[o-1]:r,s=o>2?n[2]:r;for(a=e.length>3&&"function"==typeof a?(o--,a):r,s&&Ao(n[0],n[1],s)&&(a=o<3?r:a,o=1),t=ke(t);++i-1?o[a?t[s]:s]:r}}function zi(e){return no((function(t){var i=t.length,o=i,a=qr.prototype.thru;for(e&&t.reverse();o--;){var s=t[o];if("function"!=typeof s)throw new Ie(n);if(a&&!c&&"wrapper"==so(s))var c=new qr([],!0)}for(o=c?o:i;++o1&&v.reverse(),l&&uc))return!1;var f=a.get(e),d=a.get(t);if(f&&d)return f==t&&d==e;var l=-1,h=!0,p=2&n?new Gr:r;for(a.set(e,t),a.set(t,e);++l-1&&e%1==0&&e1?"& ":"")+t[n],t=t.join(r>2?", ":" "),e.replace(se,"{\n/* [wrapped with "+t+"] */\n")}(n,function(e,t){return Mt(g,(function(r){var n="_."+r[0];t&r[1]&&!Nt(e,n)&&e.push(n)})),e.sort()}(function(e){var t=e.match(ce);return t?t[1].split(ue):[]}(n),r)))}function jo(e){var t=0,n=0;return function(){var i=wr(),o=16-(i-n);if(n=i,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(r,arguments)}}function Do(e,t){var n=-1,i=e.length,o=i-1;for(t=t===r?i:t;++n1?e[t-1]:r;return n="function"==typeof n?(e.pop(),n):r,aa(e,n)}));function ha(e){var t=zr(e);return t.__chain__=!0,t}function pa(e,t){return t(e)}var ma=no((function(e){var t=e.length,n=t?e[0]:0,i=this.__wrapped__,o=function(t){return sn(t,e)};return!(t>1||this.__actions__.length)&&i instanceof Hr&&wo(n)?((i=i.slice(n,+n+(t?1:0))).__actions__.push({func:pa,args:[o],thisArg:r}),new qr(i,this.__chain__).thru((function(e){return t&&!e.length&&e.push(r),e}))):this.thru(o)}));var ga=Ni((function(e,t,r){De.call(e,r)?++e[r]:an(e,r,1)}));var ya=Fi(Ho),ba=Fi(Ko);function va(e,t){return(Ka(e)?Mt:hn)(e,uo(t,3))}function wa(e,t){return(Ka(e)?Ct:pn)(e,uo(t,3))}var Aa=Ni((function(e,t,r){De.call(e,r)?e[r].push(t):an(e,r,[t])}));var _a=Xn((function(e,t,r){var n=-1,i="function"==typeof t,o=Wa(e)?ae(e.length):[];return hn(e,(function(e){o[++n]=i?xt(t,e,r):Rn(e,t,r)})),o})),Ea=Ni((function(e,t,r){an(e,r,t)}));function Sa(e,t){return(Ka(e)?Tt:zn)(e,uo(t,3))}var Pa=Ni((function(e,t,r){e[r?0:1].push(t)}),(function(){return[[],[]]}));var xa=Xn((function(e,t){if(null==e)return[];var r=t.length;return r>1&&Ao(e,t[0],t[1])?t=[]:r>2&&Ao(t[0],t[1],t[2])&&(t=[t[0]]),Kn(e,bn(t,1),[])})),ka=lt||function(){return pt.Date.now()};function Ma(e,t,n){return t=n?r:t,t=e&&null==t?e.length:t,Qi(e,f,r,r,r,r,t)}function Ca(e,t){var i;if("function"!=typeof t)throw new Ie(n);return e=ms(e),function(){return--e>0&&(i=t.apply(this,arguments)),e<=1&&(t=r),i}}var Ia=Xn((function(e,t,r){var n=1;if(r.length){var i=ur(r,co(Ia));n|=c}return Qi(e,n,t,r,i)})),Ra=Xn((function(e,t,r){var n=3;if(r.length){var i=ur(r,co(Ra));n|=c}return Qi(t,n,e,r,i)}));function Na(e,t,i){var o,a,s,c,u,f,d=0,l=!1,h=!1,p=!0;if("function"!=typeof e)throw new Ie(n);function m(t){var n=o,i=a;return o=a=r,d=t,c=e.apply(i,n)}function g(e){var n=e-f;return f===r||n>=t||n<0||h&&e-d>=s}function y(){var e=ka();if(g(e))return b(e);u=No(y,function(e){var r=t-(e-f);return h?vr(r,s-(e-d)):r}(e))}function b(e){return u=r,p&&o?m(e):(o=a=r,c)}function v(){var e=ka(),n=g(e);if(o=arguments,a=this,f=e,n){if(u===r)return function(e){return d=e,u=No(y,t),l?m(e):c}(f);if(h)return Ei(u),u=No(y,t),m(f)}return u===r&&(u=No(y,t)),c}return t=ys(t)||0,ts(i)&&(l=!!i.leading,s=(h="maxWait"in i)?br(ys(i.maxWait)||0,t):s,p="trailing"in i?!!i.trailing:p),v.cancel=function(){u!==r&&Ei(u),d=0,o=f=a=u=r},v.flush=function(){return u===r?c:b(ka())},v}var Oa=Xn((function(e,t){return dn(e,1,t)})),Ta=Xn((function(e,t,r){return dn(e,ys(t)||0,r)}));function ja(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Ie(n);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var a=e.apply(this,n);return r.cache=o.set(i,a)||o,a};return r.cache=new(ja.Cache||Wr),r}function Da(e){if("function"!=typeof e)throw new Ie(n);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}ja.Cache=Wr;var $a=Ai((function(e,t){var r=(t=1==t.length&&Ka(t[0])?Tt(t[0],Qt(uo())):Tt(bn(t,1),Qt(uo()))).length;return Xn((function(n){for(var i=-1,o=vr(n.length,r);++i=t})),Ha=Nn(function(){return arguments}())?Nn:function(e){return rs(e)&&De.call(e,"callee")&&!Ve.call(e,"callee")},Ka=ae.isArray,Ja=wt?Qt(wt):function(e){return rs(e)&&xn(e)==O};function Wa(e){return null!=e&&es(e.length)&&!Qa(e)}function Ga(e){return rs(e)&&Wa(e)}var Va=vt||yc,Za=At?Qt(At):function(e){return rs(e)&&xn(e)==w};function Xa(e){if(!rs(e))return!1;var t=xn(e);return t==A||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!os(e)}function Qa(e){if(!ts(e))return!1;var t=xn(e);return t==_||t==E||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Ya(e){return"number"==typeof e&&e==ms(e)}function es(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=h}function ts(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function rs(e){return null!=e&&"object"==typeof e}var ns=_t?Qt(_t):function(e){return rs(e)&&go(e)==S};function is(e){return"number"==typeof e||rs(e)&&xn(e)==P}function os(e){if(!rs(e)||xn(e)!=x)return!1;var t=We(e);if(null===t)return!0;var r=De.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&je.call(r)==ze}var as=Et?Qt(Et):function(e){return rs(e)&&xn(e)==M};var ss=St?Qt(St):function(e){return rs(e)&&go(e)==C};function cs(e){return"string"==typeof e||!Ka(e)&&rs(e)&&xn(e)==I}function us(e){return"symbol"==typeof e||rs(e)&&xn(e)==R}var fs=Pt?Qt(Pt):function(e){return rs(e)&&es(e.length)&&!!st[xn(e)]};var ds=Wi(Fn),ls=Wi((function(e,t){return e<=t}));function hs(e){if(!e)return[];if(Wa(e))return cs(e)?hr(e):Ii(e);if(Qe&&e[Qe])return function(e){for(var t,r=[];!(t=e.next()).done;)r.push(t.value);return r}(e[Qe]());var t=go(e);return(t==S?sr:t==C?fr:Us)(e)}function ps(e){return e?(e=ys(e))===l||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function ms(e){var t=ps(e),r=t%1;return t==t?r?t-r:t:0}function gs(e){return e?cn(ms(e),0,m):0}function ys(e){if("number"==typeof e)return e;if(us(e))return p;if(ts(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=ts(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Xt(e);var r=ge.test(e);return r||be.test(e)?dt(e.slice(2),r?2:8):me.test(e)?p:+e}function bs(e){return Ri(e,Os(e))}function vs(e){return null==e?"":fi(e)}var ws=Oi((function(e,t){if(Po(t)||Wa(t))Ri(t,Ns(t),e);else for(var r in t)De.call(t,r)&&tn(e,r,t[r])})),As=Oi((function(e,t){Ri(t,Os(t),e)})),_s=Oi((function(e,t,r,n){Ri(t,Os(t),e,n)})),Es=Oi((function(e,t,r,n){Ri(t,Ns(t),e,n)})),Ss=no(sn);var Ps=Xn((function(e,t){e=ke(e);var n=-1,i=t.length,o=i>2?t[2]:r;for(o&&Ao(t[0],t[1],o)&&(i=1);++n1),t})),Ri(e,oo(e),r),n&&(r=un(r,7,to));for(var i=t.length;i--;)li(r,t[i]);return r}));var $s=no((function(e,t){return null==e?{}:function(e,t){return Jn(e,t,(function(t,r){return Ms(e,r)}))}(e,t)}));function Bs(e,t){if(null==e)return{};var r=Tt(oo(e),(function(e){return[e]}));return t=uo(t),Jn(e,r,(function(e,r){return t(e,r[0])}))}var Fs=Xi(Ns),zs=Xi(Os);function Us(e){return null==e?[]:Yt(e,Ns(e))}var Ls=$i((function(e,t,r){return t=t.toLowerCase(),e+(r?qs(t):t)}));function qs(e){return Xs(vs(e).toLowerCase())}function Hs(e){return(e=vs(e))&&e.replace(we,nr).replace(et,"")}var Ks=$i((function(e,t,r){return e+(r?"-":"")+t.toLowerCase()})),Js=$i((function(e,t,r){return e+(r?" ":"")+t.toLowerCase()})),Ws=Di("toLowerCase");var Gs=$i((function(e,t,r){return e+(r?"_":"")+t.toLowerCase()}));var Vs=$i((function(e,t,r){return e+(r?" ":"")+Xs(t)}));var Zs=$i((function(e,t,r){return e+(r?" ":"")+t.toUpperCase()})),Xs=Di("toUpperCase");function Qs(e,t,n){return e=vs(e),(t=n?r:t)===r?function(e){return it.test(e)}(e)?function(e){return e.match(rt)||[]}(e):function(e){return e.match(fe)||[]}(e):e.match(t)||[]}var Ys=Xn((function(e,t){try{return xt(e,r,t)}catch(e){return Xa(e)?e:new Se(e)}})),ec=no((function(e,t){return Mt(t,(function(t){t=Bo(t),an(e,t,Ia(e[t],e))})),e}));function tc(e){return function(){return e}}var rc=zi(),nc=zi(!0);function ic(e){return e}function oc(e){return Dn("function"==typeof e?e:un(e,1))}var ac=Xn((function(e,t){return function(r){return Rn(r,e,t)}})),sc=Xn((function(e,t){return function(r){return Rn(e,r,t)}}));function cc(e,t,r){var n=Ns(t),i=En(t,n);null!=r||ts(t)&&(i.length||!n.length)||(r=t,t=e,e=this,i=En(t,Ns(t)));var o=!(ts(r)&&"chain"in r&&!r.chain),a=Qa(e);return Mt(i,(function(r){var n=t[r];e[r]=n,a&&(e.prototype[r]=function(){var t=this.__chain__;if(o||t){var r=e(this.__wrapped__);return(r.__actions__=Ii(this.__actions__)).push({func:n,args:arguments,thisArg:e}),r.__chain__=t,r}return n.apply(e,jt([this.value()],arguments))})})),e}function uc(){}var fc=Hi(Tt),dc=Hi(It),lc=Hi(Bt);function hc(e){return _o(e)?Jt(Bo(e)):function(e){return function(t){return Sn(t,e)}}(e)}var pc=Ji(),mc=Ji(!0);function gc(){return[]}function yc(){return!1}var bc=qi((function(e,t){return e+t}),0),vc=Vi("ceil"),wc=qi((function(e,t){return e/t}),1),Ac=Vi("floor");var _c,Ec=qi((function(e,t){return e*t}),1),Sc=Vi("round"),Pc=qi((function(e,t){return e-t}),0);return zr.after=function(e,t){if("function"!=typeof t)throw new Ie(n);return e=ms(e),function(){if(--e<1)return t.apply(this,arguments)}},zr.ary=Ma,zr.assign=ws,zr.assignIn=As,zr.assignInWith=_s,zr.assignWith=Es,zr.at=Ss,zr.before=Ca,zr.bind=Ia,zr.bindAll=ec,zr.bindKey=Ra,zr.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Ka(e)?e:[e]},zr.chain=ha,zr.chunk=function(e,t,n){t=(n?Ao(e,t,n):t===r)?1:br(ms(t),0);var i=null==e?0:e.length;if(!i||t<1)return[];for(var o=0,a=0,s=ae(mt(i/t));oo?0:o+n),(i=i===r||i>o?o:ms(i))<0&&(i+=o),i=n>i?0:gs(i);n>>0)?(e=vs(e))&&("string"==typeof t||null!=t&&!as(t))&&!(t=fi(t))&&ar(e)?_i(hr(e),0,n):e.split(t,n):[]},zr.spread=function(e,t){if("function"!=typeof e)throw new Ie(n);return t=null==t?0:br(ms(t),0),Xn((function(r){var n=r[t],i=_i(r,0,t);return n&&jt(i,n),xt(e,this,i)}))},zr.tail=function(e){var t=null==e?0:e.length;return t?ii(e,1,t):[]},zr.take=function(e,t,n){return e&&e.length?ii(e,0,(t=n||t===r?1:ms(t))<0?0:t):[]},zr.takeRight=function(e,t,n){var i=null==e?0:e.length;return i?ii(e,(t=i-(t=n||t===r?1:ms(t)))<0?0:t,i):[]},zr.takeRightWhile=function(e,t){return e&&e.length?pi(e,uo(t,3),!1,!0):[]},zr.takeWhile=function(e,t){return e&&e.length?pi(e,uo(t,3)):[]},zr.tap=function(e,t){return t(e),e},zr.throttle=function(e,t,r){var i=!0,o=!0;if("function"!=typeof e)throw new Ie(n);return ts(r)&&(i="leading"in r?!!r.leading:i,o="trailing"in r?!!r.trailing:o),Na(e,t,{leading:i,maxWait:t,trailing:o})},zr.thru=pa,zr.toArray=hs,zr.toPairs=Fs,zr.toPairsIn=zs,zr.toPath=function(e){return Ka(e)?Tt(e,Bo):us(e)?[e]:Ii($o(vs(e)))},zr.toPlainObject=bs,zr.transform=function(e,t,r){var n=Ka(e),i=n||Va(e)||fs(e);if(t=uo(t,4),null==r){var o=e&&e.constructor;r=i?n?new o:[]:ts(e)&&Qa(o)?Ur(We(e)):{}}return(i?Mt:An)(e,(function(e,n,i){return t(r,e,n,i)})),r},zr.unary=function(e){return Ma(e,1)},zr.union=ra,zr.unionBy=na,zr.unionWith=ia,zr.uniq=function(e){return e&&e.length?di(e):[]},zr.uniqBy=function(e,t){return e&&e.length?di(e,uo(t,2)):[]},zr.uniqWith=function(e,t){return t="function"==typeof t?t:r,e&&e.length?di(e,r,t):[]},zr.unset=function(e,t){return null==e||li(e,t)},zr.unzip=oa,zr.unzipWith=aa,zr.update=function(e,t,r){return null==e?e:hi(e,t,vi(r))},zr.updateWith=function(e,t,n,i){return i="function"==typeof i?i:r,null==e?e:hi(e,t,vi(n),i)},zr.values=Us,zr.valuesIn=function(e){return null==e?[]:Yt(e,Os(e))},zr.without=sa,zr.words=Qs,zr.wrap=function(e,t){return Ba(vi(t),e)},zr.xor=ca,zr.xorBy=ua,zr.xorWith=fa,zr.zip=da,zr.zipObject=function(e,t){return yi(e||[],t||[],tn)},zr.zipObjectDeep=function(e,t){return yi(e||[],t||[],ei)},zr.zipWith=la,zr.entries=Fs,zr.entriesIn=zs,zr.extend=As,zr.extendWith=_s,cc(zr,zr),zr.add=bc,zr.attempt=Ys,zr.camelCase=Ls,zr.capitalize=qs,zr.ceil=vc,zr.clamp=function(e,t,n){return n===r&&(n=t,t=r),n!==r&&(n=(n=ys(n))==n?n:0),t!==r&&(t=(t=ys(t))==t?t:0),cn(ys(e),t,n)},zr.clone=function(e){return un(e,4)},zr.cloneDeep=function(e){return un(e,5)},zr.cloneDeepWith=function(e,t){return un(e,5,t="function"==typeof t?t:r)},zr.cloneWith=function(e,t){return un(e,4,t="function"==typeof t?t:r)},zr.conformsTo=function(e,t){return null==t||fn(e,t,Ns(t))},zr.deburr=Hs,zr.defaultTo=function(e,t){return null==e||e!=e?t:e},zr.divide=wc,zr.endsWith=function(e,t,n){e=vs(e),t=fi(t);var i=e.length,o=n=n===r?i:cn(ms(n),0,i);return(n-=t.length)>=0&&e.slice(n,o)==t},zr.eq=Ua,zr.escape=function(e){return(e=vs(e))&&Z.test(e)?e.replace(G,ir):e},zr.escapeRegExp=function(e){return(e=vs(e))&&ie.test(e)?e.replace(ne,"\\$&"):e},zr.every=function(e,t,n){var i=Ka(e)?It:mn;return n&&Ao(e,t,n)&&(t=r),i(e,uo(t,3))},zr.find=ya,zr.findIndex=Ho,zr.findKey=function(e,t){return zt(e,uo(t,3),An)},zr.findLast=ba,zr.findLastIndex=Ko,zr.findLastKey=function(e,t){return zt(e,uo(t,3),_n)},zr.floor=Ac,zr.forEach=va,zr.forEachRight=wa,zr.forIn=function(e,t){return null==e?e:vn(e,uo(t,3),Os)},zr.forInRight=function(e,t){return null==e?e:wn(e,uo(t,3),Os)},zr.forOwn=function(e,t){return e&&An(e,uo(t,3))},zr.forOwnRight=function(e,t){return e&&_n(e,uo(t,3))},zr.get=ks,zr.gt=La,zr.gte=qa,zr.has=function(e,t){return null!=e&&yo(e,t,Mn)},zr.hasIn=Ms,zr.head=Wo,zr.identity=ic,zr.includes=function(e,t,r,n){e=Wa(e)?e:Us(e),r=r&&!n?ms(r):0;var i=e.length;return r<0&&(r=br(i+r,0)),cs(e)?r<=i&&e.indexOf(t,r)>-1:!!i&&Lt(e,t,r)>-1},zr.indexOf=function(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var i=null==r?0:ms(r);return i<0&&(i=br(n+i,0)),Lt(e,t,i)},zr.inRange=function(e,t,n){return t=ps(t),n===r?(n=t,t=0):n=ps(n),function(e,t,r){return e>=vr(t,r)&&e=-9007199254740991&&e<=h},zr.isSet=ss,zr.isString=cs,zr.isSymbol=us,zr.isTypedArray=fs,zr.isUndefined=function(e){return e===r},zr.isWeakMap=function(e){return rs(e)&&go(e)==N},zr.isWeakSet=function(e){return rs(e)&&"[object WeakSet]"==xn(e)},zr.join=function(e,t){return null==e?"":Wt.call(e,t)},zr.kebabCase=Ks,zr.last=Xo,zr.lastIndexOf=function(e,t,n){var i=null==e?0:e.length;if(!i)return-1;var o=i;return n!==r&&(o=(o=ms(n))<0?br(i+o,0):vr(o,i-1)),t==t?function(e,t,r){for(var n=r+1;n--;)if(e[n]===t)return n;return n}(e,t,o):Ut(e,Ht,o,!0)},zr.lowerCase=Js,zr.lowerFirst=Ws,zr.lt=ds,zr.lte=ls,zr.max=function(e){return e&&e.length?gn(e,ic,kn):r},zr.maxBy=function(e,t){return e&&e.length?gn(e,uo(t,2),kn):r},zr.mean=function(e){return Kt(e,ic)},zr.meanBy=function(e,t){return Kt(e,uo(t,2))},zr.min=function(e){return e&&e.length?gn(e,ic,Fn):r},zr.minBy=function(e,t){return e&&e.length?gn(e,uo(t,2),Fn):r},zr.stubArray=gc,zr.stubFalse=yc,zr.stubObject=function(){return{}},zr.stubString=function(){return""},zr.stubTrue=function(){return!0},zr.multiply=Ec,zr.nth=function(e,t){return e&&e.length?Hn(e,ms(t)):r},zr.noConflict=function(){return pt._===this&&(pt._=Ue),this},zr.noop=uc,zr.now=ka,zr.pad=function(e,t,r){e=vs(e);var n=(t=ms(t))?lr(e):0;if(!t||n>=t)return e;var i=(t-n)/2;return Ki(gt(i),r)+e+Ki(mt(i),r)},zr.padEnd=function(e,t,r){e=vs(e);var n=(t=ms(t))?lr(e):0;return t&&nt){var i=e;e=t,t=i}if(n||e%1||t%1){var o=_r();return vr(e+o*(t-e+ft("1e-"+((o+"").length-1))),t)}return Vn(e,t)},zr.reduce=function(e,t,r){var n=Ka(e)?Dt:Gt,i=arguments.length<3;return n(e,uo(t,4),r,i,hn)},zr.reduceRight=function(e,t,r){var n=Ka(e)?$t:Gt,i=arguments.length<3;return n(e,uo(t,4),r,i,pn)},zr.repeat=function(e,t,n){return t=(n?Ao(e,t,n):t===r)?1:ms(t),Zn(vs(e),t)},zr.replace=function(){var e=arguments,t=vs(e[0]);return e.length<3?t:t.replace(e[1],e[2])},zr.result=function(e,t,n){var i=-1,o=(t=wi(t,e)).length;for(o||(o=1,e=r);++ih)return[];var r=m,n=vr(e,m);t=uo(t),e-=m;for(var i=Zt(n,t);++r=a)return e;var c=n-lr(i);if(c<1)return i;var u=s?_i(s,0,c).join(""):e.slice(0,c);if(o===r)return u+i;if(s&&(c+=u.length-c),as(o)){if(e.slice(c).search(o)){var f,d=u;for(o.global||(o=Me(o.source,vs(pe.exec(o))+"g")),o.lastIndex=0;f=o.exec(d);)var l=f.index;u=u.slice(0,l===r?c:l)}}else if(e.indexOf(fi(o),c)!=c){var h=u.lastIndexOf(o);h>-1&&(u=u.slice(0,h))}return u+i},zr.unescape=function(e){return(e=vs(e))&&V.test(e)?e.replace(W,mr):e},zr.uniqueId=function(e){var t=++$e;return vs(e)+t},zr.upperCase=Zs,zr.upperFirst=Xs,zr.each=va,zr.eachRight=wa,zr.first=Wo,cc(zr,(_c={},An(zr,(function(e,t){De.call(zr.prototype,t)||(_c[t]=e)})),_c),{chain:!1}),zr.VERSION="4.17.21",Mt(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){zr[e].placeholder=zr})),Mt(["drop","take"],(function(e,t){Hr.prototype[e]=function(n){n=n===r?1:br(ms(n),0);var i=this.__filtered__&&!t?new Hr(this):this.clone();return i.__filtered__?i.__takeCount__=vr(n,i.__takeCount__):i.__views__.push({size:vr(n,m),type:e+(i.__dir__<0?"Right":"")}),i},Hr.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),Mt(["filter","map","takeWhile"],(function(e,t){var r=t+1,n=1==r||3==r;Hr.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:uo(e,3),type:r}),t.__filtered__=t.__filtered__||n,t}})),Mt(["head","last"],(function(e,t){var r="take"+(t?"Right":"");Hr.prototype[e]=function(){return this[r](1).value()[0]}})),Mt(["initial","tail"],(function(e,t){var r="drop"+(t?"":"Right");Hr.prototype[e]=function(){return this.__filtered__?new Hr(this):this[r](1)}})),Hr.prototype.compact=function(){return this.filter(ic)},Hr.prototype.find=function(e){return this.filter(e).head()},Hr.prototype.findLast=function(e){return this.reverse().find(e)},Hr.prototype.invokeMap=Xn((function(e,t){return"function"==typeof e?new Hr(this):this.map((function(r){return Rn(r,e,t)}))})),Hr.prototype.reject=function(e){return this.filter(Da(uo(e)))},Hr.prototype.slice=function(e,t){e=ms(e);var n=this;return n.__filtered__&&(e>0||t<0)?new Hr(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==r&&(n=(t=ms(t))<0?n.dropRight(-t):n.take(t-e)),n)},Hr.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Hr.prototype.toArray=function(){return this.take(m)},An(Hr.prototype,(function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),i=/^(?:head|last)$/.test(t),o=zr[i?"take"+("last"==t?"Right":""):t],a=i||/^find/.test(t);o&&(zr.prototype[t]=function(){var t=this.__wrapped__,s=i?[1]:arguments,c=t instanceof Hr,u=s[0],f=c||Ka(t),d=function(e){var t=o.apply(zr,jt([e],s));return i&&l?t[0]:t};f&&n&&"function"==typeof u&&1!=u.length&&(c=f=!1);var l=this.__chain__,h=!!this.__actions__.length,p=a&&!l,m=c&&!h;if(!a&&f){t=m?t:new Hr(this);var g=e.apply(t,s);return g.__actions__.push({func:pa,args:[d],thisArg:r}),new qr(g,l)}return p&&m?e.apply(this,s):(g=this.thru(d),p?i?g.value()[0]:g.value():g)})})),Mt(["pop","push","shift","sort","splice","unshift"],(function(e){var t=Re[e],r=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",n=/^(?:pop|shift)$/.test(e);zr.prototype[e]=function(){var e=arguments;if(n&&!this.__chain__){var i=this.value();return t.apply(Ka(i)?i:[],e)}return this[r]((function(r){return t.apply(Ka(r)?r:[],e)}))}})),An(Hr.prototype,(function(e,t){var r=zr[t];if(r){var n=r.name+"";De.call(Rr,n)||(Rr[n]=[]),Rr[n].push({name:t,func:r})}})),Rr[Ui(r,2).name]=[{name:"wrapper",func:r}],Hr.prototype.clone=function(){var e=new Hr(this.__wrapped__);return e.__actions__=Ii(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Ii(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Ii(this.__views__),e},Hr.prototype.reverse=function(){if(this.__filtered__){var e=new Hr(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Hr.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,r=Ka(e),n=t<0,i=r?e.length:0,o=function(e,t,r){var n=-1,i=r.length;for(;++n=this.__values__.length;return{done:e,value:e?r:this.__values__[this.__index__++]}},zr.prototype.plant=function(e){for(var t,n=this;n instanceof Lr;){var i=zo(n);i.__index__=0,i.__values__=r,t?o.__wrapped__=i:t=i;var o=i;n=n.__wrapped__}return o.__wrapped__=e,t},zr.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Hr){var t=e;return this.__actions__.length&&(t=new Hr(this)),(t=t.reverse()).__actions__.push({func:pa,args:[ta],thisArg:r}),new qr(t,this.__chain__)}return this.thru(ta)},zr.prototype.toJSON=zr.prototype.valueOf=zr.prototype.value=function(){return mi(this.__wrapped__,this.__actions__)},zr.prototype.first=zr.prototype.head,Qe&&(zr.prototype[Qe]=function(){return this}),zr}();gt?((gt.exports=gr)._=gr,mt._=gr):pt._=gr}).call(s)}(Vw,Vw.exports);var Zw=c(Vw.exports),Xw={id:"https://spec.openapis.org/oas/3.0/schema/2021-09-28",$schema:"http://json-schema.org/draft-04/schema#",description:"The description of OpenAPI v3.0.x documents, as defined by https://spec.openapis.org/oas/v3.0.3",type:"object",required:["openapi","info","paths"],properties:{openapi:{type:"string",pattern:"^3\\.0\\.\\d(-.+)?$"},info:{$ref:"#/definitions/Info"},externalDocs:{$ref:"#/definitions/ExternalDocumentation"},servers:{type:"array",items:{$ref:"#/definitions/Server"}},security:{type:"array",items:{$ref:"#/definitions/SecurityRequirement"}},tags:{type:"array",items:{$ref:"#/definitions/Tag"},uniqueItems:!0},paths:{$ref:"#/definitions/Paths"},components:{$ref:"#/definitions/Components"}},patternProperties:{"^x-":{}},additionalProperties:!1,definitions:{Reference:{type:"object",required:["$ref"],patternProperties:{"^\\$ref$":{type:"string",format:"uri-reference"}}},Info:{type:"object",required:["title","version"],properties:{title:{type:"string"},description:{type:"string"},termsOfService:{type:"string",format:"uri-reference"},contact:{$ref:"#/definitions/Contact"},license:{$ref:"#/definitions/License"},version:{type:"string"}},patternProperties:{"^x-":{}},additionalProperties:!1},Contact:{type:"object",properties:{name:{type:"string"},url:{type:"string",format:"uri-reference"},email:{type:"string",format:"email"}},patternProperties:{"^x-":{}},additionalProperties:!1},License:{type:"object",required:["name"],properties:{name:{type:"string"},url:{type:"string",format:"uri-reference"}},patternProperties:{"^x-":{}},additionalProperties:!1},Server:{type:"object",required:["url"],properties:{url:{type:"string"},description:{type:"string"},variables:{type:"object",additionalProperties:{$ref:"#/definitions/ServerVariable"}}},patternProperties:{"^x-":{}},additionalProperties:!1},ServerVariable:{type:"object",required:["default"],properties:{enum:{type:"array",items:{type:"string"}},default:{type:"string"},description:{type:"string"}},patternProperties:{"^x-":{}},additionalProperties:!1},Components:{type:"object",properties:{schemas:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]}}},responses:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/Response"}]}}},parameters:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/Parameter"}]}}},examples:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/Example"}]}}},requestBodies:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/RequestBody"}]}}},headers:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/Header"}]}}},securitySchemes:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/SecurityScheme"}]}}},links:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/Link"}]}}},callbacks:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/Callback"}]}}}},patternProperties:{"^x-":{}},additionalProperties:!1},Schema:{type:"object",properties:{title:{type:"string"},multipleOf:{type:"number",minimum:0,exclusiveMinimum:!0},maximum:{type:"number"},exclusiveMaximum:{type:"boolean",default:!1},minimum:{type:"number"},exclusiveMinimum:{type:"boolean",default:!1},maxLength:{type:"integer",minimum:0},minLength:{type:"integer",minimum:0,default:0},pattern:{type:"string",format:"regex"},maxItems:{type:"integer",minimum:0},minItems:{type:"integer",minimum:0,default:0},uniqueItems:{type:"boolean",default:!1},maxProperties:{type:"integer",minimum:0},minProperties:{type:"integer",minimum:0,default:0},required:{type:"array",items:{type:"string"},minItems:1,uniqueItems:!0},enum:{type:"array",items:{},minItems:1,uniqueItems:!1},type:{type:"string",enum:["array","boolean","integer","number","object","string"]},not:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]},allOf:{type:"array",items:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]}},oneOf:{type:"array",items:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]}},anyOf:{type:"array",items:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]}},items:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]},properties:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]}},additionalProperties:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"},{type:"boolean"}],default:!0},description:{type:"string"},format:{type:"string"},default:{},nullable:{type:"boolean",default:!1},discriminator:{$ref:"#/definitions/Discriminator"},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},example:{},externalDocs:{$ref:"#/definitions/ExternalDocumentation"},deprecated:{type:"boolean",default:!1},xml:{$ref:"#/definitions/XML"}},patternProperties:{"^x-":{}},additionalProperties:!1},Discriminator:{type:"object",required:["propertyName"],properties:{propertyName:{type:"string"},mapping:{type:"object",additionalProperties:{type:"string"}}}},XML:{type:"object",properties:{name:{type:"string"},namespace:{type:"string",format:"uri"},prefix:{type:"string"},attribute:{type:"boolean",default:!1},wrapped:{type:"boolean",default:!1}},patternProperties:{"^x-":{}},additionalProperties:!1},Response:{type:"object",required:["description"],properties:{description:{type:"string"},headers:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Header"},{$ref:"#/definitions/Reference"}]}},content:{type:"object",additionalProperties:{$ref:"#/definitions/MediaType"}},links:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Link"},{$ref:"#/definitions/Reference"}]}}},patternProperties:{"^x-":{}},additionalProperties:!1},MediaType:{type:"object",properties:{schema:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]},example:{},examples:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Example"},{$ref:"#/definitions/Reference"}]}},encoding:{type:"object",additionalProperties:{$ref:"#/definitions/Encoding"}}},patternProperties:{"^x-":{}},additionalProperties:!1,allOf:[{$ref:"#/definitions/ExampleXORExamples"}]},Example:{type:"object",properties:{summary:{type:"string"},description:{type:"string"},value:{},externalValue:{type:"string",format:"uri-reference"}},patternProperties:{"^x-":{}},additionalProperties:!1},Header:{type:"object",properties:{description:{type:"string"},required:{type:"boolean",default:!1},deprecated:{type:"boolean",default:!1},allowEmptyValue:{type:"boolean",default:!1},style:{type:"string",enum:["simple"],default:"simple"},explode:{type:"boolean"},allowReserved:{type:"boolean",default:!1},schema:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]},content:{type:"object",additionalProperties:{$ref:"#/definitions/MediaType"},minProperties:1,maxProperties:1},example:{},examples:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Example"},{$ref:"#/definitions/Reference"}]}}},patternProperties:{"^x-":{}},additionalProperties:!1,allOf:[{$ref:"#/definitions/ExampleXORExamples"},{$ref:"#/definitions/SchemaXORContent"}]},Paths:{type:"object",patternProperties:{"^\\/":{$ref:"#/definitions/PathItem"},"^x-":{}},additionalProperties:!1},PathItem:{type:"object",properties:{$ref:{type:"string"},summary:{type:"string"},description:{type:"string"},servers:{type:"array",items:{$ref:"#/definitions/Server"}},parameters:{type:"array",items:{oneOf:[{$ref:"#/definitions/Parameter"},{$ref:"#/definitions/Reference"}]},uniqueItems:!0}},patternProperties:{"^(get|put|post|delete|options|head|patch|trace)$":{$ref:"#/definitions/Operation"},"^x-":{}},additionalProperties:!1},Operation:{type:"object",required:["responses"],properties:{tags:{type:"array",items:{type:"string"}},summary:{type:"string"},description:{type:"string"},externalDocs:{$ref:"#/definitions/ExternalDocumentation"},operationId:{type:"string"},parameters:{type:"array",items:{oneOf:[{$ref:"#/definitions/Parameter"},{$ref:"#/definitions/Reference"}]},uniqueItems:!0},requestBody:{oneOf:[{$ref:"#/definitions/RequestBody"},{$ref:"#/definitions/Reference"}]},responses:{$ref:"#/definitions/Responses"},callbacks:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Callback"},{$ref:"#/definitions/Reference"}]}},deprecated:{type:"boolean",default:!1},security:{type:"array",items:{$ref:"#/definitions/SecurityRequirement"}},servers:{type:"array",items:{$ref:"#/definitions/Server"}}},patternProperties:{"^x-":{}},additionalProperties:!1},Responses:{type:"object",properties:{default:{oneOf:[{$ref:"#/definitions/Response"},{$ref:"#/definitions/Reference"}]}},patternProperties:{"^[1-5](?:\\d{2}|XX)$":{oneOf:[{$ref:"#/definitions/Response"},{$ref:"#/definitions/Reference"}]},"^x-":{}},minProperties:1,additionalProperties:!1},SecurityRequirement:{type:"object",additionalProperties:{type:"array",items:{type:"string"}}},Tag:{type:"object",required:["name"],properties:{name:{type:"string"},description:{type:"string"},externalDocs:{$ref:"#/definitions/ExternalDocumentation"}},patternProperties:{"^x-":{}},additionalProperties:!1},ExternalDocumentation:{type:"object",required:["url"],properties:{description:{type:"string"},url:{type:"string",format:"uri-reference"}},patternProperties:{"^x-":{}},additionalProperties:!1},ExampleXORExamples:{description:"Example and examples are mutually exclusive",not:{required:["example","examples"]}},SchemaXORContent:{description:"Schema and content are mutually exclusive, at least one is required",not:{required:["schema","content"]},oneOf:[{required:["schema"]},{required:["content"],description:"Some properties are not allowed if content is present",allOf:[{not:{required:["style"]}},{not:{required:["explode"]}},{not:{required:["allowReserved"]}},{not:{required:["example"]}},{not:{required:["examples"]}}]}]},Parameter:{type:"object",properties:{name:{type:"string"},in:{type:"string"},description:{type:"string"},required:{type:"boolean",default:!1},deprecated:{type:"boolean",default:!1},allowEmptyValue:{type:"boolean",default:!1},style:{type:"string"},explode:{type:"boolean"},allowReserved:{type:"boolean",default:!1},schema:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]},content:{type:"object",additionalProperties:{$ref:"#/definitions/MediaType"},minProperties:1,maxProperties:1},example:{},examples:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Example"},{$ref:"#/definitions/Reference"}]}}},patternProperties:{"^x-":{}},additionalProperties:!1,required:["name","in"],allOf:[{$ref:"#/definitions/ExampleXORExamples"},{$ref:"#/definitions/SchemaXORContent"},{$ref:"#/definitions/ParameterLocation"}]},ParameterLocation:{description:"Parameter location",oneOf:[{description:"Parameter in path",required:["required"],properties:{in:{enum:["path"]},style:{enum:["matrix","label","simple"],default:"simple"},required:{enum:[!0]}}},{description:"Parameter in query",properties:{in:{enum:["query"]},style:{enum:["form","spaceDelimited","pipeDelimited","deepObject"],default:"form"}}},{description:"Parameter in header",properties:{in:{enum:["header"]},style:{enum:["simple"],default:"simple"}}},{description:"Parameter in cookie",properties:{in:{enum:["cookie"]},style:{enum:["form"],default:"form"}}}]},RequestBody:{type:"object",required:["content"],properties:{description:{type:"string"},content:{type:"object",additionalProperties:{$ref:"#/definitions/MediaType"}},required:{type:"boolean",default:!1}},patternProperties:{"^x-":{}},additionalProperties:!1},SecurityScheme:{oneOf:[{$ref:"#/definitions/APIKeySecurityScheme"},{$ref:"#/definitions/HTTPSecurityScheme"},{$ref:"#/definitions/OAuth2SecurityScheme"},{$ref:"#/definitions/OpenIdConnectSecurityScheme"}]},APIKeySecurityScheme:{type:"object",required:["type","name","in"],properties:{type:{type:"string",enum:["apiKey"]},name:{type:"string"},in:{type:"string",enum:["header","query","cookie"]},description:{type:"string"}},patternProperties:{"^x-":{}},additionalProperties:!1},HTTPSecurityScheme:{type:"object",required:["scheme","type"],properties:{scheme:{type:"string"},bearerFormat:{type:"string"},description:{type:"string"},type:{type:"string",enum:["http"]}},patternProperties:{"^x-":{}},additionalProperties:!1,oneOf:[{description:"Bearer",properties:{scheme:{type:"string",pattern:"^[Bb][Ee][Aa][Rr][Ee][Rr]$"}}},{description:"Non Bearer",not:{required:["bearerFormat"]},properties:{scheme:{not:{type:"string",pattern:"^[Bb][Ee][Aa][Rr][Ee][Rr]$"}}}}]},OAuth2SecurityScheme:{type:"object",required:["type","flows"],properties:{type:{type:"string",enum:["oauth2"]},flows:{$ref:"#/definitions/OAuthFlows"},description:{type:"string"}},patternProperties:{"^x-":{}},additionalProperties:!1},OpenIdConnectSecurityScheme:{type:"object",required:["type","openIdConnectUrl"],properties:{type:{type:"string",enum:["openIdConnect"]},openIdConnectUrl:{type:"string",format:"uri-reference"},description:{type:"string"}},patternProperties:{"^x-":{}},additionalProperties:!1},OAuthFlows:{type:"object",properties:{implicit:{$ref:"#/definitions/ImplicitOAuthFlow"},password:{$ref:"#/definitions/PasswordOAuthFlow"},clientCredentials:{$ref:"#/definitions/ClientCredentialsFlow"},authorizationCode:{$ref:"#/definitions/AuthorizationCodeOAuthFlow"}},patternProperties:{"^x-":{}},additionalProperties:!1},ImplicitOAuthFlow:{type:"object",required:["authorizationUrl","scopes"],properties:{authorizationUrl:{type:"string",format:"uri-reference"},refreshUrl:{type:"string",format:"uri-reference"},scopes:{type:"object",additionalProperties:{type:"string"}}},patternProperties:{"^x-":{}},additionalProperties:!1},PasswordOAuthFlow:{type:"object",required:["tokenUrl","scopes"],properties:{tokenUrl:{type:"string",format:"uri-reference"},refreshUrl:{type:"string",format:"uri-reference"},scopes:{type:"object",additionalProperties:{type:"string"}}},patternProperties:{"^x-":{}},additionalProperties:!1},ClientCredentialsFlow:{type:"object",required:["tokenUrl","scopes"],properties:{tokenUrl:{type:"string",format:"uri-reference"},refreshUrl:{type:"string",format:"uri-reference"},scopes:{type:"object",additionalProperties:{type:"string"}}},patternProperties:{"^x-":{}},additionalProperties:!1},AuthorizationCodeOAuthFlow:{type:"object",required:["authorizationUrl","tokenUrl","scopes"],properties:{authorizationUrl:{type:"string",format:"uri-reference"},tokenUrl:{type:"string",format:"uri-reference"},refreshUrl:{type:"string",format:"uri-reference"},scopes:{type:"object",additionalProperties:{type:"string"}}},patternProperties:{"^x-":{}},additionalProperties:!1},Link:{type:"object",properties:{operationId:{type:"string"},operationRef:{type:"string",format:"uri-reference"},parameters:{type:"object",additionalProperties:{}},requestBody:{},description:{type:"string"},server:{$ref:"#/definitions/Server"}},patternProperties:{"^x-":{}},additionalProperties:!1,not:{description:"Operation Id and Operation Ref are mutually exclusive",required:["operationId","operationRef"]}},Callback:{type:"object",additionalProperties:{$ref:"#/definitions/PathItem"},patternProperties:{"^x-":{}}},Encoding:{type:"object",properties:{contentType:{type:"string"},headers:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Header"},{$ref:"#/definitions/Reference"}]}},style:{type:"string",enum:["form","spaceDelimited","pipeDelimited","deepObject"]},explode:{type:"boolean"},allowReserved:{type:"boolean",default:!1}},additionalProperties:!1}}};function Qw(e){if(new Date(e).getTime()>0)return Number(e);throw new nn(new Error("invalid timestamp"),["invalid timestamp"])}async function Yw(e){const t=[],r=Object.keys(e);(r.length<10||r.length>11)&&t.push(new nn(new Error("Invalid agreeemt: "+JSON.stringify(e,void 0,2)),["invalid format"]));for(const n of r){let r;switch(n){case"orig":case"dest":try{e[n]!==await io(JSON.parse(e[n]),!0)&&t.push(new nn(`[dataExchangeAgreeement.${n}] A valid stringified JWK must be provided. For uniqueness, JWK claims must be alphabetically sorted in the stringified JWK. You can use the parseJWK(jwk, true) for that purpose.\n${e[n]}`,["invalid key","invalid format"]))}catch(e){t.push(new nn(`[dataExchangeAgreeement.${n}] A valid stringified JWK must be provided. For uniqueness, JWK claims must be alphabetically sorted in the stringified JWK. You can use the parseJWK(jwk, true) for that purpose.`,["invalid key","invalid format"]))}break;case"ledgerContractAddress":case"ledgerSignerAddress":try{r=Uh(e[n]),e[n]!==r&&t.push(new nn(`[dataExchangeAgreeement.${n}] Invalid EIP-55 address ${e[n]}. Did you mean ${r} instead?`,["invalid EIP-55 address","invalid format"]))}catch(r){t.push(new nn(`[dataExchangeAgreeement.${n}] Invalid EIP-55 address ${e[n]}.`,["invalid EIP-55 address","invalid format"]))}break;case"pooToPorDelay":case"pooToPopDelay":case"pooToSecretDelay":try{e[n]!==Qw(e[n])&&t.push(new nn(`[dataExchangeAgreeement.${n}] < 0 or not a number`,["invalid timestamp","invalid format"]))}catch(e){t.push(new nn(`[dataExchangeAgreeement.${n}] < 0 or not a number`,["invalid timestamp","invalid format"]))}break;case"hashAlg":Yr.includes(e[n])||t.push(new nn(`[dataExchangeAgreeement.${n}Invalid hash algorithm '${e[n]}'. It must be one of: ${Yr.join(", ")}`,["invalid algorithm"]));break;case"encAlg":tn.includes(e[n])||t.push(new nn(`[dataExchangeAgreeement.${n}Invalid encryption algorithm '${e[n]}'. It must be one of: ${tn.join(", ")}`,["invalid algorithm"]));break;case"signingAlg":en.includes(e[n])||t.push(new nn(`[dataExchangeAgreeement.${n}Invalid signing algorithm '${e[n]}'. It must be one of: ${en.join(", ")}`,["invalid algorithm"]));break;case"schema":break;default:t.push(new nn(new Error(`Property ${n} not allowed in dataAgreement`),["invalid format"]))}}return t}var eA=Object.freeze({__proto__:null,NonRepudiationDest:class{constructor(e,t,r){this.initialized=new Promise(((n,i)=>{this.asyncConstructor(e,t,r).then((()=>{n(!0)})).catch((e=>{i(e)}))}))}async asyncConstructor(e,t,r){const n=await Yw(e);if(n.length>0){const e=[];let t=[];throw n.forEach((r=>{e.push(r.message),t=t.concat(r.nrErrors)})),t=[...new Set(t)],new nn("Resource has not been validated:\n"+e.join("\n"),t)}this.agreement=e,this.jwkPairDest={privateJwk:t,publicJwk:JSON.parse(e.dest)},this.publicJwkOrig=JSON.parse(e.orig),await Xi(this.jwkPairDest.publicJwk,this.jwkPairDest.privateJwk),this.dltAgent=r;const i=await this.dltAgent.getContractAddress();if(this.agreement.ledgerContractAddress!==i)throw new Error(`Contract address ${i} does not meet agreed one ${this.agreement.ledgerContractAddress}`);this.block={}}async verifyPoO(e,r,n){await this.initialized;const i=t(await oo(r,this.agreement.hashAlg),!0,!1),{payload:o}=await Gi(e),a={...this.agreement,cipherblockDgst:i,blockCommitment:o.exchange.blockCommitment,secretCommitment:o.exchange.secretCommitment},s={proofType:"PoO",iss:"orig",exchange:{...a,id:await Lh(a)}},c={timestamp:Date.now(),notBefore:"iat",notAfter:"iat",...n},u=await Hh(e,s,c);return this.block={jwe:r,poo:{jws:e,payload:u.payload}},this.exchange=u.payload.exchange,u}async generatePoR(){if(await this.initialized,void 0===this.exchange||void 0===this.block.poo)throw new Error("Before computing a PoR, you have first to receive a valid cipherblock with a PoO and validate the PoO");const e={proofType:"PoR",iss:"dest",exchange:this.exchange,poo:this.block.poo.jws};return this.block.por=await qh(e,this.jwkPairDest.privateJwk),this.block.por}async verifyPoP(e,t){if(await this.initialized,void 0===this.exchange||void 0===this.block.por||void 0===this.block.poo)throw new Error("Cannot verify a PoP if not even a PoR have been created");const n={proofType:"PoP",iss:"orig",exchange:this.exchange,por:this.block.por.jws,secret:"",verificationCode:""},o={timestamp:Date.now(),notBefore:"iat",notAfter:1e3*this.block.poo.payload.iat+this.exchange.pooToPopDelay,...t},a=await Hh(e,n,o),s=JSON.parse(a.payload.secret);return this.block.secret={hex:i(r(s.k)),jwk:s},this.block.pop={jws:e,payload:a.payload},a}async getSecretFromLedger(){if(await this.initialized,void 0===this.exchange||void 0===this.block.poo||void 0===this.block.por)throw new Error("Cannot get secret if a PoR has not been sent before");const e=Date.now(),t=1e3*this.block.poo.payload.iat+this.agreement.pooToSecretDelay,r=Math.round((t-e)/1e3),{hex:n,iat:i}=await this.dltAgent.getSecretFromLedger(Vi(this.agreement.encAlg),this.agreement.ledgerSignerAddress,this.exchange.id,r);this.block.secret=await Zi(this.exchange.encAlg,n);try{to(1e3*i,1e3*this.block.por.payload.iat,1e3*this.block.poo.payload.iat+this.exchange.pooToSecretDelay)}catch(e){throw new nn(`Although the secret has been obtained (and you could try to decrypt the cipherblock), it's been published later than agreed: ${new Date(1e3*i).toUTCString()} > ${new Date(1e3*this.block.poo.payload.iat+this.agreement.pooToSecretDelay).toUTCString()}`,["secret not published in time"])}return this.block.secret}async decrypt(){if(await this.initialized,void 0===this.exchange)throw new Error("No agreed exchange");if(void 0===this.block.secret?.jwk)throw new Error("Cannot decrypt without the secret");if(void 0===this.block.jwe)throw new Error("No cipherblock to decrypt");const e=(await Wi(this.block.jwe,this.block.secret.jwk)).plaintext;if(t(await oo(e,this.agreement.hashAlg),!0,!1)!==this.exchange.blockCommitment)throw new Error("Decrypted block does not meet the committed one");return this.block.raw=e,e}async generateVerificationRequest(){if(await this.initialized,void 0===this.block.por||void 0===this.exchange)throw new Error("Before generating a VerificationRequest, you have first to hold a valid PoR for the exchange");return await Vh("dest",this.exchange.id,this.block.por.jws,this.jwkPairDest.privateJwk)}async generateDisputeRequest(){if(await this.initialized,void 0===this.block.por||void 0===this.block.jwe||void 0===this.exchange)throw new Error("Before generating a VerificationRequest, you have first to hold a valid PoR for the exchange and have received the cipherblock");const e={proofType:"request",iss:"dest",por:this.block.por.jws,type:"disputeRequest",cipherblock:this.block.jwe,iat:Math.floor(Date.now()/1e3),dataExchangeId:this.exchange.id},t=await Ki(this.jwkPairDest.privateJwk);try{return await new Li(e).setProtectedHeader({alg:this.jwkPairDest.privateJwk.alg}).setIssuedAt(e.iat).sign(t)}catch(e){throw new nn(e,["unexpected error"])}}},NonRepudiationOrig:class{constructor(e,t,r,n){this.jwkPairOrig={privateJwk:t,publicJwk:JSON.parse(e.orig)},this.publicJwkDest=JSON.parse(e.dest),this.block={raw:r},this.initialized=new Promise(((t,r)=>{this.init(e,n).then((()=>{t(!0)})).catch((e=>{r(e)}))}))}async init(e,r){const n=await Yw(e);if(n.length>0){const e=[];let t=[];throw n.forEach((r=>{e.push(r.message),t=t.concat(r.nrErrors)})),t=[...new Set(t)],new nn("Resource has not been validated:\n"+e.join("\n"),t)}this.agreement=e,await Xi(this.jwkPairOrig.publicJwk,this.jwkPairOrig.privateJwk);const i=await Zi(this.agreement.encAlg);this.block={...this.block,secret:i,jwe:await Ji(this.block.raw,i.jwk,this.agreement.encAlg)};const a=t(await oo(this.block.jwe,this.agreement.hashAlg),!0,!1),s=t(await oo(this.block.raw,this.agreement.hashAlg),!0,!1),c=t(await oo(new Uint8Array(o(this.block.secret.hex)),this.agreement.hashAlg),!0,!1),u={...this.agreement,cipherblockDgst:a,blockCommitment:s,secretCommitment:c},f=await Lh(u);this.exchange={...u,id:f},await this._dltSetup(r)}async _dltSetup(e){this.dltAgent=e;const t=await this.dltAgent.getAddress();if(t!==this.exchange.ledgerSignerAddress)throw new Error(`ledgerSignerAddress: ${this.exchange.ledgerSignerAddress} does not meet the address ${t} derived from the provided private key`);const r=await this.dltAgent.getContractAddress();if(r!==no(this.agreement.ledgerContractAddress,!0))throw new Error(`Contract address in use ${r} does not meet the agreed one ${this.agreement.ledgerContractAddress}`)}async generatePoO(){return await this.initialized,this.block.poo=await qh({proofType:"PoO",iss:"orig",exchange:this.exchange},this.jwkPairOrig.privateJwk),this.block.poo}async verifyPoR(e,t){if(await this.initialized,void 0===this.block.poo)throw new Error("Cannot verify a PoR if not even a PoO have been created");const r={proofType:"PoR",iss:"dest",exchange:this.exchange,poo:this.block.poo.jws},n=1e3*this.block.poo.payload.iat,i={timestamp:Date.now(),notBefore:n,notAfter:n+this.exchange.pooToPorDelay,...t},o=await Hh(e,r,i);return this.block.por={jws:e,payload:o.payload},this.block.por}async generatePoP(){if(await this.initialized,void 0===this.block.por)throw new Error("Before computing a PoP, you have first to have received and verified the PoR");const e=await this.dltAgent.deploySecret(this.block.secret.hex,this.exchange.id),t={proofType:"PoP",iss:"orig",exchange:this.exchange,por:this.block.por.jws,secret:JSON.stringify(this.block.secret.jwk),verificationCode:e};return this.block.pop=await qh(t,this.jwkPairOrig.privateJwk),this.block.pop}async generateVerificationRequest(){if(await this.initialized,void 0===this.block.por)throw new Error("Before generating a VerificationRequest, you have first to hold a valid PoR for the exchange");return await Vh("orig",this.exchange.id,this.block.por.jws,this.jwkPairOrig.privateJwk)}}});e.ConflictResolution=Zh,e.ENC_ALGS=tn,e.EthersIoAgentDest=rp,e.EthersIoAgentOrig=Cp,e.HASH_ALGS=Yr,e.I3mServerWalletAgentDest=ap,e.I3mServerWalletAgentOrig=Rp,e.I3mWalletAgentDest=ip,e.I3mWalletAgentOrig=Ip,e.KEY_AGREEMENT_ALGS=rn,e.NonRepudiationProtocol=eA,e.NrError=nn,e.SIGNING_ALGS=en,e.Signers=Np,e.checkTimestamp=to,e.createProof=qh,e.defaultDltConfig=Xh,e.exchangeId=Lh,e.generateKeys=async function(e,n,i){if(!en.includes(e))throw new nn(new RangeError(`Invalid signature algorithm '${e}''. Allowed algorithms are ${en.toString()}`),["invalid algorithm"]);let s,c,u;switch(e){case"ES512":c="P-521",s=66;break;case"ES384":c="P-384",s=48;break;default:c="P-256",s=32}u=void 0!==n?"string"==typeof n?!0===i?r(n):new Uint8Array(o(n)):n:new Uint8Array(await a(s));const f=new on("p"+c.substring(c.length-3)).keyFromPrivate(u),d=f.getPublic(),l=d.getX().toString("hex").padStart(2*s,"0"),h=d.getY().toString("hex").padStart(2*s,"0"),p=f.getPrivate("hex").padStart(2*s,"0"),m={kty:"EC",crv:c,x:t(o(l),!0,!1),y:t(o(h),!0,!1),d:t(o(p),!0,!1),alg:e},g={...m};return delete g.d,{publicJwk:g,privateJwk:m}},e.getDltAddress=function(e){const t=e.match(/^did:ethr:(\w+:)?(0x[0-9a-fA-F]{40}[0-9a-fA-F]{26}?)$/),r=null!==t?t[t.length-1]:e;try{return xf(r)}catch(e){throw new nn("no a DID or a valid public or private key",["invalid format"])}},e.importJwk=Ki,e.jsonSort=ro,e.jweDecrypt=Wi,e.jweEncrypt=Ji,e.jwsDecode=Gi,e.oneTimeSecret=Zi,e.parseAddress=Uh,e.parseHex=no,e.parseJwk=io,e.sha=oo,e.validateDataExchange=async function(e){const t=[];try{const{id:r,...n}=e;r!==await Lh(n)&&t.push(new nn("Invalid dataExchange id",["cannot verify","invalid format"]));const{blockCommitment:i,secretCommitment:o,cipherblockDgst:a,...s}=n,c=await Yw(s);c.length>0&&c.forEach((e=>{t.push(e)}))}catch(e){t.push(new nn("Invalid dataExchange",["cannot verify","invalid format"]))}return t},e.validateDataExchangeAgreement=Yw,e.validateDataSharingAgreementSchema=async function(e){const t=[],r=new lw({strictSchema:!1,removeAdditional:"all"});r.addMetaSchema(Xw),Gw(r);const n=Op.schemas.DataSharingAgreement;try{const i=r.compile(n),o=Zw.cloneDeep(e);i(e)||null!==i.errors&&void 0!==i.errors&&i.errors.length>0&&i.errors.forEach((e=>{t.push(new nn(`[${e.instancePath}] ${e.message??"unknown"}`,["invalid format"]))})),eo(o)!==eo(e)&&t.push(new nn("Additional claims beyond the schema are not supported",["invalid format"]))}catch(e){t.push(new nn(e,["invalid format"]))}return t},e.verifyKeyPair=Xi,e.verifyProof=Hh})); + deps: ${n}}`};const i={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(e){const[t,r]=function({schema:e}){const t={},r={};for(const n in e){if("__proto__"===n)continue;(Array.isArray(e[n])?t:r)[n]=e[n]}return[t,r]}(e);o(e,t),a(e,r)}};function o(e,r=e.schema){const{gen:i,data:o,it:a}=e;if(0===Object.keys(r).length)return;const s=i.let("missing");for(const c in r){const u=r[c];if(0===u.length)continue;const f=(0,n.propertyInData)(i,o,c,a.opts.ownProperties);e.setParams({property:c,depsCount:u.length,deps:u.join(", ")}),a.allErrors?i.if(f,(()=>{for(const t of u)(0,n.checkReportMissingProp)(e,t)})):(i.if(t._`${f} && (${(0,n.checkMissingProp)(e,u,s)})`),(0,n.reportMissingProp)(e,s),i.else())}}function a(e,t=e.schema){const{gen:i,data:o,keyword:a,it:s}=e,c=i.name("valid");for(const u in t)(0,r.alwaysValidSchema)(s,t[u])||(i.if((0,n.propertyInData)(i,o,u,s.opts.ownProperties),(()=>{const t=e.subschema({keyword:a,schemaProp:u},c);e.mergeValidEvaluated(t,c)}),(()=>i.var(c,!0))),e.ok(c))}e.validatePropertyDeps=o,e.validateSchemaDeps=a,e.default=i}(Jb);var Wb={};Object.defineProperty(Wb,"__esModule",{value:!0});const Gb=Up,Vb=Hp,Zb={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:e})=>Gb._`{propertyName: ${e.propertyName}}`},code(e){const{gen:t,schema:r,data:n,it:i}=e;if((0,Vb.alwaysValidSchema)(i,r))return;const o=t.name("valid");t.forIn("key",n,(r=>{e.setParams({propertyName:r}),e.subschema({keyword:"propertyNames",data:r,dataTypes:["string"],propertyName:r,compositeRule:!0},o),t.if((0,Gb.not)(o),(()=>{e.error(!0),i.allErrors||t.break()}))})),e.ok(o)}};Wb.default=Zb;var Xb={};Object.defineProperty(Xb,"__esModule",{value:!0});const Qb=fm,Yb=Up,ev=Kp,tv=Hp,rv={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:e})=>Yb._`{additionalProperty: ${e.additionalProperty}}`},code(e){const{gen:t,schema:r,parentSchema:n,data:i,errsCount:o,it:a}=e;if(!o)throw new Error("ajv implementation error");const{allErrors:s,opts:c}=a;if(a.props=!0,"all"!==c.removeAdditional&&(0,tv.alwaysValidSchema)(a,r))return;const u=(0,Qb.allSchemaProperties)(n.properties),f=(0,Qb.allSchemaProperties)(n.patternProperties);function d(e){t.code(Yb._`delete ${i}[${e}]`)}function l(n){if("all"===c.removeAdditional||c.removeAdditional&&!1===r)d(n);else{if(!1===r)return e.setParams({additionalProperty:n}),e.error(),void(s||t.break());if("object"==typeof r&&!(0,tv.alwaysValidSchema)(a,r)){const r=t.name("valid");"failing"===c.removeAdditional?(h(n,r,!1),t.if((0,Yb.not)(r),(()=>{e.reset(),d(n)}))):(h(n,r),s||t.if((0,Yb.not)(r),(()=>t.break())))}}}function h(t,r,n){const i={keyword:"additionalProperties",dataProp:t,dataPropType:tv.Type.Str};!1===n&&Object.assign(i,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(i,r)}t.forIn("key",i,(r=>{u.length||f.length?t.if(function(r){let i;if(u.length>8){const e=(0,tv.schemaRefOrVal)(a,n.properties,"properties");i=(0,Qb.isOwnProperty)(t,e,r)}else i=u.length?(0,Yb.or)(...u.map((e=>Yb._`${r} === ${e}`))):Yb.nil;return f.length&&(i=(0,Yb.or)(i,...f.map((t=>Yb._`${(0,Qb.usePattern)(e,t)}.test(${r})`)))),(0,Yb.not)(i)}(r),(()=>l(r))):l(r)})),e.ok(Yb._`${o} === ${ev.default.errors}`)}};Xb.default=rv;var nv={};Object.defineProperty(nv,"__esModule",{value:!0});const iv=Bp,ov=fm,av=Hp,sv=Xb,cv={keyword:"properties",type:"object",schemaType:"object",code(e){const{gen:t,schema:r,parentSchema:n,data:i,it:o}=e;"all"===o.opts.removeAdditional&&void 0===n.additionalProperties&&sv.default.code(new iv.KeywordCxt(o,sv.default,"additionalProperties"));const a=(0,ov.allSchemaProperties)(r);for(const e of a)o.definedProperties.add(e);o.opts.unevaluated&&a.length&&!0!==o.props&&(o.props=av.mergeEvaluated.props(t,(0,av.toHash)(a),o.props));const s=a.filter((e=>!(0,av.alwaysValidSchema)(o,r[e])));if(0===s.length)return;const c=t.name("valid");for(const r of s)u(r)?f(r):(t.if((0,ov.propertyInData)(t,i,r,o.opts.ownProperties)),f(r),o.allErrors||t.else().var(c,!0),t.endIf()),e.it.definedProperties.add(r),e.ok(c);function u(e){return o.opts.useDefaults&&!o.compositeRule&&void 0!==r[e].default}function f(t){e.subschema({keyword:"properties",schemaProp:t,dataProp:t},c)}}};nv.default=cv;var uv={};Object.defineProperty(uv,"__esModule",{value:!0});const fv=fm,dv=Up,lv=Hp,hv=Hp,pv={keyword:"patternProperties",type:"object",schemaType:"object",code(e){const{gen:t,schema:r,data:n,parentSchema:i,it:o}=e,{opts:a}=o,s=(0,fv.allSchemaProperties)(r),c=s.filter((e=>(0,lv.alwaysValidSchema)(o,r[e])));if(0===s.length||c.length===s.length&&(!o.opts.unevaluated||!0===o.props))return;const u=a.strictSchema&&!a.allowMatchingProperties&&i.properties,f=t.name("valid");!0===o.props||o.props instanceof dv.Name||(o.props=(0,hv.evaluatedPropsToName)(t,o.props));const{props:d}=o;function l(e){for(const t in u)new RegExp(e).test(t)&&(0,lv.checkStrictMode)(o,`property ${t} matches pattern ${e} (use allowMatchingProperties)`)}function h(r){t.forIn("key",n,(n=>{t.if(dv._`${(0,fv.usePattern)(e,r)}.test(${n})`,(()=>{const i=c.includes(r);i||e.subschema({keyword:"patternProperties",schemaProp:r,dataProp:n,dataPropType:hv.Type.Str},f),o.opts.unevaluated&&!0!==d?t.assign(dv._`${d}[${n}]`,!0):i||o.allErrors||t.if((0,dv.not)(f),(()=>t.break()))}))}))}!function(){for(const e of s)u&&l(e),o.allErrors?h(e):(t.var(f,!0),h(e),t.if(f))}()}};uv.default=pv;var mv={};Object.defineProperty(mv,"__esModule",{value:!0});const gv=Hp,yv={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){const{gen:t,schema:r,it:n}=e;if((0,gv.alwaysValidSchema)(n,r))return void e.fail();const i=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},i),e.failResult(i,(()=>e.reset()),(()=>e.error()))},error:{message:"must NOT be valid"}};mv.default=yv;var bv={};Object.defineProperty(bv,"__esModule",{value:!0});const vv={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:fm.validateUnion,error:{message:"must match a schema in anyOf"}};bv.default=vv;var wv={};Object.defineProperty(wv,"__esModule",{value:!0});const Av=Up,_v=Hp,Ev={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:e})=>Av._`{passingSchemas: ${e.passing}}`},code(e){const{gen:t,schema:r,parentSchema:n,it:i}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(i.opts.discriminator&&n.discriminator)return;const o=r,a=t.let("valid",!1),s=t.let("passing",null),c=t.name("_valid");e.setParams({passing:s}),t.block((function(){o.forEach(((r,n)=>{let o;(0,_v.alwaysValidSchema)(i,r)?t.var(c,!0):o=e.subschema({keyword:"oneOf",schemaProp:n,compositeRule:!0},c),n>0&&t.if(Av._`${c} && ${a}`).assign(a,!1).assign(s,Av._`[${s}, ${n}]`).else(),t.if(c,(()=>{t.assign(a,!0),t.assign(s,n),o&&e.mergeEvaluated(o,Av.Name)}))}))})),e.result(a,(()=>e.reset()),(()=>e.error(!0)))}};wv.default=Ev;var Sv={};Object.defineProperty(Sv,"__esModule",{value:!0});const Pv=Hp,xv={keyword:"allOf",schemaType:"array",code(e){const{gen:t,schema:r,it:n}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");const i=t.name("valid");r.forEach(((t,r)=>{if((0,Pv.alwaysValidSchema)(n,t))return;const o=e.subschema({keyword:"allOf",schemaProp:r},i);e.ok(i),e.mergeEvaluated(o)}))}};Sv.default=xv;var kv={};Object.defineProperty(kv,"__esModule",{value:!0});const Mv=Up,Cv=Hp,Iv={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:e})=>Mv.str`must match "${e.ifClause}" schema`,params:({params:e})=>Mv._`{failingKeyword: ${e.ifClause}}`},code(e){const{gen:t,parentSchema:r,it:n}=e;void 0===r.then&&void 0===r.else&&(0,Cv.checkStrictMode)(n,'"if" without "then" and "else" is ignored');const i=Rv(n,"then"),o=Rv(n,"else");if(!i&&!o)return;const a=t.let("valid",!0),s=t.name("_valid");if(function(){const t=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},s);e.mergeEvaluated(t)}(),e.reset(),i&&o){const r=t.let("ifClause");e.setParams({ifClause:r}),t.if(s,c("then",r),c("else",r))}else i?t.if(s,c("then")):t.if((0,Mv.not)(s),c("else"));function c(r,n){return()=>{const i=e.subschema({keyword:r},s);t.assign(a,s),e.mergeValidEvaluated(i,a),n?t.assign(n,Mv._`${r}`):e.setParams({ifClause:r})}}e.pass(a,(()=>e.error(!0)))}};function Rv(e,t){const r=e.schema[t];return void 0!==r&&!(0,Cv.alwaysValidSchema)(e,r)}kv.default=Iv;var Nv={};Object.defineProperty(Nv,"__esModule",{value:!0});const Ov=Hp,Tv={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){void 0===t.if&&(0,Ov.checkStrictMode)(r,`"${e}" without "if" is ignored`)}};Nv.default=Tv,Object.defineProperty(Ab,"__esModule",{value:!0});const jv=_b,Dv=kb,$v=Mb,Bv=Db,Fv=Lb,zv=Jb,Uv=Wb,Lv=Xb,qv=nv,Hv=uv,Kv=mv,Jv=bv,Wv=wv,Gv=Sv,Vv=kv,Zv=Nv;Ab.default=function(e=!1){const t=[Kv.default,Jv.default,Wv.default,Gv.default,Vv.default,Zv.default,Uv.default,Lv.default,zv.default,qv.default,Hv.default];return e?t.push(Dv.default,Bv.default):t.push(jv.default,$v.default),t.push(Fv.default),t};var Xv={},Qv={};Object.defineProperty(Qv,"__esModule",{value:!0});const Yv=Up,ew={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>Yv.str`must match format "${e}"`,params:({schemaCode:e})=>Yv._`{format: ${e}}`},code(e,t){const{gen:r,data:n,$data:i,schema:o,schemaCode:a,it:s}=e,{opts:c,errSchemaPath:u,schemaEnv:f,self:d}=s;c.validateFormats&&(i?function(){const i=r.scopeValue("formats",{ref:d.formats,code:c.code.formats}),o=r.const("fDef",Yv._`${i}[${a}]`),s=r.let("fType"),u=r.let("format");r.if(Yv._`typeof ${o} == "object" && !(${o} instanceof RegExp)`,(()=>r.assign(s,Yv._`${o}.type || "string"`).assign(u,Yv._`${o}.validate`)),(()=>r.assign(s,Yv._`"string"`).assign(u,o))),e.fail$data((0,Yv.or)(!1===c.strictSchema?Yv.nil:Yv._`${a} && !${u}`,function(){const e=f.$async?Yv._`(${o}.async ? await ${u}(${n}) : ${u}(${n}))`:Yv._`${u}(${n})`,r=Yv._`(typeof ${u} == "function" ? ${e} : ${u}.test(${n}))`;return Yv._`${u} && ${u} !== true && ${s} === ${t} && !${r}`}()))}():function(){const i=d.formats[o];if(!i)return void function(){if(!1===c.strictSchema)return void d.logger.warn(e());throw new Error(e());function e(){return`unknown format "${o}" ignored in schema at path "${u}"`}}();if(!0===i)return;const[a,s,l]=function(e){const t=e instanceof RegExp?(0,Yv.regexpCode)(e):c.code.formats?Yv._`${c.code.formats}${(0,Yv.getProperty)(o)}`:void 0,n=r.scopeValue("formats",{key:o,ref:e,code:t});if("object"==typeof e&&!(e instanceof RegExp))return[e.type||"string",e.validate,Yv._`${n}.validate`];return["string",e,n]}(i);a===t&&e.pass(function(){if("object"==typeof i&&!(i instanceof RegExp)&&i.async){if(!f.$async)throw new Error("async format in sync schema");return Yv._`await ${l}(${n})`}return"function"==typeof s?Yv._`${l}(${n})`:Yv._`${l}.test(${n})`}())}())}};Qv.default=ew,Object.defineProperty(Xv,"__esModule",{value:!0});const tw=[Qv.default];Xv.default=tw,Object.defineProperty(Gg,"__esModule",{value:!0});const rw=sy,nw=Ab,iw=Xv,ow=[Vg.default,rw.default,nw.default(),iw.default,["title","description","default"]];Gg.default=ow;var aw={},sw={};!function(e){var t;Object.defineProperty(e,"__esModule",{value:!0}),e.DiscrError=void 0,(t=e.DiscrError||(e.DiscrError={})).Tag="tag",t.Mapping="mapping"}(sw),Object.defineProperty(aw,"__esModule",{value:!0});const cw=Up,uw=sw,fw=Mg,dw=Hp,lw={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:e,tagName:t}})=>e===uw.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>cw._`{error: ${e}, tag: ${r}, tagValue: ${t}}`},code(e){const{gen:t,data:r,schema:n,parentSchema:i,it:o}=e,{oneOf:a}=i;if(!o.opts.discriminator)throw new Error("discriminator: requires discriminator option");const s=n.propertyName;if("string"!=typeof s)throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!a)throw new Error("discriminator: requires oneOf keyword");const c=t.let("valid",!1),u=t.const("tag",cw._`${r}${(0,cw.getProperty)(s)}`);function f(r){const n=t.name("valid"),i=e.subschema({keyword:"oneOf",schemaProp:r},n);return e.mergeEvaluated(i,cw.Name),n}t.if(cw._`typeof ${u} == "string"`,(()=>function(){const r=function(){var e;const t={},r=c(i);let n=!0;for(let t=0;te.error(!1,{discrError:uw.DiscrError.Tag,tag:u,tagName:s}))),e.ok(c)}};aw.default=lw;var hw={id:"http://json-schema.org/draft-04/schema#",$schema:"http://json-schema.org/draft-04/schema#",description:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},positiveInteger:{type:"integer",minimum:0},positiveIntegerDefault0:{allOf:[{$ref:"#/definitions/positiveInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},minItems:1,uniqueItems:!0}},type:"object",properties:{id:{type:"string",format:"uri"},$schema:{type:"string",format:"uri"},title:{type:"string"},description:{type:"string"},default:{},multipleOf:{type:"number",minimum:0,exclusiveMinimum:!0},maximum:{type:"number"},exclusiveMaximum:{type:"boolean",default:!1},minimum:{type:"number"},exclusiveMinimum:{type:"boolean",default:!1},maxLength:{$ref:"#/definitions/positiveInteger"},minLength:{$ref:"#/definitions/positiveIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{anyOf:[{type:"boolean"},{$ref:"#"}],default:{}},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:{}},maxItems:{$ref:"#/definitions/positiveInteger"},minItems:{$ref:"#/definitions/positiveIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxProperties:{$ref:"#/definitions/positiveInteger"},minProperties:{$ref:"#/definitions/positiveIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{anyOf:[{type:"boolean"},{$ref:"#"}],default:{}},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},enum:{type:"array",minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},dependencies:{exclusiveMaximum:["maximum"],exclusiveMinimum:["minimum"]},default:{}};!function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;const r=$p,n=Gg,i=aw,o=hw,a=["/properties"],s="http://json-schema.org/draft-04/schema";class c extends r.default{constructor(e={}){super({...e,schemaId:"id"})}_addVocabularies(){super._addVocabularies(),n.default.forEach((e=>this.addVocabulary(e))),this.opts.discriminator&&this.addKeyword(i.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const e=this.opts.$data?this.$dataMetaSchema(o,a):o;this.addMetaSchema(e,s,!1),this.refs["http://json-schema.org/schema"]=s}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(s)?s:void 0)}}e.exports=t=c,Object.defineProperty(t,"__esModule",{value:!0}),t.default=c;var u=$p;Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return u.KeywordCxt}});var f=$p;Object.defineProperty(t,"_",{enumerable:!0,get:function(){return f._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return f.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return f.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return f.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return f.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return f.CodeGen}})}(Dp,Dp.exports);var pw=f(Dp.exports),mw={exports:{}},gw={};!function(e){function t(e,t){return{validate:e,compare:t}}Object.defineProperty(e,"__esModule",{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0,e.fullFormats={date:t(i,o),time:t(s,c),"date-time":t((function(e){const t=e.split(u);return 2===t.length&&i(t[0])&&s(t[1],!0)}),f),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:function(e){return d.test(e)&&l.test(e)},"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1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\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:function(e){if(y.test(e))return!1;try{return new RegExp(e),!0}catch(e){return!1}},uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:function(e){return h.lastIndex=0,h.test(e)},int32:{type:"number",validate:function(e){return Number.isInteger(e)&&e<=m&&e>=p}},int64:{type:"number",validate:function(e){return Number.isInteger(e)}},float:{type:"number",validate:g},double:{type:"number",validate:g},password:!0,binary:!0},e.fastFormats={...e.fullFormats,date:t(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,o),time:t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,c),"date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,f),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},e.formatNames=Object.keys(e.fullFormats);const r=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,n=[0,31,28,31,30,31,30,31,31,30,31,30,31];function i(e){const t=r.exec(e);if(!t)return!1;const i=+t[1],o=+t[2],a=+t[3];return o>=1&&o<=12&&a>=1&&a<=(2===o&&function(e){return e%4==0&&(e%100!=0||e%400==0)}(i)?29:n[o])}function o(e,t){if(e&&t)return e>t?1:e(t=n[1]+n[2]+n[3]+(n[4]||""))?1:e=",ok:Mw.GTE,fail:Mw.LT},exclusiveMaximum:{okStr:"<",ok:Mw.LT,fail:Mw.GTE},exclusiveMinimum:{okStr:">",ok:Mw.GT,fail:Mw.LTE}},Iw={message:({keyword:e,schemaCode:t})=>kw.str`must be ${Cw[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>kw._`{comparison: ${Cw[e].okStr}, limit: ${t}}`},Rw={keyword:Object.keys(Cw),type:"number",schemaType:"number",$data:!0,error:Iw,code(e){const{keyword:t,data:r,schemaCode:n}=e;e.fail$data(kw._`${r} ${Cw[t].fail} ${n} || isNaN(${r})`)}};xw.default=Rw,Object.defineProperty(Pw,"__esModule",{value:!0});const Nw=by,Ow=Ay,Tw=Cy,jw=Oy,Dw=$y,$w=Ly,Bw=Jy,Fw=eb,zw=ob,Uw=[xw.default,Nw.default,Ow.default,Tw.default,jw.default,Dw.default,$w.default,Bw.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},Fw.default,zw.default];Pw.default=Uw;var Lw={};Object.defineProperty(Lw,"__esModule",{value:!0}),Lw.contentVocabulary=Lw.metadataVocabulary=void 0,Lw.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],Lw.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"],Object.defineProperty(vw,"__esModule",{value:!0});const qw=Pw,Hw=Ab,Kw=Xv,Jw=Lw,Ww=[ww.default,qw.default,(0,Hw.default)(),Kw.default,Jw.metadataVocabulary,Jw.contentVocabulary];vw.default=Ww;var Gw={$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:!0,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:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},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:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},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:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},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:!0};!function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;const r=$p,n=vw,i=aw,o=Gw,a=["/properties"],s="http://json-schema.org/draft-07/schema";class c extends r.default{_addVocabularies(){super._addVocabularies(),n.default.forEach((e=>this.addVocabulary(e))),this.opts.discriminator&&this.addKeyword(i.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const e=this.opts.$data?this.$dataMetaSchema(o,a):o;this.addMetaSchema(e,s,!1),this.refs["http://json-schema.org/schema"]=s}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(s)?s:void 0)}}e.exports=t=c,Object.defineProperty(t,"__esModule",{value:!0}),t.default=c;var u=Bp;Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return u.KeywordCxt}});var f=Up;Object.defineProperty(t,"_",{enumerable:!0,get:function(){return f._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return f.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return f.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return f.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return f.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return f.CodeGen}});var d=Eg;Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return d.default}});var l=Pg;Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return l.default}})}(bw,bw.exports);var Vw=bw.exports;!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;const t=Vw,r=Up,n=r.operators,i={formatMaximum:{okStr:"<=",ok:n.LTE,fail:n.GT},formatMinimum:{okStr:">=",ok:n.GTE,fail:n.LT},formatExclusiveMaximum:{okStr:"<",ok:n.LT,fail:n.GTE},formatExclusiveMinimum:{okStr:">",ok:n.GT,fail:n.LTE}},o={message:({keyword:e,schemaCode:t})=>r.str`should be ${i[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>r._`{comparison: ${i[e].okStr}, limit: ${t}}`};e.formatLimitDefinition={keyword:Object.keys(i),type:"string",schemaType:"string",$data:!0,error:o,code(e){const{gen:n,data:o,schemaCode:a,keyword:s,it:c}=e,{opts:u,self:f}=c;if(!u.validateFormats)return;const d=new t.KeywordCxt(c,f.RULES.all.format.definition,"format");function l(e){return r._`${e}.compare(${o}, ${a}) ${i[s].fail} 0`}d.$data?function(){const t=n.scopeValue("formats",{ref:f.formats,code:u.code.formats}),i=n.const("fmt",r._`${t}[${d.schemaCode}]`);e.fail$data(r.or(r._`typeof ${i} != "object"`,r._`${i} instanceof RegExp`,r._`typeof ${i}.compare != "function"`,l(i)))}():function(){const t=d.schema,i=f.formats[t];if(!i||!0===i)return;if("object"!=typeof i||i instanceof RegExp||"function"!=typeof i.compare)throw new Error(`"${s}": format "${t}" does not define "compare" function`);const o=n.scopeValue("formats",{key:t,ref:i,code:u.code.formats?r._`${u.code.formats}${r.getProperty(t)}`:void 0});e.fail$data(l(o))}()},dependencies:["format"]};e.default=t=>(t.addKeyword(e.formatLimitDefinition),t)}(yw),function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=gw,n=yw,i=Up,o=new i.Name("fullFormats"),a=new i.Name("fastFormats"),s=(e,t={keywords:!0})=>{if(Array.isArray(t))return c(e,t,r.fullFormats,o),e;const[i,s]="fast"===t.mode?[r.fastFormats,a]:[r.fullFormats,o];return c(e,t.formats||r.formatNames,i,s),t.keywords&&n.default(e),e};function c(e,t,r,n){var o,a;null!==(o=(a=e.opts.code).formats)&&void 0!==o||(a.formats=i._`require("ajv-formats/dist/formats").${n}`);for(const n of t)e.addFormat(n,r[n])}s.get=(e,t="full")=>{const n=("fast"===t?r.fastFormats:r.fullFormats)[e];if(!n)throw new Error(`Unknown format "${e}"`);return n},e.exports=t=s,Object.defineProperty(t,"__esModule",{value:!0}),t.default=s}(mw,mw.exports);var Zw=f(mw.exports),Xw={exports:{}};!function(e,t){(function(){var r,n="Expected a function",i="__lodash_hash_undefined__",o="__lodash_placeholder__",a=16,s=32,c=64,f=128,d=256,l=1/0,h=9007199254740991,p=NaN,m=4294967295,g=[["ary",f],["bind",1],["bindKey",2],["curry",8],["curryRight",a],["flip",512],["partial",s],["partialRight",c],["rearg",d]],y="[object Arguments]",b="[object Array]",v="[object Boolean]",w="[object Date]",A="[object Error]",_="[object Function]",E="[object GeneratorFunction]",S="[object Map]",P="[object Number]",x="[object Object]",k="[object Promise]",M="[object RegExp]",C="[object Set]",I="[object String]",R="[object Symbol]",N="[object WeakMap]",O="[object ArrayBuffer]",T="[object DataView]",j="[object Float32Array]",D="[object Float64Array]",$="[object Int8Array]",B="[object Int16Array]",F="[object Int32Array]",z="[object Uint8Array]",U="[object Uint8ClampedArray]",L="[object Uint16Array]",q="[object Uint32Array]",H=/\b__p \+= '';/g,K=/\b(__p \+=) '' \+/g,J=/(__e\(.*?\)|\b__t\)) \+\n'';/g,W=/&(?:amp|lt|gt|quot|#39);/g,G=/[&<>"']/g,V=RegExp(W.source),Z=RegExp(G.source),X=/<%-([\s\S]+?)%>/g,Q=/<%([\s\S]+?)%>/g,Y=/<%=([\s\S]+?)%>/g,ee=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,te=/^\w*$/,re=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ne=/[\\^$.*+?()[\]{}|]/g,ie=RegExp(ne.source),oe=/^\s+/,ae=/\s/,se=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ce=/\{\n\/\* \[wrapped with (.+)\] \*/,ue=/,? & /,fe=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,de=/[()=,{}\[\]\/\s]/,le=/\\(\\)?/g,he=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,pe=/\w*$/,me=/^[-+]0x[0-9a-f]+$/i,ge=/^0b[01]+$/i,ye=/^\[object .+?Constructor\]$/,be=/^0o[0-7]+$/i,ve=/^(?:0|[1-9]\d*)$/,we=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Ae=/($^)/,_e=/['\n\r\u2028\u2029\\]/g,Ee="\\ud800-\\udfff",Se="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Pe="\\u2700-\\u27bf",xe="a-z\\xdf-\\xf6\\xf8-\\xff",ke="A-Z\\xc0-\\xd6\\xd8-\\xde",Me="\\ufe0e\\ufe0f",Ce="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ie="['’]",Re="["+Ee+"]",Ne="["+Ce+"]",Oe="["+Se+"]",Te="\\d+",je="["+Pe+"]",De="["+xe+"]",$e="[^"+Ee+Ce+Te+Pe+xe+ke+"]",Be="\\ud83c[\\udffb-\\udfff]",Fe="[^"+Ee+"]",ze="(?:\\ud83c[\\udde6-\\uddff]){2}",Ue="[\\ud800-\\udbff][\\udc00-\\udfff]",Le="["+ke+"]",qe="\\u200d",He="(?:"+De+"|"+$e+")",Ke="(?:"+Le+"|"+$e+")",Je="(?:['’](?:d|ll|m|re|s|t|ve))?",We="(?:['’](?:D|LL|M|RE|S|T|VE))?",Ge="(?:"+Oe+"|"+Be+")"+"?",Ve="["+Me+"]?",Ze=Ve+Ge+("(?:"+qe+"(?:"+[Fe,ze,Ue].join("|")+")"+Ve+Ge+")*"),Xe="(?:"+[je,ze,Ue].join("|")+")"+Ze,Qe="(?:"+[Fe+Oe+"?",Oe,ze,Ue,Re].join("|")+")",Ye=RegExp(Ie,"g"),et=RegExp(Oe,"g"),tt=RegExp(Be+"(?="+Be+")|"+Qe+Ze,"g"),rt=RegExp([Le+"?"+De+"+"+Je+"(?="+[Ne,Le,"$"].join("|")+")",Ke+"+"+We+"(?="+[Ne,Le+He,"$"].join("|")+")",Le+"?"+He+"+"+Je,Le+"+"+We,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Te,Xe].join("|"),"g"),nt=RegExp("["+qe+Ee+Se+Me+"]"),it=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ot=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],at=-1,st={};st[j]=st[D]=st[$]=st[B]=st[F]=st[z]=st[U]=st[L]=st[q]=!0,st[y]=st[b]=st[O]=st[v]=st[T]=st[w]=st[A]=st[_]=st[S]=st[P]=st[x]=st[M]=st[C]=st[I]=st[N]=!1;var ct={};ct[y]=ct[b]=ct[O]=ct[T]=ct[v]=ct[w]=ct[j]=ct[D]=ct[$]=ct[B]=ct[F]=ct[S]=ct[P]=ct[x]=ct[M]=ct[C]=ct[I]=ct[R]=ct[z]=ct[U]=ct[L]=ct[q]=!0,ct[A]=ct[_]=ct[N]=!1;var ut={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ft=parseFloat,dt=parseInt,lt="object"==typeof u&&u&&u.Object===Object&&u,ht="object"==typeof self&&self&&self.Object===Object&&self,pt=lt||ht||Function("return this")(),mt=t&&!t.nodeType&&t,gt=mt&&e&&!e.nodeType&&e,yt=gt&>.exports===mt,bt=yt&<.process,vt=function(){try{var e=gt&>.require&>.require("util").types;return e||bt&&bt.binding&&bt.binding("util")}catch(e){}}(),wt=vt&&vt.isArrayBuffer,At=vt&&vt.isDate,_t=vt&&vt.isMap,Et=vt&&vt.isRegExp,St=vt&&vt.isSet,Pt=vt&&vt.isTypedArray;function xt(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}function kt(e,t,r,n){for(var i=-1,o=null==e?0:e.length;++i-1}function Ot(e,t,r){for(var n=-1,i=null==e?0:e.length;++n-1;);return r}function rr(e,t){for(var r=e.length;r--&&Lt(t,e[r],0)>-1;);return r}var nr=Wt({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),ir=Wt({"&":"&","<":"<",">":">",'"':""","'":"'"});function or(e){return"\\"+ut[e]}function ar(e){return nt.test(e)}function sr(e){var t=-1,r=Array(e.size);return e.forEach((function(e,n){r[++t]=[n,e]})),r}function cr(e,t){return function(r){return e(t(r))}}function ur(e,t){for(var r=-1,n=e.length,i=0,a=[];++r",""":'"',"'":"'"});var gr=function e(t){var u,ae=(t=null==t?pt:gr.defaults(pt.Object(),t,gr.pick(pt,ot))).Array,Ee=t.Date,Se=t.Error,Pe=t.Function,xe=t.Math,ke=t.Object,Me=t.RegExp,Ce=t.String,Ie=t.TypeError,Re=ae.prototype,Ne=Pe.prototype,Oe=ke.prototype,Te=t["__core-js_shared__"],je=Ne.toString,De=Oe.hasOwnProperty,$e=0,Be=(u=/[^.]+$/.exec(Te&&Te.keys&&Te.keys.IE_PROTO||""))?"Symbol(src)_1."+u:"",Fe=Oe.toString,ze=je.call(ke),Ue=pt._,Le=Me("^"+je.call(De).replace(ne,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),qe=yt?t.Buffer:r,He=t.Symbol,Ke=t.Uint8Array,Je=qe?qe.allocUnsafe:r,We=cr(ke.getPrototypeOf,ke),Ge=ke.create,Ve=Oe.propertyIsEnumerable,Ze=Re.splice,Xe=He?He.isConcatSpreadable:r,Qe=He?He.iterator:r,tt=He?He.toStringTag:r,nt=function(){try{var e=ho(ke,"defineProperty");return e({},"",{}),e}catch(e){}}(),ut=t.clearTimeout!==pt.clearTimeout&&t.clearTimeout,lt=Ee&&Ee.now!==pt.Date.now&&Ee.now,ht=t.setTimeout!==pt.setTimeout&&t.setTimeout,mt=xe.ceil,gt=xe.floor,bt=ke.getOwnPropertySymbols,vt=qe?qe.isBuffer:r,Ft=t.isFinite,Wt=Re.join,yr=cr(ke.keys,ke),br=xe.max,vr=xe.min,wr=Ee.now,Ar=t.parseInt,_r=xe.random,Er=Re.reverse,Sr=ho(t,"DataView"),Pr=ho(t,"Map"),xr=ho(t,"Promise"),kr=ho(t,"Set"),Mr=ho(t,"WeakMap"),Cr=ho(ke,"create"),Ir=Mr&&new Mr,Rr={},Nr=Fo(Sr),Or=Fo(Pr),Tr=Fo(xr),jr=Fo(kr),Dr=Fo(Mr),$r=He?He.prototype:r,Br=$r?$r.valueOf:r,Fr=$r?$r.toString:r;function zr(e){if(rs(e)&&!Ka(e)&&!(e instanceof Hr)){if(e instanceof qr)return e;if(De.call(e,"__wrapped__"))return zo(e)}return new qr(e)}var Ur=function(){function e(){}return function(t){if(!ts(t))return{};if(Ge)return Ge(t);e.prototype=t;var n=new e;return e.prototype=r,n}}();function Lr(){}function qr(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=r}function Hr(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=m,this.__views__=[]}function Kr(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t=t?e:t)),e}function un(e,t,n,i,o,a){var s,c=1&t,u=2&t,f=4&t;if(n&&(s=o?n(e,i,o,a):n(e)),s!==r)return s;if(!ts(e))return e;var d=Ka(e);if(d){if(s=function(e){var t=e.length,r=new e.constructor(t);t&&"string"==typeof e[0]&&De.call(e,"index")&&(r.index=e.index,r.input=e.input);return r}(e),!c)return Ii(e,s)}else{var l=go(e),h=l==_||l==E;if(Va(e))return Si(e,c);if(l==x||l==y||h&&!o){if(s=u||h?{}:bo(e),!c)return u?function(e,t){return Ri(e,mo(e),t)}(e,function(e,t){return e&&Ri(t,Os(t),e)}(s,e)):function(e,t){return Ri(e,po(e),t)}(e,on(s,e))}else{if(!ct[l])return o?e:{};s=function(e,t,r){var n=e.constructor;switch(t){case O:return Pi(e);case v:case w:return new n(+e);case T:return function(e,t){var r=t?Pi(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}(e,r);case j:case D:case $:case B:case F:case z:case U:case L:case q:return xi(e,r);case S:return new n;case P:case I:return new n(e);case M:return function(e){var t=new e.constructor(e.source,pe.exec(e));return t.lastIndex=e.lastIndex,t}(e);case C:return new n;case R:return i=e,Br?ke(Br.call(i)):{}}var i}(e,l,c)}}a||(a=new Vr);var p=a.get(e);if(p)return p;a.set(e,s),ss(e)?e.forEach((function(r){s.add(un(r,t,n,r,e,a))})):ns(e)&&e.forEach((function(r,i){s.set(i,un(r,t,n,i,e,a))}));var m=d?r:(f?u?oo:io:u?Os:Ns)(e);return Mt(m||e,(function(r,i){m&&(r=e[i=r]),tn(s,i,un(r,t,n,i,e,a))})),s}function fn(e,t,n){var i=n.length;if(null==e)return!i;for(e=ke(e);i--;){var o=n[i],a=t[o],s=e[o];if(s===r&&!(o in e)||!a(s))return!1}return!0}function dn(e,t,i){if("function"!=typeof e)throw new Ie(n);return No((function(){e.apply(r,i)}),t)}function ln(e,t,r,n){var i=-1,o=Nt,a=!0,s=e.length,c=[],u=t.length;if(!s)return c;r&&(t=Tt(t,Qt(r))),n?(o=Ot,a=!1):t.length>=200&&(o=er,a=!1,t=new Gr(t));e:for(;++i-1},Jr.prototype.set=function(e,t){var r=this.__data__,n=rn(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this},Wr.prototype.clear=function(){this.size=0,this.__data__={hash:new Kr,map:new(Pr||Jr),string:new Kr}},Wr.prototype.delete=function(e){var t=fo(this,e).delete(e);return this.size-=t?1:0,t},Wr.prototype.get=function(e){return fo(this,e).get(e)},Wr.prototype.has=function(e){return fo(this,e).has(e)},Wr.prototype.set=function(e,t){var r=fo(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this},Gr.prototype.add=Gr.prototype.push=function(e){return this.__data__.set(e,i),this},Gr.prototype.has=function(e){return this.__data__.has(e)},Vr.prototype.clear=function(){this.__data__=new Jr,this.size=0},Vr.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},Vr.prototype.get=function(e){return this.__data__.get(e)},Vr.prototype.has=function(e){return this.__data__.has(e)},Vr.prototype.set=function(e,t){var r=this.__data__;if(r instanceof Jr){var n=r.__data__;if(!Pr||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new Wr(n)}return r.set(e,t),this.size=r.size,this};var hn=Ti(An),pn=Ti(_n,!0);function mn(e,t){var r=!0;return hn(e,(function(e,n,i){return r=!!t(e,n,i)})),r}function gn(e,t,n){for(var i=-1,o=e.length;++i0&&r(s)?t>1?bn(s,t-1,r,n,i):jt(i,s):n||(i[i.length]=s)}return i}var vn=ji(),wn=ji(!0);function An(e,t){return e&&vn(e,t,Ns)}function _n(e,t){return e&&wn(e,t,Ns)}function En(e,t){return Rt(t,(function(t){return Qa(e[t])}))}function Sn(e,t){for(var n=0,i=(t=wi(t,e)).length;null!=e&&nt}function Mn(e,t){return null!=e&&De.call(e,t)}function Cn(e,t){return null!=e&&t in ke(e)}function In(e,t,n){for(var i=n?Ot:Nt,o=e[0].length,a=e.length,s=a,c=ae(a),u=1/0,f=[];s--;){var d=e[s];s&&t&&(d=Tt(d,Qt(t))),u=vr(d.length,u),c[s]=!n&&(t||o>=120&&d.length>=120)?new Gr(s&&d):r}d=e[0];var l=-1,h=c[0];e:for(;++l=s?c:c*("desc"==r[n]?-1:1)}return e.index-t.index}(e,t,r)}))}function Jn(e,t,r){for(var n=-1,i=t.length,o={};++n-1;)s!==e&&Ze.call(s,c,1),Ze.call(e,c,1);return e}function Gn(e,t){for(var r=e?t.length:0,n=r-1;r--;){var i=t[r];if(r==n||i!==o){var o=i;wo(i)?Ze.call(e,i,1):li(e,i)}}return e}function Vn(e,t){return e+gt(_r()*(t-e+1))}function Zn(e,t){var r="";if(!e||t<1||t>h)return r;do{t%2&&(r+=e),(t=gt(t/2))&&(e+=e)}while(t);return r}function Xn(e,t){return Oo(Mo(e,t,ic),e+"")}function Qn(e){return Xr(Us(e))}function Yn(e,t){var r=Us(e);return Do(r,cn(t,0,r.length))}function ei(e,t,n,i){if(!ts(e))return e;for(var o=-1,a=(t=wi(t,e)).length,s=a-1,c=e;null!=c&&++oi?0:i+t),(r=r>i?i:r)<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var o=ae(i);++n>>1,a=e[o];null!==a&&!us(a)&&(r?a<=t:a=200){var u=t?null:Zi(e);if(u)return fr(u);a=!1,i=er,c=new Gr}else c=t?[]:s;e:for(;++n=i?e:ii(e,t,n)}var Ei=ut||function(e){return pt.clearTimeout(e)};function Si(e,t){if(t)return e.slice();var r=e.length,n=Je?Je(r):new e.constructor(r);return e.copy(n),n}function Pi(e){var t=new e.constructor(e.byteLength);return new Ke(t).set(new Ke(e)),t}function xi(e,t){var r=t?Pi(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function ki(e,t){if(e!==t){var n=e!==r,i=null===e,o=e==e,a=us(e),s=t!==r,c=null===t,u=t==t,f=us(t);if(!c&&!f&&!a&&e>t||a&&s&&u&&!c&&!f||i&&s&&u||!n&&u||!o)return 1;if(!i&&!a&&!f&&e1?n[o-1]:r,s=o>2?n[2]:r;for(a=e.length>3&&"function"==typeof a?(o--,a):r,s&&Ao(n[0],n[1],s)&&(a=o<3?r:a,o=1),t=ke(t);++i-1?o[a?t[s]:s]:r}}function zi(e){return no((function(t){var i=t.length,o=i,a=qr.prototype.thru;for(e&&t.reverse();o--;){var s=t[o];if("function"!=typeof s)throw new Ie(n);if(a&&!c&&"wrapper"==so(s))var c=new qr([],!0)}for(o=c?o:i;++o1&&v.reverse(),l&&uc))return!1;var f=a.get(e),d=a.get(t);if(f&&d)return f==t&&d==e;var l=-1,h=!0,p=2&n?new Gr:r;for(a.set(e,t),a.set(t,e);++l-1&&e%1==0&&e1?"& ":"")+t[n],t=t.join(r>2?", ":" "),e.replace(se,"{\n/* [wrapped with "+t+"] */\n")}(n,function(e,t){return Mt(g,(function(r){var n="_."+r[0];t&r[1]&&!Nt(e,n)&&e.push(n)})),e.sort()}(function(e){var t=e.match(ce);return t?t[1].split(ue):[]}(n),r)))}function jo(e){var t=0,n=0;return function(){var i=wr(),o=16-(i-n);if(n=i,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(r,arguments)}}function Do(e,t){var n=-1,i=e.length,o=i-1;for(t=t===r?i:t;++n1?e[t-1]:r;return n="function"==typeof n?(e.pop(),n):r,aa(e,n)}));function ha(e){var t=zr(e);return t.__chain__=!0,t}function pa(e,t){return t(e)}var ma=no((function(e){var t=e.length,n=t?e[0]:0,i=this.__wrapped__,o=function(t){return sn(t,e)};return!(t>1||this.__actions__.length)&&i instanceof Hr&&wo(n)?((i=i.slice(n,+n+(t?1:0))).__actions__.push({func:pa,args:[o],thisArg:r}),new qr(i,this.__chain__).thru((function(e){return t&&!e.length&&e.push(r),e}))):this.thru(o)}));var ga=Ni((function(e,t,r){De.call(e,r)?++e[r]:an(e,r,1)}));var ya=Fi(Ho),ba=Fi(Ko);function va(e,t){return(Ka(e)?Mt:hn)(e,uo(t,3))}function wa(e,t){return(Ka(e)?Ct:pn)(e,uo(t,3))}var Aa=Ni((function(e,t,r){De.call(e,r)?e[r].push(t):an(e,r,[t])}));var _a=Xn((function(e,t,r){var n=-1,i="function"==typeof t,o=Wa(e)?ae(e.length):[];return hn(e,(function(e){o[++n]=i?xt(t,e,r):Rn(e,t,r)})),o})),Ea=Ni((function(e,t,r){an(e,r,t)}));function Sa(e,t){return(Ka(e)?Tt:zn)(e,uo(t,3))}var Pa=Ni((function(e,t,r){e[r?0:1].push(t)}),(function(){return[[],[]]}));var xa=Xn((function(e,t){if(null==e)return[];var r=t.length;return r>1&&Ao(e,t[0],t[1])?t=[]:r>2&&Ao(t[0],t[1],t[2])&&(t=[t[0]]),Kn(e,bn(t,1),[])})),ka=lt||function(){return pt.Date.now()};function Ma(e,t,n){return t=n?r:t,t=e&&null==t?e.length:t,Qi(e,f,r,r,r,r,t)}function Ca(e,t){var i;if("function"!=typeof t)throw new Ie(n);return e=ms(e),function(){return--e>0&&(i=t.apply(this,arguments)),e<=1&&(t=r),i}}var Ia=Xn((function(e,t,r){var n=1;if(r.length){var i=ur(r,co(Ia));n|=s}return Qi(e,n,t,r,i)})),Ra=Xn((function(e,t,r){var n=3;if(r.length){var i=ur(r,co(Ra));n|=s}return Qi(t,n,e,r,i)}));function Na(e,t,i){var o,a,s,c,u,f,d=0,l=!1,h=!1,p=!0;if("function"!=typeof e)throw new Ie(n);function m(t){var n=o,i=a;return o=a=r,d=t,c=e.apply(i,n)}function g(e){var n=e-f;return f===r||n>=t||n<0||h&&e-d>=s}function y(){var e=ka();if(g(e))return b(e);u=No(y,function(e){var r=t-(e-f);return h?vr(r,s-(e-d)):r}(e))}function b(e){return u=r,p&&o?m(e):(o=a=r,c)}function v(){var e=ka(),n=g(e);if(o=arguments,a=this,f=e,n){if(u===r)return function(e){return d=e,u=No(y,t),l?m(e):c}(f);if(h)return Ei(u),u=No(y,t),m(f)}return u===r&&(u=No(y,t)),c}return t=ys(t)||0,ts(i)&&(l=!!i.leading,s=(h="maxWait"in i)?br(ys(i.maxWait)||0,t):s,p="trailing"in i?!!i.trailing:p),v.cancel=function(){u!==r&&Ei(u),d=0,o=f=a=u=r},v.flush=function(){return u===r?c:b(ka())},v}var Oa=Xn((function(e,t){return dn(e,1,t)})),Ta=Xn((function(e,t,r){return dn(e,ys(t)||0,r)}));function ja(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Ie(n);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var a=e.apply(this,n);return r.cache=o.set(i,a)||o,a};return r.cache=new(ja.Cache||Wr),r}function Da(e){if("function"!=typeof e)throw new Ie(n);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}ja.Cache=Wr;var $a=Ai((function(e,t){var r=(t=1==t.length&&Ka(t[0])?Tt(t[0],Qt(uo())):Tt(bn(t,1),Qt(uo()))).length;return Xn((function(n){for(var i=-1,o=vr(n.length,r);++i=t})),Ha=Nn(function(){return arguments}())?Nn:function(e){return rs(e)&&De.call(e,"callee")&&!Ve.call(e,"callee")},Ka=ae.isArray,Ja=wt?Qt(wt):function(e){return rs(e)&&xn(e)==O};function Wa(e){return null!=e&&es(e.length)&&!Qa(e)}function Ga(e){return rs(e)&&Wa(e)}var Va=vt||yc,Za=At?Qt(At):function(e){return rs(e)&&xn(e)==w};function Xa(e){if(!rs(e))return!1;var t=xn(e);return t==A||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!os(e)}function Qa(e){if(!ts(e))return!1;var t=xn(e);return t==_||t==E||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Ya(e){return"number"==typeof e&&e==ms(e)}function es(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=h}function ts(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function rs(e){return null!=e&&"object"==typeof e}var ns=_t?Qt(_t):function(e){return rs(e)&&go(e)==S};function is(e){return"number"==typeof e||rs(e)&&xn(e)==P}function os(e){if(!rs(e)||xn(e)!=x)return!1;var t=We(e);if(null===t)return!0;var r=De.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&je.call(r)==ze}var as=Et?Qt(Et):function(e){return rs(e)&&xn(e)==M};var ss=St?Qt(St):function(e){return rs(e)&&go(e)==C};function cs(e){return"string"==typeof e||!Ka(e)&&rs(e)&&xn(e)==I}function us(e){return"symbol"==typeof e||rs(e)&&xn(e)==R}var fs=Pt?Qt(Pt):function(e){return rs(e)&&es(e.length)&&!!st[xn(e)]};var ds=Wi(Fn),ls=Wi((function(e,t){return e<=t}));function hs(e){if(!e)return[];if(Wa(e))return cs(e)?hr(e):Ii(e);if(Qe&&e[Qe])return function(e){for(var t,r=[];!(t=e.next()).done;)r.push(t.value);return r}(e[Qe]());var t=go(e);return(t==S?sr:t==C?fr:Us)(e)}function ps(e){return e?(e=ys(e))===l||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function ms(e){var t=ps(e),r=t%1;return t==t?r?t-r:t:0}function gs(e){return e?cn(ms(e),0,m):0}function ys(e){if("number"==typeof e)return e;if(us(e))return p;if(ts(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=ts(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Xt(e);var r=ge.test(e);return r||be.test(e)?dt(e.slice(2),r?2:8):me.test(e)?p:+e}function bs(e){return Ri(e,Os(e))}function vs(e){return null==e?"":fi(e)}var ws=Oi((function(e,t){if(Po(t)||Wa(t))Ri(t,Ns(t),e);else for(var r in t)De.call(t,r)&&tn(e,r,t[r])})),As=Oi((function(e,t){Ri(t,Os(t),e)})),_s=Oi((function(e,t,r,n){Ri(t,Os(t),e,n)})),Es=Oi((function(e,t,r,n){Ri(t,Ns(t),e,n)})),Ss=no(sn);var Ps=Xn((function(e,t){e=ke(e);var n=-1,i=t.length,o=i>2?t[2]:r;for(o&&Ao(t[0],t[1],o)&&(i=1);++n1),t})),Ri(e,oo(e),r),n&&(r=un(r,7,to));for(var i=t.length;i--;)li(r,t[i]);return r}));var $s=no((function(e,t){return null==e?{}:function(e,t){return Jn(e,t,(function(t,r){return Ms(e,r)}))}(e,t)}));function Bs(e,t){if(null==e)return{};var r=Tt(oo(e),(function(e){return[e]}));return t=uo(t),Jn(e,r,(function(e,r){return t(e,r[0])}))}var Fs=Xi(Ns),zs=Xi(Os);function Us(e){return null==e?[]:Yt(e,Ns(e))}var Ls=$i((function(e,t,r){return t=t.toLowerCase(),e+(r?qs(t):t)}));function qs(e){return Xs(vs(e).toLowerCase())}function Hs(e){return(e=vs(e))&&e.replace(we,nr).replace(et,"")}var Ks=$i((function(e,t,r){return e+(r?"-":"")+t.toLowerCase()})),Js=$i((function(e,t,r){return e+(r?" ":"")+t.toLowerCase()})),Ws=Di("toLowerCase");var Gs=$i((function(e,t,r){return e+(r?"_":"")+t.toLowerCase()}));var Vs=$i((function(e,t,r){return e+(r?" ":"")+Xs(t)}));var Zs=$i((function(e,t,r){return e+(r?" ":"")+t.toUpperCase()})),Xs=Di("toUpperCase");function Qs(e,t,n){return e=vs(e),(t=n?r:t)===r?function(e){return it.test(e)}(e)?function(e){return e.match(rt)||[]}(e):function(e){return e.match(fe)||[]}(e):e.match(t)||[]}var Ys=Xn((function(e,t){try{return xt(e,r,t)}catch(e){return Xa(e)?e:new Se(e)}})),ec=no((function(e,t){return Mt(t,(function(t){t=Bo(t),an(e,t,Ia(e[t],e))})),e}));function tc(e){return function(){return e}}var rc=zi(),nc=zi(!0);function ic(e){return e}function oc(e){return Dn("function"==typeof e?e:un(e,1))}var ac=Xn((function(e,t){return function(r){return Rn(r,e,t)}})),sc=Xn((function(e,t){return function(r){return Rn(e,r,t)}}));function cc(e,t,r){var n=Ns(t),i=En(t,n);null!=r||ts(t)&&(i.length||!n.length)||(r=t,t=e,e=this,i=En(t,Ns(t)));var o=!(ts(r)&&"chain"in r&&!r.chain),a=Qa(e);return Mt(i,(function(r){var n=t[r];e[r]=n,a&&(e.prototype[r]=function(){var t=this.__chain__;if(o||t){var r=e(this.__wrapped__);return(r.__actions__=Ii(this.__actions__)).push({func:n,args:arguments,thisArg:e}),r.__chain__=t,r}return n.apply(e,jt([this.value()],arguments))})})),e}function uc(){}var fc=Hi(Tt),dc=Hi(It),lc=Hi(Bt);function hc(e){return _o(e)?Jt(Bo(e)):function(e){return function(t){return Sn(t,e)}}(e)}var pc=Ji(),mc=Ji(!0);function gc(){return[]}function yc(){return!1}var bc=qi((function(e,t){return e+t}),0),vc=Vi("ceil"),wc=qi((function(e,t){return e/t}),1),Ac=Vi("floor");var _c,Ec=qi((function(e,t){return e*t}),1),Sc=Vi("round"),Pc=qi((function(e,t){return e-t}),0);return zr.after=function(e,t){if("function"!=typeof t)throw new Ie(n);return e=ms(e),function(){if(--e<1)return t.apply(this,arguments)}},zr.ary=Ma,zr.assign=ws,zr.assignIn=As,zr.assignInWith=_s,zr.assignWith=Es,zr.at=Ss,zr.before=Ca,zr.bind=Ia,zr.bindAll=ec,zr.bindKey=Ra,zr.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Ka(e)?e:[e]},zr.chain=ha,zr.chunk=function(e,t,n){t=(n?Ao(e,t,n):t===r)?1:br(ms(t),0);var i=null==e?0:e.length;if(!i||t<1)return[];for(var o=0,a=0,s=ae(mt(i/t));oo?0:o+n),(i=i===r||i>o?o:ms(i))<0&&(i+=o),i=n>i?0:gs(i);n>>0)?(e=vs(e))&&("string"==typeof t||null!=t&&!as(t))&&!(t=fi(t))&&ar(e)?_i(hr(e),0,n):e.split(t,n):[]},zr.spread=function(e,t){if("function"!=typeof e)throw new Ie(n);return t=null==t?0:br(ms(t),0),Xn((function(r){var n=r[t],i=_i(r,0,t);return n&&jt(i,n),xt(e,this,i)}))},zr.tail=function(e){var t=null==e?0:e.length;return t?ii(e,1,t):[]},zr.take=function(e,t,n){return e&&e.length?ii(e,0,(t=n||t===r?1:ms(t))<0?0:t):[]},zr.takeRight=function(e,t,n){var i=null==e?0:e.length;return i?ii(e,(t=i-(t=n||t===r?1:ms(t)))<0?0:t,i):[]},zr.takeRightWhile=function(e,t){return e&&e.length?pi(e,uo(t,3),!1,!0):[]},zr.takeWhile=function(e,t){return e&&e.length?pi(e,uo(t,3)):[]},zr.tap=function(e,t){return t(e),e},zr.throttle=function(e,t,r){var i=!0,o=!0;if("function"!=typeof e)throw new Ie(n);return ts(r)&&(i="leading"in r?!!r.leading:i,o="trailing"in r?!!r.trailing:o),Na(e,t,{leading:i,maxWait:t,trailing:o})},zr.thru=pa,zr.toArray=hs,zr.toPairs=Fs,zr.toPairsIn=zs,zr.toPath=function(e){return Ka(e)?Tt(e,Bo):us(e)?[e]:Ii($o(vs(e)))},zr.toPlainObject=bs,zr.transform=function(e,t,r){var n=Ka(e),i=n||Va(e)||fs(e);if(t=uo(t,4),null==r){var o=e&&e.constructor;r=i?n?new o:[]:ts(e)&&Qa(o)?Ur(We(e)):{}}return(i?Mt:An)(e,(function(e,n,i){return t(r,e,n,i)})),r},zr.unary=function(e){return Ma(e,1)},zr.union=ra,zr.unionBy=na,zr.unionWith=ia,zr.uniq=function(e){return e&&e.length?di(e):[]},zr.uniqBy=function(e,t){return e&&e.length?di(e,uo(t,2)):[]},zr.uniqWith=function(e,t){return t="function"==typeof t?t:r,e&&e.length?di(e,r,t):[]},zr.unset=function(e,t){return null==e||li(e,t)},zr.unzip=oa,zr.unzipWith=aa,zr.update=function(e,t,r){return null==e?e:hi(e,t,vi(r))},zr.updateWith=function(e,t,n,i){return i="function"==typeof i?i:r,null==e?e:hi(e,t,vi(n),i)},zr.values=Us,zr.valuesIn=function(e){return null==e?[]:Yt(e,Os(e))},zr.without=sa,zr.words=Qs,zr.wrap=function(e,t){return Ba(vi(t),e)},zr.xor=ca,zr.xorBy=ua,zr.xorWith=fa,zr.zip=da,zr.zipObject=function(e,t){return yi(e||[],t||[],tn)},zr.zipObjectDeep=function(e,t){return yi(e||[],t||[],ei)},zr.zipWith=la,zr.entries=Fs,zr.entriesIn=zs,zr.extend=As,zr.extendWith=_s,cc(zr,zr),zr.add=bc,zr.attempt=Ys,zr.camelCase=Ls,zr.capitalize=qs,zr.ceil=vc,zr.clamp=function(e,t,n){return n===r&&(n=t,t=r),n!==r&&(n=(n=ys(n))==n?n:0),t!==r&&(t=(t=ys(t))==t?t:0),cn(ys(e),t,n)},zr.clone=function(e){return un(e,4)},zr.cloneDeep=function(e){return un(e,5)},zr.cloneDeepWith=function(e,t){return un(e,5,t="function"==typeof t?t:r)},zr.cloneWith=function(e,t){return un(e,4,t="function"==typeof t?t:r)},zr.conformsTo=function(e,t){return null==t||fn(e,t,Ns(t))},zr.deburr=Hs,zr.defaultTo=function(e,t){return null==e||e!=e?t:e},zr.divide=wc,zr.endsWith=function(e,t,n){e=vs(e),t=fi(t);var i=e.length,o=n=n===r?i:cn(ms(n),0,i);return(n-=t.length)>=0&&e.slice(n,o)==t},zr.eq=Ua,zr.escape=function(e){return(e=vs(e))&&Z.test(e)?e.replace(G,ir):e},zr.escapeRegExp=function(e){return(e=vs(e))&&ie.test(e)?e.replace(ne,"\\$&"):e},zr.every=function(e,t,n){var i=Ka(e)?It:mn;return n&&Ao(e,t,n)&&(t=r),i(e,uo(t,3))},zr.find=ya,zr.findIndex=Ho,zr.findKey=function(e,t){return zt(e,uo(t,3),An)},zr.findLast=ba,zr.findLastIndex=Ko,zr.findLastKey=function(e,t){return zt(e,uo(t,3),_n)},zr.floor=Ac,zr.forEach=va,zr.forEachRight=wa,zr.forIn=function(e,t){return null==e?e:vn(e,uo(t,3),Os)},zr.forInRight=function(e,t){return null==e?e:wn(e,uo(t,3),Os)},zr.forOwn=function(e,t){return e&&An(e,uo(t,3))},zr.forOwnRight=function(e,t){return e&&_n(e,uo(t,3))},zr.get=ks,zr.gt=La,zr.gte=qa,zr.has=function(e,t){return null!=e&&yo(e,t,Mn)},zr.hasIn=Ms,zr.head=Wo,zr.identity=ic,zr.includes=function(e,t,r,n){e=Wa(e)?e:Us(e),r=r&&!n?ms(r):0;var i=e.length;return r<0&&(r=br(i+r,0)),cs(e)?r<=i&&e.indexOf(t,r)>-1:!!i&&Lt(e,t,r)>-1},zr.indexOf=function(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var i=null==r?0:ms(r);return i<0&&(i=br(n+i,0)),Lt(e,t,i)},zr.inRange=function(e,t,n){return t=ps(t),n===r?(n=t,t=0):n=ps(n),function(e,t,r){return e>=vr(t,r)&&e=-9007199254740991&&e<=h},zr.isSet=ss,zr.isString=cs,zr.isSymbol=us,zr.isTypedArray=fs,zr.isUndefined=function(e){return e===r},zr.isWeakMap=function(e){return rs(e)&&go(e)==N},zr.isWeakSet=function(e){return rs(e)&&"[object WeakSet]"==xn(e)},zr.join=function(e,t){return null==e?"":Wt.call(e,t)},zr.kebabCase=Ks,zr.last=Xo,zr.lastIndexOf=function(e,t,n){var i=null==e?0:e.length;if(!i)return-1;var o=i;return n!==r&&(o=(o=ms(n))<0?br(i+o,0):vr(o,i-1)),t==t?function(e,t,r){for(var n=r+1;n--;)if(e[n]===t)return n;return n}(e,t,o):Ut(e,Ht,o,!0)},zr.lowerCase=Js,zr.lowerFirst=Ws,zr.lt=ds,zr.lte=ls,zr.max=function(e){return e&&e.length?gn(e,ic,kn):r},zr.maxBy=function(e,t){return e&&e.length?gn(e,uo(t,2),kn):r},zr.mean=function(e){return Kt(e,ic)},zr.meanBy=function(e,t){return Kt(e,uo(t,2))},zr.min=function(e){return e&&e.length?gn(e,ic,Fn):r},zr.minBy=function(e,t){return e&&e.length?gn(e,uo(t,2),Fn):r},zr.stubArray=gc,zr.stubFalse=yc,zr.stubObject=function(){return{}},zr.stubString=function(){return""},zr.stubTrue=function(){return!0},zr.multiply=Ec,zr.nth=function(e,t){return e&&e.length?Hn(e,ms(t)):r},zr.noConflict=function(){return pt._===this&&(pt._=Ue),this},zr.noop=uc,zr.now=ka,zr.pad=function(e,t,r){e=vs(e);var n=(t=ms(t))?lr(e):0;if(!t||n>=t)return e;var i=(t-n)/2;return Ki(gt(i),r)+e+Ki(mt(i),r)},zr.padEnd=function(e,t,r){e=vs(e);var n=(t=ms(t))?lr(e):0;return t&&nt){var i=e;e=t,t=i}if(n||e%1||t%1){var o=_r();return vr(e+o*(t-e+ft("1e-"+((o+"").length-1))),t)}return Vn(e,t)},zr.reduce=function(e,t,r){var n=Ka(e)?Dt:Gt,i=arguments.length<3;return n(e,uo(t,4),r,i,hn)},zr.reduceRight=function(e,t,r){var n=Ka(e)?$t:Gt,i=arguments.length<3;return n(e,uo(t,4),r,i,pn)},zr.repeat=function(e,t,n){return t=(n?Ao(e,t,n):t===r)?1:ms(t),Zn(vs(e),t)},zr.replace=function(){var e=arguments,t=vs(e[0]);return e.length<3?t:t.replace(e[1],e[2])},zr.result=function(e,t,n){var i=-1,o=(t=wi(t,e)).length;for(o||(o=1,e=r);++ih)return[];var r=m,n=vr(e,m);t=uo(t),e-=m;for(var i=Zt(n,t);++r=a)return e;var c=n-lr(i);if(c<1)return i;var u=s?_i(s,0,c).join(""):e.slice(0,c);if(o===r)return u+i;if(s&&(c+=u.length-c),as(o)){if(e.slice(c).search(o)){var f,d=u;for(o.global||(o=Me(o.source,vs(pe.exec(o))+"g")),o.lastIndex=0;f=o.exec(d);)var l=f.index;u=u.slice(0,l===r?c:l)}}else if(e.indexOf(fi(o),c)!=c){var h=u.lastIndexOf(o);h>-1&&(u=u.slice(0,h))}return u+i},zr.unescape=function(e){return(e=vs(e))&&V.test(e)?e.replace(W,mr):e},zr.uniqueId=function(e){var t=++$e;return vs(e)+t},zr.upperCase=Zs,zr.upperFirst=Xs,zr.each=va,zr.eachRight=wa,zr.first=Wo,cc(zr,(_c={},An(zr,(function(e,t){De.call(zr.prototype,t)||(_c[t]=e)})),_c),{chain:!1}),zr.VERSION="4.17.21",Mt(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){zr[e].placeholder=zr})),Mt(["drop","take"],(function(e,t){Hr.prototype[e]=function(n){n=n===r?1:br(ms(n),0);var i=this.__filtered__&&!t?new Hr(this):this.clone();return i.__filtered__?i.__takeCount__=vr(n,i.__takeCount__):i.__views__.push({size:vr(n,m),type:e+(i.__dir__<0?"Right":"")}),i},Hr.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),Mt(["filter","map","takeWhile"],(function(e,t){var r=t+1,n=1==r||3==r;Hr.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:uo(e,3),type:r}),t.__filtered__=t.__filtered__||n,t}})),Mt(["head","last"],(function(e,t){var r="take"+(t?"Right":"");Hr.prototype[e]=function(){return this[r](1).value()[0]}})),Mt(["initial","tail"],(function(e,t){var r="drop"+(t?"":"Right");Hr.prototype[e]=function(){return this.__filtered__?new Hr(this):this[r](1)}})),Hr.prototype.compact=function(){return this.filter(ic)},Hr.prototype.find=function(e){return this.filter(e).head()},Hr.prototype.findLast=function(e){return this.reverse().find(e)},Hr.prototype.invokeMap=Xn((function(e,t){return"function"==typeof e?new Hr(this):this.map((function(r){return Rn(r,e,t)}))})),Hr.prototype.reject=function(e){return this.filter(Da(uo(e)))},Hr.prototype.slice=function(e,t){e=ms(e);var n=this;return n.__filtered__&&(e>0||t<0)?new Hr(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==r&&(n=(t=ms(t))<0?n.dropRight(-t):n.take(t-e)),n)},Hr.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Hr.prototype.toArray=function(){return this.take(m)},An(Hr.prototype,(function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),i=/^(?:head|last)$/.test(t),o=zr[i?"take"+("last"==t?"Right":""):t],a=i||/^find/.test(t);o&&(zr.prototype[t]=function(){var t=this.__wrapped__,s=i?[1]:arguments,c=t instanceof Hr,u=s[0],f=c||Ka(t),d=function(e){var t=o.apply(zr,jt([e],s));return i&&l?t[0]:t};f&&n&&"function"==typeof u&&1!=u.length&&(c=f=!1);var l=this.__chain__,h=!!this.__actions__.length,p=a&&!l,m=c&&!h;if(!a&&f){t=m?t:new Hr(this);var g=e.apply(t,s);return g.__actions__.push({func:pa,args:[d],thisArg:r}),new qr(g,l)}return p&&m?e.apply(this,s):(g=this.thru(d),p?i?g.value()[0]:g.value():g)})})),Mt(["pop","push","shift","sort","splice","unshift"],(function(e){var t=Re[e],r=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",n=/^(?:pop|shift)$/.test(e);zr.prototype[e]=function(){var e=arguments;if(n&&!this.__chain__){var i=this.value();return t.apply(Ka(i)?i:[],e)}return this[r]((function(r){return t.apply(Ka(r)?r:[],e)}))}})),An(Hr.prototype,(function(e,t){var r=zr[t];if(r){var n=r.name+"";De.call(Rr,n)||(Rr[n]=[]),Rr[n].push({name:t,func:r})}})),Rr[Ui(r,2).name]=[{name:"wrapper",func:r}],Hr.prototype.clone=function(){var e=new Hr(this.__wrapped__);return e.__actions__=Ii(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Ii(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Ii(this.__views__),e},Hr.prototype.reverse=function(){if(this.__filtered__){var e=new Hr(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Hr.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,r=Ka(e),n=t<0,i=r?e.length:0,o=function(e,t,r){var n=-1,i=r.length;for(;++n=this.__values__.length;return{done:e,value:e?r:this.__values__[this.__index__++]}},zr.prototype.plant=function(e){for(var t,n=this;n instanceof Lr;){var i=zo(n);i.__index__=0,i.__values__=r,t?o.__wrapped__=i:t=i;var o=i;n=n.__wrapped__}return o.__wrapped__=e,t},zr.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Hr){var t=e;return this.__actions__.length&&(t=new Hr(this)),(t=t.reverse()).__actions__.push({func:pa,args:[ta],thisArg:r}),new qr(t,this.__chain__)}return this.thru(ta)},zr.prototype.toJSON=zr.prototype.valueOf=zr.prototype.value=function(){return mi(this.__wrapped__,this.__actions__)},zr.prototype.first=zr.prototype.head,Qe&&(zr.prototype[Qe]=function(){return this}),zr}();gt?((gt.exports=gr)._=gr,mt._=gr):pt._=gr}).call(u)}(Xw,Xw.exports);var Qw=f(Xw.exports),Yw={id:"https://spec.openapis.org/oas/3.0/schema/2021-09-28",$schema:"http://json-schema.org/draft-04/schema#",description:"The description of OpenAPI v3.0.x documents, as defined by https://spec.openapis.org/oas/v3.0.3",type:"object",required:["openapi","info","paths"],properties:{openapi:{type:"string",pattern:"^3\\.0\\.\\d(-.+)?$"},info:{$ref:"#/definitions/Info"},externalDocs:{$ref:"#/definitions/ExternalDocumentation"},servers:{type:"array",items:{$ref:"#/definitions/Server"}},security:{type:"array",items:{$ref:"#/definitions/SecurityRequirement"}},tags:{type:"array",items:{$ref:"#/definitions/Tag"},uniqueItems:!0},paths:{$ref:"#/definitions/Paths"},components:{$ref:"#/definitions/Components"}},patternProperties:{"^x-":{}},additionalProperties:!1,definitions:{Reference:{type:"object",required:["$ref"],patternProperties:{"^\\$ref$":{type:"string",format:"uri-reference"}}},Info:{type:"object",required:["title","version"],properties:{title:{type:"string"},description:{type:"string"},termsOfService:{type:"string",format:"uri-reference"},contact:{$ref:"#/definitions/Contact"},license:{$ref:"#/definitions/License"},version:{type:"string"}},patternProperties:{"^x-":{}},additionalProperties:!1},Contact:{type:"object",properties:{name:{type:"string"},url:{type:"string",format:"uri-reference"},email:{type:"string",format:"email"}},patternProperties:{"^x-":{}},additionalProperties:!1},License:{type:"object",required:["name"],properties:{name:{type:"string"},url:{type:"string",format:"uri-reference"}},patternProperties:{"^x-":{}},additionalProperties:!1},Server:{type:"object",required:["url"],properties:{url:{type:"string"},description:{type:"string"},variables:{type:"object",additionalProperties:{$ref:"#/definitions/ServerVariable"}}},patternProperties:{"^x-":{}},additionalProperties:!1},ServerVariable:{type:"object",required:["default"],properties:{enum:{type:"array",items:{type:"string"}},default:{type:"string"},description:{type:"string"}},patternProperties:{"^x-":{}},additionalProperties:!1},Components:{type:"object",properties:{schemas:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]}}},responses:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/Response"}]}}},parameters:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/Parameter"}]}}},examples:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/Example"}]}}},requestBodies:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/RequestBody"}]}}},headers:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/Header"}]}}},securitySchemes:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/SecurityScheme"}]}}},links:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/Link"}]}}},callbacks:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/Callback"}]}}}},patternProperties:{"^x-":{}},additionalProperties:!1},Schema:{type:"object",properties:{title:{type:"string"},multipleOf:{type:"number",minimum:0,exclusiveMinimum:!0},maximum:{type:"number"},exclusiveMaximum:{type:"boolean",default:!1},minimum:{type:"number"},exclusiveMinimum:{type:"boolean",default:!1},maxLength:{type:"integer",minimum:0},minLength:{type:"integer",minimum:0,default:0},pattern:{type:"string",format:"regex"},maxItems:{type:"integer",minimum:0},minItems:{type:"integer",minimum:0,default:0},uniqueItems:{type:"boolean",default:!1},maxProperties:{type:"integer",minimum:0},minProperties:{type:"integer",minimum:0,default:0},required:{type:"array",items:{type:"string"},minItems:1,uniqueItems:!0},enum:{type:"array",items:{},minItems:1,uniqueItems:!1},type:{type:"string",enum:["array","boolean","integer","number","object","string"]},not:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]},allOf:{type:"array",items:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]}},oneOf:{type:"array",items:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]}},anyOf:{type:"array",items:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]}},items:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]},properties:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]}},additionalProperties:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"},{type:"boolean"}],default:!0},description:{type:"string"},format:{type:"string"},default:{},nullable:{type:"boolean",default:!1},discriminator:{$ref:"#/definitions/Discriminator"},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},example:{},externalDocs:{$ref:"#/definitions/ExternalDocumentation"},deprecated:{type:"boolean",default:!1},xml:{$ref:"#/definitions/XML"}},patternProperties:{"^x-":{}},additionalProperties:!1},Discriminator:{type:"object",required:["propertyName"],properties:{propertyName:{type:"string"},mapping:{type:"object",additionalProperties:{type:"string"}}}},XML:{type:"object",properties:{name:{type:"string"},namespace:{type:"string",format:"uri"},prefix:{type:"string"},attribute:{type:"boolean",default:!1},wrapped:{type:"boolean",default:!1}},patternProperties:{"^x-":{}},additionalProperties:!1},Response:{type:"object",required:["description"],properties:{description:{type:"string"},headers:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Header"},{$ref:"#/definitions/Reference"}]}},content:{type:"object",additionalProperties:{$ref:"#/definitions/MediaType"}},links:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Link"},{$ref:"#/definitions/Reference"}]}}},patternProperties:{"^x-":{}},additionalProperties:!1},MediaType:{type:"object",properties:{schema:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]},example:{},examples:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Example"},{$ref:"#/definitions/Reference"}]}},encoding:{type:"object",additionalProperties:{$ref:"#/definitions/Encoding"}}},patternProperties:{"^x-":{}},additionalProperties:!1,allOf:[{$ref:"#/definitions/ExampleXORExamples"}]},Example:{type:"object",properties:{summary:{type:"string"},description:{type:"string"},value:{},externalValue:{type:"string",format:"uri-reference"}},patternProperties:{"^x-":{}},additionalProperties:!1},Header:{type:"object",properties:{description:{type:"string"},required:{type:"boolean",default:!1},deprecated:{type:"boolean",default:!1},allowEmptyValue:{type:"boolean",default:!1},style:{type:"string",enum:["simple"],default:"simple"},explode:{type:"boolean"},allowReserved:{type:"boolean",default:!1},schema:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]},content:{type:"object",additionalProperties:{$ref:"#/definitions/MediaType"},minProperties:1,maxProperties:1},example:{},examples:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Example"},{$ref:"#/definitions/Reference"}]}}},patternProperties:{"^x-":{}},additionalProperties:!1,allOf:[{$ref:"#/definitions/ExampleXORExamples"},{$ref:"#/definitions/SchemaXORContent"}]},Paths:{type:"object",patternProperties:{"^\\/":{$ref:"#/definitions/PathItem"},"^x-":{}},additionalProperties:!1},PathItem:{type:"object",properties:{$ref:{type:"string"},summary:{type:"string"},description:{type:"string"},servers:{type:"array",items:{$ref:"#/definitions/Server"}},parameters:{type:"array",items:{oneOf:[{$ref:"#/definitions/Parameter"},{$ref:"#/definitions/Reference"}]},uniqueItems:!0}},patternProperties:{"^(get|put|post|delete|options|head|patch|trace)$":{$ref:"#/definitions/Operation"},"^x-":{}},additionalProperties:!1},Operation:{type:"object",required:["responses"],properties:{tags:{type:"array",items:{type:"string"}},summary:{type:"string"},description:{type:"string"},externalDocs:{$ref:"#/definitions/ExternalDocumentation"},operationId:{type:"string"},parameters:{type:"array",items:{oneOf:[{$ref:"#/definitions/Parameter"},{$ref:"#/definitions/Reference"}]},uniqueItems:!0},requestBody:{oneOf:[{$ref:"#/definitions/RequestBody"},{$ref:"#/definitions/Reference"}]},responses:{$ref:"#/definitions/Responses"},callbacks:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Callback"},{$ref:"#/definitions/Reference"}]}},deprecated:{type:"boolean",default:!1},security:{type:"array",items:{$ref:"#/definitions/SecurityRequirement"}},servers:{type:"array",items:{$ref:"#/definitions/Server"}}},patternProperties:{"^x-":{}},additionalProperties:!1},Responses:{type:"object",properties:{default:{oneOf:[{$ref:"#/definitions/Response"},{$ref:"#/definitions/Reference"}]}},patternProperties:{"^[1-5](?:\\d{2}|XX)$":{oneOf:[{$ref:"#/definitions/Response"},{$ref:"#/definitions/Reference"}]},"^x-":{}},minProperties:1,additionalProperties:!1},SecurityRequirement:{type:"object",additionalProperties:{type:"array",items:{type:"string"}}},Tag:{type:"object",required:["name"],properties:{name:{type:"string"},description:{type:"string"},externalDocs:{$ref:"#/definitions/ExternalDocumentation"}},patternProperties:{"^x-":{}},additionalProperties:!1},ExternalDocumentation:{type:"object",required:["url"],properties:{description:{type:"string"},url:{type:"string",format:"uri-reference"}},patternProperties:{"^x-":{}},additionalProperties:!1},ExampleXORExamples:{description:"Example and examples are mutually exclusive",not:{required:["example","examples"]}},SchemaXORContent:{description:"Schema and content are mutually exclusive, at least one is required",not:{required:["schema","content"]},oneOf:[{required:["schema"]},{required:["content"],description:"Some properties are not allowed if content is present",allOf:[{not:{required:["style"]}},{not:{required:["explode"]}},{not:{required:["allowReserved"]}},{not:{required:["example"]}},{not:{required:["examples"]}}]}]},Parameter:{type:"object",properties:{name:{type:"string"},in:{type:"string"},description:{type:"string"},required:{type:"boolean",default:!1},deprecated:{type:"boolean",default:!1},allowEmptyValue:{type:"boolean",default:!1},style:{type:"string"},explode:{type:"boolean"},allowReserved:{type:"boolean",default:!1},schema:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]},content:{type:"object",additionalProperties:{$ref:"#/definitions/MediaType"},minProperties:1,maxProperties:1},example:{},examples:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Example"},{$ref:"#/definitions/Reference"}]}}},patternProperties:{"^x-":{}},additionalProperties:!1,required:["name","in"],allOf:[{$ref:"#/definitions/ExampleXORExamples"},{$ref:"#/definitions/SchemaXORContent"},{$ref:"#/definitions/ParameterLocation"}]},ParameterLocation:{description:"Parameter location",oneOf:[{description:"Parameter in path",required:["required"],properties:{in:{enum:["path"]},style:{enum:["matrix","label","simple"],default:"simple"},required:{enum:[!0]}}},{description:"Parameter in query",properties:{in:{enum:["query"]},style:{enum:["form","spaceDelimited","pipeDelimited","deepObject"],default:"form"}}},{description:"Parameter in header",properties:{in:{enum:["header"]},style:{enum:["simple"],default:"simple"}}},{description:"Parameter in cookie",properties:{in:{enum:["cookie"]},style:{enum:["form"],default:"form"}}}]},RequestBody:{type:"object",required:["content"],properties:{description:{type:"string"},content:{type:"object",additionalProperties:{$ref:"#/definitions/MediaType"}},required:{type:"boolean",default:!1}},patternProperties:{"^x-":{}},additionalProperties:!1},SecurityScheme:{oneOf:[{$ref:"#/definitions/APIKeySecurityScheme"},{$ref:"#/definitions/HTTPSecurityScheme"},{$ref:"#/definitions/OAuth2SecurityScheme"},{$ref:"#/definitions/OpenIdConnectSecurityScheme"}]},APIKeySecurityScheme:{type:"object",required:["type","name","in"],properties:{type:{type:"string",enum:["apiKey"]},name:{type:"string"},in:{type:"string",enum:["header","query","cookie"]},description:{type:"string"}},patternProperties:{"^x-":{}},additionalProperties:!1},HTTPSecurityScheme:{type:"object",required:["scheme","type"],properties:{scheme:{type:"string"},bearerFormat:{type:"string"},description:{type:"string"},type:{type:"string",enum:["http"]}},patternProperties:{"^x-":{}},additionalProperties:!1,oneOf:[{description:"Bearer",properties:{scheme:{type:"string",pattern:"^[Bb][Ee][Aa][Rr][Ee][Rr]$"}}},{description:"Non Bearer",not:{required:["bearerFormat"]},properties:{scheme:{not:{type:"string",pattern:"^[Bb][Ee][Aa][Rr][Ee][Rr]$"}}}}]},OAuth2SecurityScheme:{type:"object",required:["type","flows"],properties:{type:{type:"string",enum:["oauth2"]},flows:{$ref:"#/definitions/OAuthFlows"},description:{type:"string"}},patternProperties:{"^x-":{}},additionalProperties:!1},OpenIdConnectSecurityScheme:{type:"object",required:["type","openIdConnectUrl"],properties:{type:{type:"string",enum:["openIdConnect"]},openIdConnectUrl:{type:"string",format:"uri-reference"},description:{type:"string"}},patternProperties:{"^x-":{}},additionalProperties:!1},OAuthFlows:{type:"object",properties:{implicit:{$ref:"#/definitions/ImplicitOAuthFlow"},password:{$ref:"#/definitions/PasswordOAuthFlow"},clientCredentials:{$ref:"#/definitions/ClientCredentialsFlow"},authorizationCode:{$ref:"#/definitions/AuthorizationCodeOAuthFlow"}},patternProperties:{"^x-":{}},additionalProperties:!1},ImplicitOAuthFlow:{type:"object",required:["authorizationUrl","scopes"],properties:{authorizationUrl:{type:"string",format:"uri-reference"},refreshUrl:{type:"string",format:"uri-reference"},scopes:{type:"object",additionalProperties:{type:"string"}}},patternProperties:{"^x-":{}},additionalProperties:!1},PasswordOAuthFlow:{type:"object",required:["tokenUrl","scopes"],properties:{tokenUrl:{type:"string",format:"uri-reference"},refreshUrl:{type:"string",format:"uri-reference"},scopes:{type:"object",additionalProperties:{type:"string"}}},patternProperties:{"^x-":{}},additionalProperties:!1},ClientCredentialsFlow:{type:"object",required:["tokenUrl","scopes"],properties:{tokenUrl:{type:"string",format:"uri-reference"},refreshUrl:{type:"string",format:"uri-reference"},scopes:{type:"object",additionalProperties:{type:"string"}}},patternProperties:{"^x-":{}},additionalProperties:!1},AuthorizationCodeOAuthFlow:{type:"object",required:["authorizationUrl","tokenUrl","scopes"],properties:{authorizationUrl:{type:"string",format:"uri-reference"},tokenUrl:{type:"string",format:"uri-reference"},refreshUrl:{type:"string",format:"uri-reference"},scopes:{type:"object",additionalProperties:{type:"string"}}},patternProperties:{"^x-":{}},additionalProperties:!1},Link:{type:"object",properties:{operationId:{type:"string"},operationRef:{type:"string",format:"uri-reference"},parameters:{type:"object",additionalProperties:{}},requestBody:{},description:{type:"string"},server:{$ref:"#/definitions/Server"}},patternProperties:{"^x-":{}},additionalProperties:!1,not:{description:"Operation Id and Operation Ref are mutually exclusive",required:["operationId","operationRef"]}},Callback:{type:"object",additionalProperties:{$ref:"#/definitions/PathItem"},patternProperties:{"^x-":{}}},Encoding:{type:"object",properties:{contentType:{type:"string"},headers:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Header"},{$ref:"#/definitions/Reference"}]}},style:{type:"string",enum:["form","spaceDelimited","pipeDelimited","deepObject"]},explode:{type:"boolean"},allowReserved:{type:"boolean",default:!1}},additionalProperties:!1}}};function eA(e){if(new Date(e).getTime()>0)return Number(e);throw new an(new Error("invalid timestamp"),["invalid timestamp"])}async function tA(e){const t=[],r=Object.keys(e);(r.length<10||r.length>11)&&t.push(new an(new Error("Invalid agreeemt: "+JSON.stringify(e,void 0,2)),["invalid format"]));for(const n of r){let r;switch(n){case"orig":case"dest":try{e[n]!==await ao(JSON.parse(e[n]),!0)&&t.push(new an(`[dataExchangeAgreeement.${n}] A valid stringified JWK must be provided. For uniqueness, JWK claims must be alphabetically sorted in the stringified JWK. You can use the parseJWK(jwk, true) for that purpose.\n${e[n]}`,["invalid key","invalid format"]))}catch(e){t.push(new an(`[dataExchangeAgreeement.${n}] A valid stringified JWK must be provided. For uniqueness, JWK claims must be alphabetically sorted in the stringified JWK. You can use the parseJWK(jwk, true) for that purpose.`,["invalid key","invalid format"]))}break;case"ledgerContractAddress":case"ledgerSignerAddress":try{r=qh(e[n]),e[n]!==r&&t.push(new an(`[dataExchangeAgreeement.${n}] Invalid EIP-55 address ${e[n]}. Did you mean ${r} instead?`,["invalid EIP-55 address","invalid format"]))}catch(r){t.push(new an(`[dataExchangeAgreeement.${n}] Invalid EIP-55 address ${e[n]}.`,["invalid EIP-55 address","invalid format"]))}break;case"pooToPorDelay":case"pooToPopDelay":case"pooToSecretDelay":try{e[n]!==eA(e[n])&&t.push(new an(`[dataExchangeAgreeement.${n}] < 0 or not a number`,["invalid timestamp","invalid format"]))}catch(e){t.push(new an(`[dataExchangeAgreeement.${n}] < 0 or not a number`,["invalid timestamp","invalid format"]))}break;case"hashAlg":tn.includes(e[n])||t.push(new an(`[dataExchangeAgreeement.${n}Invalid hash algorithm '${e[n]}'. It must be one of: ${tn.join(", ")}`,["invalid algorithm"]));break;case"encAlg":nn.includes(e[n])||t.push(new an(`[dataExchangeAgreeement.${n}Invalid encryption algorithm '${e[n]}'. It must be one of: ${nn.join(", ")}`,["invalid algorithm"]));break;case"signingAlg":rn.includes(e[n])||t.push(new an(`[dataExchangeAgreeement.${n}Invalid signing algorithm '${e[n]}'. It must be one of: ${rn.join(", ")}`,["invalid algorithm"]));break;case"schema":break;default:t.push(new an(new Error(`Property ${n} not allowed in dataAgreement`),["invalid format"]))}}return t}var rA=Object.freeze({__proto__:null,NonRepudiationDest:class{constructor(e,t,r){this.initialized=new Promise(((n,i)=>{this.asyncConstructor(e,t,r).then((()=>{n(!0)})).catch((e=>{i(e)}))}))}async asyncConstructor(e,t,r){const n=await tA(e);if(n.length>0){const e=[];let t=[];throw n.forEach((r=>{e.push(r.message),t=t.concat(r.nrErrors)})),t=[...new Set(t)],new an("Resource has not been validated:\n"+e.join("\n"),t)}this.agreement=e,this.jwkPairDest={privateJwk:t,publicJwk:JSON.parse(e.dest)},this.publicJwkOrig=JSON.parse(e.orig),await Yi(this.jwkPairDest.publicJwk,this.jwkPairDest.privateJwk),this.dltAgent=r;const i=await this.dltAgent.getContractAddress();if(this.agreement.ledgerContractAddress!==i)throw new Error(`Contract address ${i} does not meet agreed one ${this.agreement.ledgerContractAddress}`);this.block={}}async verifyPoO(e,t,r){await this.initialized;const i=n(await so(t,this.agreement.hashAlg),!0,!1),{payload:o}=await Zi(e),a={...this.agreement,cipherblockDgst:i,blockCommitment:o.exchange.blockCommitment,secretCommitment:o.exchange.secretCommitment},s={proofType:"PoO",iss:"orig",exchange:{...a,id:await Hh(a)}},c={timestamp:Date.now(),notBefore:"iat",notAfter:"iat",...r},u=await Jh(e,s,c);return this.block={jwe:t,poo:{jws:e,payload:u.payload}},this.exchange=u.payload.exchange,u}async generatePoR(){if(await this.initialized,void 0===this.exchange||void 0===this.block.poo)throw new Error("Before computing a PoR, you have first to receive a valid cipherblock with a PoO and validate the PoO");const e={proofType:"PoR",iss:"dest",exchange:this.exchange,poo:this.block.poo.jws};return this.block.por=await Kh(e,this.jwkPairDest.privateJwk),this.block.por}async verifyPoP(e,t){if(await this.initialized,void 0===this.exchange||void 0===this.block.por||void 0===this.block.poo)throw new Error("Cannot verify a PoP if not even a PoR have been created");const r={proofType:"PoP",iss:"orig",exchange:this.exchange,por:this.block.por.jws,secret:"",verificationCode:""},n={timestamp:Date.now(),notBefore:"iat",notAfter:1e3*this.block.poo.payload.iat+this.exchange.pooToPopDelay,...t},o=await Jh(e,r,n),s=JSON.parse(o.payload.secret);return this.block.secret={hex:a(i(s.k)),jwk:s},this.block.pop={jws:e,payload:o.payload},o}async getSecretFromLedger(){if(await this.initialized,void 0===this.exchange||void 0===this.block.poo||void 0===this.block.por)throw new Error("Cannot get secret if a PoR has not been sent before");const e=Date.now(),t=1e3*this.block.poo.payload.iat+this.agreement.pooToSecretDelay,r=Math.round((t-e)/1e3),{hex:n,iat:i}=await this.dltAgent.getSecretFromLedger(Xi(this.agreement.encAlg),this.agreement.ledgerSignerAddress,this.exchange.id,r);this.block.secret=await Qi(this.exchange.encAlg,n);try{no(1e3*i,1e3*this.block.por.payload.iat,1e3*this.block.poo.payload.iat+this.exchange.pooToSecretDelay)}catch(e){throw new an(`Although the secret has been obtained (and you could try to decrypt the cipherblock), it's been published later than agreed: ${new Date(1e3*i).toUTCString()} > ${new Date(1e3*this.block.poo.payload.iat+this.agreement.pooToSecretDelay).toUTCString()}`,["secret not published in time"])}return this.block.secret}async decrypt(){if(await this.initialized,void 0===this.exchange)throw new Error("No agreed exchange");if(void 0===this.block.secret?.jwk)throw new Error("Cannot decrypt without the secret");if(void 0===this.block.jwe)throw new Error("No cipherblock to decrypt");const e=(await Vi(this.block.jwe,this.block.secret.jwk)).plaintext;if(n(await so(e,this.agreement.hashAlg),!0,!1)!==this.exchange.blockCommitment)throw new Error("Decrypted block does not meet the committed one");return this.block.raw=e,e}async generateVerificationRequest(){if(await this.initialized,void 0===this.block.por||void 0===this.exchange)throw new Error("Before generating a VerificationRequest, you have first to hold a valid PoR for the exchange");return await Xh("dest",this.exchange.id,this.block.por.jws,this.jwkPairDest.privateJwk)}async generateDisputeRequest(){if(await this.initialized,void 0===this.block.por||void 0===this.block.jwe||void 0===this.exchange)throw new Error("Before generating a VerificationRequest, you have first to hold a valid PoR for the exchange and have received the cipherblock");const e={proofType:"request",iss:"dest",por:this.block.por.jws,type:"disputeRequest",cipherblock:this.block.jwe,iat:Math.floor(Date.now()/1e3),dataExchangeId:this.exchange.id},t=await Wi(this.jwkPairDest.privateJwk);try{return await new Hi(e).setProtectedHeader({alg:this.jwkPairDest.privateJwk.alg}).setIssuedAt(e.iat).sign(t)}catch(e){throw new an(e,["unexpected error"])}}},NonRepudiationOrig:class{constructor(e,t,r,n){this.jwkPairOrig={privateJwk:t,publicJwk:JSON.parse(e.orig)},this.publicJwkDest=JSON.parse(e.dest),this.block={raw:r},this.initialized=new Promise(((t,r)=>{this.init(e,n).then((()=>{t(!0)})).catch((e=>{r(e)}))}))}async init(e,t){const r=await tA(e);if(r.length>0){const e=[];let t=[];throw r.forEach((r=>{e.push(r.message),t=t.concat(r.nrErrors)})),t=[...new Set(t)],new an("Resource has not been validated:\n"+e.join("\n"),t)}this.agreement=e,await Yi(this.jwkPairOrig.publicJwk,this.jwkPairOrig.privateJwk);const i=await Qi(this.agreement.encAlg);this.block={...this.block,secret:i,jwe:await Gi(this.block.raw,i.jwk,this.agreement.encAlg)};const o=n(await so(this.block.jwe,this.agreement.hashAlg),!0,!1),a=n(await so(this.block.raw,this.agreement.hashAlg),!0,!1),c=n(await so(new Uint8Array(s(this.block.secret.hex)),this.agreement.hashAlg),!0,!1),u={...this.agreement,cipherblockDgst:o,blockCommitment:a,secretCommitment:c},f=await Hh(u);this.exchange={...u,id:f},await this._dltSetup(t)}async _dltSetup(e){this.dltAgent=e;const t=await this.dltAgent.getAddress();if(t!==this.exchange.ledgerSignerAddress)throw new Error(`ledgerSignerAddress: ${this.exchange.ledgerSignerAddress} does not meet the address ${t} derived from the provided private key`);const r=await this.dltAgent.getContractAddress();if(r!==oo(this.agreement.ledgerContractAddress,!0))throw new Error(`Contract address in use ${r} does not meet the agreed one ${this.agreement.ledgerContractAddress}`)}async generatePoO(){return await this.initialized,this.block.poo=await Kh({proofType:"PoO",iss:"orig",exchange:this.exchange},this.jwkPairOrig.privateJwk),this.block.poo}async verifyPoR(e,t){if(await this.initialized,void 0===this.block.poo)throw new Error("Cannot verify a PoR if not even a PoO have been created");const r={proofType:"PoR",iss:"dest",exchange:this.exchange,poo:this.block.poo.jws},n=1e3*this.block.poo.payload.iat,i={timestamp:Date.now(),notBefore:n,notAfter:n+this.exchange.pooToPorDelay,...t},o=await Jh(e,r,i);return this.block.por={jws:e,payload:o.payload},this.block.por}async generatePoP(){if(await this.initialized,void 0===this.block.por)throw new Error("Before computing a PoP, you have first to have received and verified the PoR");const e=await this.dltAgent.deploySecret(this.block.secret.hex,this.exchange.id),t={proofType:"PoP",iss:"orig",exchange:this.exchange,por:this.block.por.jws,secret:JSON.stringify(this.block.secret.jwk),verificationCode:e};return this.block.pop=await Kh(t,this.jwkPairOrig.privateJwk),this.block.pop}async generateVerificationRequest(){if(await this.initialized,void 0===this.block.por)throw new Error("Before generating a VerificationRequest, you have first to hold a valid PoR for the exchange");return await Xh("orig",this.exchange.id,this.block.por.jws,this.jwkPairOrig.privateJwk)}}});e.ConflictResolution=Qh,e.ENC_ALGS=nn,e.EthersIoAgentDest=ip,e.EthersIoAgentOrig=Rp,e.HASH_ALGS=tn,e.I3mServerWalletAgentDest=cp,e.I3mServerWalletAgentOrig=Op,e.I3mWalletAgentDest=ap,e.I3mWalletAgentOrig=Np,e.KEY_AGREEMENT_ALGS=on,e.NonRepudiationProtocol=rA,e.NrError=an,e.SIGNING_ALGS=rn,e.Signers=Tp,e.checkTimestamp=no,e.createProof=Kh,e.defaultDltConfig=Yh,e.exchangeId=Hh,e.generateKeys=async function(e,t,r){if(!rn.includes(e))throw new an(new RangeError(`Invalid signature algorithm '${e}''. Allowed algorithms are ${rn.toString()}`),["invalid algorithm"]);let o,a,u;switch(e){case"ES512":a="P-521",o=66;break;case"ES384":a="P-384",o=48;break;default:a="P-256",o=32}u=void 0!==t?"string"==typeof t?!0===r?i(t):new Uint8Array(s(t)):t:new Uint8Array(await c(o));const f=new sn("p"+a.substring(a.length-3)).keyFromPrivate(u),d=f.getPublic(),l=d.getX().toString("hex").padStart(2*o,"0"),h=d.getY().toString("hex").padStart(2*o,"0"),p=f.getPrivate("hex").padStart(2*o,"0"),m={kty:"EC",crv:a,x:n(s(l),!0,!1),y:n(s(h),!0,!1),d:n(s(p),!0,!1),alg:e},g={...m};return delete g.d,{publicJwk:g,privateJwk:m}},e.getDltAddress=function(e){const t=e.match(/^did:ethr:(\w+:)?(0x[0-9a-fA-F]{40}[0-9a-fA-F]{26}?)$/),r=null!==t?t[t.length-1]:e;try{return Mf(r)}catch(e){throw new an("no a DID or a valid public or private key",["invalid format"])}},e.importJwk=Wi,e.jsonSort=io,e.jweDecrypt=Vi,e.jweEncrypt=Gi,e.jwsDecode=Zi,e.oneTimeSecret=Qi,e.parseAddress=qh,e.parseHex=oo,e.parseJwk=ao,e.sha=so,e.validateDataExchange=async function(e){const t=[];try{const{id:r,...n}=e;r!==await Hh(n)&&t.push(new an("Invalid dataExchange id",["cannot verify","invalid format"]));const{blockCommitment:i,secretCommitment:o,cipherblockDgst:a,...s}=n,c=await tA(s);c.length>0&&c.forEach((e=>{t.push(e)}))}catch(e){t.push(new an("Invalid dataExchange",["cannot verify","invalid format"]))}return t},e.validateDataExchangeAgreement=tA,e.validateDataSharingAgreementSchema=async function(e){const t=[],r=new pw({strictSchema:!1,removeAdditional:"all"});r.addMetaSchema(Yw),Zw(r);const n=jp.schemas.DataSharingAgreement;try{const i=r.compile(n),o=Qw.cloneDeep(e);i(e)||null!==i.errors&&void 0!==i.errors&&i.errors.length>0&&i.errors.forEach((e=>{t.push(new an(`[${e.instancePath}] ${e.message??"unknown"}`,["invalid format"]))})),ro(o)!==ro(e)&&t.push(new an("Additional claims beyond the schema are not supported",["invalid format"]))}catch(e){t.push(new an(e,["invalid format"]))}return t},e.verifyKeyPair=Yi,e.verifyProof=Jh})); diff --git a/dist/index.browser.esm.js b/dist/index.browser.esm.js index be4fe75..1b02f47 100644 --- a/dist/index.browser.esm.js +++ b/dist/index.browser.esm.js @@ -1,2 +1,2 @@ -import*as e from"@juanelas/base64";import{decode as t}from"@juanelas/base64";import{hexToBuf as i,parseHex as r,bufToHex as a}from"bigint-conversion";import{randBytes as n,randBytesSync as o}from"bigint-crypto-utils";import s from"elliptic";import{importJWK as p,CompactEncrypt as d,decodeProtectedHeader as c,compactDecrypt as l,jwtVerify as f,generateSecret as y,exportJWK as m,GeneralSign as g,generalVerify as u,SignJWT as h}from"jose";import{hashable as b}from"object-sha";import{ethers as w,Wallet as x}from"ethers";import{SigningKey as P}from"ethers/lib/utils";import A from"ajv-draft-04";import v from"ajv-formats";import S from"lodash";const k=["SHA-256","SHA-384","SHA-512"],E=["ES256","ES384","ES512"],j=["A128GCM","A256GCM"],D=["ECDH-ES"];class C extends Error{constructor(e,t){super(e),e instanceof C?(this.nrErrors=e.nrErrors,this.add(...t)):this.nrErrors=t}add(...e){const t=this.nrErrors.concat(e);this.nrErrors=[...new Set(t)]}}const{ec:$}=s;async function q(t,r,a){if(!E.includes(t))throw new C(new RangeError(`Invalid signature algorithm '${t}''. Allowed algorithms are ${E.toString()}`),["invalid algorithm"]);let o,s,p;switch(t){case"ES512":s="P-521",o=66;break;case"ES384":s="P-384",o=48;break;default:s="P-256",o=32}p=void 0!==r?"string"==typeof r?!0===a?e.decode(r):new Uint8Array(i(r)):r:new Uint8Array(await n(o));const d=new $("p"+s.substring(s.length-3)).keyFromPrivate(p),c=d.getPublic(),l=c.getX().toString("hex").padStart(2*o,"0"),f=c.getY().toString("hex").padStart(2*o,"0"),y=d.getPrivate("hex").padStart(2*o,"0"),m={kty:"EC",crv:s,x:e.encode(i(l),!0,!1),y:e.encode(i(f),!0,!1),d:e.encode(i(y),!0,!1),alg:t},g={...m};return delete g.d,{publicJwk:g,privateJwk:m}}async function R(e,t){const i=void 0===t?e.alg:t,r=j.concat(E).concat(D);if(!r.includes(i))throw new C("invalid alg. Must be one of: "+r.join(","),["invalid algorithm"]);try{const i=await p(e,t);if(null==i)throw new C(new Error("failed importing keys"),["invalid key"]);return i}catch(e){throw new C(e,["invalid key"])}}async function O(e,t,i){let r,a;const n={...t};if(j.includes(t.alg))r="dir",a=void 0!==i?i:t.alg;else{if(!E.concat(D).includes(t.alg))throw new C(`Not a valid symmetric or assymetric alg: ${t.alg}`,["encryption failed","invalid key","invalid algorithm"]);if(void 0===i)throw new C("An encryption algorith encAlg for content encryption should be provided. Allowed values are: "+j.join(","),["encryption failed"]);a=i,r="ECDH-ES",n.alg=r}const o=await R(n);let s;try{return s=await new d(e).setProtectedHeader({alg:r,enc:a,kid:t.kid}).encrypt(o),s}catch(e){throw new C(e,["encryption failed"])}}async function J(e,t){try{const i={...t},{alg:r,enc:a}=c(e);if(void 0===r||void 0===a)throw new C("missing enc or alg in jwe header",["invalid format"]);"ECDH-ES"===r&&(i.alg=r);const n=await R(i);return await l(e,n,{contentEncryptionAlgorithms:[a]})}catch(e){throw new C(e,["decryption failed"])}}async function I(t,i){const r=t.match(/^([a-zA-Z0-9_-]+)\.{1,2}([a-zA-Z0-9_-]+)\.([a-zA-Z0-9_-]+)$/);if(null===r)throw new C(new Error(`${t} is not a JWS`),["not a compact jws"]);let a,n;try{a=JSON.parse(e.decode(r[1],!0)),n=JSON.parse(e.decode(r[2],!0))}catch(e){throw new C(e,["invalid format","not a compact jws"])}if(void 0!==i){const e="function"==typeof i?await i(a,n):i,r=await R(e);try{const i=await f(t,r);return{header:i.protectedHeader,payload:i.payload,signer:e}}catch(e){throw new C(e,["jws verification failed"])}}return{header:a,payload:n}}function T(e){if(j.concat(k).concat(E).includes(e))return Number(e.match(/\d{3}/)[0])/8;throw new C("unsupported algorithm",["invalid algorithm"])}async function F(n,o,s){let p;if(!j.includes(n))throw new C(new Error(`Invalid encAlg '${n}'. Supported values are: ${j.toString()}`),["invalid algorithm"]);const d=T(n);if(void 0!==o){if("string"==typeof o)if(!0===s)p=e.decode(o);else{const e=r(o,!1);if(e!==r(o,!1,d))throw new C(new RangeError(`Expected hex length ${2*d} does not meet provided one ${e.length/2}`),["invalid key"]);p=new Uint8Array(i(o))}else p=o;if(p.length!==d)throw new C(new RangeError(`Expected secret length ${d} does not meet provided one ${p.length}`),["invalid key"])}else try{p=await y(n,{extractable:!0})}catch(e){throw new C(e,["unexpected error"])}const c=await m(p);return c.alg=n,{jwk:c,hex:a(t(c.k),!1,d)}}async function z(e,t){if(void 0===e.alg||void 0===t.alg||e.alg!==t.alg)throw new Error("alg no present in either pubJwk or privJwk, or pubJWK.alg != privJWK.alg");const i=await R(e),r=await R(t);try{const e=await n(16),a=await new g(e).addSignature(r).setProtectedHeader({alg:t.alg}).sign();await u(a,i)}catch(e){throw new C(e,["unexpected error"])}}function _(e,t,i,r=2e3){if(ei+r)throw new C(new Error(`timestamp ${new Date(e).toTimeString()} after 'notAfter' ${new Date(i).toTimeString()} with tolerance of ${r/1e3}s`),["invalid timestamp"])}function M(e){return Array.isArray(e)?e.sort().map(M):(t=e,"[object Object]"===Object.prototype.toString.call(t)?Object.keys(e).sort().reduce((function(t,i){return t[i]=M(e[i]),t}),{}):e);var t}function W(e,t=!1,i){try{return r(e,t,i)}catch(e){throw new C(e,["invalid format"])}}async function N(e,t){try{await R(e,e.alg);const i=M(e);return t?JSON.stringify(i):i}catch(e){throw new C(e,["invalid key"])}}async function H(e,t){const i=k;if(!i.includes(t))throw new C(new RangeError(`Valid hash algorith values are any of ${JSON.stringify(i)}`),["invalid algorithm"]);const r=new TextEncoder,a="string"==typeof e?r.encode(e).buffer:e;try{let e;return e=new Uint8Array(await crypto.subtle.digest(t,a)),e}catch(e){throw new C(e,["unexpected error"])}}function K(e){if(null==e.match(/^(0x)?([\da-fA-F]{40})$/))throw new RangeError("incorrect address format");try{const t=W(e,!0,20);return w.utils.getAddress(t)}catch(e){throw new C(e,["invalid EIP-55 address"])}}function V(e){const t=e.match(/^did:ethr:(\w+:)?(0x[0-9a-fA-F]{40}[0-9a-fA-F]{26}?)$/),i=null!==t?t[t.length-1]:e;try{return w.utils.computeAddress(i)}catch(e){throw new C("no a DID or a valid public or private key",["invalid format"])}}async function B(t){return e.encode(await H(b(t),"SHA-256"),!0,!1)}async function G(e,t){if(void 0===e.iss)throw new Error('Payload iss should be set to either "orig" or "dest"');const i=JSON.parse(e.exchange[e.iss]);await z(i,t);const r=await R(t),a=t.alg,n={...e,iat:Math.floor(Date.now()/1e3)};return{jws:await new h(n).setProtectedHeader({alg:a}).setIssuedAt(n.iat).sign(r),payload:n}}async function Z(e,t,i){const r=JSON.parse(t.exchange[t.iss]),a=await I(e,r);if(void 0===a.payload.iss)throw new Error('Property "iss" missing');if(void 0===a.payload.iat)throw new Error("Property claim iat missing");if(void 0!==i){_("iat"===i.timestamp?1e3*a.payload.iat:i.timestamp,"iat"===i.notBefore?1e3*a.payload.iat:i.notBefore,"iat"===i.notAfter?1e3*a.payload.iat:i.notAfter,i.tolerance)}const n=a.payload,o=n.exchange[n.iss];if(b(r)!==b(JSON.parse(o)))throw new Error(`The proof is issued by ${o} instead of ${JSON.stringify(r)}`);const s=t;for(const e in s){if(void 0===n[e])throw new Error(`Expected key '${e}' not found in proof`);if("exchange"===e){const e=t.exchange;X(n.exchange,e)}else if(""!==s[e]&&b(s[e])!==b(n[e]))throw new Error(`Proof's ${e}: ${JSON.stringify(n[e],void 0,2)} does not meet provided value ${JSON.stringify(s[e],void 0,2)}`)}return a}function X(e,t){const i=["id","orig","dest","hashAlg","cipherblockDgst","blockCommitment","blockCommitment","secretCommitment","schema"];for(const t of i)if("schema"!==t&&(void 0===e[t]||""===e[t]))throw new Error(`${t} is missing on dataExchange.\ndataExchange: ${JSON.stringify(e,void 0,2)}`);for(const i in t)if(""!==t[i]&&b(t[i])!==b(e[i]))throw new Error(`dataExchange's ${i}: ${JSON.stringify(e[i],void 0,2)} does not meet expected value ${JSON.stringify(t[i],void 0,2)}`)}async function L(e,t,i=10){const{payload:r}=await I(e),a=r.exchange,n={...a};delete n.id;if(await B(n)!==a.id)throw new C(new Error("data exchange integrity failed"),["dataExchange integrity violated"]);const o=JSON.parse(a.dest),s=JSON.parse(a.orig);let p,d,c;try{p=(await Z(r.poo,{iss:"orig",proofType:"PoO",exchange:a})).payload}catch(e){throw new C(e,["invalid poo"])}try{await Z(e,{iss:"dest",proofType:"PoR",exchange:a},{timestamp:"iat",notBefore:1e3*p.iat,notAfter:1e3*p.iat+a.pooToPorDelay})}catch(e){throw new C(e,["invalid por"])}try{const e=await t.getSecretFromLedger(T(a.encAlg),a.ledgerSignerAddress,a.id,i);d=e.hex,c=e.iat}catch(e){throw new C(e,["cannot verify"])}try{_(1e3*c,1e3*r.iat,1e3*p.iat+a.pooToSecretDelay)}catch(e){throw new C(`Although the secret has been obtained (and you could try to decrypt the cipherblock), it's been published later than agreed: ${new Date(1e3*c).toUTCString()} > ${new Date(1e3*p.iat+a.pooToSecretDelay).toUTCString()}`,["secret not published in time"])}return{pooPayload:p,porPayload:r,secretHex:d,destPublicJwk:o,origPublicJwk:s}}async function U(e,t,i=10){let r,a,n,o,s;try{r=(await I(e)).payload}catch(e){throw new C(e,["invalid verification request"])}try{const e=await L(r.por,t,i);a=e.destPublicJwk,n=e.origPublicJwk,o=e.pooPayload,s=e.porPayload}catch(e){throw new C(e,["invalid por","invalid verification request"])}try{await I(e,"dest"===r.iss?a:n)}catch(e){throw new C(e,["invalid verification request"])}return{pooPayload:o,porPayload:s,vrPayload:r,destPublicJwk:a,origPublicJwk:n}}async function Y(t,i){const{payload:r}=await I(t),{destPublicJwk:a,origPublicJwk:n,secretHex:o,pooPayload:s,porPayload:p}=await L(r.por,i);try{await I(t,a)}catch(e){throw e instanceof C&&e.add("invalid dispute request"),e}if(e.encode(await H(r.cipherblock,p.exchange.hashAlg),!0,!1)!==p.exchange.cipherblockDgst)throw new C(new Error("cipherblock does not meet the committed (and already accepted) one"),["invalid dispute request"]);return await J(r.cipherblock,(await F(p.exchange.encAlg,o)).jwk),{pooPayload:s,porPayload:p,drPayload:r,destPublicJwk:a,origPublicJwk:n}}async function Q(e,t,i,r){const a={proofType:"request",iss:e,dataExchangeId:t,por:i,type:"verificationRequest",iat:Math.floor(Date.now()/1e3)},n=await p(r);return await new h(a).setProtectedHeader({alg:r.alg}).setIssuedAt(a.iat).sign(n)}var ee=Object.freeze({__proto__:null,ConflictResolver:class{constructor(e,t){this.jwkPair=e,this.dltAgent=t,this.initialized=new Promise(((e,t)=>{this.init().then((()=>{e(!0)})).catch((e=>{t(e)}))}))}async init(){await z(this.jwkPair.publicJwk,this.jwkPair.privateJwk)}async resolveCompleteness(e){await this.initialized;const{payload:t}=await I(e);let i;try{i=(await I(t.por)).payload}catch(e){throw new C(e,["invalid por"])}const r={...await this._resolution(t.dataExchangeId,i.exchange[t.iss]),resolution:"not completed",type:"verification"};try{await U(e,this.dltAgent),r.resolution="completed"}catch(e){if(!(e instanceof C)||e.nrErrors.includes("invalid verification request")||e.nrErrors.includes("unexpected error"))throw e}const a=await p(this.jwkPair.privateJwk);return await new h(r).setProtectedHeader({alg:this.jwkPair.privateJwk.alg}).setIssuedAt(r.iat).sign(a)}async resolveDispute(e){await this.initialized;const{payload:t}=await I(e);let i;try{i=(await I(t.por)).payload}catch(e){throw new C(e,["invalid por"])}const r={...await this._resolution(t.dataExchangeId,i.exchange[t.iss]),resolution:"denied",type:"dispute"};try{await Y(e,this.dltAgent)}catch(e){if(!(e instanceof C&&e.nrErrors.includes("decryption failed")))throw new C(e,["cannot verify"]);r.resolution="accepted"}const a=await p(this.jwkPair.privateJwk);return await new h(r).setProtectedHeader({alg:this.jwkPair.privateJwk.alg}).setIssuedAt(r.iat).sign(a)}async _resolution(e,t){return{proofType:"resolution",dataExchangeId:e,iat:Math.floor(Date.now()/1e3),iss:await N(this.jwkPair.publicJwk,!0),sub:t}}},checkCompleteness:U,checkDecryption:Y,generateVerificationRequest:Q,verifyPor:L,verifyResolution:async function(e,t){return await I(e,t??((e,t)=>JSON.parse(t.iss)))}});const te={gasLimit:125e5,contract:{address:"0x8d407A1722633bDD1dcf221474be7a44C05d7c2F",abi:[{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"sender",type:"address"},{indexed:!1,internalType:"uint256",name:"dataExchangeId",type:"uint256"},{indexed:!1,internalType:"uint256",name:"timestamp",type:"uint256"},{indexed:!1,internalType:"uint256",name:"secret",type:"uint256"}],name:"Registration",type:"event"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"uint256",name:"",type:"uint256"}],name:"registry",outputs:[{internalType:"uint256",name:"timestamp",type:"uint256"},{internalType:"uint256",name:"secret",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"_dataExchangeId",type:"uint256"},{internalType:"uint256",name:"_secret",type:"uint256"}],name:"setRegistry",outputs:[],stateMutability:"nonpayable",type:"function"}],transactionHash:"0x6a3828f8fe232819dc40ca66f93930b3bd1619db31a67ec34b44446b3e7c8289",receipt:{to:null,from:"0x17bd12C2134AfC1f6E9302a532eFE30C19B9E903",contractAddress:"0x8d407A1722633bDD1dcf221474be7a44C05d7c2F",transactionIndex:0,gasUsed:"253928",logsBloom:"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",blockHash:"0x0118672bb9b27679e616831d056d36291dd20cfe88c3ee2abd8f2dfce579cad4",transactionHash:"0x6a3828f8fe232819dc40ca66f93930b3bd1619db31a67ec34b44446b3e7c8289",logs:[],blockNumber:119389,cumulativeGasUsed:"253928",status:1,byzantium:!0},args:[],solcInputHash:"c528a37588793ef74285d75e08d6b8eb",metadata:'{"compiler":{"version":"0.8.4+commit.c7e474f2"},"language":"Solidity","output":{"abi":[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"dataExchangeId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"secret","type":"uint256"}],"name":"Registration","type":"event"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"registry","outputs":[{"internalType":"uint256","name":"timestamp","type":"uint256"},{"internalType":"uint256","name":"secret","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_dataExchangeId","type":"uint256"},{"internalType":"uint256","name":"_secret","type":"uint256"}],"name":"setRegistry","outputs":[],"stateMutability":"nonpayable","type":"function"}],"devdoc":{"kind":"dev","methods":{},"version":1},"userdoc":{"kind":"user","methods":{},"version":1}},"settings":{"compilationTarget":{"contracts/NonRepudiation.sol":"NonRepudiation"},"evmVersion":"istanbul","libraries":{},"metadata":{"bytecodeHash":"ipfs","useLiteralContent":true},"optimizer":{"enabled":false,"runs":200},"remappings":[]},"sources":{"contracts/NonRepudiation.sol":{"content":"//SPDX-License-Identifier: Unlicense\\npragma solidity ^0.8.0;\\n\\ncontract NonRepudiation {\\n struct Proof {\\n uint256 timestamp;\\n uint256 secret;\\n }\\n mapping(address => mapping (uint256 => Proof)) public registry;\\n event Registration(address sender, uint256 dataExchangeId, uint256 timestamp, uint256 secret);\\n\\n function setRegistry(uint256 _dataExchangeId, uint256 _secret) public {\\n require(registry[msg.sender][_dataExchangeId].secret == 0);\\n registry[msg.sender][_dataExchangeId] = Proof(block.timestamp, _secret);\\n emit Registration(msg.sender, _dataExchangeId, block.timestamp, _secret);\\n }\\n}\\n","keccak256":"0x8d371257a9b03c9102f158323e61f56ce49dd8489bd92c5a7d8abc3d9f6f8399","license":"Unlicense"}},"version":1}',bytecode:"0x608060405234801561001057600080fd5b506103a2806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c8063032439371461003b578063d05cb54514610057575b600080fd5b6100556004803603810190610050919061023a565b610088565b005b610071600480360381019061006c91906101fe565b6101a3565b60405161007f9291906102d9565b60405180910390f35b60008060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002060010154146100e757600080fd5b6040518060400160405280428152602001828152506000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002060008201518160000155602082015181600101559050507faa58599838af2e5e0f3251cfbb4eac5d5d447ded49f6b0ac28d6b44098224e63338342846040516101979493929190610294565b60405180910390a15050565b6000602052816000526040600020602052806000526040600020600091509150508060000154908060010154905082565b6000813590506101e38161033e565b92915050565b6000813590506101f881610355565b92915050565b6000806040838503121561021157600080fd5b600061021f858286016101d4565b9250506020610230858286016101e9565b9150509250929050565b6000806040838503121561024d57600080fd5b600061025b858286016101e9565b925050602061026c858286016101e9565b9150509250929050565b61027f81610302565b82525050565b61028e81610334565b82525050565b60006080820190506102a96000830187610276565b6102b66020830186610285565b6102c36040830185610285565b6102d06060830184610285565b95945050505050565b60006040820190506102ee6000830185610285565b6102fb6020830184610285565b9392505050565b600061030d82610314565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b61034781610302565b811461035257600080fd5b50565b61035e81610334565b811461036957600080fd5b5056fea26469706673582212204fd0fc653fb487221da9a14a4ca5d5499f9e9bc7b27ac8ab0f8d397fd6e3148564736f6c63430008040033",deployedBytecode:"0x608060405234801561001057600080fd5b50600436106100365760003560e01c8063032439371461003b578063d05cb54514610057575b600080fd5b6100556004803603810190610050919061023a565b610088565b005b610071600480360381019061006c91906101fe565b6101a3565b60405161007f9291906102d9565b60405180910390f35b60008060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002060010154146100e757600080fd5b6040518060400160405280428152602001828152506000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002060008201518160000155602082015181600101559050507faa58599838af2e5e0f3251cfbb4eac5d5d447ded49f6b0ac28d6b44098224e63338342846040516101979493929190610294565b60405180910390a15050565b6000602052816000526040600020602052806000526040600020600091509150508060000154908060010154905082565b6000813590506101e38161033e565b92915050565b6000813590506101f881610355565b92915050565b6000806040838503121561021157600080fd5b600061021f858286016101d4565b9250506020610230858286016101e9565b9150509250929050565b6000806040838503121561024d57600080fd5b600061025b858286016101e9565b925050602061026c858286016101e9565b9150509250929050565b61027f81610302565b82525050565b61028e81610334565b82525050565b60006080820190506102a96000830187610276565b6102b66020830186610285565b6102c36040830185610285565b6102d06060830184610285565b95945050505050565b60006040820190506102ee6000830185610285565b6102fb6020830184610285565b9392505050565b600061030d82610314565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b61034781610302565b811461035257600080fd5b50565b61035e81610334565b811461036957600080fd5b5056fea26469706673582212204fd0fc653fb487221da9a14a4ca5d5499f9e9bc7b27ac8ab0f8d397fd6e3148564736f6c63430008040033",devdoc:{kind:"dev",methods:{},version:1},userdoc:{kind:"user",methods:{},version:1},storageLayout:{storage:[{astId:13,contract:"contracts/NonRepudiation.sol:NonRepudiation",label:"registry",offset:0,slot:"0",type:"t_mapping(t_address,t_mapping(t_uint256,t_struct(Proof)6_storage))"}],types:{t_address:{encoding:"inplace",label:"address",numberOfBytes:"20"},"t_mapping(t_address,t_mapping(t_uint256,t_struct(Proof)6_storage))":{encoding:"mapping",key:"t_address",label:"mapping(address => mapping(uint256 => struct NonRepudiation.Proof))",numberOfBytes:"32",value:"t_mapping(t_uint256,t_struct(Proof)6_storage)"},"t_mapping(t_uint256,t_struct(Proof)6_storage)":{encoding:"mapping",key:"t_uint256",label:"mapping(uint256 => struct NonRepudiation.Proof)",numberOfBytes:"32",value:"t_struct(Proof)6_storage"},"t_struct(Proof)6_storage":{encoding:"inplace",label:"struct NonRepudiation.Proof",members:[{astId:3,contract:"contracts/NonRepudiation.sol:NonRepudiation",label:"timestamp",offset:0,slot:"0",type:"t_uint256"},{astId:5,contract:"contracts/NonRepudiation.sol:NonRepudiation",label:"secret",offset:0,slot:"1",type:"t_uint256"}],numberOfBytes:"64"},t_uint256:{encoding:"inplace",label:"uint256",numberOfBytes:"32"}}}}};async function ie(t,i,r,n,o){let s=w.BigNumber.from(0),p=w.BigNumber.from(0);const d=W(a(e.decode(r)),!0);let c=0;do{try{({secret:s,timestamp:p}=await t.registry(W(i,!0),d))}catch(e){throw new C(e,["cannot contact the ledger"])}s.isZero()&&(c++,await new Promise((e=>setTimeout(e,1e3))))}while(s.isZero()&&c{null!==e&&"object"==typeof e&&"function"==typeof e.then?e.then((e=>{this.dltConfig={...te,...e},this.provider=new w.providers.JsonRpcProvider(this.dltConfig.rpcProviderUrl),this.contract=new w.Contract(this.dltConfig.contract.address,this.dltConfig.contract.abi,this.provider),t(!0)})).catch((e=>i(e))):(this.dltConfig={...te,...e},this.provider=new w.providers.JsonRpcProvider(this.dltConfig.rpcProviderUrl),this.contract=new w.Contract(this.dltConfig.contract.address,this.dltConfig.contract.abi,this.provider),t(!0))}))}async getContractAddress(){return await this.initialized,this.contract.address}}class oe extends ne{async getSecretFromLedger(e,t,i,r){return await this.initialized,await ie(this.contract,t,i,r,e)}}class se extends ne{constructor(e,t,i){super(new Promise(((t,r)=>{e.providerinfo.get().then((e=>{const a=e.rpcUrl;void 0===a?r(new Error("wallet is not connected to RPC endpoint")):t({...i,rpcProviderUrl:"string"==typeof a?a:a[0]})})).catch((e=>{r(e)}))}))),this.wallet=e,this.did=t}}class pe extends se{async getSecretFromLedger(e,t,i,r){return await this.initialized,await ie(this.contract,t,i,r,e)}}class de extends ne{constructor(e,t,i){super(new Promise(((t,r)=>{e.providerinfoGet().then((e=>{const a=e.rpcUrl;void 0===a?r(new Error("wallet is not connected to RPC endpoint")):t({...i,rpcProviderUrl:"string"==typeof a?a:a[0]})})).catch((e=>{r(e)}))}))),this.wallet=e,this.did=t}}class ce extends de{async getSecretFromLedger(e,t,i,r){return await this.initialized,await ie(this.contract,t,i,r,e)}}class le extends ne{constructor(e,t){let r;super(e),this.count=-1,r=void 0===t?o(32):"string"==typeof t?new Uint8Array(i(t)):t;const a=new P(r);this.signer=new x(a,this.provider)}async deploySecret(e,t){await this.initialized;const i=await re(e,t,this),r=await this.signer.signTransaction(i),a=await this.signer.provider.sendTransaction(r);return this.count=this.count+1,a.hash}async getAddress(){return await this.initialized,this.signer.address}async nextNonce(){await this.initialized;const e=await this.provider.getTransactionCount(await this.getAddress(),"pending");return e>this.count&&(this.count=e),this.count}}class fe extends se{constructor(){super(...arguments),this.count=-1}async deploySecret(e,t){await this.initialized;const i=await re(e,t,this),r=(await this.wallet.identities.sign({did:this.did},{type:"Transaction",data:i})).signature,a=await this.provider.sendTransaction(r);return this.count=this.count+1,a.hash}async getAddress(){await this.initialized;const e=await this.wallet.identities.info({did:this.did});if(void 0===e.addresses)throw new C(new Error("no addresses for did "+this.did),["unexpected error"]);return e.addresses[0]}async nextNonce(){await this.initialized;const e=await this.provider.getTransactionCount(await this.getAddress(),"pending");return e>this.count&&(this.count=e),this.count}}class ye extends de{constructor(){super(...arguments),this.count=-1}async deploySecret(e,t){await this.initialized;const i=await re(e,t,this),r=(await this.wallet.identitySign({did:this.did},{type:"Transaction",data:i})).signature,a=await this.provider.sendTransaction(r);return this.count=this.count+1,a.hash}async getAddress(){await this.initialized;const e=await this.wallet.identityInfo({did:this.did});if(void 0===e.addresses)throw new C(`Can't get address for did: ${this.did}`,["unexpected error"]);return e.addresses[0]}async nextNonce(){await this.initialized;const e=await this.provider.getTransactionCount(await this.getAddress(),"pending");return e>this.count&&(this.count=e),this.count}}var me=Object.freeze({__proto__:null,EthersIoAgentDest:oe,EthersIoAgentOrig:le,I3mServerWalletAgentDest:ce,I3mServerWalletAgentOrig:ye,I3mWalletAgentDest:pe,I3mWalletAgentOrig:fe}),ge={schemas:{IdentitySelectOutput:{title:"IdentitySelectOutput",type:"object",properties:{did:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},required:["did"]},SignInput:{title:"SignInput",oneOf:[{title:"SignTransaction",type:"object",properties:{type:{enum:["Transaction"]},data:{title:"Transaction",type:"object",additionalProperties:!0,properties:{from:{type:"string"},to:{type:"string"},nonce:{type:"number"}}}},required:["type","data"]},{title:"SignRaw",type:"object",properties:{type:{enum:["Raw"]},data:{type:"object",properties:{payload:{description:"Base64Url encoded data to sign",type:"string",pattern:"^[A-Za-z0-9_-]+$"}},required:["payload"]}},required:["type","data"]},{title:"SignJWT",type:"object",properties:{type:{enum:["JWT"]},data:{type:"object",properties:{header:{description:'header fields to be added to the JWS header. "alg" and "kid" will be ignored since they are automatically added by the wallet.',type:"object",additionalProperties:!0},payload:{description:"A JSON object to be signed by the wallet. It will become the payload of the generated JWS. 'iss' (issuer) and 'iat' (issued at) will be automatically added by the wallet and will override provided values.",type:"object",additionalProperties:!0}},required:["payload"]}},required:["type","data"]}]},SignRaw:{title:"SignRaw",type:"object",properties:{type:{enum:["Raw"]},data:{type:"object",properties:{payload:{description:"Base64Url encoded data to sign",type:"string",pattern:"^[A-Za-z0-9_-]+$"}},required:["payload"]}},required:["type","data"]},SignTransaction:{title:"SignTransaction",type:"object",properties:{type:{enum:["Transaction"]},data:{title:"Transaction",type:"object",additionalProperties:!0,properties:{from:{type:"string"},to:{type:"string"},nonce:{type:"number"}}}},required:["type","data"]},SignJWT:{title:"SignJWT",type:"object",properties:{type:{enum:["JWT"]},data:{type:"object",properties:{header:{description:'header fields to be added to the JWS header. "alg" and "kid" will be ignored since they are automatically added by the wallet.',type:"object",additionalProperties:!0},payload:{description:"A JSON object to be signed by the wallet. It will become the payload of the generated JWS. 'iss' (issuer) and 'iat' (issued at) will be automatically added by the wallet and will override provided values.",type:"object",additionalProperties:!0}},required:["payload"]}},required:["type","data"]},Transaction:{title:"Transaction",type:"object",additionalProperties:!0,properties:{from:{type:"string"},to:{type:"string"},nonce:{type:"number"}}},SignOutput:{title:"SignOutput",type:"object",properties:{signature:{type:"string"}},required:["signature"]},Receipt:{title:"Receipt",type:"object",properties:{receipt:{type:"string"}},required:["receipt"]},SignTypes:{title:"SignTypes",type:"string",enum:["Transaction","Raw","JWT"]},IdentityListInput:{title:"IdentityListInput",description:"A list of DIDs",type:"array",items:{type:"object",properties:{did:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},required:["did"]}},IdentityCreateInput:{title:"IdentityCreateInput",description:'Besides the here defined options, provider specific properties should be added here if necessary, e.g. "path" for BIP21 wallets, or the key algorithm (if the wallet supports multiple algorithm).\n',type:"object",properties:{alias:{type:"string"}},additionalProperties:!0},IdentityCreateOutput:{title:"IdentityCreateOutput",description:"It returns the account id and type\n",type:"object",properties:{did:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},additionalProperties:!0,required:["did"]},ResourceListOutput:{title:"ResourceListOutput",description:"A list of resources",type:"array",items:{title:"Resource",anyOf:[{title:"VerifiableCredential",type:"object",properties:{type:{example:"VerifiableCredential",enum:["VerifiableCredential"]},name:{type:"string",example:"Resource name"},resource:{type:"object",properties:{"@context":{type:"array",items:{type:"string"},example:["https://www.w3.org/2018/credentials/v1"]},id:{type:"string",example:"http://example.edu/credentials/1872"},type:{type:"array",items:{type:"string"},example:["VerifiableCredential"]},issuer:{type:"object",properties:{id:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},additionalProperties:!0,required:["id"]},issuanceDate:{type:"string",format:"date-time",example:"2021-06-10T19:07:28.000Z"},credentialSubject:{type:"object",properties:{id:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},required:["id"],additionalProperties:!0},proof:{type:"object",properties:{type:{type:"string",enum:["JwtProof2020"]}},required:["type"],additionalProperties:!0}},additionalProperties:!0,required:["@context","type","issuer","issuanceDate","credentialSubject","proof"]}},required:["type","resource"]},{title:"ObjectResource",type:"object",properties:{type:{example:"Object",enum:["Object"]},name:{type:"string",example:"Resource name"},parentResource:{type:"string"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",additionalProperties:!0}},required:["type","resource"]},{title:"JWK pair",type:"object",properties:{type:{example:"KeyPair",enum:["KeyPair"]},name:{type:"string",example:"Resource name"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",properties:{keyPair:{type:"object",properties:{privateJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents a private key (complementary to `publicJwk`)\n",example:'{"alg":"ES256","crv":"P-256","d":"rQp_3eZzvXwt1sK7WWsRhVYipqNGblzYDKKaYirlqs0","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'},publicJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents the public key (complementary to `privateJwk`).\n",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'}},required:["privateJwk","publicJwk"]}},required:["keyPair"]}},required:["type","resource"]},{title:"Contract",type:"object",properties:{type:{example:"Contract",enum:["Contract"]},name:{type:"string",example:"Resource name"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",properties:{dataSharingAgreement:{type:"object",required:["dataOfferingDescription","parties","purpose","duration","intendedUse","licenseGrant","dataStream","personalData","pricingModel","dataExchangeAgreement","signatures"],properties:{dataOfferingDescription:{type:"object",required:["dataOfferingId","version","active"],properties:{dataOfferingId:{type:"string"},version:{type:"integer"},category:{type:"string"},active:{type:"boolean"},title:{type:"string"}}},parties:{type:"object",required:["providerDid","consumerDid"],properties:{providerDid:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},consumerDid:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}}},purpose:{type:"string"},duration:{type:"object",required:["creationDate","startDate","endDate"],properties:{creationDate:{type:"integer"},startDate:{type:"integer"},endDate:{type:"integer"}}},intendedUse:{type:"object",required:["processData","shareDataWithThirdParty","editData"],properties:{processData:{type:"boolean"},shareDataWithThirdParty:{type:"boolean"},editData:{type:"boolean"}}},licenseGrant:{type:"object",required:["transferable","exclusiveness","paidUp","revocable","processing","modifying","analyzing","storingData","storingCopy","reproducing","distributing","loaning","selling","renting","furtherLicensing","leasing"],properties:{transferable:{type:"boolean"},exclusiveness:{type:"boolean"},paidUp:{type:"boolean"},revocable:{type:"boolean"},processing:{type:"boolean"},modifying:{type:"boolean"},analyzing:{type:"boolean"},storingData:{type:"boolean"},storingCopy:{type:"boolean"},reproducing:{type:"boolean"},distributing:{type:"boolean"},loaning:{type:"boolean"},selling:{type:"boolean"},renting:{type:"boolean"},furtherLicensing:{type:"boolean"},leasing:{type:"boolean"}}},dataStream:{type:"boolean"},personalData:{type:"boolean"},pricingModel:{type:"object",required:["basicPrice","currency","hasFreePrice"],properties:{paymentType:{type:"string"},pricingModelName:{type:"string"},basicPrice:{type:"number",format:"float"},currency:{type:"string"},fee:{type:"number",format:"float"},hasPaymentOnSubscription:{type:"object",properties:{paymentOnSubscriptionName:{type:"string"},paymentType:{type:"string"},timeDuration:{type:"string"},description:{type:"string"},repeat:{type:"string"},hasSubscriptionPrice:{type:"number"}}},hasFreePrice:{type:"object",properties:{hasPriceFree:{type:"boolean"}}}}},dataExchangeAgreement:{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},signatures:{type:"object",required:["providerSignature","consumerSignature"],properties:{providerSignature:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"},consumerSignature:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"}}}}},keyPair:{type:"object",properties:{privateJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents a private key (complementary to `publicJwk`)\n",example:'{"alg":"ES256","crv":"P-256","d":"rQp_3eZzvXwt1sK7WWsRhVYipqNGblzYDKKaYirlqs0","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'},publicJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents the public key (complementary to `privateJwk`).\n",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'}},required:["privateJwk","publicJwk"]}},required:["dataSharingAgreement"]}},required:["type","resource"]},{title:"NonRepudiationProof",type:"object",properties:{type:{example:"NonRepudiationProof",enum:["NonRepudiationProof"]},name:{type:"string",example:"Resource name"},resource:{description:"a non-repudiation proof (either a PoO, a PoR or a PoP) as a compact JWS"}},required:["type","resource"]},{title:"DataExchangeResource",type:"object",properties:{type:{example:"DataExchange",enum:["DataExchange"]},name:{type:"string",example:"Resource name"},resource:{allOf:[{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},{type:"object",properties:{cipherblockDgst:{type:"string",description:"hash of the cipherblock in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"},blockCommitment:{type:"string",description:"hash of the plaintext block in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"},secretCommitment:{type:"string",description:"ash of the secret that can be used to decrypt the block in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"}},required:["cipherblockDgst","blockCommitment","secretCommitment"]}]}},required:["type","resource"]}]}},Resource:{title:"Resource",anyOf:[{title:"VerifiableCredential",type:"object",properties:{type:{example:"VerifiableCredential",enum:["VerifiableCredential"]},name:{type:"string",example:"Resource name"},resource:{type:"object",properties:{"@context":{type:"array",items:{type:"string"},example:["https://www.w3.org/2018/credentials/v1"]},id:{type:"string",example:"http://example.edu/credentials/1872"},type:{type:"array",items:{type:"string"},example:["VerifiableCredential"]},issuer:{type:"object",properties:{id:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},additionalProperties:!0,required:["id"]},issuanceDate:{type:"string",format:"date-time",example:"2021-06-10T19:07:28.000Z"},credentialSubject:{type:"object",properties:{id:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},required:["id"],additionalProperties:!0},proof:{type:"object",properties:{type:{type:"string",enum:["JwtProof2020"]}},required:["type"],additionalProperties:!0}},additionalProperties:!0,required:["@context","type","issuer","issuanceDate","credentialSubject","proof"]}},required:["type","resource"]},{title:"ObjectResource",type:"object",properties:{type:{example:"Object",enum:["Object"]},name:{type:"string",example:"Resource name"},parentResource:{type:"string"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",additionalProperties:!0}},required:["type","resource"]},{title:"JWK pair",type:"object",properties:{type:{example:"KeyPair",enum:["KeyPair"]},name:{type:"string",example:"Resource name"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",properties:{keyPair:{type:"object",properties:{privateJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents a private key (complementary to `publicJwk`)\n",example:'{"alg":"ES256","crv":"P-256","d":"rQp_3eZzvXwt1sK7WWsRhVYipqNGblzYDKKaYirlqs0","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'},publicJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents the public key (complementary to `privateJwk`).\n",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'}},required:["privateJwk","publicJwk"]}},required:["keyPair"]}},required:["type","resource"]},{title:"Contract",type:"object",properties:{type:{example:"Contract",enum:["Contract"]},name:{type:"string",example:"Resource name"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",properties:{dataSharingAgreement:{type:"object",required:["dataOfferingDescription","parties","purpose","duration","intendedUse","licenseGrant","dataStream","personalData","pricingModel","dataExchangeAgreement","signatures"],properties:{dataOfferingDescription:{type:"object",required:["dataOfferingId","version","active"],properties:{dataOfferingId:{type:"string"},version:{type:"integer"},category:{type:"string"},active:{type:"boolean"},title:{type:"string"}}},parties:{type:"object",required:["providerDid","consumerDid"],properties:{providerDid:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},consumerDid:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}}},purpose:{type:"string"},duration:{type:"object",required:["creationDate","startDate","endDate"],properties:{creationDate:{type:"integer"},startDate:{type:"integer"},endDate:{type:"integer"}}},intendedUse:{type:"object",required:["processData","shareDataWithThirdParty","editData"],properties:{processData:{type:"boolean"},shareDataWithThirdParty:{type:"boolean"},editData:{type:"boolean"}}},licenseGrant:{type:"object",required:["transferable","exclusiveness","paidUp","revocable","processing","modifying","analyzing","storingData","storingCopy","reproducing","distributing","loaning","selling","renting","furtherLicensing","leasing"],properties:{transferable:{type:"boolean"},exclusiveness:{type:"boolean"},paidUp:{type:"boolean"},revocable:{type:"boolean"},processing:{type:"boolean"},modifying:{type:"boolean"},analyzing:{type:"boolean"},storingData:{type:"boolean"},storingCopy:{type:"boolean"},reproducing:{type:"boolean"},distributing:{type:"boolean"},loaning:{type:"boolean"},selling:{type:"boolean"},renting:{type:"boolean"},furtherLicensing:{type:"boolean"},leasing:{type:"boolean"}}},dataStream:{type:"boolean"},personalData:{type:"boolean"},pricingModel:{type:"object",required:["basicPrice","currency","hasFreePrice"],properties:{paymentType:{type:"string"},pricingModelName:{type:"string"},basicPrice:{type:"number",format:"float"},currency:{type:"string"},fee:{type:"number",format:"float"},hasPaymentOnSubscription:{type:"object",properties:{paymentOnSubscriptionName:{type:"string"},paymentType:{type:"string"},timeDuration:{type:"string"},description:{type:"string"},repeat:{type:"string"},hasSubscriptionPrice:{type:"number"}}},hasFreePrice:{type:"object",properties:{hasPriceFree:{type:"boolean"}}}}},dataExchangeAgreement:{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},signatures:{type:"object",required:["providerSignature","consumerSignature"],properties:{providerSignature:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"},consumerSignature:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"}}}}},keyPair:{type:"object",properties:{privateJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents a private key (complementary to `publicJwk`)\n",example:'{"alg":"ES256","crv":"P-256","d":"rQp_3eZzvXwt1sK7WWsRhVYipqNGblzYDKKaYirlqs0","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'},publicJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents the public key (complementary to `privateJwk`).\n",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'}},required:["privateJwk","publicJwk"]}},required:["dataSharingAgreement"]}},required:["type","resource"]},{title:"NonRepudiationProof",type:"object",properties:{type:{example:"NonRepudiationProof",enum:["NonRepudiationProof"]},name:{type:"string",example:"Resource name"},resource:{description:"a non-repudiation proof (either a PoO, a PoR or a PoP) as a compact JWS"}},required:["type","resource"]},{title:"DataExchangeResource",type:"object",properties:{type:{example:"DataExchange",enum:["DataExchange"]},name:{type:"string",example:"Resource name"},resource:{allOf:[{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},{type:"object",properties:{cipherblockDgst:{type:"string",description:"hash of the cipherblock in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"},blockCommitment:{type:"string",description:"hash of the plaintext block in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"},secretCommitment:{type:"string",description:"ash of the secret that can be used to decrypt the block in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"}},required:["cipherblockDgst","blockCommitment","secretCommitment"]}]}},required:["type","resource"]}]},VerifiableCredential:{title:"VerifiableCredential",type:"object",properties:{type:{example:"VerifiableCredential",enum:["VerifiableCredential"]},name:{type:"string",example:"Resource name"},resource:{type:"object",properties:{"@context":{type:"array",items:{type:"string"},example:["https://www.w3.org/2018/credentials/v1"]},id:{type:"string",example:"http://example.edu/credentials/1872"},type:{type:"array",items:{type:"string"},example:["VerifiableCredential"]},issuer:{type:"object",properties:{id:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},additionalProperties:!0,required:["id"]},issuanceDate:{type:"string",format:"date-time",example:"2021-06-10T19:07:28.000Z"},credentialSubject:{type:"object",properties:{id:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},required:["id"],additionalProperties:!0},proof:{type:"object",properties:{type:{type:"string",enum:["JwtProof2020"]}},required:["type"],additionalProperties:!0}},additionalProperties:!0,required:["@context","type","issuer","issuanceDate","credentialSubject","proof"]}},required:["type","resource"]},ObjectResource:{title:"ObjectResource",type:"object",properties:{type:{example:"Object",enum:["Object"]},name:{type:"string",example:"Resource name"},parentResource:{type:"string"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",additionalProperties:!0}},required:["type","resource"]},KeyPair:{title:"JWK pair",type:"object",properties:{type:{example:"KeyPair",enum:["KeyPair"]},name:{type:"string",example:"Resource name"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",properties:{keyPair:{type:"object",properties:{privateJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents a private key (complementary to `publicJwk`)\n",example:'{"alg":"ES256","crv":"P-256","d":"rQp_3eZzvXwt1sK7WWsRhVYipqNGblzYDKKaYirlqs0","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'},publicJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents the public key (complementary to `privateJwk`).\n",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'}},required:["privateJwk","publicJwk"]}},required:["keyPair"]}},required:["type","resource"]},Contract:{title:"Contract",type:"object",properties:{type:{example:"Contract",enum:["Contract"]},name:{type:"string",example:"Resource name"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",properties:{dataSharingAgreement:{type:"object",required:["dataOfferingDescription","parties","purpose","duration","intendedUse","licenseGrant","dataStream","personalData","pricingModel","dataExchangeAgreement","signatures"],properties:{dataOfferingDescription:{type:"object",required:["dataOfferingId","version","active"],properties:{dataOfferingId:{type:"string"},version:{type:"integer"},category:{type:"string"},active:{type:"boolean"},title:{type:"string"}}},parties:{type:"object",required:["providerDid","consumerDid"],properties:{providerDid:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},consumerDid:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}}},purpose:{type:"string"},duration:{type:"object",required:["creationDate","startDate","endDate"],properties:{creationDate:{type:"integer"},startDate:{type:"integer"},endDate:{type:"integer"}}},intendedUse:{type:"object",required:["processData","shareDataWithThirdParty","editData"],properties:{processData:{type:"boolean"},shareDataWithThirdParty:{type:"boolean"},editData:{type:"boolean"}}},licenseGrant:{type:"object",required:["transferable","exclusiveness","paidUp","revocable","processing","modifying","analyzing","storingData","storingCopy","reproducing","distributing","loaning","selling","renting","furtherLicensing","leasing"],properties:{transferable:{type:"boolean"},exclusiveness:{type:"boolean"},paidUp:{type:"boolean"},revocable:{type:"boolean"},processing:{type:"boolean"},modifying:{type:"boolean"},analyzing:{type:"boolean"},storingData:{type:"boolean"},storingCopy:{type:"boolean"},reproducing:{type:"boolean"},distributing:{type:"boolean"},loaning:{type:"boolean"},selling:{type:"boolean"},renting:{type:"boolean"},furtherLicensing:{type:"boolean"},leasing:{type:"boolean"}}},dataStream:{type:"boolean"},personalData:{type:"boolean"},pricingModel:{type:"object",required:["basicPrice","currency","hasFreePrice"],properties:{paymentType:{type:"string"},pricingModelName:{type:"string"},basicPrice:{type:"number",format:"float"},currency:{type:"string"},fee:{type:"number",format:"float"},hasPaymentOnSubscription:{type:"object",properties:{paymentOnSubscriptionName:{type:"string"},paymentType:{type:"string"},timeDuration:{type:"string"},description:{type:"string"},repeat:{type:"string"},hasSubscriptionPrice:{type:"number"}}},hasFreePrice:{type:"object",properties:{hasPriceFree:{type:"boolean"}}}}},dataExchangeAgreement:{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},signatures:{type:"object",required:["providerSignature","consumerSignature"],properties:{providerSignature:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"},consumerSignature:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"}}}}},keyPair:{type:"object",properties:{privateJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents a private key (complementary to `publicJwk`)\n",example:'{"alg":"ES256","crv":"P-256","d":"rQp_3eZzvXwt1sK7WWsRhVYipqNGblzYDKKaYirlqs0","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'},publicJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents the public key (complementary to `privateJwk`).\n",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'}},required:["privateJwk","publicJwk"]}},required:["dataSharingAgreement"]}},required:["type","resource"]},DataExchangeResource:{title:"DataExchangeResource",type:"object",properties:{type:{example:"DataExchange",enum:["DataExchange"]},name:{type:"string",example:"Resource name"},resource:{allOf:[{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},{type:"object",properties:{cipherblockDgst:{type:"string",description:"hash of the cipherblock in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"},blockCommitment:{type:"string",description:"hash of the plaintext block in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"},secretCommitment:{type:"string",description:"ash of the secret that can be used to decrypt the block in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"}},required:["cipherblockDgst","blockCommitment","secretCommitment"]}]}},required:["type","resource"]},NonRepudiationProof:{title:"NonRepudiationProof",type:"object",properties:{type:{example:"NonRepudiationProof",enum:["NonRepudiationProof"]},name:{type:"string",example:"Resource name"},resource:{description:"a non-repudiation proof (either a PoO, a PoR or a PoP) as a compact JWS"}},required:["type","resource"]},ResourceId:{type:"object",properties:{id:{type:"string"}},required:["id"]},ResourceType:{type:"string",enum:["VerifiableCredential","Object","KeyPair","Contract","DataExchange","NonRepudiationProof"]},SignedTransaction:{title:"SignedTransaction",description:"A list of resources",type:"object",properties:{transaction:{type:"string",pattern:"^0x(?:[A-Fa-f0-9])+$"}}},DecodedJwt:{title:"JwtPayload",type:"object",properties:{header:{type:"object",properties:{typ:{type:"string",enum:["JWT"]},alg:{type:"string",enum:["ES256K"]}},required:["typ","alg"],additionalProperties:!0},payload:{type:"object",properties:{iss:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},required:["iss"],additionalProperties:!0},signature:{type:"string",format:"^[A-Za-z0-9_-]+$"},data:{type:"string",format:"^[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+$",description:"."}},required:["signature","data"]},VerificationOutput:{title:"VerificationOutput",type:"object",properties:{verification:{type:"string",enum:["success","failed"],description:"whether verification has been successful or has failed"},error:{type:"string",description:"error message if verification failed"},decodedJwt:{description:"the decoded JWT"}},required:["verification"]},ProviderData:{title:"ProviderData",description:"A JSON object with information of the DLT provider currently in use.",type:"object",properties:{provider:{type:"string",example:"did:ethr:i3m"},network:{type:"string",example:"i3m"},rpcUrl:{oneOf:[{type:"string",example:"http://95.211.3.250:8545"},{type:"array",items:{type:"string"},uniqueItems:!0,example:["http://95.211.3.249:8545","http://95.211.3.250:8545"]}]}},additionalProperties:!0},EthereumAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},did:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},IdentityData:{title:"Identity Data",type:"object",properties:{did:{type:"string",example:"did:ethr:i3m:0x03142f480f831e835822fc0cd35726844a7069d28df58fb82037f1598812e1ade8"},alias:{type:"string",example:"identity1"},provider:{type:"string",example:"did:ethr:i3m"},addresses:{type:"array",items:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},example:["0x8646cAcF516de1292be1D30AB68E7Ea51e9B1BE7"]}},required:["did"]},ApiError:{type:"object",title:"Error",required:["code","message"],properties:{code:{type:"integer",format:"int32"},message:{type:"string"}}},JwkPair:{type:"object",properties:{privateJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents a private key (complementary to `publicJwk`)\n",example:'{"alg":"ES256","crv":"P-256","d":"rQp_3eZzvXwt1sK7WWsRhVYipqNGblzYDKKaYirlqs0","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'},publicJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents the public key (complementary to `privateJwk`).\n",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'}},required:["privateJwk","publicJwk"]},CompactJWS:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"},DataExchangeAgreement:{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},DataSharingAgreement:{type:"object",required:["dataOfferingDescription","parties","purpose","duration","intendedUse","licenseGrant","dataStream","personalData","pricingModel","dataExchangeAgreement","signatures"],properties:{dataOfferingDescription:{type:"object",required:["dataOfferingId","version","active"],properties:{dataOfferingId:{type:"string"},version:{type:"integer"},category:{type:"string"},active:{type:"boolean"},title:{type:"string"}}},parties:{type:"object",required:["providerDid","consumerDid"],properties:{providerDid:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},consumerDid:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}}},purpose:{type:"string"},duration:{type:"object",required:["creationDate","startDate","endDate"],properties:{creationDate:{type:"integer"},startDate:{type:"integer"},endDate:{type:"integer"}}},intendedUse:{type:"object",required:["processData","shareDataWithThirdParty","editData"],properties:{processData:{type:"boolean"},shareDataWithThirdParty:{type:"boolean"},editData:{type:"boolean"}}},licenseGrant:{type:"object",required:["transferable","exclusiveness","paidUp","revocable","processing","modifying","analyzing","storingData","storingCopy","reproducing","distributing","loaning","selling","renting","furtherLicensing","leasing"],properties:{transferable:{type:"boolean"},exclusiveness:{type:"boolean"},paidUp:{type:"boolean"},revocable:{type:"boolean"},processing:{type:"boolean"},modifying:{type:"boolean"},analyzing:{type:"boolean"},storingData:{type:"boolean"},storingCopy:{type:"boolean"},reproducing:{type:"boolean"},distributing:{type:"boolean"},loaning:{type:"boolean"},selling:{type:"boolean"},renting:{type:"boolean"},furtherLicensing:{type:"boolean"},leasing:{type:"boolean"}}},dataStream:{type:"boolean"},personalData:{type:"boolean"},pricingModel:{type:"object",required:["basicPrice","currency","hasFreePrice"],properties:{paymentType:{type:"string"},pricingModelName:{type:"string"},basicPrice:{type:"number",format:"float"},currency:{type:"string"},fee:{type:"number",format:"float"},hasPaymentOnSubscription:{type:"object",properties:{paymentOnSubscriptionName:{type:"string"},paymentType:{type:"string"},timeDuration:{type:"string"},description:{type:"string"},repeat:{type:"string"},hasSubscriptionPrice:{type:"number"}}},hasFreePrice:{type:"object",properties:{hasPriceFree:{type:"boolean"}}}}},dataExchangeAgreement:{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},signatures:{type:"object",required:["providerSignature","consumerSignature"],properties:{providerSignature:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"},consumerSignature:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"}}}}},DataExchange:{allOf:[{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},{type:"object",properties:{cipherblockDgst:{type:"string",description:"hash of the cipherblock in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"},blockCommitment:{type:"string",description:"hash of the plaintext block in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"},secretCommitment:{type:"string",description:"ash of the secret that can be used to decrypt the block in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"}},required:["cipherblockDgst","blockCommitment","secretCommitment"]}]}}},ue={id:"https://spec.openapis.org/oas/3.0/schema/2021-09-28",$schema:"http://json-schema.org/draft-04/schema#",description:"The description of OpenAPI v3.0.x documents, as defined by https://spec.openapis.org/oas/v3.0.3",type:"object",required:["openapi","info","paths"],properties:{openapi:{type:"string",pattern:"^3\\.0\\.\\d(-.+)?$"},info:{$ref:"#/definitions/Info"},externalDocs:{$ref:"#/definitions/ExternalDocumentation"},servers:{type:"array",items:{$ref:"#/definitions/Server"}},security:{type:"array",items:{$ref:"#/definitions/SecurityRequirement"}},tags:{type:"array",items:{$ref:"#/definitions/Tag"},uniqueItems:!0},paths:{$ref:"#/definitions/Paths"},components:{$ref:"#/definitions/Components"}},patternProperties:{"^x-":{}},additionalProperties:!1,definitions:{Reference:{type:"object",required:["$ref"],patternProperties:{"^\\$ref$":{type:"string",format:"uri-reference"}}},Info:{type:"object",required:["title","version"],properties:{title:{type:"string"},description:{type:"string"},termsOfService:{type:"string",format:"uri-reference"},contact:{$ref:"#/definitions/Contact"},license:{$ref:"#/definitions/License"},version:{type:"string"}},patternProperties:{"^x-":{}},additionalProperties:!1},Contact:{type:"object",properties:{name:{type:"string"},url:{type:"string",format:"uri-reference"},email:{type:"string",format:"email"}},patternProperties:{"^x-":{}},additionalProperties:!1},License:{type:"object",required:["name"],properties:{name:{type:"string"},url:{type:"string",format:"uri-reference"}},patternProperties:{"^x-":{}},additionalProperties:!1},Server:{type:"object",required:["url"],properties:{url:{type:"string"},description:{type:"string"},variables:{type:"object",additionalProperties:{$ref:"#/definitions/ServerVariable"}}},patternProperties:{"^x-":{}},additionalProperties:!1},ServerVariable:{type:"object",required:["default"],properties:{enum:{type:"array",items:{type:"string"}},default:{type:"string"},description:{type:"string"}},patternProperties:{"^x-":{}},additionalProperties:!1},Components:{type:"object",properties:{schemas:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]}}},responses:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/Response"}]}}},parameters:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/Parameter"}]}}},examples:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/Example"}]}}},requestBodies:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/RequestBody"}]}}},headers:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/Header"}]}}},securitySchemes:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/SecurityScheme"}]}}},links:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/Link"}]}}},callbacks:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/Callback"}]}}}},patternProperties:{"^x-":{}},additionalProperties:!1},Schema:{type:"object",properties:{title:{type:"string"},multipleOf:{type:"number",minimum:0,exclusiveMinimum:!0},maximum:{type:"number"},exclusiveMaximum:{type:"boolean",default:!1},minimum:{type:"number"},exclusiveMinimum:{type:"boolean",default:!1},maxLength:{type:"integer",minimum:0},minLength:{type:"integer",minimum:0,default:0},pattern:{type:"string",format:"regex"},maxItems:{type:"integer",minimum:0},minItems:{type:"integer",minimum:0,default:0},uniqueItems:{type:"boolean",default:!1},maxProperties:{type:"integer",minimum:0},minProperties:{type:"integer",minimum:0,default:0},required:{type:"array",items:{type:"string"},minItems:1,uniqueItems:!0},enum:{type:"array",items:{},minItems:1,uniqueItems:!1},type:{type:"string",enum:["array","boolean","integer","number","object","string"]},not:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]},allOf:{type:"array",items:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]}},oneOf:{type:"array",items:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]}},anyOf:{type:"array",items:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]}},items:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]},properties:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]}},additionalProperties:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"},{type:"boolean"}],default:!0},description:{type:"string"},format:{type:"string"},default:{},nullable:{type:"boolean",default:!1},discriminator:{$ref:"#/definitions/Discriminator"},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},example:{},externalDocs:{$ref:"#/definitions/ExternalDocumentation"},deprecated:{type:"boolean",default:!1},xml:{$ref:"#/definitions/XML"}},patternProperties:{"^x-":{}},additionalProperties:!1},Discriminator:{type:"object",required:["propertyName"],properties:{propertyName:{type:"string"},mapping:{type:"object",additionalProperties:{type:"string"}}}},XML:{type:"object",properties:{name:{type:"string"},namespace:{type:"string",format:"uri"},prefix:{type:"string"},attribute:{type:"boolean",default:!1},wrapped:{type:"boolean",default:!1}},patternProperties:{"^x-":{}},additionalProperties:!1},Response:{type:"object",required:["description"],properties:{description:{type:"string"},headers:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Header"},{$ref:"#/definitions/Reference"}]}},content:{type:"object",additionalProperties:{$ref:"#/definitions/MediaType"}},links:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Link"},{$ref:"#/definitions/Reference"}]}}},patternProperties:{"^x-":{}},additionalProperties:!1},MediaType:{type:"object",properties:{schema:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]},example:{},examples:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Example"},{$ref:"#/definitions/Reference"}]}},encoding:{type:"object",additionalProperties:{$ref:"#/definitions/Encoding"}}},patternProperties:{"^x-":{}},additionalProperties:!1,allOf:[{$ref:"#/definitions/ExampleXORExamples"}]},Example:{type:"object",properties:{summary:{type:"string"},description:{type:"string"},value:{},externalValue:{type:"string",format:"uri-reference"}},patternProperties:{"^x-":{}},additionalProperties:!1},Header:{type:"object",properties:{description:{type:"string"},required:{type:"boolean",default:!1},deprecated:{type:"boolean",default:!1},allowEmptyValue:{type:"boolean",default:!1},style:{type:"string",enum:["simple"],default:"simple"},explode:{type:"boolean"},allowReserved:{type:"boolean",default:!1},schema:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]},content:{type:"object",additionalProperties:{$ref:"#/definitions/MediaType"},minProperties:1,maxProperties:1},example:{},examples:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Example"},{$ref:"#/definitions/Reference"}]}}},patternProperties:{"^x-":{}},additionalProperties:!1,allOf:[{$ref:"#/definitions/ExampleXORExamples"},{$ref:"#/definitions/SchemaXORContent"}]},Paths:{type:"object",patternProperties:{"^\\/":{$ref:"#/definitions/PathItem"},"^x-":{}},additionalProperties:!1},PathItem:{type:"object",properties:{$ref:{type:"string"},summary:{type:"string"},description:{type:"string"},servers:{type:"array",items:{$ref:"#/definitions/Server"}},parameters:{type:"array",items:{oneOf:[{$ref:"#/definitions/Parameter"},{$ref:"#/definitions/Reference"}]},uniqueItems:!0}},patternProperties:{"^(get|put|post|delete|options|head|patch|trace)$":{$ref:"#/definitions/Operation"},"^x-":{}},additionalProperties:!1},Operation:{type:"object",required:["responses"],properties:{tags:{type:"array",items:{type:"string"}},summary:{type:"string"},description:{type:"string"},externalDocs:{$ref:"#/definitions/ExternalDocumentation"},operationId:{type:"string"},parameters:{type:"array",items:{oneOf:[{$ref:"#/definitions/Parameter"},{$ref:"#/definitions/Reference"}]},uniqueItems:!0},requestBody:{oneOf:[{$ref:"#/definitions/RequestBody"},{$ref:"#/definitions/Reference"}]},responses:{$ref:"#/definitions/Responses"},callbacks:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Callback"},{$ref:"#/definitions/Reference"}]}},deprecated:{type:"boolean",default:!1},security:{type:"array",items:{$ref:"#/definitions/SecurityRequirement"}},servers:{type:"array",items:{$ref:"#/definitions/Server"}}},patternProperties:{"^x-":{}},additionalProperties:!1},Responses:{type:"object",properties:{default:{oneOf:[{$ref:"#/definitions/Response"},{$ref:"#/definitions/Reference"}]}},patternProperties:{"^[1-5](?:\\d{2}|XX)$":{oneOf:[{$ref:"#/definitions/Response"},{$ref:"#/definitions/Reference"}]},"^x-":{}},minProperties:1,additionalProperties:!1},SecurityRequirement:{type:"object",additionalProperties:{type:"array",items:{type:"string"}}},Tag:{type:"object",required:["name"],properties:{name:{type:"string"},description:{type:"string"},externalDocs:{$ref:"#/definitions/ExternalDocumentation"}},patternProperties:{"^x-":{}},additionalProperties:!1},ExternalDocumentation:{type:"object",required:["url"],properties:{description:{type:"string"},url:{type:"string",format:"uri-reference"}},patternProperties:{"^x-":{}},additionalProperties:!1},ExampleXORExamples:{description:"Example and examples are mutually exclusive",not:{required:["example","examples"]}},SchemaXORContent:{description:"Schema and content are mutually exclusive, at least one is required",not:{required:["schema","content"]},oneOf:[{required:["schema"]},{required:["content"],description:"Some properties are not allowed if content is present",allOf:[{not:{required:["style"]}},{not:{required:["explode"]}},{not:{required:["allowReserved"]}},{not:{required:["example"]}},{not:{required:["examples"]}}]}]},Parameter:{type:"object",properties:{name:{type:"string"},in:{type:"string"},description:{type:"string"},required:{type:"boolean",default:!1},deprecated:{type:"boolean",default:!1},allowEmptyValue:{type:"boolean",default:!1},style:{type:"string"},explode:{type:"boolean"},allowReserved:{type:"boolean",default:!1},schema:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]},content:{type:"object",additionalProperties:{$ref:"#/definitions/MediaType"},minProperties:1,maxProperties:1},example:{},examples:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Example"},{$ref:"#/definitions/Reference"}]}}},patternProperties:{"^x-":{}},additionalProperties:!1,required:["name","in"],allOf:[{$ref:"#/definitions/ExampleXORExamples"},{$ref:"#/definitions/SchemaXORContent"},{$ref:"#/definitions/ParameterLocation"}]},ParameterLocation:{description:"Parameter location",oneOf:[{description:"Parameter in path",required:["required"],properties:{in:{enum:["path"]},style:{enum:["matrix","label","simple"],default:"simple"},required:{enum:[!0]}}},{description:"Parameter in query",properties:{in:{enum:["query"]},style:{enum:["form","spaceDelimited","pipeDelimited","deepObject"],default:"form"}}},{description:"Parameter in header",properties:{in:{enum:["header"]},style:{enum:["simple"],default:"simple"}}},{description:"Parameter in cookie",properties:{in:{enum:["cookie"]},style:{enum:["form"],default:"form"}}}]},RequestBody:{type:"object",required:["content"],properties:{description:{type:"string"},content:{type:"object",additionalProperties:{$ref:"#/definitions/MediaType"}},required:{type:"boolean",default:!1}},patternProperties:{"^x-":{}},additionalProperties:!1},SecurityScheme:{oneOf:[{$ref:"#/definitions/APIKeySecurityScheme"},{$ref:"#/definitions/HTTPSecurityScheme"},{$ref:"#/definitions/OAuth2SecurityScheme"},{$ref:"#/definitions/OpenIdConnectSecurityScheme"}]},APIKeySecurityScheme:{type:"object",required:["type","name","in"],properties:{type:{type:"string",enum:["apiKey"]},name:{type:"string"},in:{type:"string",enum:["header","query","cookie"]},description:{type:"string"}},patternProperties:{"^x-":{}},additionalProperties:!1},HTTPSecurityScheme:{type:"object",required:["scheme","type"],properties:{scheme:{type:"string"},bearerFormat:{type:"string"},description:{type:"string"},type:{type:"string",enum:["http"]}},patternProperties:{"^x-":{}},additionalProperties:!1,oneOf:[{description:"Bearer",properties:{scheme:{type:"string",pattern:"^[Bb][Ee][Aa][Rr][Ee][Rr]$"}}},{description:"Non Bearer",not:{required:["bearerFormat"]},properties:{scheme:{not:{type:"string",pattern:"^[Bb][Ee][Aa][Rr][Ee][Rr]$"}}}}]},OAuth2SecurityScheme:{type:"object",required:["type","flows"],properties:{type:{type:"string",enum:["oauth2"]},flows:{$ref:"#/definitions/OAuthFlows"},description:{type:"string"}},patternProperties:{"^x-":{}},additionalProperties:!1},OpenIdConnectSecurityScheme:{type:"object",required:["type","openIdConnectUrl"],properties:{type:{type:"string",enum:["openIdConnect"]},openIdConnectUrl:{type:"string",format:"uri-reference"},description:{type:"string"}},patternProperties:{"^x-":{}},additionalProperties:!1},OAuthFlows:{type:"object",properties:{implicit:{$ref:"#/definitions/ImplicitOAuthFlow"},password:{$ref:"#/definitions/PasswordOAuthFlow"},clientCredentials:{$ref:"#/definitions/ClientCredentialsFlow"},authorizationCode:{$ref:"#/definitions/AuthorizationCodeOAuthFlow"}},patternProperties:{"^x-":{}},additionalProperties:!1},ImplicitOAuthFlow:{type:"object",required:["authorizationUrl","scopes"],properties:{authorizationUrl:{type:"string",format:"uri-reference"},refreshUrl:{type:"string",format:"uri-reference"},scopes:{type:"object",additionalProperties:{type:"string"}}},patternProperties:{"^x-":{}},additionalProperties:!1},PasswordOAuthFlow:{type:"object",required:["tokenUrl","scopes"],properties:{tokenUrl:{type:"string",format:"uri-reference"},refreshUrl:{type:"string",format:"uri-reference"},scopes:{type:"object",additionalProperties:{type:"string"}}},patternProperties:{"^x-":{}},additionalProperties:!1},ClientCredentialsFlow:{type:"object",required:["tokenUrl","scopes"],properties:{tokenUrl:{type:"string",format:"uri-reference"},refreshUrl:{type:"string",format:"uri-reference"},scopes:{type:"object",additionalProperties:{type:"string"}}},patternProperties:{"^x-":{}},additionalProperties:!1},AuthorizationCodeOAuthFlow:{type:"object",required:["authorizationUrl","tokenUrl","scopes"],properties:{authorizationUrl:{type:"string",format:"uri-reference"},tokenUrl:{type:"string",format:"uri-reference"},refreshUrl:{type:"string",format:"uri-reference"},scopes:{type:"object",additionalProperties:{type:"string"}}},patternProperties:{"^x-":{}},additionalProperties:!1},Link:{type:"object",properties:{operationId:{type:"string"},operationRef:{type:"string",format:"uri-reference"},parameters:{type:"object",additionalProperties:{}},requestBody:{},description:{type:"string"},server:{$ref:"#/definitions/Server"}},patternProperties:{"^x-":{}},additionalProperties:!1,not:{description:"Operation Id and Operation Ref are mutually exclusive",required:["operationId","operationRef"]}},Callback:{type:"object",additionalProperties:{$ref:"#/definitions/PathItem"},patternProperties:{"^x-":{}}},Encoding:{type:"object",properties:{contentType:{type:"string"},headers:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Header"},{$ref:"#/definitions/Reference"}]}},style:{type:"string",enum:["form","spaceDelimited","pipeDelimited","deepObject"]},explode:{type:"boolean"},allowReserved:{type:"boolean",default:!1}},additionalProperties:!1}}};function he(e){if(new Date(e).getTime()>0)return Number(e);throw new C(new Error("invalid timestamp"),["invalid timestamp"])}async function be(e){const t=[],i=new A({strictSchema:!1,removeAdditional:"all"});i.addMetaSchema(ue),v(i);const r=ge.schemas.DataSharingAgreement;try{const a=i.compile(r),n=S.cloneDeep(e);a(e)||null!==a.errors&&void 0!==a.errors&&a.errors.length>0&&a.errors.forEach((e=>{t.push(new C(`[${e.instancePath}] ${e.message??"unknown"}`,["invalid format"]))})),b(n)!==b(e)&&t.push(new C("Additional claims beyond the schema are not supported",["invalid format"]))}catch(e){t.push(new C(e,["invalid format"]))}return t}async function we(e){const t=[];try{const{id:i,...r}=e;i!==await B(r)&&t.push(new C("Invalid dataExchange id",["cannot verify","invalid format"]));const{blockCommitment:a,secretCommitment:n,cipherblockDgst:o,...s}=r,p=await xe(s);p.length>0&&p.forEach((e=>{t.push(e)}))}catch(e){t.push(new C("Invalid dataExchange",["cannot verify","invalid format"]))}return t}async function xe(e){const t=[],i=Object.keys(e);(i.length<10||i.length>11)&&t.push(new C(new Error("Invalid agreeemt: "+JSON.stringify(e,void 0,2)),["invalid format"]));for(const r of i){let i;switch(r){case"orig":case"dest":try{e[r]!==await N(JSON.parse(e[r]),!0)&&t.push(new C(`[dataExchangeAgreeement.${r}] A valid stringified JWK must be provided. For uniqueness, JWK claims must be alphabetically sorted in the stringified JWK. You can use the parseJWK(jwk, true) for that purpose.\n${e[r]}`,["invalid key","invalid format"]))}catch(e){t.push(new C(`[dataExchangeAgreeement.${r}] A valid stringified JWK must be provided. For uniqueness, JWK claims must be alphabetically sorted in the stringified JWK. You can use the parseJWK(jwk, true) for that purpose.`,["invalid key","invalid format"]))}break;case"ledgerContractAddress":case"ledgerSignerAddress":try{i=K(e[r]),e[r]!==i&&t.push(new C(`[dataExchangeAgreeement.${r}] Invalid EIP-55 address ${e[r]}. Did you mean ${i} instead?`,["invalid EIP-55 address","invalid format"]))}catch(i){t.push(new C(`[dataExchangeAgreeement.${r}] Invalid EIP-55 address ${e[r]}.`,["invalid EIP-55 address","invalid format"]))}break;case"pooToPorDelay":case"pooToPopDelay":case"pooToSecretDelay":try{e[r]!==he(e[r])&&t.push(new C(`[dataExchangeAgreeement.${r}] < 0 or not a number`,["invalid timestamp","invalid format"]))}catch(e){t.push(new C(`[dataExchangeAgreeement.${r}] < 0 or not a number`,["invalid timestamp","invalid format"]))}break;case"hashAlg":k.includes(e[r])||t.push(new C(`[dataExchangeAgreeement.${r}Invalid hash algorithm '${e[r]}'. It must be one of: ${k.join(", ")}`,["invalid algorithm"]));break;case"encAlg":j.includes(e[r])||t.push(new C(`[dataExchangeAgreeement.${r}Invalid encryption algorithm '${e[r]}'. It must be one of: ${j.join(", ")}`,["invalid algorithm"]));break;case"signingAlg":E.includes(e[r])||t.push(new C(`[dataExchangeAgreeement.${r}Invalid signing algorithm '${e[r]}'. It must be one of: ${E.join(", ")}`,["invalid algorithm"]));break;case"schema":break;default:t.push(new C(new Error(`Property ${r} not allowed in dataAgreement`),["invalid format"]))}}return t}var Pe=Object.freeze({__proto__:null,NonRepudiationDest:class{constructor(e,t,i){this.initialized=new Promise(((r,a)=>{this.asyncConstructor(e,t,i).then((()=>{r(!0)})).catch((e=>{a(e)}))}))}async asyncConstructor(e,t,i){const r=await xe(e);if(r.length>0){const e=[];let t=[];throw r.forEach((i=>{e.push(i.message),t=t.concat(i.nrErrors)})),t=[...new Set(t)],new C("Resource has not been validated:\n"+e.join("\n"),t)}this.agreement=e,this.jwkPairDest={privateJwk:t,publicJwk:JSON.parse(e.dest)},this.publicJwkOrig=JSON.parse(e.orig),await z(this.jwkPairDest.publicJwk,this.jwkPairDest.privateJwk),this.dltAgent=i;const a=await this.dltAgent.getContractAddress();if(this.agreement.ledgerContractAddress!==a)throw new Error(`Contract address ${a} does not meet agreed one ${this.agreement.ledgerContractAddress}`);this.block={}}async verifyPoO(t,i,r){await this.initialized;const a=e.encode(await H(i,this.agreement.hashAlg),!0,!1),{payload:n}=await I(t),o={...this.agreement,cipherblockDgst:a,blockCommitment:n.exchange.blockCommitment,secretCommitment:n.exchange.secretCommitment},s={proofType:"PoO",iss:"orig",exchange:{...o,id:await B(o)}},p={timestamp:Date.now(),notBefore:"iat",notAfter:"iat",...r},d=await Z(t,s,p);return this.block={jwe:i,poo:{jws:t,payload:d.payload}},this.exchange=d.payload.exchange,d}async generatePoR(){if(await this.initialized,void 0===this.exchange||void 0===this.block.poo)throw new Error("Before computing a PoR, you have first to receive a valid cipherblock with a PoO and validate the PoO");const e={proofType:"PoR",iss:"dest",exchange:this.exchange,poo:this.block.poo.jws};return this.block.por=await G(e,this.jwkPairDest.privateJwk),this.block.por}async verifyPoP(t,i){if(await this.initialized,void 0===this.exchange||void 0===this.block.por||void 0===this.block.poo)throw new Error("Cannot verify a PoP if not even a PoR have been created");const r={proofType:"PoP",iss:"orig",exchange:this.exchange,por:this.block.por.jws,secret:"",verificationCode:""},n={timestamp:Date.now(),notBefore:"iat",notAfter:1e3*this.block.poo.payload.iat+this.exchange.pooToPopDelay,...i},o=await Z(t,r,n),s=JSON.parse(o.payload.secret);return this.block.secret={hex:a(e.decode(s.k)),jwk:s},this.block.pop={jws:t,payload:o.payload},o}async getSecretFromLedger(){if(await this.initialized,void 0===this.exchange||void 0===this.block.poo||void 0===this.block.por)throw new Error("Cannot get secret if a PoR has not been sent before");const e=Date.now(),t=1e3*this.block.poo.payload.iat+this.agreement.pooToSecretDelay,i=Math.round((t-e)/1e3),{hex:r,iat:a}=await this.dltAgent.getSecretFromLedger(T(this.agreement.encAlg),this.agreement.ledgerSignerAddress,this.exchange.id,i);this.block.secret=await F(this.exchange.encAlg,r);try{_(1e3*a,1e3*this.block.por.payload.iat,1e3*this.block.poo.payload.iat+this.exchange.pooToSecretDelay)}catch(e){throw new C(`Although the secret has been obtained (and you could try to decrypt the cipherblock), it's been published later than agreed: ${new Date(1e3*a).toUTCString()} > ${new Date(1e3*this.block.poo.payload.iat+this.agreement.pooToSecretDelay).toUTCString()}`,["secret not published in time"])}return this.block.secret}async decrypt(){if(await this.initialized,void 0===this.exchange)throw new Error("No agreed exchange");if(void 0===this.block.secret?.jwk)throw new Error("Cannot decrypt without the secret");if(void 0===this.block.jwe)throw new Error("No cipherblock to decrypt");const t=(await J(this.block.jwe,this.block.secret.jwk)).plaintext;if(e.encode(await H(t,this.agreement.hashAlg),!0,!1)!==this.exchange.blockCommitment)throw new Error("Decrypted block does not meet the committed one");return this.block.raw=t,t}async generateVerificationRequest(){if(await this.initialized,void 0===this.block.por||void 0===this.exchange)throw new Error("Before generating a VerificationRequest, you have first to hold a valid PoR for the exchange");return await Q("dest",this.exchange.id,this.block.por.jws,this.jwkPairDest.privateJwk)}async generateDisputeRequest(){if(await this.initialized,void 0===this.block.por||void 0===this.block.jwe||void 0===this.exchange)throw new Error("Before generating a VerificationRequest, you have first to hold a valid PoR for the exchange and have received the cipherblock");const e={proofType:"request",iss:"dest",por:this.block.por.jws,type:"disputeRequest",cipherblock:this.block.jwe,iat:Math.floor(Date.now()/1e3),dataExchangeId:this.exchange.id},t=await R(this.jwkPairDest.privateJwk);try{return await new h(e).setProtectedHeader({alg:this.jwkPairDest.privateJwk.alg}).setIssuedAt(e.iat).sign(t)}catch(e){throw new C(e,["unexpected error"])}}},NonRepudiationOrig:class{constructor(e,t,i,r){this.jwkPairOrig={privateJwk:t,publicJwk:JSON.parse(e.orig)},this.publicJwkDest=JSON.parse(e.dest),this.block={raw:i},this.initialized=new Promise(((t,i)=>{this.init(e,r).then((()=>{t(!0)})).catch((e=>{i(e)}))}))}async init(t,r){const a=await xe(t);if(a.length>0){const e=[];let t=[];throw a.forEach((i=>{e.push(i.message),t=t.concat(i.nrErrors)})),t=[...new Set(t)],new C("Resource has not been validated:\n"+e.join("\n"),t)}this.agreement=t,await z(this.jwkPairOrig.publicJwk,this.jwkPairOrig.privateJwk);const n=await F(this.agreement.encAlg);this.block={...this.block,secret:n,jwe:await O(this.block.raw,n.jwk,this.agreement.encAlg)};const o=e.encode(await H(this.block.jwe,this.agreement.hashAlg),!0,!1),s=e.encode(await H(this.block.raw,this.agreement.hashAlg),!0,!1),p=e.encode(await H(new Uint8Array(i(this.block.secret.hex)),this.agreement.hashAlg),!0,!1),d={...this.agreement,cipherblockDgst:o,blockCommitment:s,secretCommitment:p},c=await B(d);this.exchange={...d,id:c},await this._dltSetup(r)}async _dltSetup(e){this.dltAgent=e;const t=await this.dltAgent.getAddress();if(t!==this.exchange.ledgerSignerAddress)throw new Error(`ledgerSignerAddress: ${this.exchange.ledgerSignerAddress} does not meet the address ${t} derived from the provided private key`);const i=await this.dltAgent.getContractAddress();if(i!==W(this.agreement.ledgerContractAddress,!0))throw new Error(`Contract address in use ${i} does not meet the agreed one ${this.agreement.ledgerContractAddress}`)}async generatePoO(){return await this.initialized,this.block.poo=await G({proofType:"PoO",iss:"orig",exchange:this.exchange},this.jwkPairOrig.privateJwk),this.block.poo}async verifyPoR(e,t){if(await this.initialized,void 0===this.block.poo)throw new Error("Cannot verify a PoR if not even a PoO have been created");const i={proofType:"PoR",iss:"dest",exchange:this.exchange,poo:this.block.poo.jws},r=1e3*this.block.poo.payload.iat,a={timestamp:Date.now(),notBefore:r,notAfter:r+this.exchange.pooToPorDelay,...t},n=await Z(e,i,a);return this.block.por={jws:e,payload:n.payload},this.block.por}async generatePoP(){if(await this.initialized,void 0===this.block.por)throw new Error("Before computing a PoP, you have first to have received and verified the PoR");const e=await this.dltAgent.deploySecret(this.block.secret.hex,this.exchange.id),t={proofType:"PoP",iss:"orig",exchange:this.exchange,por:this.block.por.jws,secret:JSON.stringify(this.block.secret.jwk),verificationCode:e};return this.block.pop=await G(t,this.jwkPairOrig.privateJwk),this.block.pop}async generateVerificationRequest(){if(await this.initialized,void 0===this.block.por)throw new Error("Before generating a VerificationRequest, you have first to hold a valid PoR for the exchange");return await Q("orig",this.exchange.id,this.block.por.jws,this.jwkPairOrig.privateJwk)}}});export{ee as ConflictResolution,j as ENC_ALGS,oe as EthersIoAgentDest,le as EthersIoAgentOrig,k as HASH_ALGS,ce as I3mServerWalletAgentDest,ye as I3mServerWalletAgentOrig,pe as I3mWalletAgentDest,fe as I3mWalletAgentOrig,D as KEY_AGREEMENT_ALGS,Pe as NonRepudiationProtocol,C as NrError,E as SIGNING_ALGS,me as Signers,_ as checkTimestamp,G as createProof,te as defaultDltConfig,B as exchangeId,q as generateKeys,V as getDltAddress,R as importJwk,M as jsonSort,J as jweDecrypt,O as jweEncrypt,I as jwsDecode,F as oneTimeSecret,K as parseAddress,W as parseHex,N as parseJwk,H as sha,we as validateDataExchange,xe as validateDataExchangeAgreement,be as validateDataSharingAgreementSchema,z as verifyKeyPair,Z as verifyProof}; -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguYnJvd3Nlci5lc20uanMiLCJzb3VyY2VzIjpbIi4uL3NyYy90cy9jb25zdGFudHMudHMiLCIuLi9zcmMvdHMvZXJyb3JzL05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RRHZVLG9DQUdFLFNBRk1SLEtBQUsrTSxpQkFFWTVMLElBQW5CbkIsS0FBS3NELE1BQU11SCxJQUNiLE1BQU0sSUFBSWxMLE1BQU0sZ0dBR2xCLGFBQWE4TSxFQUE0QixPQUFRek0sS0FBS3FKLFNBQVM2QixHQUFJbEwsS0FBS3NELE1BQU11SCxJQUFJeEcsSUFBS3JFLEtBQUt3VixZQUFZbFQsV0FDekcifQ== +import*as e from"@juanelas/base64";import{decode as t}from"@juanelas/base64";import{hexToBuf as i,parseHex as r,bufToHex as a}from"bigint-conversion";import{randBytes as n,randBytesSync as o}from"bigint-crypto-utils";import s from"elliptic";import{importJWK as p,CompactEncrypt as d,decodeProtectedHeader as c,compactDecrypt as l,jwtVerify as f,generateSecret as y,exportJWK as m,GeneralSign as g,generalVerify as u,SignJWT as h}from"jose";import{hashable as b}from"object-sha";import{ethers as w,Wallet as x}from"ethers";import{SigningKey as P}from"ethers/lib/utils";import A from"ajv-draft-04";import v from"ajv-formats";import S from"lodash";const k=["SHA-256","SHA-384","SHA-512"],E=["ES256","ES384","ES512"],j=["A128GCM","A256GCM"],D=["ECDH-ES"];class C extends Error{constructor(e,t){super(e),e instanceof C?(this.nrErrors=e.nrErrors,this.add(...t)):this.nrErrors=t}add(...e){const t=this.nrErrors.concat(e);this.nrErrors=[...new Set(t)]}}const{ec:$}=s;async function q(t,r,a){if(!E.includes(t))throw new C(new RangeError(`Invalid signature algorithm '${t}''. Allowed algorithms are ${E.toString()}`),["invalid algorithm"]);let o,s,p;switch(t){case"ES512":s="P-521",o=66;break;case"ES384":s="P-384",o=48;break;default:s="P-256",o=32}p=void 0!==r?"string"==typeof r?!0===a?e.decode(r):new Uint8Array(i(r)):r:new Uint8Array(await n(o));const d=new $("p"+s.substring(s.length-3)).keyFromPrivate(p),c=d.getPublic(),l=c.getX().toString("hex").padStart(2*o,"0"),f=c.getY().toString("hex").padStart(2*o,"0"),y=d.getPrivate("hex").padStart(2*o,"0"),m={kty:"EC",crv:s,x:e.encode(i(l),!0,!1),y:e.encode(i(f),!0,!1),d:e.encode(i(y),!0,!1),alg:t},g={...m};return delete g.d,{publicJwk:g,privateJwk:m}}async function R(e,t){const i=void 0===t?e.alg:t,r=j.concat(E).concat(D);if(!r.includes(i))throw new C("invalid alg. Must be one of: "+r.join(","),["invalid algorithm"]);try{const i=await p(e,t);if(null==i)throw new C(new Error("failed importing keys"),["invalid key"]);return i}catch(e){throw new C(e,["invalid key"])}}async function O(e,t,i){let r,a;const n={...t};if(j.includes(t.alg))r="dir",a=void 0!==i?i:t.alg;else{if(!E.concat(D).includes(t.alg))throw new C(`Not a valid symmetric or assymetric alg: ${t.alg}`,["encryption failed","invalid key","invalid algorithm"]);if(void 0===i)throw new C("An encryption algorith encAlg for content encryption should be provided. Allowed values are: "+j.join(","),["encryption failed"]);a=i,r="ECDH-ES",n.alg=r}const o=await R(n);let s;try{return s=await new d(e).setProtectedHeader({alg:r,enc:a,kid:t.kid}).encrypt(o),s}catch(e){throw new C(e,["encryption failed"])}}async function J(e,t){try{const i={...t},{alg:r,enc:a}=c(e);if(void 0===r||void 0===a)throw new C("missing enc or alg in jwe header",["invalid format"]);"ECDH-ES"===r&&(i.alg=r);const n=await R(i);return await l(e,n,{contentEncryptionAlgorithms:[a]})}catch(e){throw new C(e,["decryption failed"])}}async function I(t,i){const r=t.match(/^([a-zA-Z0-9_-]+)\.{1,2}([a-zA-Z0-9_-]+)\.([a-zA-Z0-9_-]+)$/);if(null===r)throw new C(new Error(`${t} is not a JWS`),["not a compact jws"]);let a,n;try{a=JSON.parse(e.decode(r[1],!0)),n=JSON.parse(e.decode(r[2],!0))}catch(e){throw new C(e,["invalid format","not a compact jws"])}if(void 0!==i){const e="function"==typeof i?await i(a,n):i,r=await R(e);try{const i=await f(t,r);return{header:i.protectedHeader,payload:i.payload,signer:e}}catch(e){throw new C(e,["jws verification failed"])}}return{header:a,payload:n}}function T(e){if(j.concat(k).concat(E).includes(e))return Number(e.match(/\d{3}/)[0])/8;throw new C("unsupported algorithm",["invalid algorithm"])}async function F(n,o,s){let p;if(!j.includes(n))throw new C(new Error(`Invalid encAlg '${n}'. Supported values are: ${j.toString()}`),["invalid algorithm"]);const d=T(n);if(void 0!==o){if("string"==typeof o)if(!0===s)p=e.decode(o);else{const e=r(o,!1);if(e!==r(o,!1,d))throw new C(new RangeError(`Expected hex length ${2*d} does not meet provided one ${e.length/2}`),["invalid key"]);p=new Uint8Array(i(o))}else p=o;if(p.length!==d)throw new C(new RangeError(`Expected secret length ${d} does not meet provided one ${p.length}`),["invalid key"])}else try{p=await y(n,{extractable:!0})}catch(e){throw new C(e,["unexpected error"])}const c=await m(p);return c.alg=n,{jwk:c,hex:a(t(c.k),!1,d)}}async function z(e,t){if(void 0===e.alg||void 0===t.alg||e.alg!==t.alg)throw new Error("alg no present in either pubJwk or privJwk, or pubJWK.alg != privJWK.alg");const i=await R(e),r=await R(t);try{const e=await n(16),a=await new g(e).addSignature(r).setProtectedHeader({alg:t.alg}).sign();await u(a,i)}catch(e){throw new C(e,["unexpected error"])}}function _(e,t,i,r=2e3){if(ei+r)throw new C(new Error(`timestamp ${new Date(e).toTimeString()} after 'notAfter' ${new Date(i).toTimeString()} with tolerance of ${r/1e3}s`),["invalid timestamp"])}function M(e){return Array.isArray(e)?e.sort().map(M):(t=e,"[object Object]"===Object.prototype.toString.call(t)?Object.keys(e).sort().reduce((function(t,i){return t[i]=M(e[i]),t}),{}):e);var t}function W(e,t=!1,i){try{return r(e,t,i)}catch(e){throw new C(e,["invalid format"])}}async function N(e,t){try{await R(e,e.alg);const i=M(e);return t?JSON.stringify(i):i}catch(e){throw new C(e,["invalid key"])}}async function H(e,t){const i=k;if(!i.includes(t))throw new C(new RangeError(`Valid hash algorith values are any of ${JSON.stringify(i)}`),["invalid algorithm"]);const r=new TextEncoder,a="string"==typeof e?r.encode(e).buffer:e;try{let e;return e=new Uint8Array(await crypto.subtle.digest(t,a)),e}catch(e){throw new C(e,["unexpected error"])}}function K(e){if(null==e.match(/^(0x)?([\da-fA-F]{40})$/))throw new RangeError("incorrect address format");try{const t=W(e,!0,20);return w.utils.getAddress(t)}catch(e){throw new C(e,["invalid EIP-55 address"])}}function V(e){const t=e.match(/^did:ethr:(\w+:)?(0x[0-9a-fA-F]{40}[0-9a-fA-F]{26}?)$/),i=null!==t?t[t.length-1]:e;try{return w.utils.computeAddress(i)}catch(e){throw new C("no a DID or a valid public or private key",["invalid format"])}}async function B(t){return e.encode(await H(b(t),"SHA-256"),!0,!1)}async function G(e,t){if(void 0===e.iss)throw new Error('Payload iss should be set to either "orig" or "dest"');const i=JSON.parse(e.exchange[e.iss]);await z(i,t);const r=await R(t),a=t.alg,n={...e,iat:Math.floor(Date.now()/1e3)};return{jws:await new h(n).setProtectedHeader({alg:a}).setIssuedAt(n.iat).sign(r),payload:n}}async function Z(e,t,i){const r=JSON.parse(t.exchange[t.iss]),a=await I(e,r);if(void 0===a.payload.iss)throw new Error('Property "iss" missing');if(void 0===a.payload.iat)throw new Error("Property claim iat missing");if(void 0!==i){_("iat"===i.timestamp?1e3*a.payload.iat:i.timestamp,"iat"===i.notBefore?1e3*a.payload.iat:i.notBefore,"iat"===i.notAfter?1e3*a.payload.iat:i.notAfter,i.tolerance)}const n=a.payload,o=n.exchange[n.iss];if(b(r)!==b(JSON.parse(o)))throw new Error(`The proof is issued by ${o} instead of ${JSON.stringify(r)}`);const s=t;for(const e in s){if(void 0===n[e])throw new Error(`Expected key '${e}' not found in proof`);if("exchange"===e){const e=t.exchange;X(n.exchange,e)}else if(""!==s[e]&&b(s[e])!==b(n[e]))throw new Error(`Proof's ${e}: ${JSON.stringify(n[e],void 0,2)} does not meet provided value ${JSON.stringify(s[e],void 0,2)}`)}return a}function X(e,t){const i=["id","orig","dest","hashAlg","cipherblockDgst","blockCommitment","blockCommitment","secretCommitment","schema"];for(const t of i)if("schema"!==t&&(void 0===e[t]||""===e[t]))throw new Error(`${t} is missing on dataExchange.\ndataExchange: ${JSON.stringify(e,void 0,2)}`);for(const i in t)if(""!==t[i]&&b(t[i])!==b(e[i]))throw new Error(`dataExchange's ${i}: ${JSON.stringify(e[i],void 0,2)} does not meet expected value ${JSON.stringify(t[i],void 0,2)}`)}async function L(e,t,i=10){const{payload:r}=await I(e),a=r.exchange,n={...a};delete n.id;if(await B(n)!==a.id)throw new C(new Error("data exchange integrity failed"),["dataExchange integrity violated"]);const o=JSON.parse(a.dest),s=JSON.parse(a.orig);let p,d,c;try{p=(await Z(r.poo,{iss:"orig",proofType:"PoO",exchange:a})).payload}catch(e){throw new C(e,["invalid poo"])}try{await Z(e,{iss:"dest",proofType:"PoR",exchange:a},{timestamp:"iat",notBefore:1e3*p.iat,notAfter:1e3*p.iat+a.pooToPorDelay})}catch(e){throw new C(e,["invalid por"])}try{const e=await t.getSecretFromLedger(T(a.encAlg),a.ledgerSignerAddress,a.id,i);d=e.hex,c=e.iat}catch(e){throw new C(e,["cannot verify"])}try{_(1e3*c,1e3*r.iat,1e3*p.iat+a.pooToSecretDelay)}catch(e){throw new C(`Although the secret has been obtained (and you could try to decrypt the cipherblock), it's been published later than agreed: ${new Date(1e3*c).toUTCString()} > ${new Date(1e3*p.iat+a.pooToSecretDelay).toUTCString()}`,["secret not published in time"])}return{pooPayload:p,porPayload:r,secretHex:d,destPublicJwk:o,origPublicJwk:s}}async function U(e,t,i=10){let r,a,n,o,s;try{r=(await I(e)).payload}catch(e){throw new C(e,["invalid verification request"])}try{const e=await L(r.por,t,i);a=e.destPublicJwk,n=e.origPublicJwk,o=e.pooPayload,s=e.porPayload}catch(e){throw new C(e,["invalid por","invalid verification request"])}try{await I(e,"dest"===r.iss?a:n)}catch(e){throw new C(e,["invalid verification request"])}return{pooPayload:o,porPayload:s,vrPayload:r,destPublicJwk:a,origPublicJwk:n}}async function Y(t,i){const{payload:r}=await I(t),{destPublicJwk:a,origPublicJwk:n,secretHex:o,pooPayload:s,porPayload:p}=await L(r.por,i);try{await I(t,a)}catch(e){throw e instanceof C&&e.add("invalid dispute request"),e}if(e.encode(await H(r.cipherblock,p.exchange.hashAlg),!0,!1)!==p.exchange.cipherblockDgst)throw new C(new Error("cipherblock does not meet the committed (and already accepted) one"),["invalid dispute request"]);return await J(r.cipherblock,(await F(p.exchange.encAlg,o)).jwk),{pooPayload:s,porPayload:p,drPayload:r,destPublicJwk:a,origPublicJwk:n}}async function Q(e,t,i,r){const a={proofType:"request",iss:e,dataExchangeId:t,por:i,type:"verificationRequest",iat:Math.floor(Date.now()/1e3)},n=await p(r);return await new h(a).setProtectedHeader({alg:r.alg}).setIssuedAt(a.iat).sign(n)}var ee=Object.freeze({__proto__:null,ConflictResolver:class{constructor(e,t){this.jwkPair=e,this.dltAgent=t,this.initialized=new Promise(((e,t)=>{this.init().then((()=>{e(!0)})).catch((e=>{t(e)}))}))}async init(){await z(this.jwkPair.publicJwk,this.jwkPair.privateJwk)}async resolveCompleteness(e){await this.initialized;const{payload:t}=await I(e);let i;try{i=(await I(t.por)).payload}catch(e){throw new C(e,["invalid por"])}const r={...await this._resolution(t.dataExchangeId,i.exchange[t.iss]),resolution:"not completed",type:"verification"};try{await U(e,this.dltAgent),r.resolution="completed"}catch(e){if(!(e instanceof C)||e.nrErrors.includes("invalid verification request")||e.nrErrors.includes("unexpected error"))throw e}const a=await p(this.jwkPair.privateJwk);return await new h(r).setProtectedHeader({alg:this.jwkPair.privateJwk.alg}).setIssuedAt(r.iat).sign(a)}async resolveDispute(e){await this.initialized;const{payload:t}=await I(e);let i;try{i=(await I(t.por)).payload}catch(e){throw new C(e,["invalid por"])}const r={...await this._resolution(t.dataExchangeId,i.exchange[t.iss]),resolution:"denied",type:"dispute"};try{await Y(e,this.dltAgent)}catch(e){if(!(e instanceof C&&e.nrErrors.includes("decryption failed")))throw new C(e,["cannot verify"]);r.resolution="accepted"}const a=await p(this.jwkPair.privateJwk);return await new h(r).setProtectedHeader({alg:this.jwkPair.privateJwk.alg}).setIssuedAt(r.iat).sign(a)}async _resolution(e,t){return{proofType:"resolution",dataExchangeId:e,iat:Math.floor(Date.now()/1e3),iss:await N(this.jwkPair.publicJwk,!0),sub:t}}},checkCompleteness:U,checkDecryption:Y,generateVerificationRequest:Q,verifyPor:L,verifyResolution:async function(e,t){return await I(e,t??((e,t)=>JSON.parse(t.iss)))}});const te={gasLimit:125e5,contract:{address:"0x8d407A1722633bDD1dcf221474be7a44C05d7c2F",abi:[{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"sender",type:"address"},{indexed:!1,internalType:"uint256",name:"dataExchangeId",type:"uint256"},{indexed:!1,internalType:"uint256",name:"timestamp",type:"uint256"},{indexed:!1,internalType:"uint256",name:"secret",type:"uint256"}],name:"Registration",type:"event"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"uint256",name:"",type:"uint256"}],name:"registry",outputs:[{internalType:"uint256",name:"timestamp",type:"uint256"},{internalType:"uint256",name:"secret",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"_dataExchangeId",type:"uint256"},{internalType:"uint256",name:"_secret",type:"uint256"}],name:"setRegistry",outputs:[],stateMutability:"nonpayable",type:"function"}],transactionHash:"0x6a3828f8fe232819dc40ca66f93930b3bd1619db31a67ec34b44446b3e7c8289",receipt:{to:null,from:"0x17bd12C2134AfC1f6E9302a532eFE30C19B9E903",contractAddress:"0x8d407A1722633bDD1dcf221474be7a44C05d7c2F",transactionIndex:0,gasUsed:"253928",logsBloom:"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",blockHash:"0x0118672bb9b27679e616831d056d36291dd20cfe88c3ee2abd8f2dfce579cad4",transactionHash:"0x6a3828f8fe232819dc40ca66f93930b3bd1619db31a67ec34b44446b3e7c8289",logs:[],blockNumber:119389,cumulativeGasUsed:"253928",status:1,byzantium:!0},args:[],solcInputHash:"c528a37588793ef74285d75e08d6b8eb",metadata:'{"compiler":{"version":"0.8.4+commit.c7e474f2"},"language":"Solidity","output":{"abi":[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"dataExchangeId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"secret","type":"uint256"}],"name":"Registration","type":"event"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"registry","outputs":[{"internalType":"uint256","name":"timestamp","type":"uint256"},{"internalType":"uint256","name":"secret","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_dataExchangeId","type":"uint256"},{"internalType":"uint256","name":"_secret","type":"uint256"}],"name":"setRegistry","outputs":[],"stateMutability":"nonpayable","type":"function"}],"devdoc":{"kind":"dev","methods":{},"version":1},"userdoc":{"kind":"user","methods":{},"version":1}},"settings":{"compilationTarget":{"contracts/NonRepudiation.sol":"NonRepudiation"},"evmVersion":"istanbul","libraries":{},"metadata":{"bytecodeHash":"ipfs","useLiteralContent":true},"optimizer":{"enabled":false,"runs":200},"remappings":[]},"sources":{"contracts/NonRepudiation.sol":{"content":"//SPDX-License-Identifier: Unlicense\\npragma solidity ^0.8.0;\\n\\ncontract NonRepudiation {\\n struct Proof {\\n uint256 timestamp;\\n uint256 secret;\\n }\\n mapping(address => mapping (uint256 => Proof)) public registry;\\n event Registration(address sender, uint256 dataExchangeId, uint256 timestamp, uint256 secret);\\n\\n function setRegistry(uint256 _dataExchangeId, uint256 _secret) public {\\n require(registry[msg.sender][_dataExchangeId].secret == 0);\\n registry[msg.sender][_dataExchangeId] = Proof(block.timestamp, _secret);\\n emit Registration(msg.sender, _dataExchangeId, block.timestamp, _secret);\\n }\\n}\\n","keccak256":"0x8d371257a9b03c9102f158323e61f56ce49dd8489bd92c5a7d8abc3d9f6f8399","license":"Unlicense"}},"version":1}',bytecode:"0x608060405234801561001057600080fd5b506103a2806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c8063032439371461003b578063d05cb54514610057575b600080fd5b6100556004803603810190610050919061023a565b610088565b005b610071600480360381019061006c91906101fe565b6101a3565b60405161007f9291906102d9565b60405180910390f35b60008060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002060010154146100e757600080fd5b6040518060400160405280428152602001828152506000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002060008201518160000155602082015181600101559050507faa58599838af2e5e0f3251cfbb4eac5d5d447ded49f6b0ac28d6b44098224e63338342846040516101979493929190610294565b60405180910390a15050565b6000602052816000526040600020602052806000526040600020600091509150508060000154908060010154905082565b6000813590506101e38161033e565b92915050565b6000813590506101f881610355565b92915050565b6000806040838503121561021157600080fd5b600061021f858286016101d4565b9250506020610230858286016101e9565b9150509250929050565b6000806040838503121561024d57600080fd5b600061025b858286016101e9565b925050602061026c858286016101e9565b9150509250929050565b61027f81610302565b82525050565b61028e81610334565b82525050565b60006080820190506102a96000830187610276565b6102b66020830186610285565b6102c36040830185610285565b6102d06060830184610285565b95945050505050565b60006040820190506102ee6000830185610285565b6102fb6020830184610285565b9392505050565b600061030d82610314565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b61034781610302565b811461035257600080fd5b50565b61035e81610334565b811461036957600080fd5b5056fea26469706673582212204fd0fc653fb487221da9a14a4ca5d5499f9e9bc7b27ac8ab0f8d397fd6e3148564736f6c63430008040033",deployedBytecode:"0x608060405234801561001057600080fd5b50600436106100365760003560e01c8063032439371461003b578063d05cb54514610057575b600080fd5b6100556004803603810190610050919061023a565b610088565b005b610071600480360381019061006c91906101fe565b6101a3565b60405161007f9291906102d9565b60405180910390f35b60008060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002060010154146100e757600080fd5b6040518060400160405280428152602001828152506000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002060008201518160000155602082015181600101559050507faa58599838af2e5e0f3251cfbb4eac5d5d447ded49f6b0ac28d6b44098224e63338342846040516101979493929190610294565b60405180910390a15050565b6000602052816000526040600020602052806000526040600020600091509150508060000154908060010154905082565b6000813590506101e38161033e565b92915050565b6000813590506101f881610355565b92915050565b6000806040838503121561021157600080fd5b600061021f858286016101d4565b9250506020610230858286016101e9565b9150509250929050565b6000806040838503121561024d57600080fd5b600061025b858286016101e9565b925050602061026c858286016101e9565b9150509250929050565b61027f81610302565b82525050565b61028e81610334565b82525050565b60006080820190506102a96000830187610276565b6102b66020830186610285565b6102c36040830185610285565b6102d06060830184610285565b95945050505050565b60006040820190506102ee6000830185610285565b6102fb6020830184610285565b9392505050565b600061030d82610314565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b61034781610302565b811461035257600080fd5b50565b61035e81610334565b811461036957600080fd5b5056fea26469706673582212204fd0fc653fb487221da9a14a4ca5d5499f9e9bc7b27ac8ab0f8d397fd6e3148564736f6c63430008040033",devdoc:{kind:"dev",methods:{},version:1},userdoc:{kind:"user",methods:{},version:1},storageLayout:{storage:[{astId:13,contract:"contracts/NonRepudiation.sol:NonRepudiation",label:"registry",offset:0,slot:"0",type:"t_mapping(t_address,t_mapping(t_uint256,t_struct(Proof)6_storage))"}],types:{t_address:{encoding:"inplace",label:"address",numberOfBytes:"20"},"t_mapping(t_address,t_mapping(t_uint256,t_struct(Proof)6_storage))":{encoding:"mapping",key:"t_address",label:"mapping(address => mapping(uint256 => struct NonRepudiation.Proof))",numberOfBytes:"32",value:"t_mapping(t_uint256,t_struct(Proof)6_storage)"},"t_mapping(t_uint256,t_struct(Proof)6_storage)":{encoding:"mapping",key:"t_uint256",label:"mapping(uint256 => struct NonRepudiation.Proof)",numberOfBytes:"32",value:"t_struct(Proof)6_storage"},"t_struct(Proof)6_storage":{encoding:"inplace",label:"struct NonRepudiation.Proof",members:[{astId:3,contract:"contracts/NonRepudiation.sol:NonRepudiation",label:"timestamp",offset:0,slot:"0",type:"t_uint256"},{astId:5,contract:"contracts/NonRepudiation.sol:NonRepudiation",label:"secret",offset:0,slot:"1",type:"t_uint256"}],numberOfBytes:"64"},t_uint256:{encoding:"inplace",label:"uint256",numberOfBytes:"32"}}}}};async function ie(t,i,r,n,o){let s=w.BigNumber.from(0),p=w.BigNumber.from(0);const d=W(a(e.decode(r)),!0);let c=0;do{try{({secret:s,timestamp:p}=await t.registry(W(i,!0),d))}catch(e){throw new C(e,["cannot contact the ledger"])}s.isZero()&&(c++,await new Promise((e=>setTimeout(e,1e3))))}while(s.isZero()&&c{null!==e&&"object"==typeof e&&"function"==typeof e.then?e.then((e=>{this.dltConfig={...te,...e},this.provider=new w.providers.JsonRpcProvider(this.dltConfig.rpcProviderUrl),this.contract=new w.Contract(this.dltConfig.contract.address,this.dltConfig.contract.abi,this.provider),t(!0)})).catch((e=>i(e))):(this.dltConfig={...te,...e},this.provider=new w.providers.JsonRpcProvider(this.dltConfig.rpcProviderUrl),this.contract=new w.Contract(this.dltConfig.contract.address,this.dltConfig.contract.abi,this.provider),t(!0))}))}async getContractAddress(){return await this.initialized,this.contract.address}}class oe extends ne{async getSecretFromLedger(e,t,i,r){return await this.initialized,await ie(this.contract,t,i,r,e)}}class se extends ne{constructor(e,t,i){super(new Promise(((t,r)=>{e.providerinfo.get().then((e=>{const a=e.rpcUrl;void 0===a?r(new Error("wallet is not connected to RPC endpoint")):t({...i,rpcProviderUrl:"string"==typeof a?a:a[0]})})).catch((e=>{r(e)}))}))),this.wallet=e,this.did=t}}class pe extends se{async getSecretFromLedger(e,t,i,r){return await this.initialized,await ie(this.contract,t,i,r,e)}}class de extends ne{constructor(e,t,i){super(new Promise(((t,r)=>{e.providerinfoGet().then((e=>{const a=e.rpcUrl;void 0===a?r(new Error("wallet is not connected to RPC endpoint")):t({...i,rpcProviderUrl:"string"==typeof a?a:a[0]})})).catch((e=>{r(e)}))}))),this.wallet=e,this.did=t}}class ce extends de{async getSecretFromLedger(e,t,i,r){return await this.initialized,await ie(this.contract,t,i,r,e)}}class le extends ne{constructor(e,t){let r;super(e),this.count=-1,r=void 0===t?o(32):"string"==typeof t?new Uint8Array(i(t)):t;const a=new P(r);this.signer=new x(a,this.provider)}async deploySecret(e,t){await this.initialized;const i=await re(e,t,this),r=await this.signer.signTransaction(i),a=await this.signer.provider.sendTransaction(r);return this.count=this.count+1,a.hash}async getAddress(){return await this.initialized,this.signer.address}async nextNonce(){await this.initialized;const e=await this.provider.getTransactionCount(await this.getAddress(),"pending");return e>this.count&&(this.count=e),this.count}}class fe extends se{constructor(){super(...arguments),this.count=-1}async deploySecret(e,t){await this.initialized;const i=await re(e,t,this),r=(await this.wallet.identities.sign({did:this.did},{type:"Transaction",data:i})).signature,a=await this.provider.sendTransaction(r);return this.count=this.count+1,a.hash}async getAddress(){await this.initialized;const e=await this.wallet.identities.info({did:this.did});if(void 0===e.addresses)throw new C(new Error("no addresses for did "+this.did),["unexpected error"]);return e.addresses[0]}async nextNonce(){await this.initialized;const e=await this.provider.getTransactionCount(await this.getAddress(),"pending");return e>this.count&&(this.count=e),this.count}}class ye extends de{constructor(){super(...arguments),this.count=-1}async deploySecret(e,t){await this.initialized;const i=await re(e,t,this),r=(await this.wallet.identitySign({did:this.did},{type:"Transaction",data:i})).signature,a=await this.provider.sendTransaction(r);return this.count=this.count+1,a.hash}async getAddress(){await this.initialized;const e=await this.wallet.identityInfo({did:this.did});if(void 0===e.addresses)throw new C(`Can't get address for did: ${this.did}`,["unexpected error"]);return e.addresses[0]}async nextNonce(){await this.initialized;const e=await this.provider.getTransactionCount(await this.getAddress(),"pending");return e>this.count&&(this.count=e),this.count}}var me=Object.freeze({__proto__:null,EthersIoAgentDest:oe,EthersIoAgentOrig:le,I3mServerWalletAgentDest:ce,I3mServerWalletAgentOrig:ye,I3mWalletAgentDest:pe,I3mWalletAgentOrig:fe}),ge={schemas:{IdentitySelectOutput:{title:"IdentitySelectOutput",type:"object",properties:{did:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},required:["did"]},SignInput:{title:"SignInput",oneOf:[{title:"SignTransaction",type:"object",properties:{type:{enum:["Transaction"]},data:{title:"Transaction",type:"object",additionalProperties:!0,properties:{from:{type:"string"},to:{type:"string"},nonce:{type:"number"}}}},required:["type","data"]},{title:"SignRaw",type:"object",properties:{type:{enum:["Raw"]},data:{type:"object",properties:{payload:{description:"Base64Url encoded data to sign",type:"string",pattern:"^[A-Za-z0-9_-]+$"}},required:["payload"]}},required:["type","data"]},{title:"SignJWT",type:"object",properties:{type:{enum:["JWT"]},data:{type:"object",properties:{header:{description:'header fields to be added to the JWS header. "alg" and "kid" will be ignored since they are automatically added by the wallet.',type:"object",additionalProperties:!0},payload:{description:"A JSON object to be signed by the wallet. It will become the payload of the generated JWS. 'iss' (issuer) and 'iat' (issued at) will be automatically added by the wallet and will override provided values.",type:"object",additionalProperties:!0}},required:["payload"]}},required:["type","data"]}]},SignRaw:{title:"SignRaw",type:"object",properties:{type:{enum:["Raw"]},data:{type:"object",properties:{payload:{description:"Base64Url encoded data to sign",type:"string",pattern:"^[A-Za-z0-9_-]+$"}},required:["payload"]}},required:["type","data"]},SignTransaction:{title:"SignTransaction",type:"object",properties:{type:{enum:["Transaction"]},data:{title:"Transaction",type:"object",additionalProperties:!0,properties:{from:{type:"string"},to:{type:"string"},nonce:{type:"number"}}}},required:["type","data"]},SignJWT:{title:"SignJWT",type:"object",properties:{type:{enum:["JWT"]},data:{type:"object",properties:{header:{description:'header fields to be added to the JWS header. "alg" and "kid" will be ignored since they are automatically added by the wallet.',type:"object",additionalProperties:!0},payload:{description:"A JSON object to be signed by the wallet. It will become the payload of the generated JWS. 'iss' (issuer) and 'iat' (issued at) will be automatically added by the wallet and will override provided values.",type:"object",additionalProperties:!0}},required:["payload"]}},required:["type","data"]},Transaction:{title:"Transaction",type:"object",additionalProperties:!0,properties:{from:{type:"string"},to:{type:"string"},nonce:{type:"number"}}},SignOutput:{title:"SignOutput",type:"object",properties:{signature:{type:"string"}},required:["signature"]},Receipt:{title:"Receipt",type:"object",properties:{receipt:{type:"string"}},required:["receipt"]},SignTypes:{title:"SignTypes",type:"string",enum:["Transaction","Raw","JWT"]},IdentityListInput:{title:"IdentityListInput",description:"A list of DIDs",type:"array",items:{type:"object",properties:{did:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},required:["did"]}},IdentityCreateInput:{title:"IdentityCreateInput",description:'Besides the here defined options, provider specific properties should be added here if necessary, e.g. "path" for BIP21 wallets, or the key algorithm (if the wallet supports multiple algorithm).\n',type:"object",properties:{alias:{type:"string"}},additionalProperties:!0},IdentityCreateOutput:{title:"IdentityCreateOutput",description:"It returns the account id and type\n",type:"object",properties:{did:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},additionalProperties:!0,required:["did"]},ResourceListOutput:{title:"ResourceListOutput",description:"A list of resources",type:"array",items:{title:"Resource",anyOf:[{title:"VerifiableCredential",type:"object",properties:{type:{example:"VerifiableCredential",enum:["VerifiableCredential"]},name:{type:"string",example:"Resource name"},resource:{type:"object",properties:{"@context":{type:"array",items:{type:"string"},example:["https://www.w3.org/2018/credentials/v1"]},id:{type:"string",example:"http://example.edu/credentials/1872"},type:{type:"array",items:{type:"string"},example:["VerifiableCredential"]},issuer:{type:"object",properties:{id:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},additionalProperties:!0,required:["id"]},issuanceDate:{type:"string",format:"date-time",example:"2021-06-10T19:07:28.000Z"},credentialSubject:{type:"object",properties:{id:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},required:["id"],additionalProperties:!0},proof:{type:"object",properties:{type:{type:"string",enum:["JwtProof2020"]}},required:["type"],additionalProperties:!0}},additionalProperties:!0,required:["@context","type","issuer","issuanceDate","credentialSubject","proof"]}},required:["type","resource"]},{title:"ObjectResource",type:"object",properties:{type:{example:"Object",enum:["Object"]},name:{type:"string",example:"Resource name"},parentResource:{type:"string"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",additionalProperties:!0}},required:["type","resource"]},{title:"JWK pair",type:"object",properties:{type:{example:"KeyPair",enum:["KeyPair"]},name:{type:"string",example:"Resource name"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",properties:{keyPair:{type:"object",properties:{privateJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents a private key (complementary to `publicJwk`)\n",example:'{"alg":"ES256","crv":"P-256","d":"rQp_3eZzvXwt1sK7WWsRhVYipqNGblzYDKKaYirlqs0","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'},publicJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents the public key (complementary to `privateJwk`).\n",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'}},required:["privateJwk","publicJwk"]}},required:["keyPair"]}},required:["type","resource"]},{title:"Contract",type:"object",properties:{type:{example:"Contract",enum:["Contract"]},name:{type:"string",example:"Resource name"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",properties:{dataSharingAgreement:{type:"object",required:["dataOfferingDescription","parties","purpose","duration","intendedUse","licenseGrant","dataStream","personalData","pricingModel","dataExchangeAgreement","signatures"],properties:{dataOfferingDescription:{type:"object",required:["dataOfferingId","version","active"],properties:{dataOfferingId:{type:"string"},version:{type:"integer"},category:{type:"string"},active:{type:"boolean"},title:{type:"string"}}},parties:{type:"object",required:["providerDid","consumerDid"],properties:{providerDid:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},consumerDid:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}}},purpose:{type:"string"},duration:{type:"object",required:["creationDate","startDate","endDate"],properties:{creationDate:{type:"integer"},startDate:{type:"integer"},endDate:{type:"integer"}}},intendedUse:{type:"object",required:["processData","shareDataWithThirdParty","editData"],properties:{processData:{type:"boolean"},shareDataWithThirdParty:{type:"boolean"},editData:{type:"boolean"}}},licenseGrant:{type:"object",required:["transferable","exclusiveness","paidUp","revocable","processing","modifying","analyzing","storingData","storingCopy","reproducing","distributing","loaning","selling","renting","furtherLicensing","leasing"],properties:{transferable:{type:"boolean"},exclusiveness:{type:"boolean"},paidUp:{type:"boolean"},revocable:{type:"boolean"},processing:{type:"boolean"},modifying:{type:"boolean"},analyzing:{type:"boolean"},storingData:{type:"boolean"},storingCopy:{type:"boolean"},reproducing:{type:"boolean"},distributing:{type:"boolean"},loaning:{type:"boolean"},selling:{type:"boolean"},renting:{type:"boolean"},furtherLicensing:{type:"boolean"},leasing:{type:"boolean"}}},dataStream:{type:"boolean"},personalData:{type:"boolean"},pricingModel:{type:"object",required:["basicPrice","currency","hasFreePrice"],properties:{paymentType:{type:"string"},pricingModelName:{type:"string"},basicPrice:{type:"number",format:"float"},currency:{type:"string"},fee:{type:"number",format:"float"},hasPaymentOnSubscription:{type:"object",properties:{paymentOnSubscriptionName:{type:"string"},paymentType:{type:"string"},timeDuration:{type:"string"},description:{type:"string"},repeat:{type:"string"},hasSubscriptionPrice:{type:"number"}}},hasFreePrice:{type:"object",properties:{hasPriceFree:{type:"boolean"}}}}},dataExchangeAgreement:{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},signatures:{type:"object",required:["providerSignature","consumerSignature"],properties:{providerSignature:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"},consumerSignature:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"}}}}},keyPair:{type:"object",properties:{privateJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents a private key (complementary to `publicJwk`)\n",example:'{"alg":"ES256","crv":"P-256","d":"rQp_3eZzvXwt1sK7WWsRhVYipqNGblzYDKKaYirlqs0","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'},publicJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents the public key (complementary to `privateJwk`).\n",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'}},required:["privateJwk","publicJwk"]}},required:["dataSharingAgreement"]}},required:["type","resource"]},{title:"NonRepudiationProof",type:"object",properties:{type:{example:"NonRepudiationProof",enum:["NonRepudiationProof"]},name:{type:"string",example:"Resource name"},resource:{description:"a non-repudiation proof (either a PoO, a PoR or a PoP) as a compact JWS"}},required:["type","resource"]},{title:"DataExchangeResource",type:"object",properties:{type:{example:"DataExchange",enum:["DataExchange"]},name:{type:"string",example:"Resource name"},resource:{allOf:[{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},{type:"object",properties:{cipherblockDgst:{type:"string",description:"hash of the cipherblock in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"},blockCommitment:{type:"string",description:"hash of the plaintext block in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"},secretCommitment:{type:"string",description:"ash of the secret that can be used to decrypt the block in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"}},required:["cipherblockDgst","blockCommitment","secretCommitment"]}]}},required:["type","resource"]}]}},Resource:{title:"Resource",anyOf:[{title:"VerifiableCredential",type:"object",properties:{type:{example:"VerifiableCredential",enum:["VerifiableCredential"]},name:{type:"string",example:"Resource name"},resource:{type:"object",properties:{"@context":{type:"array",items:{type:"string"},example:["https://www.w3.org/2018/credentials/v1"]},id:{type:"string",example:"http://example.edu/credentials/1872"},type:{type:"array",items:{type:"string"},example:["VerifiableCredential"]},issuer:{type:"object",properties:{id:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},additionalProperties:!0,required:["id"]},issuanceDate:{type:"string",format:"date-time",example:"2021-06-10T19:07:28.000Z"},credentialSubject:{type:"object",properties:{id:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},required:["id"],additionalProperties:!0},proof:{type:"object",properties:{type:{type:"string",enum:["JwtProof2020"]}},required:["type"],additionalProperties:!0}},additionalProperties:!0,required:["@context","type","issuer","issuanceDate","credentialSubject","proof"]}},required:["type","resource"]},{title:"ObjectResource",type:"object",properties:{type:{example:"Object",enum:["Object"]},name:{type:"string",example:"Resource name"},parentResource:{type:"string"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",additionalProperties:!0}},required:["type","resource"]},{title:"JWK pair",type:"object",properties:{type:{example:"KeyPair",enum:["KeyPair"]},name:{type:"string",example:"Resource name"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",properties:{keyPair:{type:"object",properties:{privateJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents a private key (complementary to `publicJwk`)\n",example:'{"alg":"ES256","crv":"P-256","d":"rQp_3eZzvXwt1sK7WWsRhVYipqNGblzYDKKaYirlqs0","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'},publicJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents the public key (complementary to `privateJwk`).\n",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'}},required:["privateJwk","publicJwk"]}},required:["keyPair"]}},required:["type","resource"]},{title:"Contract",type:"object",properties:{type:{example:"Contract",enum:["Contract"]},name:{type:"string",example:"Resource name"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",properties:{dataSharingAgreement:{type:"object",required:["dataOfferingDescription","parties","purpose","duration","intendedUse","licenseGrant","dataStream","personalData","pricingModel","dataExchangeAgreement","signatures"],properties:{dataOfferingDescription:{type:"object",required:["dataOfferingId","version","active"],properties:{dataOfferingId:{type:"string"},version:{type:"integer"},category:{type:"string"},active:{type:"boolean"},title:{type:"string"}}},parties:{type:"object",required:["providerDid","consumerDid"],properties:{providerDid:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},consumerDid:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}}},purpose:{type:"string"},duration:{type:"object",required:["creationDate","startDate","endDate"],properties:{creationDate:{type:"integer"},startDate:{type:"integer"},endDate:{type:"integer"}}},intendedUse:{type:"object",required:["processData","shareDataWithThirdParty","editData"],properties:{processData:{type:"boolean"},shareDataWithThirdParty:{type:"boolean"},editData:{type:"boolean"}}},licenseGrant:{type:"object",required:["transferable","exclusiveness","paidUp","revocable","processing","modifying","analyzing","storingData","storingCopy","reproducing","distributing","loaning","selling","renting","furtherLicensing","leasing"],properties:{transferable:{type:"boolean"},exclusiveness:{type:"boolean"},paidUp:{type:"boolean"},revocable:{type:"boolean"},processing:{type:"boolean"},modifying:{type:"boolean"},analyzing:{type:"boolean"},storingData:{type:"boolean"},storingCopy:{type:"boolean"},reproducing:{type:"boolean"},distributing:{type:"boolean"},loaning:{type:"boolean"},selling:{type:"boolean"},renting:{type:"boolean"},furtherLicensing:{type:"boolean"},leasing:{type:"boolean"}}},dataStream:{type:"boolean"},personalData:{type:"boolean"},pricingModel:{type:"object",required:["basicPrice","currency","hasFreePrice"],properties:{paymentType:{type:"string"},pricingModelName:{type:"string"},basicPrice:{type:"number",format:"float"},currency:{type:"string"},fee:{type:"number",format:"float"},hasPaymentOnSubscription:{type:"object",properties:{paymentOnSubscriptionName:{type:"string"},paymentType:{type:"string"},timeDuration:{type:"string"},description:{type:"string"},repeat:{type:"string"},hasSubscriptionPrice:{type:"number"}}},hasFreePrice:{type:"object",properties:{hasPriceFree:{type:"boolean"}}}}},dataExchangeAgreement:{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},signatures:{type:"object",required:["providerSignature","consumerSignature"],properties:{providerSignature:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"},consumerSignature:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"}}}}},keyPair:{type:"object",properties:{privateJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents a private key (complementary to `publicJwk`)\n",example:'{"alg":"ES256","crv":"P-256","d":"rQp_3eZzvXwt1sK7WWsRhVYipqNGblzYDKKaYirlqs0","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'},publicJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents the public key (complementary to `privateJwk`).\n",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'}},required:["privateJwk","publicJwk"]}},required:["dataSharingAgreement"]}},required:["type","resource"]},{title:"NonRepudiationProof",type:"object",properties:{type:{example:"NonRepudiationProof",enum:["NonRepudiationProof"]},name:{type:"string",example:"Resource name"},resource:{description:"a non-repudiation proof (either a PoO, a PoR or a PoP) as a compact JWS"}},required:["type","resource"]},{title:"DataExchangeResource",type:"object",properties:{type:{example:"DataExchange",enum:["DataExchange"]},name:{type:"string",example:"Resource name"},resource:{allOf:[{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},{type:"object",properties:{cipherblockDgst:{type:"string",description:"hash of the cipherblock in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"},blockCommitment:{type:"string",description:"hash of the plaintext block in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"},secretCommitment:{type:"string",description:"ash of the secret that can be used to decrypt the block in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"}},required:["cipherblockDgst","blockCommitment","secretCommitment"]}]}},required:["type","resource"]}]},VerifiableCredential:{title:"VerifiableCredential",type:"object",properties:{type:{example:"VerifiableCredential",enum:["VerifiableCredential"]},name:{type:"string",example:"Resource name"},resource:{type:"object",properties:{"@context":{type:"array",items:{type:"string"},example:["https://www.w3.org/2018/credentials/v1"]},id:{type:"string",example:"http://example.edu/credentials/1872"},type:{type:"array",items:{type:"string"},example:["VerifiableCredential"]},issuer:{type:"object",properties:{id:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},additionalProperties:!0,required:["id"]},issuanceDate:{type:"string",format:"date-time",example:"2021-06-10T19:07:28.000Z"},credentialSubject:{type:"object",properties:{id:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},required:["id"],additionalProperties:!0},proof:{type:"object",properties:{type:{type:"string",enum:["JwtProof2020"]}},required:["type"],additionalProperties:!0}},additionalProperties:!0,required:["@context","type","issuer","issuanceDate","credentialSubject","proof"]}},required:["type","resource"]},ObjectResource:{title:"ObjectResource",type:"object",properties:{type:{example:"Object",enum:["Object"]},name:{type:"string",example:"Resource name"},parentResource:{type:"string"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",additionalProperties:!0}},required:["type","resource"]},KeyPair:{title:"JWK pair",type:"object",properties:{type:{example:"KeyPair",enum:["KeyPair"]},name:{type:"string",example:"Resource name"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",properties:{keyPair:{type:"object",properties:{privateJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents a private key (complementary to `publicJwk`)\n",example:'{"alg":"ES256","crv":"P-256","d":"rQp_3eZzvXwt1sK7WWsRhVYipqNGblzYDKKaYirlqs0","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'},publicJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents the public key (complementary to `privateJwk`).\n",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'}},required:["privateJwk","publicJwk"]}},required:["keyPair"]}},required:["type","resource"]},Contract:{title:"Contract",type:"object",properties:{type:{example:"Contract",enum:["Contract"]},name:{type:"string",example:"Resource name"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",properties:{dataSharingAgreement:{type:"object",required:["dataOfferingDescription","parties","purpose","duration","intendedUse","licenseGrant","dataStream","personalData","pricingModel","dataExchangeAgreement","signatures"],properties:{dataOfferingDescription:{type:"object",required:["dataOfferingId","version","active"],properties:{dataOfferingId:{type:"string"},version:{type:"integer"},category:{type:"string"},active:{type:"boolean"},title:{type:"string"}}},parties:{type:"object",required:["providerDid","consumerDid"],properties:{providerDid:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},consumerDid:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}}},purpose:{type:"string"},duration:{type:"object",required:["creationDate","startDate","endDate"],properties:{creationDate:{type:"integer"},startDate:{type:"integer"},endDate:{type:"integer"}}},intendedUse:{type:"object",required:["processData","shareDataWithThirdParty","editData"],properties:{processData:{type:"boolean"},shareDataWithThirdParty:{type:"boolean"},editData:{type:"boolean"}}},licenseGrant:{type:"object",required:["transferable","exclusiveness","paidUp","revocable","processing","modifying","analyzing","storingData","storingCopy","reproducing","distributing","loaning","selling","renting","furtherLicensing","leasing"],properties:{transferable:{type:"boolean"},exclusiveness:{type:"boolean"},paidUp:{type:"boolean"},revocable:{type:"boolean"},processing:{type:"boolean"},modifying:{type:"boolean"},analyzing:{type:"boolean"},storingData:{type:"boolean"},storingCopy:{type:"boolean"},reproducing:{type:"boolean"},distributing:{type:"boolean"},loaning:{type:"boolean"},selling:{type:"boolean"},renting:{type:"boolean"},furtherLicensing:{type:"boolean"},leasing:{type:"boolean"}}},dataStream:{type:"boolean"},personalData:{type:"boolean"},pricingModel:{type:"object",required:["basicPrice","currency","hasFreePrice"],properties:{paymentType:{type:"string"},pricingModelName:{type:"string"},basicPrice:{type:"number",format:"float"},currency:{type:"string"},fee:{type:"number",format:"float"},hasPaymentOnSubscription:{type:"object",properties:{paymentOnSubscriptionName:{type:"string"},paymentType:{type:"string"},timeDuration:{type:"string"},description:{type:"string"},repeat:{type:"string"},hasSubscriptionPrice:{type:"number"}}},hasFreePrice:{type:"object",properties:{hasPriceFree:{type:"boolean"}}}}},dataExchangeAgreement:{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},signatures:{type:"object",required:["providerSignature","consumerSignature"],properties:{providerSignature:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"},consumerSignature:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"}}}}},keyPair:{type:"object",properties:{privateJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents a private key (complementary to `publicJwk`)\n",example:'{"alg":"ES256","crv":"P-256","d":"rQp_3eZzvXwt1sK7WWsRhVYipqNGblzYDKKaYirlqs0","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'},publicJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents the public key (complementary to `privateJwk`).\n",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'}},required:["privateJwk","publicJwk"]}},required:["dataSharingAgreement"]}},required:["type","resource"]},DataExchangeResource:{title:"DataExchangeResource",type:"object",properties:{type:{example:"DataExchange",enum:["DataExchange"]},name:{type:"string",example:"Resource name"},resource:{allOf:[{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},{type:"object",properties:{cipherblockDgst:{type:"string",description:"hash of the cipherblock in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"},blockCommitment:{type:"string",description:"hash of the plaintext block in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"},secretCommitment:{type:"string",description:"ash of the secret that can be used to decrypt the block in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"}},required:["cipherblockDgst","blockCommitment","secretCommitment"]}]}},required:["type","resource"]},NonRepudiationProof:{title:"NonRepudiationProof",type:"object",properties:{type:{example:"NonRepudiationProof",enum:["NonRepudiationProof"]},name:{type:"string",example:"Resource name"},resource:{description:"a non-repudiation proof (either a PoO, a PoR or a PoP) as a compact JWS"}},required:["type","resource"]},ResourceId:{type:"object",properties:{id:{type:"string"}},required:["id"]},ResourceType:{type:"string",enum:["VerifiableCredential","Object","KeyPair","Contract","DataExchange","NonRepudiationProof"]},SignedTransaction:{title:"SignedTransaction",description:"A list of resources",type:"object",properties:{transaction:{type:"string",pattern:"^0x(?:[A-Fa-f0-9])+$"}}},DecodedJwt:{title:"JwtPayload",type:"object",properties:{header:{type:"object",properties:{typ:{type:"string",enum:["JWT"]},alg:{type:"string",enum:["ES256K"]}},required:["typ","alg"],additionalProperties:!0},payload:{type:"object",properties:{iss:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},required:["iss"],additionalProperties:!0},signature:{type:"string",format:"^[A-Za-z0-9_-]+$"},data:{type:"string",format:"^[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+$",description:"."}},required:["signature","data"]},VerificationOutput:{title:"VerificationOutput",type:"object",properties:{verification:{type:"string",enum:["success","failed"],description:"whether verification has been successful or has failed"},error:{type:"string",description:"error message if verification failed"},decodedJwt:{description:"the decoded JWT"}},required:["verification"]},ProviderData:{title:"ProviderData",description:"A JSON object with information of the DLT provider currently in use.",type:"object",properties:{provider:{type:"string",example:"did:ethr:i3m"},network:{type:"string",example:"i3m"},rpcUrl:{type:"string",example:"http://95.211.3.250:8545"}},additionalProperties:!0},EthereumAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},did:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},IdentityData:{title:"Identity Data",type:"object",properties:{did:{type:"string",example:"did:ethr:i3m:0x03142f480f831e835822fc0cd35726844a7069d28df58fb82037f1598812e1ade8"},alias:{type:"string",example:"identity1"},provider:{type:"string",example:"did:ethr:i3m"},addresses:{type:"array",items:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},example:["0x8646cAcF516de1292be1D30AB68E7Ea51e9B1BE7"]}},required:["did"]},ApiError:{type:"object",title:"Error",required:["code","message"],properties:{code:{type:"integer",format:"int32"},message:{type:"string"}}},JwkPair:{type:"object",properties:{privateJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents a private key (complementary to `publicJwk`)\n",example:'{"alg":"ES256","crv":"P-256","d":"rQp_3eZzvXwt1sK7WWsRhVYipqNGblzYDKKaYirlqs0","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'},publicJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents the public key (complementary to `privateJwk`).\n",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'}},required:["privateJwk","publicJwk"]},CompactJWS:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"},DataExchangeAgreement:{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},DataSharingAgreement:{type:"object",required:["dataOfferingDescription","parties","purpose","duration","intendedUse","licenseGrant","dataStream","personalData","pricingModel","dataExchangeAgreement","signatures"],properties:{dataOfferingDescription:{type:"object",required:["dataOfferingId","version","active"],properties:{dataOfferingId:{type:"string"},version:{type:"integer"},category:{type:"string"},active:{type:"boolean"},title:{type:"string"}}},parties:{type:"object",required:["providerDid","consumerDid"],properties:{providerDid:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},consumerDid:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}}},purpose:{type:"string"},duration:{type:"object",required:["creationDate","startDate","endDate"],properties:{creationDate:{type:"integer"},startDate:{type:"integer"},endDate:{type:"integer"}}},intendedUse:{type:"object",required:["processData","shareDataWithThirdParty","editData"],properties:{processData:{type:"boolean"},shareDataWithThirdParty:{type:"boolean"},editData:{type:"boolean"}}},licenseGrant:{type:"object",required:["transferable","exclusiveness","paidUp","revocable","processing","modifying","analyzing","storingData","storingCopy","reproducing","distributing","loaning","selling","renting","furtherLicensing","leasing"],properties:{transferable:{type:"boolean"},exclusiveness:{type:"boolean"},paidUp:{type:"boolean"},revocable:{type:"boolean"},processing:{type:"boolean"},modifying:{type:"boolean"},analyzing:{type:"boolean"},storingData:{type:"boolean"},storingCopy:{type:"boolean"},reproducing:{type:"boolean"},distributing:{type:"boolean"},loaning:{type:"boolean"},selling:{type:"boolean"},renting:{type:"boolean"},furtherLicensing:{type:"boolean"},leasing:{type:"boolean"}}},dataStream:{type:"boolean"},personalData:{type:"boolean"},pricingModel:{type:"object",required:["basicPrice","currency","hasFreePrice"],properties:{paymentType:{type:"string"},pricingModelName:{type:"string"},basicPrice:{type:"number",format:"float"},currency:{type:"string"},fee:{type:"number",format:"float"},hasPaymentOnSubscription:{type:"object",properties:{paymentOnSubscriptionName:{type:"string"},paymentType:{type:"string"},timeDuration:{type:"string"},description:{type:"string"},repeat:{type:"string"},hasSubscriptionPrice:{type:"number"}}},hasFreePrice:{type:"object",properties:{hasPriceFree:{type:"boolean"}}}}},dataExchangeAgreement:{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},signatures:{type:"object",required:["providerSignature","consumerSignature"],properties:{providerSignature:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"},consumerSignature:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"}}}}},DataExchange:{allOf:[{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},{type:"object",properties:{cipherblockDgst:{type:"string",description:"hash of the cipherblock in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"},blockCommitment:{type:"string",description:"hash of the plaintext block in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"},secretCommitment:{type:"string",description:"ash of the secret that can be used to decrypt the block in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"}},required:["cipherblockDgst","blockCommitment","secretCommitment"]}]}}},ue={id:"https://spec.openapis.org/oas/3.0/schema/2021-09-28",$schema:"http://json-schema.org/draft-04/schema#",description:"The description of OpenAPI v3.0.x documents, as defined by https://spec.openapis.org/oas/v3.0.3",type:"object",required:["openapi","info","paths"],properties:{openapi:{type:"string",pattern:"^3\\.0\\.\\d(-.+)?$"},info:{$ref:"#/definitions/Info"},externalDocs:{$ref:"#/definitions/ExternalDocumentation"},servers:{type:"array",items:{$ref:"#/definitions/Server"}},security:{type:"array",items:{$ref:"#/definitions/SecurityRequirement"}},tags:{type:"array",items:{$ref:"#/definitions/Tag"},uniqueItems:!0},paths:{$ref:"#/definitions/Paths"},components:{$ref:"#/definitions/Components"}},patternProperties:{"^x-":{}},additionalProperties:!1,definitions:{Reference:{type:"object",required:["$ref"],patternProperties:{"^\\$ref$":{type:"string",format:"uri-reference"}}},Info:{type:"object",required:["title","version"],properties:{title:{type:"string"},description:{type:"string"},termsOfService:{type:"string",format:"uri-reference"},contact:{$ref:"#/definitions/Contact"},license:{$ref:"#/definitions/License"},version:{type:"string"}},patternProperties:{"^x-":{}},additionalProperties:!1},Contact:{type:"object",properties:{name:{type:"string"},url:{type:"string",format:"uri-reference"},email:{type:"string",format:"email"}},patternProperties:{"^x-":{}},additionalProperties:!1},License:{type:"object",required:["name"],properties:{name:{type:"string"},url:{type:"string",format:"uri-reference"}},patternProperties:{"^x-":{}},additionalProperties:!1},Server:{type:"object",required:["url"],properties:{url:{type:"string"},description:{type:"string"},variables:{type:"object",additionalProperties:{$ref:"#/definitions/ServerVariable"}}},patternProperties:{"^x-":{}},additionalProperties:!1},ServerVariable:{type:"object",required:["default"],properties:{enum:{type:"array",items:{type:"string"}},default:{type:"string"},description:{type:"string"}},patternProperties:{"^x-":{}},additionalProperties:!1},Components:{type:"object",properties:{schemas:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]}}},responses:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/Response"}]}}},parameters:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/Parameter"}]}}},examples:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/Example"}]}}},requestBodies:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/RequestBody"}]}}},headers:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/Header"}]}}},securitySchemes:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/SecurityScheme"}]}}},links:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/Link"}]}}},callbacks:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/Callback"}]}}}},patternProperties:{"^x-":{}},additionalProperties:!1},Schema:{type:"object",properties:{title:{type:"string"},multipleOf:{type:"number",minimum:0,exclusiveMinimum:!0},maximum:{type:"number"},exclusiveMaximum:{type:"boolean",default:!1},minimum:{type:"number"},exclusiveMinimum:{type:"boolean",default:!1},maxLength:{type:"integer",minimum:0},minLength:{type:"integer",minimum:0,default:0},pattern:{type:"string",format:"regex"},maxItems:{type:"integer",minimum:0},minItems:{type:"integer",minimum:0,default:0},uniqueItems:{type:"boolean",default:!1},maxProperties:{type:"integer",minimum:0},minProperties:{type:"integer",minimum:0,default:0},required:{type:"array",items:{type:"string"},minItems:1,uniqueItems:!0},enum:{type:"array",items:{},minItems:1,uniqueItems:!1},type:{type:"string",enum:["array","boolean","integer","number","object","string"]},not:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]},allOf:{type:"array",items:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]}},oneOf:{type:"array",items:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]}},anyOf:{type:"array",items:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]}},items:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]},properties:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]}},additionalProperties:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"},{type:"boolean"}],default:!0},description:{type:"string"},format:{type:"string"},default:{},nullable:{type:"boolean",default:!1},discriminator:{$ref:"#/definitions/Discriminator"},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},example:{},externalDocs:{$ref:"#/definitions/ExternalDocumentation"},deprecated:{type:"boolean",default:!1},xml:{$ref:"#/definitions/XML"}},patternProperties:{"^x-":{}},additionalProperties:!1},Discriminator:{type:"object",required:["propertyName"],properties:{propertyName:{type:"string"},mapping:{type:"object",additionalProperties:{type:"string"}}}},XML:{type:"object",properties:{name:{type:"string"},namespace:{type:"string",format:"uri"},prefix:{type:"string"},attribute:{type:"boolean",default:!1},wrapped:{type:"boolean",default:!1}},patternProperties:{"^x-":{}},additionalProperties:!1},Response:{type:"object",required:["description"],properties:{description:{type:"string"},headers:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Header"},{$ref:"#/definitions/Reference"}]}},content:{type:"object",additionalProperties:{$ref:"#/definitions/MediaType"}},links:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Link"},{$ref:"#/definitions/Reference"}]}}},patternProperties:{"^x-":{}},additionalProperties:!1},MediaType:{type:"object",properties:{schema:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]},example:{},examples:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Example"},{$ref:"#/definitions/Reference"}]}},encoding:{type:"object",additionalProperties:{$ref:"#/definitions/Encoding"}}},patternProperties:{"^x-":{}},additionalProperties:!1,allOf:[{$ref:"#/definitions/ExampleXORExamples"}]},Example:{type:"object",properties:{summary:{type:"string"},description:{type:"string"},value:{},externalValue:{type:"string",format:"uri-reference"}},patternProperties:{"^x-":{}},additionalProperties:!1},Header:{type:"object",properties:{description:{type:"string"},required:{type:"boolean",default:!1},deprecated:{type:"boolean",default:!1},allowEmptyValue:{type:"boolean",default:!1},style:{type:"string",enum:["simple"],default:"simple"},explode:{type:"boolean"},allowReserved:{type:"boolean",default:!1},schema:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]},content:{type:"object",additionalProperties:{$ref:"#/definitions/MediaType"},minProperties:1,maxProperties:1},example:{},examples:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Example"},{$ref:"#/definitions/Reference"}]}}},patternProperties:{"^x-":{}},additionalProperties:!1,allOf:[{$ref:"#/definitions/ExampleXORExamples"},{$ref:"#/definitions/SchemaXORContent"}]},Paths:{type:"object",patternProperties:{"^\\/":{$ref:"#/definitions/PathItem"},"^x-":{}},additionalProperties:!1},PathItem:{type:"object",properties:{$ref:{type:"string"},summary:{type:"string"},description:{type:"string"},servers:{type:"array",items:{$ref:"#/definitions/Server"}},parameters:{type:"array",items:{oneOf:[{$ref:"#/definitions/Parameter"},{$ref:"#/definitions/Reference"}]},uniqueItems:!0}},patternProperties:{"^(get|put|post|delete|options|head|patch|trace)$":{$ref:"#/definitions/Operation"},"^x-":{}},additionalProperties:!1},Operation:{type:"object",required:["responses"],properties:{tags:{type:"array",items:{type:"string"}},summary:{type:"string"},description:{type:"string"},externalDocs:{$ref:"#/definitions/ExternalDocumentation"},operationId:{type:"string"},parameters:{type:"array",items:{oneOf:[{$ref:"#/definitions/Parameter"},{$ref:"#/definitions/Reference"}]},uniqueItems:!0},requestBody:{oneOf:[{$ref:"#/definitions/RequestBody"},{$ref:"#/definitions/Reference"}]},responses:{$ref:"#/definitions/Responses"},callbacks:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Callback"},{$ref:"#/definitions/Reference"}]}},deprecated:{type:"boolean",default:!1},security:{type:"array",items:{$ref:"#/definitions/SecurityRequirement"}},servers:{type:"array",items:{$ref:"#/definitions/Server"}}},patternProperties:{"^x-":{}},additionalProperties:!1},Responses:{type:"object",properties:{default:{oneOf:[{$ref:"#/definitions/Response"},{$ref:"#/definitions/Reference"}]}},patternProperties:{"^[1-5](?:\\d{2}|XX)$":{oneOf:[{$ref:"#/definitions/Response"},{$ref:"#/definitions/Reference"}]},"^x-":{}},minProperties:1,additionalProperties:!1},SecurityRequirement:{type:"object",additionalProperties:{type:"array",items:{type:"string"}}},Tag:{type:"object",required:["name"],properties:{name:{type:"string"},description:{type:"string"},externalDocs:{$ref:"#/definitions/ExternalDocumentation"}},patternProperties:{"^x-":{}},additionalProperties:!1},ExternalDocumentation:{type:"object",required:["url"],properties:{description:{type:"string"},url:{type:"string",format:"uri-reference"}},patternProperties:{"^x-":{}},additionalProperties:!1},ExampleXORExamples:{description:"Example and examples are mutually exclusive",not:{required:["example","examples"]}},SchemaXORContent:{description:"Schema and content are mutually exclusive, at least one is required",not:{required:["schema","content"]},oneOf:[{required:["schema"]},{required:["content"],description:"Some properties are not allowed if content is present",allOf:[{not:{required:["style"]}},{not:{required:["explode"]}},{not:{required:["allowReserved"]}},{not:{required:["example"]}},{not:{required:["examples"]}}]}]},Parameter:{type:"object",properties:{name:{type:"string"},in:{type:"string"},description:{type:"string"},required:{type:"boolean",default:!1},deprecated:{type:"boolean",default:!1},allowEmptyValue:{type:"boolean",default:!1},style:{type:"string"},explode:{type:"boolean"},allowReserved:{type:"boolean",default:!1},schema:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]},content:{type:"object",additionalProperties:{$ref:"#/definitions/MediaType"},minProperties:1,maxProperties:1},example:{},examples:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Example"},{$ref:"#/definitions/Reference"}]}}},patternProperties:{"^x-":{}},additionalProperties:!1,required:["name","in"],allOf:[{$ref:"#/definitions/ExampleXORExamples"},{$ref:"#/definitions/SchemaXORContent"},{$ref:"#/definitions/ParameterLocation"}]},ParameterLocation:{description:"Parameter location",oneOf:[{description:"Parameter in path",required:["required"],properties:{in:{enum:["path"]},style:{enum:["matrix","label","simple"],default:"simple"},required:{enum:[!0]}}},{description:"Parameter in query",properties:{in:{enum:["query"]},style:{enum:["form","spaceDelimited","pipeDelimited","deepObject"],default:"form"}}},{description:"Parameter in header",properties:{in:{enum:["header"]},style:{enum:["simple"],default:"simple"}}},{description:"Parameter in cookie",properties:{in:{enum:["cookie"]},style:{enum:["form"],default:"form"}}}]},RequestBody:{type:"object",required:["content"],properties:{description:{type:"string"},content:{type:"object",additionalProperties:{$ref:"#/definitions/MediaType"}},required:{type:"boolean",default:!1}},patternProperties:{"^x-":{}},additionalProperties:!1},SecurityScheme:{oneOf:[{$ref:"#/definitions/APIKeySecurityScheme"},{$ref:"#/definitions/HTTPSecurityScheme"},{$ref:"#/definitions/OAuth2SecurityScheme"},{$ref:"#/definitions/OpenIdConnectSecurityScheme"}]},APIKeySecurityScheme:{type:"object",required:["type","name","in"],properties:{type:{type:"string",enum:["apiKey"]},name:{type:"string"},in:{type:"string",enum:["header","query","cookie"]},description:{type:"string"}},patternProperties:{"^x-":{}},additionalProperties:!1},HTTPSecurityScheme:{type:"object",required:["scheme","type"],properties:{scheme:{type:"string"},bearerFormat:{type:"string"},description:{type:"string"},type:{type:"string",enum:["http"]}},patternProperties:{"^x-":{}},additionalProperties:!1,oneOf:[{description:"Bearer",properties:{scheme:{type:"string",pattern:"^[Bb][Ee][Aa][Rr][Ee][Rr]$"}}},{description:"Non Bearer",not:{required:["bearerFormat"]},properties:{scheme:{not:{type:"string",pattern:"^[Bb][Ee][Aa][Rr][Ee][Rr]$"}}}}]},OAuth2SecurityScheme:{type:"object",required:["type","flows"],properties:{type:{type:"string",enum:["oauth2"]},flows:{$ref:"#/definitions/OAuthFlows"},description:{type:"string"}},patternProperties:{"^x-":{}},additionalProperties:!1},OpenIdConnectSecurityScheme:{type:"object",required:["type","openIdConnectUrl"],properties:{type:{type:"string",enum:["openIdConnect"]},openIdConnectUrl:{type:"string",format:"uri-reference"},description:{type:"string"}},patternProperties:{"^x-":{}},additionalProperties:!1},OAuthFlows:{type:"object",properties:{implicit:{$ref:"#/definitions/ImplicitOAuthFlow"},password:{$ref:"#/definitions/PasswordOAuthFlow"},clientCredentials:{$ref:"#/definitions/ClientCredentialsFlow"},authorizationCode:{$ref:"#/definitions/AuthorizationCodeOAuthFlow"}},patternProperties:{"^x-":{}},additionalProperties:!1},ImplicitOAuthFlow:{type:"object",required:["authorizationUrl","scopes"],properties:{authorizationUrl:{type:"string",format:"uri-reference"},refreshUrl:{type:"string",format:"uri-reference"},scopes:{type:"object",additionalProperties:{type:"string"}}},patternProperties:{"^x-":{}},additionalProperties:!1},PasswordOAuthFlow:{type:"object",required:["tokenUrl","scopes"],properties:{tokenUrl:{type:"string",format:"uri-reference"},refreshUrl:{type:"string",format:"uri-reference"},scopes:{type:"object",additionalProperties:{type:"string"}}},patternProperties:{"^x-":{}},additionalProperties:!1},ClientCredentialsFlow:{type:"object",required:["tokenUrl","scopes"],properties:{tokenUrl:{type:"string",format:"uri-reference"},refreshUrl:{type:"string",format:"uri-reference"},scopes:{type:"object",additionalProperties:{type:"string"}}},patternProperties:{"^x-":{}},additionalProperties:!1},AuthorizationCodeOAuthFlow:{type:"object",required:["authorizationUrl","tokenUrl","scopes"],properties:{authorizationUrl:{type:"string",format:"uri-reference"},tokenUrl:{type:"string",format:"uri-reference"},refreshUrl:{type:"string",format:"uri-reference"},scopes:{type:"object",additionalProperties:{type:"string"}}},patternProperties:{"^x-":{}},additionalProperties:!1},Link:{type:"object",properties:{operationId:{type:"string"},operationRef:{type:"string",format:"uri-reference"},parameters:{type:"object",additionalProperties:{}},requestBody:{},description:{type:"string"},server:{$ref:"#/definitions/Server"}},patternProperties:{"^x-":{}},additionalProperties:!1,not:{description:"Operation Id and Operation Ref are mutually exclusive",required:["operationId","operationRef"]}},Callback:{type:"object",additionalProperties:{$ref:"#/definitions/PathItem"},patternProperties:{"^x-":{}}},Encoding:{type:"object",properties:{contentType:{type:"string"},headers:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Header"},{$ref:"#/definitions/Reference"}]}},style:{type:"string",enum:["form","spaceDelimited","pipeDelimited","deepObject"]},explode:{type:"boolean"},allowReserved:{type:"boolean",default:!1}},additionalProperties:!1}}};function he(e){if(new Date(e).getTime()>0)return Number(e);throw new C(new Error("invalid timestamp"),["invalid timestamp"])}async function be(e){const t=[],i=new A({strictSchema:!1,removeAdditional:"all"});i.addMetaSchema(ue),v(i);const r=ge.schemas.DataSharingAgreement;try{const a=i.compile(r),n=S.cloneDeep(e);a(e)||null!==a.errors&&void 0!==a.errors&&a.errors.length>0&&a.errors.forEach((e=>{t.push(new C(`[${e.instancePath}] ${e.message??"unknown"}`,["invalid format"]))})),b(n)!==b(e)&&t.push(new C("Additional claims beyond the schema are not supported",["invalid format"]))}catch(e){t.push(new C(e,["invalid format"]))}return t}async function we(e){const t=[];try{const{id:i,...r}=e;i!==await B(r)&&t.push(new C("Invalid dataExchange id",["cannot verify","invalid format"]));const{blockCommitment:a,secretCommitment:n,cipherblockDgst:o,...s}=r,p=await xe(s);p.length>0&&p.forEach((e=>{t.push(e)}))}catch(e){t.push(new C("Invalid dataExchange",["cannot verify","invalid format"]))}return t}async function xe(e){const t=[],i=Object.keys(e);(i.length<10||i.length>11)&&t.push(new C(new Error("Invalid agreeemt: "+JSON.stringify(e,void 0,2)),["invalid format"]));for(const r of i){let i;switch(r){case"orig":case"dest":try{e[r]!==await N(JSON.parse(e[r]),!0)&&t.push(new C(`[dataExchangeAgreeement.${r}] A valid stringified JWK must be provided. For uniqueness, JWK claims must be alphabetically sorted in the stringified JWK. You can use the parseJWK(jwk, true) for that purpose.\n${e[r]}`,["invalid key","invalid format"]))}catch(e){t.push(new C(`[dataExchangeAgreeement.${r}] A valid stringified JWK must be provided. For uniqueness, JWK claims must be alphabetically sorted in the stringified JWK. You can use the parseJWK(jwk, true) for that purpose.`,["invalid key","invalid format"]))}break;case"ledgerContractAddress":case"ledgerSignerAddress":try{i=K(e[r]),e[r]!==i&&t.push(new C(`[dataExchangeAgreeement.${r}] Invalid EIP-55 address ${e[r]}. Did you mean ${i} instead?`,["invalid EIP-55 address","invalid format"]))}catch(i){t.push(new C(`[dataExchangeAgreeement.${r}] Invalid EIP-55 address ${e[r]}.`,["invalid EIP-55 address","invalid format"]))}break;case"pooToPorDelay":case"pooToPopDelay":case"pooToSecretDelay":try{e[r]!==he(e[r])&&t.push(new C(`[dataExchangeAgreeement.${r}] < 0 or not a number`,["invalid timestamp","invalid format"]))}catch(e){t.push(new C(`[dataExchangeAgreeement.${r}] < 0 or not a number`,["invalid timestamp","invalid format"]))}break;case"hashAlg":k.includes(e[r])||t.push(new C(`[dataExchangeAgreeement.${r}Invalid hash algorithm '${e[r]}'. It must be one of: ${k.join(", ")}`,["invalid algorithm"]));break;case"encAlg":j.includes(e[r])||t.push(new C(`[dataExchangeAgreeement.${r}Invalid encryption algorithm '${e[r]}'. It must be one of: ${j.join(", ")}`,["invalid algorithm"]));break;case"signingAlg":E.includes(e[r])||t.push(new C(`[dataExchangeAgreeement.${r}Invalid signing algorithm '${e[r]}'. It must be one of: ${E.join(", ")}`,["invalid algorithm"]));break;case"schema":break;default:t.push(new C(new Error(`Property ${r} not allowed in dataAgreement`),["invalid format"]))}}return t}var Pe=Object.freeze({__proto__:null,NonRepudiationDest:class{constructor(e,t,i){this.initialized=new Promise(((r,a)=>{this.asyncConstructor(e,t,i).then((()=>{r(!0)})).catch((e=>{a(e)}))}))}async asyncConstructor(e,t,i){const r=await xe(e);if(r.length>0){const e=[];let t=[];throw r.forEach((i=>{e.push(i.message),t=t.concat(i.nrErrors)})),t=[...new Set(t)],new C("Resource has not been validated:\n"+e.join("\n"),t)}this.agreement=e,this.jwkPairDest={privateJwk:t,publicJwk:JSON.parse(e.dest)},this.publicJwkOrig=JSON.parse(e.orig),await z(this.jwkPairDest.publicJwk,this.jwkPairDest.privateJwk),this.dltAgent=i;const a=await this.dltAgent.getContractAddress();if(this.agreement.ledgerContractAddress!==a)throw new Error(`Contract address ${a} does not meet agreed one ${this.agreement.ledgerContractAddress}`);this.block={}}async verifyPoO(t,i,r){await this.initialized;const a=e.encode(await H(i,this.agreement.hashAlg),!0,!1),{payload:n}=await I(t),o={...this.agreement,cipherblockDgst:a,blockCommitment:n.exchange.blockCommitment,secretCommitment:n.exchange.secretCommitment},s={proofType:"PoO",iss:"orig",exchange:{...o,id:await B(o)}},p={timestamp:Date.now(),notBefore:"iat",notAfter:"iat",...r},d=await Z(t,s,p);return this.block={jwe:i,poo:{jws:t,payload:d.payload}},this.exchange=d.payload.exchange,d}async generatePoR(){if(await this.initialized,void 0===this.exchange||void 0===this.block.poo)throw new Error("Before computing a PoR, you have first to receive a valid cipherblock with a PoO and validate the PoO");const e={proofType:"PoR",iss:"dest",exchange:this.exchange,poo:this.block.poo.jws};return this.block.por=await G(e,this.jwkPairDest.privateJwk),this.block.por}async verifyPoP(t,i){if(await this.initialized,void 0===this.exchange||void 0===this.block.por||void 0===this.block.poo)throw new Error("Cannot verify a PoP if not even a PoR have been created");const r={proofType:"PoP",iss:"orig",exchange:this.exchange,por:this.block.por.jws,secret:"",verificationCode:""},n={timestamp:Date.now(),notBefore:"iat",notAfter:1e3*this.block.poo.payload.iat+this.exchange.pooToPopDelay,...i},o=await Z(t,r,n),s=JSON.parse(o.payload.secret);return this.block.secret={hex:a(e.decode(s.k)),jwk:s},this.block.pop={jws:t,payload:o.payload},o}async getSecretFromLedger(){if(await this.initialized,void 0===this.exchange||void 0===this.block.poo||void 0===this.block.por)throw new Error("Cannot get secret if a PoR has not been sent before");const e=Date.now(),t=1e3*this.block.poo.payload.iat+this.agreement.pooToSecretDelay,i=Math.round((t-e)/1e3),{hex:r,iat:a}=await this.dltAgent.getSecretFromLedger(T(this.agreement.encAlg),this.agreement.ledgerSignerAddress,this.exchange.id,i);this.block.secret=await F(this.exchange.encAlg,r);try{_(1e3*a,1e3*this.block.por.payload.iat,1e3*this.block.poo.payload.iat+this.exchange.pooToSecretDelay)}catch(e){throw new C(`Although the secret has been obtained (and you could try to decrypt the cipherblock), it's been published later than agreed: ${new Date(1e3*a).toUTCString()} > ${new Date(1e3*this.block.poo.payload.iat+this.agreement.pooToSecretDelay).toUTCString()}`,["secret not published in time"])}return this.block.secret}async decrypt(){if(await this.initialized,void 0===this.exchange)throw new Error("No agreed exchange");if(void 0===this.block.secret?.jwk)throw new Error("Cannot decrypt without the secret");if(void 0===this.block.jwe)throw new Error("No cipherblock to decrypt");const t=(await J(this.block.jwe,this.block.secret.jwk)).plaintext;if(e.encode(await H(t,this.agreement.hashAlg),!0,!1)!==this.exchange.blockCommitment)throw new Error("Decrypted block does not meet the committed one");return this.block.raw=t,t}async generateVerificationRequest(){if(await this.initialized,void 0===this.block.por||void 0===this.exchange)throw new Error("Before generating a VerificationRequest, you have first to hold a valid PoR for the exchange");return await Q("dest",this.exchange.id,this.block.por.jws,this.jwkPairDest.privateJwk)}async generateDisputeRequest(){if(await this.initialized,void 0===this.block.por||void 0===this.block.jwe||void 0===this.exchange)throw new Error("Before generating a VerificationRequest, you have first to hold a valid PoR for the exchange and have received the cipherblock");const e={proofType:"request",iss:"dest",por:this.block.por.jws,type:"disputeRequest",cipherblock:this.block.jwe,iat:Math.floor(Date.now()/1e3),dataExchangeId:this.exchange.id},t=await R(this.jwkPairDest.privateJwk);try{return await new h(e).setProtectedHeader({alg:this.jwkPairDest.privateJwk.alg}).setIssuedAt(e.iat).sign(t)}catch(e){throw new C(e,["unexpected error"])}}},NonRepudiationOrig:class{constructor(e,t,i,r){this.jwkPairOrig={privateJwk:t,publicJwk:JSON.parse(e.orig)},this.publicJwkDest=JSON.parse(e.dest),this.block={raw:i},this.initialized=new Promise(((t,i)=>{this.init(e,r).then((()=>{t(!0)})).catch((e=>{i(e)}))}))}async init(t,r){const a=await xe(t);if(a.length>0){const e=[];let t=[];throw a.forEach((i=>{e.push(i.message),t=t.concat(i.nrErrors)})),t=[...new Set(t)],new C("Resource has not been validated:\n"+e.join("\n"),t)}this.agreement=t,await z(this.jwkPairOrig.publicJwk,this.jwkPairOrig.privateJwk);const n=await F(this.agreement.encAlg);this.block={...this.block,secret:n,jwe:await O(this.block.raw,n.jwk,this.agreement.encAlg)};const o=e.encode(await H(this.block.jwe,this.agreement.hashAlg),!0,!1),s=e.encode(await H(this.block.raw,this.agreement.hashAlg),!0,!1),p=e.encode(await H(new Uint8Array(i(this.block.secret.hex)),this.agreement.hashAlg),!0,!1),d={...this.agreement,cipherblockDgst:o,blockCommitment:s,secretCommitment:p},c=await B(d);this.exchange={...d,id:c},await this._dltSetup(r)}async _dltSetup(e){this.dltAgent=e;const t=await this.dltAgent.getAddress();if(t!==this.exchange.ledgerSignerAddress)throw new Error(`ledgerSignerAddress: ${this.exchange.ledgerSignerAddress} does not meet the address ${t} derived from the provided private key`);const i=await this.dltAgent.getContractAddress();if(i!==W(this.agreement.ledgerContractAddress,!0))throw new Error(`Contract address in use ${i} does not meet the agreed one ${this.agreement.ledgerContractAddress}`)}async generatePoO(){return await this.initialized,this.block.poo=await G({proofType:"PoO",iss:"orig",exchange:this.exchange},this.jwkPairOrig.privateJwk),this.block.poo}async verifyPoR(e,t){if(await this.initialized,void 0===this.block.poo)throw new Error("Cannot verify a PoR if not even a PoO have been created");const i={proofType:"PoR",iss:"dest",exchange:this.exchange,poo:this.block.poo.jws},r=1e3*this.block.poo.payload.iat,a={timestamp:Date.now(),notBefore:r,notAfter:r+this.exchange.pooToPorDelay,...t},n=await Z(e,i,a);return this.block.por={jws:e,payload:n.payload},this.block.por}async generatePoP(){if(await this.initialized,void 0===this.block.por)throw new Error("Before computing a PoP, you have first to have received and verified the PoR");const e=await this.dltAgent.deploySecret(this.block.secret.hex,this.exchange.id),t={proofType:"PoP",iss:"orig",exchange:this.exchange,por:this.block.por.jws,secret:JSON.stringify(this.block.secret.jwk),verificationCode:e};return this.block.pop=await G(t,this.jwkPairOrig.privateJwk),this.block.pop}async generateVerificationRequest(){if(await this.initialized,void 0===this.block.por)throw new Error("Before generating a VerificationRequest, you have first to hold a valid PoR for the exchange");return await Q("orig",this.exchange.id,this.block.por.jws,this.jwkPairOrig.privateJwk)}}});export{ee as ConflictResolution,j as ENC_ALGS,oe as EthersIoAgentDest,le as EthersIoAgentOrig,k as HASH_ALGS,ce as I3mServerWalletAgentDest,ye as I3mServerWalletAgentOrig,pe as I3mWalletAgentDest,fe as I3mWalletAgentOrig,D as KEY_AGREEMENT_ALGS,Pe as NonRepudiationProtocol,C as NrError,E as SIGNING_ALGS,me as Signers,_ as checkTimestamp,G as createProof,te as defaultDltConfig,B as exchangeId,q as generateKeys,V as getDltAddress,R as importJwk,M as jsonSort,J as jweDecrypt,O as jweEncrypt,I as jwsDecode,F as oneTimeSecret,K as parseAddress,W as parseHex,N as parseJwk,H as sha,we as validateDataExchange,xe as validateDataExchangeAgreement,be as validateDataSharingAgreementSchema,z as verifyKeyPair,Z as verifyProof}; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguYnJvd3Nlci5lc20uanMiLCJzb3VyY2VzIjpbIi4uL3NyYy90cy9jb25zdGFudHMudHMiLCIuLi9zcmMvdHMvZXJyb3JzL05yRXJyb3IudHMiLCIuLi9zcmMvdHMvY3J5cHRvL2dlbmVyYXRlS2V5cy50cyIsIi4uL3NyYy90cy9jcnlwdG8vaW1wb3J0SndrLnRzIiwiLi4vc3JjL3RzL2NyeXB0by9qd2UudHMiLCIuLi9zcmMvdHMvY3J5cHRvL2p3c0RlY29kZS50cyIsIi4uL3NyYy90cy91dGlscy9hbGdCeXRlTGVuZ3RoLnRzIiwiLi4vc3JjL3RzL2NyeXB0by9vbmVUaW1lU2VjcmV0LnRzIiwiLi4vc3JjL3RzL2NyeXB0by92ZXJpZnlLZXlQYWlyLnRzIiwiLi4vc3JjL3RzL3V0aWxzL3RpbWVzdGFtcHMudHMiLCIuLi9zcmMvdHMvdXRpbHMvanNvblNvcnQudHMiLCIuLi9zcmMvdHMvdXRpbHMvcGFyc2VIZXgudHMiLCIuLi9zcmMvdHMvdXRpbHMvcGFyc2VKd2sudHMiLCIuLi9zcmMvdHMvdXRpbHMv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Q0FRRHJLLG9CQUdFLFNBRk1SLEtBQUsrTSxpQkFFWTVMLElBQW5CbkIsS0FBS3NELE1BQU11SCxJQUNiLE1BQU0sSUFBSWxMLE1BQU0sZ0ZBR2xCLE1BQU1xVixRQUF5QmhWLEtBQUs4TSxTQUFTOEksYUFBYTVWLEtBQUtzRCxNQUFNOEIsT0FBT08sSUFBSzNGLEtBQUtxSixTQUFTNkIsSUFFekYxRyxFQUFtQyxDQUN2Q2tILFVBQVcsTUFDWGxDLElBQUssT0FDTEgsU0FBVXJKLEtBQUtxSixTQUNmd0IsSUFBSzdLLEtBQUtzRCxNQUFNdUgsSUFBSXhHLElBQ3BCZSxPQUFRWCxLQUFLdUQsVUFBVWhJLEtBQUtzRCxNQUFNOEIsT0FBT3JDLEtBQ3pDaVMsb0JBR0YsT0FEQWhWLEtBQUtzRCxNQUFNeVIsVUFBWXhMLEVBQVkvRSxFQUFTeEUsS0FBS3dWLFlBQVlsVCxZQUN0RHRDLEtBQUtzRCxNQUFNeVIsR0FDbkIsQ0FRRHZVLG9DQUdFLFNBRk1SLEtBQUsrTSxpQkFFWTVMLElBQW5CbkIsS0FBS3NELE1BQU11SCxJQUNiLE1BQU0sSUFBSWxMLE1BQU0sZ0dBR2xCLGFBQWE4TSxFQUE0QixPQUFRek0sS0FBS3FKLFNBQVM2QixHQUFJbEwsS0FBS3NELE1BQU11SCxJQUFJeEcsSUFBS3JFLEtBQUt3VixZQUFZbFQsV0FDekcifQ== diff --git a/dist/index.d.ts b/dist/index.d.ts index 5d85a96..71247ad 100644 --- a/dist/index.d.ts +++ b/dist/index.d.ts @@ -4,7 +4,6 @@ export { ContractInterface } from '@ethersproject/contracts'; import { JWK as JWK$1, JWTHeaderParameters, JWEHeaderParameters, KeyLike as KeyLike$1, CompactDecryptResult } from 'jose'; export { KeyLike } from 'jose'; import { ethers } from 'ethers'; -import { EventEmitter as EventEmitter$1 } from 'events'; import { KeyObject } from 'crypto'; declare const HASH_ALGS: readonly ["SHA-256", "SHA-384", "SHA-512"]; @@ -496,7 +495,11 @@ declare namespace WalletComponents { * i3m */ network?: string - rpcUrl?: string | string[] + /** + * example: + * http://95.211.3.250:8545 + */ + rpcUrl?: string } /** * Receipt @@ -882,8 +885,9 @@ declare namespace WalletPaths { type HashAlg = typeof HASH_ALGS[number]; type SigningAlg = typeof SIGNING_ALGS[number]; type EncryptionAlg = typeof ENC_ALGS[number]; +type DictKey = string | number | symbol; type Dict = T & { - [key: string | symbol | number]: any | undefined; + [key in DictKey]: any | undefined; }; interface Algs { hashAlg?: HashAlg; @@ -1035,14 +1039,12 @@ declare class EthersIoAgentDest extends EthersIoAgent implements NrpDltAgentDest }>; } -//# sourceMappingURL=index.d.ts.map - declare class BaseECDH { generateKeys(): Promise; getPublicKey(): Promise; deriveBits(publicKeyHex: string): Promise; } -type CipherAlgorithms = 'aes-256-gcm'; +declare type CipherAlgorithms = 'aes-256-gcm'; declare class BaseCipher { readonly algorithm: CipherAlgorithms; readonly key: Uint8Array; @@ -1152,8 +1154,8 @@ interface Transport { send: (masterKey: MasterKey, code: Uint8Array, request: Req) => Promise; finish: (protocol: WalletProtocol) => void; } -type TransportRequest = T extends Transport ? Req : never; -type TransportResponse = T extends Transport ? Res : never; +declare type TransportRequest = T extends Transport ? Req : never; +declare type TransportResponse = T extends Transport ? Res : never; declare abstract class BaseTransport implements Transport { abstract prepare(protocol: WalletProtocol, publicKey: string): Promise; abstract publicKeyExchange(protocol: WalletProtocol, publicKey: PKEData): Promise; @@ -1187,7 +1189,7 @@ interface VerificationChallengeRequest { interface AcknowledgementRequest { method: 'acknowledgement'; } -type Request = PublicKeyExchangeRequest | CommitmentRequest | NonceRevealRequest | VerificationRequest | VerificationChallengeRequest | AcknowledgementRequest; +declare type Request = PublicKeyExchangeRequest | CommitmentRequest | NonceRevealRequest | VerificationRequest | VerificationChallengeRequest | AcknowledgementRequest; interface InitiatorOptions { host: string; @@ -1221,8 +1223,8 @@ declare class HttpInitiatorTransport extends InitiatorTransport; } -type Params = Record | undefined; -type Body = any; +declare type Params = Record | undefined; +declare type Body = any; interface ApiMethod { path: string; method: string; @@ -2285,6 +2287,52 @@ interface IResolver extends IPluginMethodMap { resolveDid(args: ResolveDidArgs): Promise; } +interface BaseDialogOptions { + title?: string; + message?: string; + timeout?: number; + allowCancel?: boolean; +} +interface TextOptions extends BaseDialogOptions { + hiddenText?: boolean; + default?: string; +} +interface ConfirmationOptions extends BaseDialogOptions { + acceptMsg?: string; + rejectMsg?: string; +} +interface SelectOptions extends BaseDialogOptions { + values: T[]; + getText?: (obj: T) => string; + getContext?: (obj: T) => DialogOptionContext; +} +interface TextFormDescriptor extends TextOptions { + type: 'text'; +} +interface ConfirmationFormDescriptor extends ConfirmationOptions { + type: 'confirmation'; +} +interface SelectFormDescriptor extends SelectOptions { + type: 'select'; +} +declare type DialogOptionContext = 'success' | 'danger'; +declare type Descriptors = TextFormDescriptor | ConfirmationFormDescriptor | SelectFormDescriptor; +declare type DescriptorsMap = { + [K in keyof Partial]: Descriptors; +}; +interface FormOptions extends BaseDialogOptions { + descriptors: DescriptorsMap; + order: Array; +} +declare type DialogResponse = Promise; +interface Dialog { + text: (options: TextOptions) => DialogResponse; + confirmation: (options: ConfirmationOptions) => DialogResponse; + authenticate: () => DialogResponse; + select: (options: SelectOptions) => DialogResponse; + form: (options: FormOptions) => DialogResponse; +} + /** * An abstract class for the {@link @veramo/did-manager#DIDManager} identifier providers * @public @@ -2318,6 +2366,56 @@ declare abstract class AbstractIdentifierProvider { }, context: IAgentContext): Promise; } +declare type IContext$2 = IAgentContext; +/** + * {@link @veramo/did-manager#DIDManager} identifier provider for `did:ethr` identifiers + * @public + */ +declare class EthrDIDProvider extends AbstractIdentifierProvider { + private defaultKms; + private network; + private web3Provider?; + private rpcUrl?; + private gas?; + private ttl?; + private registry?; + constructor(options: { + defaultKms: string; + network: string; + rpcUrl?: string; + web3Provider?: object; + ttl?: number; + gas?: number; + registry?: string; + }); + createIdentifier({ kms, options }: { + kms?: string; + options?: any; + }, context: IContext$2): Promise>; + deleteIdentifier(identifier: IIdentifier, context: IContext$2): Promise; + private getWeb3Provider; + addKey({ identifier, key, options }: { + identifier: IIdentifier; + key: IKey; + options?: any; + }, context: IContext$2): Promise; + addService({ identifier, service, options }: { + identifier: IIdentifier; + service: IService; + options?: any; + }, context: IContext$2): Promise; + removeKey(args: { + identifier: IIdentifier; + kid: string; + options?: any; + }, context: IContext$2): Promise; + removeService(args: { + identifier: IIdentifier; + id: string; + options?: any; + }, context: IContext$2): Promise; +} + /*! ***************************************************************************** Copyright (C) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use @@ -3196,69 +3294,35 @@ interface ISelectiveDisclosure extends IPluginMethodMap { createProfilePresentation(args: ICreateProfileCredentialsArgs, context: IAgentContext): Promise; } -interface BaseDialogOptions { - title?: string; - message?: string; - timeout?: number; - allowCancel?: boolean; -} -interface TextOptions extends BaseDialogOptions { - hiddenText?: boolean; - default?: string; -} -interface ConfirmationOptions extends BaseDialogOptions { - acceptMsg?: string; - rejectMsg?: string; -} -interface SelectOptions extends BaseDialogOptions { - values: T[]; - getText?: (obj: T) => string; - getContext?: (obj: T) => DialogOptionContext; -} -interface TextFormDescriptor extends TextOptions { - type: 'text'; -} -interface ConfirmationFormDescriptor extends ConfirmationOptions { - type: 'confirmation'; -} -interface SelectFormDescriptor extends SelectOptions { - type: 'select'; -} -type DialogOptionContext = 'success' | 'danger'; -type Descriptors = TextFormDescriptor | ConfirmationFormDescriptor | SelectFormDescriptor; -type DescriptorsMap = { - [K in keyof Partial]: Descriptors; -}; -interface FormOptions extends BaseDialogOptions { - descriptors: DescriptorsMap; - order: Array; -} -type DialogResponse = Promise; -interface Dialog { - text: (options: TextOptions) => DialogResponse; - confirmation: (options: ConfirmationOptions) => DialogResponse; - authenticate: () => DialogResponse; - select: (options: SelectOptions) => DialogResponse; - form: (options: FormOptions) => DialogResponse; -} - interface KeyWallet { + /** + * Creates a key pair + * + * @returns a promise that resolves to the key id. + */ createAccountKeyPair: () => Promise; + /** + * Gets a public key + * + * @returns a promise that resolves to a public key + */ getPublicKey: (id: string) => Promise; + /** + * Signs input message and returns DER encoded typed array + */ signDigest: (id: string, message: T) => Promise; + /** + * @throws Error - Any error + */ delete: (id: string) => Promise; + /** + * @throws Error - Any error + */ wipe: () => Promise; } -type PluginMap = IDIDManager & IKeyManager & IResolver & IMessageHandler & ISelectiveDisclosure & ICredentialIssuer; -interface ProviderData { - network: string; - rpcUrl?: string | string[]; - web3Provider?: object; - ttl?: number; - gas?: number; - registry?: string; -} +declare type PluginMap = IDIDManager & IKeyManager & IResolver & IMessageHandler & ISelectiveDisclosure & ICredentialIssuer; +declare type ProviderData = Omit[0], 'defaultKms'>; declare class Veramo { agent: TAgent; providers: Record; @@ -3268,16 +3332,16 @@ declare class Veramo { getProvider(name: string): AbstractIdentifierProvider; } -type CanBePromise = Promise | T; -type TypedArray = Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array | BigInt64Array | BigUint64Array; -type KeyLike = Uint8Array; +declare type CanBePromise = Promise | T; +declare type TypedArray = Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array | BigInt64Array | BigUint64Array; +declare type KeyLike = Uint8Array; -type Resource$1 = WalletComponents.Schemas.Resource & WalletComponents.Schemas.ResourceId & { +declare type Resource$1 = WalletComponents.Schemas.Resource & WalletComponents.Schemas.ResourceId & { identity?: WalletComponents.Schemas.ObjectResource['identity']; } & { parentResource?: WalletComponents.Schemas.ObjectResource['parentResource']; }; -type Identity = IIdentifier; +declare type Identity = IIdentifier; interface BaseWalletModel { resources: { [id: string]: Resource$1; @@ -3287,27 +3351,56 @@ interface BaseWalletModel { }; } interface Store = Record> { + /** + * Get an item. + * + * @param key - The key of the item to get. + * @param defaultValue - The default value if the item does not exist. + */ get(key: Key): CanBePromise; get(key: Key, defaultValue: Required[Key]): CanBePromise[Key]>; + /** + * Set multiple keys at once. + * @param store + */ set(store: Partial): CanBePromise; + /** + * Set an item. + * @param key - The key of the item to set + * @param value - The value to set + */ set(key: Key, value: T[Key]): CanBePromise; set(key: string, value: unknown): CanBePromise; + /** + * Check if an item exists. + * + * @param key - The key of the item to check. + */ has(key: Key): CanBePromise; has(key: string): CanBePromise; + /** + * Delete an item. + * @param key - The key of the item to delete. + */ delete(key: Key): CanBePromise; delete(key: string): CanBePromise; + /** + * Delete all items. + */ clear: () => CanBePromise; + /** + * Return a readonly version of the complete store + * @returns The entire store + */ getStore: () => CanBePromise; + /** + * Get the path of the store + * @returns The store path + */ getPath: () => string; - on(eventName: 'changed', listener: (changedAt: number) => void): this; - on(eventName: 'cleared', listener: (changedAt: number) => void): this; - on(eventName: string | symbol, listener: (...args: any[]) => void): this; - emit(eventName: 'changed', changedAt: number): boolean; - emit(eventName: 'cleared', changedAt: number): boolean; - emit(eventName: string | symbol, ...args: any[]): boolean; } -type ToastType = 'info' | 'success' | 'warning' | 'error'; +declare type ToastType = 'info' | 'success' | 'warning' | 'error'; interface ToastOptions { message: string; type?: ToastType; @@ -3323,8 +3416,8 @@ interface Validation { validated: boolean; errors: Error[]; } -type Resource = WalletComponents.Schemas.Resource; -type Validator = (resource: T, veramo: Veramo) => Promise; +declare type Resource = WalletComponents.Schemas.Resource; +declare type Validator = (resource: T, veramo: Veramo) => Promise; declare class ResourceValidator { protected validators: { [key: string]: Validator | undefined; @@ -3373,7 +3466,7 @@ interface WalletOptionsSettings { provider?: string; providersData?: Record; } -type WalletOptions = WalletOptionsSettings & WalletOptionsCryptoWallet; +declare type WalletOptions = WalletOptionsSettings & WalletOptionsCryptoWallet; interface SelectIdentityOptions { reason?: string; @@ -3382,7 +3475,7 @@ interface TransactionOptions { transaction?: string; notifyUser?: boolean; } -type ResourceMap = BaseWalletModel['resources']; +declare type ResourceMap = BaseWalletModel['resources']; declare class BaseWallet, Model extends BaseWalletModel = BaseWalletModel> implements Wallet { dialog: Dialog; store: Store; @@ -3401,41 +3494,126 @@ declare class BaseWallet, Model extends Bas selectCredentialsForSdr(sdrMessage: IMessage): Promise; getKeyWallet(): T; call(functionMetadata: WalletFunctionMetadata): Promise; + /** + * Gets a list of identities managed by this wallet + * @returns + */ getIdentities(): Promise; + /** + * Returns a list of DIDs managed by this wallet + * + * @param queryParameters. You can filter by alias. + * @returns + */ identityList(queryParameters: WalletPaths.IdentityList.QueryParameters): Promise; + /** + * Creates an identity + * @param requestBody + * @returns the DID of the created identity + */ identityCreate(requestBody: WalletPaths.IdentityCreate.RequestBody): Promise; identitySelect(queryParameters: WalletPaths.IdentitySelect.QueryParameters): Promise; + /** + * Signs using the identity set in pathParameters. Currently suporting RAW signatures of base64url-encoded data, arbritrary JSON objects (it returns a JWT); and transactions for the DLT. + * @param pathParameters + * @param requestBody + * @returns + */ identitySign(pathParameters: WalletPaths.IdentitySign.PathParameters, requestBody: WalletPaths.IdentitySign.RequestBody): Promise; + /** + * Returns info regarding an identity. It includes DLT addresses bounded to the identity + * + * @param pathParameters + * @returns + */ identityInfo(pathParameters: WalletPaths.IdentityInfo.PathParameters): Promise; identityDeployTransaction(pathParameters: WalletPaths.IdentityDeployTransaction.PathParameters, requestBody: WalletComponents.Schemas.Transaction): Promise; + /** + * Get resources stored in the wallet's vault. It is the place where to find stored verfiable credentials, agreements, non-repudiable proofs. + * @returns + */ getResources(): Promise; private getResource; private setResource; + /** + * Gets a list of resources stored in the wallet's vault. + * @returns + */ resourceList(query: WalletPaths.ResourceList.QueryParameters): Promise; + /** + * Deletes a given resource and all its children + * @param id + */ deleteResource(id: string, requestConfirmation?: boolean): Promise; + /** + * Deletes a given identity (DID) and all its associated resources + * @param did + */ deleteIdentity(did: string): Promise; + /** + * Securely stores in the wallet a new resource. + * + * @param requestBody + * @returns and identifier of the created resource + */ resourceCreate(requestBody: WalletPaths.ResourceCreate.RequestBody): Promise; + /** + * Initiates the flow of choosing which credentials to present after a selective disclosure request. + * @param pathParameters + * @returns + */ selectiveDisclosure(pathParameters: WalletPaths.SelectiveDisclosure.PathParameters): Promise; + /** + * Deploys a transaction to the connected DLT + * @param requestBody + * @returns + */ transactionDeploy(requestBody: WalletComponents.Schemas.SignedTransaction): Promise; + /** + * Verifies a JWT resolving the public key from the signer DID (no other kind of signer supported) and optionally check values for expected payload claims. + * + * The Wallet only supports the 'ES256K1' algorithm. + * + * Useful to verify JWT created by another wallet instance. + * @param requestBody + * @returns + */ didJwtVerify(requestBody: WalletPaths.DidJwtVerify.RequestBody): Promise; + /** + * Retrieves information regarding the current connection to the DLT. + * @returns + */ providerinfoGet(): Promise; } -declare class FileStore = Record> extends EventEmitter$1 implements Store { +/** + * A class that implements a storage for the wallet in a single file. The server wallet uses a file as storage. + * + * `filepath` is the path to the Wallet's storage file. If you are using a container it should be a path to a file that persists (like one in a volume) + * + * The wallet's storage-file can be encrypted for added security. + */ +declare class FileStore = Record> implements Store { filepath: string; private key; private readonly _password?; private _passwordSalt?; initialized: Promise; defaultModel: T; + /** + * + * @param filepath an absolute path to the file that will be used to store wallet data + * @param keyObject a key object holding a 32 bytes symmetric key to use for encryption/decryption of the storage + */ constructor(filepath: string, keyObject?: KeyObject, defaultModel?: T); + /** + * + * @param filepath an absolute path to the file that will be used to store wallet data + * @param password if provided a key will be derived from the password and the store file will be encrypted + * + * @deprecated you should consider passing a more secure KeyObject derived from your password + */ constructor(filepath: string, password?: string, defaultModel?: T); - on(eventName: 'changed', listener: (changedAt: number) => void): this; - on(eventName: 'cleared', listener: (changedAt: number) => void): this; - on(eventName: string | symbol, listener: (...args: any[]) => void): this; - emit(eventName: 'changed', changedAt: number): boolean; - emit(eventName: 'cleared', changedAt: number): boolean; - emit(eventName: string | symbol, ...args: any[]): boolean; private init; deriveKey(password: string, salt?: Buffer): Promise; private getModel; @@ -3444,8 +3622,8 @@ declare class FileStore = Record> private decryptModel; get(key: any, defaultValue?: any): Promise; set(keyOrStore: any, value?: any): Promise; - has(key: any): Promise; - delete(key: any): Promise; + has(key: Key): Promise; + delete(key: Key): Promise; clear(): Promise; getStore(): Promise; getPath(): string; @@ -3472,7 +3650,7 @@ declare class ConsoleToast implements Toast { close(toastId: string): void; } -type KeyType = 'Secp256k1'; +declare type KeyType = 'Secp256k1'; interface Key { kid: string; type: KeyType; diff --git a/dist/index.node.cjs b/dist/index.node.cjs index a183690..450a7f9 100644 --- a/dist/index.node.cjs +++ b/dist/index.node.cjs @@ -1,2 +1,2 @@ -"use strict";var e=require("@juanelas/base64"),t=require("bigint-conversion"),i=require("bigint-crypto-utils"),r=require("elliptic"),a=require("jose"),n=require("object-sha"),o=(require("crypto"),require("ethers")),s=require("ethers/lib/utils"),p=require("ajv-draft-04"),d=require("ajv-formats"),c=require("lodash");function l(e){return e&&e.__esModule?e:{default:e}}function f(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(i){if("default"!==i){var r=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(t,i,r.get?r:{enumerable:!0,get:function(){return e[i]}})}})),t.default=e,Object.freeze(t)}var y=f(e),g=l(r),m=l(p),u=l(d),h=l(c);const b=["SHA-256","SHA-384","SHA-512"],w=["ES256","ES384","ES512"],x=["A128GCM","A256GCM"],P=["ECDH-ES"];class A extends Error{constructor(e,t){super(e),e instanceof A?(this.nrErrors=e.nrErrors,this.add(...t)):this.nrErrors=t}add(...e){const t=this.nrErrors.concat(e);this.nrErrors=[...new Set(t)]}}const{ec:v}=g.default;async function S(e,t){const i=void 0===t?e.alg:t,r=x.concat(w).concat(P);if(!r.includes(i))throw new A("invalid alg. Must be one of: "+r.join(","),["invalid algorithm"]);try{const i=await a.importJWK(e,t);if(null==i)throw new A(new Error("failed importing keys"),["invalid key"]);return i}catch(e){throw new A(e,["invalid key"])}}async function k(e,t,i){let r,n;const o={...t};if(x.includes(t.alg))r="dir",n=void 0!==i?i:t.alg;else{if(!w.concat(P).includes(t.alg))throw new A(`Not a valid symmetric or assymetric alg: ${t.alg}`,["encryption failed","invalid key","invalid algorithm"]);if(void 0===i)throw new A("An encryption algorith encAlg for content encryption should be provided. Allowed values are: "+x.join(","),["encryption failed"]);n=i,r="ECDH-ES",o.alg=r}const s=await S(o);let p;try{return p=await new a.CompactEncrypt(e).setProtectedHeader({alg:r,enc:n,kid:t.kid}).encrypt(s),p}catch(e){throw new A(e,["encryption failed"])}}async function E(e,t){try{const i={...t},{alg:r,enc:n}=a.decodeProtectedHeader(e);if(void 0===r||void 0===n)throw new A("missing enc or alg in jwe header",["invalid format"]);"ECDH-ES"===r&&(i.alg=r);const o=await S(i);return await a.compactDecrypt(e,o,{contentEncryptionAlgorithms:[n]})}catch(e){throw new A(e,["decryption failed"])}}async function j(e,t){const i=e.match(/^([a-zA-Z0-9_-]+)\.{1,2}([a-zA-Z0-9_-]+)\.([a-zA-Z0-9_-]+)$/);if(null===i)throw new A(new Error(`${e} is not a JWS`),["not a compact jws"]);let r,n;try{r=JSON.parse(y.decode(i[1],!0)),n=JSON.parse(y.decode(i[2],!0))}catch(e){throw new A(e,["invalid format","not a compact jws"])}if(void 0!==t){const i="function"==typeof t?await t(r,n):t,o=await S(i);try{const t=await a.jwtVerify(e,o);return{header:t.protectedHeader,payload:t.payload,signer:i}}catch(e){throw new A(e,["jws verification failed"])}}return{header:r,payload:n}}function D(e){if(x.concat(b).concat(w).includes(e))return Number(e.match(/\d{3}/)[0])/8;throw new A("unsupported algorithm",["invalid algorithm"])}async function C(i,r,n){let o;if(!x.includes(i))throw new A(new Error(`Invalid encAlg '${i}'. Supported values are: ${x.toString()}`),["invalid algorithm"]);const s=D(i);if(void 0!==r){if("string"==typeof r)if(!0===n)o=y.decode(r);else{const e=t.parseHex(r,!1);if(e!==t.parseHex(r,!1,s))throw new A(new RangeError(`Expected hex length ${2*s} does not meet provided one ${e.length/2}`),["invalid key"]);o=new Uint8Array(t.hexToBuf(r))}else o=r;if(o.length!==s)throw new A(new RangeError(`Expected secret length ${s} does not meet provided one ${o.length}`),["invalid key"])}else try{o=await a.generateSecret(i,{extractable:!0})}catch(e){throw new A(e,["unexpected error"])}const p=await a.exportJWK(o);return p.alg=i,{jwk:p,hex:t.bufToHex(e.decode(p.k),!1,s)}}async function $(e,t){if(void 0===e.alg||void 0===t.alg||e.alg!==t.alg)throw new Error("alg no present in either pubJwk or privJwk, or pubJWK.alg != privJWK.alg");const r=await S(e),n=await S(t);try{const e=await i.randBytes(16),o=await new a.GeneralSign(e).addSignature(n).setProtectedHeader({alg:t.alg}).sign();await a.generalVerify(o,r)}catch(e){throw new A(e,["unexpected error"])}}function q(e,t,i,r=2e3){if(ei+r)throw new A(new Error(`timestamp ${new Date(e).toTimeString()} after 'notAfter' ${new Date(i).toTimeString()} with tolerance of ${r/1e3}s`),["invalid timestamp"])}function O(e){return Array.isArray(e)?e.sort().map(O):(t=e,"[object Object]"===Object.prototype.toString.call(t)?Object.keys(e).sort().reduce((function(t,i){return t[i]=O(e[i]),t}),{}):e);var t}function R(e,i=!1,r){try{return t.parseHex(e,i,r)}catch(e){throw new A(e,["invalid format"])}}async function J(e,t){try{await S(e,e.alg);const i=O(e);return t?JSON.stringify(i):i}catch(e){throw new A(e,["invalid key"])}}async function T(e,t){const i=b;if(!i.includes(t))throw new A(new RangeError(`Valid hash algorith values are any of ${JSON.stringify(i)}`),["invalid algorithm"]);const r=new TextEncoder,a="string"==typeof e?r.encode(e).buffer:e;try{let e;{const i=t.toLowerCase().replace("-","");e=new Uint8Array((await Promise.resolve().then((function(){return f(require("crypto"))}))).createHash(i).update(Buffer.from(a)).digest())}return e}catch(e){throw new A(e,["unexpected error"])}}function I(e){if(null==e.match(/^(0x)?([\da-fA-F]{40})$/))throw new RangeError("incorrect address format");try{const t=R(e,!0,20);return o.ethers.utils.getAddress(t)}catch(e){throw new A(e,["invalid EIP-55 address"])}}async function F(e){return y.encode(await T(n.hashable(e),"SHA-256"),!0,!1)}async function _(e,t){if(void 0===e.iss)throw new Error('Payload iss should be set to either "orig" or "dest"');const i=JSON.parse(e.exchange[e.iss]);await $(i,t);const r=await S(t),n=t.alg,o={...e,iat:Math.floor(Date.now()/1e3)};return{jws:await new a.SignJWT(o).setProtectedHeader({alg:n}).setIssuedAt(o.iat).sign(r),payload:o}}async function z(e,t,i){const r=JSON.parse(t.exchange[t.iss]),a=await j(e,r);if(void 0===a.payload.iss)throw new Error('Property "iss" missing');if(void 0===a.payload.iat)throw new Error("Property claim iat missing");if(void 0!==i){q("iat"===i.timestamp?1e3*a.payload.iat:i.timestamp,"iat"===i.notBefore?1e3*a.payload.iat:i.notBefore,"iat"===i.notAfter?1e3*a.payload.iat:i.notAfter,i.tolerance)}const o=a.payload,s=o.exchange[o.iss];if(n.hashable(r)!==n.hashable(JSON.parse(s)))throw new Error(`The proof is issued by ${s} instead of ${JSON.stringify(r)}`);const p=t;for(const e in p){if(void 0===o[e])throw new Error(`Expected key '${e}' not found in proof`);if("exchange"===e){const e=t.exchange;M(o.exchange,e)}else if(""!==p[e]&&n.hashable(p[e])!==n.hashable(o[e]))throw new Error(`Proof's ${e}: ${JSON.stringify(o[e],void 0,2)} does not meet provided value ${JSON.stringify(p[e],void 0,2)}`)}return a}function M(e,t){const i=["id","orig","dest","hashAlg","cipherblockDgst","blockCommitment","blockCommitment","secretCommitment","schema"];for(const t of i)if("schema"!==t&&(void 0===e[t]||""===e[t]))throw new Error(`${t} is missing on dataExchange.\ndataExchange: ${JSON.stringify(e,void 0,2)}`);for(const i in t)if(""!==t[i]&&n.hashable(t[i])!==n.hashable(e[i]))throw new Error(`dataExchange's ${i}: ${JSON.stringify(e[i],void 0,2)} does not meet expected value ${JSON.stringify(t[i],void 0,2)}`)}async function W(e,t,i=10){const{payload:r}=await j(e),a=r.exchange,n={...a};delete n.id;if(await F(n)!==a.id)throw new A(new Error("data exchange integrity failed"),["dataExchange integrity violated"]);const o=JSON.parse(a.dest),s=JSON.parse(a.orig);let p,d,c;try{p=(await z(r.poo,{iss:"orig",proofType:"PoO",exchange:a})).payload}catch(e){throw new A(e,["invalid poo"])}try{await z(e,{iss:"dest",proofType:"PoR",exchange:a},{timestamp:"iat",notBefore:1e3*p.iat,notAfter:1e3*p.iat+a.pooToPorDelay})}catch(e){throw new A(e,["invalid por"])}try{const e=await t.getSecretFromLedger(D(a.encAlg),a.ledgerSignerAddress,a.id,i);d=e.hex,c=e.iat}catch(e){throw new A(e,["cannot verify"])}try{q(1e3*c,1e3*r.iat,1e3*p.iat+a.pooToSecretDelay)}catch(e){throw new A(`Although the secret has been obtained (and you could try to decrypt the cipherblock), it's been published later than agreed: ${new Date(1e3*c).toUTCString()} > ${new Date(1e3*p.iat+a.pooToSecretDelay).toUTCString()}`,["secret not published in time"])}return{pooPayload:p,porPayload:r,secretHex:d,destPublicJwk:o,origPublicJwk:s}}async function N(e,t,i=10){let r,a,n,o,s;try{r=(await j(e)).payload}catch(e){throw new A(e,["invalid verification request"])}try{const e=await W(r.por,t,i);a=e.destPublicJwk,n=e.origPublicJwk,o=e.pooPayload,s=e.porPayload}catch(e){throw new A(e,["invalid por","invalid verification request"])}try{await j(e,"dest"===r.iss?a:n)}catch(e){throw new A(e,["invalid verification request"])}return{pooPayload:o,porPayload:s,vrPayload:r,destPublicJwk:a,origPublicJwk:n}}async function H(e,t){const{payload:i}=await j(e),{destPublicJwk:r,origPublicJwk:a,secretHex:n,pooPayload:o,porPayload:s}=await W(i.por,t);try{await j(e,r)}catch(e){throw e instanceof A&&e.add("invalid dispute request"),e}if(y.encode(await T(i.cipherblock,s.exchange.hashAlg),!0,!1)!==s.exchange.cipherblockDgst)throw new A(new Error("cipherblock does not meet the committed (and already accepted) one"),["invalid dispute request"]);return await E(i.cipherblock,(await C(s.exchange.encAlg,n)).jwk),{pooPayload:o,porPayload:s,drPayload:i,destPublicJwk:r,origPublicJwk:a}}async function K(e,t,i,r){const n={proofType:"request",iss:e,dataExchangeId:t,por:i,type:"verificationRequest",iat:Math.floor(Date.now()/1e3)},o=await a.importJWK(r);return await new a.SignJWT(n).setProtectedHeader({alg:r.alg}).setIssuedAt(n.iat).sign(o)}var B=Object.freeze({__proto__:null,ConflictResolver:class{constructor(e,t){this.jwkPair=e,this.dltAgent=t,this.initialized=new Promise(((e,t)=>{this.init().then((()=>{e(!0)})).catch((e=>{t(e)}))}))}async init(){await $(this.jwkPair.publicJwk,this.jwkPair.privateJwk)}async resolveCompleteness(e){await this.initialized;const{payload:t}=await j(e);let i;try{i=(await j(t.por)).payload}catch(e){throw new A(e,["invalid por"])}const r={...await this._resolution(t.dataExchangeId,i.exchange[t.iss]),resolution:"not completed",type:"verification"};try{await N(e,this.dltAgent),r.resolution="completed"}catch(e){if(!(e instanceof A)||e.nrErrors.includes("invalid verification request")||e.nrErrors.includes("unexpected error"))throw e}const n=await a.importJWK(this.jwkPair.privateJwk);return await new a.SignJWT(r).setProtectedHeader({alg:this.jwkPair.privateJwk.alg}).setIssuedAt(r.iat).sign(n)}async resolveDispute(e){await this.initialized;const{payload:t}=await j(e);let i;try{i=(await j(t.por)).payload}catch(e){throw new A(e,["invalid por"])}const r={...await this._resolution(t.dataExchangeId,i.exchange[t.iss]),resolution:"denied",type:"dispute"};try{await H(e,this.dltAgent)}catch(e){if(!(e instanceof A&&e.nrErrors.includes("decryption failed")))throw new A(e,["cannot verify"]);r.resolution="accepted"}const n=await a.importJWK(this.jwkPair.privateJwk);return await new a.SignJWT(r).setProtectedHeader({alg:this.jwkPair.privateJwk.alg}).setIssuedAt(r.iat).sign(n)}async _resolution(e,t){return{proofType:"resolution",dataExchangeId:e,iat:Math.floor(Date.now()/1e3),iss:await J(this.jwkPair.publicJwk,!0),sub:t}}},checkCompleteness:N,checkDecryption:H,generateVerificationRequest:K,verifyPor:W,verifyResolution:async function(e,t){return await j(e,t??((e,t)=>JSON.parse(t.iss)))}});const V={gasLimit:125e5,contract:{address:"0x8d407A1722633bDD1dcf221474be7a44C05d7c2F",abi:[{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"sender",type:"address"},{indexed:!1,internalType:"uint256",name:"dataExchangeId",type:"uint256"},{indexed:!1,internalType:"uint256",name:"timestamp",type:"uint256"},{indexed:!1,internalType:"uint256",name:"secret",type:"uint256"}],name:"Registration",type:"event"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"uint256",name:"",type:"uint256"}],name:"registry",outputs:[{internalType:"uint256",name:"timestamp",type:"uint256"},{internalType:"uint256",name:"secret",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"_dataExchangeId",type:"uint256"},{internalType:"uint256",name:"_secret",type:"uint256"}],name:"setRegistry",outputs:[],stateMutability:"nonpayable",type:"function"}],transactionHash:"0x6a3828f8fe232819dc40ca66f93930b3bd1619db31a67ec34b44446b3e7c8289",receipt:{to:null,from:"0x17bd12C2134AfC1f6E9302a532eFE30C19B9E903",contractAddress:"0x8d407A1722633bDD1dcf221474be7a44C05d7c2F",transactionIndex:0,gasUsed:"253928",logsBloom:"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",blockHash:"0x0118672bb9b27679e616831d056d36291dd20cfe88c3ee2abd8f2dfce579cad4",transactionHash:"0x6a3828f8fe232819dc40ca66f93930b3bd1619db31a67ec34b44446b3e7c8289",logs:[],blockNumber:119389,cumulativeGasUsed:"253928",status:1,byzantium:!0},args:[],solcInputHash:"c528a37588793ef74285d75e08d6b8eb",metadata:'{"compiler":{"version":"0.8.4+commit.c7e474f2"},"language":"Solidity","output":{"abi":[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"dataExchangeId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"secret","type":"uint256"}],"name":"Registration","type":"event"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"registry","outputs":[{"internalType":"uint256","name":"timestamp","type":"uint256"},{"internalType":"uint256","name":"secret","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_dataExchangeId","type":"uint256"},{"internalType":"uint256","name":"_secret","type":"uint256"}],"name":"setRegistry","outputs":[],"stateMutability":"nonpayable","type":"function"}],"devdoc":{"kind":"dev","methods":{},"version":1},"userdoc":{"kind":"user","methods":{},"version":1}},"settings":{"compilationTarget":{"contracts/NonRepudiation.sol":"NonRepudiation"},"evmVersion":"istanbul","libraries":{},"metadata":{"bytecodeHash":"ipfs","useLiteralContent":true},"optimizer":{"enabled":false,"runs":200},"remappings":[]},"sources":{"contracts/NonRepudiation.sol":{"content":"//SPDX-License-Identifier: Unlicense\\npragma solidity ^0.8.0;\\n\\ncontract NonRepudiation {\\n struct Proof {\\n uint256 timestamp;\\n uint256 secret;\\n }\\n mapping(address => mapping (uint256 => Proof)) public registry;\\n event Registration(address sender, uint256 dataExchangeId, uint256 timestamp, uint256 secret);\\n\\n function setRegistry(uint256 _dataExchangeId, uint256 _secret) public {\\n require(registry[msg.sender][_dataExchangeId].secret == 0);\\n registry[msg.sender][_dataExchangeId] = Proof(block.timestamp, _secret);\\n emit Registration(msg.sender, _dataExchangeId, block.timestamp, _secret);\\n }\\n}\\n","keccak256":"0x8d371257a9b03c9102f158323e61f56ce49dd8489bd92c5a7d8abc3d9f6f8399","license":"Unlicense"}},"version":1}',bytecode:"0x608060405234801561001057600080fd5b506103a2806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c8063032439371461003b578063d05cb54514610057575b600080fd5b6100556004803603810190610050919061023a565b610088565b005b610071600480360381019061006c91906101fe565b6101a3565b60405161007f9291906102d9565b60405180910390f35b60008060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002060010154146100e757600080fd5b6040518060400160405280428152602001828152506000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002060008201518160000155602082015181600101559050507faa58599838af2e5e0f3251cfbb4eac5d5d447ded49f6b0ac28d6b44098224e63338342846040516101979493929190610294565b60405180910390a15050565b6000602052816000526040600020602052806000526040600020600091509150508060000154908060010154905082565b6000813590506101e38161033e565b92915050565b6000813590506101f881610355565b92915050565b6000806040838503121561021157600080fd5b600061021f858286016101d4565b9250506020610230858286016101e9565b9150509250929050565b6000806040838503121561024d57600080fd5b600061025b858286016101e9565b925050602061026c858286016101e9565b9150509250929050565b61027f81610302565b82525050565b61028e81610334565b82525050565b60006080820190506102a96000830187610276565b6102b66020830186610285565b6102c36040830185610285565b6102d06060830184610285565b95945050505050565b60006040820190506102ee6000830185610285565b6102fb6020830184610285565b9392505050565b600061030d82610314565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b61034781610302565b811461035257600080fd5b50565b61035e81610334565b811461036957600080fd5b5056fea26469706673582212204fd0fc653fb487221da9a14a4ca5d5499f9e9bc7b27ac8ab0f8d397fd6e3148564736f6c63430008040033",deployedBytecode:"0x608060405234801561001057600080fd5b50600436106100365760003560e01c8063032439371461003b578063d05cb54514610057575b600080fd5b6100556004803603810190610050919061023a565b610088565b005b610071600480360381019061006c91906101fe565b6101a3565b60405161007f9291906102d9565b60405180910390f35b60008060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002060010154146100e757600080fd5b6040518060400160405280428152602001828152506000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002060008201518160000155602082015181600101559050507faa58599838af2e5e0f3251cfbb4eac5d5d447ded49f6b0ac28d6b44098224e63338342846040516101979493929190610294565b60405180910390a15050565b6000602052816000526040600020602052806000526040600020600091509150508060000154908060010154905082565b6000813590506101e38161033e565b92915050565b6000813590506101f881610355565b92915050565b6000806040838503121561021157600080fd5b600061021f858286016101d4565b9250506020610230858286016101e9565b9150509250929050565b6000806040838503121561024d57600080fd5b600061025b858286016101e9565b925050602061026c858286016101e9565b9150509250929050565b61027f81610302565b82525050565b61028e81610334565b82525050565b60006080820190506102a96000830187610276565b6102b66020830186610285565b6102c36040830185610285565b6102d06060830184610285565b95945050505050565b60006040820190506102ee6000830185610285565b6102fb6020830184610285565b9392505050565b600061030d82610314565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b61034781610302565b811461035257600080fd5b50565b61035e81610334565b811461036957600080fd5b5056fea26469706673582212204fd0fc653fb487221da9a14a4ca5d5499f9e9bc7b27ac8ab0f8d397fd6e3148564736f6c63430008040033",devdoc:{kind:"dev",methods:{},version:1},userdoc:{kind:"user",methods:{},version:1},storageLayout:{storage:[{astId:13,contract:"contracts/NonRepudiation.sol:NonRepudiation",label:"registry",offset:0,slot:"0",type:"t_mapping(t_address,t_mapping(t_uint256,t_struct(Proof)6_storage))"}],types:{t_address:{encoding:"inplace",label:"address",numberOfBytes:"20"},"t_mapping(t_address,t_mapping(t_uint256,t_struct(Proof)6_storage))":{encoding:"mapping",key:"t_address",label:"mapping(address => mapping(uint256 => struct NonRepudiation.Proof))",numberOfBytes:"32",value:"t_mapping(t_uint256,t_struct(Proof)6_storage)"},"t_mapping(t_uint256,t_struct(Proof)6_storage)":{encoding:"mapping",key:"t_uint256",label:"mapping(uint256 => struct NonRepudiation.Proof)",numberOfBytes:"32",value:"t_struct(Proof)6_storage"},"t_struct(Proof)6_storage":{encoding:"inplace",label:"struct NonRepudiation.Proof",members:[{astId:3,contract:"contracts/NonRepudiation.sol:NonRepudiation",label:"timestamp",offset:0,slot:"0",type:"t_uint256"},{astId:5,contract:"contracts/NonRepudiation.sol:NonRepudiation",label:"secret",offset:0,slot:"1",type:"t_uint256"}],numberOfBytes:"64"},t_uint256:{encoding:"inplace",label:"uint256",numberOfBytes:"32"}}}}};async function G(e,i,r,a,n){let s=o.ethers.BigNumber.from(0),p=o.ethers.BigNumber.from(0);const d=R(t.bufToHex(y.decode(r)),!0);let c=0;do{try{({secret:s,timestamp:p}=await e.registry(R(i,!0),d))}catch(e){throw new A(e,["cannot contact the ledger"])}s.isZero()&&(c++,await new Promise((e=>setTimeout(e,1e3))))}while(s.isZero()&&c{null!==e&&"object"==typeof e&&"function"==typeof e.then?e.then((e=>{this.dltConfig={...V,...e},this.provider=new o.ethers.providers.JsonRpcProvider(this.dltConfig.rpcProviderUrl),this.contract=new o.ethers.Contract(this.dltConfig.contract.address,this.dltConfig.contract.abi,this.provider),t(!0)})).catch((e=>i(e))):(this.dltConfig={...V,...e},this.provider=new o.ethers.providers.JsonRpcProvider(this.dltConfig.rpcProviderUrl),this.contract=new o.ethers.Contract(this.dltConfig.contract.address,this.dltConfig.contract.abi,this.provider),t(!0))}))}async getContractAddress(){return await this.initialized,this.contract.address}}class U extends L{async getSecretFromLedger(e,t,i,r){return await this.initialized,await G(this.contract,t,i,r,e)}}class Y extends L{constructor(e,t,i){super(new Promise(((t,r)=>{e.providerinfo.get().then((e=>{const a=e.rpcUrl;void 0===a?r(new Error("wallet is not connected to RPC endpoint")):t({...i,rpcProviderUrl:"string"==typeof a?a:a[0]})})).catch((e=>{r(e)}))}))),this.wallet=e,this.did=t}}class Q extends Y{async getSecretFromLedger(e,t,i,r){return await this.initialized,await G(this.contract,t,i,r,e)}}class ee extends L{constructor(e,t,i){super(new Promise(((t,r)=>{e.providerinfoGet().then((e=>{const a=e.rpcUrl;void 0===a?r(new Error("wallet is not connected to RPC endpoint")):t({...i,rpcProviderUrl:"string"==typeof a?a:a[0]})})).catch((e=>{r(e)}))}))),this.wallet=e,this.did=t}}class te extends ee{async getSecretFromLedger(e,t,i,r){return await this.initialized,await G(this.contract,t,i,r,e)}}class ie extends L{constructor(e,r){let a;super(e),this.count=-1,a=void 0===r?i.randBytesSync(32):"string"==typeof r?new Uint8Array(t.hexToBuf(r)):r;const n=new s.SigningKey(a);this.signer=new o.Wallet(n,this.provider)}async deploySecret(e,t){await this.initialized;const i=await Z(e,t,this),r=await this.signer.signTransaction(i),a=await this.signer.provider.sendTransaction(r);return this.count=this.count+1,a.hash}async getAddress(){return await this.initialized,this.signer.address}async nextNonce(){await this.initialized;const e=await this.provider.getTransactionCount(await this.getAddress(),"pending");return e>this.count&&(this.count=e),this.count}}class re extends Y{constructor(){super(...arguments),this.count=-1}async deploySecret(e,t){await this.initialized;const i=await Z(e,t,this),r=(await this.wallet.identities.sign({did:this.did},{type:"Transaction",data:i})).signature,a=await this.provider.sendTransaction(r);return this.count=this.count+1,a.hash}async getAddress(){await this.initialized;const e=await this.wallet.identities.info({did:this.did});if(void 0===e.addresses)throw new A(new Error("no addresses for did "+this.did),["unexpected error"]);return e.addresses[0]}async nextNonce(){await this.initialized;const e=await this.provider.getTransactionCount(await this.getAddress(),"pending");return e>this.count&&(this.count=e),this.count}}class ae extends ee{constructor(){super(...arguments),this.count=-1}async deploySecret(e,t){await this.initialized;const i=await Z(e,t,this),r=(await this.wallet.identitySign({did:this.did},{type:"Transaction",data:i})).signature,a=await this.provider.sendTransaction(r);return this.count=this.count+1,a.hash}async getAddress(){await this.initialized;const e=await this.wallet.identityInfo({did:this.did});if(void 0===e.addresses)throw new A(`Can't get address for did: ${this.did}`,["unexpected error"]);return e.addresses[0]}async nextNonce(){await this.initialized;const e=await this.provider.getTransactionCount(await this.getAddress(),"pending");return e>this.count&&(this.count=e),this.count}}var ne=Object.freeze({__proto__:null,EthersIoAgentDest:U,EthersIoAgentOrig:ie,I3mServerWalletAgentDest:te,I3mServerWalletAgentOrig:ae,I3mWalletAgentDest:Q,I3mWalletAgentOrig:re}),oe={schemas:{IdentitySelectOutput:{title:"IdentitySelectOutput",type:"object",properties:{did:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},required:["did"]},SignInput:{title:"SignInput",oneOf:[{title:"SignTransaction",type:"object",properties:{type:{enum:["Transaction"]},data:{title:"Transaction",type:"object",additionalProperties:!0,properties:{from:{type:"string"},to:{type:"string"},nonce:{type:"number"}}}},required:["type","data"]},{title:"SignRaw",type:"object",properties:{type:{enum:["Raw"]},data:{type:"object",properties:{payload:{description:"Base64Url encoded data to sign",type:"string",pattern:"^[A-Za-z0-9_-]+$"}},required:["payload"]}},required:["type","data"]},{title:"SignJWT",type:"object",properties:{type:{enum:["JWT"]},data:{type:"object",properties:{header:{description:'header fields to be added to the JWS header. "alg" and "kid" will be ignored since they are automatically added by the wallet.',type:"object",additionalProperties:!0},payload:{description:"A JSON object to be signed by the wallet. It will become the payload of the generated JWS. 'iss' (issuer) and 'iat' (issued at) will be automatically added by the wallet and will override provided values.",type:"object",additionalProperties:!0}},required:["payload"]}},required:["type","data"]}]},SignRaw:{title:"SignRaw",type:"object",properties:{type:{enum:["Raw"]},data:{type:"object",properties:{payload:{description:"Base64Url encoded data to sign",type:"string",pattern:"^[A-Za-z0-9_-]+$"}},required:["payload"]}},required:["type","data"]},SignTransaction:{title:"SignTransaction",type:"object",properties:{type:{enum:["Transaction"]},data:{title:"Transaction",type:"object",additionalProperties:!0,properties:{from:{type:"string"},to:{type:"string"},nonce:{type:"number"}}}},required:["type","data"]},SignJWT:{title:"SignJWT",type:"object",properties:{type:{enum:["JWT"]},data:{type:"object",properties:{header:{description:'header fields to be added to the JWS header. "alg" and "kid" will be ignored since they are automatically added by the wallet.',type:"object",additionalProperties:!0},payload:{description:"A JSON object to be signed by the wallet. It will become the payload of the generated JWS. 'iss' (issuer) and 'iat' (issued at) will be automatically added by the wallet and will override provided values.",type:"object",additionalProperties:!0}},required:["payload"]}},required:["type","data"]},Transaction:{title:"Transaction",type:"object",additionalProperties:!0,properties:{from:{type:"string"},to:{type:"string"},nonce:{type:"number"}}},SignOutput:{title:"SignOutput",type:"object",properties:{signature:{type:"string"}},required:["signature"]},Receipt:{title:"Receipt",type:"object",properties:{receipt:{type:"string"}},required:["receipt"]},SignTypes:{title:"SignTypes",type:"string",enum:["Transaction","Raw","JWT"]},IdentityListInput:{title:"IdentityListInput",description:"A list of DIDs",type:"array",items:{type:"object",properties:{did:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},required:["did"]}},IdentityCreateInput:{title:"IdentityCreateInput",description:'Besides the here defined options, provider specific properties should be added here if necessary, e.g. "path" for BIP21 wallets, or the key algorithm (if the wallet supports multiple algorithm).\n',type:"object",properties:{alias:{type:"string"}},additionalProperties:!0},IdentityCreateOutput:{title:"IdentityCreateOutput",description:"It returns the account id and type\n",type:"object",properties:{did:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},additionalProperties:!0,required:["did"]},ResourceListOutput:{title:"ResourceListOutput",description:"A list of resources",type:"array",items:{title:"Resource",anyOf:[{title:"VerifiableCredential",type:"object",properties:{type:{example:"VerifiableCredential",enum:["VerifiableCredential"]},name:{type:"string",example:"Resource name"},resource:{type:"object",properties:{"@context":{type:"array",items:{type:"string"},example:["https://www.w3.org/2018/credentials/v1"]},id:{type:"string",example:"http://example.edu/credentials/1872"},type:{type:"array",items:{type:"string"},example:["VerifiableCredential"]},issuer:{type:"object",properties:{id:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},additionalProperties:!0,required:["id"]},issuanceDate:{type:"string",format:"date-time",example:"2021-06-10T19:07:28.000Z"},credentialSubject:{type:"object",properties:{id:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},required:["id"],additionalProperties:!0},proof:{type:"object",properties:{type:{type:"string",enum:["JwtProof2020"]}},required:["type"],additionalProperties:!0}},additionalProperties:!0,required:["@context","type","issuer","issuanceDate","credentialSubject","proof"]}},required:["type","resource"]},{title:"ObjectResource",type:"object",properties:{type:{example:"Object",enum:["Object"]},name:{type:"string",example:"Resource name"},parentResource:{type:"string"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",additionalProperties:!0}},required:["type","resource"]},{title:"JWK pair",type:"object",properties:{type:{example:"KeyPair",enum:["KeyPair"]},name:{type:"string",example:"Resource name"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",properties:{keyPair:{type:"object",properties:{privateJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents a private key (complementary to `publicJwk`)\n",example:'{"alg":"ES256","crv":"P-256","d":"rQp_3eZzvXwt1sK7WWsRhVYipqNGblzYDKKaYirlqs0","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'},publicJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents the public key (complementary to `privateJwk`).\n",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'}},required:["privateJwk","publicJwk"]}},required:["keyPair"]}},required:["type","resource"]},{title:"Contract",type:"object",properties:{type:{example:"Contract",enum:["Contract"]},name:{type:"string",example:"Resource name"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",properties:{dataSharingAgreement:{type:"object",required:["dataOfferingDescription","parties","purpose","duration","intendedUse","licenseGrant","dataStream","personalData","pricingModel","dataExchangeAgreement","signatures"],properties:{dataOfferingDescription:{type:"object",required:["dataOfferingId","version","active"],properties:{dataOfferingId:{type:"string"},version:{type:"integer"},category:{type:"string"},active:{type:"boolean"},title:{type:"string"}}},parties:{type:"object",required:["providerDid","consumerDid"],properties:{providerDid:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},consumerDid:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}}},purpose:{type:"string"},duration:{type:"object",required:["creationDate","startDate","endDate"],properties:{creationDate:{type:"integer"},startDate:{type:"integer"},endDate:{type:"integer"}}},intendedUse:{type:"object",required:["processData","shareDataWithThirdParty","editData"],properties:{processData:{type:"boolean"},shareDataWithThirdParty:{type:"boolean"},editData:{type:"boolean"}}},licenseGrant:{type:"object",required:["transferable","exclusiveness","paidUp","revocable","processing","modifying","analyzing","storingData","storingCopy","reproducing","distributing","loaning","selling","renting","furtherLicensing","leasing"],properties:{transferable:{type:"boolean"},exclusiveness:{type:"boolean"},paidUp:{type:"boolean"},revocable:{type:"boolean"},processing:{type:"boolean"},modifying:{type:"boolean"},analyzing:{type:"boolean"},storingData:{type:"boolean"},storingCopy:{type:"boolean"},reproducing:{type:"boolean"},distributing:{type:"boolean"},loaning:{type:"boolean"},selling:{type:"boolean"},renting:{type:"boolean"},furtherLicensing:{type:"boolean"},leasing:{type:"boolean"}}},dataStream:{type:"boolean"},personalData:{type:"boolean"},pricingModel:{type:"object",required:["basicPrice","currency","hasFreePrice"],properties:{paymentType:{type:"string"},pricingModelName:{type:"string"},basicPrice:{type:"number",format:"float"},currency:{type:"string"},fee:{type:"number",format:"float"},hasPaymentOnSubscription:{type:"object",properties:{paymentOnSubscriptionName:{type:"string"},paymentType:{type:"string"},timeDuration:{type:"string"},description:{type:"string"},repeat:{type:"string"},hasSubscriptionPrice:{type:"number"}}},hasFreePrice:{type:"object",properties:{hasPriceFree:{type:"boolean"}}}}},dataExchangeAgreement:{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},signatures:{type:"object",required:["providerSignature","consumerSignature"],properties:{providerSignature:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"},consumerSignature:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"}}}}},keyPair:{type:"object",properties:{privateJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents a private key (complementary to `publicJwk`)\n",example:'{"alg":"ES256","crv":"P-256","d":"rQp_3eZzvXwt1sK7WWsRhVYipqNGblzYDKKaYirlqs0","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'},publicJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents the public key (complementary to `privateJwk`).\n",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'}},required:["privateJwk","publicJwk"]}},required:["dataSharingAgreement"]}},required:["type","resource"]},{title:"NonRepudiationProof",type:"object",properties:{type:{example:"NonRepudiationProof",enum:["NonRepudiationProof"]},name:{type:"string",example:"Resource name"},resource:{description:"a non-repudiation proof (either a PoO, a PoR or a PoP) as a compact JWS"}},required:["type","resource"]},{title:"DataExchangeResource",type:"object",properties:{type:{example:"DataExchange",enum:["DataExchange"]},name:{type:"string",example:"Resource name"},resource:{allOf:[{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},{type:"object",properties:{cipherblockDgst:{type:"string",description:"hash of the cipherblock in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"},blockCommitment:{type:"string",description:"hash of the plaintext block in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"},secretCommitment:{type:"string",description:"ash of the secret that can be used to decrypt the block in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"}},required:["cipherblockDgst","blockCommitment","secretCommitment"]}]}},required:["type","resource"]}]}},Resource:{title:"Resource",anyOf:[{title:"VerifiableCredential",type:"object",properties:{type:{example:"VerifiableCredential",enum:["VerifiableCredential"]},name:{type:"string",example:"Resource name"},resource:{type:"object",properties:{"@context":{type:"array",items:{type:"string"},example:["https://www.w3.org/2018/credentials/v1"]},id:{type:"string",example:"http://example.edu/credentials/1872"},type:{type:"array",items:{type:"string"},example:["VerifiableCredential"]},issuer:{type:"object",properties:{id:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},additionalProperties:!0,required:["id"]},issuanceDate:{type:"string",format:"date-time",example:"2021-06-10T19:07:28.000Z"},credentialSubject:{type:"object",properties:{id:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},required:["id"],additionalProperties:!0},proof:{type:"object",properties:{type:{type:"string",enum:["JwtProof2020"]}},required:["type"],additionalProperties:!0}},additionalProperties:!0,required:["@context","type","issuer","issuanceDate","credentialSubject","proof"]}},required:["type","resource"]},{title:"ObjectResource",type:"object",properties:{type:{example:"Object",enum:["Object"]},name:{type:"string",example:"Resource name"},parentResource:{type:"string"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",additionalProperties:!0}},required:["type","resource"]},{title:"JWK pair",type:"object",properties:{type:{example:"KeyPair",enum:["KeyPair"]},name:{type:"string",example:"Resource name"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",properties:{keyPair:{type:"object",properties:{privateJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents a private key (complementary to `publicJwk`)\n",example:'{"alg":"ES256","crv":"P-256","d":"rQp_3eZzvXwt1sK7WWsRhVYipqNGblzYDKKaYirlqs0","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'},publicJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents the public key (complementary to `privateJwk`).\n",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'}},required:["privateJwk","publicJwk"]}},required:["keyPair"]}},required:["type","resource"]},{title:"Contract",type:"object",properties:{type:{example:"Contract",enum:["Contract"]},name:{type:"string",example:"Resource name"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",properties:{dataSharingAgreement:{type:"object",required:["dataOfferingDescription","parties","purpose","duration","intendedUse","licenseGrant","dataStream","personalData","pricingModel","dataExchangeAgreement","signatures"],properties:{dataOfferingDescription:{type:"object",required:["dataOfferingId","version","active"],properties:{dataOfferingId:{type:"string"},version:{type:"integer"},category:{type:"string"},active:{type:"boolean"},title:{type:"string"}}},parties:{type:"object",required:["providerDid","consumerDid"],properties:{providerDid:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},consumerDid:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}}},purpose:{type:"string"},duration:{type:"object",required:["creationDate","startDate","endDate"],properties:{creationDate:{type:"integer"},startDate:{type:"integer"},endDate:{type:"integer"}}},intendedUse:{type:"object",required:["processData","shareDataWithThirdParty","editData"],properties:{processData:{type:"boolean"},shareDataWithThirdParty:{type:"boolean"},editData:{type:"boolean"}}},licenseGrant:{type:"object",required:["transferable","exclusiveness","paidUp","revocable","processing","modifying","analyzing","storingData","storingCopy","reproducing","distributing","loaning","selling","renting","furtherLicensing","leasing"],properties:{transferable:{type:"boolean"},exclusiveness:{type:"boolean"},paidUp:{type:"boolean"},revocable:{type:"boolean"},processing:{type:"boolean"},modifying:{type:"boolean"},analyzing:{type:"boolean"},storingData:{type:"boolean"},storingCopy:{type:"boolean"},reproducing:{type:"boolean"},distributing:{type:"boolean"},loaning:{type:"boolean"},selling:{type:"boolean"},renting:{type:"boolean"},furtherLicensing:{type:"boolean"},leasing:{type:"boolean"}}},dataStream:{type:"boolean"},personalData:{type:"boolean"},pricingModel:{type:"object",required:["basicPrice","currency","hasFreePrice"],properties:{paymentType:{type:"string"},pricingModelName:{type:"string"},basicPrice:{type:"number",format:"float"},currency:{type:"string"},fee:{type:"number",format:"float"},hasPaymentOnSubscription:{type:"object",properties:{paymentOnSubscriptionName:{type:"string"},paymentType:{type:"string"},timeDuration:{type:"string"},description:{type:"string"},repeat:{type:"string"},hasSubscriptionPrice:{type:"number"}}},hasFreePrice:{type:"object",properties:{hasPriceFree:{type:"boolean"}}}}},dataExchangeAgreement:{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},signatures:{type:"object",required:["providerSignature","consumerSignature"],properties:{providerSignature:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"},consumerSignature:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"}}}}},keyPair:{type:"object",properties:{privateJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents a private key (complementary to `publicJwk`)\n",example:'{"alg":"ES256","crv":"P-256","d":"rQp_3eZzvXwt1sK7WWsRhVYipqNGblzYDKKaYirlqs0","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'},publicJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents the public key (complementary to `privateJwk`).\n",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'}},required:["privateJwk","publicJwk"]}},required:["dataSharingAgreement"]}},required:["type","resource"]},{title:"NonRepudiationProof",type:"object",properties:{type:{example:"NonRepudiationProof",enum:["NonRepudiationProof"]},name:{type:"string",example:"Resource name"},resource:{description:"a non-repudiation proof (either a PoO, a PoR or a PoP) as a compact JWS"}},required:["type","resource"]},{title:"DataExchangeResource",type:"object",properties:{type:{example:"DataExchange",enum:["DataExchange"]},name:{type:"string",example:"Resource name"},resource:{allOf:[{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},{type:"object",properties:{cipherblockDgst:{type:"string",description:"hash of the cipherblock in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"},blockCommitment:{type:"string",description:"hash of the plaintext block in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"},secretCommitment:{type:"string",description:"ash of the secret that can be used to decrypt the block in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"}},required:["cipherblockDgst","blockCommitment","secretCommitment"]}]}},required:["type","resource"]}]},VerifiableCredential:{title:"VerifiableCredential",type:"object",properties:{type:{example:"VerifiableCredential",enum:["VerifiableCredential"]},name:{type:"string",example:"Resource name"},resource:{type:"object",properties:{"@context":{type:"array",items:{type:"string"},example:["https://www.w3.org/2018/credentials/v1"]},id:{type:"string",example:"http://example.edu/credentials/1872"},type:{type:"array",items:{type:"string"},example:["VerifiableCredential"]},issuer:{type:"object",properties:{id:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},additionalProperties:!0,required:["id"]},issuanceDate:{type:"string",format:"date-time",example:"2021-06-10T19:07:28.000Z"},credentialSubject:{type:"object",properties:{id:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},required:["id"],additionalProperties:!0},proof:{type:"object",properties:{type:{type:"string",enum:["JwtProof2020"]}},required:["type"],additionalProperties:!0}},additionalProperties:!0,required:["@context","type","issuer","issuanceDate","credentialSubject","proof"]}},required:["type","resource"]},ObjectResource:{title:"ObjectResource",type:"object",properties:{type:{example:"Object",enum:["Object"]},name:{type:"string",example:"Resource name"},parentResource:{type:"string"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",additionalProperties:!0}},required:["type","resource"]},KeyPair:{title:"JWK pair",type:"object",properties:{type:{example:"KeyPair",enum:["KeyPair"]},name:{type:"string",example:"Resource name"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",properties:{keyPair:{type:"object",properties:{privateJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents a private key (complementary to `publicJwk`)\n",example:'{"alg":"ES256","crv":"P-256","d":"rQp_3eZzvXwt1sK7WWsRhVYipqNGblzYDKKaYirlqs0","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'},publicJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents the public key (complementary to `privateJwk`).\n",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'}},required:["privateJwk","publicJwk"]}},required:["keyPair"]}},required:["type","resource"]},Contract:{title:"Contract",type:"object",properties:{type:{example:"Contract",enum:["Contract"]},name:{type:"string",example:"Resource name"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",properties:{dataSharingAgreement:{type:"object",required:["dataOfferingDescription","parties","purpose","duration","intendedUse","licenseGrant","dataStream","personalData","pricingModel","dataExchangeAgreement","signatures"],properties:{dataOfferingDescription:{type:"object",required:["dataOfferingId","version","active"],properties:{dataOfferingId:{type:"string"},version:{type:"integer"},category:{type:"string"},active:{type:"boolean"},title:{type:"string"}}},parties:{type:"object",required:["providerDid","consumerDid"],properties:{providerDid:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},consumerDid:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}}},purpose:{type:"string"},duration:{type:"object",required:["creationDate","startDate","endDate"],properties:{creationDate:{type:"integer"},startDate:{type:"integer"},endDate:{type:"integer"}}},intendedUse:{type:"object",required:["processData","shareDataWithThirdParty","editData"],properties:{processData:{type:"boolean"},shareDataWithThirdParty:{type:"boolean"},editData:{type:"boolean"}}},licenseGrant:{type:"object",required:["transferable","exclusiveness","paidUp","revocable","processing","modifying","analyzing","storingData","storingCopy","reproducing","distributing","loaning","selling","renting","furtherLicensing","leasing"],properties:{transferable:{type:"boolean"},exclusiveness:{type:"boolean"},paidUp:{type:"boolean"},revocable:{type:"boolean"},processing:{type:"boolean"},modifying:{type:"boolean"},analyzing:{type:"boolean"},storingData:{type:"boolean"},storingCopy:{type:"boolean"},reproducing:{type:"boolean"},distributing:{type:"boolean"},loaning:{type:"boolean"},selling:{type:"boolean"},renting:{type:"boolean"},furtherLicensing:{type:"boolean"},leasing:{type:"boolean"}}},dataStream:{type:"boolean"},personalData:{type:"boolean"},pricingModel:{type:"object",required:["basicPrice","currency","hasFreePrice"],properties:{paymentType:{type:"string"},pricingModelName:{type:"string"},basicPrice:{type:"number",format:"float"},currency:{type:"string"},fee:{type:"number",format:"float"},hasPaymentOnSubscription:{type:"object",properties:{paymentOnSubscriptionName:{type:"string"},paymentType:{type:"string"},timeDuration:{type:"string"},description:{type:"string"},repeat:{type:"string"},hasSubscriptionPrice:{type:"number"}}},hasFreePrice:{type:"object",properties:{hasPriceFree:{type:"boolean"}}}}},dataExchangeAgreement:{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},signatures:{type:"object",required:["providerSignature","consumerSignature"],properties:{providerSignature:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"},consumerSignature:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"}}}}},keyPair:{type:"object",properties:{privateJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents a private key (complementary to `publicJwk`)\n",example:'{"alg":"ES256","crv":"P-256","d":"rQp_3eZzvXwt1sK7WWsRhVYipqNGblzYDKKaYirlqs0","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'},publicJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents the public key (complementary to `privateJwk`).\n",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'}},required:["privateJwk","publicJwk"]}},required:["dataSharingAgreement"]}},required:["type","resource"]},DataExchangeResource:{title:"DataExchangeResource",type:"object",properties:{type:{example:"DataExchange",enum:["DataExchange"]},name:{type:"string",example:"Resource name"},resource:{allOf:[{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},{type:"object",properties:{cipherblockDgst:{type:"string",description:"hash of the cipherblock in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"},blockCommitment:{type:"string",description:"hash of the plaintext block in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"},secretCommitment:{type:"string",description:"ash of the secret that can be used to decrypt the block in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"}},required:["cipherblockDgst","blockCommitment","secretCommitment"]}]}},required:["type","resource"]},NonRepudiationProof:{title:"NonRepudiationProof",type:"object",properties:{type:{example:"NonRepudiationProof",enum:["NonRepudiationProof"]},name:{type:"string",example:"Resource name"},resource:{description:"a non-repudiation proof (either a PoO, a PoR or a PoP) as a compact JWS"}},required:["type","resource"]},ResourceId:{type:"object",properties:{id:{type:"string"}},required:["id"]},ResourceType:{type:"string",enum:["VerifiableCredential","Object","KeyPair","Contract","DataExchange","NonRepudiationProof"]},SignedTransaction:{title:"SignedTransaction",description:"A list of resources",type:"object",properties:{transaction:{type:"string",pattern:"^0x(?:[A-Fa-f0-9])+$"}}},DecodedJwt:{title:"JwtPayload",type:"object",properties:{header:{type:"object",properties:{typ:{type:"string",enum:["JWT"]},alg:{type:"string",enum:["ES256K"]}},required:["typ","alg"],additionalProperties:!0},payload:{type:"object",properties:{iss:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},required:["iss"],additionalProperties:!0},signature:{type:"string",format:"^[A-Za-z0-9_-]+$"},data:{type:"string",format:"^[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+$",description:"."}},required:["signature","data"]},VerificationOutput:{title:"VerificationOutput",type:"object",properties:{verification:{type:"string",enum:["success","failed"],description:"whether verification has been successful or has failed"},error:{type:"string",description:"error message if verification failed"},decodedJwt:{description:"the decoded JWT"}},required:["verification"]},ProviderData:{title:"ProviderData",description:"A JSON object with information of the DLT provider currently in use.",type:"object",properties:{provider:{type:"string",example:"did:ethr:i3m"},network:{type:"string",example:"i3m"},rpcUrl:{oneOf:[{type:"string",example:"http://95.211.3.250:8545"},{type:"array",items:{type:"string"},uniqueItems:!0,example:["http://95.211.3.249:8545","http://95.211.3.250:8545"]}]}},additionalProperties:!0},EthereumAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},did:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},IdentityData:{title:"Identity Data",type:"object",properties:{did:{type:"string",example:"did:ethr:i3m:0x03142f480f831e835822fc0cd35726844a7069d28df58fb82037f1598812e1ade8"},alias:{type:"string",example:"identity1"},provider:{type:"string",example:"did:ethr:i3m"},addresses:{type:"array",items:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},example:["0x8646cAcF516de1292be1D30AB68E7Ea51e9B1BE7"]}},required:["did"]},ApiError:{type:"object",title:"Error",required:["code","message"],properties:{code:{type:"integer",format:"int32"},message:{type:"string"}}},JwkPair:{type:"object",properties:{privateJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents a private key (complementary to `publicJwk`)\n",example:'{"alg":"ES256","crv":"P-256","d":"rQp_3eZzvXwt1sK7WWsRhVYipqNGblzYDKKaYirlqs0","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'},publicJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents the public key (complementary to `privateJwk`).\n",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'}},required:["privateJwk","publicJwk"]},CompactJWS:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"},DataExchangeAgreement:{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},DataSharingAgreement:{type:"object",required:["dataOfferingDescription","parties","purpose","duration","intendedUse","licenseGrant","dataStream","personalData","pricingModel","dataExchangeAgreement","signatures"],properties:{dataOfferingDescription:{type:"object",required:["dataOfferingId","version","active"],properties:{dataOfferingId:{type:"string"},version:{type:"integer"},category:{type:"string"},active:{type:"boolean"},title:{type:"string"}}},parties:{type:"object",required:["providerDid","consumerDid"],properties:{providerDid:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},consumerDid:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}}},purpose:{type:"string"},duration:{type:"object",required:["creationDate","startDate","endDate"],properties:{creationDate:{type:"integer"},startDate:{type:"integer"},endDate:{type:"integer"}}},intendedUse:{type:"object",required:["processData","shareDataWithThirdParty","editData"],properties:{processData:{type:"boolean"},shareDataWithThirdParty:{type:"boolean"},editData:{type:"boolean"}}},licenseGrant:{type:"object",required:["transferable","exclusiveness","paidUp","revocable","processing","modifying","analyzing","storingData","storingCopy","reproducing","distributing","loaning","selling","renting","furtherLicensing","leasing"],properties:{transferable:{type:"boolean"},exclusiveness:{type:"boolean"},paidUp:{type:"boolean"},revocable:{type:"boolean"},processing:{type:"boolean"},modifying:{type:"boolean"},analyzing:{type:"boolean"},storingData:{type:"boolean"},storingCopy:{type:"boolean"},reproducing:{type:"boolean"},distributing:{type:"boolean"},loaning:{type:"boolean"},selling:{type:"boolean"},renting:{type:"boolean"},furtherLicensing:{type:"boolean"},leasing:{type:"boolean"}}},dataStream:{type:"boolean"},personalData:{type:"boolean"},pricingModel:{type:"object",required:["basicPrice","currency","hasFreePrice"],properties:{paymentType:{type:"string"},pricingModelName:{type:"string"},basicPrice:{type:"number",format:"float"},currency:{type:"string"},fee:{type:"number",format:"float"},hasPaymentOnSubscription:{type:"object",properties:{paymentOnSubscriptionName:{type:"string"},paymentType:{type:"string"},timeDuration:{type:"string"},description:{type:"string"},repeat:{type:"string"},hasSubscriptionPrice:{type:"number"}}},hasFreePrice:{type:"object",properties:{hasPriceFree:{type:"boolean"}}}}},dataExchangeAgreement:{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},signatures:{type:"object",required:["providerSignature","consumerSignature"],properties:{providerSignature:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"},consumerSignature:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"}}}}},DataExchange:{allOf:[{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},{type:"object",properties:{cipherblockDgst:{type:"string",description:"hash of the cipherblock in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"},blockCommitment:{type:"string",description:"hash of the plaintext block in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"},secretCommitment:{type:"string",description:"ash of the secret that can be used to decrypt the block in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"}},required:["cipherblockDgst","blockCommitment","secretCommitment"]}]}}},se={id:"https://spec.openapis.org/oas/3.0/schema/2021-09-28",$schema:"http://json-schema.org/draft-04/schema#",description:"The description of OpenAPI v3.0.x documents, as defined by https://spec.openapis.org/oas/v3.0.3",type:"object",required:["openapi","info","paths"],properties:{openapi:{type:"string",pattern:"^3\\.0\\.\\d(-.+)?$"},info:{$ref:"#/definitions/Info"},externalDocs:{$ref:"#/definitions/ExternalDocumentation"},servers:{type:"array",items:{$ref:"#/definitions/Server"}},security:{type:"array",items:{$ref:"#/definitions/SecurityRequirement"}},tags:{type:"array",items:{$ref:"#/definitions/Tag"},uniqueItems:!0},paths:{$ref:"#/definitions/Paths"},components:{$ref:"#/definitions/Components"}},patternProperties:{"^x-":{}},additionalProperties:!1,definitions:{Reference:{type:"object",required:["$ref"],patternProperties:{"^\\$ref$":{type:"string",format:"uri-reference"}}},Info:{type:"object",required:["title","version"],properties:{title:{type:"string"},description:{type:"string"},termsOfService:{type:"string",format:"uri-reference"},contact:{$ref:"#/definitions/Contact"},license:{$ref:"#/definitions/License"},version:{type:"string"}},patternProperties:{"^x-":{}},additionalProperties:!1},Contact:{type:"object",properties:{name:{type:"string"},url:{type:"string",format:"uri-reference"},email:{type:"string",format:"email"}},patternProperties:{"^x-":{}},additionalProperties:!1},License:{type:"object",required:["name"],properties:{name:{type:"string"},url:{type:"string",format:"uri-reference"}},patternProperties:{"^x-":{}},additionalProperties:!1},Server:{type:"object",required:["url"],properties:{url:{type:"string"},description:{type:"string"},variables:{type:"object",additionalProperties:{$ref:"#/definitions/ServerVariable"}}},patternProperties:{"^x-":{}},additionalProperties:!1},ServerVariable:{type:"object",required:["default"],properties:{enum:{type:"array",items:{type:"string"}},default:{type:"string"},description:{type:"string"}},patternProperties:{"^x-":{}},additionalProperties:!1},Components:{type:"object",properties:{schemas:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]}}},responses:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/Response"}]}}},parameters:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/Parameter"}]}}},examples:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/Example"}]}}},requestBodies:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/RequestBody"}]}}},headers:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/Header"}]}}},securitySchemes:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/SecurityScheme"}]}}},links:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/Link"}]}}},callbacks:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/Callback"}]}}}},patternProperties:{"^x-":{}},additionalProperties:!1},Schema:{type:"object",properties:{title:{type:"string"},multipleOf:{type:"number",minimum:0,exclusiveMinimum:!0},maximum:{type:"number"},exclusiveMaximum:{type:"boolean",default:!1},minimum:{type:"number"},exclusiveMinimum:{type:"boolean",default:!1},maxLength:{type:"integer",minimum:0},minLength:{type:"integer",minimum:0,default:0},pattern:{type:"string",format:"regex"},maxItems:{type:"integer",minimum:0},minItems:{type:"integer",minimum:0,default:0},uniqueItems:{type:"boolean",default:!1},maxProperties:{type:"integer",minimum:0},minProperties:{type:"integer",minimum:0,default:0},required:{type:"array",items:{type:"string"},minItems:1,uniqueItems:!0},enum:{type:"array",items:{},minItems:1,uniqueItems:!1},type:{type:"string",enum:["array","boolean","integer","number","object","string"]},not:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]},allOf:{type:"array",items:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]}},oneOf:{type:"array",items:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]}},anyOf:{type:"array",items:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]}},items:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]},properties:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]}},additionalProperties:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"},{type:"boolean"}],default:!0},description:{type:"string"},format:{type:"string"},default:{},nullable:{type:"boolean",default:!1},discriminator:{$ref:"#/definitions/Discriminator"},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},example:{},externalDocs:{$ref:"#/definitions/ExternalDocumentation"},deprecated:{type:"boolean",default:!1},xml:{$ref:"#/definitions/XML"}},patternProperties:{"^x-":{}},additionalProperties:!1},Discriminator:{type:"object",required:["propertyName"],properties:{propertyName:{type:"string"},mapping:{type:"object",additionalProperties:{type:"string"}}}},XML:{type:"object",properties:{name:{type:"string"},namespace:{type:"string",format:"uri"},prefix:{type:"string"},attribute:{type:"boolean",default:!1},wrapped:{type:"boolean",default:!1}},patternProperties:{"^x-":{}},additionalProperties:!1},Response:{type:"object",required:["description"],properties:{description:{type:"string"},headers:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Header"},{$ref:"#/definitions/Reference"}]}},content:{type:"object",additionalProperties:{$ref:"#/definitions/MediaType"}},links:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Link"},{$ref:"#/definitions/Reference"}]}}},patternProperties:{"^x-":{}},additionalProperties:!1},MediaType:{type:"object",properties:{schema:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]},example:{},examples:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Example"},{$ref:"#/definitions/Reference"}]}},encoding:{type:"object",additionalProperties:{$ref:"#/definitions/Encoding"}}},patternProperties:{"^x-":{}},additionalProperties:!1,allOf:[{$ref:"#/definitions/ExampleXORExamples"}]},Example:{type:"object",properties:{summary:{type:"string"},description:{type:"string"},value:{},externalValue:{type:"string",format:"uri-reference"}},patternProperties:{"^x-":{}},additionalProperties:!1},Header:{type:"object",properties:{description:{type:"string"},required:{type:"boolean",default:!1},deprecated:{type:"boolean",default:!1},allowEmptyValue:{type:"boolean",default:!1},style:{type:"string",enum:["simple"],default:"simple"},explode:{type:"boolean"},allowReserved:{type:"boolean",default:!1},schema:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]},content:{type:"object",additionalProperties:{$ref:"#/definitions/MediaType"},minProperties:1,maxProperties:1},example:{},examples:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Example"},{$ref:"#/definitions/Reference"}]}}},patternProperties:{"^x-":{}},additionalProperties:!1,allOf:[{$ref:"#/definitions/ExampleXORExamples"},{$ref:"#/definitions/SchemaXORContent"}]},Paths:{type:"object",patternProperties:{"^\\/":{$ref:"#/definitions/PathItem"},"^x-":{}},additionalProperties:!1},PathItem:{type:"object",properties:{$ref:{type:"string"},summary:{type:"string"},description:{type:"string"},servers:{type:"array",items:{$ref:"#/definitions/Server"}},parameters:{type:"array",items:{oneOf:[{$ref:"#/definitions/Parameter"},{$ref:"#/definitions/Reference"}]},uniqueItems:!0}},patternProperties:{"^(get|put|post|delete|options|head|patch|trace)$":{$ref:"#/definitions/Operation"},"^x-":{}},additionalProperties:!1},Operation:{type:"object",required:["responses"],properties:{tags:{type:"array",items:{type:"string"}},summary:{type:"string"},description:{type:"string"},externalDocs:{$ref:"#/definitions/ExternalDocumentation"},operationId:{type:"string"},parameters:{type:"array",items:{oneOf:[{$ref:"#/definitions/Parameter"},{$ref:"#/definitions/Reference"}]},uniqueItems:!0},requestBody:{oneOf:[{$ref:"#/definitions/RequestBody"},{$ref:"#/definitions/Reference"}]},responses:{$ref:"#/definitions/Responses"},callbacks:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Callback"},{$ref:"#/definitions/Reference"}]}},deprecated:{type:"boolean",default:!1},security:{type:"array",items:{$ref:"#/definitions/SecurityRequirement"}},servers:{type:"array",items:{$ref:"#/definitions/Server"}}},patternProperties:{"^x-":{}},additionalProperties:!1},Responses:{type:"object",properties:{default:{oneOf:[{$ref:"#/definitions/Response"},{$ref:"#/definitions/Reference"}]}},patternProperties:{"^[1-5](?:\\d{2}|XX)$":{oneOf:[{$ref:"#/definitions/Response"},{$ref:"#/definitions/Reference"}]},"^x-":{}},minProperties:1,additionalProperties:!1},SecurityRequirement:{type:"object",additionalProperties:{type:"array",items:{type:"string"}}},Tag:{type:"object",required:["name"],properties:{name:{type:"string"},description:{type:"string"},externalDocs:{$ref:"#/definitions/ExternalDocumentation"}},patternProperties:{"^x-":{}},additionalProperties:!1},ExternalDocumentation:{type:"object",required:["url"],properties:{description:{type:"string"},url:{type:"string",format:"uri-reference"}},patternProperties:{"^x-":{}},additionalProperties:!1},ExampleXORExamples:{description:"Example and examples are mutually exclusive",not:{required:["example","examples"]}},SchemaXORContent:{description:"Schema and content are mutually exclusive, at least one is required",not:{required:["schema","content"]},oneOf:[{required:["schema"]},{required:["content"],description:"Some properties are not allowed if content is present",allOf:[{not:{required:["style"]}},{not:{required:["explode"]}},{not:{required:["allowReserved"]}},{not:{required:["example"]}},{not:{required:["examples"]}}]}]},Parameter:{type:"object",properties:{name:{type:"string"},in:{type:"string"},description:{type:"string"},required:{type:"boolean",default:!1},deprecated:{type:"boolean",default:!1},allowEmptyValue:{type:"boolean",default:!1},style:{type:"string"},explode:{type:"boolean"},allowReserved:{type:"boolean",default:!1},schema:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]},content:{type:"object",additionalProperties:{$ref:"#/definitions/MediaType"},minProperties:1,maxProperties:1},example:{},examples:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Example"},{$ref:"#/definitions/Reference"}]}}},patternProperties:{"^x-":{}},additionalProperties:!1,required:["name","in"],allOf:[{$ref:"#/definitions/ExampleXORExamples"},{$ref:"#/definitions/SchemaXORContent"},{$ref:"#/definitions/ParameterLocation"}]},ParameterLocation:{description:"Parameter location",oneOf:[{description:"Parameter in path",required:["required"],properties:{in:{enum:["path"]},style:{enum:["matrix","label","simple"],default:"simple"},required:{enum:[!0]}}},{description:"Parameter in query",properties:{in:{enum:["query"]},style:{enum:["form","spaceDelimited","pipeDelimited","deepObject"],default:"form"}}},{description:"Parameter in header",properties:{in:{enum:["header"]},style:{enum:["simple"],default:"simple"}}},{description:"Parameter in cookie",properties:{in:{enum:["cookie"]},style:{enum:["form"],default:"form"}}}]},RequestBody:{type:"object",required:["content"],properties:{description:{type:"string"},content:{type:"object",additionalProperties:{$ref:"#/definitions/MediaType"}},required:{type:"boolean",default:!1}},patternProperties:{"^x-":{}},additionalProperties:!1},SecurityScheme:{oneOf:[{$ref:"#/definitions/APIKeySecurityScheme"},{$ref:"#/definitions/HTTPSecurityScheme"},{$ref:"#/definitions/OAuth2SecurityScheme"},{$ref:"#/definitions/OpenIdConnectSecurityScheme"}]},APIKeySecurityScheme:{type:"object",required:["type","name","in"],properties:{type:{type:"string",enum:["apiKey"]},name:{type:"string"},in:{type:"string",enum:["header","query","cookie"]},description:{type:"string"}},patternProperties:{"^x-":{}},additionalProperties:!1},HTTPSecurityScheme:{type:"object",required:["scheme","type"],properties:{scheme:{type:"string"},bearerFormat:{type:"string"},description:{type:"string"},type:{type:"string",enum:["http"]}},patternProperties:{"^x-":{}},additionalProperties:!1,oneOf:[{description:"Bearer",properties:{scheme:{type:"string",pattern:"^[Bb][Ee][Aa][Rr][Ee][Rr]$"}}},{description:"Non Bearer",not:{required:["bearerFormat"]},properties:{scheme:{not:{type:"string",pattern:"^[Bb][Ee][Aa][Rr][Ee][Rr]$"}}}}]},OAuth2SecurityScheme:{type:"object",required:["type","flows"],properties:{type:{type:"string",enum:["oauth2"]},flows:{$ref:"#/definitions/OAuthFlows"},description:{type:"string"}},patternProperties:{"^x-":{}},additionalProperties:!1},OpenIdConnectSecurityScheme:{type:"object",required:["type","openIdConnectUrl"],properties:{type:{type:"string",enum:["openIdConnect"]},openIdConnectUrl:{type:"string",format:"uri-reference"},description:{type:"string"}},patternProperties:{"^x-":{}},additionalProperties:!1},OAuthFlows:{type:"object",properties:{implicit:{$ref:"#/definitions/ImplicitOAuthFlow"},password:{$ref:"#/definitions/PasswordOAuthFlow"},clientCredentials:{$ref:"#/definitions/ClientCredentialsFlow"},authorizationCode:{$ref:"#/definitions/AuthorizationCodeOAuthFlow"}},patternProperties:{"^x-":{}},additionalProperties:!1},ImplicitOAuthFlow:{type:"object",required:["authorizationUrl","scopes"],properties:{authorizationUrl:{type:"string",format:"uri-reference"},refreshUrl:{type:"string",format:"uri-reference"},scopes:{type:"object",additionalProperties:{type:"string"}}},patternProperties:{"^x-":{}},additionalProperties:!1},PasswordOAuthFlow:{type:"object",required:["tokenUrl","scopes"],properties:{tokenUrl:{type:"string",format:"uri-reference"},refreshUrl:{type:"string",format:"uri-reference"},scopes:{type:"object",additionalProperties:{type:"string"}}},patternProperties:{"^x-":{}},additionalProperties:!1},ClientCredentialsFlow:{type:"object",required:["tokenUrl","scopes"],properties:{tokenUrl:{type:"string",format:"uri-reference"},refreshUrl:{type:"string",format:"uri-reference"},scopes:{type:"object",additionalProperties:{type:"string"}}},patternProperties:{"^x-":{}},additionalProperties:!1},AuthorizationCodeOAuthFlow:{type:"object",required:["authorizationUrl","tokenUrl","scopes"],properties:{authorizationUrl:{type:"string",format:"uri-reference"},tokenUrl:{type:"string",format:"uri-reference"},refreshUrl:{type:"string",format:"uri-reference"},scopes:{type:"object",additionalProperties:{type:"string"}}},patternProperties:{"^x-":{}},additionalProperties:!1},Link:{type:"object",properties:{operationId:{type:"string"},operationRef:{type:"string",format:"uri-reference"},parameters:{type:"object",additionalProperties:{}},requestBody:{},description:{type:"string"},server:{$ref:"#/definitions/Server"}},patternProperties:{"^x-":{}},additionalProperties:!1,not:{description:"Operation Id and Operation Ref are mutually exclusive",required:["operationId","operationRef"]}},Callback:{type:"object",additionalProperties:{$ref:"#/definitions/PathItem"},patternProperties:{"^x-":{}}},Encoding:{type:"object",properties:{contentType:{type:"string"},headers:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Header"},{$ref:"#/definitions/Reference"}]}},style:{type:"string",enum:["form","spaceDelimited","pipeDelimited","deepObject"]},explode:{type:"boolean"},allowReserved:{type:"boolean",default:!1}},additionalProperties:!1}}};function pe(e){if(new Date(e).getTime()>0)return Number(e);throw new A(new Error("invalid timestamp"),["invalid timestamp"])}async function de(e){const t=[],i=Object.keys(e);(i.length<10||i.length>11)&&t.push(new A(new Error("Invalid agreeemt: "+JSON.stringify(e,void 0,2)),["invalid format"]));for(const r of i){let i;switch(r){case"orig":case"dest":try{e[r]!==await J(JSON.parse(e[r]),!0)&&t.push(new A(`[dataExchangeAgreeement.${r}] A valid stringified JWK must be provided. For uniqueness, JWK claims must be alphabetically sorted in the stringified JWK. You can use the parseJWK(jwk, true) for that purpose.\n${e[r]}`,["invalid key","invalid format"]))}catch(e){t.push(new A(`[dataExchangeAgreeement.${r}] A valid stringified JWK must be provided. For uniqueness, JWK claims must be alphabetically sorted in the stringified JWK. You can use the parseJWK(jwk, true) for that purpose.`,["invalid key","invalid format"]))}break;case"ledgerContractAddress":case"ledgerSignerAddress":try{i=I(e[r]),e[r]!==i&&t.push(new A(`[dataExchangeAgreeement.${r}] Invalid EIP-55 address ${e[r]}. Did you mean ${i} instead?`,["invalid EIP-55 address","invalid format"]))}catch(i){t.push(new A(`[dataExchangeAgreeement.${r}] Invalid EIP-55 address ${e[r]}.`,["invalid EIP-55 address","invalid format"]))}break;case"pooToPorDelay":case"pooToPopDelay":case"pooToSecretDelay":try{e[r]!==pe(e[r])&&t.push(new A(`[dataExchangeAgreeement.${r}] < 0 or not a number`,["invalid timestamp","invalid format"]))}catch(e){t.push(new A(`[dataExchangeAgreeement.${r}] < 0 or not a number`,["invalid timestamp","invalid format"]))}break;case"hashAlg":b.includes(e[r])||t.push(new A(`[dataExchangeAgreeement.${r}Invalid hash algorithm '${e[r]}'. It must be one of: ${b.join(", ")}`,["invalid algorithm"]));break;case"encAlg":x.includes(e[r])||t.push(new A(`[dataExchangeAgreeement.${r}Invalid encryption algorithm '${e[r]}'. It must be one of: ${x.join(", ")}`,["invalid algorithm"]));break;case"signingAlg":w.includes(e[r])||t.push(new A(`[dataExchangeAgreeement.${r}Invalid signing algorithm '${e[r]}'. It must be one of: ${w.join(", ")}`,["invalid algorithm"]));break;case"schema":break;default:t.push(new A(new Error(`Property ${r} not allowed in dataAgreement`),["invalid format"]))}}return t}var ce=Object.freeze({__proto__:null,NonRepudiationDest:class{constructor(e,t,i){this.initialized=new Promise(((r,a)=>{this.asyncConstructor(e,t,i).then((()=>{r(!0)})).catch((e=>{a(e)}))}))}async asyncConstructor(e,t,i){const r=await de(e);if(r.length>0){const e=[];let t=[];throw r.forEach((i=>{e.push(i.message),t=t.concat(i.nrErrors)})),t=[...new Set(t)],new A("Resource has not been validated:\n"+e.join("\n"),t)}this.agreement=e,this.jwkPairDest={privateJwk:t,publicJwk:JSON.parse(e.dest)},this.publicJwkOrig=JSON.parse(e.orig),await $(this.jwkPairDest.publicJwk,this.jwkPairDest.privateJwk),this.dltAgent=i;const a=await this.dltAgent.getContractAddress();if(this.agreement.ledgerContractAddress!==a)throw new Error(`Contract address ${a} does not meet agreed one ${this.agreement.ledgerContractAddress}`);this.block={}}async verifyPoO(e,t,i){await this.initialized;const r=y.encode(await T(t,this.agreement.hashAlg),!0,!1),{payload:a}=await j(e),n={...this.agreement,cipherblockDgst:r,blockCommitment:a.exchange.blockCommitment,secretCommitment:a.exchange.secretCommitment},o={proofType:"PoO",iss:"orig",exchange:{...n,id:await F(n)}},s={timestamp:Date.now(),notBefore:"iat",notAfter:"iat",...i},p=await z(e,o,s);return this.block={jwe:t,poo:{jws:e,payload:p.payload}},this.exchange=p.payload.exchange,p}async generatePoR(){if(await this.initialized,void 0===this.exchange||void 0===this.block.poo)throw new Error("Before computing a PoR, you have first to receive a valid cipherblock with a PoO and validate the PoO");const e={proofType:"PoR",iss:"dest",exchange:this.exchange,poo:this.block.poo.jws};return this.block.por=await _(e,this.jwkPairDest.privateJwk),this.block.por}async verifyPoP(e,i){if(await this.initialized,void 0===this.exchange||void 0===this.block.por||void 0===this.block.poo)throw new Error("Cannot verify a PoP if not even a PoR have been created");const r={proofType:"PoP",iss:"orig",exchange:this.exchange,por:this.block.por.jws,secret:"",verificationCode:""},a={timestamp:Date.now(),notBefore:"iat",notAfter:1e3*this.block.poo.payload.iat+this.exchange.pooToPopDelay,...i},n=await z(e,r,a),o=JSON.parse(n.payload.secret);return this.block.secret={hex:t.bufToHex(y.decode(o.k)),jwk:o},this.block.pop={jws:e,payload:n.payload},n}async getSecretFromLedger(){if(await this.initialized,void 0===this.exchange||void 0===this.block.poo||void 0===this.block.por)throw new Error("Cannot get secret if a PoR has not been sent before");const e=Date.now(),t=1e3*this.block.poo.payload.iat+this.agreement.pooToSecretDelay,i=Math.round((t-e)/1e3),{hex:r,iat:a}=await this.dltAgent.getSecretFromLedger(D(this.agreement.encAlg),this.agreement.ledgerSignerAddress,this.exchange.id,i);this.block.secret=await C(this.exchange.encAlg,r);try{q(1e3*a,1e3*this.block.por.payload.iat,1e3*this.block.poo.payload.iat+this.exchange.pooToSecretDelay)}catch(e){throw new A(`Although the secret has been obtained (and you could try to decrypt the cipherblock), it's been published later than agreed: ${new Date(1e3*a).toUTCString()} > ${new Date(1e3*this.block.poo.payload.iat+this.agreement.pooToSecretDelay).toUTCString()}`,["secret not published in time"])}return this.block.secret}async decrypt(){if(await this.initialized,void 0===this.exchange)throw new Error("No agreed exchange");if(void 0===this.block.secret?.jwk)throw new Error("Cannot decrypt without the secret");if(void 0===this.block.jwe)throw new Error("No cipherblock to decrypt");const e=(await E(this.block.jwe,this.block.secret.jwk)).plaintext;if(y.encode(await T(e,this.agreement.hashAlg),!0,!1)!==this.exchange.blockCommitment)throw new Error("Decrypted block does not meet the committed one");return this.block.raw=e,e}async generateVerificationRequest(){if(await this.initialized,void 0===this.block.por||void 0===this.exchange)throw new Error("Before generating a VerificationRequest, you have first to hold a valid PoR for the exchange");return await K("dest",this.exchange.id,this.block.por.jws,this.jwkPairDest.privateJwk)}async generateDisputeRequest(){if(await this.initialized,void 0===this.block.por||void 0===this.block.jwe||void 0===this.exchange)throw new Error("Before generating a VerificationRequest, you have first to hold a valid PoR for the exchange and have received the cipherblock");const e={proofType:"request",iss:"dest",por:this.block.por.jws,type:"disputeRequest",cipherblock:this.block.jwe,iat:Math.floor(Date.now()/1e3),dataExchangeId:this.exchange.id},t=await S(this.jwkPairDest.privateJwk);try{return await new a.SignJWT(e).setProtectedHeader({alg:this.jwkPairDest.privateJwk.alg}).setIssuedAt(e.iat).sign(t)}catch(e){throw new A(e,["unexpected error"])}}},NonRepudiationOrig:class{constructor(e,t,i,r){this.jwkPairOrig={privateJwk:t,publicJwk:JSON.parse(e.orig)},this.publicJwkDest=JSON.parse(e.dest),this.block={raw:i},this.initialized=new Promise(((t,i)=>{this.init(e,r).then((()=>{t(!0)})).catch((e=>{i(e)}))}))}async init(e,i){const r=await de(e);if(r.length>0){const e=[];let t=[];throw r.forEach((i=>{e.push(i.message),t=t.concat(i.nrErrors)})),t=[...new Set(t)],new A("Resource has not been validated:\n"+e.join("\n"),t)}this.agreement=e,await $(this.jwkPairOrig.publicJwk,this.jwkPairOrig.privateJwk);const a=await C(this.agreement.encAlg);this.block={...this.block,secret:a,jwe:await k(this.block.raw,a.jwk,this.agreement.encAlg)};const n=y.encode(await T(this.block.jwe,this.agreement.hashAlg),!0,!1),o=y.encode(await T(this.block.raw,this.agreement.hashAlg),!0,!1),s=y.encode(await T(new Uint8Array(t.hexToBuf(this.block.secret.hex)),this.agreement.hashAlg),!0,!1),p={...this.agreement,cipherblockDgst:n,blockCommitment:o,secretCommitment:s},d=await F(p);this.exchange={...p,id:d},await this._dltSetup(i)}async _dltSetup(e){this.dltAgent=e;const t=await this.dltAgent.getAddress();if(t!==this.exchange.ledgerSignerAddress)throw new Error(`ledgerSignerAddress: ${this.exchange.ledgerSignerAddress} does not meet the address ${t} derived from the provided private key`);const i=await this.dltAgent.getContractAddress();if(i!==R(this.agreement.ledgerContractAddress,!0))throw new Error(`Contract address in use ${i} does not meet the agreed one ${this.agreement.ledgerContractAddress}`)}async generatePoO(){return await this.initialized,this.block.poo=await _({proofType:"PoO",iss:"orig",exchange:this.exchange},this.jwkPairOrig.privateJwk),this.block.poo}async verifyPoR(e,t){if(await this.initialized,void 0===this.block.poo)throw new Error("Cannot verify a PoR if not even a PoO have been created");const i={proofType:"PoR",iss:"dest",exchange:this.exchange,poo:this.block.poo.jws},r=1e3*this.block.poo.payload.iat,a={timestamp:Date.now(),notBefore:r,notAfter:r+this.exchange.pooToPorDelay,...t},n=await z(e,i,a);return this.block.por={jws:e,payload:n.payload},this.block.por}async generatePoP(){if(await this.initialized,void 0===this.block.por)throw new Error("Before computing a PoP, you have first to have received and verified the PoR");const e=await this.dltAgent.deploySecret(this.block.secret.hex,this.exchange.id),t={proofType:"PoP",iss:"orig",exchange:this.exchange,por:this.block.por.jws,secret:JSON.stringify(this.block.secret.jwk),verificationCode:e};return this.block.pop=await _(t,this.jwkPairOrig.privateJwk),this.block.pop}async generateVerificationRequest(){if(await this.initialized,void 0===this.block.por)throw new Error("Before generating a VerificationRequest, you have first to hold a valid PoR for the exchange");return await K("orig",this.exchange.id,this.block.por.jws,this.jwkPairOrig.privateJwk)}}});exports.ConflictResolution=B,exports.ENC_ALGS=x,exports.EthersIoAgentDest=U,exports.EthersIoAgentOrig=ie,exports.HASH_ALGS=b,exports.I3mServerWalletAgentDest=te,exports.I3mServerWalletAgentOrig=ae,exports.I3mWalletAgentDest=Q,exports.I3mWalletAgentOrig=re,exports.KEY_AGREEMENT_ALGS=P,exports.NonRepudiationProtocol=ce,exports.NrError=A,exports.SIGNING_ALGS=w,exports.Signers=ne,exports.checkTimestamp=q,exports.createProof=_,exports.defaultDltConfig=V,exports.exchangeId=F,exports.generateKeys=async function(e,r,a){if(!w.includes(e))throw new A(new RangeError(`Invalid signature algorithm '${e}''. Allowed algorithms are ${w.toString()}`),["invalid algorithm"]);let n,o,s;switch(e){case"ES512":o="P-521",n=66;break;case"ES384":o="P-384",n=48;break;default:o="P-256",n=32}s=void 0!==r?"string"==typeof r?!0===a?y.decode(r):new Uint8Array(t.hexToBuf(r)):r:new Uint8Array(await i.randBytes(n));const p=new v("p"+o.substring(o.length-3)).keyFromPrivate(s),d=p.getPublic(),c=d.getX().toString("hex").padStart(2*n,"0"),l=d.getY().toString("hex").padStart(2*n,"0"),f=p.getPrivate("hex").padStart(2*n,"0"),g={kty:"EC",crv:o,x:y.encode(t.hexToBuf(c),!0,!1),y:y.encode(t.hexToBuf(l),!0,!1),d:y.encode(t.hexToBuf(f),!0,!1),alg:e},m={...g};return delete m.d,{publicJwk:m,privateJwk:g}},exports.getDltAddress=function(e){const t=e.match(/^did:ethr:(\w+:)?(0x[0-9a-fA-F]{40}[0-9a-fA-F]{26}?)$/),i=null!==t?t[t.length-1]:e;try{return o.ethers.utils.computeAddress(i)}catch(e){throw new A("no a DID or a valid public or private key",["invalid format"])}},exports.importJwk=S,exports.jsonSort=O,exports.jweDecrypt=E,exports.jweEncrypt=k,exports.jwsDecode=j,exports.oneTimeSecret=C,exports.parseAddress=I,exports.parseHex=R,exports.parseJwk=J,exports.sha=T,exports.validateDataExchange=async function(e){const t=[];try{const{id:i,...r}=e;i!==await F(r)&&t.push(new A("Invalid dataExchange id",["cannot verify","invalid format"]));const{blockCommitment:a,secretCommitment:n,cipherblockDgst:o,...s}=r,p=await de(s);p.length>0&&p.forEach((e=>{t.push(e)}))}catch(e){t.push(new A("Invalid dataExchange",["cannot verify","invalid format"]))}return t},exports.validateDataExchangeAgreement=de,exports.validateDataSharingAgreementSchema=async function(e){const t=[],i=new m.default({strictSchema:!1,removeAdditional:"all"});i.addMetaSchema(se),u.default(i);const r=oe.schemas.DataSharingAgreement;try{const a=i.compile(r),o=h.default.cloneDeep(e);a(e)||null!==a.errors&&void 0!==a.errors&&a.errors.length>0&&a.errors.forEach((e=>{t.push(new A(`[${e.instancePath}] ${e.message??"unknown"}`,["invalid format"]))})),n.hashable(o)!==n.hashable(e)&&t.push(new A("Additional claims beyond the schema are not supported",["invalid format"]))}catch(e){t.push(new A(e,["invalid format"]))}return t},exports.verifyKeyPair=$,exports.verifyProof=z; -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXgubm9kZS5janMiLCJzb3VyY2VzIjpbIi4uL3NyYy90cy9jb25zdGFudHMud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0JDLFFBQVFDLHFCQUN2QyxJQUNFLE1BQU1DLEVBQVdaLEVBQUlhLFFBQVFMLEdBQ3ZCTSxFQUFrQkMsRUFBQUEsUUFBRUMsVUFBVXZFLEdBQ3RCbUUsRUFBU25FLElBR0csT0FBcEJtRSxFQUFTeFYsYUFBdUNXLElBQXBCNlUsRUFBU3hWLFFBQXdCd1YsRUFBU3hWLE9BQU8wRCxPQUFTLEdBQ3hGOFIsRUFBU3hWLE9BQU8yUixTQUFRaFMsSUFDdEJLLEVBQU91UixLQUFLLElBQUkvUixFQUFRLElBQUlHLEVBQU1rVyxpQkFBaUJsVyxFQUFNaVMsU0FBVyxZQUFhLENBQUMsbUJBQW1CLElBSXZHeEosRUFBUUEsU0FBQ3NOLEtBQXFCdE4sRUFBUUEsU0FBQ2lKLElBQ3pDclIsRUFBT3VSLEtBQUssSUFBSS9SLEVBQVEsd0RBQXlELENBQUMsbUJBRXJGLENBQUMsTUFBT0csR0FDUEssRUFBT3VSLEtBQUssSUFBSS9SLEVBQVFHLEVBQU8sQ0FBQyxtQkFDakMsQ0FFRCxPQUFPSyxDQUNUIn0= +"use strict";var e=require("@juanelas/base64"),t=require("bigint-conversion"),i=require("bigint-crypto-utils"),r=require("elliptic"),a=require("jose"),n=require("object-sha"),o=(require("crypto"),require("ethers")),s=require("ethers/lib/utils"),p=require("ajv-draft-04"),d=require("ajv-formats"),c=require("lodash");function l(e){return e&&e.__esModule?e:{default:e}}function f(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(i){if("default"!==i){var r=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(t,i,r.get?r:{enumerable:!0,get:function(){return e[i]}})}})),t.default=e,Object.freeze(t)}var y=f(e),g=l(r),m=l(p),u=l(d),h=l(c);const b=["SHA-256","SHA-384","SHA-512"],w=["ES256","ES384","ES512"],x=["A128GCM","A256GCM"],P=["ECDH-ES"];class A extends Error{constructor(e,t){super(e),e instanceof A?(this.nrErrors=e.nrErrors,this.add(...t)):this.nrErrors=t}add(...e){const t=this.nrErrors.concat(e);this.nrErrors=[...new Set(t)]}}const{ec:v}=g.default;async function S(e,t){const i=void 0===t?e.alg:t,r=x.concat(w).concat(P);if(!r.includes(i))throw new A("invalid alg. Must be one of: "+r.join(","),["invalid algorithm"]);try{const i=await a.importJWK(e,t);if(null==i)throw new A(new Error("failed importing keys"),["invalid key"]);return i}catch(e){throw new A(e,["invalid key"])}}async function k(e,t,i){let r,n;const o={...t};if(x.includes(t.alg))r="dir",n=void 0!==i?i:t.alg;else{if(!w.concat(P).includes(t.alg))throw new A(`Not a valid symmetric or assymetric alg: ${t.alg}`,["encryption failed","invalid key","invalid algorithm"]);if(void 0===i)throw new A("An encryption algorith encAlg for content encryption should be provided. Allowed values are: "+x.join(","),["encryption failed"]);n=i,r="ECDH-ES",o.alg=r}const s=await S(o);let p;try{return p=await new a.CompactEncrypt(e).setProtectedHeader({alg:r,enc:n,kid:t.kid}).encrypt(s),p}catch(e){throw new A(e,["encryption failed"])}}async function E(e,t){try{const i={...t},{alg:r,enc:n}=a.decodeProtectedHeader(e);if(void 0===r||void 0===n)throw new A("missing enc or alg in jwe header",["invalid format"]);"ECDH-ES"===r&&(i.alg=r);const o=await S(i);return await a.compactDecrypt(e,o,{contentEncryptionAlgorithms:[n]})}catch(e){throw new A(e,["decryption failed"])}}async function j(e,t){const i=e.match(/^([a-zA-Z0-9_-]+)\.{1,2}([a-zA-Z0-9_-]+)\.([a-zA-Z0-9_-]+)$/);if(null===i)throw new A(new Error(`${e} is not a JWS`),["not a compact jws"]);let r,n;try{r=JSON.parse(y.decode(i[1],!0)),n=JSON.parse(y.decode(i[2],!0))}catch(e){throw new A(e,["invalid format","not a compact jws"])}if(void 0!==t){const i="function"==typeof t?await t(r,n):t,o=await S(i);try{const t=await a.jwtVerify(e,o);return{header:t.protectedHeader,payload:t.payload,signer:i}}catch(e){throw new A(e,["jws verification failed"])}}return{header:r,payload:n}}function D(e){if(x.concat(b).concat(w).includes(e))return Number(e.match(/\d{3}/)[0])/8;throw new A("unsupported algorithm",["invalid algorithm"])}async function C(i,r,n){let o;if(!x.includes(i))throw new A(new Error(`Invalid encAlg '${i}'. Supported values are: ${x.toString()}`),["invalid algorithm"]);const s=D(i);if(void 0!==r){if("string"==typeof r)if(!0===n)o=y.decode(r);else{const e=t.parseHex(r,!1);if(e!==t.parseHex(r,!1,s))throw new A(new RangeError(`Expected hex length ${2*s} does not meet provided one ${e.length/2}`),["invalid key"]);o=new Uint8Array(t.hexToBuf(r))}else o=r;if(o.length!==s)throw new A(new RangeError(`Expected secret length ${s} does not meet provided one ${o.length}`),["invalid key"])}else try{o=await a.generateSecret(i,{extractable:!0})}catch(e){throw new A(e,["unexpected error"])}const p=await a.exportJWK(o);return p.alg=i,{jwk:p,hex:t.bufToHex(e.decode(p.k),!1,s)}}async function $(e,t){if(void 0===e.alg||void 0===t.alg||e.alg!==t.alg)throw new Error("alg no present in either pubJwk or privJwk, or pubJWK.alg != privJWK.alg");const r=await S(e),n=await S(t);try{const e=await i.randBytes(16),o=await new a.GeneralSign(e).addSignature(n).setProtectedHeader({alg:t.alg}).sign();await a.generalVerify(o,r)}catch(e){throw new A(e,["unexpected error"])}}function q(e,t,i,r=2e3){if(ei+r)throw new A(new Error(`timestamp ${new Date(e).toTimeString()} after 'notAfter' ${new Date(i).toTimeString()} with tolerance of ${r/1e3}s`),["invalid timestamp"])}function O(e){return Array.isArray(e)?e.sort().map(O):(t=e,"[object Object]"===Object.prototype.toString.call(t)?Object.keys(e).sort().reduce((function(t,i){return t[i]=O(e[i]),t}),{}):e);var t}function R(e,i=!1,r){try{return t.parseHex(e,i,r)}catch(e){throw new A(e,["invalid format"])}}async function J(e,t){try{await S(e,e.alg);const i=O(e);return t?JSON.stringify(i):i}catch(e){throw new A(e,["invalid key"])}}async function T(e,t){const i=b;if(!i.includes(t))throw new A(new RangeError(`Valid hash algorith values are any of ${JSON.stringify(i)}`),["invalid algorithm"]);const r=new TextEncoder,a="string"==typeof e?r.encode(e).buffer:e;try{let e;{const i=t.toLowerCase().replace("-","");e=new Uint8Array((await Promise.resolve().then((function(){return f(require("crypto"))}))).createHash(i).update(Buffer.from(a)).digest())}return e}catch(e){throw new A(e,["unexpected error"])}}function I(e){if(null==e.match(/^(0x)?([\da-fA-F]{40})$/))throw new RangeError("incorrect address format");try{const t=R(e,!0,20);return o.ethers.utils.getAddress(t)}catch(e){throw new A(e,["invalid EIP-55 address"])}}async function F(e){return y.encode(await T(n.hashable(e),"SHA-256"),!0,!1)}async function _(e,t){if(void 0===e.iss)throw new Error('Payload iss should be set to either "orig" or "dest"');const i=JSON.parse(e.exchange[e.iss]);await $(i,t);const r=await S(t),n=t.alg,o={...e,iat:Math.floor(Date.now()/1e3)};return{jws:await new a.SignJWT(o).setProtectedHeader({alg:n}).setIssuedAt(o.iat).sign(r),payload:o}}async function z(e,t,i){const r=JSON.parse(t.exchange[t.iss]),a=await j(e,r);if(void 0===a.payload.iss)throw new Error('Property "iss" missing');if(void 0===a.payload.iat)throw new Error("Property claim iat missing");if(void 0!==i){q("iat"===i.timestamp?1e3*a.payload.iat:i.timestamp,"iat"===i.notBefore?1e3*a.payload.iat:i.notBefore,"iat"===i.notAfter?1e3*a.payload.iat:i.notAfter,i.tolerance)}const o=a.payload,s=o.exchange[o.iss];if(n.hashable(r)!==n.hashable(JSON.parse(s)))throw new Error(`The proof is issued by ${s} instead of ${JSON.stringify(r)}`);const p=t;for(const e in p){if(void 0===o[e])throw new Error(`Expected key '${e}' not found in proof`);if("exchange"===e){const e=t.exchange;M(o.exchange,e)}else if(""!==p[e]&&n.hashable(p[e])!==n.hashable(o[e]))throw new Error(`Proof's ${e}: ${JSON.stringify(o[e],void 0,2)} does not meet provided value ${JSON.stringify(p[e],void 0,2)}`)}return a}function M(e,t){const i=["id","orig","dest","hashAlg","cipherblockDgst","blockCommitment","blockCommitment","secretCommitment","schema"];for(const t of i)if("schema"!==t&&(void 0===e[t]||""===e[t]))throw new Error(`${t} is missing on dataExchange.\ndataExchange: ${JSON.stringify(e,void 0,2)}`);for(const i in t)if(""!==t[i]&&n.hashable(t[i])!==n.hashable(e[i]))throw new Error(`dataExchange's ${i}: ${JSON.stringify(e[i],void 0,2)} does not meet expected value ${JSON.stringify(t[i],void 0,2)}`)}async function W(e,t,i=10){const{payload:r}=await j(e),a=r.exchange,n={...a};delete n.id;if(await F(n)!==a.id)throw new A(new Error("data exchange integrity failed"),["dataExchange integrity violated"]);const o=JSON.parse(a.dest),s=JSON.parse(a.orig);let p,d,c;try{p=(await z(r.poo,{iss:"orig",proofType:"PoO",exchange:a})).payload}catch(e){throw new A(e,["invalid poo"])}try{await z(e,{iss:"dest",proofType:"PoR",exchange:a},{timestamp:"iat",notBefore:1e3*p.iat,notAfter:1e3*p.iat+a.pooToPorDelay})}catch(e){throw new A(e,["invalid por"])}try{const e=await t.getSecretFromLedger(D(a.encAlg),a.ledgerSignerAddress,a.id,i);d=e.hex,c=e.iat}catch(e){throw new A(e,["cannot verify"])}try{q(1e3*c,1e3*r.iat,1e3*p.iat+a.pooToSecretDelay)}catch(e){throw new A(`Although the secret has been obtained (and you could try to decrypt the cipherblock), it's been published later than agreed: ${new Date(1e3*c).toUTCString()} > ${new Date(1e3*p.iat+a.pooToSecretDelay).toUTCString()}`,["secret not published in time"])}return{pooPayload:p,porPayload:r,secretHex:d,destPublicJwk:o,origPublicJwk:s}}async function N(e,t,i=10){let r,a,n,o,s;try{r=(await j(e)).payload}catch(e){throw new A(e,["invalid verification request"])}try{const e=await W(r.por,t,i);a=e.destPublicJwk,n=e.origPublicJwk,o=e.pooPayload,s=e.porPayload}catch(e){throw new A(e,["invalid por","invalid verification request"])}try{await j(e,"dest"===r.iss?a:n)}catch(e){throw new A(e,["invalid verification request"])}return{pooPayload:o,porPayload:s,vrPayload:r,destPublicJwk:a,origPublicJwk:n}}async function H(e,t){const{payload:i}=await j(e),{destPublicJwk:r,origPublicJwk:a,secretHex:n,pooPayload:o,porPayload:s}=await W(i.por,t);try{await j(e,r)}catch(e){throw e instanceof A&&e.add("invalid dispute request"),e}if(y.encode(await T(i.cipherblock,s.exchange.hashAlg),!0,!1)!==s.exchange.cipherblockDgst)throw new A(new Error("cipherblock does not meet the committed (and already accepted) one"),["invalid dispute request"]);return await E(i.cipherblock,(await C(s.exchange.encAlg,n)).jwk),{pooPayload:o,porPayload:s,drPayload:i,destPublicJwk:r,origPublicJwk:a}}async function K(e,t,i,r){const n={proofType:"request",iss:e,dataExchangeId:t,por:i,type:"verificationRequest",iat:Math.floor(Date.now()/1e3)},o=await a.importJWK(r);return await new a.SignJWT(n).setProtectedHeader({alg:r.alg}).setIssuedAt(n.iat).sign(o)}var B=Object.freeze({__proto__:null,ConflictResolver:class{constructor(e,t){this.jwkPair=e,this.dltAgent=t,this.initialized=new Promise(((e,t)=>{this.init().then((()=>{e(!0)})).catch((e=>{t(e)}))}))}async init(){await $(this.jwkPair.publicJwk,this.jwkPair.privateJwk)}async resolveCompleteness(e){await this.initialized;const{payload:t}=await j(e);let i;try{i=(await j(t.por)).payload}catch(e){throw new A(e,["invalid por"])}const r={...await this._resolution(t.dataExchangeId,i.exchange[t.iss]),resolution:"not completed",type:"verification"};try{await N(e,this.dltAgent),r.resolution="completed"}catch(e){if(!(e instanceof A)||e.nrErrors.includes("invalid verification request")||e.nrErrors.includes("unexpected error"))throw e}const n=await a.importJWK(this.jwkPair.privateJwk);return await new a.SignJWT(r).setProtectedHeader({alg:this.jwkPair.privateJwk.alg}).setIssuedAt(r.iat).sign(n)}async resolveDispute(e){await this.initialized;const{payload:t}=await j(e);let i;try{i=(await j(t.por)).payload}catch(e){throw new A(e,["invalid por"])}const r={...await this._resolution(t.dataExchangeId,i.exchange[t.iss]),resolution:"denied",type:"dispute"};try{await H(e,this.dltAgent)}catch(e){if(!(e instanceof A&&e.nrErrors.includes("decryption failed")))throw new A(e,["cannot verify"]);r.resolution="accepted"}const n=await a.importJWK(this.jwkPair.privateJwk);return await new a.SignJWT(r).setProtectedHeader({alg:this.jwkPair.privateJwk.alg}).setIssuedAt(r.iat).sign(n)}async _resolution(e,t){return{proofType:"resolution",dataExchangeId:e,iat:Math.floor(Date.now()/1e3),iss:await J(this.jwkPair.publicJwk,!0),sub:t}}},checkCompleteness:N,checkDecryption:H,generateVerificationRequest:K,verifyPor:W,verifyResolution:async function(e,t){return await j(e,t??((e,t)=>JSON.parse(t.iss)))}});const V={gasLimit:125e5,contract:{address:"0x8d407A1722633bDD1dcf221474be7a44C05d7c2F",abi:[{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"sender",type:"address"},{indexed:!1,internalType:"uint256",name:"dataExchangeId",type:"uint256"},{indexed:!1,internalType:"uint256",name:"timestamp",type:"uint256"},{indexed:!1,internalType:"uint256",name:"secret",type:"uint256"}],name:"Registration",type:"event"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"uint256",name:"",type:"uint256"}],name:"registry",outputs:[{internalType:"uint256",name:"timestamp",type:"uint256"},{internalType:"uint256",name:"secret",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"_dataExchangeId",type:"uint256"},{internalType:"uint256",name:"_secret",type:"uint256"}],name:"setRegistry",outputs:[],stateMutability:"nonpayable",type:"function"}],transactionHash:"0x6a3828f8fe232819dc40ca66f93930b3bd1619db31a67ec34b44446b3e7c8289",receipt:{to:null,from:"0x17bd12C2134AfC1f6E9302a532eFE30C19B9E903",contractAddress:"0x8d407A1722633bDD1dcf221474be7a44C05d7c2F",transactionIndex:0,gasUsed:"253928",logsBloom:"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",blockHash:"0x0118672bb9b27679e616831d056d36291dd20cfe88c3ee2abd8f2dfce579cad4",transactionHash:"0x6a3828f8fe232819dc40ca66f93930b3bd1619db31a67ec34b44446b3e7c8289",logs:[],blockNumber:119389,cumulativeGasUsed:"253928",status:1,byzantium:!0},args:[],solcInputHash:"c528a37588793ef74285d75e08d6b8eb",metadata:'{"compiler":{"version":"0.8.4+commit.c7e474f2"},"language":"Solidity","output":{"abi":[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"dataExchangeId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"secret","type":"uint256"}],"name":"Registration","type":"event"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"registry","outputs":[{"internalType":"uint256","name":"timestamp","type":"uint256"},{"internalType":"uint256","name":"secret","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_dataExchangeId","type":"uint256"},{"internalType":"uint256","name":"_secret","type":"uint256"}],"name":"setRegistry","outputs":[],"stateMutability":"nonpayable","type":"function"}],"devdoc":{"kind":"dev","methods":{},"version":1},"userdoc":{"kind":"user","methods":{},"version":1}},"settings":{"compilationTarget":{"contracts/NonRepudiation.sol":"NonRepudiation"},"evmVersion":"istanbul","libraries":{},"metadata":{"bytecodeHash":"ipfs","useLiteralContent":true},"optimizer":{"enabled":false,"runs":200},"remappings":[]},"sources":{"contracts/NonRepudiation.sol":{"content":"//SPDX-License-Identifier: Unlicense\\npragma solidity ^0.8.0;\\n\\ncontract NonRepudiation {\\n struct Proof {\\n uint256 timestamp;\\n uint256 secret;\\n }\\n mapping(address => mapping (uint256 => Proof)) public registry;\\n event Registration(address sender, uint256 dataExchangeId, uint256 timestamp, uint256 secret);\\n\\n function setRegistry(uint256 _dataExchangeId, uint256 _secret) public {\\n require(registry[msg.sender][_dataExchangeId].secret == 0);\\n registry[msg.sender][_dataExchangeId] = Proof(block.timestamp, _secret);\\n emit Registration(msg.sender, _dataExchangeId, block.timestamp, _secret);\\n }\\n}\\n","keccak256":"0x8d371257a9b03c9102f158323e61f56ce49dd8489bd92c5a7d8abc3d9f6f8399","license":"Unlicense"}},"version":1}',bytecode:"0x608060405234801561001057600080fd5b506103a2806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c8063032439371461003b578063d05cb54514610057575b600080fd5b6100556004803603810190610050919061023a565b610088565b005b610071600480360381019061006c91906101fe565b6101a3565b60405161007f9291906102d9565b60405180910390f35b60008060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002060010154146100e757600080fd5b6040518060400160405280428152602001828152506000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002060008201518160000155602082015181600101559050507faa58599838af2e5e0f3251cfbb4eac5d5d447ded49f6b0ac28d6b44098224e63338342846040516101979493929190610294565b60405180910390a15050565b6000602052816000526040600020602052806000526040600020600091509150508060000154908060010154905082565b6000813590506101e38161033e565b92915050565b6000813590506101f881610355565b92915050565b6000806040838503121561021157600080fd5b600061021f858286016101d4565b9250506020610230858286016101e9565b9150509250929050565b6000806040838503121561024d57600080fd5b600061025b858286016101e9565b925050602061026c858286016101e9565b9150509250929050565b61027f81610302565b82525050565b61028e81610334565b82525050565b60006080820190506102a96000830187610276565b6102b66020830186610285565b6102c36040830185610285565b6102d06060830184610285565b95945050505050565b60006040820190506102ee6000830185610285565b6102fb6020830184610285565b9392505050565b600061030d82610314565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b61034781610302565b811461035257600080fd5b50565b61035e81610334565b811461036957600080fd5b5056fea26469706673582212204fd0fc653fb487221da9a14a4ca5d5499f9e9bc7b27ac8ab0f8d397fd6e3148564736f6c63430008040033",deployedBytecode:"0x608060405234801561001057600080fd5b50600436106100365760003560e01c8063032439371461003b578063d05cb54514610057575b600080fd5b6100556004803603810190610050919061023a565b610088565b005b610071600480360381019061006c91906101fe565b6101a3565b60405161007f9291906102d9565b60405180910390f35b60008060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002060010154146100e757600080fd5b6040518060400160405280428152602001828152506000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002060008201518160000155602082015181600101559050507faa58599838af2e5e0f3251cfbb4eac5d5d447ded49f6b0ac28d6b44098224e63338342846040516101979493929190610294565b60405180910390a15050565b6000602052816000526040600020602052806000526040600020600091509150508060000154908060010154905082565b6000813590506101e38161033e565b92915050565b6000813590506101f881610355565b92915050565b6000806040838503121561021157600080fd5b600061021f858286016101d4565b9250506020610230858286016101e9565b9150509250929050565b6000806040838503121561024d57600080fd5b600061025b858286016101e9565b925050602061026c858286016101e9565b9150509250929050565b61027f81610302565b82525050565b61028e81610334565b82525050565b60006080820190506102a96000830187610276565b6102b66020830186610285565b6102c36040830185610285565b6102d06060830184610285565b95945050505050565b60006040820190506102ee6000830185610285565b6102fb6020830184610285565b9392505050565b600061030d82610314565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b61034781610302565b811461035257600080fd5b50565b61035e81610334565b811461036957600080fd5b5056fea26469706673582212204fd0fc653fb487221da9a14a4ca5d5499f9e9bc7b27ac8ab0f8d397fd6e3148564736f6c63430008040033",devdoc:{kind:"dev",methods:{},version:1},userdoc:{kind:"user",methods:{},version:1},storageLayout:{storage:[{astId:13,contract:"contracts/NonRepudiation.sol:NonRepudiation",label:"registry",offset:0,slot:"0",type:"t_mapping(t_address,t_mapping(t_uint256,t_struct(Proof)6_storage))"}],types:{t_address:{encoding:"inplace",label:"address",numberOfBytes:"20"},"t_mapping(t_address,t_mapping(t_uint256,t_struct(Proof)6_storage))":{encoding:"mapping",key:"t_address",label:"mapping(address => mapping(uint256 => struct NonRepudiation.Proof))",numberOfBytes:"32",value:"t_mapping(t_uint256,t_struct(Proof)6_storage)"},"t_mapping(t_uint256,t_struct(Proof)6_storage)":{encoding:"mapping",key:"t_uint256",label:"mapping(uint256 => struct NonRepudiation.Proof)",numberOfBytes:"32",value:"t_struct(Proof)6_storage"},"t_struct(Proof)6_storage":{encoding:"inplace",label:"struct NonRepudiation.Proof",members:[{astId:3,contract:"contracts/NonRepudiation.sol:NonRepudiation",label:"timestamp",offset:0,slot:"0",type:"t_uint256"},{astId:5,contract:"contracts/NonRepudiation.sol:NonRepudiation",label:"secret",offset:0,slot:"1",type:"t_uint256"}],numberOfBytes:"64"},t_uint256:{encoding:"inplace",label:"uint256",numberOfBytes:"32"}}}}};async function G(e,i,r,a,n){let s=o.ethers.BigNumber.from(0),p=o.ethers.BigNumber.from(0);const d=R(t.bufToHex(y.decode(r)),!0);let c=0;do{try{({secret:s,timestamp:p}=await e.registry(R(i,!0),d))}catch(e){throw new A(e,["cannot contact the ledger"])}s.isZero()&&(c++,await new Promise((e=>setTimeout(e,1e3))))}while(s.isZero()&&c{null!==e&&"object"==typeof e&&"function"==typeof e.then?e.then((e=>{this.dltConfig={...V,...e},this.provider=new o.ethers.providers.JsonRpcProvider(this.dltConfig.rpcProviderUrl),this.contract=new o.ethers.Contract(this.dltConfig.contract.address,this.dltConfig.contract.abi,this.provider),t(!0)})).catch((e=>i(e))):(this.dltConfig={...V,...e},this.provider=new o.ethers.providers.JsonRpcProvider(this.dltConfig.rpcProviderUrl),this.contract=new o.ethers.Contract(this.dltConfig.contract.address,this.dltConfig.contract.abi,this.provider),t(!0))}))}async getContractAddress(){return await this.initialized,this.contract.address}}class U extends L{async getSecretFromLedger(e,t,i,r){return await this.initialized,await G(this.contract,t,i,r,e)}}class Y extends L{constructor(e,t,i){super(new Promise(((t,r)=>{e.providerinfo.get().then((e=>{const a=e.rpcUrl;void 0===a?r(new Error("wallet is not connected to RPC endpoint")):t({...i,rpcProviderUrl:"string"==typeof a?a:a[0]})})).catch((e=>{r(e)}))}))),this.wallet=e,this.did=t}}class Q extends Y{async getSecretFromLedger(e,t,i,r){return await this.initialized,await G(this.contract,t,i,r,e)}}class ee extends L{constructor(e,t,i){super(new Promise(((t,r)=>{e.providerinfoGet().then((e=>{const a=e.rpcUrl;void 0===a?r(new Error("wallet is not connected to RPC endpoint")):t({...i,rpcProviderUrl:"string"==typeof a?a:a[0]})})).catch((e=>{r(e)}))}))),this.wallet=e,this.did=t}}class te extends ee{async getSecretFromLedger(e,t,i,r){return await this.initialized,await G(this.contract,t,i,r,e)}}class ie extends L{constructor(e,r){let a;super(e),this.count=-1,a=void 0===r?i.randBytesSync(32):"string"==typeof r?new Uint8Array(t.hexToBuf(r)):r;const n=new s.SigningKey(a);this.signer=new o.Wallet(n,this.provider)}async deploySecret(e,t){await this.initialized;const i=await Z(e,t,this),r=await this.signer.signTransaction(i),a=await this.signer.provider.sendTransaction(r);return this.count=this.count+1,a.hash}async getAddress(){return await this.initialized,this.signer.address}async nextNonce(){await this.initialized;const e=await this.provider.getTransactionCount(await this.getAddress(),"pending");return e>this.count&&(this.count=e),this.count}}class re extends Y{constructor(){super(...arguments),this.count=-1}async deploySecret(e,t){await this.initialized;const i=await Z(e,t,this),r=(await this.wallet.identities.sign({did:this.did},{type:"Transaction",data:i})).signature,a=await this.provider.sendTransaction(r);return this.count=this.count+1,a.hash}async getAddress(){await this.initialized;const e=await this.wallet.identities.info({did:this.did});if(void 0===e.addresses)throw new A(new Error("no addresses for did "+this.did),["unexpected error"]);return e.addresses[0]}async nextNonce(){await this.initialized;const e=await this.provider.getTransactionCount(await this.getAddress(),"pending");return e>this.count&&(this.count=e),this.count}}class ae extends ee{constructor(){super(...arguments),this.count=-1}async deploySecret(e,t){await this.initialized;const i=await Z(e,t,this),r=(await this.wallet.identitySign({did:this.did},{type:"Transaction",data:i})).signature,a=await this.provider.sendTransaction(r);return this.count=this.count+1,a.hash}async getAddress(){await this.initialized;const e=await this.wallet.identityInfo({did:this.did});if(void 0===e.addresses)throw new A(`Can't get address for did: ${this.did}`,["unexpected error"]);return e.addresses[0]}async nextNonce(){await this.initialized;const e=await this.provider.getTransactionCount(await this.getAddress(),"pending");return e>this.count&&(this.count=e),this.count}}var ne=Object.freeze({__proto__:null,EthersIoAgentDest:U,EthersIoAgentOrig:ie,I3mServerWalletAgentDest:te,I3mServerWalletAgentOrig:ae,I3mWalletAgentDest:Q,I3mWalletAgentOrig:re}),oe={schemas:{IdentitySelectOutput:{title:"IdentitySelectOutput",type:"object",properties:{did:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},required:["did"]},SignInput:{title:"SignInput",oneOf:[{title:"SignTransaction",type:"object",properties:{type:{enum:["Transaction"]},data:{title:"Transaction",type:"object",additionalProperties:!0,properties:{from:{type:"string"},to:{type:"string"},nonce:{type:"number"}}}},required:["type","data"]},{title:"SignRaw",type:"object",properties:{type:{enum:["Raw"]},data:{type:"object",properties:{payload:{description:"Base64Url encoded data to sign",type:"string",pattern:"^[A-Za-z0-9_-]+$"}},required:["payload"]}},required:["type","data"]},{title:"SignJWT",type:"object",properties:{type:{enum:["JWT"]},data:{type:"object",properties:{header:{description:'header fields to be added to the JWS header. "alg" and "kid" will be ignored since they are automatically added by the wallet.',type:"object",additionalProperties:!0},payload:{description:"A JSON object to be signed by the wallet. It will become the payload of the generated JWS. 'iss' (issuer) and 'iat' (issued at) will be automatically added by the wallet and will override provided values.",type:"object",additionalProperties:!0}},required:["payload"]}},required:["type","data"]}]},SignRaw:{title:"SignRaw",type:"object",properties:{type:{enum:["Raw"]},data:{type:"object",properties:{payload:{description:"Base64Url encoded data to sign",type:"string",pattern:"^[A-Za-z0-9_-]+$"}},required:["payload"]}},required:["type","data"]},SignTransaction:{title:"SignTransaction",type:"object",properties:{type:{enum:["Transaction"]},data:{title:"Transaction",type:"object",additionalProperties:!0,properties:{from:{type:"string"},to:{type:"string"},nonce:{type:"number"}}}},required:["type","data"]},SignJWT:{title:"SignJWT",type:"object",properties:{type:{enum:["JWT"]},data:{type:"object",properties:{header:{description:'header fields to be added to the JWS header. "alg" and "kid" will be ignored since they are automatically added by the wallet.',type:"object",additionalProperties:!0},payload:{description:"A JSON object to be signed by the wallet. It will become the payload of the generated JWS. 'iss' (issuer) and 'iat' (issued at) will be automatically added by the wallet and will override provided values.",type:"object",additionalProperties:!0}},required:["payload"]}},required:["type","data"]},Transaction:{title:"Transaction",type:"object",additionalProperties:!0,properties:{from:{type:"string"},to:{type:"string"},nonce:{type:"number"}}},SignOutput:{title:"SignOutput",type:"object",properties:{signature:{type:"string"}},required:["signature"]},Receipt:{title:"Receipt",type:"object",properties:{receipt:{type:"string"}},required:["receipt"]},SignTypes:{title:"SignTypes",type:"string",enum:["Transaction","Raw","JWT"]},IdentityListInput:{title:"IdentityListInput",description:"A list of DIDs",type:"array",items:{type:"object",properties:{did:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},required:["did"]}},IdentityCreateInput:{title:"IdentityCreateInput",description:'Besides the here defined options, provider specific properties should be added here if necessary, e.g. "path" for BIP21 wallets, or the key algorithm (if the wallet supports multiple algorithm).\n',type:"object",properties:{alias:{type:"string"}},additionalProperties:!0},IdentityCreateOutput:{title:"IdentityCreateOutput",description:"It returns the account id and type\n",type:"object",properties:{did:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},additionalProperties:!0,required:["did"]},ResourceListOutput:{title:"ResourceListOutput",description:"A list of resources",type:"array",items:{title:"Resource",anyOf:[{title:"VerifiableCredential",type:"object",properties:{type:{example:"VerifiableCredential",enum:["VerifiableCredential"]},name:{type:"string",example:"Resource name"},resource:{type:"object",properties:{"@context":{type:"array",items:{type:"string"},example:["https://www.w3.org/2018/credentials/v1"]},id:{type:"string",example:"http://example.edu/credentials/1872"},type:{type:"array",items:{type:"string"},example:["VerifiableCredential"]},issuer:{type:"object",properties:{id:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},additionalProperties:!0,required:["id"]},issuanceDate:{type:"string",format:"date-time",example:"2021-06-10T19:07:28.000Z"},credentialSubject:{type:"object",properties:{id:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},required:["id"],additionalProperties:!0},proof:{type:"object",properties:{type:{type:"string",enum:["JwtProof2020"]}},required:["type"],additionalProperties:!0}},additionalProperties:!0,required:["@context","type","issuer","issuanceDate","credentialSubject","proof"]}},required:["type","resource"]},{title:"ObjectResource",type:"object",properties:{type:{example:"Object",enum:["Object"]},name:{type:"string",example:"Resource name"},parentResource:{type:"string"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",additionalProperties:!0}},required:["type","resource"]},{title:"JWK pair",type:"object",properties:{type:{example:"KeyPair",enum:["KeyPair"]},name:{type:"string",example:"Resource name"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",properties:{keyPair:{type:"object",properties:{privateJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents a private key (complementary to `publicJwk`)\n",example:'{"alg":"ES256","crv":"P-256","d":"rQp_3eZzvXwt1sK7WWsRhVYipqNGblzYDKKaYirlqs0","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'},publicJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents the public key (complementary to `privateJwk`).\n",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'}},required:["privateJwk","publicJwk"]}},required:["keyPair"]}},required:["type","resource"]},{title:"Contract",type:"object",properties:{type:{example:"Contract",enum:["Contract"]},name:{type:"string",example:"Resource name"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",properties:{dataSharingAgreement:{type:"object",required:["dataOfferingDescription","parties","purpose","duration","intendedUse","licenseGrant","dataStream","personalData","pricingModel","dataExchangeAgreement","signatures"],properties:{dataOfferingDescription:{type:"object",required:["dataOfferingId","version","active"],properties:{dataOfferingId:{type:"string"},version:{type:"integer"},category:{type:"string"},active:{type:"boolean"},title:{type:"string"}}},parties:{type:"object",required:["providerDid","consumerDid"],properties:{providerDid:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},consumerDid:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}}},purpose:{type:"string"},duration:{type:"object",required:["creationDate","startDate","endDate"],properties:{creationDate:{type:"integer"},startDate:{type:"integer"},endDate:{type:"integer"}}},intendedUse:{type:"object",required:["processData","shareDataWithThirdParty","editData"],properties:{processData:{type:"boolean"},shareDataWithThirdParty:{type:"boolean"},editData:{type:"boolean"}}},licenseGrant:{type:"object",required:["transferable","exclusiveness","paidUp","revocable","processing","modifying","analyzing","storingData","storingCopy","reproducing","distributing","loaning","selling","renting","furtherLicensing","leasing"],properties:{transferable:{type:"boolean"},exclusiveness:{type:"boolean"},paidUp:{type:"boolean"},revocable:{type:"boolean"},processing:{type:"boolean"},modifying:{type:"boolean"},analyzing:{type:"boolean"},storingData:{type:"boolean"},storingCopy:{type:"boolean"},reproducing:{type:"boolean"},distributing:{type:"boolean"},loaning:{type:"boolean"},selling:{type:"boolean"},renting:{type:"boolean"},furtherLicensing:{type:"boolean"},leasing:{type:"boolean"}}},dataStream:{type:"boolean"},personalData:{type:"boolean"},pricingModel:{type:"object",required:["basicPrice","currency","hasFreePrice"],properties:{paymentType:{type:"string"},pricingModelName:{type:"string"},basicPrice:{type:"number",format:"float"},currency:{type:"string"},fee:{type:"number",format:"float"},hasPaymentOnSubscription:{type:"object",properties:{paymentOnSubscriptionName:{type:"string"},paymentType:{type:"string"},timeDuration:{type:"string"},description:{type:"string"},repeat:{type:"string"},hasSubscriptionPrice:{type:"number"}}},hasFreePrice:{type:"object",properties:{hasPriceFree:{type:"boolean"}}}}},dataExchangeAgreement:{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},signatures:{type:"object",required:["providerSignature","consumerSignature"],properties:{providerSignature:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"},consumerSignature:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"}}}}},keyPair:{type:"object",properties:{privateJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents a private key (complementary to `publicJwk`)\n",example:'{"alg":"ES256","crv":"P-256","d":"rQp_3eZzvXwt1sK7WWsRhVYipqNGblzYDKKaYirlqs0","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'},publicJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents the public key (complementary to `privateJwk`).\n",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'}},required:["privateJwk","publicJwk"]}},required:["dataSharingAgreement"]}},required:["type","resource"]},{title:"NonRepudiationProof",type:"object",properties:{type:{example:"NonRepudiationProof",enum:["NonRepudiationProof"]},name:{type:"string",example:"Resource name"},resource:{description:"a non-repudiation proof (either a PoO, a PoR or a PoP) as a compact JWS"}},required:["type","resource"]},{title:"DataExchangeResource",type:"object",properties:{type:{example:"DataExchange",enum:["DataExchange"]},name:{type:"string",example:"Resource name"},resource:{allOf:[{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},{type:"object",properties:{cipherblockDgst:{type:"string",description:"hash of the cipherblock in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"},blockCommitment:{type:"string",description:"hash of the plaintext block in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"},secretCommitment:{type:"string",description:"ash of the secret that can be used to decrypt the block in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"}},required:["cipherblockDgst","blockCommitment","secretCommitment"]}]}},required:["type","resource"]}]}},Resource:{title:"Resource",anyOf:[{title:"VerifiableCredential",type:"object",properties:{type:{example:"VerifiableCredential",enum:["VerifiableCredential"]},name:{type:"string",example:"Resource name"},resource:{type:"object",properties:{"@context":{type:"array",items:{type:"string"},example:["https://www.w3.org/2018/credentials/v1"]},id:{type:"string",example:"http://example.edu/credentials/1872"},type:{type:"array",items:{type:"string"},example:["VerifiableCredential"]},issuer:{type:"object",properties:{id:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},additionalProperties:!0,required:["id"]},issuanceDate:{type:"string",format:"date-time",example:"2021-06-10T19:07:28.000Z"},credentialSubject:{type:"object",properties:{id:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},required:["id"],additionalProperties:!0},proof:{type:"object",properties:{type:{type:"string",enum:["JwtProof2020"]}},required:["type"],additionalProperties:!0}},additionalProperties:!0,required:["@context","type","issuer","issuanceDate","credentialSubject","proof"]}},required:["type","resource"]},{title:"ObjectResource",type:"object",properties:{type:{example:"Object",enum:["Object"]},name:{type:"string",example:"Resource name"},parentResource:{type:"string"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",additionalProperties:!0}},required:["type","resource"]},{title:"JWK pair",type:"object",properties:{type:{example:"KeyPair",enum:["KeyPair"]},name:{type:"string",example:"Resource name"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",properties:{keyPair:{type:"object",properties:{privateJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents a private key (complementary to `publicJwk`)\n",example:'{"alg":"ES256","crv":"P-256","d":"rQp_3eZzvXwt1sK7WWsRhVYipqNGblzYDKKaYirlqs0","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'},publicJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents the public key (complementary to `privateJwk`).\n",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'}},required:["privateJwk","publicJwk"]}},required:["keyPair"]}},required:["type","resource"]},{title:"Contract",type:"object",properties:{type:{example:"Contract",enum:["Contract"]},name:{type:"string",example:"Resource name"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",properties:{dataSharingAgreement:{type:"object",required:["dataOfferingDescription","parties","purpose","duration","intendedUse","licenseGrant","dataStream","personalData","pricingModel","dataExchangeAgreement","signatures"],properties:{dataOfferingDescription:{type:"object",required:["dataOfferingId","version","active"],properties:{dataOfferingId:{type:"string"},version:{type:"integer"},category:{type:"string"},active:{type:"boolean"},title:{type:"string"}}},parties:{type:"object",required:["providerDid","consumerDid"],properties:{providerDid:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},consumerDid:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}}},purpose:{type:"string"},duration:{type:"object",required:["creationDate","startDate","endDate"],properties:{creationDate:{type:"integer"},startDate:{type:"integer"},endDate:{type:"integer"}}},intendedUse:{type:"object",required:["processData","shareDataWithThirdParty","editData"],properties:{processData:{type:"boolean"},shareDataWithThirdParty:{type:"boolean"},editData:{type:"boolean"}}},licenseGrant:{type:"object",required:["transferable","exclusiveness","paidUp","revocable","processing","modifying","analyzing","storingData","storingCopy","reproducing","distributing","loaning","selling","renting","furtherLicensing","leasing"],properties:{transferable:{type:"boolean"},exclusiveness:{type:"boolean"},paidUp:{type:"boolean"},revocable:{type:"boolean"},processing:{type:"boolean"},modifying:{type:"boolean"},analyzing:{type:"boolean"},storingData:{type:"boolean"},storingCopy:{type:"boolean"},reproducing:{type:"boolean"},distributing:{type:"boolean"},loaning:{type:"boolean"},selling:{type:"boolean"},renting:{type:"boolean"},furtherLicensing:{type:"boolean"},leasing:{type:"boolean"}}},dataStream:{type:"boolean"},personalData:{type:"boolean"},pricingModel:{type:"object",required:["basicPrice","currency","hasFreePrice"],properties:{paymentType:{type:"string"},pricingModelName:{type:"string"},basicPrice:{type:"number",format:"float"},currency:{type:"string"},fee:{type:"number",format:"float"},hasPaymentOnSubscription:{type:"object",properties:{paymentOnSubscriptionName:{type:"string"},paymentType:{type:"string"},timeDuration:{type:"string"},description:{type:"string"},repeat:{type:"string"},hasSubscriptionPrice:{type:"number"}}},hasFreePrice:{type:"object",properties:{hasPriceFree:{type:"boolean"}}}}},dataExchangeAgreement:{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},signatures:{type:"object",required:["providerSignature","consumerSignature"],properties:{providerSignature:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"},consumerSignature:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"}}}}},keyPair:{type:"object",properties:{privateJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents a private key (complementary to `publicJwk`)\n",example:'{"alg":"ES256","crv":"P-256","d":"rQp_3eZzvXwt1sK7WWsRhVYipqNGblzYDKKaYirlqs0","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'},publicJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents the public key (complementary to `privateJwk`).\n",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'}},required:["privateJwk","publicJwk"]}},required:["dataSharingAgreement"]}},required:["type","resource"]},{title:"NonRepudiationProof",type:"object",properties:{type:{example:"NonRepudiationProof",enum:["NonRepudiationProof"]},name:{type:"string",example:"Resource name"},resource:{description:"a non-repudiation proof (either a PoO, a PoR or a PoP) as a compact JWS"}},required:["type","resource"]},{title:"DataExchangeResource",type:"object",properties:{type:{example:"DataExchange",enum:["DataExchange"]},name:{type:"string",example:"Resource name"},resource:{allOf:[{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},{type:"object",properties:{cipherblockDgst:{type:"string",description:"hash of the cipherblock in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"},blockCommitment:{type:"string",description:"hash of the plaintext block in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"},secretCommitment:{type:"string",description:"ash of the secret that can be used to decrypt the block in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"}},required:["cipherblockDgst","blockCommitment","secretCommitment"]}]}},required:["type","resource"]}]},VerifiableCredential:{title:"VerifiableCredential",type:"object",properties:{type:{example:"VerifiableCredential",enum:["VerifiableCredential"]},name:{type:"string",example:"Resource name"},resource:{type:"object",properties:{"@context":{type:"array",items:{type:"string"},example:["https://www.w3.org/2018/credentials/v1"]},id:{type:"string",example:"http://example.edu/credentials/1872"},type:{type:"array",items:{type:"string"},example:["VerifiableCredential"]},issuer:{type:"object",properties:{id:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},additionalProperties:!0,required:["id"]},issuanceDate:{type:"string",format:"date-time",example:"2021-06-10T19:07:28.000Z"},credentialSubject:{type:"object",properties:{id:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},required:["id"],additionalProperties:!0},proof:{type:"object",properties:{type:{type:"string",enum:["JwtProof2020"]}},required:["type"],additionalProperties:!0}},additionalProperties:!0,required:["@context","type","issuer","issuanceDate","credentialSubject","proof"]}},required:["type","resource"]},ObjectResource:{title:"ObjectResource",type:"object",properties:{type:{example:"Object",enum:["Object"]},name:{type:"string",example:"Resource name"},parentResource:{type:"string"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",additionalProperties:!0}},required:["type","resource"]},KeyPair:{title:"JWK pair",type:"object",properties:{type:{example:"KeyPair",enum:["KeyPair"]},name:{type:"string",example:"Resource name"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",properties:{keyPair:{type:"object",properties:{privateJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents a private key (complementary to `publicJwk`)\n",example:'{"alg":"ES256","crv":"P-256","d":"rQp_3eZzvXwt1sK7WWsRhVYipqNGblzYDKKaYirlqs0","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'},publicJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents the public key (complementary to `privateJwk`).\n",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'}},required:["privateJwk","publicJwk"]}},required:["keyPair"]}},required:["type","resource"]},Contract:{title:"Contract",type:"object",properties:{type:{example:"Contract",enum:["Contract"]},name:{type:"string",example:"Resource name"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",properties:{dataSharingAgreement:{type:"object",required:["dataOfferingDescription","parties","purpose","duration","intendedUse","licenseGrant","dataStream","personalData","pricingModel","dataExchangeAgreement","signatures"],properties:{dataOfferingDescription:{type:"object",required:["dataOfferingId","version","active"],properties:{dataOfferingId:{type:"string"},version:{type:"integer"},category:{type:"string"},active:{type:"boolean"},title:{type:"string"}}},parties:{type:"object",required:["providerDid","consumerDid"],properties:{providerDid:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},consumerDid:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}}},purpose:{type:"string"},duration:{type:"object",required:["creationDate","startDate","endDate"],properties:{creationDate:{type:"integer"},startDate:{type:"integer"},endDate:{type:"integer"}}},intendedUse:{type:"object",required:["processData","shareDataWithThirdParty","editData"],properties:{processData:{type:"boolean"},shareDataWithThirdParty:{type:"boolean"},editData:{type:"boolean"}}},licenseGrant:{type:"object",required:["transferable","exclusiveness","paidUp","revocable","processing","modifying","analyzing","storingData","storingCopy","reproducing","distributing","loaning","selling","renting","furtherLicensing","leasing"],properties:{transferable:{type:"boolean"},exclusiveness:{type:"boolean"},paidUp:{type:"boolean"},revocable:{type:"boolean"},processing:{type:"boolean"},modifying:{type:"boolean"},analyzing:{type:"boolean"},storingData:{type:"boolean"},storingCopy:{type:"boolean"},reproducing:{type:"boolean"},distributing:{type:"boolean"},loaning:{type:"boolean"},selling:{type:"boolean"},renting:{type:"boolean"},furtherLicensing:{type:"boolean"},leasing:{type:"boolean"}}},dataStream:{type:"boolean"},personalData:{type:"boolean"},pricingModel:{type:"object",required:["basicPrice","currency","hasFreePrice"],properties:{paymentType:{type:"string"},pricingModelName:{type:"string"},basicPrice:{type:"number",format:"float"},currency:{type:"string"},fee:{type:"number",format:"float"},hasPaymentOnSubscription:{type:"object",properties:{paymentOnSubscriptionName:{type:"string"},paymentType:{type:"string"},timeDuration:{type:"string"},description:{type:"string"},repeat:{type:"string"},hasSubscriptionPrice:{type:"number"}}},hasFreePrice:{type:"object",properties:{hasPriceFree:{type:"boolean"}}}}},dataExchangeAgreement:{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},signatures:{type:"object",required:["providerSignature","consumerSignature"],properties:{providerSignature:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"},consumerSignature:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"}}}}},keyPair:{type:"object",properties:{privateJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents a private key (complementary to `publicJwk`)\n",example:'{"alg":"ES256","crv":"P-256","d":"rQp_3eZzvXwt1sK7WWsRhVYipqNGblzYDKKaYirlqs0","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'},publicJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents the public key (complementary to `privateJwk`).\n",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'}},required:["privateJwk","publicJwk"]}},required:["dataSharingAgreement"]}},required:["type","resource"]},DataExchangeResource:{title:"DataExchangeResource",type:"object",properties:{type:{example:"DataExchange",enum:["DataExchange"]},name:{type:"string",example:"Resource name"},resource:{allOf:[{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},{type:"object",properties:{cipherblockDgst:{type:"string",description:"hash of the cipherblock in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"},blockCommitment:{type:"string",description:"hash of the plaintext block in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"},secretCommitment:{type:"string",description:"ash of the secret that can be used to decrypt the block in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"}},required:["cipherblockDgst","blockCommitment","secretCommitment"]}]}},required:["type","resource"]},NonRepudiationProof:{title:"NonRepudiationProof",type:"object",properties:{type:{example:"NonRepudiationProof",enum:["NonRepudiationProof"]},name:{type:"string",example:"Resource name"},resource:{description:"a non-repudiation proof (either a PoO, a PoR or a PoP) as a compact JWS"}},required:["type","resource"]},ResourceId:{type:"object",properties:{id:{type:"string"}},required:["id"]},ResourceType:{type:"string",enum:["VerifiableCredential","Object","KeyPair","Contract","DataExchange","NonRepudiationProof"]},SignedTransaction:{title:"SignedTransaction",description:"A list of resources",type:"object",properties:{transaction:{type:"string",pattern:"^0x(?:[A-Fa-f0-9])+$"}}},DecodedJwt:{title:"JwtPayload",type:"object",properties:{header:{type:"object",properties:{typ:{type:"string",enum:["JWT"]},alg:{type:"string",enum:["ES256K"]}},required:["typ","alg"],additionalProperties:!0},payload:{type:"object",properties:{iss:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},required:["iss"],additionalProperties:!0},signature:{type:"string",format:"^[A-Za-z0-9_-]+$"},data:{type:"string",format:"^[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+$",description:"."}},required:["signature","data"]},VerificationOutput:{title:"VerificationOutput",type:"object",properties:{verification:{type:"string",enum:["success","failed"],description:"whether verification has been successful or has failed"},error:{type:"string",description:"error message if verification failed"},decodedJwt:{description:"the decoded JWT"}},required:["verification"]},ProviderData:{title:"ProviderData",description:"A JSON object with information of the DLT provider currently in use.",type:"object",properties:{provider:{type:"string",example:"did:ethr:i3m"},network:{type:"string",example:"i3m"},rpcUrl:{type:"string",example:"http://95.211.3.250:8545"}},additionalProperties:!0},EthereumAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},did:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},IdentityData:{title:"Identity Data",type:"object",properties:{did:{type:"string",example:"did:ethr:i3m:0x03142f480f831e835822fc0cd35726844a7069d28df58fb82037f1598812e1ade8"},alias:{type:"string",example:"identity1"},provider:{type:"string",example:"did:ethr:i3m"},addresses:{type:"array",items:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},example:["0x8646cAcF516de1292be1D30AB68E7Ea51e9B1BE7"]}},required:["did"]},ApiError:{type:"object",title:"Error",required:["code","message"],properties:{code:{type:"integer",format:"int32"},message:{type:"string"}}},JwkPair:{type:"object",properties:{privateJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents a private key (complementary to `publicJwk`)\n",example:'{"alg":"ES256","crv":"P-256","d":"rQp_3eZzvXwt1sK7WWsRhVYipqNGblzYDKKaYirlqs0","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'},publicJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents the public key (complementary to `privateJwk`).\n",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'}},required:["privateJwk","publicJwk"]},CompactJWS:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"},DataExchangeAgreement:{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},DataSharingAgreement:{type:"object",required:["dataOfferingDescription","parties","purpose","duration","intendedUse","licenseGrant","dataStream","personalData","pricingModel","dataExchangeAgreement","signatures"],properties:{dataOfferingDescription:{type:"object",required:["dataOfferingId","version","active"],properties:{dataOfferingId:{type:"string"},version:{type:"integer"},category:{type:"string"},active:{type:"boolean"},title:{type:"string"}}},parties:{type:"object",required:["providerDid","consumerDid"],properties:{providerDid:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},consumerDid:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}}},purpose:{type:"string"},duration:{type:"object",required:["creationDate","startDate","endDate"],properties:{creationDate:{type:"integer"},startDate:{type:"integer"},endDate:{type:"integer"}}},intendedUse:{type:"object",required:["processData","shareDataWithThirdParty","editData"],properties:{processData:{type:"boolean"},shareDataWithThirdParty:{type:"boolean"},editData:{type:"boolean"}}},licenseGrant:{type:"object",required:["transferable","exclusiveness","paidUp","revocable","processing","modifying","analyzing","storingData","storingCopy","reproducing","distributing","loaning","selling","renting","furtherLicensing","leasing"],properties:{transferable:{type:"boolean"},exclusiveness:{type:"boolean"},paidUp:{type:"boolean"},revocable:{type:"boolean"},processing:{type:"boolean"},modifying:{type:"boolean"},analyzing:{type:"boolean"},storingData:{type:"boolean"},storingCopy:{type:"boolean"},reproducing:{type:"boolean"},distributing:{type:"boolean"},loaning:{type:"boolean"},selling:{type:"boolean"},renting:{type:"boolean"},furtherLicensing:{type:"boolean"},leasing:{type:"boolean"}}},dataStream:{type:"boolean"},personalData:{type:"boolean"},pricingModel:{type:"object",required:["basicPrice","currency","hasFreePrice"],properties:{paymentType:{type:"string"},pricingModelName:{type:"string"},basicPrice:{type:"number",format:"float"},currency:{type:"string"},fee:{type:"number",format:"float"},hasPaymentOnSubscription:{type:"object",properties:{paymentOnSubscriptionName:{type:"string"},paymentType:{type:"string"},timeDuration:{type:"string"},description:{type:"string"},repeat:{type:"string"},hasSubscriptionPrice:{type:"number"}}},hasFreePrice:{type:"object",properties:{hasPriceFree:{type:"boolean"}}}}},dataExchangeAgreement:{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},signatures:{type:"object",required:["providerSignature","consumerSignature"],properties:{providerSignature:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"},consumerSignature:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"}}}}},DataExchange:{allOf:[{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},{type:"object",properties:{cipherblockDgst:{type:"string",description:"hash of the cipherblock in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"},blockCommitment:{type:"string",description:"hash of the plaintext block in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"},secretCommitment:{type:"string",description:"ash of the secret that can be used to decrypt the block in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"}},required:["cipherblockDgst","blockCommitment","secretCommitment"]}]}}},se={id:"https://spec.openapis.org/oas/3.0/schema/2021-09-28",$schema:"http://json-schema.org/draft-04/schema#",description:"The description of OpenAPI v3.0.x documents, as defined by https://spec.openapis.org/oas/v3.0.3",type:"object",required:["openapi","info","paths"],properties:{openapi:{type:"string",pattern:"^3\\.0\\.\\d(-.+)?$"},info:{$ref:"#/definitions/Info"},externalDocs:{$ref:"#/definitions/ExternalDocumentation"},servers:{type:"array",items:{$ref:"#/definitions/Server"}},security:{type:"array",items:{$ref:"#/definitions/SecurityRequirement"}},tags:{type:"array",items:{$ref:"#/definitions/Tag"},uniqueItems:!0},paths:{$ref:"#/definitions/Paths"},components:{$ref:"#/definitions/Components"}},patternProperties:{"^x-":{}},additionalProperties:!1,definitions:{Reference:{type:"object",required:["$ref"],patternProperties:{"^\\$ref$":{type:"string",format:"uri-reference"}}},Info:{type:"object",required:["title","version"],properties:{title:{type:"string"},description:{type:"string"},termsOfService:{type:"string",format:"uri-reference"},contact:{$ref:"#/definitions/Contact"},license:{$ref:"#/definitions/License"},version:{type:"string"}},patternProperties:{"^x-":{}},additionalProperties:!1},Contact:{type:"object",properties:{name:{type:"string"},url:{type:"string",format:"uri-reference"},email:{type:"string",format:"email"}},patternProperties:{"^x-":{}},additionalProperties:!1},License:{type:"object",required:["name"],properties:{name:{type:"string"},url:{type:"string",format:"uri-reference"}},patternProperties:{"^x-":{}},additionalProperties:!1},Server:{type:"object",required:["url"],properties:{url:{type:"string"},description:{type:"string"},variables:{type:"object",additionalProperties:{$ref:"#/definitions/ServerVariable"}}},patternProperties:{"^x-":{}},additionalProperties:!1},ServerVariable:{type:"object",required:["default"],properties:{enum:{type:"array",items:{type:"string"}},default:{type:"string"},description:{type:"string"}},patternProperties:{"^x-":{}},additionalProperties:!1},Components:{type:"object",properties:{schemas:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]}}},responses:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/Response"}]}}},parameters:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/Parameter"}]}}},examples:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/Example"}]}}},requestBodies:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/RequestBody"}]}}},headers:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/Header"}]}}},securitySchemes:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/SecurityScheme"}]}}},links:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/Link"}]}}},callbacks:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/Callback"}]}}}},patternProperties:{"^x-":{}},additionalProperties:!1},Schema:{type:"object",properties:{title:{type:"string"},multipleOf:{type:"number",minimum:0,exclusiveMinimum:!0},maximum:{type:"number"},exclusiveMaximum:{type:"boolean",default:!1},minimum:{type:"number"},exclusiveMinimum:{type:"boolean",default:!1},maxLength:{type:"integer",minimum:0},minLength:{type:"integer",minimum:0,default:0},pattern:{type:"string",format:"regex"},maxItems:{type:"integer",minimum:0},minItems:{type:"integer",minimum:0,default:0},uniqueItems:{type:"boolean",default:!1},maxProperties:{type:"integer",minimum:0},minProperties:{type:"integer",minimum:0,default:0},required:{type:"array",items:{type:"string"},minItems:1,uniqueItems:!0},enum:{type:"array",items:{},minItems:1,uniqueItems:!1},type:{type:"string",enum:["array","boolean","integer","number","object","string"]},not:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]},allOf:{type:"array",items:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]}},oneOf:{type:"array",items:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]}},anyOf:{type:"array",items:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]}},items:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]},properties:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]}},additionalProperties:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"},{type:"boolean"}],default:!0},description:{type:"string"},format:{type:"string"},default:{},nullable:{type:"boolean",default:!1},discriminator:{$ref:"#/definitions/Discriminator"},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},example:{},externalDocs:{$ref:"#/definitions/ExternalDocumentation"},deprecated:{type:"boolean",default:!1},xml:{$ref:"#/definitions/XML"}},patternProperties:{"^x-":{}},additionalProperties:!1},Discriminator:{type:"object",required:["propertyName"],properties:{propertyName:{type:"string"},mapping:{type:"object",additionalProperties:{type:"string"}}}},XML:{type:"object",properties:{name:{type:"string"},namespace:{type:"string",format:"uri"},prefix:{type:"string"},attribute:{type:"boolean",default:!1},wrapped:{type:"boolean",default:!1}},patternProperties:{"^x-":{}},additionalProperties:!1},Response:{type:"object",required:["description"],properties:{description:{type:"string"},headers:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Header"},{$ref:"#/definitions/Reference"}]}},content:{type:"object",additionalProperties:{$ref:"#/definitions/MediaType"}},links:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Link"},{$ref:"#/definitions/Reference"}]}}},patternProperties:{"^x-":{}},additionalProperties:!1},MediaType:{type:"object",properties:{schema:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]},example:{},examples:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Example"},{$ref:"#/definitions/Reference"}]}},encoding:{type:"object",additionalProperties:{$ref:"#/definitions/Encoding"}}},patternProperties:{"^x-":{}},additionalProperties:!1,allOf:[{$ref:"#/definitions/ExampleXORExamples"}]},Example:{type:"object",properties:{summary:{type:"string"},description:{type:"string"},value:{},externalValue:{type:"string",format:"uri-reference"}},patternProperties:{"^x-":{}},additionalProperties:!1},Header:{type:"object",properties:{description:{type:"string"},required:{type:"boolean",default:!1},deprecated:{type:"boolean",default:!1},allowEmptyValue:{type:"boolean",default:!1},style:{type:"string",enum:["simple"],default:"simple"},explode:{type:"boolean"},allowReserved:{type:"boolean",default:!1},schema:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]},content:{type:"object",additionalProperties:{$ref:"#/definitions/MediaType"},minProperties:1,maxProperties:1},example:{},examples:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Example"},{$ref:"#/definitions/Reference"}]}}},patternProperties:{"^x-":{}},additionalProperties:!1,allOf:[{$ref:"#/definitions/ExampleXORExamples"},{$ref:"#/definitions/SchemaXORContent"}]},Paths:{type:"object",patternProperties:{"^\\/":{$ref:"#/definitions/PathItem"},"^x-":{}},additionalProperties:!1},PathItem:{type:"object",properties:{$ref:{type:"string"},summary:{type:"string"},description:{type:"string"},servers:{type:"array",items:{$ref:"#/definitions/Server"}},parameters:{type:"array",items:{oneOf:[{$ref:"#/definitions/Parameter"},{$ref:"#/definitions/Reference"}]},uniqueItems:!0}},patternProperties:{"^(get|put|post|delete|options|head|patch|trace)$":{$ref:"#/definitions/Operation"},"^x-":{}},additionalProperties:!1},Operation:{type:"object",required:["responses"],properties:{tags:{type:"array",items:{type:"string"}},summary:{type:"string"},description:{type:"string"},externalDocs:{$ref:"#/definitions/ExternalDocumentation"},operationId:{type:"string"},parameters:{type:"array",items:{oneOf:[{$ref:"#/definitions/Parameter"},{$ref:"#/definitions/Reference"}]},uniqueItems:!0},requestBody:{oneOf:[{$ref:"#/definitions/RequestBody"},{$ref:"#/definitions/Reference"}]},responses:{$ref:"#/definitions/Responses"},callbacks:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Callback"},{$ref:"#/definitions/Reference"}]}},deprecated:{type:"boolean",default:!1},security:{type:"array",items:{$ref:"#/definitions/SecurityRequirement"}},servers:{type:"array",items:{$ref:"#/definitions/Server"}}},patternProperties:{"^x-":{}},additionalProperties:!1},Responses:{type:"object",properties:{default:{oneOf:[{$ref:"#/definitions/Response"},{$ref:"#/definitions/Reference"}]}},patternProperties:{"^[1-5](?:\\d{2}|XX)$":{oneOf:[{$ref:"#/definitions/Response"},{$ref:"#/definitions/Reference"}]},"^x-":{}},minProperties:1,additionalProperties:!1},SecurityRequirement:{type:"object",additionalProperties:{type:"array",items:{type:"string"}}},Tag:{type:"object",required:["name"],properties:{name:{type:"string"},description:{type:"string"},externalDocs:{$ref:"#/definitions/ExternalDocumentation"}},patternProperties:{"^x-":{}},additionalProperties:!1},ExternalDocumentation:{type:"object",required:["url"],properties:{description:{type:"string"},url:{type:"string",format:"uri-reference"}},patternProperties:{"^x-":{}},additionalProperties:!1},ExampleXORExamples:{description:"Example and examples are mutually exclusive",not:{required:["example","examples"]}},SchemaXORContent:{description:"Schema and content are mutually exclusive, at least one is required",not:{required:["schema","content"]},oneOf:[{required:["schema"]},{required:["content"],description:"Some properties are not allowed if content is present",allOf:[{not:{required:["style"]}},{not:{required:["explode"]}},{not:{required:["allowReserved"]}},{not:{required:["example"]}},{not:{required:["examples"]}}]}]},Parameter:{type:"object",properties:{name:{type:"string"},in:{type:"string"},description:{type:"string"},required:{type:"boolean",default:!1},deprecated:{type:"boolean",default:!1},allowEmptyValue:{type:"boolean",default:!1},style:{type:"string"},explode:{type:"boolean"},allowReserved:{type:"boolean",default:!1},schema:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]},content:{type:"object",additionalProperties:{$ref:"#/definitions/MediaType"},minProperties:1,maxProperties:1},example:{},examples:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Example"},{$ref:"#/definitions/Reference"}]}}},patternProperties:{"^x-":{}},additionalProperties:!1,required:["name","in"],allOf:[{$ref:"#/definitions/ExampleXORExamples"},{$ref:"#/definitions/SchemaXORContent"},{$ref:"#/definitions/ParameterLocation"}]},ParameterLocation:{description:"Parameter location",oneOf:[{description:"Parameter in path",required:["required"],properties:{in:{enum:["path"]},style:{enum:["matrix","label","simple"],default:"simple"},required:{enum:[!0]}}},{description:"Parameter in query",properties:{in:{enum:["query"]},style:{enum:["form","spaceDelimited","pipeDelimited","deepObject"],default:"form"}}},{description:"Parameter in header",properties:{in:{enum:["header"]},style:{enum:["simple"],default:"simple"}}},{description:"Parameter in cookie",properties:{in:{enum:["cookie"]},style:{enum:["form"],default:"form"}}}]},RequestBody:{type:"object",required:["content"],properties:{description:{type:"string"},content:{type:"object",additionalProperties:{$ref:"#/definitions/MediaType"}},required:{type:"boolean",default:!1}},patternProperties:{"^x-":{}},additionalProperties:!1},SecurityScheme:{oneOf:[{$ref:"#/definitions/APIKeySecurityScheme"},{$ref:"#/definitions/HTTPSecurityScheme"},{$ref:"#/definitions/OAuth2SecurityScheme"},{$ref:"#/definitions/OpenIdConnectSecurityScheme"}]},APIKeySecurityScheme:{type:"object",required:["type","name","in"],properties:{type:{type:"string",enum:["apiKey"]},name:{type:"string"},in:{type:"string",enum:["header","query","cookie"]},description:{type:"string"}},patternProperties:{"^x-":{}},additionalProperties:!1},HTTPSecurityScheme:{type:"object",required:["scheme","type"],properties:{scheme:{type:"string"},bearerFormat:{type:"string"},description:{type:"string"},type:{type:"string",enum:["http"]}},patternProperties:{"^x-":{}},additionalProperties:!1,oneOf:[{description:"Bearer",properties:{scheme:{type:"string",pattern:"^[Bb][Ee][Aa][Rr][Ee][Rr]$"}}},{description:"Non Bearer",not:{required:["bearerFormat"]},properties:{scheme:{not:{type:"string",pattern:"^[Bb][Ee][Aa][Rr][Ee][Rr]$"}}}}]},OAuth2SecurityScheme:{type:"object",required:["type","flows"],properties:{type:{type:"string",enum:["oauth2"]},flows:{$ref:"#/definitions/OAuthFlows"},description:{type:"string"}},patternProperties:{"^x-":{}},additionalProperties:!1},OpenIdConnectSecurityScheme:{type:"object",required:["type","openIdConnectUrl"],properties:{type:{type:"string",enum:["openIdConnect"]},openIdConnectUrl:{type:"string",format:"uri-reference"},description:{type:"string"}},patternProperties:{"^x-":{}},additionalProperties:!1},OAuthFlows:{type:"object",properties:{implicit:{$ref:"#/definitions/ImplicitOAuthFlow"},password:{$ref:"#/definitions/PasswordOAuthFlow"},clientCredentials:{$ref:"#/definitions/ClientCredentialsFlow"},authorizationCode:{$ref:"#/definitions/AuthorizationCodeOAuthFlow"}},patternProperties:{"^x-":{}},additionalProperties:!1},ImplicitOAuthFlow:{type:"object",required:["authorizationUrl","scopes"],properties:{authorizationUrl:{type:"string",format:"uri-reference"},refreshUrl:{type:"string",format:"uri-reference"},scopes:{type:"object",additionalProperties:{type:"string"}}},patternProperties:{"^x-":{}},additionalProperties:!1},PasswordOAuthFlow:{type:"object",required:["tokenUrl","scopes"],properties:{tokenUrl:{type:"string",format:"uri-reference"},refreshUrl:{type:"string",format:"uri-reference"},scopes:{type:"object",additionalProperties:{type:"string"}}},patternProperties:{"^x-":{}},additionalProperties:!1},ClientCredentialsFlow:{type:"object",required:["tokenUrl","scopes"],properties:{tokenUrl:{type:"string",format:"uri-reference"},refreshUrl:{type:"string",format:"uri-reference"},scopes:{type:"object",additionalProperties:{type:"string"}}},patternProperties:{"^x-":{}},additionalProperties:!1},AuthorizationCodeOAuthFlow:{type:"object",required:["authorizationUrl","tokenUrl","scopes"],properties:{authorizationUrl:{type:"string",format:"uri-reference"},tokenUrl:{type:"string",format:"uri-reference"},refreshUrl:{type:"string",format:"uri-reference"},scopes:{type:"object",additionalProperties:{type:"string"}}},patternProperties:{"^x-":{}},additionalProperties:!1},Link:{type:"object",properties:{operationId:{type:"string"},operationRef:{type:"string",format:"uri-reference"},parameters:{type:"object",additionalProperties:{}},requestBody:{},description:{type:"string"},server:{$ref:"#/definitions/Server"}},patternProperties:{"^x-":{}},additionalProperties:!1,not:{description:"Operation Id and Operation Ref are mutually exclusive",required:["operationId","operationRef"]}},Callback:{type:"object",additionalProperties:{$ref:"#/definitions/PathItem"},patternProperties:{"^x-":{}}},Encoding:{type:"object",properties:{contentType:{type:"string"},headers:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Header"},{$ref:"#/definitions/Reference"}]}},style:{type:"string",enum:["form","spaceDelimited","pipeDelimited","deepObject"]},explode:{type:"boolean"},allowReserved:{type:"boolean",default:!1}},additionalProperties:!1}}};function pe(e){if(new Date(e).getTime()>0)return Number(e);throw new A(new Error("invalid timestamp"),["invalid timestamp"])}async function de(e){const t=[],i=Object.keys(e);(i.length<10||i.length>11)&&t.push(new A(new Error("Invalid agreeemt: "+JSON.stringify(e,void 0,2)),["invalid format"]));for(const r of i){let i;switch(r){case"orig":case"dest":try{e[r]!==await J(JSON.parse(e[r]),!0)&&t.push(new A(`[dataExchangeAgreeement.${r}] A valid stringified JWK must be provided. For uniqueness, JWK claims must be alphabetically sorted in the stringified JWK. You can use the parseJWK(jwk, true) for that purpose.\n${e[r]}`,["invalid key","invalid format"]))}catch(e){t.push(new A(`[dataExchangeAgreeement.${r}] A valid stringified JWK must be provided. For uniqueness, JWK claims must be alphabetically sorted in the stringified JWK. You can use the parseJWK(jwk, true) for that purpose.`,["invalid key","invalid format"]))}break;case"ledgerContractAddress":case"ledgerSignerAddress":try{i=I(e[r]),e[r]!==i&&t.push(new A(`[dataExchangeAgreeement.${r}] Invalid EIP-55 address ${e[r]}. Did you mean ${i} instead?`,["invalid EIP-55 address","invalid format"]))}catch(i){t.push(new A(`[dataExchangeAgreeement.${r}] Invalid EIP-55 address ${e[r]}.`,["invalid EIP-55 address","invalid format"]))}break;case"pooToPorDelay":case"pooToPopDelay":case"pooToSecretDelay":try{e[r]!==pe(e[r])&&t.push(new A(`[dataExchangeAgreeement.${r}] < 0 or not a number`,["invalid timestamp","invalid format"]))}catch(e){t.push(new A(`[dataExchangeAgreeement.${r}] < 0 or not a number`,["invalid timestamp","invalid format"]))}break;case"hashAlg":b.includes(e[r])||t.push(new A(`[dataExchangeAgreeement.${r}Invalid hash algorithm '${e[r]}'. It must be one of: ${b.join(", ")}`,["invalid algorithm"]));break;case"encAlg":x.includes(e[r])||t.push(new A(`[dataExchangeAgreeement.${r}Invalid encryption algorithm '${e[r]}'. It must be one of: ${x.join(", ")}`,["invalid algorithm"]));break;case"signingAlg":w.includes(e[r])||t.push(new A(`[dataExchangeAgreeement.${r}Invalid signing algorithm '${e[r]}'. It must be one of: ${w.join(", ")}`,["invalid algorithm"]));break;case"schema":break;default:t.push(new A(new Error(`Property ${r} not allowed in dataAgreement`),["invalid format"]))}}return t}var ce=Object.freeze({__proto__:null,NonRepudiationDest:class{constructor(e,t,i){this.initialized=new Promise(((r,a)=>{this.asyncConstructor(e,t,i).then((()=>{r(!0)})).catch((e=>{a(e)}))}))}async asyncConstructor(e,t,i){const r=await de(e);if(r.length>0){const e=[];let t=[];throw r.forEach((i=>{e.push(i.message),t=t.concat(i.nrErrors)})),t=[...new Set(t)],new A("Resource has not been validated:\n"+e.join("\n"),t)}this.agreement=e,this.jwkPairDest={privateJwk:t,publicJwk:JSON.parse(e.dest)},this.publicJwkOrig=JSON.parse(e.orig),await $(this.jwkPairDest.publicJwk,this.jwkPairDest.privateJwk),this.dltAgent=i;const a=await this.dltAgent.getContractAddress();if(this.agreement.ledgerContractAddress!==a)throw new Error(`Contract address ${a} does not meet agreed one ${this.agreement.ledgerContractAddress}`);this.block={}}async verifyPoO(e,t,i){await this.initialized;const r=y.encode(await T(t,this.agreement.hashAlg),!0,!1),{payload:a}=await j(e),n={...this.agreement,cipherblockDgst:r,blockCommitment:a.exchange.blockCommitment,secretCommitment:a.exchange.secretCommitment},o={proofType:"PoO",iss:"orig",exchange:{...n,id:await F(n)}},s={timestamp:Date.now(),notBefore:"iat",notAfter:"iat",...i},p=await z(e,o,s);return this.block={jwe:t,poo:{jws:e,payload:p.payload}},this.exchange=p.payload.exchange,p}async generatePoR(){if(await this.initialized,void 0===this.exchange||void 0===this.block.poo)throw new Error("Before computing a PoR, you have first to receive a valid cipherblock with a PoO and validate the PoO");const e={proofType:"PoR",iss:"dest",exchange:this.exchange,poo:this.block.poo.jws};return this.block.por=await _(e,this.jwkPairDest.privateJwk),this.block.por}async verifyPoP(e,i){if(await this.initialized,void 0===this.exchange||void 0===this.block.por||void 0===this.block.poo)throw new Error("Cannot verify a PoP if not even a PoR have been created");const r={proofType:"PoP",iss:"orig",exchange:this.exchange,por:this.block.por.jws,secret:"",verificationCode:""},a={timestamp:Date.now(),notBefore:"iat",notAfter:1e3*this.block.poo.payload.iat+this.exchange.pooToPopDelay,...i},n=await z(e,r,a),o=JSON.parse(n.payload.secret);return this.block.secret={hex:t.bufToHex(y.decode(o.k)),jwk:o},this.block.pop={jws:e,payload:n.payload},n}async getSecretFromLedger(){if(await this.initialized,void 0===this.exchange||void 0===this.block.poo||void 0===this.block.por)throw new Error("Cannot get secret if a PoR has not been sent before");const e=Date.now(),t=1e3*this.block.poo.payload.iat+this.agreement.pooToSecretDelay,i=Math.round((t-e)/1e3),{hex:r,iat:a}=await this.dltAgent.getSecretFromLedger(D(this.agreement.encAlg),this.agreement.ledgerSignerAddress,this.exchange.id,i);this.block.secret=await C(this.exchange.encAlg,r);try{q(1e3*a,1e3*this.block.por.payload.iat,1e3*this.block.poo.payload.iat+this.exchange.pooToSecretDelay)}catch(e){throw new A(`Although the secret has been obtained (and you could try to decrypt the cipherblock), it's been published later than agreed: ${new Date(1e3*a).toUTCString()} > ${new Date(1e3*this.block.poo.payload.iat+this.agreement.pooToSecretDelay).toUTCString()}`,["secret not published in time"])}return this.block.secret}async decrypt(){if(await this.initialized,void 0===this.exchange)throw new Error("No agreed exchange");if(void 0===this.block.secret?.jwk)throw new Error("Cannot decrypt without the secret");if(void 0===this.block.jwe)throw new Error("No cipherblock to decrypt");const e=(await E(this.block.jwe,this.block.secret.jwk)).plaintext;if(y.encode(await T(e,this.agreement.hashAlg),!0,!1)!==this.exchange.blockCommitment)throw new Error("Decrypted block does not meet the committed one");return this.block.raw=e,e}async generateVerificationRequest(){if(await this.initialized,void 0===this.block.por||void 0===this.exchange)throw new Error("Before generating a VerificationRequest, you have first to hold a valid PoR for the exchange");return await K("dest",this.exchange.id,this.block.por.jws,this.jwkPairDest.privateJwk)}async generateDisputeRequest(){if(await this.initialized,void 0===this.block.por||void 0===this.block.jwe||void 0===this.exchange)throw new Error("Before generating a VerificationRequest, you have first to hold a valid PoR for the exchange and have received the cipherblock");const e={proofType:"request",iss:"dest",por:this.block.por.jws,type:"disputeRequest",cipherblock:this.block.jwe,iat:Math.floor(Date.now()/1e3),dataExchangeId:this.exchange.id},t=await S(this.jwkPairDest.privateJwk);try{return await new a.SignJWT(e).setProtectedHeader({alg:this.jwkPairDest.privateJwk.alg}).setIssuedAt(e.iat).sign(t)}catch(e){throw new A(e,["unexpected error"])}}},NonRepudiationOrig:class{constructor(e,t,i,r){this.jwkPairOrig={privateJwk:t,publicJwk:JSON.parse(e.orig)},this.publicJwkDest=JSON.parse(e.dest),this.block={raw:i},this.initialized=new Promise(((t,i)=>{this.init(e,r).then((()=>{t(!0)})).catch((e=>{i(e)}))}))}async init(e,i){const r=await de(e);if(r.length>0){const e=[];let t=[];throw r.forEach((i=>{e.push(i.message),t=t.concat(i.nrErrors)})),t=[...new Set(t)],new A("Resource has not been validated:\n"+e.join("\n"),t)}this.agreement=e,await $(this.jwkPairOrig.publicJwk,this.jwkPairOrig.privateJwk);const a=await C(this.agreement.encAlg);this.block={...this.block,secret:a,jwe:await k(this.block.raw,a.jwk,this.agreement.encAlg)};const n=y.encode(await T(this.block.jwe,this.agreement.hashAlg),!0,!1),o=y.encode(await T(this.block.raw,this.agreement.hashAlg),!0,!1),s=y.encode(await T(new Uint8Array(t.hexToBuf(this.block.secret.hex)),this.agreement.hashAlg),!0,!1),p={...this.agreement,cipherblockDgst:n,blockCommitment:o,secretCommitment:s},d=await F(p);this.exchange={...p,id:d},await this._dltSetup(i)}async _dltSetup(e){this.dltAgent=e;const t=await this.dltAgent.getAddress();if(t!==this.exchange.ledgerSignerAddress)throw new Error(`ledgerSignerAddress: ${this.exchange.ledgerSignerAddress} does not meet the address ${t} derived from the provided private key`);const i=await this.dltAgent.getContractAddress();if(i!==R(this.agreement.ledgerContractAddress,!0))throw new Error(`Contract address in use ${i} does not meet the agreed one ${this.agreement.ledgerContractAddress}`)}async generatePoO(){return await this.initialized,this.block.poo=await _({proofType:"PoO",iss:"orig",exchange:this.exchange},this.jwkPairOrig.privateJwk),this.block.poo}async verifyPoR(e,t){if(await this.initialized,void 0===this.block.poo)throw new Error("Cannot verify a PoR if not even a PoO have been created");const i={proofType:"PoR",iss:"dest",exchange:this.exchange,poo:this.block.poo.jws},r=1e3*this.block.poo.payload.iat,a={timestamp:Date.now(),notBefore:r,notAfter:r+this.exchange.pooToPorDelay,...t},n=await z(e,i,a);return this.block.por={jws:e,payload:n.payload},this.block.por}async generatePoP(){if(await this.initialized,void 0===this.block.por)throw new Error("Before computing a PoP, you have first to have received and verified the PoR");const e=await this.dltAgent.deploySecret(this.block.secret.hex,this.exchange.id),t={proofType:"PoP",iss:"orig",exchange:this.exchange,por:this.block.por.jws,secret:JSON.stringify(this.block.secret.jwk),verificationCode:e};return this.block.pop=await _(t,this.jwkPairOrig.privateJwk),this.block.pop}async generateVerificationRequest(){if(await this.initialized,void 0===this.block.por)throw new Error("Before generating a VerificationRequest, you have first to hold a valid PoR for the exchange");return await K("orig",this.exchange.id,this.block.por.jws,this.jwkPairOrig.privateJwk)}}});exports.ConflictResolution=B,exports.ENC_ALGS=x,exports.EthersIoAgentDest=U,exports.EthersIoAgentOrig=ie,exports.HASH_ALGS=b,exports.I3mServerWalletAgentDest=te,exports.I3mServerWalletAgentOrig=ae,exports.I3mWalletAgentDest=Q,exports.I3mWalletAgentOrig=re,exports.KEY_AGREEMENT_ALGS=P,exports.NonRepudiationProtocol=ce,exports.NrError=A,exports.SIGNING_ALGS=w,exports.Signers=ne,exports.checkTimestamp=q,exports.createProof=_,exports.defaultDltConfig=V,exports.exchangeId=F,exports.generateKeys=async function(e,r,a){if(!w.includes(e))throw new A(new RangeError(`Invalid signature algorithm '${e}''. Allowed algorithms are ${w.toString()}`),["invalid algorithm"]);let n,o,s;switch(e){case"ES512":o="P-521",n=66;break;case"ES384":o="P-384",n=48;break;default:o="P-256",n=32}s=void 0!==r?"string"==typeof r?!0===a?y.decode(r):new Uint8Array(t.hexToBuf(r)):r:new Uint8Array(await i.randBytes(n));const p=new v("p"+o.substring(o.length-3)).keyFromPrivate(s),d=p.getPublic(),c=d.getX().toString("hex").padStart(2*n,"0"),l=d.getY().toString("hex").padStart(2*n,"0"),f=p.getPrivate("hex").padStart(2*n,"0"),g={kty:"EC",crv:o,x:y.encode(t.hexToBuf(c),!0,!1),y:y.encode(t.hexToBuf(l),!0,!1),d:y.encode(t.hexToBuf(f),!0,!1),alg:e},m={...g};return delete m.d,{publicJwk:m,privateJwk:g}},exports.getDltAddress=function(e){const t=e.match(/^did:ethr:(\w+:)?(0x[0-9a-fA-F]{40}[0-9a-fA-F]{26}?)$/),i=null!==t?t[t.length-1]:e;try{return o.ethers.utils.computeAddress(i)}catch(e){throw new A("no a DID or a valid public or private key",["invalid format"])}},exports.importJwk=S,exports.jsonSort=O,exports.jweDecrypt=E,exports.jweEncrypt=k,exports.jwsDecode=j,exports.oneTimeSecret=C,exports.parseAddress=I,exports.parseHex=R,exports.parseJwk=J,exports.sha=T,exports.validateDataExchange=async function(e){const t=[];try{const{id:i,...r}=e;i!==await F(r)&&t.push(new A("Invalid dataExchange id",["cannot verify","invalid format"]));const{blockCommitment:a,secretCommitment:n,cipherblockDgst:o,...s}=r,p=await de(s);p.length>0&&p.forEach((e=>{t.push(e)}))}catch(e){t.push(new A("Invalid dataExchange",["cannot verify","invalid format"]))}return t},exports.validateDataExchangeAgreement=de,exports.validateDataSharingAgreementSchema=async function(e){const t=[],i=new m.default({strictSchema:!1,removeAdditional:"all"});i.addMetaSchema(se),u.default(i);const r=oe.schemas.DataSharingAgreement;try{const a=i.compile(r),o=h.default.cloneDeep(e);a(e)||null!==a.errors&&void 0!==a.errors&&a.errors.length>0&&a.errors.forEach((e=>{t.push(new A(`[${e.instancePath}] ${e.message??"unknown"}`,["invalid format"]))})),n.hashable(o)!==n.hashable(e)&&t.push(new A("Additional claims beyond the schema are not supported",["invalid format"]))}catch(e){t.push(new A(e,["invalid format"]))}return t},exports.verifyKeyPair=$,exports.verifyProof=z; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXgubm9kZS5janMiLCJzb3VyY2VzIjpbIi4uL3NyYy90cy9jb25zdGFudHMudHMiLCIuLi9zcmMvdHMvZXJyb3JzL05yRXJyb3IudHMiLCIuLi9zcmMvdHMvY3J5cHRvL2dlbmVyYXRlS2V5cy50cyIsIi4uL3NyYy90cy9jcnlwdG8vaW1wb3J0SndrLnRzIiwiLi4vc3JjL3RzL2NyeXB0by9qd2UudHMiLCIuLi9zcmMvdHMvY3J5cHRvL2p3c0RlY29kZS50cyIsIi4uL3NyYy90cy91dGlscy9hbGdCeXRlTGVuZ3RoLnRzIiwiLi4vc3JjL3RzL2NyeXB0by9vbmVUaW1lU2VjcmV0LnRzIiwiLi4vc3JjL3RzL2NyeXB0by92ZXJpZnlLZXlQYWlyLnRzIiwiLi4vc3JjL3RzL3V0aWxzL3RpbWVzdGFtcHMudHMiLCIuLi9zcmMvdHMvdXRpbHMvanNvblNvcnQudHMiLCIuLi9zcmMvdHMvdXRpbHMvcGFyc2VIZXgudHMiLCIuLi9zcmMvdHMvdXRpbHMvcGFyc2VKd2sudHMiLCIuLi9zcmMvdHMvdXRpbHMvc2hhLnRzIiwiLi4vc3JjL3RzL3V0aWxzL3BhcnNlQWRkcmVzcy50cyIsIi4uL3NyYy90cy9leGNoYW5nZS9leGNoYW5nZUlkLnRzIiwiLi4vc3JjL3RzL3Byb29mcy9jcmVhdGVQcm9vZi50cyIsIi4uL3NyYy90cy9wcm9vZnMvdmVyaWZ5UHJvb2YudHMiLCIuLi9zcmMvdHMvY29uZmxpY3QtcmVzb2x1dG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EssRUFBT3VSLEtBQUssSUFBSS9SLEVBQVEsdUJBQXdCLENBQUMsZ0JBQWlCLG1CQUNuRSxDQUNELE9BQU9RLENBQ1Qsc0ZBbkRPTSxlQUFtRCtRLEdBQ3hELE1BQU1yUixFQUFrQixHQUVsQjRVLEVBQU0sSUFBSUMsRUFBQUEsUUFBSSxDQUFFQyxjQUFjLEVBQU9DLGlCQUFrQixRQUM3REgsRUFBSUksY0FBY0MsSUFFbEJDLEVBQVVDLFFBQUNQLEdBR1gsTUFBTVEsRUFBU0MsR0FBZ0JDLFFBQVFDLHFCQUN2QyxJQUNFLE1BQU1DLEVBQVdaLEVBQUlhLFFBQVFMLEdBQ3ZCTSxFQUFrQkMsRUFBQUEsUUFBRUMsVUFBVXZFLEdBQ3RCbUUsRUFBU25FLElBR0csT0FBcEJtRSxFQUFTeFYsYUFBdUNXLElBQXBCNlUsRUFBU3hWLFFBQXdCd1YsRUFBU3hWLE9BQU8wRCxPQUFTLEdBQ3hGOFIsRUFBU3hWLE9BQU8yUixTQUFRaFMsSUFDdEJLLEVBQU91UixLQUFLLElBQUkvUixFQUFRLElBQUlHLEVBQU1rVyxpQkFBaUJsVyxFQUFNaVMsU0FBVyxZQUFhLENBQUMsbUJBQW1CLElBSXZHeEosRUFBUUEsU0FBQ3NOLEtBQXFCdE4sRUFBUUEsU0FBQ2lKLElBQ3pDclIsRUFBT3VSLEtBQUssSUFBSS9SLEVBQVEsd0RBQXlELENBQUMsbUJBRXJGLENBQUMsTUFBT0csR0FDUEssRUFBT3VSLEtBQUssSUFBSS9SLEVBQVFHLEVBQU8sQ0FBQyxtQkFDakMsQ0FFRCxPQUFPSyxDQUNUIn0= diff --git a/dist/index.node.esm.js b/dist/index.node.esm.js index 6d3834a..e3581a9 100644 --- a/dist/index.node.esm.js +++ b/dist/index.node.esm.js @@ -1,2 +1,2 @@ -import*as e from"@juanelas/base64";import{decode as t}from"@juanelas/base64";import{hexToBuf as i,parseHex as r,bufToHex as a}from"bigint-conversion";import{randBytes as n,randBytesSync as o}from"bigint-crypto-utils";import s from"elliptic";import{importJWK as p,CompactEncrypt as d,decodeProtectedHeader as c,compactDecrypt as l,jwtVerify as f,generateSecret as y,exportJWK as m,GeneralSign as g,generalVerify as u,SignJWT as h}from"jose";import{hashable as b}from"object-sha";import{webcrypto as w}from"crypto";import{ethers as x,Wallet as P}from"ethers";import{SigningKey as A}from"ethers/lib/utils";import v from"ajv-draft-04";import S from"ajv-formats";import k from"lodash";const E=["SHA-256","SHA-384","SHA-512"],j=["ES256","ES384","ES512"],D=["A128GCM","A256GCM"],C=["ECDH-ES"];class $ extends Error{constructor(e,t){super(e),e instanceof $?(this.nrErrors=e.nrErrors,this.add(...t)):this.nrErrors=t}add(...e){const t=this.nrErrors.concat(e);this.nrErrors=[...new Set(t)]}}const{ec:q}=s;async function R(t,r,a){if(!j.includes(t))throw new $(new RangeError(`Invalid signature algorithm '${t}''. Allowed algorithms are ${j.toString()}`),["invalid algorithm"]);let o,s,p;switch(t){case"ES512":s="P-521",o=66;break;case"ES384":s="P-384",o=48;break;default:s="P-256",o=32}p=void 0!==r?"string"==typeof r?!0===a?e.decode(r):new Uint8Array(i(r)):r:new Uint8Array(await n(o));const d=new q("p"+s.substring(s.length-3)).keyFromPrivate(p),c=d.getPublic(),l=c.getX().toString("hex").padStart(2*o,"0"),f=c.getY().toString("hex").padStart(2*o,"0"),y=d.getPrivate("hex").padStart(2*o,"0"),m={kty:"EC",crv:s,x:e.encode(i(l),!0,!1),y:e.encode(i(f),!0,!1),d:e.encode(i(y),!0,!1),alg:t},g={...m};return delete g.d,{publicJwk:g,privateJwk:m}}async function O(e,t){const i=void 0===t?e.alg:t,r=D.concat(j).concat(C);if(!r.includes(i))throw new $("invalid alg. Must be one of: "+r.join(","),["invalid algorithm"]);try{const i=await p(e,t);if(null==i)throw new $(new Error("failed importing keys"),["invalid key"]);return i}catch(e){throw new $(e,["invalid key"])}}async function J(e,t,i){let r,a;const n={...t};if(D.includes(t.alg))r="dir",a=void 0!==i?i:t.alg;else{if(!j.concat(C).includes(t.alg))throw new $(`Not a valid symmetric or assymetric alg: ${t.alg}`,["encryption failed","invalid key","invalid algorithm"]);if(void 0===i)throw new $("An encryption algorith encAlg for content encryption should be provided. Allowed values are: "+D.join(","),["encryption failed"]);a=i,r="ECDH-ES",n.alg=r}const o=await O(n);let s;try{return s=await new d(e).setProtectedHeader({alg:r,enc:a,kid:t.kid}).encrypt(o),s}catch(e){throw new $(e,["encryption failed"])}}async function I(e,t){try{const i={...t},{alg:r,enc:a}=c(e);if(void 0===r||void 0===a)throw new $("missing enc or alg in jwe header",["invalid format"]);"ECDH-ES"===r&&(i.alg=r);const n=await O(i);return await l(e,n,{contentEncryptionAlgorithms:[a]})}catch(e){throw new $(e,["decryption failed"])}}async function T(t,i){const r=t.match(/^([a-zA-Z0-9_-]+)\.{1,2}([a-zA-Z0-9_-]+)\.([a-zA-Z0-9_-]+)$/);if(null===r)throw new $(new Error(`${t} is not a JWS`),["not a compact jws"]);let a,n;try{a=JSON.parse(e.decode(r[1],!0)),n=JSON.parse(e.decode(r[2],!0))}catch(e){throw new $(e,["invalid format","not a compact jws"])}if(void 0!==i){const e="function"==typeof i?await i(a,n):i,r=await O(e);try{const i=await f(t,r);return{header:i.protectedHeader,payload:i.payload,signer:e}}catch(e){throw new $(e,["jws verification failed"])}}return{header:a,payload:n}}function F(e){if(D.concat(E).concat(j).includes(e))return Number(e.match(/\d{3}/)[0])/8;throw new $("unsupported algorithm",["invalid algorithm"])}async function z(n,o,s){let p;if(!D.includes(n))throw new $(new Error(`Invalid encAlg '${n}'. Supported values are: ${D.toString()}`),["invalid algorithm"]);const d=F(n);if(void 0!==o){if("string"==typeof o)if(!0===s)p=e.decode(o);else{const e=r(o,!1);if(e!==r(o,!1,d))throw new $(new RangeError(`Expected hex length ${2*d} does not meet provided one ${e.length/2}`),["invalid key"]);p=new Uint8Array(i(o))}else p=o;if(p.length!==d)throw new $(new RangeError(`Expected secret length ${d} does not meet provided one ${p.length}`),["invalid key"])}else try{p=await y(n,{extractable:!0})}catch(e){throw new $(e,["unexpected error"])}const c=await m(p);return c.alg=n,{jwk:c,hex:a(t(c.k),!1,d)}}async function _(e,t){if(void 0===e.alg||void 0===t.alg||e.alg!==t.alg)throw new Error("alg no present in either pubJwk or privJwk, or pubJWK.alg != privJWK.alg");const i=await O(e),r=await O(t);try{const e=await n(16),a=await new g(e).addSignature(r).setProtectedHeader({alg:t.alg}).sign();await u(a,i)}catch(e){throw new $(e,["unexpected error"])}}function M(e,t,i,r=2e3){if(ei+r)throw new $(new Error(`timestamp ${new Date(e).toTimeString()} after 'notAfter' ${new Date(i).toTimeString()} with tolerance of ${r/1e3}s`),["invalid timestamp"])}function W(e){return Array.isArray(e)?e.sort().map(W):(t=e,"[object Object]"===Object.prototype.toString.call(t)?Object.keys(e).sort().reduce((function(t,i){return t[i]=W(e[i]),t}),{}):e);var t}function N(e,t=!1,i){try{return r(e,t,i)}catch(e){throw new $(e,["invalid format"])}}async function H(e,t){try{await O(e,e.alg);const i=W(e);return t?JSON.stringify(i):i}catch(e){throw new $(e,["invalid key"])}}async function K(e,t){const i=E;if(!i.includes(t))throw new $(new RangeError(`Valid hash algorith values are any of ${JSON.stringify(i)}`),["invalid algorithm"]);const r=new TextEncoder,a="string"==typeof e?r.encode(e).buffer:e;try{let e;{const i=t.toLowerCase().replace("-","");e=new Uint8Array((await import("crypto")).createHash(i).update(Buffer.from(a)).digest())}return e}catch(e){throw new $(e,["unexpected error"])}}function V(e){if(null==e.match(/^(0x)?([\da-fA-F]{40})$/))throw new RangeError("incorrect address format");try{const t=N(e,!0,20);return x.utils.getAddress(t)}catch(e){throw new $(e,["invalid EIP-55 address"])}}function B(e){const t=e.match(/^did:ethr:(\w+:)?(0x[0-9a-fA-F]{40}[0-9a-fA-F]{26}?)$/),i=null!==t?t[t.length-1]:e;try{return x.utils.computeAddress(i)}catch(e){throw new $("no a DID or a valid public or private key",["invalid format"])}}async function G(t){return e.encode(await K(b(t),"SHA-256"),!0,!1)}async function Z(e,t){if(void 0===e.iss)throw new Error('Payload iss should be set to either "orig" or "dest"');const i=JSON.parse(e.exchange[e.iss]);await _(i,t);const r=await O(t),a=t.alg,n={...e,iat:Math.floor(Date.now()/1e3)};return{jws:await new h(n).setProtectedHeader({alg:a}).setIssuedAt(n.iat).sign(r),payload:n}}async function X(e,t,i){const r=JSON.parse(t.exchange[t.iss]),a=await T(e,r);if(void 0===a.payload.iss)throw new Error('Property "iss" missing');if(void 0===a.payload.iat)throw new Error("Property claim iat missing");if(void 0!==i){M("iat"===i.timestamp?1e3*a.payload.iat:i.timestamp,"iat"===i.notBefore?1e3*a.payload.iat:i.notBefore,"iat"===i.notAfter?1e3*a.payload.iat:i.notAfter,i.tolerance)}const n=a.payload,o=n.exchange[n.iss];if(b(r)!==b(JSON.parse(o)))throw new Error(`The proof is issued by ${o} instead of ${JSON.stringify(r)}`);const s=t;for(const e in s){if(void 0===n[e])throw new Error(`Expected key '${e}' not found in proof`);if("exchange"===e){const e=t.exchange;L(n.exchange,e)}else if(""!==s[e]&&b(s[e])!==b(n[e]))throw new Error(`Proof's ${e}: ${JSON.stringify(n[e],void 0,2)} does not meet provided value ${JSON.stringify(s[e],void 0,2)}`)}return a}function L(e,t){const i=["id","orig","dest","hashAlg","cipherblockDgst","blockCommitment","blockCommitment","secretCommitment","schema"];for(const t of i)if("schema"!==t&&(void 0===e[t]||""===e[t]))throw new Error(`${t} is missing on dataExchange.\ndataExchange: ${JSON.stringify(e,void 0,2)}`);for(const i in t)if(""!==t[i]&&b(t[i])!==b(e[i]))throw new Error(`dataExchange's ${i}: ${JSON.stringify(e[i],void 0,2)} does not meet expected value ${JSON.stringify(t[i],void 0,2)}`)}async function U(e,t,i=10){const{payload:r}=await T(e),a=r.exchange,n={...a};delete n.id;if(await G(n)!==a.id)throw new $(new Error("data exchange integrity failed"),["dataExchange integrity violated"]);const o=JSON.parse(a.dest),s=JSON.parse(a.orig);let p,d,c;try{p=(await X(r.poo,{iss:"orig",proofType:"PoO",exchange:a})).payload}catch(e){throw new $(e,["invalid poo"])}try{await X(e,{iss:"dest",proofType:"PoR",exchange:a},{timestamp:"iat",notBefore:1e3*p.iat,notAfter:1e3*p.iat+a.pooToPorDelay})}catch(e){throw new $(e,["invalid por"])}try{const e=await t.getSecretFromLedger(F(a.encAlg),a.ledgerSignerAddress,a.id,i);d=e.hex,c=e.iat}catch(e){throw new $(e,["cannot verify"])}try{M(1e3*c,1e3*r.iat,1e3*p.iat+a.pooToSecretDelay)}catch(e){throw new $(`Although the secret has been obtained (and you could try to decrypt the cipherblock), it's been published later than agreed: ${new Date(1e3*c).toUTCString()} > ${new Date(1e3*p.iat+a.pooToSecretDelay).toUTCString()}`,["secret not published in time"])}return{pooPayload:p,porPayload:r,secretHex:d,destPublicJwk:o,origPublicJwk:s}}async function Y(e,t,i=10){let r,a,n,o,s;try{r=(await T(e)).payload}catch(e){throw new $(e,["invalid verification request"])}try{const e=await U(r.por,t,i);a=e.destPublicJwk,n=e.origPublicJwk,o=e.pooPayload,s=e.porPayload}catch(e){throw new $(e,["invalid por","invalid verification request"])}try{await T(e,"dest"===r.iss?a:n)}catch(e){throw new $(e,["invalid verification request"])}return{pooPayload:o,porPayload:s,vrPayload:r,destPublicJwk:a,origPublicJwk:n}}async function Q(t,i){const{payload:r}=await T(t),{destPublicJwk:a,origPublicJwk:n,secretHex:o,pooPayload:s,porPayload:p}=await U(r.por,i);try{await T(t,a)}catch(e){throw e instanceof $&&e.add("invalid dispute request"),e}if(e.encode(await K(r.cipherblock,p.exchange.hashAlg),!0,!1)!==p.exchange.cipherblockDgst)throw new $(new Error("cipherblock does not meet the committed (and already accepted) one"),["invalid dispute request"]);return await I(r.cipherblock,(await z(p.exchange.encAlg,o)).jwk),{pooPayload:s,porPayload:p,drPayload:r,destPublicJwk:a,origPublicJwk:n}}async function ee(e,t,i,r){const a={proofType:"request",iss:e,dataExchangeId:t,por:i,type:"verificationRequest",iat:Math.floor(Date.now()/1e3)},n=await p(r);return await new h(a).setProtectedHeader({alg:r.alg}).setIssuedAt(a.iat).sign(n)}var te=Object.freeze({__proto__:null,ConflictResolver:class{constructor(e,t){this.jwkPair=e,this.dltAgent=t,this.initialized=new Promise(((e,t)=>{this.init().then((()=>{e(!0)})).catch((e=>{t(e)}))}))}async init(){await _(this.jwkPair.publicJwk,this.jwkPair.privateJwk)}async resolveCompleteness(e){await this.initialized;const{payload:t}=await T(e);let i;try{i=(await T(t.por)).payload}catch(e){throw new $(e,["invalid por"])}const r={...await this._resolution(t.dataExchangeId,i.exchange[t.iss]),resolution:"not completed",type:"verification"};try{await Y(e,this.dltAgent),r.resolution="completed"}catch(e){if(!(e instanceof $)||e.nrErrors.includes("invalid verification request")||e.nrErrors.includes("unexpected error"))throw e}const a=await p(this.jwkPair.privateJwk);return await new h(r).setProtectedHeader({alg:this.jwkPair.privateJwk.alg}).setIssuedAt(r.iat).sign(a)}async resolveDispute(e){await this.initialized;const{payload:t}=await T(e);let i;try{i=(await T(t.por)).payload}catch(e){throw new $(e,["invalid por"])}const r={...await this._resolution(t.dataExchangeId,i.exchange[t.iss]),resolution:"denied",type:"dispute"};try{await Q(e,this.dltAgent)}catch(e){if(!(e instanceof $&&e.nrErrors.includes("decryption failed")))throw new $(e,["cannot verify"]);r.resolution="accepted"}const a=await p(this.jwkPair.privateJwk);return await new h(r).setProtectedHeader({alg:this.jwkPair.privateJwk.alg}).setIssuedAt(r.iat).sign(a)}async _resolution(e,t){return{proofType:"resolution",dataExchangeId:e,iat:Math.floor(Date.now()/1e3),iss:await H(this.jwkPair.publicJwk,!0),sub:t}}},checkCompleteness:Y,checkDecryption:Q,generateVerificationRequest:ee,verifyPor:U,verifyResolution:async function(e,t){return await T(e,t??((e,t)=>JSON.parse(t.iss)))}});const ie={gasLimit:125e5,contract:{address:"0x8d407A1722633bDD1dcf221474be7a44C05d7c2F",abi:[{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"sender",type:"address"},{indexed:!1,internalType:"uint256",name:"dataExchangeId",type:"uint256"},{indexed:!1,internalType:"uint256",name:"timestamp",type:"uint256"},{indexed:!1,internalType:"uint256",name:"secret",type:"uint256"}],name:"Registration",type:"event"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"uint256",name:"",type:"uint256"}],name:"registry",outputs:[{internalType:"uint256",name:"timestamp",type:"uint256"},{internalType:"uint256",name:"secret",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"_dataExchangeId",type:"uint256"},{internalType:"uint256",name:"_secret",type:"uint256"}],name:"setRegistry",outputs:[],stateMutability:"nonpayable",type:"function"}],transactionHash:"0x6a3828f8fe232819dc40ca66f93930b3bd1619db31a67ec34b44446b3e7c8289",receipt:{to:null,from:"0x17bd12C2134AfC1f6E9302a532eFE30C19B9E903",contractAddress:"0x8d407A1722633bDD1dcf221474be7a44C05d7c2F",transactionIndex:0,gasUsed:"253928",logsBloom:"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",blockHash:"0x0118672bb9b27679e616831d056d36291dd20cfe88c3ee2abd8f2dfce579cad4",transactionHash:"0x6a3828f8fe232819dc40ca66f93930b3bd1619db31a67ec34b44446b3e7c8289",logs:[],blockNumber:119389,cumulativeGasUsed:"253928",status:1,byzantium:!0},args:[],solcInputHash:"c528a37588793ef74285d75e08d6b8eb",metadata:'{"compiler":{"version":"0.8.4+commit.c7e474f2"},"language":"Solidity","output":{"abi":[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"dataExchangeId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"secret","type":"uint256"}],"name":"Registration","type":"event"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"registry","outputs":[{"internalType":"uint256","name":"timestamp","type":"uint256"},{"internalType":"uint256","name":"secret","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_dataExchangeId","type":"uint256"},{"internalType":"uint256","name":"_secret","type":"uint256"}],"name":"setRegistry","outputs":[],"stateMutability":"nonpayable","type":"function"}],"devdoc":{"kind":"dev","methods":{},"version":1},"userdoc":{"kind":"user","methods":{},"version":1}},"settings":{"compilationTarget":{"contracts/NonRepudiation.sol":"NonRepudiation"},"evmVersion":"istanbul","libraries":{},"metadata":{"bytecodeHash":"ipfs","useLiteralContent":true},"optimizer":{"enabled":false,"runs":200},"remappings":[]},"sources":{"contracts/NonRepudiation.sol":{"content":"//SPDX-License-Identifier: Unlicense\\npragma solidity ^0.8.0;\\n\\ncontract NonRepudiation {\\n struct Proof {\\n uint256 timestamp;\\n uint256 secret;\\n }\\n mapping(address => mapping (uint256 => Proof)) public registry;\\n event Registration(address sender, uint256 dataExchangeId, uint256 timestamp, uint256 secret);\\n\\n function setRegistry(uint256 _dataExchangeId, uint256 _secret) public {\\n require(registry[msg.sender][_dataExchangeId].secret == 0);\\n registry[msg.sender][_dataExchangeId] = Proof(block.timestamp, _secret);\\n emit Registration(msg.sender, _dataExchangeId, block.timestamp, _secret);\\n }\\n}\\n","keccak256":"0x8d371257a9b03c9102f158323e61f56ce49dd8489bd92c5a7d8abc3d9f6f8399","license":"Unlicense"}},"version":1}',bytecode:"0x608060405234801561001057600080fd5b506103a2806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c8063032439371461003b578063d05cb54514610057575b600080fd5b6100556004803603810190610050919061023a565b610088565b005b610071600480360381019061006c91906101fe565b6101a3565b60405161007f9291906102d9565b60405180910390f35b60008060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002060010154146100e757600080fd5b6040518060400160405280428152602001828152506000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002060008201518160000155602082015181600101559050507faa58599838af2e5e0f3251cfbb4eac5d5d447ded49f6b0ac28d6b44098224e63338342846040516101979493929190610294565b60405180910390a15050565b6000602052816000526040600020602052806000526040600020600091509150508060000154908060010154905082565b6000813590506101e38161033e565b92915050565b6000813590506101f881610355565b92915050565b6000806040838503121561021157600080fd5b600061021f858286016101d4565b9250506020610230858286016101e9565b9150509250929050565b6000806040838503121561024d57600080fd5b600061025b858286016101e9565b925050602061026c858286016101e9565b9150509250929050565b61027f81610302565b82525050565b61028e81610334565b82525050565b60006080820190506102a96000830187610276565b6102b66020830186610285565b6102c36040830185610285565b6102d06060830184610285565b95945050505050565b60006040820190506102ee6000830185610285565b6102fb6020830184610285565b9392505050565b600061030d82610314565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b61034781610302565b811461035257600080fd5b50565b61035e81610334565b811461036957600080fd5b5056fea26469706673582212204fd0fc653fb487221da9a14a4ca5d5499f9e9bc7b27ac8ab0f8d397fd6e3148564736f6c63430008040033",deployedBytecode:"0x608060405234801561001057600080fd5b50600436106100365760003560e01c8063032439371461003b578063d05cb54514610057575b600080fd5b6100556004803603810190610050919061023a565b610088565b005b610071600480360381019061006c91906101fe565b6101a3565b60405161007f9291906102d9565b60405180910390f35b60008060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002060010154146100e757600080fd5b6040518060400160405280428152602001828152506000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002060008201518160000155602082015181600101559050507faa58599838af2e5e0f3251cfbb4eac5d5d447ded49f6b0ac28d6b44098224e63338342846040516101979493929190610294565b60405180910390a15050565b6000602052816000526040600020602052806000526040600020600091509150508060000154908060010154905082565b6000813590506101e38161033e565b92915050565b6000813590506101f881610355565b92915050565b6000806040838503121561021157600080fd5b600061021f858286016101d4565b9250506020610230858286016101e9565b9150509250929050565b6000806040838503121561024d57600080fd5b600061025b858286016101e9565b925050602061026c858286016101e9565b9150509250929050565b61027f81610302565b82525050565b61028e81610334565b82525050565b60006080820190506102a96000830187610276565b6102b66020830186610285565b6102c36040830185610285565b6102d06060830184610285565b95945050505050565b60006040820190506102ee6000830185610285565b6102fb6020830184610285565b9392505050565b600061030d82610314565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b61034781610302565b811461035257600080fd5b50565b61035e81610334565b811461036957600080fd5b5056fea26469706673582212204fd0fc653fb487221da9a14a4ca5d5499f9e9bc7b27ac8ab0f8d397fd6e3148564736f6c63430008040033",devdoc:{kind:"dev",methods:{},version:1},userdoc:{kind:"user",methods:{},version:1},storageLayout:{storage:[{astId:13,contract:"contracts/NonRepudiation.sol:NonRepudiation",label:"registry",offset:0,slot:"0",type:"t_mapping(t_address,t_mapping(t_uint256,t_struct(Proof)6_storage))"}],types:{t_address:{encoding:"inplace",label:"address",numberOfBytes:"20"},"t_mapping(t_address,t_mapping(t_uint256,t_struct(Proof)6_storage))":{encoding:"mapping",key:"t_address",label:"mapping(address => mapping(uint256 => struct NonRepudiation.Proof))",numberOfBytes:"32",value:"t_mapping(t_uint256,t_struct(Proof)6_storage)"},"t_mapping(t_uint256,t_struct(Proof)6_storage)":{encoding:"mapping",key:"t_uint256",label:"mapping(uint256 => struct NonRepudiation.Proof)",numberOfBytes:"32",value:"t_struct(Proof)6_storage"},"t_struct(Proof)6_storage":{encoding:"inplace",label:"struct NonRepudiation.Proof",members:[{astId:3,contract:"contracts/NonRepudiation.sol:NonRepudiation",label:"timestamp",offset:0,slot:"0",type:"t_uint256"},{astId:5,contract:"contracts/NonRepudiation.sol:NonRepudiation",label:"secret",offset:0,slot:"1",type:"t_uint256"}],numberOfBytes:"64"},t_uint256:{encoding:"inplace",label:"uint256",numberOfBytes:"32"}}}}};async function re(t,i,r,n,o){let s=x.BigNumber.from(0),p=x.BigNumber.from(0);const d=N(a(e.decode(r)),!0);let c=0;do{try{({secret:s,timestamp:p}=await t.registry(N(i,!0),d))}catch(e){throw new $(e,["cannot contact the ledger"])}s.isZero()&&(c++,await new Promise((e=>setTimeout(e,1e3))))}while(s.isZero()&&c{null!==e&&"object"==typeof e&&"function"==typeof e.then?e.then((e=>{this.dltConfig={...ie,...e},this.provider=new x.providers.JsonRpcProvider(this.dltConfig.rpcProviderUrl),this.contract=new x.Contract(this.dltConfig.contract.address,this.dltConfig.contract.abi,this.provider),t(!0)})).catch((e=>i(e))):(this.dltConfig={...ie,...e},this.provider=new x.providers.JsonRpcProvider(this.dltConfig.rpcProviderUrl),this.contract=new x.Contract(this.dltConfig.contract.address,this.dltConfig.contract.abi,this.provider),t(!0))}))}async getContractAddress(){return await this.initialized,this.contract.address}}class se extends oe{async getSecretFromLedger(e,t,i,r){return await this.initialized,await re(this.contract,t,i,r,e)}}class pe extends oe{constructor(e,t,i){super(new Promise(((t,r)=>{e.providerinfo.get().then((e=>{const a=e.rpcUrl;void 0===a?r(new Error("wallet is not connected to RPC endpoint")):t({...i,rpcProviderUrl:"string"==typeof a?a:a[0]})})).catch((e=>{r(e)}))}))),this.wallet=e,this.did=t}}class de extends pe{async getSecretFromLedger(e,t,i,r){return await this.initialized,await re(this.contract,t,i,r,e)}}class ce extends oe{constructor(e,t,i){super(new Promise(((t,r)=>{e.providerinfoGet().then((e=>{const a=e.rpcUrl;void 0===a?r(new Error("wallet is not connected to RPC endpoint")):t({...i,rpcProviderUrl:"string"==typeof a?a:a[0]})})).catch((e=>{r(e)}))}))),this.wallet=e,this.did=t}}class le extends ce{async getSecretFromLedger(e,t,i,r){return await this.initialized,await re(this.contract,t,i,r,e)}}class fe extends oe{constructor(e,t){let r;super(e),this.count=-1,r=void 0===t?o(32):"string"==typeof t?new Uint8Array(i(t)):t;const a=new A(r);this.signer=new P(a,this.provider)}async deploySecret(e,t){await this.initialized;const i=await ae(e,t,this),r=await this.signer.signTransaction(i),a=await this.signer.provider.sendTransaction(r);return this.count=this.count+1,a.hash}async getAddress(){return await this.initialized,this.signer.address}async nextNonce(){await this.initialized;const e=await this.provider.getTransactionCount(await this.getAddress(),"pending");return e>this.count&&(this.count=e),this.count}}class ye extends pe{constructor(){super(...arguments),this.count=-1}async deploySecret(e,t){await this.initialized;const i=await ae(e,t,this),r=(await this.wallet.identities.sign({did:this.did},{type:"Transaction",data:i})).signature,a=await this.provider.sendTransaction(r);return this.count=this.count+1,a.hash}async getAddress(){await this.initialized;const e=await this.wallet.identities.info({did:this.did});if(void 0===e.addresses)throw new $(new Error("no addresses for did "+this.did),["unexpected error"]);return e.addresses[0]}async nextNonce(){await this.initialized;const e=await this.provider.getTransactionCount(await this.getAddress(),"pending");return e>this.count&&(this.count=e),this.count}}class me extends ce{constructor(){super(...arguments),this.count=-1}async deploySecret(e,t){await this.initialized;const i=await ae(e,t,this),r=(await this.wallet.identitySign({did:this.did},{type:"Transaction",data:i})).signature,a=await this.provider.sendTransaction(r);return this.count=this.count+1,a.hash}async getAddress(){await this.initialized;const e=await this.wallet.identityInfo({did:this.did});if(void 0===e.addresses)throw new $(`Can't get address for did: ${this.did}`,["unexpected error"]);return e.addresses[0]}async nextNonce(){await this.initialized;const e=await this.provider.getTransactionCount(await this.getAddress(),"pending");return e>this.count&&(this.count=e),this.count}}var ge=Object.freeze({__proto__:null,EthersIoAgentDest:se,EthersIoAgentOrig:fe,I3mServerWalletAgentDest:le,I3mServerWalletAgentOrig:me,I3mWalletAgentDest:de,I3mWalletAgentOrig:ye}),ue={schemas:{IdentitySelectOutput:{title:"IdentitySelectOutput",type:"object",properties:{did:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},required:["did"]},SignInput:{title:"SignInput",oneOf:[{title:"SignTransaction",type:"object",properties:{type:{enum:["Transaction"]},data:{title:"Transaction",type:"object",additionalProperties:!0,properties:{from:{type:"string"},to:{type:"string"},nonce:{type:"number"}}}},required:["type","data"]},{title:"SignRaw",type:"object",properties:{type:{enum:["Raw"]},data:{type:"object",properties:{payload:{description:"Base64Url encoded data to sign",type:"string",pattern:"^[A-Za-z0-9_-]+$"}},required:["payload"]}},required:["type","data"]},{title:"SignJWT",type:"object",properties:{type:{enum:["JWT"]},data:{type:"object",properties:{header:{description:'header fields to be added to the JWS header. "alg" and "kid" will be ignored since they are automatically added by the wallet.',type:"object",additionalProperties:!0},payload:{description:"A JSON object to be signed by the wallet. It will become the payload of the generated JWS. 'iss' (issuer) and 'iat' (issued at) will be automatically added by the wallet and will override provided values.",type:"object",additionalProperties:!0}},required:["payload"]}},required:["type","data"]}]},SignRaw:{title:"SignRaw",type:"object",properties:{type:{enum:["Raw"]},data:{type:"object",properties:{payload:{description:"Base64Url encoded data to sign",type:"string",pattern:"^[A-Za-z0-9_-]+$"}},required:["payload"]}},required:["type","data"]},SignTransaction:{title:"SignTransaction",type:"object",properties:{type:{enum:["Transaction"]},data:{title:"Transaction",type:"object",additionalProperties:!0,properties:{from:{type:"string"},to:{type:"string"},nonce:{type:"number"}}}},required:["type","data"]},SignJWT:{title:"SignJWT",type:"object",properties:{type:{enum:["JWT"]},data:{type:"object",properties:{header:{description:'header fields to be added to the JWS header. "alg" and "kid" will be ignored since they are automatically added by the wallet.',type:"object",additionalProperties:!0},payload:{description:"A JSON object to be signed by the wallet. It will become the payload of the generated JWS. 'iss' (issuer) and 'iat' (issued at) will be automatically added by the wallet and will override provided values.",type:"object",additionalProperties:!0}},required:["payload"]}},required:["type","data"]},Transaction:{title:"Transaction",type:"object",additionalProperties:!0,properties:{from:{type:"string"},to:{type:"string"},nonce:{type:"number"}}},SignOutput:{title:"SignOutput",type:"object",properties:{signature:{type:"string"}},required:["signature"]},Receipt:{title:"Receipt",type:"object",properties:{receipt:{type:"string"}},required:["receipt"]},SignTypes:{title:"SignTypes",type:"string",enum:["Transaction","Raw","JWT"]},IdentityListInput:{title:"IdentityListInput",description:"A list of DIDs",type:"array",items:{type:"object",properties:{did:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},required:["did"]}},IdentityCreateInput:{title:"IdentityCreateInput",description:'Besides the here defined options, provider specific properties should be added here if necessary, e.g. "path" for BIP21 wallets, or the key algorithm (if the wallet supports multiple algorithm).\n',type:"object",properties:{alias:{type:"string"}},additionalProperties:!0},IdentityCreateOutput:{title:"IdentityCreateOutput",description:"It returns the account id and type\n",type:"object",properties:{did:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},additionalProperties:!0,required:["did"]},ResourceListOutput:{title:"ResourceListOutput",description:"A list of resources",type:"array",items:{title:"Resource",anyOf:[{title:"VerifiableCredential",type:"object",properties:{type:{example:"VerifiableCredential",enum:["VerifiableCredential"]},name:{type:"string",example:"Resource name"},resource:{type:"object",properties:{"@context":{type:"array",items:{type:"string"},example:["https://www.w3.org/2018/credentials/v1"]},id:{type:"string",example:"http://example.edu/credentials/1872"},type:{type:"array",items:{type:"string"},example:["VerifiableCredential"]},issuer:{type:"object",properties:{id:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},additionalProperties:!0,required:["id"]},issuanceDate:{type:"string",format:"date-time",example:"2021-06-10T19:07:28.000Z"},credentialSubject:{type:"object",properties:{id:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},required:["id"],additionalProperties:!0},proof:{type:"object",properties:{type:{type:"string",enum:["JwtProof2020"]}},required:["type"],additionalProperties:!0}},additionalProperties:!0,required:["@context","type","issuer","issuanceDate","credentialSubject","proof"]}},required:["type","resource"]},{title:"ObjectResource",type:"object",properties:{type:{example:"Object",enum:["Object"]},name:{type:"string",example:"Resource name"},parentResource:{type:"string"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",additionalProperties:!0}},required:["type","resource"]},{title:"JWK pair",type:"object",properties:{type:{example:"KeyPair",enum:["KeyPair"]},name:{type:"string",example:"Resource name"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",properties:{keyPair:{type:"object",properties:{privateJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents a private key (complementary to `publicJwk`)\n",example:'{"alg":"ES256","crv":"P-256","d":"rQp_3eZzvXwt1sK7WWsRhVYipqNGblzYDKKaYirlqs0","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'},publicJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents the public key (complementary to `privateJwk`).\n",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'}},required:["privateJwk","publicJwk"]}},required:["keyPair"]}},required:["type","resource"]},{title:"Contract",type:"object",properties:{type:{example:"Contract",enum:["Contract"]},name:{type:"string",example:"Resource name"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",properties:{dataSharingAgreement:{type:"object",required:["dataOfferingDescription","parties","purpose","duration","intendedUse","licenseGrant","dataStream","personalData","pricingModel","dataExchangeAgreement","signatures"],properties:{dataOfferingDescription:{type:"object",required:["dataOfferingId","version","active"],properties:{dataOfferingId:{type:"string"},version:{type:"integer"},category:{type:"string"},active:{type:"boolean"},title:{type:"string"}}},parties:{type:"object",required:["providerDid","consumerDid"],properties:{providerDid:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},consumerDid:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}}},purpose:{type:"string"},duration:{type:"object",required:["creationDate","startDate","endDate"],properties:{creationDate:{type:"integer"},startDate:{type:"integer"},endDate:{type:"integer"}}},intendedUse:{type:"object",required:["processData","shareDataWithThirdParty","editData"],properties:{processData:{type:"boolean"},shareDataWithThirdParty:{type:"boolean"},editData:{type:"boolean"}}},licenseGrant:{type:"object",required:["transferable","exclusiveness","paidUp","revocable","processing","modifying","analyzing","storingData","storingCopy","reproducing","distributing","loaning","selling","renting","furtherLicensing","leasing"],properties:{transferable:{type:"boolean"},exclusiveness:{type:"boolean"},paidUp:{type:"boolean"},revocable:{type:"boolean"},processing:{type:"boolean"},modifying:{type:"boolean"},analyzing:{type:"boolean"},storingData:{type:"boolean"},storingCopy:{type:"boolean"},reproducing:{type:"boolean"},distributing:{type:"boolean"},loaning:{type:"boolean"},selling:{type:"boolean"},renting:{type:"boolean"},furtherLicensing:{type:"boolean"},leasing:{type:"boolean"}}},dataStream:{type:"boolean"},personalData:{type:"boolean"},pricingModel:{type:"object",required:["basicPrice","currency","hasFreePrice"],properties:{paymentType:{type:"string"},pricingModelName:{type:"string"},basicPrice:{type:"number",format:"float"},currency:{type:"string"},fee:{type:"number",format:"float"},hasPaymentOnSubscription:{type:"object",properties:{paymentOnSubscriptionName:{type:"string"},paymentType:{type:"string"},timeDuration:{type:"string"},description:{type:"string"},repeat:{type:"string"},hasSubscriptionPrice:{type:"number"}}},hasFreePrice:{type:"object",properties:{hasPriceFree:{type:"boolean"}}}}},dataExchangeAgreement:{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},signatures:{type:"object",required:["providerSignature","consumerSignature"],properties:{providerSignature:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"},consumerSignature:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"}}}}},keyPair:{type:"object",properties:{privateJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents a private key (complementary to `publicJwk`)\n",example:'{"alg":"ES256","crv":"P-256","d":"rQp_3eZzvXwt1sK7WWsRhVYipqNGblzYDKKaYirlqs0","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'},publicJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents the public key (complementary to `privateJwk`).\n",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'}},required:["privateJwk","publicJwk"]}},required:["dataSharingAgreement"]}},required:["type","resource"]},{title:"NonRepudiationProof",type:"object",properties:{type:{example:"NonRepudiationProof",enum:["NonRepudiationProof"]},name:{type:"string",example:"Resource name"},resource:{description:"a non-repudiation proof (either a PoO, a PoR or a PoP) as a compact JWS"}},required:["type","resource"]},{title:"DataExchangeResource",type:"object",properties:{type:{example:"DataExchange",enum:["DataExchange"]},name:{type:"string",example:"Resource name"},resource:{allOf:[{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},{type:"object",properties:{cipherblockDgst:{type:"string",description:"hash of the cipherblock in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"},blockCommitment:{type:"string",description:"hash of the plaintext block in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"},secretCommitment:{type:"string",description:"ash of the secret that can be used to decrypt the block in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"}},required:["cipherblockDgst","blockCommitment","secretCommitment"]}]}},required:["type","resource"]}]}},Resource:{title:"Resource",anyOf:[{title:"VerifiableCredential",type:"object",properties:{type:{example:"VerifiableCredential",enum:["VerifiableCredential"]},name:{type:"string",example:"Resource name"},resource:{type:"object",properties:{"@context":{type:"array",items:{type:"string"},example:["https://www.w3.org/2018/credentials/v1"]},id:{type:"string",example:"http://example.edu/credentials/1872"},type:{type:"array",items:{type:"string"},example:["VerifiableCredential"]},issuer:{type:"object",properties:{id:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},additionalProperties:!0,required:["id"]},issuanceDate:{type:"string",format:"date-time",example:"2021-06-10T19:07:28.000Z"},credentialSubject:{type:"object",properties:{id:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},required:["id"],additionalProperties:!0},proof:{type:"object",properties:{type:{type:"string",enum:["JwtProof2020"]}},required:["type"],additionalProperties:!0}},additionalProperties:!0,required:["@context","type","issuer","issuanceDate","credentialSubject","proof"]}},required:["type","resource"]},{title:"ObjectResource",type:"object",properties:{type:{example:"Object",enum:["Object"]},name:{type:"string",example:"Resource name"},parentResource:{type:"string"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",additionalProperties:!0}},required:["type","resource"]},{title:"JWK pair",type:"object",properties:{type:{example:"KeyPair",enum:["KeyPair"]},name:{type:"string",example:"Resource name"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",properties:{keyPair:{type:"object",properties:{privateJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents a private key (complementary to `publicJwk`)\n",example:'{"alg":"ES256","crv":"P-256","d":"rQp_3eZzvXwt1sK7WWsRhVYipqNGblzYDKKaYirlqs0","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'},publicJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents the public key (complementary to `privateJwk`).\n",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'}},required:["privateJwk","publicJwk"]}},required:["keyPair"]}},required:["type","resource"]},{title:"Contract",type:"object",properties:{type:{example:"Contract",enum:["Contract"]},name:{type:"string",example:"Resource name"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",properties:{dataSharingAgreement:{type:"object",required:["dataOfferingDescription","parties","purpose","duration","intendedUse","licenseGrant","dataStream","personalData","pricingModel","dataExchangeAgreement","signatures"],properties:{dataOfferingDescription:{type:"object",required:["dataOfferingId","version","active"],properties:{dataOfferingId:{type:"string"},version:{type:"integer"},category:{type:"string"},active:{type:"boolean"},title:{type:"string"}}},parties:{type:"object",required:["providerDid","consumerDid"],properties:{providerDid:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},consumerDid:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}}},purpose:{type:"string"},duration:{type:"object",required:["creationDate","startDate","endDate"],properties:{creationDate:{type:"integer"},startDate:{type:"integer"},endDate:{type:"integer"}}},intendedUse:{type:"object",required:["processData","shareDataWithThirdParty","editData"],properties:{processData:{type:"boolean"},shareDataWithThirdParty:{type:"boolean"},editData:{type:"boolean"}}},licenseGrant:{type:"object",required:["transferable","exclusiveness","paidUp","revocable","processing","modifying","analyzing","storingData","storingCopy","reproducing","distributing","loaning","selling","renting","furtherLicensing","leasing"],properties:{transferable:{type:"boolean"},exclusiveness:{type:"boolean"},paidUp:{type:"boolean"},revocable:{type:"boolean"},processing:{type:"boolean"},modifying:{type:"boolean"},analyzing:{type:"boolean"},storingData:{type:"boolean"},storingCopy:{type:"boolean"},reproducing:{type:"boolean"},distributing:{type:"boolean"},loaning:{type:"boolean"},selling:{type:"boolean"},renting:{type:"boolean"},furtherLicensing:{type:"boolean"},leasing:{type:"boolean"}}},dataStream:{type:"boolean"},personalData:{type:"boolean"},pricingModel:{type:"object",required:["basicPrice","currency","hasFreePrice"],properties:{paymentType:{type:"string"},pricingModelName:{type:"string"},basicPrice:{type:"number",format:"float"},currency:{type:"string"},fee:{type:"number",format:"float"},hasPaymentOnSubscription:{type:"object",properties:{paymentOnSubscriptionName:{type:"string"},paymentType:{type:"string"},timeDuration:{type:"string"},description:{type:"string"},repeat:{type:"string"},hasSubscriptionPrice:{type:"number"}}},hasFreePrice:{type:"object",properties:{hasPriceFree:{type:"boolean"}}}}},dataExchangeAgreement:{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},signatures:{type:"object",required:["providerSignature","consumerSignature"],properties:{providerSignature:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"},consumerSignature:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"}}}}},keyPair:{type:"object",properties:{privateJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents a private key (complementary to `publicJwk`)\n",example:'{"alg":"ES256","crv":"P-256","d":"rQp_3eZzvXwt1sK7WWsRhVYipqNGblzYDKKaYirlqs0","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'},publicJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents the public key (complementary to `privateJwk`).\n",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'}},required:["privateJwk","publicJwk"]}},required:["dataSharingAgreement"]}},required:["type","resource"]},{title:"NonRepudiationProof",type:"object",properties:{type:{example:"NonRepudiationProof",enum:["NonRepudiationProof"]},name:{type:"string",example:"Resource name"},resource:{description:"a non-repudiation proof (either a PoO, a PoR or a PoP) as a compact JWS"}},required:["type","resource"]},{title:"DataExchangeResource",type:"object",properties:{type:{example:"DataExchange",enum:["DataExchange"]},name:{type:"string",example:"Resource name"},resource:{allOf:[{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},{type:"object",properties:{cipherblockDgst:{type:"string",description:"hash of the cipherblock in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"},blockCommitment:{type:"string",description:"hash of the plaintext block in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"},secretCommitment:{type:"string",description:"ash of the secret that can be used to decrypt the block in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"}},required:["cipherblockDgst","blockCommitment","secretCommitment"]}]}},required:["type","resource"]}]},VerifiableCredential:{title:"VerifiableCredential",type:"object",properties:{type:{example:"VerifiableCredential",enum:["VerifiableCredential"]},name:{type:"string",example:"Resource name"},resource:{type:"object",properties:{"@context":{type:"array",items:{type:"string"},example:["https://www.w3.org/2018/credentials/v1"]},id:{type:"string",example:"http://example.edu/credentials/1872"},type:{type:"array",items:{type:"string"},example:["VerifiableCredential"]},issuer:{type:"object",properties:{id:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},additionalProperties:!0,required:["id"]},issuanceDate:{type:"string",format:"date-time",example:"2021-06-10T19:07:28.000Z"},credentialSubject:{type:"object",properties:{id:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},required:["id"],additionalProperties:!0},proof:{type:"object",properties:{type:{type:"string",enum:["JwtProof2020"]}},required:["type"],additionalProperties:!0}},additionalProperties:!0,required:["@context","type","issuer","issuanceDate","credentialSubject","proof"]}},required:["type","resource"]},ObjectResource:{title:"ObjectResource",type:"object",properties:{type:{example:"Object",enum:["Object"]},name:{type:"string",example:"Resource name"},parentResource:{type:"string"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",additionalProperties:!0}},required:["type","resource"]},KeyPair:{title:"JWK pair",type:"object",properties:{type:{example:"KeyPair",enum:["KeyPair"]},name:{type:"string",example:"Resource name"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",properties:{keyPair:{type:"object",properties:{privateJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents a private key (complementary to `publicJwk`)\n",example:'{"alg":"ES256","crv":"P-256","d":"rQp_3eZzvXwt1sK7WWsRhVYipqNGblzYDKKaYirlqs0","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'},publicJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents the public key (complementary to `privateJwk`).\n",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'}},required:["privateJwk","publicJwk"]}},required:["keyPair"]}},required:["type","resource"]},Contract:{title:"Contract",type:"object",properties:{type:{example:"Contract",enum:["Contract"]},name:{type:"string",example:"Resource name"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",properties:{dataSharingAgreement:{type:"object",required:["dataOfferingDescription","parties","purpose","duration","intendedUse","licenseGrant","dataStream","personalData","pricingModel","dataExchangeAgreement","signatures"],properties:{dataOfferingDescription:{type:"object",required:["dataOfferingId","version","active"],properties:{dataOfferingId:{type:"string"},version:{type:"integer"},category:{type:"string"},active:{type:"boolean"},title:{type:"string"}}},parties:{type:"object",required:["providerDid","consumerDid"],properties:{providerDid:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},consumerDid:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}}},purpose:{type:"string"},duration:{type:"object",required:["creationDate","startDate","endDate"],properties:{creationDate:{type:"integer"},startDate:{type:"integer"},endDate:{type:"integer"}}},intendedUse:{type:"object",required:["processData","shareDataWithThirdParty","editData"],properties:{processData:{type:"boolean"},shareDataWithThirdParty:{type:"boolean"},editData:{type:"boolean"}}},licenseGrant:{type:"object",required:["transferable","exclusiveness","paidUp","revocable","processing","modifying","analyzing","storingData","storingCopy","reproducing","distributing","loaning","selling","renting","furtherLicensing","leasing"],properties:{transferable:{type:"boolean"},exclusiveness:{type:"boolean"},paidUp:{type:"boolean"},revocable:{type:"boolean"},processing:{type:"boolean"},modifying:{type:"boolean"},analyzing:{type:"boolean"},storingData:{type:"boolean"},storingCopy:{type:"boolean"},reproducing:{type:"boolean"},distributing:{type:"boolean"},loaning:{type:"boolean"},selling:{type:"boolean"},renting:{type:"boolean"},furtherLicensing:{type:"boolean"},leasing:{type:"boolean"}}},dataStream:{type:"boolean"},personalData:{type:"boolean"},pricingModel:{type:"object",required:["basicPrice","currency","hasFreePrice"],properties:{paymentType:{type:"string"},pricingModelName:{type:"string"},basicPrice:{type:"number",format:"float"},currency:{type:"string"},fee:{type:"number",format:"float"},hasPaymentOnSubscription:{type:"object",properties:{paymentOnSubscriptionName:{type:"string"},paymentType:{type:"string"},timeDuration:{type:"string"},description:{type:"string"},repeat:{type:"string"},hasSubscriptionPrice:{type:"number"}}},hasFreePrice:{type:"object",properties:{hasPriceFree:{type:"boolean"}}}}},dataExchangeAgreement:{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},signatures:{type:"object",required:["providerSignature","consumerSignature"],properties:{providerSignature:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"},consumerSignature:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"}}}}},keyPair:{type:"object",properties:{privateJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents a private key (complementary to `publicJwk`)\n",example:'{"alg":"ES256","crv":"P-256","d":"rQp_3eZzvXwt1sK7WWsRhVYipqNGblzYDKKaYirlqs0","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'},publicJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents the public key (complementary to `privateJwk`).\n",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'}},required:["privateJwk","publicJwk"]}},required:["dataSharingAgreement"]}},required:["type","resource"]},DataExchangeResource:{title:"DataExchangeResource",type:"object",properties:{type:{example:"DataExchange",enum:["DataExchange"]},name:{type:"string",example:"Resource name"},resource:{allOf:[{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},{type:"object",properties:{cipherblockDgst:{type:"string",description:"hash of the cipherblock in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"},blockCommitment:{type:"string",description:"hash of the plaintext block in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"},secretCommitment:{type:"string",description:"ash of the secret that can be used to decrypt the block in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"}},required:["cipherblockDgst","blockCommitment","secretCommitment"]}]}},required:["type","resource"]},NonRepudiationProof:{title:"NonRepudiationProof",type:"object",properties:{type:{example:"NonRepudiationProof",enum:["NonRepudiationProof"]},name:{type:"string",example:"Resource name"},resource:{description:"a non-repudiation proof (either a PoO, a PoR or a PoP) as a compact JWS"}},required:["type","resource"]},ResourceId:{type:"object",properties:{id:{type:"string"}},required:["id"]},ResourceType:{type:"string",enum:["VerifiableCredential","Object","KeyPair","Contract","DataExchange","NonRepudiationProof"]},SignedTransaction:{title:"SignedTransaction",description:"A list of resources",type:"object",properties:{transaction:{type:"string",pattern:"^0x(?:[A-Fa-f0-9])+$"}}},DecodedJwt:{title:"JwtPayload",type:"object",properties:{header:{type:"object",properties:{typ:{type:"string",enum:["JWT"]},alg:{type:"string",enum:["ES256K"]}},required:["typ","alg"],additionalProperties:!0},payload:{type:"object",properties:{iss:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},required:["iss"],additionalProperties:!0},signature:{type:"string",format:"^[A-Za-z0-9_-]+$"},data:{type:"string",format:"^[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+$",description:"."}},required:["signature","data"]},VerificationOutput:{title:"VerificationOutput",type:"object",properties:{verification:{type:"string",enum:["success","failed"],description:"whether verification has been successful or has failed"},error:{type:"string",description:"error message if verification failed"},decodedJwt:{description:"the decoded JWT"}},required:["verification"]},ProviderData:{title:"ProviderData",description:"A JSON object with information of the DLT provider currently in use.",type:"object",properties:{provider:{type:"string",example:"did:ethr:i3m"},network:{type:"string",example:"i3m"},rpcUrl:{oneOf:[{type:"string",example:"http://95.211.3.250:8545"},{type:"array",items:{type:"string"},uniqueItems:!0,example:["http://95.211.3.249:8545","http://95.211.3.250:8545"]}]}},additionalProperties:!0},EthereumAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},did:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},IdentityData:{title:"Identity Data",type:"object",properties:{did:{type:"string",example:"did:ethr:i3m:0x03142f480f831e835822fc0cd35726844a7069d28df58fb82037f1598812e1ade8"},alias:{type:"string",example:"identity1"},provider:{type:"string",example:"did:ethr:i3m"},addresses:{type:"array",items:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},example:["0x8646cAcF516de1292be1D30AB68E7Ea51e9B1BE7"]}},required:["did"]},ApiError:{type:"object",title:"Error",required:["code","message"],properties:{code:{type:"integer",format:"int32"},message:{type:"string"}}},JwkPair:{type:"object",properties:{privateJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents a private key (complementary to `publicJwk`)\n",example:'{"alg":"ES256","crv":"P-256","d":"rQp_3eZzvXwt1sK7WWsRhVYipqNGblzYDKKaYirlqs0","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'},publicJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents the public key (complementary to `privateJwk`).\n",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'}},required:["privateJwk","publicJwk"]},CompactJWS:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"},DataExchangeAgreement:{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},DataSharingAgreement:{type:"object",required:["dataOfferingDescription","parties","purpose","duration","intendedUse","licenseGrant","dataStream","personalData","pricingModel","dataExchangeAgreement","signatures"],properties:{dataOfferingDescription:{type:"object",required:["dataOfferingId","version","active"],properties:{dataOfferingId:{type:"string"},version:{type:"integer"},category:{type:"string"},active:{type:"boolean"},title:{type:"string"}}},parties:{type:"object",required:["providerDid","consumerDid"],properties:{providerDid:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},consumerDid:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}}},purpose:{type:"string"},duration:{type:"object",required:["creationDate","startDate","endDate"],properties:{creationDate:{type:"integer"},startDate:{type:"integer"},endDate:{type:"integer"}}},intendedUse:{type:"object",required:["processData","shareDataWithThirdParty","editData"],properties:{processData:{type:"boolean"},shareDataWithThirdParty:{type:"boolean"},editData:{type:"boolean"}}},licenseGrant:{type:"object",required:["transferable","exclusiveness","paidUp","revocable","processing","modifying","analyzing","storingData","storingCopy","reproducing","distributing","loaning","selling","renting","furtherLicensing","leasing"],properties:{transferable:{type:"boolean"},exclusiveness:{type:"boolean"},paidUp:{type:"boolean"},revocable:{type:"boolean"},processing:{type:"boolean"},modifying:{type:"boolean"},analyzing:{type:"boolean"},storingData:{type:"boolean"},storingCopy:{type:"boolean"},reproducing:{type:"boolean"},distributing:{type:"boolean"},loaning:{type:"boolean"},selling:{type:"boolean"},renting:{type:"boolean"},furtherLicensing:{type:"boolean"},leasing:{type:"boolean"}}},dataStream:{type:"boolean"},personalData:{type:"boolean"},pricingModel:{type:"object",required:["basicPrice","currency","hasFreePrice"],properties:{paymentType:{type:"string"},pricingModelName:{type:"string"},basicPrice:{type:"number",format:"float"},currency:{type:"string"},fee:{type:"number",format:"float"},hasPaymentOnSubscription:{type:"object",properties:{paymentOnSubscriptionName:{type:"string"},paymentType:{type:"string"},timeDuration:{type:"string"},description:{type:"string"},repeat:{type:"string"},hasSubscriptionPrice:{type:"number"}}},hasFreePrice:{type:"object",properties:{hasPriceFree:{type:"boolean"}}}}},dataExchangeAgreement:{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},signatures:{type:"object",required:["providerSignature","consumerSignature"],properties:{providerSignature:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"},consumerSignature:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"}}}}},DataExchange:{allOf:[{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},{type:"object",properties:{cipherblockDgst:{type:"string",description:"hash of the cipherblock in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"},blockCommitment:{type:"string",description:"hash of the plaintext block in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"},secretCommitment:{type:"string",description:"ash of the secret that can be used to decrypt the block in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"}},required:["cipherblockDgst","blockCommitment","secretCommitment"]}]}}},he={id:"https://spec.openapis.org/oas/3.0/schema/2021-09-28",$schema:"http://json-schema.org/draft-04/schema#",description:"The description of OpenAPI v3.0.x documents, as defined by https://spec.openapis.org/oas/v3.0.3",type:"object",required:["openapi","info","paths"],properties:{openapi:{type:"string",pattern:"^3\\.0\\.\\d(-.+)?$"},info:{$ref:"#/definitions/Info"},externalDocs:{$ref:"#/definitions/ExternalDocumentation"},servers:{type:"array",items:{$ref:"#/definitions/Server"}},security:{type:"array",items:{$ref:"#/definitions/SecurityRequirement"}},tags:{type:"array",items:{$ref:"#/definitions/Tag"},uniqueItems:!0},paths:{$ref:"#/definitions/Paths"},components:{$ref:"#/definitions/Components"}},patternProperties:{"^x-":{}},additionalProperties:!1,definitions:{Reference:{type:"object",required:["$ref"],patternProperties:{"^\\$ref$":{type:"string",format:"uri-reference"}}},Info:{type:"object",required:["title","version"],properties:{title:{type:"string"},description:{type:"string"},termsOfService:{type:"string",format:"uri-reference"},contact:{$ref:"#/definitions/Contact"},license:{$ref:"#/definitions/License"},version:{type:"string"}},patternProperties:{"^x-":{}},additionalProperties:!1},Contact:{type:"object",properties:{name:{type:"string"},url:{type:"string",format:"uri-reference"},email:{type:"string",format:"email"}},patternProperties:{"^x-":{}},additionalProperties:!1},License:{type:"object",required:["name"],properties:{name:{type:"string"},url:{type:"string",format:"uri-reference"}},patternProperties:{"^x-":{}},additionalProperties:!1},Server:{type:"object",required:["url"],properties:{url:{type:"string"},description:{type:"string"},variables:{type:"object",additionalProperties:{$ref:"#/definitions/ServerVariable"}}},patternProperties:{"^x-":{}},additionalProperties:!1},ServerVariable:{type:"object",required:["default"],properties:{enum:{type:"array",items:{type:"string"}},default:{type:"string"},description:{type:"string"}},patternProperties:{"^x-":{}},additionalProperties:!1},Components:{type:"object",properties:{schemas:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]}}},responses:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/Response"}]}}},parameters:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/Parameter"}]}}},examples:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/Example"}]}}},requestBodies:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/RequestBody"}]}}},headers:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/Header"}]}}},securitySchemes:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/SecurityScheme"}]}}},links:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/Link"}]}}},callbacks:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/Callback"}]}}}},patternProperties:{"^x-":{}},additionalProperties:!1},Schema:{type:"object",properties:{title:{type:"string"},multipleOf:{type:"number",minimum:0,exclusiveMinimum:!0},maximum:{type:"number"},exclusiveMaximum:{type:"boolean",default:!1},minimum:{type:"number"},exclusiveMinimum:{type:"boolean",default:!1},maxLength:{type:"integer",minimum:0},minLength:{type:"integer",minimum:0,default:0},pattern:{type:"string",format:"regex"},maxItems:{type:"integer",minimum:0},minItems:{type:"integer",minimum:0,default:0},uniqueItems:{type:"boolean",default:!1},maxProperties:{type:"integer",minimum:0},minProperties:{type:"integer",minimum:0,default:0},required:{type:"array",items:{type:"string"},minItems:1,uniqueItems:!0},enum:{type:"array",items:{},minItems:1,uniqueItems:!1},type:{type:"string",enum:["array","boolean","integer","number","object","string"]},not:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]},allOf:{type:"array",items:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]}},oneOf:{type:"array",items:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]}},anyOf:{type:"array",items:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]}},items:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]},properties:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]}},additionalProperties:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"},{type:"boolean"}],default:!0},description:{type:"string"},format:{type:"string"},default:{},nullable:{type:"boolean",default:!1},discriminator:{$ref:"#/definitions/Discriminator"},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},example:{},externalDocs:{$ref:"#/definitions/ExternalDocumentation"},deprecated:{type:"boolean",default:!1},xml:{$ref:"#/definitions/XML"}},patternProperties:{"^x-":{}},additionalProperties:!1},Discriminator:{type:"object",required:["propertyName"],properties:{propertyName:{type:"string"},mapping:{type:"object",additionalProperties:{type:"string"}}}},XML:{type:"object",properties:{name:{type:"string"},namespace:{type:"string",format:"uri"},prefix:{type:"string"},attribute:{type:"boolean",default:!1},wrapped:{type:"boolean",default:!1}},patternProperties:{"^x-":{}},additionalProperties:!1},Response:{type:"object",required:["description"],properties:{description:{type:"string"},headers:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Header"},{$ref:"#/definitions/Reference"}]}},content:{type:"object",additionalProperties:{$ref:"#/definitions/MediaType"}},links:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Link"},{$ref:"#/definitions/Reference"}]}}},patternProperties:{"^x-":{}},additionalProperties:!1},MediaType:{type:"object",properties:{schema:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]},example:{},examples:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Example"},{$ref:"#/definitions/Reference"}]}},encoding:{type:"object",additionalProperties:{$ref:"#/definitions/Encoding"}}},patternProperties:{"^x-":{}},additionalProperties:!1,allOf:[{$ref:"#/definitions/ExampleXORExamples"}]},Example:{type:"object",properties:{summary:{type:"string"},description:{type:"string"},value:{},externalValue:{type:"string",format:"uri-reference"}},patternProperties:{"^x-":{}},additionalProperties:!1},Header:{type:"object",properties:{description:{type:"string"},required:{type:"boolean",default:!1},deprecated:{type:"boolean",default:!1},allowEmptyValue:{type:"boolean",default:!1},style:{type:"string",enum:["simple"],default:"simple"},explode:{type:"boolean"},allowReserved:{type:"boolean",default:!1},schema:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]},content:{type:"object",additionalProperties:{$ref:"#/definitions/MediaType"},minProperties:1,maxProperties:1},example:{},examples:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Example"},{$ref:"#/definitions/Reference"}]}}},patternProperties:{"^x-":{}},additionalProperties:!1,allOf:[{$ref:"#/definitions/ExampleXORExamples"},{$ref:"#/definitions/SchemaXORContent"}]},Paths:{type:"object",patternProperties:{"^\\/":{$ref:"#/definitions/PathItem"},"^x-":{}},additionalProperties:!1},PathItem:{type:"object",properties:{$ref:{type:"string"},summary:{type:"string"},description:{type:"string"},servers:{type:"array",items:{$ref:"#/definitions/Server"}},parameters:{type:"array",items:{oneOf:[{$ref:"#/definitions/Parameter"},{$ref:"#/definitions/Reference"}]},uniqueItems:!0}},patternProperties:{"^(get|put|post|delete|options|head|patch|trace)$":{$ref:"#/definitions/Operation"},"^x-":{}},additionalProperties:!1},Operation:{type:"object",required:["responses"],properties:{tags:{type:"array",items:{type:"string"}},summary:{type:"string"},description:{type:"string"},externalDocs:{$ref:"#/definitions/ExternalDocumentation"},operationId:{type:"string"},parameters:{type:"array",items:{oneOf:[{$ref:"#/definitions/Parameter"},{$ref:"#/definitions/Reference"}]},uniqueItems:!0},requestBody:{oneOf:[{$ref:"#/definitions/RequestBody"},{$ref:"#/definitions/Reference"}]},responses:{$ref:"#/definitions/Responses"},callbacks:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Callback"},{$ref:"#/definitions/Reference"}]}},deprecated:{type:"boolean",default:!1},security:{type:"array",items:{$ref:"#/definitions/SecurityRequirement"}},servers:{type:"array",items:{$ref:"#/definitions/Server"}}},patternProperties:{"^x-":{}},additionalProperties:!1},Responses:{type:"object",properties:{default:{oneOf:[{$ref:"#/definitions/Response"},{$ref:"#/definitions/Reference"}]}},patternProperties:{"^[1-5](?:\\d{2}|XX)$":{oneOf:[{$ref:"#/definitions/Response"},{$ref:"#/definitions/Reference"}]},"^x-":{}},minProperties:1,additionalProperties:!1},SecurityRequirement:{type:"object",additionalProperties:{type:"array",items:{type:"string"}}},Tag:{type:"object",required:["name"],properties:{name:{type:"string"},description:{type:"string"},externalDocs:{$ref:"#/definitions/ExternalDocumentation"}},patternProperties:{"^x-":{}},additionalProperties:!1},ExternalDocumentation:{type:"object",required:["url"],properties:{description:{type:"string"},url:{type:"string",format:"uri-reference"}},patternProperties:{"^x-":{}},additionalProperties:!1},ExampleXORExamples:{description:"Example and examples are mutually exclusive",not:{required:["example","examples"]}},SchemaXORContent:{description:"Schema and content are mutually exclusive, at least one is required",not:{required:["schema","content"]},oneOf:[{required:["schema"]},{required:["content"],description:"Some properties are not allowed if content is present",allOf:[{not:{required:["style"]}},{not:{required:["explode"]}},{not:{required:["allowReserved"]}},{not:{required:["example"]}},{not:{required:["examples"]}}]}]},Parameter:{type:"object",properties:{name:{type:"string"},in:{type:"string"},description:{type:"string"},required:{type:"boolean",default:!1},deprecated:{type:"boolean",default:!1},allowEmptyValue:{type:"boolean",default:!1},style:{type:"string"},explode:{type:"boolean"},allowReserved:{type:"boolean",default:!1},schema:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]},content:{type:"object",additionalProperties:{$ref:"#/definitions/MediaType"},minProperties:1,maxProperties:1},example:{},examples:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Example"},{$ref:"#/definitions/Reference"}]}}},patternProperties:{"^x-":{}},additionalProperties:!1,required:["name","in"],allOf:[{$ref:"#/definitions/ExampleXORExamples"},{$ref:"#/definitions/SchemaXORContent"},{$ref:"#/definitions/ParameterLocation"}]},ParameterLocation:{description:"Parameter location",oneOf:[{description:"Parameter in path",required:["required"],properties:{in:{enum:["path"]},style:{enum:["matrix","label","simple"],default:"simple"},required:{enum:[!0]}}},{description:"Parameter in query",properties:{in:{enum:["query"]},style:{enum:["form","spaceDelimited","pipeDelimited","deepObject"],default:"form"}}},{description:"Parameter in header",properties:{in:{enum:["header"]},style:{enum:["simple"],default:"simple"}}},{description:"Parameter in cookie",properties:{in:{enum:["cookie"]},style:{enum:["form"],default:"form"}}}]},RequestBody:{type:"object",required:["content"],properties:{description:{type:"string"},content:{type:"object",additionalProperties:{$ref:"#/definitions/MediaType"}},required:{type:"boolean",default:!1}},patternProperties:{"^x-":{}},additionalProperties:!1},SecurityScheme:{oneOf:[{$ref:"#/definitions/APIKeySecurityScheme"},{$ref:"#/definitions/HTTPSecurityScheme"},{$ref:"#/definitions/OAuth2SecurityScheme"},{$ref:"#/definitions/OpenIdConnectSecurityScheme"}]},APIKeySecurityScheme:{type:"object",required:["type","name","in"],properties:{type:{type:"string",enum:["apiKey"]},name:{type:"string"},in:{type:"string",enum:["header","query","cookie"]},description:{type:"string"}},patternProperties:{"^x-":{}},additionalProperties:!1},HTTPSecurityScheme:{type:"object",required:["scheme","type"],properties:{scheme:{type:"string"},bearerFormat:{type:"string"},description:{type:"string"},type:{type:"string",enum:["http"]}},patternProperties:{"^x-":{}},additionalProperties:!1,oneOf:[{description:"Bearer",properties:{scheme:{type:"string",pattern:"^[Bb][Ee][Aa][Rr][Ee][Rr]$"}}},{description:"Non Bearer",not:{required:["bearerFormat"]},properties:{scheme:{not:{type:"string",pattern:"^[Bb][Ee][Aa][Rr][Ee][Rr]$"}}}}]},OAuth2SecurityScheme:{type:"object",required:["type","flows"],properties:{type:{type:"string",enum:["oauth2"]},flows:{$ref:"#/definitions/OAuthFlows"},description:{type:"string"}},patternProperties:{"^x-":{}},additionalProperties:!1},OpenIdConnectSecurityScheme:{type:"object",required:["type","openIdConnectUrl"],properties:{type:{type:"string",enum:["openIdConnect"]},openIdConnectUrl:{type:"string",format:"uri-reference"},description:{type:"string"}},patternProperties:{"^x-":{}},additionalProperties:!1},OAuthFlows:{type:"object",properties:{implicit:{$ref:"#/definitions/ImplicitOAuthFlow"},password:{$ref:"#/definitions/PasswordOAuthFlow"},clientCredentials:{$ref:"#/definitions/ClientCredentialsFlow"},authorizationCode:{$ref:"#/definitions/AuthorizationCodeOAuthFlow"}},patternProperties:{"^x-":{}},additionalProperties:!1},ImplicitOAuthFlow:{type:"object",required:["authorizationUrl","scopes"],properties:{authorizationUrl:{type:"string",format:"uri-reference"},refreshUrl:{type:"string",format:"uri-reference"},scopes:{type:"object",additionalProperties:{type:"string"}}},patternProperties:{"^x-":{}},additionalProperties:!1},PasswordOAuthFlow:{type:"object",required:["tokenUrl","scopes"],properties:{tokenUrl:{type:"string",format:"uri-reference"},refreshUrl:{type:"string",format:"uri-reference"},scopes:{type:"object",additionalProperties:{type:"string"}}},patternProperties:{"^x-":{}},additionalProperties:!1},ClientCredentialsFlow:{type:"object",required:["tokenUrl","scopes"],properties:{tokenUrl:{type:"string",format:"uri-reference"},refreshUrl:{type:"string",format:"uri-reference"},scopes:{type:"object",additionalProperties:{type:"string"}}},patternProperties:{"^x-":{}},additionalProperties:!1},AuthorizationCodeOAuthFlow:{type:"object",required:["authorizationUrl","tokenUrl","scopes"],properties:{authorizationUrl:{type:"string",format:"uri-reference"},tokenUrl:{type:"string",format:"uri-reference"},refreshUrl:{type:"string",format:"uri-reference"},scopes:{type:"object",additionalProperties:{type:"string"}}},patternProperties:{"^x-":{}},additionalProperties:!1},Link:{type:"object",properties:{operationId:{type:"string"},operationRef:{type:"string",format:"uri-reference"},parameters:{type:"object",additionalProperties:{}},requestBody:{},description:{type:"string"},server:{$ref:"#/definitions/Server"}},patternProperties:{"^x-":{}},additionalProperties:!1,not:{description:"Operation Id and Operation Ref are mutually exclusive",required:["operationId","operationRef"]}},Callback:{type:"object",additionalProperties:{$ref:"#/definitions/PathItem"},patternProperties:{"^x-":{}}},Encoding:{type:"object",properties:{contentType:{type:"string"},headers:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Header"},{$ref:"#/definitions/Reference"}]}},style:{type:"string",enum:["form","spaceDelimited","pipeDelimited","deepObject"]},explode:{type:"boolean"},allowReserved:{type:"boolean",default:!1}},additionalProperties:!1}}};function be(e){if(new Date(e).getTime()>0)return Number(e);throw new $(new Error("invalid timestamp"),["invalid timestamp"])}async function we(e){const t=[],i=new v({strictSchema:!1,removeAdditional:"all"});i.addMetaSchema(he),S(i);const r=ue.schemas.DataSharingAgreement;try{const a=i.compile(r),n=k.cloneDeep(e);a(e)||null!==a.errors&&void 0!==a.errors&&a.errors.length>0&&a.errors.forEach((e=>{t.push(new $(`[${e.instancePath}] ${e.message??"unknown"}`,["invalid format"]))})),b(n)!==b(e)&&t.push(new $("Additional claims beyond the schema are not supported",["invalid format"]))}catch(e){t.push(new $(e,["invalid format"]))}return t}async function xe(e){const t=[];try{const{id:i,...r}=e;i!==await G(r)&&t.push(new $("Invalid dataExchange id",["cannot verify","invalid format"]));const{blockCommitment:a,secretCommitment:n,cipherblockDgst:o,...s}=r,p=await Pe(s);p.length>0&&p.forEach((e=>{t.push(e)}))}catch(e){t.push(new $("Invalid dataExchange",["cannot verify","invalid format"]))}return t}async function Pe(e){const t=[],i=Object.keys(e);(i.length<10||i.length>11)&&t.push(new $(new Error("Invalid agreeemt: "+JSON.stringify(e,void 0,2)),["invalid format"]));for(const r of i){let i;switch(r){case"orig":case"dest":try{e[r]!==await H(JSON.parse(e[r]),!0)&&t.push(new $(`[dataExchangeAgreeement.${r}] A valid stringified JWK must be provided. For uniqueness, JWK claims must be alphabetically sorted in the stringified JWK. You can use the parseJWK(jwk, true) for that purpose.\n${e[r]}`,["invalid key","invalid format"]))}catch(e){t.push(new $(`[dataExchangeAgreeement.${r}] A valid stringified JWK must be provided. For uniqueness, JWK claims must be alphabetically sorted in the stringified JWK. You can use the parseJWK(jwk, true) for that purpose.`,["invalid key","invalid format"]))}break;case"ledgerContractAddress":case"ledgerSignerAddress":try{i=V(e[r]),e[r]!==i&&t.push(new $(`[dataExchangeAgreeement.${r}] Invalid EIP-55 address ${e[r]}. Did you mean ${i} instead?`,["invalid EIP-55 address","invalid format"]))}catch(i){t.push(new $(`[dataExchangeAgreeement.${r}] Invalid EIP-55 address ${e[r]}.`,["invalid EIP-55 address","invalid format"]))}break;case"pooToPorDelay":case"pooToPopDelay":case"pooToSecretDelay":try{e[r]!==be(e[r])&&t.push(new $(`[dataExchangeAgreeement.${r}] < 0 or not a number`,["invalid timestamp","invalid format"]))}catch(e){t.push(new $(`[dataExchangeAgreeement.${r}] < 0 or not a number`,["invalid timestamp","invalid format"]))}break;case"hashAlg":E.includes(e[r])||t.push(new $(`[dataExchangeAgreeement.${r}Invalid hash algorithm '${e[r]}'. It must be one of: ${E.join(", ")}`,["invalid algorithm"]));break;case"encAlg":D.includes(e[r])||t.push(new $(`[dataExchangeAgreeement.${r}Invalid encryption algorithm '${e[r]}'. It must be one of: ${D.join(", ")}`,["invalid algorithm"]));break;case"signingAlg":j.includes(e[r])||t.push(new $(`[dataExchangeAgreeement.${r}Invalid signing algorithm '${e[r]}'. It must be one of: ${j.join(", ")}`,["invalid algorithm"]));break;case"schema":break;default:t.push(new $(new Error(`Property ${r} not allowed in dataAgreement`),["invalid format"]))}}return t}var Ae=Object.freeze({__proto__:null,NonRepudiationDest:class{constructor(e,t,i){this.initialized=new Promise(((r,a)=>{this.asyncConstructor(e,t,i).then((()=>{r(!0)})).catch((e=>{a(e)}))}))}async asyncConstructor(e,t,i){const r=await Pe(e);if(r.length>0){const e=[];let t=[];throw r.forEach((i=>{e.push(i.message),t=t.concat(i.nrErrors)})),t=[...new Set(t)],new $("Resource has not been validated:\n"+e.join("\n"),t)}this.agreement=e,this.jwkPairDest={privateJwk:t,publicJwk:JSON.parse(e.dest)},this.publicJwkOrig=JSON.parse(e.orig),await _(this.jwkPairDest.publicJwk,this.jwkPairDest.privateJwk),this.dltAgent=i;const a=await this.dltAgent.getContractAddress();if(this.agreement.ledgerContractAddress!==a)throw new Error(`Contract address ${a} does not meet agreed one ${this.agreement.ledgerContractAddress}`);this.block={}}async verifyPoO(t,i,r){await this.initialized;const a=e.encode(await K(i,this.agreement.hashAlg),!0,!1),{payload:n}=await T(t),o={...this.agreement,cipherblockDgst:a,blockCommitment:n.exchange.blockCommitment,secretCommitment:n.exchange.secretCommitment},s={proofType:"PoO",iss:"orig",exchange:{...o,id:await G(o)}},p={timestamp:Date.now(),notBefore:"iat",notAfter:"iat",...r},d=await X(t,s,p);return this.block={jwe:i,poo:{jws:t,payload:d.payload}},this.exchange=d.payload.exchange,d}async generatePoR(){if(await this.initialized,void 0===this.exchange||void 0===this.block.poo)throw new Error("Before computing a PoR, you have first to receive a valid cipherblock with a PoO and validate the PoO");const e={proofType:"PoR",iss:"dest",exchange:this.exchange,poo:this.block.poo.jws};return this.block.por=await Z(e,this.jwkPairDest.privateJwk),this.block.por}async verifyPoP(t,i){if(await this.initialized,void 0===this.exchange||void 0===this.block.por||void 0===this.block.poo)throw new Error("Cannot verify a PoP if not even a PoR have been created");const r={proofType:"PoP",iss:"orig",exchange:this.exchange,por:this.block.por.jws,secret:"",verificationCode:""},n={timestamp:Date.now(),notBefore:"iat",notAfter:1e3*this.block.poo.payload.iat+this.exchange.pooToPopDelay,...i},o=await X(t,r,n),s=JSON.parse(o.payload.secret);return this.block.secret={hex:a(e.decode(s.k)),jwk:s},this.block.pop={jws:t,payload:o.payload},o}async getSecretFromLedger(){if(await this.initialized,void 0===this.exchange||void 0===this.block.poo||void 0===this.block.por)throw new Error("Cannot get secret if a PoR has not been sent before");const e=Date.now(),t=1e3*this.block.poo.payload.iat+this.agreement.pooToSecretDelay,i=Math.round((t-e)/1e3),{hex:r,iat:a}=await this.dltAgent.getSecretFromLedger(F(this.agreement.encAlg),this.agreement.ledgerSignerAddress,this.exchange.id,i);this.block.secret=await z(this.exchange.encAlg,r);try{M(1e3*a,1e3*this.block.por.payload.iat,1e3*this.block.poo.payload.iat+this.exchange.pooToSecretDelay)}catch(e){throw new $(`Although the secret has been obtained (and you could try to decrypt the cipherblock), it's been published later than agreed: ${new Date(1e3*a).toUTCString()} > ${new Date(1e3*this.block.poo.payload.iat+this.agreement.pooToSecretDelay).toUTCString()}`,["secret not published in time"])}return this.block.secret}async decrypt(){if(await this.initialized,void 0===this.exchange)throw new Error("No agreed exchange");if(void 0===this.block.secret?.jwk)throw new Error("Cannot decrypt without the secret");if(void 0===this.block.jwe)throw new Error("No cipherblock to decrypt");const t=(await I(this.block.jwe,this.block.secret.jwk)).plaintext;if(e.encode(await K(t,this.agreement.hashAlg),!0,!1)!==this.exchange.blockCommitment)throw new Error("Decrypted block does not meet the committed one");return this.block.raw=t,t}async generateVerificationRequest(){if(await this.initialized,void 0===this.block.por||void 0===this.exchange)throw new Error("Before generating a VerificationRequest, you have first to hold a valid PoR for the exchange");return await ee("dest",this.exchange.id,this.block.por.jws,this.jwkPairDest.privateJwk)}async generateDisputeRequest(){if(await this.initialized,void 0===this.block.por||void 0===this.block.jwe||void 0===this.exchange)throw new Error("Before generating a VerificationRequest, you have first to hold a valid PoR for the exchange and have received the cipherblock");const e={proofType:"request",iss:"dest",por:this.block.por.jws,type:"disputeRequest",cipherblock:this.block.jwe,iat:Math.floor(Date.now()/1e3),dataExchangeId:this.exchange.id},t=await O(this.jwkPairDest.privateJwk);try{return await new h(e).setProtectedHeader({alg:this.jwkPairDest.privateJwk.alg}).setIssuedAt(e.iat).sign(t)}catch(e){throw new $(e,["unexpected error"])}}},NonRepudiationOrig:class{constructor(e,t,i,r){this.jwkPairOrig={privateJwk:t,publicJwk:JSON.parse(e.orig)},this.publicJwkDest=JSON.parse(e.dest),this.block={raw:i},this.initialized=new Promise(((t,i)=>{this.init(e,r).then((()=>{t(!0)})).catch((e=>{i(e)}))}))}async init(t,r){const a=await Pe(t);if(a.length>0){const e=[];let t=[];throw a.forEach((i=>{e.push(i.message),t=t.concat(i.nrErrors)})),t=[...new Set(t)],new $("Resource has not been validated:\n"+e.join("\n"),t)}this.agreement=t,await _(this.jwkPairOrig.publicJwk,this.jwkPairOrig.privateJwk);const n=await z(this.agreement.encAlg);this.block={...this.block,secret:n,jwe:await J(this.block.raw,n.jwk,this.agreement.encAlg)};const o=e.encode(await K(this.block.jwe,this.agreement.hashAlg),!0,!1),s=e.encode(await K(this.block.raw,this.agreement.hashAlg),!0,!1),p=e.encode(await K(new Uint8Array(i(this.block.secret.hex)),this.agreement.hashAlg),!0,!1),d={...this.agreement,cipherblockDgst:o,blockCommitment:s,secretCommitment:p},c=await G(d);this.exchange={...d,id:c},await this._dltSetup(r)}async _dltSetup(e){this.dltAgent=e;const t=await this.dltAgent.getAddress();if(t!==this.exchange.ledgerSignerAddress)throw new Error(`ledgerSignerAddress: ${this.exchange.ledgerSignerAddress} does not meet the address ${t} derived from the provided private key`);const i=await this.dltAgent.getContractAddress();if(i!==N(this.agreement.ledgerContractAddress,!0))throw new Error(`Contract address in use ${i} does not meet the agreed one ${this.agreement.ledgerContractAddress}`)}async generatePoO(){return await this.initialized,this.block.poo=await Z({proofType:"PoO",iss:"orig",exchange:this.exchange},this.jwkPairOrig.privateJwk),this.block.poo}async verifyPoR(e,t){if(await this.initialized,void 0===this.block.poo)throw new Error("Cannot verify a PoR if not even a PoO have been created");const i={proofType:"PoR",iss:"dest",exchange:this.exchange,poo:this.block.poo.jws},r=1e3*this.block.poo.payload.iat,a={timestamp:Date.now(),notBefore:r,notAfter:r+this.exchange.pooToPorDelay,...t},n=await X(e,i,a);return this.block.por={jws:e,payload:n.payload},this.block.por}async generatePoP(){if(await this.initialized,void 0===this.block.por)throw new Error("Before computing a PoP, you have first to have received and verified the PoR");const e=await this.dltAgent.deploySecret(this.block.secret.hex,this.exchange.id),t={proofType:"PoP",iss:"orig",exchange:this.exchange,por:this.block.por.jws,secret:JSON.stringify(this.block.secret.jwk),verificationCode:e};return this.block.pop=await Z(t,this.jwkPairOrig.privateJwk),this.block.pop}async generateVerificationRequest(){if(await this.initialized,void 0===this.block.por)throw new Error("Before generating a VerificationRequest, you have first to hold a valid PoR for the exchange");return await ee("orig",this.exchange.id,this.block.por.jws,this.jwkPairOrig.privateJwk)}}});export{te as ConflictResolution,D as ENC_ALGS,se as EthersIoAgentDest,fe as EthersIoAgentOrig,E as HASH_ALGS,le as I3mServerWalletAgentDest,me as I3mServerWalletAgentOrig,de as I3mWalletAgentDest,ye as I3mWalletAgentOrig,C as KEY_AGREEMENT_ALGS,Ae as NonRepudiationProtocol,$ as NrError,j as SIGNING_ALGS,ge as Signers,M as checkTimestamp,Z as createProof,ie as defaultDltConfig,G as exchangeId,R as generateKeys,B as getDltAddress,O as importJwk,W as jsonSort,I as jweDecrypt,J as jweEncrypt,T as jwsDecode,z as oneTimeSecret,V as parseAddress,N as parseHex,H as parseJwk,K as sha,xe as validateDataExchange,Pe as validateDataExchangeAgreement,we as validateDataSharingAgreementSchema,_ as verifyKeyPair,X as verifyProof}; -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXgubm9kZS5lc20uanMiLCJzb3VyY2VzIjpbIi4uL3NyYy90cy9jb25zdGFudHMudHMiLCIuLi9zcmMvdHMvZXJyb3JzL05yRXJyb3IudHMiLCIuLi9zcmMvdHMvY3J5cHRvL2dlbmVyYXRlS2V5cy50cyIsIi4uL3NyYy90cy9jcnlwdG8vaW1wb3J0SndrLnRzIiwiLi4vc3JjL3RzL2NyeXB0by9qd2UudHMiLCIuLi9zcmMvdHMvY3J5cHRvL2p3c0RlY29kZS50cyIsIi4uL3NyYy90cy91dGlscy9hbGdCeXRlTGVuZ3RoLnRzIiwiLi4vc3JjL3RzL2NyeXB0by9vbmVUaW1lU2VjcmV0LnRzIiwiLi4vc3JjL3RzL2NyeXB0by92ZXJpZnlLZXlQYWlyLnRzIiwiLi4vc3JjL3RzL3V0aWxzL3RpbWVzdGFtcHMudHMiLCIuLi9zcmMvdHMvdXRpbHMvanNvblNvcnQudHMiLCIuLi9zcmMvdHMvdXRpbHMvcGFyc2VIZXgudHMiLCIuLi9zcmMvdHMvdXRpbHMvcGFyc2VKd2sudHMiLCIuLi9zcmMvdHMvdXRpbHMvc2hhLnRzIiwiLi4vc3JjL3RzL3V0aWxzL3BhcnNlQWRkcmVzcy50cyIsIi4uL3NyYy90cy91dGlscy9nZXREbHRBZGRyZXNzLnRzIiwiLi4vc3JjL3RzL2V4Y2hhbmdlL2V4Y2hhbmdlSWQudHMiLCIuLi9zcmMvdHMvcHJvb2ZzL2NyZWF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QUdieEUsS0FBS3NELE1BQU02SCxHQUNuQixDQVFEM0ssb0JBR0UsU0FGTVIsS0FBS3FOLGlCQUVZbE0sSUFBbkJuQixLQUFLc0QsTUFBTTZILElBQ2IsTUFBTSxJQUFJeEwsTUFBTSxnRkFHbEIsTUFBTTBWLFFBQXlCclYsS0FBS29OLFNBQVM2SSxhQUFhalcsS0FBS3NELE1BQU04QixPQUFPTyxJQUFLM0YsS0FBSzJKLFNBQVM2QixJQUV6RmhILEVBQW1DLENBQ3ZDd0gsVUFBVyxNQUNYbEMsSUFBSyxPQUNMSCxTQUFVM0osS0FBSzJKLFNBQ2Z3QixJQUFLbkwsS0FBS3NELE1BQU02SCxJQUFJOUcsSUFDcEJlLE9BQVFYLEtBQUt1RCxVQUFVaEksS0FBS3NELE1BQU04QixPQUFPckMsS0FDekNzUyxvQkFHRixPQURBclYsS0FBS3NELE1BQU04UixVQUFZdkwsRUFBWXJGLEVBQVN4RSxLQUFLNlYsWUFBWXZULFlBQ3REdEMsS0FBS3NELE1BQU04UixHQUNuQixDQVFENVUsb0NBR0UsU0FGTVIsS0FBS3FOLGlCQUVZbE0sSUFBbkJuQixLQUFLc0QsTUFBTTZILElBQ2IsTUFBTSxJQUFJeEwsTUFBTSxnR0FHbEIsYUFBYW9OLEdBQTRCLE9BQVEvTSxLQUFLMkosU0FBUzZCLEdBQUl4TCxLQUFLc0QsTUFBTTZILElBQUk5RyxJQUFLckUsS0FBSzZWLFlBQVl2VCxXQUN6RyJ9 +import*as e from"@juanelas/base64";import{decode as t}from"@juanelas/base64";import{hexToBuf as i,parseHex as r,bufToHex as a}from"bigint-conversion";import{randBytes as n,randBytesSync as o}from"bigint-crypto-utils";import s from"elliptic";import{importJWK as p,CompactEncrypt as d,decodeProtectedHeader as c,compactDecrypt as l,jwtVerify as f,generateSecret as y,exportJWK as m,GeneralSign as g,generalVerify as u,SignJWT as h}from"jose";import{hashable as b}from"object-sha";import{webcrypto as w}from"crypto";import{ethers as x,Wallet as P}from"ethers";import{SigningKey as A}from"ethers/lib/utils";import v from"ajv-draft-04";import S from"ajv-formats";import k from"lodash";const E=["SHA-256","SHA-384","SHA-512"],j=["ES256","ES384","ES512"],D=["A128GCM","A256GCM"],C=["ECDH-ES"];class $ extends Error{constructor(e,t){super(e),e instanceof $?(this.nrErrors=e.nrErrors,this.add(...t)):this.nrErrors=t}add(...e){const t=this.nrErrors.concat(e);this.nrErrors=[...new Set(t)]}}const{ec:q}=s;async function R(t,r,a){if(!j.includes(t))throw new $(new RangeError(`Invalid signature algorithm '${t}''. Allowed algorithms are ${j.toString()}`),["invalid algorithm"]);let o,s,p;switch(t){case"ES512":s="P-521",o=66;break;case"ES384":s="P-384",o=48;break;default:s="P-256",o=32}p=void 0!==r?"string"==typeof r?!0===a?e.decode(r):new Uint8Array(i(r)):r:new Uint8Array(await n(o));const d=new q("p"+s.substring(s.length-3)).keyFromPrivate(p),c=d.getPublic(),l=c.getX().toString("hex").padStart(2*o,"0"),f=c.getY().toString("hex").padStart(2*o,"0"),y=d.getPrivate("hex").padStart(2*o,"0"),m={kty:"EC",crv:s,x:e.encode(i(l),!0,!1),y:e.encode(i(f),!0,!1),d:e.encode(i(y),!0,!1),alg:t},g={...m};return delete g.d,{publicJwk:g,privateJwk:m}}async function O(e,t){const i=void 0===t?e.alg:t,r=D.concat(j).concat(C);if(!r.includes(i))throw new $("invalid alg. Must be one of: "+r.join(","),["invalid algorithm"]);try{const i=await p(e,t);if(null==i)throw new $(new Error("failed importing keys"),["invalid key"]);return i}catch(e){throw new $(e,["invalid key"])}}async function J(e,t,i){let r,a;const n={...t};if(D.includes(t.alg))r="dir",a=void 0!==i?i:t.alg;else{if(!j.concat(C).includes(t.alg))throw new $(`Not a valid symmetric or assymetric alg: ${t.alg}`,["encryption failed","invalid key","invalid algorithm"]);if(void 0===i)throw new $("An encryption algorith encAlg for content encryption should be provided. Allowed values are: "+D.join(","),["encryption failed"]);a=i,r="ECDH-ES",n.alg=r}const o=await O(n);let s;try{return s=await new d(e).setProtectedHeader({alg:r,enc:a,kid:t.kid}).encrypt(o),s}catch(e){throw new $(e,["encryption failed"])}}async function I(e,t){try{const i={...t},{alg:r,enc:a}=c(e);if(void 0===r||void 0===a)throw new $("missing enc or alg in jwe header",["invalid format"]);"ECDH-ES"===r&&(i.alg=r);const n=await O(i);return await l(e,n,{contentEncryptionAlgorithms:[a]})}catch(e){throw new $(e,["decryption failed"])}}async function T(t,i){const r=t.match(/^([a-zA-Z0-9_-]+)\.{1,2}([a-zA-Z0-9_-]+)\.([a-zA-Z0-9_-]+)$/);if(null===r)throw new $(new Error(`${t} is not a JWS`),["not a compact jws"]);let a,n;try{a=JSON.parse(e.decode(r[1],!0)),n=JSON.parse(e.decode(r[2],!0))}catch(e){throw new $(e,["invalid format","not a compact jws"])}if(void 0!==i){const e="function"==typeof i?await i(a,n):i,r=await O(e);try{const i=await f(t,r);return{header:i.protectedHeader,payload:i.payload,signer:e}}catch(e){throw new $(e,["jws verification failed"])}}return{header:a,payload:n}}function F(e){if(D.concat(E).concat(j).includes(e))return Number(e.match(/\d{3}/)[0])/8;throw new $("unsupported algorithm",["invalid algorithm"])}async function z(n,o,s){let p;if(!D.includes(n))throw new $(new Error(`Invalid encAlg '${n}'. Supported values are: ${D.toString()}`),["invalid algorithm"]);const d=F(n);if(void 0!==o){if("string"==typeof o)if(!0===s)p=e.decode(o);else{const e=r(o,!1);if(e!==r(o,!1,d))throw new $(new RangeError(`Expected hex length ${2*d} does not meet provided one ${e.length/2}`),["invalid key"]);p=new Uint8Array(i(o))}else p=o;if(p.length!==d)throw new $(new RangeError(`Expected secret length ${d} does not meet provided one ${p.length}`),["invalid key"])}else try{p=await y(n,{extractable:!0})}catch(e){throw new $(e,["unexpected error"])}const c=await m(p);return c.alg=n,{jwk:c,hex:a(t(c.k),!1,d)}}async function _(e,t){if(void 0===e.alg||void 0===t.alg||e.alg!==t.alg)throw new Error("alg no present in either pubJwk or privJwk, or pubJWK.alg != privJWK.alg");const i=await O(e),r=await O(t);try{const e=await n(16),a=await new g(e).addSignature(r).setProtectedHeader({alg:t.alg}).sign();await u(a,i)}catch(e){throw new $(e,["unexpected error"])}}function M(e,t,i,r=2e3){if(ei+r)throw new $(new Error(`timestamp ${new Date(e).toTimeString()} after 'notAfter' ${new Date(i).toTimeString()} with tolerance of ${r/1e3}s`),["invalid timestamp"])}function W(e){return Array.isArray(e)?e.sort().map(W):(t=e,"[object Object]"===Object.prototype.toString.call(t)?Object.keys(e).sort().reduce((function(t,i){return t[i]=W(e[i]),t}),{}):e);var t}function N(e,t=!1,i){try{return r(e,t,i)}catch(e){throw new $(e,["invalid format"])}}async function H(e,t){try{await O(e,e.alg);const i=W(e);return t?JSON.stringify(i):i}catch(e){throw new $(e,["invalid key"])}}async function K(e,t){const i=E;if(!i.includes(t))throw new $(new RangeError(`Valid hash algorith values are any of ${JSON.stringify(i)}`),["invalid algorithm"]);const r=new TextEncoder,a="string"==typeof e?r.encode(e).buffer:e;try{let e;{const i=t.toLowerCase().replace("-","");e=new Uint8Array((await import("crypto")).createHash(i).update(Buffer.from(a)).digest())}return e}catch(e){throw new $(e,["unexpected error"])}}function V(e){if(null==e.match(/^(0x)?([\da-fA-F]{40})$/))throw new RangeError("incorrect address format");try{const t=N(e,!0,20);return x.utils.getAddress(t)}catch(e){throw new $(e,["invalid EIP-55 address"])}}function B(e){const t=e.match(/^did:ethr:(\w+:)?(0x[0-9a-fA-F]{40}[0-9a-fA-F]{26}?)$/),i=null!==t?t[t.length-1]:e;try{return x.utils.computeAddress(i)}catch(e){throw new $("no a DID or a valid public or private key",["invalid format"])}}async function G(t){return e.encode(await K(b(t),"SHA-256"),!0,!1)}async function Z(e,t){if(void 0===e.iss)throw new Error('Payload iss should be set to either "orig" or "dest"');const i=JSON.parse(e.exchange[e.iss]);await _(i,t);const r=await O(t),a=t.alg,n={...e,iat:Math.floor(Date.now()/1e3)};return{jws:await new h(n).setProtectedHeader({alg:a}).setIssuedAt(n.iat).sign(r),payload:n}}async function X(e,t,i){const r=JSON.parse(t.exchange[t.iss]),a=await T(e,r);if(void 0===a.payload.iss)throw new Error('Property "iss" missing');if(void 0===a.payload.iat)throw new Error("Property claim iat missing");if(void 0!==i){M("iat"===i.timestamp?1e3*a.payload.iat:i.timestamp,"iat"===i.notBefore?1e3*a.payload.iat:i.notBefore,"iat"===i.notAfter?1e3*a.payload.iat:i.notAfter,i.tolerance)}const n=a.payload,o=n.exchange[n.iss];if(b(r)!==b(JSON.parse(o)))throw new Error(`The proof is issued by ${o} instead of ${JSON.stringify(r)}`);const s=t;for(const e in s){if(void 0===n[e])throw new Error(`Expected key '${e}' not found in proof`);if("exchange"===e){const e=t.exchange;L(n.exchange,e)}else if(""!==s[e]&&b(s[e])!==b(n[e]))throw new Error(`Proof's ${e}: ${JSON.stringify(n[e],void 0,2)} does not meet provided value ${JSON.stringify(s[e],void 0,2)}`)}return a}function L(e,t){const i=["id","orig","dest","hashAlg","cipherblockDgst","blockCommitment","blockCommitment","secretCommitment","schema"];for(const t of i)if("schema"!==t&&(void 0===e[t]||""===e[t]))throw new Error(`${t} is missing on dataExchange.\ndataExchange: ${JSON.stringify(e,void 0,2)}`);for(const i in t)if(""!==t[i]&&b(t[i])!==b(e[i]))throw new Error(`dataExchange's ${i}: ${JSON.stringify(e[i],void 0,2)} does not meet expected value ${JSON.stringify(t[i],void 0,2)}`)}async function U(e,t,i=10){const{payload:r}=await T(e),a=r.exchange,n={...a};delete n.id;if(await G(n)!==a.id)throw new $(new Error("data exchange integrity failed"),["dataExchange integrity violated"]);const o=JSON.parse(a.dest),s=JSON.parse(a.orig);let p,d,c;try{p=(await X(r.poo,{iss:"orig",proofType:"PoO",exchange:a})).payload}catch(e){throw new $(e,["invalid poo"])}try{await X(e,{iss:"dest",proofType:"PoR",exchange:a},{timestamp:"iat",notBefore:1e3*p.iat,notAfter:1e3*p.iat+a.pooToPorDelay})}catch(e){throw new $(e,["invalid por"])}try{const e=await t.getSecretFromLedger(F(a.encAlg),a.ledgerSignerAddress,a.id,i);d=e.hex,c=e.iat}catch(e){throw new $(e,["cannot verify"])}try{M(1e3*c,1e3*r.iat,1e3*p.iat+a.pooToSecretDelay)}catch(e){throw new $(`Although the secret has been obtained (and you could try to decrypt the cipherblock), it's been published later than agreed: ${new Date(1e3*c).toUTCString()} > ${new Date(1e3*p.iat+a.pooToSecretDelay).toUTCString()}`,["secret not published in time"])}return{pooPayload:p,porPayload:r,secretHex:d,destPublicJwk:o,origPublicJwk:s}}async function Y(e,t,i=10){let r,a,n,o,s;try{r=(await T(e)).payload}catch(e){throw new $(e,["invalid verification request"])}try{const e=await U(r.por,t,i);a=e.destPublicJwk,n=e.origPublicJwk,o=e.pooPayload,s=e.porPayload}catch(e){throw new $(e,["invalid por","invalid verification request"])}try{await T(e,"dest"===r.iss?a:n)}catch(e){throw new $(e,["invalid verification request"])}return{pooPayload:o,porPayload:s,vrPayload:r,destPublicJwk:a,origPublicJwk:n}}async function Q(t,i){const{payload:r}=await T(t),{destPublicJwk:a,origPublicJwk:n,secretHex:o,pooPayload:s,porPayload:p}=await U(r.por,i);try{await T(t,a)}catch(e){throw e instanceof $&&e.add("invalid dispute request"),e}if(e.encode(await K(r.cipherblock,p.exchange.hashAlg),!0,!1)!==p.exchange.cipherblockDgst)throw new $(new Error("cipherblock does not meet the committed (and already accepted) one"),["invalid dispute request"]);return await I(r.cipherblock,(await z(p.exchange.encAlg,o)).jwk),{pooPayload:s,porPayload:p,drPayload:r,destPublicJwk:a,origPublicJwk:n}}async function ee(e,t,i,r){const a={proofType:"request",iss:e,dataExchangeId:t,por:i,type:"verificationRequest",iat:Math.floor(Date.now()/1e3)},n=await p(r);return await new h(a).setProtectedHeader({alg:r.alg}).setIssuedAt(a.iat).sign(n)}var te=Object.freeze({__proto__:null,ConflictResolver:class{constructor(e,t){this.jwkPair=e,this.dltAgent=t,this.initialized=new Promise(((e,t)=>{this.init().then((()=>{e(!0)})).catch((e=>{t(e)}))}))}async init(){await _(this.jwkPair.publicJwk,this.jwkPair.privateJwk)}async resolveCompleteness(e){await this.initialized;const{payload:t}=await T(e);let i;try{i=(await T(t.por)).payload}catch(e){throw new $(e,["invalid por"])}const r={...await this._resolution(t.dataExchangeId,i.exchange[t.iss]),resolution:"not completed",type:"verification"};try{await Y(e,this.dltAgent),r.resolution="completed"}catch(e){if(!(e instanceof $)||e.nrErrors.includes("invalid verification request")||e.nrErrors.includes("unexpected error"))throw e}const a=await p(this.jwkPair.privateJwk);return await new h(r).setProtectedHeader({alg:this.jwkPair.privateJwk.alg}).setIssuedAt(r.iat).sign(a)}async resolveDispute(e){await this.initialized;const{payload:t}=await T(e);let i;try{i=(await T(t.por)).payload}catch(e){throw new $(e,["invalid por"])}const r={...await this._resolution(t.dataExchangeId,i.exchange[t.iss]),resolution:"denied",type:"dispute"};try{await Q(e,this.dltAgent)}catch(e){if(!(e instanceof $&&e.nrErrors.includes("decryption failed")))throw new $(e,["cannot verify"]);r.resolution="accepted"}const a=await p(this.jwkPair.privateJwk);return await new h(r).setProtectedHeader({alg:this.jwkPair.privateJwk.alg}).setIssuedAt(r.iat).sign(a)}async _resolution(e,t){return{proofType:"resolution",dataExchangeId:e,iat:Math.floor(Date.now()/1e3),iss:await H(this.jwkPair.publicJwk,!0),sub:t}}},checkCompleteness:Y,checkDecryption:Q,generateVerificationRequest:ee,verifyPor:U,verifyResolution:async function(e,t){return await T(e,t??((e,t)=>JSON.parse(t.iss)))}});const ie={gasLimit:125e5,contract:{address:"0x8d407A1722633bDD1dcf221474be7a44C05d7c2F",abi:[{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"sender",type:"address"},{indexed:!1,internalType:"uint256",name:"dataExchangeId",type:"uint256"},{indexed:!1,internalType:"uint256",name:"timestamp",type:"uint256"},{indexed:!1,internalType:"uint256",name:"secret",type:"uint256"}],name:"Registration",type:"event"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"uint256",name:"",type:"uint256"}],name:"registry",outputs:[{internalType:"uint256",name:"timestamp",type:"uint256"},{internalType:"uint256",name:"secret",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"_dataExchangeId",type:"uint256"},{internalType:"uint256",name:"_secret",type:"uint256"}],name:"setRegistry",outputs:[],stateMutability:"nonpayable",type:"function"}],transactionHash:"0x6a3828f8fe232819dc40ca66f93930b3bd1619db31a67ec34b44446b3e7c8289",receipt:{to:null,from:"0x17bd12C2134AfC1f6E9302a532eFE30C19B9E903",contractAddress:"0x8d407A1722633bDD1dcf221474be7a44C05d7c2F",transactionIndex:0,gasUsed:"253928",logsBloom:"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",blockHash:"0x0118672bb9b27679e616831d056d36291dd20cfe88c3ee2abd8f2dfce579cad4",transactionHash:"0x6a3828f8fe232819dc40ca66f93930b3bd1619db31a67ec34b44446b3e7c8289",logs:[],blockNumber:119389,cumulativeGasUsed:"253928",status:1,byzantium:!0},args:[],solcInputHash:"c528a37588793ef74285d75e08d6b8eb",metadata:'{"compiler":{"version":"0.8.4+commit.c7e474f2"},"language":"Solidity","output":{"abi":[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"dataExchangeId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"secret","type":"uint256"}],"name":"Registration","type":"event"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"registry","outputs":[{"internalType":"uint256","name":"timestamp","type":"uint256"},{"internalType":"uint256","name":"secret","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_dataExchangeId","type":"uint256"},{"internalType":"uint256","name":"_secret","type":"uint256"}],"name":"setRegistry","outputs":[],"stateMutability":"nonpayable","type":"function"}],"devdoc":{"kind":"dev","methods":{},"version":1},"userdoc":{"kind":"user","methods":{},"version":1}},"settings":{"compilationTarget":{"contracts/NonRepudiation.sol":"NonRepudiation"},"evmVersion":"istanbul","libraries":{},"metadata":{"bytecodeHash":"ipfs","useLiteralContent":true},"optimizer":{"enabled":false,"runs":200},"remappings":[]},"sources":{"contracts/NonRepudiation.sol":{"content":"//SPDX-License-Identifier: Unlicense\\npragma solidity ^0.8.0;\\n\\ncontract NonRepudiation {\\n struct Proof {\\n uint256 timestamp;\\n uint256 secret;\\n }\\n mapping(address => mapping (uint256 => Proof)) public registry;\\n event Registration(address sender, uint256 dataExchangeId, uint256 timestamp, uint256 secret);\\n\\n function setRegistry(uint256 _dataExchangeId, uint256 _secret) public {\\n require(registry[msg.sender][_dataExchangeId].secret == 0);\\n registry[msg.sender][_dataExchangeId] = Proof(block.timestamp, _secret);\\n emit Registration(msg.sender, _dataExchangeId, block.timestamp, _secret);\\n }\\n}\\n","keccak256":"0x8d371257a9b03c9102f158323e61f56ce49dd8489bd92c5a7d8abc3d9f6f8399","license":"Unlicense"}},"version":1}',bytecode:"0x608060405234801561001057600080fd5b506103a2806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c8063032439371461003b578063d05cb54514610057575b600080fd5b6100556004803603810190610050919061023a565b610088565b005b610071600480360381019061006c91906101fe565b6101a3565b60405161007f9291906102d9565b60405180910390f35b60008060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002060010154146100e757600080fd5b6040518060400160405280428152602001828152506000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002060008201518160000155602082015181600101559050507faa58599838af2e5e0f3251cfbb4eac5d5d447ded49f6b0ac28d6b44098224e63338342846040516101979493929190610294565b60405180910390a15050565b6000602052816000526040600020602052806000526040600020600091509150508060000154908060010154905082565b6000813590506101e38161033e565b92915050565b6000813590506101f881610355565b92915050565b6000806040838503121561021157600080fd5b600061021f858286016101d4565b9250506020610230858286016101e9565b9150509250929050565b6000806040838503121561024d57600080fd5b600061025b858286016101e9565b925050602061026c858286016101e9565b9150509250929050565b61027f81610302565b82525050565b61028e81610334565b82525050565b60006080820190506102a96000830187610276565b6102b66020830186610285565b6102c36040830185610285565b6102d06060830184610285565b95945050505050565b60006040820190506102ee6000830185610285565b6102fb6020830184610285565b9392505050565b600061030d82610314565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b61034781610302565b811461035257600080fd5b50565b61035e81610334565b811461036957600080fd5b5056fea26469706673582212204fd0fc653fb487221da9a14a4ca5d5499f9e9bc7b27ac8ab0f8d397fd6e3148564736f6c63430008040033",deployedBytecode:"0x608060405234801561001057600080fd5b50600436106100365760003560e01c8063032439371461003b578063d05cb54514610057575b600080fd5b6100556004803603810190610050919061023a565b610088565b005b610071600480360381019061006c91906101fe565b6101a3565b60405161007f9291906102d9565b60405180910390f35b60008060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002060010154146100e757600080fd5b6040518060400160405280428152602001828152506000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002060008201518160000155602082015181600101559050507faa58599838af2e5e0f3251cfbb4eac5d5d447ded49f6b0ac28d6b44098224e63338342846040516101979493929190610294565b60405180910390a15050565b6000602052816000526040600020602052806000526040600020600091509150508060000154908060010154905082565b6000813590506101e38161033e565b92915050565b6000813590506101f881610355565b92915050565b6000806040838503121561021157600080fd5b600061021f858286016101d4565b9250506020610230858286016101e9565b9150509250929050565b6000806040838503121561024d57600080fd5b600061025b858286016101e9565b925050602061026c858286016101e9565b9150509250929050565b61027f81610302565b82525050565b61028e81610334565b82525050565b60006080820190506102a96000830187610276565b6102b66020830186610285565b6102c36040830185610285565b6102d06060830184610285565b95945050505050565b60006040820190506102ee6000830185610285565b6102fb6020830184610285565b9392505050565b600061030d82610314565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b61034781610302565b811461035257600080fd5b50565b61035e81610334565b811461036957600080fd5b5056fea26469706673582212204fd0fc653fb487221da9a14a4ca5d5499f9e9bc7b27ac8ab0f8d397fd6e3148564736f6c63430008040033",devdoc:{kind:"dev",methods:{},version:1},userdoc:{kind:"user",methods:{},version:1},storageLayout:{storage:[{astId:13,contract:"contracts/NonRepudiation.sol:NonRepudiation",label:"registry",offset:0,slot:"0",type:"t_mapping(t_address,t_mapping(t_uint256,t_struct(Proof)6_storage))"}],types:{t_address:{encoding:"inplace",label:"address",numberOfBytes:"20"},"t_mapping(t_address,t_mapping(t_uint256,t_struct(Proof)6_storage))":{encoding:"mapping",key:"t_address",label:"mapping(address => mapping(uint256 => struct NonRepudiation.Proof))",numberOfBytes:"32",value:"t_mapping(t_uint256,t_struct(Proof)6_storage)"},"t_mapping(t_uint256,t_struct(Proof)6_storage)":{encoding:"mapping",key:"t_uint256",label:"mapping(uint256 => struct NonRepudiation.Proof)",numberOfBytes:"32",value:"t_struct(Proof)6_storage"},"t_struct(Proof)6_storage":{encoding:"inplace",label:"struct NonRepudiation.Proof",members:[{astId:3,contract:"contracts/NonRepudiation.sol:NonRepudiation",label:"timestamp",offset:0,slot:"0",type:"t_uint256"},{astId:5,contract:"contracts/NonRepudiation.sol:NonRepudiation",label:"secret",offset:0,slot:"1",type:"t_uint256"}],numberOfBytes:"64"},t_uint256:{encoding:"inplace",label:"uint256",numberOfBytes:"32"}}}}};async function re(t,i,r,n,o){let s=x.BigNumber.from(0),p=x.BigNumber.from(0);const d=N(a(e.decode(r)),!0);let c=0;do{try{({secret:s,timestamp:p}=await t.registry(N(i,!0),d))}catch(e){throw new $(e,["cannot contact the ledger"])}s.isZero()&&(c++,await new Promise((e=>setTimeout(e,1e3))))}while(s.isZero()&&c{null!==e&&"object"==typeof e&&"function"==typeof e.then?e.then((e=>{this.dltConfig={...ie,...e},this.provider=new x.providers.JsonRpcProvider(this.dltConfig.rpcProviderUrl),this.contract=new x.Contract(this.dltConfig.contract.address,this.dltConfig.contract.abi,this.provider),t(!0)})).catch((e=>i(e))):(this.dltConfig={...ie,...e},this.provider=new x.providers.JsonRpcProvider(this.dltConfig.rpcProviderUrl),this.contract=new x.Contract(this.dltConfig.contract.address,this.dltConfig.contract.abi,this.provider),t(!0))}))}async getContractAddress(){return await this.initialized,this.contract.address}}class se extends oe{async getSecretFromLedger(e,t,i,r){return await this.initialized,await re(this.contract,t,i,r,e)}}class pe extends oe{constructor(e,t,i){super(new Promise(((t,r)=>{e.providerinfo.get().then((e=>{const a=e.rpcUrl;void 0===a?r(new Error("wallet is not connected to RPC endpoint")):t({...i,rpcProviderUrl:"string"==typeof a?a:a[0]})})).catch((e=>{r(e)}))}))),this.wallet=e,this.did=t}}class de extends pe{async getSecretFromLedger(e,t,i,r){return await this.initialized,await re(this.contract,t,i,r,e)}}class ce extends oe{constructor(e,t,i){super(new Promise(((t,r)=>{e.providerinfoGet().then((e=>{const a=e.rpcUrl;void 0===a?r(new Error("wallet is not connected to RPC endpoint")):t({...i,rpcProviderUrl:"string"==typeof a?a:a[0]})})).catch((e=>{r(e)}))}))),this.wallet=e,this.did=t}}class le extends ce{async getSecretFromLedger(e,t,i,r){return await this.initialized,await re(this.contract,t,i,r,e)}}class fe extends oe{constructor(e,t){let r;super(e),this.count=-1,r=void 0===t?o(32):"string"==typeof t?new Uint8Array(i(t)):t;const a=new A(r);this.signer=new P(a,this.provider)}async deploySecret(e,t){await this.initialized;const i=await ae(e,t,this),r=await this.signer.signTransaction(i),a=await this.signer.provider.sendTransaction(r);return this.count=this.count+1,a.hash}async getAddress(){return await this.initialized,this.signer.address}async nextNonce(){await this.initialized;const e=await this.provider.getTransactionCount(await this.getAddress(),"pending");return e>this.count&&(this.count=e),this.count}}class ye extends pe{constructor(){super(...arguments),this.count=-1}async deploySecret(e,t){await this.initialized;const i=await ae(e,t,this),r=(await this.wallet.identities.sign({did:this.did},{type:"Transaction",data:i})).signature,a=await this.provider.sendTransaction(r);return this.count=this.count+1,a.hash}async getAddress(){await this.initialized;const e=await this.wallet.identities.info({did:this.did});if(void 0===e.addresses)throw new $(new Error("no addresses for did "+this.did),["unexpected error"]);return e.addresses[0]}async nextNonce(){await this.initialized;const e=await this.provider.getTransactionCount(await this.getAddress(),"pending");return e>this.count&&(this.count=e),this.count}}class me extends ce{constructor(){super(...arguments),this.count=-1}async deploySecret(e,t){await this.initialized;const i=await ae(e,t,this),r=(await this.wallet.identitySign({did:this.did},{type:"Transaction",data:i})).signature,a=await this.provider.sendTransaction(r);return this.count=this.count+1,a.hash}async getAddress(){await this.initialized;const e=await this.wallet.identityInfo({did:this.did});if(void 0===e.addresses)throw new $(`Can't get address for did: ${this.did}`,["unexpected error"]);return e.addresses[0]}async nextNonce(){await this.initialized;const e=await this.provider.getTransactionCount(await this.getAddress(),"pending");return e>this.count&&(this.count=e),this.count}}var ge=Object.freeze({__proto__:null,EthersIoAgentDest:se,EthersIoAgentOrig:fe,I3mServerWalletAgentDest:le,I3mServerWalletAgentOrig:me,I3mWalletAgentDest:de,I3mWalletAgentOrig:ye}),ue={schemas:{IdentitySelectOutput:{title:"IdentitySelectOutput",type:"object",properties:{did:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},required:["did"]},SignInput:{title:"SignInput",oneOf:[{title:"SignTransaction",type:"object",properties:{type:{enum:["Transaction"]},data:{title:"Transaction",type:"object",additionalProperties:!0,properties:{from:{type:"string"},to:{type:"string"},nonce:{type:"number"}}}},required:["type","data"]},{title:"SignRaw",type:"object",properties:{type:{enum:["Raw"]},data:{type:"object",properties:{payload:{description:"Base64Url encoded data to sign",type:"string",pattern:"^[A-Za-z0-9_-]+$"}},required:["payload"]}},required:["type","data"]},{title:"SignJWT",type:"object",properties:{type:{enum:["JWT"]},data:{type:"object",properties:{header:{description:'header fields to be added to the JWS header. "alg" and "kid" will be ignored since they are automatically added by the wallet.',type:"object",additionalProperties:!0},payload:{description:"A JSON object to be signed by the wallet. It will become the payload of the generated JWS. 'iss' (issuer) and 'iat' (issued at) will be automatically added by the wallet and will override provided values.",type:"object",additionalProperties:!0}},required:["payload"]}},required:["type","data"]}]},SignRaw:{title:"SignRaw",type:"object",properties:{type:{enum:["Raw"]},data:{type:"object",properties:{payload:{description:"Base64Url encoded data to sign",type:"string",pattern:"^[A-Za-z0-9_-]+$"}},required:["payload"]}},required:["type","data"]},SignTransaction:{title:"SignTransaction",type:"object",properties:{type:{enum:["Transaction"]},data:{title:"Transaction",type:"object",additionalProperties:!0,properties:{from:{type:"string"},to:{type:"string"},nonce:{type:"number"}}}},required:["type","data"]},SignJWT:{title:"SignJWT",type:"object",properties:{type:{enum:["JWT"]},data:{type:"object",properties:{header:{description:'header fields to be added to the JWS header. "alg" and "kid" will be ignored since they are automatically added by the wallet.',type:"object",additionalProperties:!0},payload:{description:"A JSON object to be signed by the wallet. It will become the payload of the generated JWS. 'iss' (issuer) and 'iat' (issued at) will be automatically added by the wallet and will override provided values.",type:"object",additionalProperties:!0}},required:["payload"]}},required:["type","data"]},Transaction:{title:"Transaction",type:"object",additionalProperties:!0,properties:{from:{type:"string"},to:{type:"string"},nonce:{type:"number"}}},SignOutput:{title:"SignOutput",type:"object",properties:{signature:{type:"string"}},required:["signature"]},Receipt:{title:"Receipt",type:"object",properties:{receipt:{type:"string"}},required:["receipt"]},SignTypes:{title:"SignTypes",type:"string",enum:["Transaction","Raw","JWT"]},IdentityListInput:{title:"IdentityListInput",description:"A list of DIDs",type:"array",items:{type:"object",properties:{did:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},required:["did"]}},IdentityCreateInput:{title:"IdentityCreateInput",description:'Besides the here defined options, provider specific properties should be added here if necessary, e.g. "path" for BIP21 wallets, or the key algorithm (if the wallet supports multiple algorithm).\n',type:"object",properties:{alias:{type:"string"}},additionalProperties:!0},IdentityCreateOutput:{title:"IdentityCreateOutput",description:"It returns the account id and type\n",type:"object",properties:{did:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},additionalProperties:!0,required:["did"]},ResourceListOutput:{title:"ResourceListOutput",description:"A list of resources",type:"array",items:{title:"Resource",anyOf:[{title:"VerifiableCredential",type:"object",properties:{type:{example:"VerifiableCredential",enum:["VerifiableCredential"]},name:{type:"string",example:"Resource name"},resource:{type:"object",properties:{"@context":{type:"array",items:{type:"string"},example:["https://www.w3.org/2018/credentials/v1"]},id:{type:"string",example:"http://example.edu/credentials/1872"},type:{type:"array",items:{type:"string"},example:["VerifiableCredential"]},issuer:{type:"object",properties:{id:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},additionalProperties:!0,required:["id"]},issuanceDate:{type:"string",format:"date-time",example:"2021-06-10T19:07:28.000Z"},credentialSubject:{type:"object",properties:{id:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},required:["id"],additionalProperties:!0},proof:{type:"object",properties:{type:{type:"string",enum:["JwtProof2020"]}},required:["type"],additionalProperties:!0}},additionalProperties:!0,required:["@context","type","issuer","issuanceDate","credentialSubject","proof"]}},required:["type","resource"]},{title:"ObjectResource",type:"object",properties:{type:{example:"Object",enum:["Object"]},name:{type:"string",example:"Resource name"},parentResource:{type:"string"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",additionalProperties:!0}},required:["type","resource"]},{title:"JWK pair",type:"object",properties:{type:{example:"KeyPair",enum:["KeyPair"]},name:{type:"string",example:"Resource name"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",properties:{keyPair:{type:"object",properties:{privateJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents a private key (complementary to `publicJwk`)\n",example:'{"alg":"ES256","crv":"P-256","d":"rQp_3eZzvXwt1sK7WWsRhVYipqNGblzYDKKaYirlqs0","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'},publicJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents the public key (complementary to `privateJwk`).\n",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'}},required:["privateJwk","publicJwk"]}},required:["keyPair"]}},required:["type","resource"]},{title:"Contract",type:"object",properties:{type:{example:"Contract",enum:["Contract"]},name:{type:"string",example:"Resource name"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",properties:{dataSharingAgreement:{type:"object",required:["dataOfferingDescription","parties","purpose","duration","intendedUse","licenseGrant","dataStream","personalData","pricingModel","dataExchangeAgreement","signatures"],properties:{dataOfferingDescription:{type:"object",required:["dataOfferingId","version","active"],properties:{dataOfferingId:{type:"string"},version:{type:"integer"},category:{type:"string"},active:{type:"boolean"},title:{type:"string"}}},parties:{type:"object",required:["providerDid","consumerDid"],properties:{providerDid:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},consumerDid:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}}},purpose:{type:"string"},duration:{type:"object",required:["creationDate","startDate","endDate"],properties:{creationDate:{type:"integer"},startDate:{type:"integer"},endDate:{type:"integer"}}},intendedUse:{type:"object",required:["processData","shareDataWithThirdParty","editData"],properties:{processData:{type:"boolean"},shareDataWithThirdParty:{type:"boolean"},editData:{type:"boolean"}}},licenseGrant:{type:"object",required:["transferable","exclusiveness","paidUp","revocable","processing","modifying","analyzing","storingData","storingCopy","reproducing","distributing","loaning","selling","renting","furtherLicensing","leasing"],properties:{transferable:{type:"boolean"},exclusiveness:{type:"boolean"},paidUp:{type:"boolean"},revocable:{type:"boolean"},processing:{type:"boolean"},modifying:{type:"boolean"},analyzing:{type:"boolean"},storingData:{type:"boolean"},storingCopy:{type:"boolean"},reproducing:{type:"boolean"},distributing:{type:"boolean"},loaning:{type:"boolean"},selling:{type:"boolean"},renting:{type:"boolean"},furtherLicensing:{type:"boolean"},leasing:{type:"boolean"}}},dataStream:{type:"boolean"},personalData:{type:"boolean"},pricingModel:{type:"object",required:["basicPrice","currency","hasFreePrice"],properties:{paymentType:{type:"string"},pricingModelName:{type:"string"},basicPrice:{type:"number",format:"float"},currency:{type:"string"},fee:{type:"number",format:"float"},hasPaymentOnSubscription:{type:"object",properties:{paymentOnSubscriptionName:{type:"string"},paymentType:{type:"string"},timeDuration:{type:"string"},description:{type:"string"},repeat:{type:"string"},hasSubscriptionPrice:{type:"number"}}},hasFreePrice:{type:"object",properties:{hasPriceFree:{type:"boolean"}}}}},dataExchangeAgreement:{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},signatures:{type:"object",required:["providerSignature","consumerSignature"],properties:{providerSignature:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"},consumerSignature:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"}}}}},keyPair:{type:"object",properties:{privateJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents a private key (complementary to `publicJwk`)\n",example:'{"alg":"ES256","crv":"P-256","d":"rQp_3eZzvXwt1sK7WWsRhVYipqNGblzYDKKaYirlqs0","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'},publicJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents the public key (complementary to `privateJwk`).\n",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'}},required:["privateJwk","publicJwk"]}},required:["dataSharingAgreement"]}},required:["type","resource"]},{title:"NonRepudiationProof",type:"object",properties:{type:{example:"NonRepudiationProof",enum:["NonRepudiationProof"]},name:{type:"string",example:"Resource name"},resource:{description:"a non-repudiation proof (either a PoO, a PoR or a PoP) as a compact JWS"}},required:["type","resource"]},{title:"DataExchangeResource",type:"object",properties:{type:{example:"DataExchange",enum:["DataExchange"]},name:{type:"string",example:"Resource name"},resource:{allOf:[{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},{type:"object",properties:{cipherblockDgst:{type:"string",description:"hash of the cipherblock in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"},blockCommitment:{type:"string",description:"hash of the plaintext block in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"},secretCommitment:{type:"string",description:"ash of the secret that can be used to decrypt the block in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"}},required:["cipherblockDgst","blockCommitment","secretCommitment"]}]}},required:["type","resource"]}]}},Resource:{title:"Resource",anyOf:[{title:"VerifiableCredential",type:"object",properties:{type:{example:"VerifiableCredential",enum:["VerifiableCredential"]},name:{type:"string",example:"Resource name"},resource:{type:"object",properties:{"@context":{type:"array",items:{type:"string"},example:["https://www.w3.org/2018/credentials/v1"]},id:{type:"string",example:"http://example.edu/credentials/1872"},type:{type:"array",items:{type:"string"},example:["VerifiableCredential"]},issuer:{type:"object",properties:{id:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},additionalProperties:!0,required:["id"]},issuanceDate:{type:"string",format:"date-time",example:"2021-06-10T19:07:28.000Z"},credentialSubject:{type:"object",properties:{id:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},required:["id"],additionalProperties:!0},proof:{type:"object",properties:{type:{type:"string",enum:["JwtProof2020"]}},required:["type"],additionalProperties:!0}},additionalProperties:!0,required:["@context","type","issuer","issuanceDate","credentialSubject","proof"]}},required:["type","resource"]},{title:"ObjectResource",type:"object",properties:{type:{example:"Object",enum:["Object"]},name:{type:"string",example:"Resource name"},parentResource:{type:"string"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",additionalProperties:!0}},required:["type","resource"]},{title:"JWK pair",type:"object",properties:{type:{example:"KeyPair",enum:["KeyPair"]},name:{type:"string",example:"Resource name"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",properties:{keyPair:{type:"object",properties:{privateJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents a private key (complementary to `publicJwk`)\n",example:'{"alg":"ES256","crv":"P-256","d":"rQp_3eZzvXwt1sK7WWsRhVYipqNGblzYDKKaYirlqs0","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'},publicJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents the public key (complementary to `privateJwk`).\n",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'}},required:["privateJwk","publicJwk"]}},required:["keyPair"]}},required:["type","resource"]},{title:"Contract",type:"object",properties:{type:{example:"Contract",enum:["Contract"]},name:{type:"string",example:"Resource name"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",properties:{dataSharingAgreement:{type:"object",required:["dataOfferingDescription","parties","purpose","duration","intendedUse","licenseGrant","dataStream","personalData","pricingModel","dataExchangeAgreement","signatures"],properties:{dataOfferingDescription:{type:"object",required:["dataOfferingId","version","active"],properties:{dataOfferingId:{type:"string"},version:{type:"integer"},category:{type:"string"},active:{type:"boolean"},title:{type:"string"}}},parties:{type:"object",required:["providerDid","consumerDid"],properties:{providerDid:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},consumerDid:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}}},purpose:{type:"string"},duration:{type:"object",required:["creationDate","startDate","endDate"],properties:{creationDate:{type:"integer"},startDate:{type:"integer"},endDate:{type:"integer"}}},intendedUse:{type:"object",required:["processData","shareDataWithThirdParty","editData"],properties:{processData:{type:"boolean"},shareDataWithThirdParty:{type:"boolean"},editData:{type:"boolean"}}},licenseGrant:{type:"object",required:["transferable","exclusiveness","paidUp","revocable","processing","modifying","analyzing","storingData","storingCopy","reproducing","distributing","loaning","selling","renting","furtherLicensing","leasing"],properties:{transferable:{type:"boolean"},exclusiveness:{type:"boolean"},paidUp:{type:"boolean"},revocable:{type:"boolean"},processing:{type:"boolean"},modifying:{type:"boolean"},analyzing:{type:"boolean"},storingData:{type:"boolean"},storingCopy:{type:"boolean"},reproducing:{type:"boolean"},distributing:{type:"boolean"},loaning:{type:"boolean"},selling:{type:"boolean"},renting:{type:"boolean"},furtherLicensing:{type:"boolean"},leasing:{type:"boolean"}}},dataStream:{type:"boolean"},personalData:{type:"boolean"},pricingModel:{type:"object",required:["basicPrice","currency","hasFreePrice"],properties:{paymentType:{type:"string"},pricingModelName:{type:"string"},basicPrice:{type:"number",format:"float"},currency:{type:"string"},fee:{type:"number",format:"float"},hasPaymentOnSubscription:{type:"object",properties:{paymentOnSubscriptionName:{type:"string"},paymentType:{type:"string"},timeDuration:{type:"string"},description:{type:"string"},repeat:{type:"string"},hasSubscriptionPrice:{type:"number"}}},hasFreePrice:{type:"object",properties:{hasPriceFree:{type:"boolean"}}}}},dataExchangeAgreement:{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},signatures:{type:"object",required:["providerSignature","consumerSignature"],properties:{providerSignature:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"},consumerSignature:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"}}}}},keyPair:{type:"object",properties:{privateJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents a private key (complementary to `publicJwk`)\n",example:'{"alg":"ES256","crv":"P-256","d":"rQp_3eZzvXwt1sK7WWsRhVYipqNGblzYDKKaYirlqs0","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'},publicJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents the public key (complementary to `privateJwk`).\n",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'}},required:["privateJwk","publicJwk"]}},required:["dataSharingAgreement"]}},required:["type","resource"]},{title:"NonRepudiationProof",type:"object",properties:{type:{example:"NonRepudiationProof",enum:["NonRepudiationProof"]},name:{type:"string",example:"Resource name"},resource:{description:"a non-repudiation proof (either a PoO, a PoR or a PoP) as a compact JWS"}},required:["type","resource"]},{title:"DataExchangeResource",type:"object",properties:{type:{example:"DataExchange",enum:["DataExchange"]},name:{type:"string",example:"Resource name"},resource:{allOf:[{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},{type:"object",properties:{cipherblockDgst:{type:"string",description:"hash of the cipherblock in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"},blockCommitment:{type:"string",description:"hash of the plaintext block in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"},secretCommitment:{type:"string",description:"ash of the secret that can be used to decrypt the block in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"}},required:["cipherblockDgst","blockCommitment","secretCommitment"]}]}},required:["type","resource"]}]},VerifiableCredential:{title:"VerifiableCredential",type:"object",properties:{type:{example:"VerifiableCredential",enum:["VerifiableCredential"]},name:{type:"string",example:"Resource name"},resource:{type:"object",properties:{"@context":{type:"array",items:{type:"string"},example:["https://www.w3.org/2018/credentials/v1"]},id:{type:"string",example:"http://example.edu/credentials/1872"},type:{type:"array",items:{type:"string"},example:["VerifiableCredential"]},issuer:{type:"object",properties:{id:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},additionalProperties:!0,required:["id"]},issuanceDate:{type:"string",format:"date-time",example:"2021-06-10T19:07:28.000Z"},credentialSubject:{type:"object",properties:{id:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},required:["id"],additionalProperties:!0},proof:{type:"object",properties:{type:{type:"string",enum:["JwtProof2020"]}},required:["type"],additionalProperties:!0}},additionalProperties:!0,required:["@context","type","issuer","issuanceDate","credentialSubject","proof"]}},required:["type","resource"]},ObjectResource:{title:"ObjectResource",type:"object",properties:{type:{example:"Object",enum:["Object"]},name:{type:"string",example:"Resource name"},parentResource:{type:"string"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",additionalProperties:!0}},required:["type","resource"]},KeyPair:{title:"JWK pair",type:"object",properties:{type:{example:"KeyPair",enum:["KeyPair"]},name:{type:"string",example:"Resource name"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",properties:{keyPair:{type:"object",properties:{privateJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents a private key (complementary to `publicJwk`)\n",example:'{"alg":"ES256","crv":"P-256","d":"rQp_3eZzvXwt1sK7WWsRhVYipqNGblzYDKKaYirlqs0","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'},publicJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents the public key (complementary to `privateJwk`).\n",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'}},required:["privateJwk","publicJwk"]}},required:["keyPair"]}},required:["type","resource"]},Contract:{title:"Contract",type:"object",properties:{type:{example:"Contract",enum:["Contract"]},name:{type:"string",example:"Resource name"},identity:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},resource:{type:"object",properties:{dataSharingAgreement:{type:"object",required:["dataOfferingDescription","parties","purpose","duration","intendedUse","licenseGrant","dataStream","personalData","pricingModel","dataExchangeAgreement","signatures"],properties:{dataOfferingDescription:{type:"object",required:["dataOfferingId","version","active"],properties:{dataOfferingId:{type:"string"},version:{type:"integer"},category:{type:"string"},active:{type:"boolean"},title:{type:"string"}}},parties:{type:"object",required:["providerDid","consumerDid"],properties:{providerDid:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},consumerDid:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}}},purpose:{type:"string"},duration:{type:"object",required:["creationDate","startDate","endDate"],properties:{creationDate:{type:"integer"},startDate:{type:"integer"},endDate:{type:"integer"}}},intendedUse:{type:"object",required:["processData","shareDataWithThirdParty","editData"],properties:{processData:{type:"boolean"},shareDataWithThirdParty:{type:"boolean"},editData:{type:"boolean"}}},licenseGrant:{type:"object",required:["transferable","exclusiveness","paidUp","revocable","processing","modifying","analyzing","storingData","storingCopy","reproducing","distributing","loaning","selling","renting","furtherLicensing","leasing"],properties:{transferable:{type:"boolean"},exclusiveness:{type:"boolean"},paidUp:{type:"boolean"},revocable:{type:"boolean"},processing:{type:"boolean"},modifying:{type:"boolean"},analyzing:{type:"boolean"},storingData:{type:"boolean"},storingCopy:{type:"boolean"},reproducing:{type:"boolean"},distributing:{type:"boolean"},loaning:{type:"boolean"},selling:{type:"boolean"},renting:{type:"boolean"},furtherLicensing:{type:"boolean"},leasing:{type:"boolean"}}},dataStream:{type:"boolean"},personalData:{type:"boolean"},pricingModel:{type:"object",required:["basicPrice","currency","hasFreePrice"],properties:{paymentType:{type:"string"},pricingModelName:{type:"string"},basicPrice:{type:"number",format:"float"},currency:{type:"string"},fee:{type:"number",format:"float"},hasPaymentOnSubscription:{type:"object",properties:{paymentOnSubscriptionName:{type:"string"},paymentType:{type:"string"},timeDuration:{type:"string"},description:{type:"string"},repeat:{type:"string"},hasSubscriptionPrice:{type:"number"}}},hasFreePrice:{type:"object",properties:{hasPriceFree:{type:"boolean"}}}}},dataExchangeAgreement:{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},signatures:{type:"object",required:["providerSignature","consumerSignature"],properties:{providerSignature:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"},consumerSignature:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"}}}}},keyPair:{type:"object",properties:{privateJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents a private key (complementary to `publicJwk`)\n",example:'{"alg":"ES256","crv":"P-256","d":"rQp_3eZzvXwt1sK7WWsRhVYipqNGblzYDKKaYirlqs0","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'},publicJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents the public key (complementary to `privateJwk`).\n",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'}},required:["privateJwk","publicJwk"]}},required:["dataSharingAgreement"]}},required:["type","resource"]},DataExchangeResource:{title:"DataExchangeResource",type:"object",properties:{type:{example:"DataExchange",enum:["DataExchange"]},name:{type:"string",example:"Resource name"},resource:{allOf:[{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},{type:"object",properties:{cipherblockDgst:{type:"string",description:"hash of the cipherblock in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"},blockCommitment:{type:"string",description:"hash of the plaintext block in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"},secretCommitment:{type:"string",description:"ash of the secret that can be used to decrypt the block in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"}},required:["cipherblockDgst","blockCommitment","secretCommitment"]}]}},required:["type","resource"]},NonRepudiationProof:{title:"NonRepudiationProof",type:"object",properties:{type:{example:"NonRepudiationProof",enum:["NonRepudiationProof"]},name:{type:"string",example:"Resource name"},resource:{description:"a non-repudiation proof (either a PoO, a PoR or a PoP) as a compact JWS"}},required:["type","resource"]},ResourceId:{type:"object",properties:{id:{type:"string"}},required:["id"]},ResourceType:{type:"string",enum:["VerifiableCredential","Object","KeyPair","Contract","DataExchange","NonRepudiationProof"]},SignedTransaction:{title:"SignedTransaction",description:"A list of resources",type:"object",properties:{transaction:{type:"string",pattern:"^0x(?:[A-Fa-f0-9])+$"}}},DecodedJwt:{title:"JwtPayload",type:"object",properties:{header:{type:"object",properties:{typ:{type:"string",enum:["JWT"]},alg:{type:"string",enum:["ES256K"]}},required:["typ","alg"],additionalProperties:!0},payload:{type:"object",properties:{iss:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}},required:["iss"],additionalProperties:!0},signature:{type:"string",format:"^[A-Za-z0-9_-]+$"},data:{type:"string",format:"^[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+$",description:"."}},required:["signature","data"]},VerificationOutput:{title:"VerificationOutput",type:"object",properties:{verification:{type:"string",enum:["success","failed"],description:"whether verification has been successful or has failed"},error:{type:"string",description:"error message if verification failed"},decodedJwt:{description:"the decoded JWT"}},required:["verification"]},ProviderData:{title:"ProviderData",description:"A JSON object with information of the DLT provider currently in use.",type:"object",properties:{provider:{type:"string",example:"did:ethr:i3m"},network:{type:"string",example:"i3m"},rpcUrl:{type:"string",example:"http://95.211.3.250:8545"}},additionalProperties:!0},EthereumAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},did:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},IdentityData:{title:"Identity Data",type:"object",properties:{did:{type:"string",example:"did:ethr:i3m:0x03142f480f831e835822fc0cd35726844a7069d28df58fb82037f1598812e1ade8"},alias:{type:"string",example:"identity1"},provider:{type:"string",example:"did:ethr:i3m"},addresses:{type:"array",items:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},example:["0x8646cAcF516de1292be1D30AB68E7Ea51e9B1BE7"]}},required:["did"]},ApiError:{type:"object",title:"Error",required:["code","message"],properties:{code:{type:"integer",format:"int32"},message:{type:"string"}}},JwkPair:{type:"object",properties:{privateJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents a private key (complementary to `publicJwk`)\n",example:'{"alg":"ES256","crv":"P-256","d":"rQp_3eZzvXwt1sK7WWsRhVYipqNGblzYDKKaYirlqs0","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'},publicJwk:{type:"string",description:"A stringified JWK with alphabetically sorted claims that represents the public key (complementary to `privateJwk`).\n",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"}'}},required:["privateJwk","publicJwk"]},CompactJWS:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"},DataExchangeAgreement:{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},DataSharingAgreement:{type:"object",required:["dataOfferingDescription","parties","purpose","duration","intendedUse","licenseGrant","dataStream","personalData","pricingModel","dataExchangeAgreement","signatures"],properties:{dataOfferingDescription:{type:"object",required:["dataOfferingId","version","active"],properties:{dataOfferingId:{type:"string"},version:{type:"integer"},category:{type:"string"},active:{type:"boolean"},title:{type:"string"}}},parties:{type:"object",required:["providerDid","consumerDid"],properties:{providerDid:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},consumerDid:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"}}},purpose:{type:"string"},duration:{type:"object",required:["creationDate","startDate","endDate"],properties:{creationDate:{type:"integer"},startDate:{type:"integer"},endDate:{type:"integer"}}},intendedUse:{type:"object",required:["processData","shareDataWithThirdParty","editData"],properties:{processData:{type:"boolean"},shareDataWithThirdParty:{type:"boolean"},editData:{type:"boolean"}}},licenseGrant:{type:"object",required:["transferable","exclusiveness","paidUp","revocable","processing","modifying","analyzing","storingData","storingCopy","reproducing","distributing","loaning","selling","renting","furtherLicensing","leasing"],properties:{transferable:{type:"boolean"},exclusiveness:{type:"boolean"},paidUp:{type:"boolean"},revocable:{type:"boolean"},processing:{type:"boolean"},modifying:{type:"boolean"},analyzing:{type:"boolean"},storingData:{type:"boolean"},storingCopy:{type:"boolean"},reproducing:{type:"boolean"},distributing:{type:"boolean"},loaning:{type:"boolean"},selling:{type:"boolean"},renting:{type:"boolean"},furtherLicensing:{type:"boolean"},leasing:{type:"boolean"}}},dataStream:{type:"boolean"},personalData:{type:"boolean"},pricingModel:{type:"object",required:["basicPrice","currency","hasFreePrice"],properties:{paymentType:{type:"string"},pricingModelName:{type:"string"},basicPrice:{type:"number",format:"float"},currency:{type:"string"},fee:{type:"number",format:"float"},hasPaymentOnSubscription:{type:"object",properties:{paymentOnSubscriptionName:{type:"string"},paymentType:{type:"string"},timeDuration:{type:"string"},description:{type:"string"},repeat:{type:"string"},hasSubscriptionPrice:{type:"number"}}},hasFreePrice:{type:"object",properties:{hasPriceFree:{type:"boolean"}}}}},dataExchangeAgreement:{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},signatures:{type:"object",required:["providerSignature","consumerSignature"],properties:{providerSignature:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"},consumerSignature:{title:"CompactJWS",type:"string",pattern:"^[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+\\.[a-zA-Z0-9_-]+$"}}}}},DataExchange:{allOf:[{type:"object",required:["orig","dest","encAlg","signingAlg","hashAlg","ledgerContractAddress","ledgerSignerAddress","pooToPorDelay","pooToPopDelay","pooToSecretDelay"],properties:{orig:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"}'},dest:{type:"string",description:"A stringified JWK with alphabetically sorted claims",example:'{"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"}'},encAlg:{type:"string",enum:["A128GCM","A256GCM"],example:"A256GCM"},signingAlg:{type:"string",enum:["ES256","ES384","ES512"],example:"ES256"},hashAlg:{type:"string",enum:["SHA-256","SHA-384","SHA-512"],example:"SHA-256"},ledgerContractAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},ledgerSignerAddress:{description:"Ethereum Address in EIP-55 format (with checksum)",type:"string",pattern:"^0x([0-9A-Fa-f]){40}$",example:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},pooToPorDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and verified PoR",type:"integer",minimum:1,example:1e4},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:2e4},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:18e4},schema:{description:"A stringified JSON-LD schema describing the data format",type:"string"}}},{type:"object",properties:{cipherblockDgst:{type:"string",description:"hash of the cipherblock in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"},blockCommitment:{type:"string",description:"hash of the plaintext block in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"},secretCommitment:{type:"string",description:"ash of the secret that can be used to decrypt the block in base64url with no padding",pattern:"^[a-zA-Z0-9_-]+$"}},required:["cipherblockDgst","blockCommitment","secretCommitment"]}]}}},he={id:"https://spec.openapis.org/oas/3.0/schema/2021-09-28",$schema:"http://json-schema.org/draft-04/schema#",description:"The description of OpenAPI v3.0.x documents, as defined by https://spec.openapis.org/oas/v3.0.3",type:"object",required:["openapi","info","paths"],properties:{openapi:{type:"string",pattern:"^3\\.0\\.\\d(-.+)?$"},info:{$ref:"#/definitions/Info"},externalDocs:{$ref:"#/definitions/ExternalDocumentation"},servers:{type:"array",items:{$ref:"#/definitions/Server"}},security:{type:"array",items:{$ref:"#/definitions/SecurityRequirement"}},tags:{type:"array",items:{$ref:"#/definitions/Tag"},uniqueItems:!0},paths:{$ref:"#/definitions/Paths"},components:{$ref:"#/definitions/Components"}},patternProperties:{"^x-":{}},additionalProperties:!1,definitions:{Reference:{type:"object",required:["$ref"],patternProperties:{"^\\$ref$":{type:"string",format:"uri-reference"}}},Info:{type:"object",required:["title","version"],properties:{title:{type:"string"},description:{type:"string"},termsOfService:{type:"string",format:"uri-reference"},contact:{$ref:"#/definitions/Contact"},license:{$ref:"#/definitions/License"},version:{type:"string"}},patternProperties:{"^x-":{}},additionalProperties:!1},Contact:{type:"object",properties:{name:{type:"string"},url:{type:"string",format:"uri-reference"},email:{type:"string",format:"email"}},patternProperties:{"^x-":{}},additionalProperties:!1},License:{type:"object",required:["name"],properties:{name:{type:"string"},url:{type:"string",format:"uri-reference"}},patternProperties:{"^x-":{}},additionalProperties:!1},Server:{type:"object",required:["url"],properties:{url:{type:"string"},description:{type:"string"},variables:{type:"object",additionalProperties:{$ref:"#/definitions/ServerVariable"}}},patternProperties:{"^x-":{}},additionalProperties:!1},ServerVariable:{type:"object",required:["default"],properties:{enum:{type:"array",items:{type:"string"}},default:{type:"string"},description:{type:"string"}},patternProperties:{"^x-":{}},additionalProperties:!1},Components:{type:"object",properties:{schemas:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]}}},responses:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/Response"}]}}},parameters:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/Parameter"}]}}},examples:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/Example"}]}}},requestBodies:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/RequestBody"}]}}},headers:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/Header"}]}}},securitySchemes:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/SecurityScheme"}]}}},links:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/Link"}]}}},callbacks:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/Callback"}]}}}},patternProperties:{"^x-":{}},additionalProperties:!1},Schema:{type:"object",properties:{title:{type:"string"},multipleOf:{type:"number",minimum:0,exclusiveMinimum:!0},maximum:{type:"number"},exclusiveMaximum:{type:"boolean",default:!1},minimum:{type:"number"},exclusiveMinimum:{type:"boolean",default:!1},maxLength:{type:"integer",minimum:0},minLength:{type:"integer",minimum:0,default:0},pattern:{type:"string",format:"regex"},maxItems:{type:"integer",minimum:0},minItems:{type:"integer",minimum:0,default:0},uniqueItems:{type:"boolean",default:!1},maxProperties:{type:"integer",minimum:0},minProperties:{type:"integer",minimum:0,default:0},required:{type:"array",items:{type:"string"},minItems:1,uniqueItems:!0},enum:{type:"array",items:{},minItems:1,uniqueItems:!1},type:{type:"string",enum:["array","boolean","integer","number","object","string"]},not:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]},allOf:{type:"array",items:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]}},oneOf:{type:"array",items:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]}},anyOf:{type:"array",items:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]}},items:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]},properties:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]}},additionalProperties:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"},{type:"boolean"}],default:!0},description:{type:"string"},format:{type:"string"},default:{},nullable:{type:"boolean",default:!1},discriminator:{$ref:"#/definitions/Discriminator"},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},example:{},externalDocs:{$ref:"#/definitions/ExternalDocumentation"},deprecated:{type:"boolean",default:!1},xml:{$ref:"#/definitions/XML"}},patternProperties:{"^x-":{}},additionalProperties:!1},Discriminator:{type:"object",required:["propertyName"],properties:{propertyName:{type:"string"},mapping:{type:"object",additionalProperties:{type:"string"}}}},XML:{type:"object",properties:{name:{type:"string"},namespace:{type:"string",format:"uri"},prefix:{type:"string"},attribute:{type:"boolean",default:!1},wrapped:{type:"boolean",default:!1}},patternProperties:{"^x-":{}},additionalProperties:!1},Response:{type:"object",required:["description"],properties:{description:{type:"string"},headers:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Header"},{$ref:"#/definitions/Reference"}]}},content:{type:"object",additionalProperties:{$ref:"#/definitions/MediaType"}},links:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Link"},{$ref:"#/definitions/Reference"}]}}},patternProperties:{"^x-":{}},additionalProperties:!1},MediaType:{type:"object",properties:{schema:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]},example:{},examples:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Example"},{$ref:"#/definitions/Reference"}]}},encoding:{type:"object",additionalProperties:{$ref:"#/definitions/Encoding"}}},patternProperties:{"^x-":{}},additionalProperties:!1,allOf:[{$ref:"#/definitions/ExampleXORExamples"}]},Example:{type:"object",properties:{summary:{type:"string"},description:{type:"string"},value:{},externalValue:{type:"string",format:"uri-reference"}},patternProperties:{"^x-":{}},additionalProperties:!1},Header:{type:"object",properties:{description:{type:"string"},required:{type:"boolean",default:!1},deprecated:{type:"boolean",default:!1},allowEmptyValue:{type:"boolean",default:!1},style:{type:"string",enum:["simple"],default:"simple"},explode:{type:"boolean"},allowReserved:{type:"boolean",default:!1},schema:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]},content:{type:"object",additionalProperties:{$ref:"#/definitions/MediaType"},minProperties:1,maxProperties:1},example:{},examples:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Example"},{$ref:"#/definitions/Reference"}]}}},patternProperties:{"^x-":{}},additionalProperties:!1,allOf:[{$ref:"#/definitions/ExampleXORExamples"},{$ref:"#/definitions/SchemaXORContent"}]},Paths:{type:"object",patternProperties:{"^\\/":{$ref:"#/definitions/PathItem"},"^x-":{}},additionalProperties:!1},PathItem:{type:"object",properties:{$ref:{type:"string"},summary:{type:"string"},description:{type:"string"},servers:{type:"array",items:{$ref:"#/definitions/Server"}},parameters:{type:"array",items:{oneOf:[{$ref:"#/definitions/Parameter"},{$ref:"#/definitions/Reference"}]},uniqueItems:!0}},patternProperties:{"^(get|put|post|delete|options|head|patch|trace)$":{$ref:"#/definitions/Operation"},"^x-":{}},additionalProperties:!1},Operation:{type:"object",required:["responses"],properties:{tags:{type:"array",items:{type:"string"}},summary:{type:"string"},description:{type:"string"},externalDocs:{$ref:"#/definitions/ExternalDocumentation"},operationId:{type:"string"},parameters:{type:"array",items:{oneOf:[{$ref:"#/definitions/Parameter"},{$ref:"#/definitions/Reference"}]},uniqueItems:!0},requestBody:{oneOf:[{$ref:"#/definitions/RequestBody"},{$ref:"#/definitions/Reference"}]},responses:{$ref:"#/definitions/Responses"},callbacks:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Callback"},{$ref:"#/definitions/Reference"}]}},deprecated:{type:"boolean",default:!1},security:{type:"array",items:{$ref:"#/definitions/SecurityRequirement"}},servers:{type:"array",items:{$ref:"#/definitions/Server"}}},patternProperties:{"^x-":{}},additionalProperties:!1},Responses:{type:"object",properties:{default:{oneOf:[{$ref:"#/definitions/Response"},{$ref:"#/definitions/Reference"}]}},patternProperties:{"^[1-5](?:\\d{2}|XX)$":{oneOf:[{$ref:"#/definitions/Response"},{$ref:"#/definitions/Reference"}]},"^x-":{}},minProperties:1,additionalProperties:!1},SecurityRequirement:{type:"object",additionalProperties:{type:"array",items:{type:"string"}}},Tag:{type:"object",required:["name"],properties:{name:{type:"string"},description:{type:"string"},externalDocs:{$ref:"#/definitions/ExternalDocumentation"}},patternProperties:{"^x-":{}},additionalProperties:!1},ExternalDocumentation:{type:"object",required:["url"],properties:{description:{type:"string"},url:{type:"string",format:"uri-reference"}},patternProperties:{"^x-":{}},additionalProperties:!1},ExampleXORExamples:{description:"Example and examples are mutually exclusive",not:{required:["example","examples"]}},SchemaXORContent:{description:"Schema and content are mutually exclusive, at least one is required",not:{required:["schema","content"]},oneOf:[{required:["schema"]},{required:["content"],description:"Some properties are not allowed if content is present",allOf:[{not:{required:["style"]}},{not:{required:["explode"]}},{not:{required:["allowReserved"]}},{not:{required:["example"]}},{not:{required:["examples"]}}]}]},Parameter:{type:"object",properties:{name:{type:"string"},in:{type:"string"},description:{type:"string"},required:{type:"boolean",default:!1},deprecated:{type:"boolean",default:!1},allowEmptyValue:{type:"boolean",default:!1},style:{type:"string"},explode:{type:"boolean"},allowReserved:{type:"boolean",default:!1},schema:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]},content:{type:"object",additionalProperties:{$ref:"#/definitions/MediaType"},minProperties:1,maxProperties:1},example:{},examples:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Example"},{$ref:"#/definitions/Reference"}]}}},patternProperties:{"^x-":{}},additionalProperties:!1,required:["name","in"],allOf:[{$ref:"#/definitions/ExampleXORExamples"},{$ref:"#/definitions/SchemaXORContent"},{$ref:"#/definitions/ParameterLocation"}]},ParameterLocation:{description:"Parameter location",oneOf:[{description:"Parameter in path",required:["required"],properties:{in:{enum:["path"]},style:{enum:["matrix","label","simple"],default:"simple"},required:{enum:[!0]}}},{description:"Parameter in query",properties:{in:{enum:["query"]},style:{enum:["form","spaceDelimited","pipeDelimited","deepObject"],default:"form"}}},{description:"Parameter in header",properties:{in:{enum:["header"]},style:{enum:["simple"],default:"simple"}}},{description:"Parameter in cookie",properties:{in:{enum:["cookie"]},style:{enum:["form"],default:"form"}}}]},RequestBody:{type:"object",required:["content"],properties:{description:{type:"string"},content:{type:"object",additionalProperties:{$ref:"#/definitions/MediaType"}},required:{type:"boolean",default:!1}},patternProperties:{"^x-":{}},additionalProperties:!1},SecurityScheme:{oneOf:[{$ref:"#/definitions/APIKeySecurityScheme"},{$ref:"#/definitions/HTTPSecurityScheme"},{$ref:"#/definitions/OAuth2SecurityScheme"},{$ref:"#/definitions/OpenIdConnectSecurityScheme"}]},APIKeySecurityScheme:{type:"object",required:["type","name","in"],properties:{type:{type:"string",enum:["apiKey"]},name:{type:"string"},in:{type:"string",enum:["header","query","cookie"]},description:{type:"string"}},patternProperties:{"^x-":{}},additionalProperties:!1},HTTPSecurityScheme:{type:"object",required:["scheme","type"],properties:{scheme:{type:"string"},bearerFormat:{type:"string"},description:{type:"string"},type:{type:"string",enum:["http"]}},patternProperties:{"^x-":{}},additionalProperties:!1,oneOf:[{description:"Bearer",properties:{scheme:{type:"string",pattern:"^[Bb][Ee][Aa][Rr][Ee][Rr]$"}}},{description:"Non Bearer",not:{required:["bearerFormat"]},properties:{scheme:{not:{type:"string",pattern:"^[Bb][Ee][Aa][Rr][Ee][Rr]$"}}}}]},OAuth2SecurityScheme:{type:"object",required:["type","flows"],properties:{type:{type:"string",enum:["oauth2"]},flows:{$ref:"#/definitions/OAuthFlows"},description:{type:"string"}},patternProperties:{"^x-":{}},additionalProperties:!1},OpenIdConnectSecurityScheme:{type:"object",required:["type","openIdConnectUrl"],properties:{type:{type:"string",enum:["openIdConnect"]},openIdConnectUrl:{type:"string",format:"uri-reference"},description:{type:"string"}},patternProperties:{"^x-":{}},additionalProperties:!1},OAuthFlows:{type:"object",properties:{implicit:{$ref:"#/definitions/ImplicitOAuthFlow"},password:{$ref:"#/definitions/PasswordOAuthFlow"},clientCredentials:{$ref:"#/definitions/ClientCredentialsFlow"},authorizationCode:{$ref:"#/definitions/AuthorizationCodeOAuthFlow"}},patternProperties:{"^x-":{}},additionalProperties:!1},ImplicitOAuthFlow:{type:"object",required:["authorizationUrl","scopes"],properties:{authorizationUrl:{type:"string",format:"uri-reference"},refreshUrl:{type:"string",format:"uri-reference"},scopes:{type:"object",additionalProperties:{type:"string"}}},patternProperties:{"^x-":{}},additionalProperties:!1},PasswordOAuthFlow:{type:"object",required:["tokenUrl","scopes"],properties:{tokenUrl:{type:"string",format:"uri-reference"},refreshUrl:{type:"string",format:"uri-reference"},scopes:{type:"object",additionalProperties:{type:"string"}}},patternProperties:{"^x-":{}},additionalProperties:!1},ClientCredentialsFlow:{type:"object",required:["tokenUrl","scopes"],properties:{tokenUrl:{type:"string",format:"uri-reference"},refreshUrl:{type:"string",format:"uri-reference"},scopes:{type:"object",additionalProperties:{type:"string"}}},patternProperties:{"^x-":{}},additionalProperties:!1},AuthorizationCodeOAuthFlow:{type:"object",required:["authorizationUrl","tokenUrl","scopes"],properties:{authorizationUrl:{type:"string",format:"uri-reference"},tokenUrl:{type:"string",format:"uri-reference"},refreshUrl:{type:"string",format:"uri-reference"},scopes:{type:"object",additionalProperties:{type:"string"}}},patternProperties:{"^x-":{}},additionalProperties:!1},Link:{type:"object",properties:{operationId:{type:"string"},operationRef:{type:"string",format:"uri-reference"},parameters:{type:"object",additionalProperties:{}},requestBody:{},description:{type:"string"},server:{$ref:"#/definitions/Server"}},patternProperties:{"^x-":{}},additionalProperties:!1,not:{description:"Operation Id and Operation Ref are mutually exclusive",required:["operationId","operationRef"]}},Callback:{type:"object",additionalProperties:{$ref:"#/definitions/PathItem"},patternProperties:{"^x-":{}}},Encoding:{type:"object",properties:{contentType:{type:"string"},headers:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Header"},{$ref:"#/definitions/Reference"}]}},style:{type:"string",enum:["form","spaceDelimited","pipeDelimited","deepObject"]},explode:{type:"boolean"},allowReserved:{type:"boolean",default:!1}},additionalProperties:!1}}};function be(e){if(new Date(e).getTime()>0)return Number(e);throw new $(new Error("invalid timestamp"),["invalid timestamp"])}async function we(e){const t=[],i=new v({strictSchema:!1,removeAdditional:"all"});i.addMetaSchema(he),S(i);const r=ue.schemas.DataSharingAgreement;try{const a=i.compile(r),n=k.cloneDeep(e);a(e)||null!==a.errors&&void 0!==a.errors&&a.errors.length>0&&a.errors.forEach((e=>{t.push(new $(`[${e.instancePath}] ${e.message??"unknown"}`,["invalid format"]))})),b(n)!==b(e)&&t.push(new $("Additional claims beyond the schema are not supported",["invalid format"]))}catch(e){t.push(new $(e,["invalid format"]))}return t}async function xe(e){const t=[];try{const{id:i,...r}=e;i!==await G(r)&&t.push(new $("Invalid dataExchange id",["cannot verify","invalid format"]));const{blockCommitment:a,secretCommitment:n,cipherblockDgst:o,...s}=r,p=await Pe(s);p.length>0&&p.forEach((e=>{t.push(e)}))}catch(e){t.push(new $("Invalid dataExchange",["cannot verify","invalid format"]))}return t}async function Pe(e){const t=[],i=Object.keys(e);(i.length<10||i.length>11)&&t.push(new $(new Error("Invalid agreeemt: "+JSON.stringify(e,void 0,2)),["invalid format"]));for(const r of i){let i;switch(r){case"orig":case"dest":try{e[r]!==await H(JSON.parse(e[r]),!0)&&t.push(new $(`[dataExchangeAgreeement.${r}] A valid stringified JWK must be provided. For uniqueness, JWK claims must be alphabetically sorted in the stringified JWK. You can use the parseJWK(jwk, true) for that purpose.\n${e[r]}`,["invalid key","invalid format"]))}catch(e){t.push(new $(`[dataExchangeAgreeement.${r}] A valid stringified JWK must be provided. For uniqueness, JWK claims must be alphabetically sorted in the stringified JWK. You can use the parseJWK(jwk, true) for that purpose.`,["invalid key","invalid format"]))}break;case"ledgerContractAddress":case"ledgerSignerAddress":try{i=V(e[r]),e[r]!==i&&t.push(new $(`[dataExchangeAgreeement.${r}] Invalid EIP-55 address ${e[r]}. Did you mean ${i} instead?`,["invalid EIP-55 address","invalid format"]))}catch(i){t.push(new $(`[dataExchangeAgreeement.${r}] Invalid EIP-55 address ${e[r]}.`,["invalid EIP-55 address","invalid format"]))}break;case"pooToPorDelay":case"pooToPopDelay":case"pooToSecretDelay":try{e[r]!==be(e[r])&&t.push(new $(`[dataExchangeAgreeement.${r}] < 0 or not a number`,["invalid timestamp","invalid format"]))}catch(e){t.push(new $(`[dataExchangeAgreeement.${r}] < 0 or not a number`,["invalid timestamp","invalid format"]))}break;case"hashAlg":E.includes(e[r])||t.push(new $(`[dataExchangeAgreeement.${r}Invalid hash algorithm '${e[r]}'. It must be one of: ${E.join(", ")}`,["invalid algorithm"]));break;case"encAlg":D.includes(e[r])||t.push(new $(`[dataExchangeAgreeement.${r}Invalid encryption algorithm '${e[r]}'. It must be one of: ${D.join(", ")}`,["invalid algorithm"]));break;case"signingAlg":j.includes(e[r])||t.push(new $(`[dataExchangeAgreeement.${r}Invalid signing algorithm '${e[r]}'. It must be one of: ${j.join(", ")}`,["invalid algorithm"]));break;case"schema":break;default:t.push(new $(new Error(`Property ${r} not allowed in dataAgreement`),["invalid format"]))}}return t}var Ae=Object.freeze({__proto__:null,NonRepudiationDest:class{constructor(e,t,i){this.initialized=new Promise(((r,a)=>{this.asyncConstructor(e,t,i).then((()=>{r(!0)})).catch((e=>{a(e)}))}))}async asyncConstructor(e,t,i){const r=await Pe(e);if(r.length>0){const e=[];let t=[];throw r.forEach((i=>{e.push(i.message),t=t.concat(i.nrErrors)})),t=[...new Set(t)],new $("Resource has not been validated:\n"+e.join("\n"),t)}this.agreement=e,this.jwkPairDest={privateJwk:t,publicJwk:JSON.parse(e.dest)},this.publicJwkOrig=JSON.parse(e.orig),await _(this.jwkPairDest.publicJwk,this.jwkPairDest.privateJwk),this.dltAgent=i;const a=await this.dltAgent.getContractAddress();if(this.agreement.ledgerContractAddress!==a)throw new Error(`Contract address ${a} does not meet agreed one ${this.agreement.ledgerContractAddress}`);this.block={}}async verifyPoO(t,i,r){await this.initialized;const a=e.encode(await K(i,this.agreement.hashAlg),!0,!1),{payload:n}=await T(t),o={...this.agreement,cipherblockDgst:a,blockCommitment:n.exchange.blockCommitment,secretCommitment:n.exchange.secretCommitment},s={proofType:"PoO",iss:"orig",exchange:{...o,id:await G(o)}},p={timestamp:Date.now(),notBefore:"iat",notAfter:"iat",...r},d=await X(t,s,p);return this.block={jwe:i,poo:{jws:t,payload:d.payload}},this.exchange=d.payload.exchange,d}async generatePoR(){if(await this.initialized,void 0===this.exchange||void 0===this.block.poo)throw new Error("Before computing a PoR, you have first to receive a valid cipherblock with a PoO and validate the PoO");const e={proofType:"PoR",iss:"dest",exchange:this.exchange,poo:this.block.poo.jws};return this.block.por=await Z(e,this.jwkPairDest.privateJwk),this.block.por}async verifyPoP(t,i){if(await this.initialized,void 0===this.exchange||void 0===this.block.por||void 0===this.block.poo)throw new Error("Cannot verify a PoP if not even a PoR have been created");const r={proofType:"PoP",iss:"orig",exchange:this.exchange,por:this.block.por.jws,secret:"",verificationCode:""},n={timestamp:Date.now(),notBefore:"iat",notAfter:1e3*this.block.poo.payload.iat+this.exchange.pooToPopDelay,...i},o=await X(t,r,n),s=JSON.parse(o.payload.secret);return this.block.secret={hex:a(e.decode(s.k)),jwk:s},this.block.pop={jws:t,payload:o.payload},o}async getSecretFromLedger(){if(await this.initialized,void 0===this.exchange||void 0===this.block.poo||void 0===this.block.por)throw new Error("Cannot get secret if a PoR has not been sent before");const e=Date.now(),t=1e3*this.block.poo.payload.iat+this.agreement.pooToSecretDelay,i=Math.round((t-e)/1e3),{hex:r,iat:a}=await this.dltAgent.getSecretFromLedger(F(this.agreement.encAlg),this.agreement.ledgerSignerAddress,this.exchange.id,i);this.block.secret=await z(this.exchange.encAlg,r);try{M(1e3*a,1e3*this.block.por.payload.iat,1e3*this.block.poo.payload.iat+this.exchange.pooToSecretDelay)}catch(e){throw new $(`Although the secret has been obtained (and you could try to decrypt the cipherblock), it's been published later than agreed: ${new Date(1e3*a).toUTCString()} > ${new Date(1e3*this.block.poo.payload.iat+this.agreement.pooToSecretDelay).toUTCString()}`,["secret not published in time"])}return this.block.secret}async decrypt(){if(await this.initialized,void 0===this.exchange)throw new Error("No agreed exchange");if(void 0===this.block.secret?.jwk)throw new Error("Cannot decrypt without the secret");if(void 0===this.block.jwe)throw new Error("No cipherblock to decrypt");const t=(await I(this.block.jwe,this.block.secret.jwk)).plaintext;if(e.encode(await K(t,this.agreement.hashAlg),!0,!1)!==this.exchange.blockCommitment)throw new Error("Decrypted block does not meet the committed one");return this.block.raw=t,t}async generateVerificationRequest(){if(await this.initialized,void 0===this.block.por||void 0===this.exchange)throw new Error("Before generating a VerificationRequest, you have first to hold a valid PoR for the exchange");return await ee("dest",this.exchange.id,this.block.por.jws,this.jwkPairDest.privateJwk)}async generateDisputeRequest(){if(await this.initialized,void 0===this.block.por||void 0===this.block.jwe||void 0===this.exchange)throw new Error("Before generating a VerificationRequest, you have first to hold a valid PoR for the exchange and have received the cipherblock");const e={proofType:"request",iss:"dest",por:this.block.por.jws,type:"disputeRequest",cipherblock:this.block.jwe,iat:Math.floor(Date.now()/1e3),dataExchangeId:this.exchange.id},t=await O(this.jwkPairDest.privateJwk);try{return await new h(e).setProtectedHeader({alg:this.jwkPairDest.privateJwk.alg}).setIssuedAt(e.iat).sign(t)}catch(e){throw new $(e,["unexpected error"])}}},NonRepudiationOrig:class{constructor(e,t,i,r){this.jwkPairOrig={privateJwk:t,publicJwk:JSON.parse(e.orig)},this.publicJwkDest=JSON.parse(e.dest),this.block={raw:i},this.initialized=new Promise(((t,i)=>{this.init(e,r).then((()=>{t(!0)})).catch((e=>{i(e)}))}))}async init(t,r){const a=await Pe(t);if(a.length>0){const e=[];let t=[];throw a.forEach((i=>{e.push(i.message),t=t.concat(i.nrErrors)})),t=[...new Set(t)],new $("Resource has not been validated:\n"+e.join("\n"),t)}this.agreement=t,await _(this.jwkPairOrig.publicJwk,this.jwkPairOrig.privateJwk);const n=await z(this.agreement.encAlg);this.block={...this.block,secret:n,jwe:await J(this.block.raw,n.jwk,this.agreement.encAlg)};const o=e.encode(await K(this.block.jwe,this.agreement.hashAlg),!0,!1),s=e.encode(await K(this.block.raw,this.agreement.hashAlg),!0,!1),p=e.encode(await K(new Uint8Array(i(this.block.secret.hex)),this.agreement.hashAlg),!0,!1),d={...this.agreement,cipherblockDgst:o,blockCommitment:s,secretCommitment:p},c=await G(d);this.exchange={...d,id:c},await this._dltSetup(r)}async _dltSetup(e){this.dltAgent=e;const t=await this.dltAgent.getAddress();if(t!==this.exchange.ledgerSignerAddress)throw new Error(`ledgerSignerAddress: ${this.exchange.ledgerSignerAddress} does not meet the address ${t} derived from the provided private key`);const i=await this.dltAgent.getContractAddress();if(i!==N(this.agreement.ledgerContractAddress,!0))throw new Error(`Contract address in use ${i} does not meet the agreed one ${this.agreement.ledgerContractAddress}`)}async generatePoO(){return await this.initialized,this.block.poo=await Z({proofType:"PoO",iss:"orig",exchange:this.exchange},this.jwkPairOrig.privateJwk),this.block.poo}async verifyPoR(e,t){if(await this.initialized,void 0===this.block.poo)throw new Error("Cannot verify a PoR if not even a PoO have been created");const i={proofType:"PoR",iss:"dest",exchange:this.exchange,poo:this.block.poo.jws},r=1e3*this.block.poo.payload.iat,a={timestamp:Date.now(),notBefore:r,notAfter:r+this.exchange.pooToPorDelay,...t},n=await X(e,i,a);return this.block.por={jws:e,payload:n.payload},this.block.por}async generatePoP(){if(await this.initialized,void 0===this.block.por)throw new Error("Before computing a PoP, you have first to have received and verified the PoR");const e=await this.dltAgent.deploySecret(this.block.secret.hex,this.exchange.id),t={proofType:"PoP",iss:"orig",exchange:this.exchange,por:this.block.por.jws,secret:JSON.stringify(this.block.secret.jwk),verificationCode:e};return this.block.pop=await Z(t,this.jwkPairOrig.privateJwk),this.block.pop}async generateVerificationRequest(){if(await this.initialized,void 0===this.block.por)throw new Error("Before generating a VerificationRequest, you have first to hold a valid PoR for the exchange");return await ee("orig",this.exchange.id,this.block.por.jws,this.jwkPairOrig.privateJwk)}}});export{te as ConflictResolution,D as ENC_ALGS,se as EthersIoAgentDest,fe as EthersIoAgentOrig,E as HASH_ALGS,le as I3mServerWalletAgentDest,me as I3mServerWalletAgentOrig,de as I3mWalletAgentDest,ye as I3mWalletAgentOrig,C as KEY_AGREEMENT_ALGS,Ae as NonRepudiationProtocol,$ as NrError,j as SIGNING_ALGS,ge as Signers,M as checkTimestamp,Z as createProof,ie as defaultDltConfig,G as exchangeId,R as generateKeys,B as getDltAddress,O as importJwk,W as jsonSort,I as jweDecrypt,J as jweEncrypt,T as jwsDecode,z as oneTimeSecret,V as parseAddress,N as parseHex,H as parseJwk,K as sha,xe as validateDataExchange,Pe as validateDataExchangeAgreement,we as validateDataSharingAgreementSchema,_ as verifyKeyPair,X as verifyProof}; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uI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1DLENBQ3ZDd0gsVUFBVyxNQUNYbEMsSUFBSyxPQUNMSCxTQUFVM0osS0FBSzJKLFNBQ2Z3QixJQUFLbkwsS0FBS3NELE1BQU02SCxJQUFJOUcsSUFDcEJlLE9BQVFYLEtBQUt1RCxVQUFVaEksS0FBS3NELE1BQU04QixPQUFPckMsS0FDekNzUyxvQkFHRixPQURBclYsS0FBS3NELE1BQU04UixVQUFZdkwsRUFBWXJGLEVBQVN4RSxLQUFLNlYsWUFBWXZULFlBQ3REdEMsS0FBS3NELE1BQU04UixHQUNuQixDQVFENVUsb0NBR0UsU0FGTVIsS0FBS3FOLGlCQUVZbE0sSUFBbkJuQixLQUFLc0QsTUFBTTZILElBQ2IsTUFBTSxJQUFJeEwsTUFBTSxnR0FHbEIsYUFBYW9OLEdBQTRCLE9BQVEvTSxLQUFLMkosU0FBUzZCLEdBQUl4TCxLQUFLc0QsTUFBTTZILElBQUk5RyxJQUFLckUsS0FBSzZWLFlBQVl2VCxXQUN6RyJ9 diff --git a/docs/API.md b/docs/API.md index 055bb2b..9234f91 100644 --- a/docs/API.md +++ b/docs/API.md @@ -105,7 +105,7 @@ ___ ### Dict -Ƭ **Dict**<`T`\>: `T` & { `[key: string | symbol | number]`: `any` \| `undefined`; } +Ƭ **Dict**<`T`\>: `T` & { [key in DictKey]: any \| undefined } #### Type parameters @@ -115,7 +115,7 @@ ___ #### Defined in -[src/ts/types.ts:13](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L13) +[src/ts/types.ts:14](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L14) ___ @@ -125,7 +125,7 @@ ___ #### Defined in -[src/ts/types.ts:11](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L11) +[src/ts/types.ts:11](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L11) ___ @@ -135,7 +135,7 @@ ___ #### Defined in -[src/ts/types.ts:9](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L9) +[src/ts/types.ts:9](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L9) ___ @@ -188,7 +188,7 @@ ___ #### Defined in -[src/ts/types.ts:177](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L177) +[src/ts/types.ts:178](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L178) ___ @@ -198,7 +198,7 @@ ___ #### Defined in -[src/ts/types.ts:10](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L10) +[src/ts/types.ts:10](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L10) ___ @@ -229,7 +229,7 @@ ___ #### Defined in -[src/ts/types.ts:175](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L175) +[src/ts/types.ts:176](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L176) ## Variables @@ -239,7 +239,7 @@ ___ #### Defined in -[src/ts/constants.ts:3](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/constants.ts#L3) +[src/ts/constants.ts:3](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/constants.ts#L3) ___ @@ -249,7 +249,7 @@ ___ #### Defined in -[src/ts/constants.ts:1](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/constants.ts#L1) +[src/ts/constants.ts:1](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/constants.ts#L1) ___ @@ -259,7 +259,7 @@ ___ #### Defined in -[src/ts/constants.ts:4](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/constants.ts#L4) +[src/ts/constants.ts:4](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/constants.ts#L4) ___ @@ -269,7 +269,7 @@ ___ #### Defined in -[src/ts/constants.ts:2](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/constants.ts#L2) +[src/ts/constants.ts:2](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/constants.ts#L2) ___ @@ -279,7 +279,7 @@ ___ #### Defined in -[src/ts/dlt/defaultDltConfig.ts:3](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/defaultDltConfig.ts#L3) +[src/ts/dlt/defaultDltConfig.ts:3](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/defaultDltConfig.ts#L3) ## Functions @@ -302,7 +302,7 @@ ___ #### Defined in -[src/ts/utils/timestamps.ts:3](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/utils/timestamps.ts#L3) +[src/ts/utils/timestamps.ts:3](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/utils/timestamps.ts#L3) ___ @@ -333,7 +333,7 @@ a proof as a compact JWS formatted JWT string #### Defined in -[src/ts/proofs/createProof.ts:13](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/proofs/createProof.ts#L13) +[src/ts/proofs/createProof.ts:13](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/proofs/createProof.ts#L13) ___ @@ -359,7 +359,7 @@ the exchange id in hexadecimal #### Defined in -[src/ts/exchange/exchangeId.ts:13](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/exchange/exchangeId.ts#L13) +[src/ts/exchange/exchangeId.ts:13](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/exchange/exchangeId.ts#L13) ___ @@ -383,7 +383,7 @@ Generates a pair of JWK signing/verification keys #### Defined in -[src/ts/crypto/generateKeys.ts:18](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/crypto/generateKeys.ts#L18) +[src/ts/crypto/generateKeys.ts:18](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/crypto/generateKeys.ts#L18) ___ @@ -403,7 +403,7 @@ ___ #### Defined in -[src/ts/utils/getDltAddress.ts:4](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/utils/getDltAddress.ts#L4) +[src/ts/utils/getDltAddress.ts:4](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/utils/getDltAddress.ts#L4) ___ @@ -424,7 +424,7 @@ ___ #### Defined in -[src/ts/crypto/importJwk.ts:6](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/crypto/importJwk.ts#L6) +[src/ts/crypto/importJwk.ts:6](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/crypto/importJwk.ts#L6) ___ @@ -444,7 +444,7 @@ ___ #### Defined in -[src/ts/utils/jsonSort.ts:5](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/utils/jsonSort.ts#L5) +[src/ts/utils/jsonSort.ts:5](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/utils/jsonSort.ts#L5) ___ @@ -469,7 +469,7 @@ the plaintext #### Defined in -[src/ts/crypto/jwe.ts:56](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/crypto/jwe.ts#L56) +[src/ts/crypto/jwe.ts:56](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/crypto/jwe.ts#L56) ___ @@ -495,7 +495,7 @@ a Compact JWE #### Defined in -[src/ts/crypto/jwe.ts:15](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/crypto/jwe.ts#L15) +[src/ts/crypto/jwe.ts:15](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/crypto/jwe.ts#L15) ___ @@ -524,7 +524,7 @@ Decodes and optionally verifies a JWS, and returns the decoded header, payload. #### Defined in -[src/ts/crypto/jwsDecode.ts:12](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/crypto/jwsDecode.ts#L12) +[src/ts/crypto/jwsDecode.ts:12](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/crypto/jwsDecode.ts#L12) ___ @@ -550,7 +550,7 @@ a promise that resolves to the secret in JWK and raw hex string #### Defined in -[src/ts/crypto/oneTimeSecret.ts:19](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/crypto/oneTimeSecret.ts#L19) +[src/ts/crypto/oneTimeSecret.ts:19](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/crypto/oneTimeSecret.ts#L19) ___ @@ -572,7 +572,7 @@ Verifies and returns the ethereum address in EIP-55 format #### Defined in -[src/ts/utils/parseAddress.ts:9](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/utils/parseAddress.ts#L9) +[src/ts/utils/parseAddress.ts:9](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/utils/parseAddress.ts#L9) ___ @@ -594,7 +594,7 @@ ___ #### Defined in -[src/ts/utils/parseHex.ts:4](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/utils/parseHex.ts#L4) +[src/ts/utils/parseHex.ts:4](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/utils/parseHex.ts#L4) ___ @@ -615,7 +615,7 @@ ___ #### Defined in -[src/ts/utils/parseJwk.ts:6](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/utils/parseJwk.ts#L6) +[src/ts/utils/parseJwk.ts:6](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/utils/parseJwk.ts#L6) ▸ **parseJwk**(`jwk`, `stringify`): `Promise`<[`JWK`](interfaces/JWK.md)\> @@ -632,7 +632,7 @@ ___ #### Defined in -[src/ts/utils/parseJwk.ts:7](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/utils/parseJwk.ts#L7) +[src/ts/utils/parseJwk.ts:7](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/utils/parseJwk.ts#L7) ___ @@ -653,7 +653,7 @@ ___ #### Defined in -[src/ts/utils/sha.ts:5](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/utils/sha.ts#L5) +[src/ts/utils/sha.ts:5](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/utils/sha.ts#L5) ___ @@ -673,7 +673,7 @@ ___ #### Defined in -[src/ts/exchange/checkAgreement.ts:52](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/exchange/checkAgreement.ts#L52) +[src/ts/exchange/checkAgreement.ts:52](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/exchange/checkAgreement.ts#L52) ___ @@ -693,7 +693,7 @@ ___ #### Defined in -[src/ts/exchange/checkAgreement.ts:73](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/exchange/checkAgreement.ts#L73) +[src/ts/exchange/checkAgreement.ts:73](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/exchange/checkAgreement.ts#L73) ___ @@ -713,7 +713,7 @@ ___ #### Defined in -[src/ts/exchange/checkAgreement.ts:20](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/exchange/checkAgreement.ts#L20) +[src/ts/exchange/checkAgreement.ts:20](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/exchange/checkAgreement.ts#L20) ___ @@ -734,7 +734,7 @@ ___ #### Defined in -[src/ts/crypto/verifyKeyPair.ts:7](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/crypto/verifyKeyPair.ts#L7) +[src/ts/crypto/verifyKeyPair.ts:7](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/crypto/verifyKeyPair.ts#L7) ___ @@ -766,4 +766,4 @@ The JWT protected header and payload if the proof is validated #### Defined in -[src/ts/proofs/verifyProof.ts:29](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/proofs/verifyProof.ts#L29) +[src/ts/proofs/verifyProof.ts:29](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/proofs/verifyProof.ts#L29) diff --git a/docs/classes/ConflictResolution.ConflictResolver.md b/docs/classes/ConflictResolution.ConflictResolver.md index e6a6694..7a91236 100644 --- a/docs/classes/ConflictResolution.ConflictResolver.md +++ b/docs/classes/ConflictResolution.ConflictResolver.md @@ -38,7 +38,7 @@ The Conflict Resolver is an external entity that can: #### Defined in -[src/ts/conflict-resolution/ConflictResolver.ts:26](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/conflict-resolution/ConflictResolver.ts#L26) +[src/ts/conflict-resolution/ConflictResolver.ts:26](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/conflict-resolution/ConflictResolver.ts#L26) ## Properties @@ -48,7 +48,7 @@ The Conflict Resolver is an external entity that can: #### Defined in -[src/ts/conflict-resolution/ConflictResolver.ts:18](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/conflict-resolution/ConflictResolver.ts#L18) +[src/ts/conflict-resolution/ConflictResolver.ts:18](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/conflict-resolution/ConflictResolver.ts#L18) ___ @@ -58,7 +58,7 @@ ___ #### Defined in -[src/ts/conflict-resolution/ConflictResolver.ts:17](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/conflict-resolution/ConflictResolver.ts#L17) +[src/ts/conflict-resolution/ConflictResolver.ts:17](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/conflict-resolution/ConflictResolver.ts#L17) ## Methods @@ -82,7 +82,7 @@ a signed resolution #### Defined in -[src/ts/conflict-resolution/ConflictResolver.ts:52](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/conflict-resolution/ConflictResolver.ts#L52) +[src/ts/conflict-resolution/ConflictResolver.ts:52](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/conflict-resolution/ConflictResolver.ts#L52) ___ @@ -111,4 +111,4 @@ a signed resolution #### Defined in -[src/ts/conflict-resolution/ConflictResolver.ts:98](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/conflict-resolution/ConflictResolver.ts#L98) +[src/ts/conflict-resolution/ConflictResolver.ts:98](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/conflict-resolution/ConflictResolver.ts#L98) diff --git a/docs/classes/EthersIoAgentDest.md b/docs/classes/EthersIoAgentDest.md index ea501e9..e080234 100644 --- a/docs/classes/EthersIoAgentDest.md +++ b/docs/classes/EthersIoAgentDest.md @@ -48,7 +48,7 @@ EthersIoAgent.constructor #### Defined in -[src/ts/dlt/agents/EthersIoAgent.ts:15](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/EthersIoAgent.ts#L15) +[src/ts/dlt/agents/EthersIoAgent.ts:15](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/EthersIoAgent.ts#L15) ## Properties @@ -62,7 +62,7 @@ EthersIoAgent.contract #### Defined in -[src/ts/dlt/agents/EthersIoAgent.ts:11](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/EthersIoAgent.ts#L11) +[src/ts/dlt/agents/EthersIoAgent.ts:11](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/EthersIoAgent.ts#L11) ___ @@ -76,7 +76,7 @@ EthersIoAgent.dltConfig #### Defined in -[src/ts/dlt/agents/EthersIoAgent.ts:10](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/EthersIoAgent.ts#L10) +[src/ts/dlt/agents/EthersIoAgent.ts:10](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/EthersIoAgent.ts#L10) ___ @@ -90,7 +90,7 @@ EthersIoAgent.initialized #### Defined in -[src/ts/dlt/agents/EthersIoAgent.ts:13](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/EthersIoAgent.ts#L13) +[src/ts/dlt/agents/EthersIoAgent.ts:13](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/EthersIoAgent.ts#L13) ___ @@ -104,7 +104,7 @@ EthersIoAgent.provider #### Defined in -[src/ts/dlt/agents/EthersIoAgent.ts:12](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/EthersIoAgent.ts#L12) +[src/ts/dlt/agents/EthersIoAgent.ts:12](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/EthersIoAgent.ts#L12) ## Methods @@ -128,7 +128,7 @@ EthersIoAgent.getContractAddress #### Defined in -[src/ts/dlt/agents/EthersIoAgent.ts:43](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/EthersIoAgent.ts#L43) +[src/ts/dlt/agents/EthersIoAgent.ts:43](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/EthersIoAgent.ts#L43) ___ @@ -160,4 +160,4 @@ NrpDltAgentDest.getSecretFromLedger #### Defined in -[src/ts/dlt/agents/dest/EthersIoAgentDest.ts:9](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/dest/EthersIoAgentDest.ts#L9) +[src/ts/dlt/agents/dest/EthersIoAgentDest.ts:9](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/dest/EthersIoAgentDest.ts#L9) diff --git a/docs/classes/EthersIoAgentOrig.md b/docs/classes/EthersIoAgentOrig.md index 84a5a02..31de3e7 100644 --- a/docs/classes/EthersIoAgentOrig.md +++ b/docs/classes/EthersIoAgentOrig.md @@ -53,7 +53,7 @@ EthersIoAgent.constructor #### Defined in -[src/ts/dlt/agents/orig/EthersIoAgentOrig.ts:21](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/orig/EthersIoAgentOrig.ts#L21) +[src/ts/dlt/agents/orig/EthersIoAgentOrig.ts:21](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/orig/EthersIoAgentOrig.ts#L21) ## Properties @@ -67,7 +67,7 @@ EthersIoAgent.contract #### Defined in -[src/ts/dlt/agents/EthersIoAgent.ts:11](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/EthersIoAgent.ts#L11) +[src/ts/dlt/agents/EthersIoAgent.ts:11](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/EthersIoAgent.ts#L11) ___ @@ -79,7 +79,7 @@ The nonce of the next transaction to send to the blockchain. It keep track also #### Defined in -[src/ts/dlt/agents/orig/EthersIoAgentOrig.ts:19](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/orig/EthersIoAgentOrig.ts#L19) +[src/ts/dlt/agents/orig/EthersIoAgentOrig.ts:19](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/orig/EthersIoAgentOrig.ts#L19) ___ @@ -93,7 +93,7 @@ EthersIoAgent.dltConfig #### Defined in -[src/ts/dlt/agents/EthersIoAgent.ts:10](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/EthersIoAgent.ts#L10) +[src/ts/dlt/agents/EthersIoAgent.ts:10](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/EthersIoAgent.ts#L10) ___ @@ -107,7 +107,7 @@ EthersIoAgent.initialized #### Defined in -[src/ts/dlt/agents/EthersIoAgent.ts:13](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/EthersIoAgent.ts#L13) +[src/ts/dlt/agents/EthersIoAgent.ts:13](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/EthersIoAgent.ts#L13) ___ @@ -121,7 +121,7 @@ EthersIoAgent.provider #### Defined in -[src/ts/dlt/agents/EthersIoAgent.ts:12](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/EthersIoAgent.ts#L12) +[src/ts/dlt/agents/EthersIoAgent.ts:12](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/EthersIoAgent.ts#L12) ___ @@ -131,7 +131,7 @@ ___ #### Defined in -[src/ts/dlt/agents/orig/EthersIoAgentOrig.ts:14](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/orig/EthersIoAgentOrig.ts#L14) +[src/ts/dlt/agents/orig/EthersIoAgentOrig.ts:14](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/orig/EthersIoAgentOrig.ts#L14) ## Methods @@ -160,7 +160,7 @@ NrpDltAgentOrig.deploySecret #### Defined in -[src/ts/dlt/agents/orig/EthersIoAgentOrig.ts:43](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/orig/EthersIoAgentOrig.ts#L43) +[src/ts/dlt/agents/orig/EthersIoAgentOrig.ts:43](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/orig/EthersIoAgentOrig.ts#L43) ___ @@ -180,7 +180,7 @@ NrpDltAgentOrig.getAddress #### Defined in -[src/ts/dlt/agents/orig/EthersIoAgentOrig.ts:59](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/orig/EthersIoAgentOrig.ts#L59) +[src/ts/dlt/agents/orig/EthersIoAgentOrig.ts:59](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/orig/EthersIoAgentOrig.ts#L59) ___ @@ -204,7 +204,7 @@ EthersIoAgent.getContractAddress #### Defined in -[src/ts/dlt/agents/EthersIoAgent.ts:43](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/EthersIoAgent.ts#L43) +[src/ts/dlt/agents/EthersIoAgent.ts:43](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/EthersIoAgent.ts#L43) ___ @@ -224,4 +224,4 @@ NrpDltAgentOrig.nextNonce #### Defined in -[src/ts/dlt/agents/orig/EthersIoAgentOrig.ts:65](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/orig/EthersIoAgentOrig.ts#L65) +[src/ts/dlt/agents/orig/EthersIoAgentOrig.ts:65](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/orig/EthersIoAgentOrig.ts#L65) diff --git a/docs/classes/I3mServerWalletAgentDest.md b/docs/classes/I3mServerWalletAgentDest.md index c8d6673..4023858 100644 --- a/docs/classes/I3mServerWalletAgentDest.md +++ b/docs/classes/I3mServerWalletAgentDest.md @@ -52,7 +52,7 @@ I3mServerWalletAgent.constructor #### Defined in -[src/ts/dlt/agents/I3mServerWalletAgent.ts:12](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/I3mServerWalletAgent.ts#L12) +[src/ts/dlt/agents/I3mServerWalletAgent.ts:12](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/I3mServerWalletAgent.ts#L12) ## Properties @@ -66,7 +66,7 @@ I3mServerWalletAgent.contract #### Defined in -[src/ts/dlt/agents/EthersIoAgent.ts:11](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/EthersIoAgent.ts#L11) +[src/ts/dlt/agents/EthersIoAgent.ts:11](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/EthersIoAgent.ts#L11) ___ @@ -80,7 +80,7 @@ I3mServerWalletAgent.did #### Defined in -[src/ts/dlt/agents/I3mServerWalletAgent.ts:10](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/I3mServerWalletAgent.ts#L10) +[src/ts/dlt/agents/I3mServerWalletAgent.ts:10](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/I3mServerWalletAgent.ts#L10) ___ @@ -94,7 +94,7 @@ I3mServerWalletAgent.dltConfig #### Defined in -[src/ts/dlt/agents/EthersIoAgent.ts:10](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/EthersIoAgent.ts#L10) +[src/ts/dlt/agents/EthersIoAgent.ts:10](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/EthersIoAgent.ts#L10) ___ @@ -108,7 +108,7 @@ I3mServerWalletAgent.initialized #### Defined in -[src/ts/dlt/agents/EthersIoAgent.ts:13](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/EthersIoAgent.ts#L13) +[src/ts/dlt/agents/EthersIoAgent.ts:13](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/EthersIoAgent.ts#L13) ___ @@ -122,7 +122,7 @@ I3mServerWalletAgent.provider #### Defined in -[src/ts/dlt/agents/EthersIoAgent.ts:12](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/EthersIoAgent.ts#L12) +[src/ts/dlt/agents/EthersIoAgent.ts:12](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/EthersIoAgent.ts#L12) ___ @@ -136,7 +136,7 @@ I3mServerWalletAgent.wallet #### Defined in -[src/ts/dlt/agents/I3mServerWalletAgent.ts:9](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/I3mServerWalletAgent.ts#L9) +[src/ts/dlt/agents/I3mServerWalletAgent.ts:9](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/I3mServerWalletAgent.ts#L9) ## Methods @@ -160,7 +160,7 @@ I3mServerWalletAgent.getContractAddress #### Defined in -[src/ts/dlt/agents/EthersIoAgent.ts:43](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/EthersIoAgent.ts#L43) +[src/ts/dlt/agents/EthersIoAgent.ts:43](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/EthersIoAgent.ts#L43) ___ @@ -192,4 +192,4 @@ NrpDltAgentDest.getSecretFromLedger #### Defined in -[src/ts/dlt/agents/dest/I3mServerWalletAgentDest.ts:9](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/dest/I3mServerWalletAgentDest.ts#L9) +[src/ts/dlt/agents/dest/I3mServerWalletAgentDest.ts:9](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/dest/I3mServerWalletAgentDest.ts#L9) diff --git a/docs/classes/I3mServerWalletAgentOrig.md b/docs/classes/I3mServerWalletAgentOrig.md index 199de6c..25fc570 100644 --- a/docs/classes/I3mServerWalletAgentOrig.md +++ b/docs/classes/I3mServerWalletAgentOrig.md @@ -53,7 +53,7 @@ I3mServerWalletAgent.constructor #### Defined in -[src/ts/dlt/agents/I3mServerWalletAgent.ts:12](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/I3mServerWalletAgent.ts#L12) +[src/ts/dlt/agents/I3mServerWalletAgent.ts:12](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/I3mServerWalletAgent.ts#L12) ## Properties @@ -67,7 +67,7 @@ I3mServerWalletAgent.contract #### Defined in -[src/ts/dlt/agents/EthersIoAgent.ts:11](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/EthersIoAgent.ts#L11) +[src/ts/dlt/agents/EthersIoAgent.ts:11](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/EthersIoAgent.ts#L11) ___ @@ -79,7 +79,7 @@ The nonce of the next transaction to send to the blockchain. It keep track also #### Defined in -[src/ts/dlt/agents/orig/I3mServerWalletAgentOrig.ts:10](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/orig/I3mServerWalletAgentOrig.ts#L10) +[src/ts/dlt/agents/orig/I3mServerWalletAgentOrig.ts:10](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/orig/I3mServerWalletAgentOrig.ts#L10) ___ @@ -93,7 +93,7 @@ I3mServerWalletAgent.did #### Defined in -[src/ts/dlt/agents/I3mServerWalletAgent.ts:10](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/I3mServerWalletAgent.ts#L10) +[src/ts/dlt/agents/I3mServerWalletAgent.ts:10](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/I3mServerWalletAgent.ts#L10) ___ @@ -107,7 +107,7 @@ I3mServerWalletAgent.dltConfig #### Defined in -[src/ts/dlt/agents/EthersIoAgent.ts:10](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/EthersIoAgent.ts#L10) +[src/ts/dlt/agents/EthersIoAgent.ts:10](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/EthersIoAgent.ts#L10) ___ @@ -121,7 +121,7 @@ I3mServerWalletAgent.initialized #### Defined in -[src/ts/dlt/agents/EthersIoAgent.ts:13](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/EthersIoAgent.ts#L13) +[src/ts/dlt/agents/EthersIoAgent.ts:13](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/EthersIoAgent.ts#L13) ___ @@ -135,7 +135,7 @@ I3mServerWalletAgent.provider #### Defined in -[src/ts/dlt/agents/EthersIoAgent.ts:12](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/EthersIoAgent.ts#L12) +[src/ts/dlt/agents/EthersIoAgent.ts:12](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/EthersIoAgent.ts#L12) ___ @@ -149,7 +149,7 @@ I3mServerWalletAgent.wallet #### Defined in -[src/ts/dlt/agents/I3mServerWalletAgent.ts:9](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/I3mServerWalletAgent.ts#L9) +[src/ts/dlt/agents/I3mServerWalletAgent.ts:9](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/I3mServerWalletAgent.ts#L9) ## Methods @@ -178,7 +178,7 @@ NrpDltAgentOrig.deploySecret #### Defined in -[src/ts/dlt/agents/orig/I3mServerWalletAgentOrig.ts:12](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/orig/I3mServerWalletAgentOrig.ts#L12) +[src/ts/dlt/agents/orig/I3mServerWalletAgentOrig.ts:12](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/orig/I3mServerWalletAgentOrig.ts#L12) ___ @@ -198,7 +198,7 @@ NrpDltAgentOrig.getAddress #### Defined in -[src/ts/dlt/agents/orig/I3mServerWalletAgentOrig.ts:28](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/orig/I3mServerWalletAgentOrig.ts#L28) +[src/ts/dlt/agents/orig/I3mServerWalletAgentOrig.ts:28](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/orig/I3mServerWalletAgentOrig.ts#L28) ___ @@ -222,7 +222,7 @@ I3mServerWalletAgent.getContractAddress #### Defined in -[src/ts/dlt/agents/EthersIoAgent.ts:43](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/EthersIoAgent.ts#L43) +[src/ts/dlt/agents/EthersIoAgent.ts:43](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/EthersIoAgent.ts#L43) ___ @@ -242,4 +242,4 @@ NrpDltAgentOrig.nextNonce #### Defined in -[src/ts/dlt/agents/orig/I3mServerWalletAgentOrig.ts:38](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/orig/I3mServerWalletAgentOrig.ts#L38) +[src/ts/dlt/agents/orig/I3mServerWalletAgentOrig.ts:38](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/orig/I3mServerWalletAgentOrig.ts#L38) diff --git a/docs/classes/I3mWalletAgentDest.md b/docs/classes/I3mWalletAgentDest.md index a69ed53..e7eaaeb 100644 --- a/docs/classes/I3mWalletAgentDest.md +++ b/docs/classes/I3mWalletAgentDest.md @@ -52,7 +52,7 @@ I3mWalletAgent.constructor #### Defined in -[src/ts/dlt/agents/I3mWalletAgent.ts:12](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/I3mWalletAgent.ts#L12) +[src/ts/dlt/agents/I3mWalletAgent.ts:12](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/I3mWalletAgent.ts#L12) ## Properties @@ -66,7 +66,7 @@ I3mWalletAgent.contract #### Defined in -[src/ts/dlt/agents/EthersIoAgent.ts:11](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/EthersIoAgent.ts#L11) +[src/ts/dlt/agents/EthersIoAgent.ts:11](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/EthersIoAgent.ts#L11) ___ @@ -80,7 +80,7 @@ I3mWalletAgent.did #### Defined in -[src/ts/dlt/agents/I3mWalletAgent.ts:10](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/I3mWalletAgent.ts#L10) +[src/ts/dlt/agents/I3mWalletAgent.ts:10](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/I3mWalletAgent.ts#L10) ___ @@ -94,7 +94,7 @@ I3mWalletAgent.dltConfig #### Defined in -[src/ts/dlt/agents/EthersIoAgent.ts:10](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/EthersIoAgent.ts#L10) +[src/ts/dlt/agents/EthersIoAgent.ts:10](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/EthersIoAgent.ts#L10) ___ @@ -108,7 +108,7 @@ I3mWalletAgent.initialized #### Defined in -[src/ts/dlt/agents/EthersIoAgent.ts:13](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/EthersIoAgent.ts#L13) +[src/ts/dlt/agents/EthersIoAgent.ts:13](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/EthersIoAgent.ts#L13) ___ @@ -122,7 +122,7 @@ I3mWalletAgent.provider #### Defined in -[src/ts/dlt/agents/EthersIoAgent.ts:12](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/EthersIoAgent.ts#L12) +[src/ts/dlt/agents/EthersIoAgent.ts:12](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/EthersIoAgent.ts#L12) ___ @@ -136,7 +136,7 @@ I3mWalletAgent.wallet #### Defined in -[src/ts/dlt/agents/I3mWalletAgent.ts:9](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/I3mWalletAgent.ts#L9) +[src/ts/dlt/agents/I3mWalletAgent.ts:9](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/I3mWalletAgent.ts#L9) ## Methods @@ -160,7 +160,7 @@ I3mWalletAgent.getContractAddress #### Defined in -[src/ts/dlt/agents/EthersIoAgent.ts:43](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/EthersIoAgent.ts#L43) +[src/ts/dlt/agents/EthersIoAgent.ts:43](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/EthersIoAgent.ts#L43) ___ @@ -192,4 +192,4 @@ NrpDltAgentDest.getSecretFromLedger #### Defined in -[src/ts/dlt/agents/dest/I3mWalletAgentDest.ts:9](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/dest/I3mWalletAgentDest.ts#L9) +[src/ts/dlt/agents/dest/I3mWalletAgentDest.ts:9](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/dest/I3mWalletAgentDest.ts#L9) diff --git a/docs/classes/I3mWalletAgentOrig.md b/docs/classes/I3mWalletAgentOrig.md index b27f299..928a53c 100644 --- a/docs/classes/I3mWalletAgentOrig.md +++ b/docs/classes/I3mWalletAgentOrig.md @@ -55,7 +55,7 @@ I3mWalletAgent.constructor #### Defined in -[src/ts/dlt/agents/I3mWalletAgent.ts:12](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/I3mWalletAgent.ts#L12) +[src/ts/dlt/agents/I3mWalletAgent.ts:12](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/I3mWalletAgent.ts#L12) ## Properties @@ -69,7 +69,7 @@ I3mWalletAgent.contract #### Defined in -[src/ts/dlt/agents/EthersIoAgent.ts:11](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/EthersIoAgent.ts#L11) +[src/ts/dlt/agents/EthersIoAgent.ts:11](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/EthersIoAgent.ts#L11) ___ @@ -81,7 +81,7 @@ The nonce of the next transaction to send to the blockchain. It keep track also #### Defined in -[src/ts/dlt/agents/orig/I3mWalletAgentOrig.ts:13](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/orig/I3mWalletAgentOrig.ts#L13) +[src/ts/dlt/agents/orig/I3mWalletAgentOrig.ts:13](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/orig/I3mWalletAgentOrig.ts#L13) ___ @@ -95,7 +95,7 @@ I3mWalletAgent.did #### Defined in -[src/ts/dlt/agents/I3mWalletAgent.ts:10](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/I3mWalletAgent.ts#L10) +[src/ts/dlt/agents/I3mWalletAgent.ts:10](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/I3mWalletAgent.ts#L10) ___ @@ -109,7 +109,7 @@ I3mWalletAgent.dltConfig #### Defined in -[src/ts/dlt/agents/EthersIoAgent.ts:10](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/EthersIoAgent.ts#L10) +[src/ts/dlt/agents/EthersIoAgent.ts:10](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/EthersIoAgent.ts#L10) ___ @@ -123,7 +123,7 @@ I3mWalletAgent.initialized #### Defined in -[src/ts/dlt/agents/EthersIoAgent.ts:13](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/EthersIoAgent.ts#L13) +[src/ts/dlt/agents/EthersIoAgent.ts:13](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/EthersIoAgent.ts#L13) ___ @@ -137,7 +137,7 @@ I3mWalletAgent.provider #### Defined in -[src/ts/dlt/agents/EthersIoAgent.ts:12](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/EthersIoAgent.ts#L12) +[src/ts/dlt/agents/EthersIoAgent.ts:12](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/EthersIoAgent.ts#L12) ___ @@ -151,7 +151,7 @@ I3mWalletAgent.wallet #### Defined in -[src/ts/dlt/agents/I3mWalletAgent.ts:9](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/I3mWalletAgent.ts#L9) +[src/ts/dlt/agents/I3mWalletAgent.ts:9](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/I3mWalletAgent.ts#L9) ## Methods @@ -180,7 +180,7 @@ NrpDltAgentOrig.deploySecret #### Defined in -[src/ts/dlt/agents/orig/I3mWalletAgentOrig.ts:15](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/orig/I3mWalletAgentOrig.ts#L15) +[src/ts/dlt/agents/orig/I3mWalletAgentOrig.ts:15](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/orig/I3mWalletAgentOrig.ts#L15) ___ @@ -200,7 +200,7 @@ NrpDltAgentOrig.getAddress #### Defined in -[src/ts/dlt/agents/orig/I3mWalletAgentOrig.ts:36](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/orig/I3mWalletAgentOrig.ts#L36) +[src/ts/dlt/agents/orig/I3mWalletAgentOrig.ts:36](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/orig/I3mWalletAgentOrig.ts#L36) ___ @@ -224,7 +224,7 @@ I3mWalletAgent.getContractAddress #### Defined in -[src/ts/dlt/agents/EthersIoAgent.ts:43](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/EthersIoAgent.ts#L43) +[src/ts/dlt/agents/EthersIoAgent.ts:43](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/EthersIoAgent.ts#L43) ___ @@ -244,4 +244,4 @@ NrpDltAgentOrig.nextNonce #### Defined in -[src/ts/dlt/agents/orig/I3mWalletAgentOrig.ts:46](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/orig/I3mWalletAgentOrig.ts#L46) +[src/ts/dlt/agents/orig/I3mWalletAgentOrig.ts:46](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/orig/I3mWalletAgentOrig.ts#L46) diff --git a/docs/classes/NonRepudiationProtocol.NonRepudiationDest.md b/docs/classes/NonRepudiationProtocol.NonRepudiationDest.md index 7cbbb4d..97dc32a 100644 --- a/docs/classes/NonRepudiationProtocol.NonRepudiationDest.md +++ b/docs/classes/NonRepudiationProtocol.NonRepudiationDest.md @@ -48,7 +48,7 @@ likely to be a Consumer. #### Defined in -[src/ts/non-repudiation-protocol/NonRepudiationDest.ts:33](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/non-repudiation-protocol/NonRepudiationDest.ts#L33) +[src/ts/non-repudiation-protocol/NonRepudiationDest.ts:33](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/non-repudiation-protocol/NonRepudiationDest.ts#L33) ## Properties @@ -58,7 +58,7 @@ likely to be a Consumer. #### Defined in -[src/ts/non-repudiation-protocol/NonRepudiationDest.ts:20](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/non-repudiation-protocol/NonRepudiationDest.ts#L20) +[src/ts/non-repudiation-protocol/NonRepudiationDest.ts:20](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/non-repudiation-protocol/NonRepudiationDest.ts#L20) ___ @@ -68,7 +68,7 @@ ___ #### Defined in -[src/ts/non-repudiation-protocol/NonRepudiationDest.ts:24](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/non-repudiation-protocol/NonRepudiationDest.ts#L24) +[src/ts/non-repudiation-protocol/NonRepudiationDest.ts:24](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/non-repudiation-protocol/NonRepudiationDest.ts#L24) ___ @@ -78,7 +78,7 @@ ___ #### Defined in -[src/ts/non-repudiation-protocol/NonRepudiationDest.ts:25](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/non-repudiation-protocol/NonRepudiationDest.ts#L25) +[src/ts/non-repudiation-protocol/NonRepudiationDest.ts:25](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/non-repudiation-protocol/NonRepudiationDest.ts#L25) ___ @@ -88,7 +88,7 @@ ___ #### Defined in -[src/ts/non-repudiation-protocol/NonRepudiationDest.ts:21](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/non-repudiation-protocol/NonRepudiationDest.ts#L21) +[src/ts/non-repudiation-protocol/NonRepudiationDest.ts:21](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/non-repudiation-protocol/NonRepudiationDest.ts#L21) ___ @@ -98,7 +98,7 @@ ___ #### Defined in -[src/ts/non-repudiation-protocol/NonRepudiationDest.ts:26](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/non-repudiation-protocol/NonRepudiationDest.ts#L26) +[src/ts/non-repudiation-protocol/NonRepudiationDest.ts:26](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/non-repudiation-protocol/NonRepudiationDest.ts#L26) ___ @@ -108,7 +108,7 @@ ___ #### Defined in -[src/ts/non-repudiation-protocol/NonRepudiationDest.ts:22](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/non-repudiation-protocol/NonRepudiationDest.ts#L22) +[src/ts/non-repudiation-protocol/NonRepudiationDest.ts:22](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/non-repudiation-protocol/NonRepudiationDest.ts#L22) ___ @@ -118,7 +118,7 @@ ___ #### Defined in -[src/ts/non-repudiation-protocol/NonRepudiationDest.ts:23](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/non-repudiation-protocol/NonRepudiationDest.ts#L23) +[src/ts/non-repudiation-protocol/NonRepudiationDest.ts:23](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/non-repudiation-protocol/NonRepudiationDest.ts#L23) ## Methods @@ -136,7 +136,7 @@ the decrypted block #### Defined in -[src/ts/non-repudiation-protocol/NonRepudiationDest.ts:235](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/non-repudiation-protocol/NonRepudiationDest.ts#L235) +[src/ts/non-repudiation-protocol/NonRepudiationDest.ts:235](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/non-repudiation-protocol/NonRepudiationDest.ts#L235) ___ @@ -155,7 +155,7 @@ the dispute request as a compact JWS signed with 'dest's private key #### Defined in -[src/ts/non-repudiation-protocol/NonRepudiationDest.ts:280](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/non-repudiation-protocol/NonRepudiationDest.ts#L280) +[src/ts/non-repudiation-protocol/NonRepudiationDest.ts:280](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/non-repudiation-protocol/NonRepudiationDest.ts#L280) ___ @@ -174,7 +174,7 @@ the PoR as a compact JWS along with its decoded payload #### Defined in -[src/ts/non-repudiation-protocol/NonRepudiationDest.ts:138](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/non-repudiation-protocol/NonRepudiationDest.ts#L138) +[src/ts/non-repudiation-protocol/NonRepudiationDest.ts:138](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/non-repudiation-protocol/NonRepudiationDest.ts#L138) ___ @@ -193,7 +193,7 @@ the verification request as a compact JWS signed with 'dest's private key #### Defined in -[src/ts/non-repudiation-protocol/NonRepudiationDest.ts:264](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/non-repudiation-protocol/NonRepudiationDest.ts#L264) +[src/ts/non-repudiation-protocol/NonRepudiationDest.ts:264](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/non-repudiation-protocol/NonRepudiationDest.ts#L264) ___ @@ -212,7 +212,7 @@ the secret #### Defined in -[src/ts/non-repudiation-protocol/NonRepudiationDest.ts:208](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/non-repudiation-protocol/NonRepudiationDest.ts#L208) +[src/ts/non-repudiation-protocol/NonRepudiationDest.ts:208](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/non-repudiation-protocol/NonRepudiationDest.ts#L208) ___ @@ -239,7 +239,7 @@ the verified payload and protected header #### Defined in -[src/ts/non-repudiation-protocol/NonRepudiationDest.ts:85](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/non-repudiation-protocol/NonRepudiationDest.ts#L85) +[src/ts/non-repudiation-protocol/NonRepudiationDest.ts:85](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/non-repudiation-protocol/NonRepudiationDest.ts#L85) ___ @@ -264,4 +264,4 @@ the verified payload (that includes the secret that can be used to decrypt the c #### Defined in -[src/ts/non-repudiation-protocol/NonRepudiationDest.ts:163](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/non-repudiation-protocol/NonRepudiationDest.ts#L163) +[src/ts/non-repudiation-protocol/NonRepudiationDest.ts:163](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/non-repudiation-protocol/NonRepudiationDest.ts#L163) diff --git a/docs/classes/NonRepudiationProtocol.NonRepudiationOrig.md b/docs/classes/NonRepudiationProtocol.NonRepudiationOrig.md index da1d813..60c5388 100644 --- a/docs/classes/NonRepudiationProtocol.NonRepudiationOrig.md +++ b/docs/classes/NonRepudiationProtocol.NonRepudiationOrig.md @@ -46,7 +46,7 @@ likely to be a Provider. #### Defined in -[src/ts/non-repudiation-protocol/NonRepudiationOrig.ts:32](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/non-repudiation-protocol/NonRepudiationOrig.ts#L32) +[src/ts/non-repudiation-protocol/NonRepudiationOrig.ts:32](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/non-repudiation-protocol/NonRepudiationOrig.ts#L32) ## Properties @@ -56,7 +56,7 @@ likely to be a Provider. #### Defined in -[src/ts/non-repudiation-protocol/NonRepudiationOrig.ts:18](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/non-repudiation-protocol/NonRepudiationOrig.ts#L18) +[src/ts/non-repudiation-protocol/NonRepudiationOrig.ts:18](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/non-repudiation-protocol/NonRepudiationOrig.ts#L18) ___ @@ -66,7 +66,7 @@ ___ #### Defined in -[src/ts/non-repudiation-protocol/NonRepudiationOrig.ts:22](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/non-repudiation-protocol/NonRepudiationOrig.ts#L22) +[src/ts/non-repudiation-protocol/NonRepudiationOrig.ts:22](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/non-repudiation-protocol/NonRepudiationOrig.ts#L22) ___ @@ -76,7 +76,7 @@ ___ #### Defined in -[src/ts/non-repudiation-protocol/NonRepudiationOrig.ts:23](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/non-repudiation-protocol/NonRepudiationOrig.ts#L23) +[src/ts/non-repudiation-protocol/NonRepudiationOrig.ts:23](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/non-repudiation-protocol/NonRepudiationOrig.ts#L23) ___ @@ -86,7 +86,7 @@ ___ #### Defined in -[src/ts/non-repudiation-protocol/NonRepudiationOrig.ts:19](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/non-repudiation-protocol/NonRepudiationOrig.ts#L19) +[src/ts/non-repudiation-protocol/NonRepudiationOrig.ts:19](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/non-repudiation-protocol/NonRepudiationOrig.ts#L19) ___ @@ -96,7 +96,7 @@ ___ #### Defined in -[src/ts/non-repudiation-protocol/NonRepudiationOrig.ts:24](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/non-repudiation-protocol/NonRepudiationOrig.ts#L24) +[src/ts/non-repudiation-protocol/NonRepudiationOrig.ts:24](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/non-repudiation-protocol/NonRepudiationOrig.ts#L24) ___ @@ -106,7 +106,7 @@ ___ #### Defined in -[src/ts/non-repudiation-protocol/NonRepudiationOrig.ts:20](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/non-repudiation-protocol/NonRepudiationOrig.ts#L20) +[src/ts/non-repudiation-protocol/NonRepudiationOrig.ts:20](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/non-repudiation-protocol/NonRepudiationOrig.ts#L20) ___ @@ -116,7 +116,7 @@ ___ #### Defined in -[src/ts/non-repudiation-protocol/NonRepudiationOrig.ts:21](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/non-repudiation-protocol/NonRepudiationOrig.ts#L21) +[src/ts/non-repudiation-protocol/NonRepudiationOrig.ts:21](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/non-repudiation-protocol/NonRepudiationOrig.ts#L21) ## Methods @@ -135,7 +135,7 @@ a compact JWS with the PoO along with its decoded payload #### Defined in -[src/ts/non-repudiation-protocol/NonRepudiationOrig.ts:118](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/non-repudiation-protocol/NonRepudiationOrig.ts#L118) +[src/ts/non-repudiation-protocol/NonRepudiationOrig.ts:118](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/non-repudiation-protocol/NonRepudiationOrig.ts#L118) ___ @@ -154,7 +154,7 @@ a compact JWS with the PoP #### Defined in -[src/ts/non-repudiation-protocol/NonRepudiationOrig.ts:174](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/non-repudiation-protocol/NonRepudiationOrig.ts#L174) +[src/ts/non-repudiation-protocol/NonRepudiationOrig.ts:174](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/non-repudiation-protocol/NonRepudiationOrig.ts#L174) ___ @@ -173,7 +173,7 @@ the verification request as a compact JWS signed with 'orig's private key #### Defined in -[src/ts/non-repudiation-protocol/NonRepudiationOrig.ts:201](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/non-repudiation-protocol/NonRepudiationOrig.ts#L201) +[src/ts/non-repudiation-protocol/NonRepudiationOrig.ts:201](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/non-repudiation-protocol/NonRepudiationOrig.ts#L201) ___ @@ -199,4 +199,4 @@ the verified payload and protected header #### Defined in -[src/ts/non-repudiation-protocol/NonRepudiationOrig.ts:137](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/non-repudiation-protocol/NonRepudiationOrig.ts#L137) +[src/ts/non-repudiation-protocol/NonRepudiationOrig.ts:137](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/non-repudiation-protocol/NonRepudiationOrig.ts#L137) diff --git a/docs/classes/NrError.md b/docs/classes/NrError.md index 3ec0f44..fdd8a4b 100644 --- a/docs/classes/NrError.md +++ b/docs/classes/NrError.md @@ -45,7 +45,7 @@ Error.constructor #### Defined in -[src/ts/errors/NrError.ts:6](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/errors/NrError.ts#L6) +[src/ts/errors/NrError.ts:6](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/errors/NrError.ts#L6) ## Properties @@ -83,7 +83,7 @@ ___ #### Defined in -[src/ts/errors/NrError.ts:4](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/errors/NrError.ts#L4) +[src/ts/errors/NrError.ts:4](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/errors/NrError.ts#L4) ___ @@ -166,7 +166,7 @@ node_modules/@types/node/globals.d.ts:13 #### Defined in -[src/ts/errors/NrError.ts:16](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/errors/NrError.ts#L16) +[src/ts/errors/NrError.ts:16](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/errors/NrError.ts#L16) ___ diff --git a/docs/classes/Signers.EthersIoAgentDest.md b/docs/classes/Signers.EthersIoAgentDest.md index efe0fe4..b793633 100644 --- a/docs/classes/Signers.EthersIoAgentDest.md +++ b/docs/classes/Signers.EthersIoAgentDest.md @@ -50,7 +50,7 @@ EthersIoAgent.constructor #### Defined in -[src/ts/dlt/agents/EthersIoAgent.ts:15](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/EthersIoAgent.ts#L15) +[src/ts/dlt/agents/EthersIoAgent.ts:15](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/EthersIoAgent.ts#L15) ## Properties @@ -64,7 +64,7 @@ EthersIoAgent.contract #### Defined in -[src/ts/dlt/agents/EthersIoAgent.ts:11](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/EthersIoAgent.ts#L11) +[src/ts/dlt/agents/EthersIoAgent.ts:11](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/EthersIoAgent.ts#L11) ___ @@ -78,7 +78,7 @@ EthersIoAgent.dltConfig #### Defined in -[src/ts/dlt/agents/EthersIoAgent.ts:10](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/EthersIoAgent.ts#L10) +[src/ts/dlt/agents/EthersIoAgent.ts:10](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/EthersIoAgent.ts#L10) ___ @@ -92,7 +92,7 @@ EthersIoAgent.initialized #### Defined in -[src/ts/dlt/agents/EthersIoAgent.ts:13](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/EthersIoAgent.ts#L13) +[src/ts/dlt/agents/EthersIoAgent.ts:13](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/EthersIoAgent.ts#L13) ___ @@ -106,7 +106,7 @@ EthersIoAgent.provider #### Defined in -[src/ts/dlt/agents/EthersIoAgent.ts:12](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/EthersIoAgent.ts#L12) +[src/ts/dlt/agents/EthersIoAgent.ts:12](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/EthersIoAgent.ts#L12) ## Methods @@ -130,7 +130,7 @@ EthersIoAgent.getContractAddress #### Defined in -[src/ts/dlt/agents/EthersIoAgent.ts:43](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/EthersIoAgent.ts#L43) +[src/ts/dlt/agents/EthersIoAgent.ts:43](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/EthersIoAgent.ts#L43) ___ @@ -162,4 +162,4 @@ NrpDltAgentDest.getSecretFromLedger #### Defined in -[src/ts/dlt/agents/dest/EthersIoAgentDest.ts:9](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/dest/EthersIoAgentDest.ts#L9) +[src/ts/dlt/agents/dest/EthersIoAgentDest.ts:9](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/dest/EthersIoAgentDest.ts#L9) diff --git a/docs/classes/Signers.EthersIoAgentOrig.md b/docs/classes/Signers.EthersIoAgentOrig.md index 770b6d8..972960d 100644 --- a/docs/classes/Signers.EthersIoAgentOrig.md +++ b/docs/classes/Signers.EthersIoAgentOrig.md @@ -55,7 +55,7 @@ EthersIoAgent.constructor #### Defined in -[src/ts/dlt/agents/orig/EthersIoAgentOrig.ts:21](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/orig/EthersIoAgentOrig.ts#L21) +[src/ts/dlt/agents/orig/EthersIoAgentOrig.ts:21](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/orig/EthersIoAgentOrig.ts#L21) ## Properties @@ -69,7 +69,7 @@ EthersIoAgent.contract #### Defined in -[src/ts/dlt/agents/EthersIoAgent.ts:11](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/EthersIoAgent.ts#L11) +[src/ts/dlt/agents/EthersIoAgent.ts:11](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/EthersIoAgent.ts#L11) ___ @@ -81,7 +81,7 @@ The nonce of the next transaction to send to the blockchain. It keep track also #### Defined in -[src/ts/dlt/agents/orig/EthersIoAgentOrig.ts:19](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/orig/EthersIoAgentOrig.ts#L19) +[src/ts/dlt/agents/orig/EthersIoAgentOrig.ts:19](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/orig/EthersIoAgentOrig.ts#L19) ___ @@ -95,7 +95,7 @@ EthersIoAgent.dltConfig #### Defined in -[src/ts/dlt/agents/EthersIoAgent.ts:10](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/EthersIoAgent.ts#L10) +[src/ts/dlt/agents/EthersIoAgent.ts:10](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/EthersIoAgent.ts#L10) ___ @@ -109,7 +109,7 @@ EthersIoAgent.initialized #### Defined in -[src/ts/dlt/agents/EthersIoAgent.ts:13](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/EthersIoAgent.ts#L13) +[src/ts/dlt/agents/EthersIoAgent.ts:13](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/EthersIoAgent.ts#L13) ___ @@ -123,7 +123,7 @@ EthersIoAgent.provider #### Defined in -[src/ts/dlt/agents/EthersIoAgent.ts:12](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/EthersIoAgent.ts#L12) +[src/ts/dlt/agents/EthersIoAgent.ts:12](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/EthersIoAgent.ts#L12) ___ @@ -133,7 +133,7 @@ ___ #### Defined in -[src/ts/dlt/agents/orig/EthersIoAgentOrig.ts:14](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/orig/EthersIoAgentOrig.ts#L14) +[src/ts/dlt/agents/orig/EthersIoAgentOrig.ts:14](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/orig/EthersIoAgentOrig.ts#L14) ## Methods @@ -162,7 +162,7 @@ NrpDltAgentOrig.deploySecret #### Defined in -[src/ts/dlt/agents/orig/EthersIoAgentOrig.ts:43](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/orig/EthersIoAgentOrig.ts#L43) +[src/ts/dlt/agents/orig/EthersIoAgentOrig.ts:43](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/orig/EthersIoAgentOrig.ts#L43) ___ @@ -182,7 +182,7 @@ NrpDltAgentOrig.getAddress #### Defined in -[src/ts/dlt/agents/orig/EthersIoAgentOrig.ts:59](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/orig/EthersIoAgentOrig.ts#L59) +[src/ts/dlt/agents/orig/EthersIoAgentOrig.ts:59](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/orig/EthersIoAgentOrig.ts#L59) ___ @@ -206,7 +206,7 @@ EthersIoAgent.getContractAddress #### Defined in -[src/ts/dlt/agents/EthersIoAgent.ts:43](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/EthersIoAgent.ts#L43) +[src/ts/dlt/agents/EthersIoAgent.ts:43](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/EthersIoAgent.ts#L43) ___ @@ -226,4 +226,4 @@ NrpDltAgentOrig.nextNonce #### Defined in -[src/ts/dlt/agents/orig/EthersIoAgentOrig.ts:65](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/orig/EthersIoAgentOrig.ts#L65) +[src/ts/dlt/agents/orig/EthersIoAgentOrig.ts:65](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/orig/EthersIoAgentOrig.ts#L65) diff --git a/docs/classes/Signers.I3mServerWalletAgentDest.md b/docs/classes/Signers.I3mServerWalletAgentDest.md index e2ef2c7..c35486d 100644 --- a/docs/classes/Signers.I3mServerWalletAgentDest.md +++ b/docs/classes/Signers.I3mServerWalletAgentDest.md @@ -54,7 +54,7 @@ I3mServerWalletAgent.constructor #### Defined in -[src/ts/dlt/agents/I3mServerWalletAgent.ts:12](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/I3mServerWalletAgent.ts#L12) +[src/ts/dlt/agents/I3mServerWalletAgent.ts:12](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/I3mServerWalletAgent.ts#L12) ## Properties @@ -68,7 +68,7 @@ I3mServerWalletAgent.contract #### Defined in -[src/ts/dlt/agents/EthersIoAgent.ts:11](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/EthersIoAgent.ts#L11) +[src/ts/dlt/agents/EthersIoAgent.ts:11](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/EthersIoAgent.ts#L11) ___ @@ -82,7 +82,7 @@ I3mServerWalletAgent.did #### Defined in -[src/ts/dlt/agents/I3mServerWalletAgent.ts:10](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/I3mServerWalletAgent.ts#L10) +[src/ts/dlt/agents/I3mServerWalletAgent.ts:10](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/I3mServerWalletAgent.ts#L10) ___ @@ -96,7 +96,7 @@ I3mServerWalletAgent.dltConfig #### Defined in -[src/ts/dlt/agents/EthersIoAgent.ts:10](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/EthersIoAgent.ts#L10) +[src/ts/dlt/agents/EthersIoAgent.ts:10](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/EthersIoAgent.ts#L10) ___ @@ -110,7 +110,7 @@ I3mServerWalletAgent.initialized #### Defined in -[src/ts/dlt/agents/EthersIoAgent.ts:13](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/EthersIoAgent.ts#L13) +[src/ts/dlt/agents/EthersIoAgent.ts:13](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/EthersIoAgent.ts#L13) ___ @@ -124,7 +124,7 @@ I3mServerWalletAgent.provider #### Defined in -[src/ts/dlt/agents/EthersIoAgent.ts:12](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/EthersIoAgent.ts#L12) +[src/ts/dlt/agents/EthersIoAgent.ts:12](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/EthersIoAgent.ts#L12) ___ @@ -138,7 +138,7 @@ I3mServerWalletAgent.wallet #### Defined in -[src/ts/dlt/agents/I3mServerWalletAgent.ts:9](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/I3mServerWalletAgent.ts#L9) +[src/ts/dlt/agents/I3mServerWalletAgent.ts:9](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/I3mServerWalletAgent.ts#L9) ## Methods @@ -162,7 +162,7 @@ I3mServerWalletAgent.getContractAddress #### Defined in -[src/ts/dlt/agents/EthersIoAgent.ts:43](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/EthersIoAgent.ts#L43) +[src/ts/dlt/agents/EthersIoAgent.ts:43](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/EthersIoAgent.ts#L43) ___ @@ -194,4 +194,4 @@ NrpDltAgentDest.getSecretFromLedger #### Defined in -[src/ts/dlt/agents/dest/I3mServerWalletAgentDest.ts:9](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/dest/I3mServerWalletAgentDest.ts#L9) +[src/ts/dlt/agents/dest/I3mServerWalletAgentDest.ts:9](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/dest/I3mServerWalletAgentDest.ts#L9) diff --git a/docs/classes/Signers.I3mServerWalletAgentOrig.md b/docs/classes/Signers.I3mServerWalletAgentOrig.md index 487db71..78346da 100644 --- a/docs/classes/Signers.I3mServerWalletAgentOrig.md +++ b/docs/classes/Signers.I3mServerWalletAgentOrig.md @@ -55,7 +55,7 @@ I3mServerWalletAgent.constructor #### Defined in -[src/ts/dlt/agents/I3mServerWalletAgent.ts:12](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/I3mServerWalletAgent.ts#L12) +[src/ts/dlt/agents/I3mServerWalletAgent.ts:12](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/I3mServerWalletAgent.ts#L12) ## Properties @@ -69,7 +69,7 @@ I3mServerWalletAgent.contract #### Defined in -[src/ts/dlt/agents/EthersIoAgent.ts:11](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/EthersIoAgent.ts#L11) +[src/ts/dlt/agents/EthersIoAgent.ts:11](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/EthersIoAgent.ts#L11) ___ @@ -81,7 +81,7 @@ The nonce of the next transaction to send to the blockchain. It keep track also #### Defined in -[src/ts/dlt/agents/orig/I3mServerWalletAgentOrig.ts:10](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/orig/I3mServerWalletAgentOrig.ts#L10) +[src/ts/dlt/agents/orig/I3mServerWalletAgentOrig.ts:10](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/orig/I3mServerWalletAgentOrig.ts#L10) ___ @@ -95,7 +95,7 @@ I3mServerWalletAgent.did #### Defined in -[src/ts/dlt/agents/I3mServerWalletAgent.ts:10](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/I3mServerWalletAgent.ts#L10) +[src/ts/dlt/agents/I3mServerWalletAgent.ts:10](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/I3mServerWalletAgent.ts#L10) ___ @@ -109,7 +109,7 @@ I3mServerWalletAgent.dltConfig #### Defined in -[src/ts/dlt/agents/EthersIoAgent.ts:10](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/EthersIoAgent.ts#L10) +[src/ts/dlt/agents/EthersIoAgent.ts:10](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/EthersIoAgent.ts#L10) ___ @@ -123,7 +123,7 @@ I3mServerWalletAgent.initialized #### Defined in -[src/ts/dlt/agents/EthersIoAgent.ts:13](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/EthersIoAgent.ts#L13) +[src/ts/dlt/agents/EthersIoAgent.ts:13](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/EthersIoAgent.ts#L13) ___ @@ -137,7 +137,7 @@ I3mServerWalletAgent.provider #### Defined in -[src/ts/dlt/agents/EthersIoAgent.ts:12](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/EthersIoAgent.ts#L12) +[src/ts/dlt/agents/EthersIoAgent.ts:12](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/EthersIoAgent.ts#L12) ___ @@ -151,7 +151,7 @@ I3mServerWalletAgent.wallet #### Defined in -[src/ts/dlt/agents/I3mServerWalletAgent.ts:9](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/I3mServerWalletAgent.ts#L9) +[src/ts/dlt/agents/I3mServerWalletAgent.ts:9](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/I3mServerWalletAgent.ts#L9) ## Methods @@ -180,7 +180,7 @@ NrpDltAgentOrig.deploySecret #### Defined in -[src/ts/dlt/agents/orig/I3mServerWalletAgentOrig.ts:12](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/orig/I3mServerWalletAgentOrig.ts#L12) +[src/ts/dlt/agents/orig/I3mServerWalletAgentOrig.ts:12](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/orig/I3mServerWalletAgentOrig.ts#L12) ___ @@ -200,7 +200,7 @@ NrpDltAgentOrig.getAddress #### Defined in -[src/ts/dlt/agents/orig/I3mServerWalletAgentOrig.ts:28](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/orig/I3mServerWalletAgentOrig.ts#L28) +[src/ts/dlt/agents/orig/I3mServerWalletAgentOrig.ts:28](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/orig/I3mServerWalletAgentOrig.ts#L28) ___ @@ -224,7 +224,7 @@ I3mServerWalletAgent.getContractAddress #### Defined in -[src/ts/dlt/agents/EthersIoAgent.ts:43](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/EthersIoAgent.ts#L43) +[src/ts/dlt/agents/EthersIoAgent.ts:43](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/EthersIoAgent.ts#L43) ___ @@ -244,4 +244,4 @@ NrpDltAgentOrig.nextNonce #### Defined in -[src/ts/dlt/agents/orig/I3mServerWalletAgentOrig.ts:38](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/orig/I3mServerWalletAgentOrig.ts#L38) +[src/ts/dlt/agents/orig/I3mServerWalletAgentOrig.ts:38](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/orig/I3mServerWalletAgentOrig.ts#L38) diff --git a/docs/classes/Signers.I3mWalletAgentDest.md b/docs/classes/Signers.I3mWalletAgentDest.md index dfef49e..df0479a 100644 --- a/docs/classes/Signers.I3mWalletAgentDest.md +++ b/docs/classes/Signers.I3mWalletAgentDest.md @@ -54,7 +54,7 @@ I3mWalletAgent.constructor #### Defined in -[src/ts/dlt/agents/I3mWalletAgent.ts:12](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/I3mWalletAgent.ts#L12) +[src/ts/dlt/agents/I3mWalletAgent.ts:12](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/I3mWalletAgent.ts#L12) ## Properties @@ -68,7 +68,7 @@ I3mWalletAgent.contract #### Defined in -[src/ts/dlt/agents/EthersIoAgent.ts:11](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/EthersIoAgent.ts#L11) +[src/ts/dlt/agents/EthersIoAgent.ts:11](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/EthersIoAgent.ts#L11) ___ @@ -82,7 +82,7 @@ I3mWalletAgent.did #### Defined in -[src/ts/dlt/agents/I3mWalletAgent.ts:10](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/I3mWalletAgent.ts#L10) +[src/ts/dlt/agents/I3mWalletAgent.ts:10](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/I3mWalletAgent.ts#L10) ___ @@ -96,7 +96,7 @@ I3mWalletAgent.dltConfig #### Defined in -[src/ts/dlt/agents/EthersIoAgent.ts:10](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/EthersIoAgent.ts#L10) +[src/ts/dlt/agents/EthersIoAgent.ts:10](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/EthersIoAgent.ts#L10) ___ @@ -110,7 +110,7 @@ I3mWalletAgent.initialized #### Defined in -[src/ts/dlt/agents/EthersIoAgent.ts:13](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/EthersIoAgent.ts#L13) +[src/ts/dlt/agents/EthersIoAgent.ts:13](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/EthersIoAgent.ts#L13) ___ @@ -124,7 +124,7 @@ I3mWalletAgent.provider #### Defined in -[src/ts/dlt/agents/EthersIoAgent.ts:12](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/EthersIoAgent.ts#L12) +[src/ts/dlt/agents/EthersIoAgent.ts:12](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/EthersIoAgent.ts#L12) ___ @@ -138,7 +138,7 @@ I3mWalletAgent.wallet #### Defined in -[src/ts/dlt/agents/I3mWalletAgent.ts:9](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/I3mWalletAgent.ts#L9) +[src/ts/dlt/agents/I3mWalletAgent.ts:9](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/I3mWalletAgent.ts#L9) ## Methods @@ -162,7 +162,7 @@ I3mWalletAgent.getContractAddress #### Defined in -[src/ts/dlt/agents/EthersIoAgent.ts:43](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/EthersIoAgent.ts#L43) +[src/ts/dlt/agents/EthersIoAgent.ts:43](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/EthersIoAgent.ts#L43) ___ @@ -194,4 +194,4 @@ NrpDltAgentDest.getSecretFromLedger #### Defined in -[src/ts/dlt/agents/dest/I3mWalletAgentDest.ts:9](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/dest/I3mWalletAgentDest.ts#L9) +[src/ts/dlt/agents/dest/I3mWalletAgentDest.ts:9](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/dest/I3mWalletAgentDest.ts#L9) diff --git a/docs/classes/Signers.I3mWalletAgentOrig.md b/docs/classes/Signers.I3mWalletAgentOrig.md index fb35740..6ee40bb 100644 --- a/docs/classes/Signers.I3mWalletAgentOrig.md +++ b/docs/classes/Signers.I3mWalletAgentOrig.md @@ -57,7 +57,7 @@ I3mWalletAgent.constructor #### Defined in -[src/ts/dlt/agents/I3mWalletAgent.ts:12](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/I3mWalletAgent.ts#L12) +[src/ts/dlt/agents/I3mWalletAgent.ts:12](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/I3mWalletAgent.ts#L12) ## Properties @@ -71,7 +71,7 @@ I3mWalletAgent.contract #### Defined in -[src/ts/dlt/agents/EthersIoAgent.ts:11](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/EthersIoAgent.ts#L11) +[src/ts/dlt/agents/EthersIoAgent.ts:11](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/EthersIoAgent.ts#L11) ___ @@ -83,7 +83,7 @@ The nonce of the next transaction to send to the blockchain. It keep track also #### Defined in -[src/ts/dlt/agents/orig/I3mWalletAgentOrig.ts:13](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/orig/I3mWalletAgentOrig.ts#L13) +[src/ts/dlt/agents/orig/I3mWalletAgentOrig.ts:13](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/orig/I3mWalletAgentOrig.ts#L13) ___ @@ -97,7 +97,7 @@ I3mWalletAgent.did #### Defined in -[src/ts/dlt/agents/I3mWalletAgent.ts:10](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/I3mWalletAgent.ts#L10) +[src/ts/dlt/agents/I3mWalletAgent.ts:10](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/I3mWalletAgent.ts#L10) ___ @@ -111,7 +111,7 @@ I3mWalletAgent.dltConfig #### Defined in -[src/ts/dlt/agents/EthersIoAgent.ts:10](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/EthersIoAgent.ts#L10) +[src/ts/dlt/agents/EthersIoAgent.ts:10](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/EthersIoAgent.ts#L10) ___ @@ -125,7 +125,7 @@ I3mWalletAgent.initialized #### Defined in -[src/ts/dlt/agents/EthersIoAgent.ts:13](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/EthersIoAgent.ts#L13) +[src/ts/dlt/agents/EthersIoAgent.ts:13](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/EthersIoAgent.ts#L13) ___ @@ -139,7 +139,7 @@ I3mWalletAgent.provider #### Defined in -[src/ts/dlt/agents/EthersIoAgent.ts:12](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/EthersIoAgent.ts#L12) +[src/ts/dlt/agents/EthersIoAgent.ts:12](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/EthersIoAgent.ts#L12) ___ @@ -153,7 +153,7 @@ I3mWalletAgent.wallet #### Defined in -[src/ts/dlt/agents/I3mWalletAgent.ts:9](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/I3mWalletAgent.ts#L9) +[src/ts/dlt/agents/I3mWalletAgent.ts:9](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/I3mWalletAgent.ts#L9) ## Methods @@ -182,7 +182,7 @@ NrpDltAgentOrig.deploySecret #### Defined in -[src/ts/dlt/agents/orig/I3mWalletAgentOrig.ts:15](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/orig/I3mWalletAgentOrig.ts#L15) +[src/ts/dlt/agents/orig/I3mWalletAgentOrig.ts:15](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/orig/I3mWalletAgentOrig.ts#L15) ___ @@ -202,7 +202,7 @@ NrpDltAgentOrig.getAddress #### Defined in -[src/ts/dlt/agents/orig/I3mWalletAgentOrig.ts:36](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/orig/I3mWalletAgentOrig.ts#L36) +[src/ts/dlt/agents/orig/I3mWalletAgentOrig.ts:36](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/orig/I3mWalletAgentOrig.ts#L36) ___ @@ -226,7 +226,7 @@ I3mWalletAgent.getContractAddress #### Defined in -[src/ts/dlt/agents/EthersIoAgent.ts:43](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/EthersIoAgent.ts#L43) +[src/ts/dlt/agents/EthersIoAgent.ts:43](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/EthersIoAgent.ts#L43) ___ @@ -246,4 +246,4 @@ NrpDltAgentOrig.nextNonce #### Defined in -[src/ts/dlt/agents/orig/I3mWalletAgentOrig.ts:46](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/orig/I3mWalletAgentOrig.ts#L46) +[src/ts/dlt/agents/orig/I3mWalletAgentOrig.ts:46](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/orig/I3mWalletAgentOrig.ts#L46) diff --git a/docs/interfaces/Algs.md b/docs/interfaces/Algs.md index 6a28a0c..00ba9cf 100644 --- a/docs/interfaces/Algs.md +++ b/docs/interfaces/Algs.md @@ -16,7 +16,7 @@ #### Defined in -[src/ts/types.ts:20](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L20) +[src/ts/types.ts:21](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L21) ___ @@ -26,7 +26,7 @@ ___ #### Defined in -[src/ts/types.ts:19](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L19) +[src/ts/types.ts:20](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L20) ___ @@ -36,4 +36,4 @@ ___ #### Defined in -[src/ts/types.ts:18](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L18) +[src/ts/types.ts:19](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L19) diff --git a/docs/interfaces/Block.md b/docs/interfaces/Block.md index 527afe8..de51113 100644 --- a/docs/interfaces/Block.md +++ b/docs/interfaces/Block.md @@ -25,7 +25,7 @@ #### Defined in -[src/ts/types.ts:45](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L45) +[src/ts/types.ts:46](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L46) ___ @@ -35,7 +35,7 @@ ___ #### Defined in -[src/ts/types.ts:50](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L50) +[src/ts/types.ts:51](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L51) ___ @@ -45,7 +45,7 @@ ___ #### Defined in -[src/ts/types.ts:52](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L52) +[src/ts/types.ts:53](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L53) ___ @@ -55,7 +55,7 @@ ___ #### Defined in -[src/ts/types.ts:51](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L51) +[src/ts/types.ts:52](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L52) ___ @@ -65,7 +65,7 @@ ___ #### Defined in -[src/ts/types.ts:44](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L44) +[src/ts/types.ts:45](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L45) ___ @@ -82,4 +82,4 @@ ___ #### Defined in -[src/ts/types.ts:46](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L46) +[src/ts/types.ts:47](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L47) diff --git a/docs/interfaces/ConflictResolutionRequestPayload.md b/docs/interfaces/ConflictResolutionRequestPayload.md index 21b9a20..a5e06c6 100644 --- a/docs/interfaces/ConflictResolutionRequestPayload.md +++ b/docs/interfaces/ConflictResolutionRequestPayload.md @@ -28,7 +28,7 @@ #### Defined in -[src/ts/types.ts:137](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L137) +[src/ts/types.ts:138](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L138) ___ @@ -42,7 +42,7 @@ ___ #### Defined in -[src/ts/types.ts:135](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L135) +[src/ts/types.ts:136](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L136) ___ @@ -56,7 +56,7 @@ ___ #### Defined in -[src/ts/types.ts:134](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L134) +[src/ts/types.ts:135](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L135) ___ @@ -66,7 +66,7 @@ ___ #### Defined in -[src/ts/types.ts:136](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L136) +[src/ts/types.ts:137](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L137) ___ @@ -80,4 +80,4 @@ ___ #### Defined in -[src/ts/types.ts:133](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L133) +[src/ts/types.ts:134](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L134) diff --git a/docs/interfaces/ContractConfig.md b/docs/interfaces/ContractConfig.md index bc56270..5df560e 100644 --- a/docs/interfaces/ContractConfig.md +++ b/docs/interfaces/ContractConfig.md @@ -15,7 +15,7 @@ #### Defined in -[src/ts/types.ts:29](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L29) +[src/ts/types.ts:30](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L30) ___ @@ -25,4 +25,4 @@ ___ #### Defined in -[src/ts/types.ts:28](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L28) +[src/ts/types.ts:29](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L29) diff --git a/docs/interfaces/DataExchange.md b/docs/interfaces/DataExchange.md index 1583d0b..317acf9 100644 --- a/docs/interfaces/DataExchange.md +++ b/docs/interfaces/DataExchange.md @@ -118,7 +118,7 @@ ___ #### Defined in -[src/ts/types.ts:89](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L89) +[src/ts/types.ts:90](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L90) ___ diff --git a/docs/interfaces/DecodedProof.md b/docs/interfaces/DecodedProof.md index c17a1ab..f9b79fd 100644 --- a/docs/interfaces/DecodedProof.md +++ b/docs/interfaces/DecodedProof.md @@ -22,7 +22,7 @@ #### Defined in -[src/ts/types.ts:171](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L171) +[src/ts/types.ts:172](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L172) ___ @@ -32,7 +32,7 @@ ___ #### Defined in -[src/ts/types.ts:172](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L172) +[src/ts/types.ts:173](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L173) ___ @@ -42,4 +42,4 @@ ___ #### Defined in -[src/ts/types.ts:173](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L173) +[src/ts/types.ts:174](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L174) diff --git a/docs/interfaces/DisputeRequestPayload.md b/docs/interfaces/DisputeRequestPayload.md index 6dfb6be..6425146 100644 --- a/docs/interfaces/DisputeRequestPayload.md +++ b/docs/interfaces/DisputeRequestPayload.md @@ -26,7 +26,7 @@ #### Defined in -[src/ts/types.ts:147](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L147) +[src/ts/types.ts:148](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L148) ___ @@ -40,7 +40,7 @@ ___ #### Defined in -[src/ts/types.ts:137](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L137) +[src/ts/types.ts:138](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L138) ___ @@ -54,7 +54,7 @@ ___ #### Defined in -[src/ts/types.ts:135](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L135) +[src/ts/types.ts:136](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L136) ___ @@ -68,7 +68,7 @@ ___ #### Defined in -[src/ts/types.ts:146](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L146) +[src/ts/types.ts:147](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L147) ___ @@ -82,7 +82,7 @@ ___ #### Defined in -[src/ts/types.ts:136](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L136) +[src/ts/types.ts:137](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L137) ___ @@ -96,7 +96,7 @@ ___ #### Defined in -[src/ts/types.ts:133](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L133) +[src/ts/types.ts:134](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L134) ___ @@ -106,4 +106,4 @@ ___ #### Defined in -[src/ts/types.ts:145](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L145) +[src/ts/types.ts:146](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L146) diff --git a/docs/interfaces/DisputeResolutionPayload.md b/docs/interfaces/DisputeResolutionPayload.md index 18be292..b4259b5 100644 --- a/docs/interfaces/DisputeResolutionPayload.md +++ b/docs/interfaces/DisputeResolutionPayload.md @@ -30,7 +30,7 @@ #### Defined in -[src/ts/types.ts:154](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L154) +[src/ts/types.ts:155](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L155) ___ @@ -44,7 +44,7 @@ ___ #### Defined in -[src/ts/types.ts:155](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L155) +[src/ts/types.ts:156](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L156) ___ @@ -58,7 +58,7 @@ ___ #### Defined in -[src/ts/types.ts:156](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L156) +[src/ts/types.ts:157](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L157) ___ @@ -72,7 +72,7 @@ ___ #### Defined in -[src/ts/types.ts:151](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L151) +[src/ts/types.ts:152](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L152) ___ @@ -86,7 +86,7 @@ ___ #### Defined in -[src/ts/types.ts:167](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L167) +[src/ts/types.ts:168](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L168) ___ @@ -100,7 +100,7 @@ ___ #### Defined in -[src/ts/types.ts:157](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L157) +[src/ts/types.ts:158](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L158) ___ @@ -114,4 +114,4 @@ ___ #### Defined in -[src/ts/types.ts:166](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L166) +[src/ts/types.ts:167](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L167) diff --git a/docs/interfaces/DltConfig.md b/docs/interfaces/DltConfig.md index aa4a72d..13e807a 100644 --- a/docs/interfaces/DltConfig.md +++ b/docs/interfaces/DltConfig.md @@ -16,7 +16,7 @@ #### Defined in -[src/ts/types.ts:35](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L35) +[src/ts/types.ts:36](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L36) ___ @@ -26,7 +26,7 @@ ___ #### Defined in -[src/ts/types.ts:34](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L34) +[src/ts/types.ts:35](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L35) ___ @@ -36,4 +36,4 @@ ___ #### Defined in -[src/ts/types.ts:33](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L33) +[src/ts/types.ts:34](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L34) diff --git a/docs/interfaces/JWK.md b/docs/interfaces/JWK.md index 3937ac4..92354ef 100644 --- a/docs/interfaces/JWK.md +++ b/docs/interfaces/JWK.md @@ -46,7 +46,7 @@ JWKjose.alg #### Defined in -[src/ts/types.ts:24](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L24) +[src/ts/types.ts:25](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L25) ___ diff --git a/docs/interfaces/JwkPair.md b/docs/interfaces/JwkPair.md index 122586e..fa8e89c 100644 --- a/docs/interfaces/JwkPair.md +++ b/docs/interfaces/JwkPair.md @@ -15,7 +15,7 @@ #### Defined in -[src/ts/types.ts:100](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L100) +[src/ts/types.ts:101](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L101) ___ @@ -25,4 +25,4 @@ ___ #### Defined in -[src/ts/types.ts:99](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L99) +[src/ts/types.ts:100](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L100) diff --git a/docs/interfaces/NrProofPayload.md b/docs/interfaces/NrProofPayload.md index 1fbee04..1ac4fc0 100644 --- a/docs/interfaces/NrProofPayload.md +++ b/docs/interfaces/NrProofPayload.md @@ -29,7 +29,7 @@ #### Defined in -[src/ts/types.ts:110](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L110) +[src/ts/types.ts:111](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L111) ___ @@ -43,7 +43,7 @@ ___ #### Defined in -[src/ts/types.ts:104](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L104) +[src/ts/types.ts:105](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L105) ___ @@ -57,7 +57,7 @@ ___ #### Defined in -[src/ts/types.ts:105](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L105) +[src/ts/types.ts:106](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L106) ___ @@ -71,4 +71,4 @@ ___ #### Defined in -[src/ts/types.ts:106](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L106) +[src/ts/types.ts:107](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L107) diff --git a/docs/interfaces/NrpDltAgentDest.md b/docs/interfaces/NrpDltAgentDest.md index 5e6f7d4..f6ec405 100644 --- a/docs/interfaces/NrpDltAgentDest.md +++ b/docs/interfaces/NrpDltAgentDest.md @@ -46,7 +46,7 @@ the secret in hex and when it was published to the blockchain as a NumericDate #### Defined in -[src/ts/dlt/agents/dest/NrpDltAgentDest.ts:13](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/dest/NrpDltAgentDest.ts#L13) +[src/ts/dlt/agents/dest/NrpDltAgentDest.ts:13](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/dest/NrpDltAgentDest.ts#L13) ## Methods @@ -66,4 +66,4 @@ NrpDltAgent.getContractAddress #### Defined in -[src/ts/dlt/agents/NrpDltAgent.ts:9](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/NrpDltAgent.ts#L9) +[src/ts/dlt/agents/NrpDltAgent.ts:9](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/NrpDltAgent.ts#L9) diff --git a/docs/interfaces/NrpDltAgentOrig.md b/docs/interfaces/NrpDltAgentOrig.md index 30634e2..40e96b7 100644 --- a/docs/interfaces/NrpDltAgentOrig.md +++ b/docs/interfaces/NrpDltAgentOrig.md @@ -45,7 +45,7 @@ a receipt of the deployment. In Ethereum-like DLTs it contains the transaction h #### Defined in -[src/ts/dlt/agents/orig/NrpDltAgentOrig.ts:12](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/orig/NrpDltAgentOrig.ts#L12) +[src/ts/dlt/agents/orig/NrpDltAgentOrig.ts:12](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/orig/NrpDltAgentOrig.ts#L12) ___ @@ -65,7 +65,7 @@ Returns and identifier of the signer's account on the ledger. In Ethereum-like D #### Defined in -[src/ts/dlt/agents/orig/NrpDltAgentOrig.ts:17](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/orig/NrpDltAgentOrig.ts#L17) +[src/ts/dlt/agents/orig/NrpDltAgentOrig.ts:17](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/orig/NrpDltAgentOrig.ts#L17) ___ @@ -85,7 +85,7 @@ Returns the next nonce to use after deploying #### Defined in -[src/ts/dlt/agents/orig/NrpDltAgentOrig.ts:22](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/orig/NrpDltAgentOrig.ts#L22) +[src/ts/dlt/agents/orig/NrpDltAgentOrig.ts:22](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/orig/NrpDltAgentOrig.ts#L22) ## Methods @@ -105,4 +105,4 @@ NrpDltAgent.getContractAddress #### Defined in -[src/ts/dlt/agents/NrpDltAgent.ts:9](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/NrpDltAgent.ts#L9) +[src/ts/dlt/agents/NrpDltAgent.ts:9](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/NrpDltAgent.ts#L9) diff --git a/docs/interfaces/OrigBlock.md b/docs/interfaces/OrigBlock.md index d2a9411..5153e51 100644 --- a/docs/interfaces/OrigBlock.md +++ b/docs/interfaces/OrigBlock.md @@ -29,7 +29,7 @@ #### Defined in -[src/ts/types.ts:57](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L57) +[src/ts/types.ts:58](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L58) ___ @@ -43,7 +43,7 @@ ___ #### Defined in -[src/ts/types.ts:50](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L50) +[src/ts/types.ts:51](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L51) ___ @@ -57,7 +57,7 @@ ___ #### Defined in -[src/ts/types.ts:52](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L52) +[src/ts/types.ts:53](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L53) ___ @@ -71,7 +71,7 @@ ___ #### Defined in -[src/ts/types.ts:51](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L51) +[src/ts/types.ts:52](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L52) ___ @@ -85,7 +85,7 @@ ___ #### Defined in -[src/ts/types.ts:56](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L56) +[src/ts/types.ts:57](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L57) ___ @@ -106,4 +106,4 @@ ___ #### Defined in -[src/ts/types.ts:58](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L58) +[src/ts/types.ts:59](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L59) diff --git a/docs/interfaces/PoOPayload.md b/docs/interfaces/PoOPayload.md index 301b0fd..046243f 100644 --- a/docs/interfaces/PoOPayload.md +++ b/docs/interfaces/PoOPayload.md @@ -27,7 +27,7 @@ #### Defined in -[src/ts/types.ts:110](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L110) +[src/ts/types.ts:111](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L111) ___ @@ -41,7 +41,7 @@ ___ #### Defined in -[src/ts/types.ts:104](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L104) +[src/ts/types.ts:105](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L105) ___ @@ -55,7 +55,7 @@ ___ #### Defined in -[src/ts/types.ts:114](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L114) +[src/ts/types.ts:115](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L115) ___ @@ -69,4 +69,4 @@ ___ #### Defined in -[src/ts/types.ts:115](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L115) +[src/ts/types.ts:116](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L116) diff --git a/docs/interfaces/PoPPayload.md b/docs/interfaces/PoPPayload.md index 87f41ee..213bbc2 100644 --- a/docs/interfaces/PoPPayload.md +++ b/docs/interfaces/PoPPayload.md @@ -30,7 +30,7 @@ #### Defined in -[src/ts/types.ts:110](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L110) +[src/ts/types.ts:111](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L111) ___ @@ -44,7 +44,7 @@ ___ #### Defined in -[src/ts/types.ts:104](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L104) +[src/ts/types.ts:105](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L105) ___ @@ -58,7 +58,7 @@ ___ #### Defined in -[src/ts/types.ts:125](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L125) +[src/ts/types.ts:126](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L126) ___ @@ -68,7 +68,7 @@ ___ #### Defined in -[src/ts/types.ts:127](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L127) +[src/ts/types.ts:128](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L128) ___ @@ -82,7 +82,7 @@ ___ #### Defined in -[src/ts/types.ts:126](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L126) +[src/ts/types.ts:127](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L127) ___ @@ -92,7 +92,7 @@ ___ #### Defined in -[src/ts/types.ts:128](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L128) +[src/ts/types.ts:129](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L129) ___ @@ -102,4 +102,4 @@ ___ #### Defined in -[src/ts/types.ts:129](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L129) +[src/ts/types.ts:130](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L130) diff --git a/docs/interfaces/PoRPayload.md b/docs/interfaces/PoRPayload.md index 00d637f..090fe81 100644 --- a/docs/interfaces/PoRPayload.md +++ b/docs/interfaces/PoRPayload.md @@ -28,7 +28,7 @@ #### Defined in -[src/ts/types.ts:110](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L110) +[src/ts/types.ts:111](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L111) ___ @@ -42,7 +42,7 @@ ___ #### Defined in -[src/ts/types.ts:104](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L104) +[src/ts/types.ts:105](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L105) ___ @@ -56,7 +56,7 @@ ___ #### Defined in -[src/ts/types.ts:119](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L119) +[src/ts/types.ts:120](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L120) ___ @@ -66,7 +66,7 @@ ___ #### Defined in -[src/ts/types.ts:121](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L121) +[src/ts/types.ts:122](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L122) ___ @@ -80,4 +80,4 @@ ___ #### Defined in -[src/ts/types.ts:120](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L120) +[src/ts/types.ts:121](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L121) diff --git a/docs/interfaces/ProofPayload.md b/docs/interfaces/ProofPayload.md index 2d85c76..b5a7eb1 100644 --- a/docs/interfaces/ProofPayload.md +++ b/docs/interfaces/ProofPayload.md @@ -26,7 +26,7 @@ #### Defined in -[src/ts/types.ts:104](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L104) +[src/ts/types.ts:105](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L105) ___ @@ -36,7 +36,7 @@ ___ #### Defined in -[src/ts/types.ts:105](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L105) +[src/ts/types.ts:106](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L106) ___ @@ -46,4 +46,4 @@ ___ #### Defined in -[src/ts/types.ts:106](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L106) +[src/ts/types.ts:107](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L107) diff --git a/docs/interfaces/ResolutionPayload.md b/docs/interfaces/ResolutionPayload.md index d97632e..58ea254 100644 --- a/docs/interfaces/ResolutionPayload.md +++ b/docs/interfaces/ResolutionPayload.md @@ -30,7 +30,7 @@ #### Defined in -[src/ts/types.ts:154](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L154) +[src/ts/types.ts:155](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L155) ___ @@ -44,7 +44,7 @@ ___ #### Defined in -[src/ts/types.ts:155](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L155) +[src/ts/types.ts:156](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L156) ___ @@ -58,7 +58,7 @@ ___ #### Defined in -[src/ts/types.ts:156](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L156) +[src/ts/types.ts:157](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L157) ___ @@ -72,7 +72,7 @@ ___ #### Defined in -[src/ts/types.ts:151](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L151) +[src/ts/types.ts:152](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L152) ___ @@ -82,7 +82,7 @@ ___ #### Defined in -[src/ts/types.ts:153](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L153) +[src/ts/types.ts:154](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L154) ___ @@ -92,7 +92,7 @@ ___ #### Defined in -[src/ts/types.ts:157](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L157) +[src/ts/types.ts:158](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L158) ___ @@ -102,4 +102,4 @@ ___ #### Defined in -[src/ts/types.ts:152](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L152) +[src/ts/types.ts:153](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L153) diff --git a/docs/interfaces/Signers.NrpDltAgentDest.md b/docs/interfaces/Signers.NrpDltAgentDest.md index 0bb2547..d75e904 100644 --- a/docs/interfaces/Signers.NrpDltAgentDest.md +++ b/docs/interfaces/Signers.NrpDltAgentDest.md @@ -57,7 +57,7 @@ the secret in hex and when it was published to the blockchain as a NumericDate #### Defined in -[src/ts/dlt/agents/dest/NrpDltAgentDest.ts:13](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/dest/NrpDltAgentDest.ts#L13) +[src/ts/dlt/agents/dest/NrpDltAgentDest.ts:13](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/dest/NrpDltAgentDest.ts#L13) ## Methods @@ -77,4 +77,4 @@ NrpDltAgent.getContractAddress #### Defined in -[src/ts/dlt/agents/NrpDltAgent.ts:9](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/NrpDltAgent.ts#L9) +[src/ts/dlt/agents/NrpDltAgent.ts:9](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/NrpDltAgent.ts#L9) diff --git a/docs/interfaces/Signers.NrpDltAgentOrig.md b/docs/interfaces/Signers.NrpDltAgentOrig.md index 1a43fb1..5babdf7 100644 --- a/docs/interfaces/Signers.NrpDltAgentOrig.md +++ b/docs/interfaces/Signers.NrpDltAgentOrig.md @@ -56,7 +56,7 @@ a receipt of the deployment. In Ethereum-like DLTs it contains the transaction h #### Defined in -[src/ts/dlt/agents/orig/NrpDltAgentOrig.ts:12](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/orig/NrpDltAgentOrig.ts#L12) +[src/ts/dlt/agents/orig/NrpDltAgentOrig.ts:12](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/orig/NrpDltAgentOrig.ts#L12) ___ @@ -76,7 +76,7 @@ Returns and identifier of the signer's account on the ledger. In Ethereum-like D #### Defined in -[src/ts/dlt/agents/orig/NrpDltAgentOrig.ts:17](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/orig/NrpDltAgentOrig.ts#L17) +[src/ts/dlt/agents/orig/NrpDltAgentOrig.ts:17](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/orig/NrpDltAgentOrig.ts#L17) ___ @@ -96,7 +96,7 @@ Returns the next nonce to use after deploying #### Defined in -[src/ts/dlt/agents/orig/NrpDltAgentOrig.ts:22](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/orig/NrpDltAgentOrig.ts#L22) +[src/ts/dlt/agents/orig/NrpDltAgentOrig.ts:22](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/orig/NrpDltAgentOrig.ts#L22) ## Methods @@ -116,4 +116,4 @@ NrpDltAgent.getContractAddress #### Defined in -[src/ts/dlt/agents/NrpDltAgent.ts:9](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/dlt/agents/NrpDltAgent.ts#L9) +[src/ts/dlt/agents/NrpDltAgent.ts:9](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/dlt/agents/NrpDltAgent.ts#L9) diff --git a/docs/interfaces/StoredProof.md b/docs/interfaces/StoredProof.md index cebf838..318439e 100644 --- a/docs/interfaces/StoredProof.md +++ b/docs/interfaces/StoredProof.md @@ -21,7 +21,7 @@ #### Defined in -[src/ts/types.ts:39](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L39) +[src/ts/types.ts:40](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L40) ___ @@ -31,4 +31,4 @@ ___ #### Defined in -[src/ts/types.ts:40](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L40) +[src/ts/types.ts:41](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L41) diff --git a/docs/interfaces/TimestampVerifyOptions.md b/docs/interfaces/TimestampVerifyOptions.md index d3b4cb9..30834d5 100644 --- a/docs/interfaces/TimestampVerifyOptions.md +++ b/docs/interfaces/TimestampVerifyOptions.md @@ -17,7 +17,7 @@ #### Defined in -[src/ts/types.ts:67](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L67) +[src/ts/types.ts:68](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L68) ___ @@ -27,7 +27,7 @@ ___ #### Defined in -[src/ts/types.ts:66](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L66) +[src/ts/types.ts:67](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L67) ___ @@ -37,7 +37,7 @@ ___ #### Defined in -[src/ts/types.ts:65](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L65) +[src/ts/types.ts:66](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L66) ___ @@ -47,4 +47,4 @@ ___ #### Defined in -[src/ts/types.ts:68](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L68) +[src/ts/types.ts:69](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L69) diff --git a/docs/interfaces/VerificationRequestPayload.md b/docs/interfaces/VerificationRequestPayload.md index 7a55731..200a682 100644 --- a/docs/interfaces/VerificationRequestPayload.md +++ b/docs/interfaces/VerificationRequestPayload.md @@ -29,7 +29,7 @@ #### Defined in -[src/ts/types.ts:137](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L137) +[src/ts/types.ts:138](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L138) ___ @@ -43,7 +43,7 @@ ___ #### Defined in -[src/ts/types.ts:135](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L135) +[src/ts/types.ts:136](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L136) ___ @@ -57,7 +57,7 @@ ___ #### Defined in -[src/ts/types.ts:134](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L134) +[src/ts/types.ts:135](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L135) ___ @@ -71,7 +71,7 @@ ___ #### Defined in -[src/ts/types.ts:136](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L136) +[src/ts/types.ts:137](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L137) ___ @@ -85,7 +85,7 @@ ___ #### Defined in -[src/ts/types.ts:133](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L133) +[src/ts/types.ts:134](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L134) ___ @@ -95,4 +95,4 @@ ___ #### Defined in -[src/ts/types.ts:141](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L141) +[src/ts/types.ts:142](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L142) diff --git a/docs/interfaces/VerificationResolutionPayload.md b/docs/interfaces/VerificationResolutionPayload.md index 76d7d11..5f49a8b 100644 --- a/docs/interfaces/VerificationResolutionPayload.md +++ b/docs/interfaces/VerificationResolutionPayload.md @@ -30,7 +30,7 @@ #### Defined in -[src/ts/types.ts:154](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L154) +[src/ts/types.ts:155](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L155) ___ @@ -44,7 +44,7 @@ ___ #### Defined in -[src/ts/types.ts:155](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L155) +[src/ts/types.ts:156](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L156) ___ @@ -58,7 +58,7 @@ ___ #### Defined in -[src/ts/types.ts:156](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L156) +[src/ts/types.ts:157](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L157) ___ @@ -72,7 +72,7 @@ ___ #### Defined in -[src/ts/types.ts:151](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L151) +[src/ts/types.ts:152](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L152) ___ @@ -86,7 +86,7 @@ ___ #### Defined in -[src/ts/types.ts:162](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L162) +[src/ts/types.ts:163](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L163) ___ @@ -100,7 +100,7 @@ ___ #### Defined in -[src/ts/types.ts:157](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L157) +[src/ts/types.ts:158](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L158) ___ @@ -114,4 +114,4 @@ ___ #### Defined in -[src/ts/types.ts:161](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/types.ts#L161) +[src/ts/types.ts:162](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/types.ts#L162) diff --git a/docs/modules/ConflictResolution.md b/docs/modules/ConflictResolution.md index b019667..17939af 100644 --- a/docs/modules/ConflictResolution.md +++ b/docs/modules/ConflictResolution.md @@ -36,7 +36,7 @@ Checks the completeness of a given data exchange by verifying the PoR in the ver #### Defined in -[src/ts/conflict-resolution/checkCompleteness.ts:14](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/conflict-resolution/checkCompleteness.ts#L14) +[src/ts/conflict-resolution/checkCompleteness.ts:14](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/conflict-resolution/checkCompleteness.ts#L14) ___ @@ -59,7 +59,7 @@ Check if the cipherblock in the disputeRequest is the one agreed for the dataExc #### Defined in -[src/ts/conflict-resolution/checkDecryption.ts:16](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/conflict-resolution/checkDecryption.ts#L16) +[src/ts/conflict-resolution/checkDecryption.ts:16](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/conflict-resolution/checkDecryption.ts#L16) ___ @@ -82,7 +82,7 @@ ___ #### Defined in -[src/ts/conflict-resolution/generateVerificationRequest.ts:4](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/conflict-resolution/generateVerificationRequest.ts#L4) +[src/ts/conflict-resolution/generateVerificationRequest.ts:4](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/conflict-resolution/generateVerificationRequest.ts#L4) ___ @@ -104,7 +104,7 @@ ___ #### Defined in -[src/ts/conflict-resolution/verifyPor.ts:10](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/conflict-resolution/verifyPor.ts#L10) +[src/ts/conflict-resolution/verifyPor.ts:10](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/conflict-resolution/verifyPor.ts#L10) ___ @@ -131,4 +131,4 @@ ___ #### Defined in -[src/ts/conflict-resolution/verifyResolution.ts:4](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/a844236/src/ts/conflict-resolution/verifyResolution.ts#L4) +[src/ts/conflict-resolution/verifyResolution.ts:4](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/00dbbfe/src/ts/conflict-resolution/verifyResolution.ts#L4) diff --git a/src/ts/types.ts b/src/ts/types.ts index 8cf4ac8..41ccd03 100644 --- a/src/ts/types.ts +++ b/src/ts/types.ts @@ -10,8 +10,9 @@ export type HashAlg = typeof HASH_ALGS[number] export type SigningAlg = typeof SIGNING_ALGS[number] export type EncryptionAlg = typeof ENC_ALGS[number] +type DictKey = string | number | symbol export type Dict = T & { - [key: string | symbol | number]: any | undefined + [key in DictKey]: any | undefined } export interface Algs {