From ee2a0c1fb4527d7155a5f609840cf45976dab5bb Mon Sep 17 00:00:00 2001 From: juanelas Date: Fri, 14 Apr 2023 15:04:11 +0200 Subject: [PATCH] better support for exports. fixed issue with workers with ESM version --- .gitignore | 1 + .npmignore | 1 + README.md | 2 +- build/bin/mocha-ts.cjs | 8 +- build/build.docs.cjs | 7 +- build/rollup-plugin-dts.js | 44 +- build/rollup.config.js | 144 +- build/testing/browser/index.cjs | 2 +- build/testing/browser/server.cjs | 20 +- dist/{bundles/esm.js => bundle.esm.js} | 9094 ++++++++++++++++- dist/bundle.esm.min.js | 15 + dist/bundle.iife.js | 17 + dist/bundle.umd.js | 17 + dist/bundles/esm.min.js | 25 - dist/bundles/iife.js | 27 - dist/bundles/umd.js | 27 - dist/cjs/index.node.cjs | 2 - dist/esm/index.browser.js | 1374 --- dist/index.browser.esm.js | 2 + dist/index.d.ts | 3909 +++++++ dist/index.node.cjs | 2 + dist/{esm/index.node.js => index.node.esm.js} | 2 +- docs/API.md | 154 +- .../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 | 46 +- 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 +- package-lock.json | 287 +- package.json | 67 +- .../ConflictResolver.d.cts | 13 - .../ConflictResolver.d.cts.map | 1 - .../conflict-resolution/ConflictResolver.d.ts | 13 - .../ConflictResolver.d.ts.map | 1 - .../checkCompleteness.d.cts | 10 - .../checkCompleteness.d.cts.map | 1 - .../checkCompleteness.d.ts | 10 - .../checkCompleteness.d.ts.map | 1 - .../conflict-resolution/checkDecryption.d.cts | 10 - .../checkDecryption.d.cts.map | 1 - .../conflict-resolution/checkDecryption.d.ts | 10 - .../checkDecryption.d.ts.map | 1 - .../generateVerificationRequest.d.cts | 3 - .../generateVerificationRequest.d.cts.map | 1 - .../generateVerificationRequest.d.ts | 3 - .../generateVerificationRequest.d.ts.map | 1 - types/conflict-resolution/index.d.cts | 7 - types/conflict-resolution/index.d.cts.map | 1 - types/conflict-resolution/index.d.ts | 7 - types/conflict-resolution/index.d.ts.map | 1 - types/conflict-resolution/verifyPor.d.cts | 10 - types/conflict-resolution/verifyPor.d.cts.map | 1 - types/conflict-resolution/verifyPor.d.ts | 10 - types/conflict-resolution/verifyPor.d.ts.map | 1 - .../verifyResolution.d.cts | 3 - .../verifyResolution.d.cts.map | 1 - .../conflict-resolution/verifyResolution.d.ts | 3 - .../verifyResolution.d.ts.map | 1 - types/constants.d.cts | 5 - types/constants.d.cts.map | 1 - types/constants.d.ts | 5 - types/constants.d.ts.map | 1 - types/crypto/generateKeys.d.cts | 3 - types/crypto/generateKeys.d.cts.map | 1 - types/crypto/generateKeys.d.ts | 3 - types/crypto/generateKeys.d.ts.map | 1 - types/crypto/importJwk.d.cts | 3 - types/crypto/importJwk.d.cts.map | 1 - types/crypto/importJwk.d.ts | 3 - types/crypto/importJwk.d.ts.map | 1 - types/crypto/index.d.cts | 7 - types/crypto/index.d.cts.map | 1 - types/crypto/index.d.ts | 7 - types/crypto/index.d.ts.map | 1 - types/crypto/jwe.d.cts | 5 - types/crypto/jwe.d.cts.map | 1 - types/crypto/jwe.d.ts | 5 - types/crypto/jwe.d.ts.map | 1 - types/crypto/jwsDecode.d.cts | 3 - types/crypto/jwsDecode.d.cts.map | 1 - types/crypto/jwsDecode.d.ts | 3 - types/crypto/jwsDecode.d.ts.map | 1 - types/crypto/oneTimeSecret.d.cts | 3 - types/crypto/oneTimeSecret.d.cts.map | 1 - types/crypto/oneTimeSecret.d.ts | 3 - types/crypto/oneTimeSecret.d.ts.map | 1 - types/crypto/verifyKeyPair.d.cts | 3 - types/crypto/verifyKeyPair.d.cts.map | 1 - types/crypto/verifyKeyPair.d.ts | 3 - types/crypto/verifyKeyPair.d.ts.map | 1 - types/dlt/agents/EthersIoAgent.d.cts | 12 - types/dlt/agents/EthersIoAgent.d.cts.map | 1 - types/dlt/agents/EthersIoAgent.d.ts | 12 - types/dlt/agents/EthersIoAgent.d.ts.map | 1 - types/dlt/agents/I3mServerWalletAgent.d.cts | 9 - .../dlt/agents/I3mServerWalletAgent.d.cts.map | 1 - types/dlt/agents/I3mServerWalletAgent.d.ts | 9 - .../dlt/agents/I3mServerWalletAgent.d.ts.map | 1 - types/dlt/agents/I3mWalletAgent.d.cts | 9 - types/dlt/agents/I3mWalletAgent.d.cts.map | 1 - types/dlt/agents/I3mWalletAgent.d.ts | 9 - types/dlt/agents/I3mWalletAgent.d.ts.map | 1 - types/dlt/agents/NrpDltAgent.d.cts | 4 - types/dlt/agents/NrpDltAgent.d.cts.map | 1 - types/dlt/agents/NrpDltAgent.d.ts | 4 - types/dlt/agents/NrpDltAgent.d.ts.map | 1 - types/dlt/agents/dest/EthersIoAgentDest.d.cts | 9 - .../agents/dest/EthersIoAgentDest.d.cts.map | 1 - types/dlt/agents/dest/EthersIoAgentDest.d.ts | 9 - .../agents/dest/EthersIoAgentDest.d.ts.map | 1 - .../dest/I3mServerWalletAgentDest.d.cts | 9 - .../dest/I3mServerWalletAgentDest.d.cts.map | 1 - .../agents/dest/I3mServerWalletAgentDest.d.ts | 9 - .../dest/I3mServerWalletAgentDest.d.ts.map | 1 - .../dlt/agents/dest/I3mWalletAgentDest.d.cts | 9 - .../agents/dest/I3mWalletAgentDest.d.cts.map | 1 - types/dlt/agents/dest/I3mWalletAgentDest.d.ts | 9 - .../agents/dest/I3mWalletAgentDest.d.ts.map | 1 - types/dlt/agents/dest/NrpDltAgentDest.d.cts | 8 - .../dlt/agents/dest/NrpDltAgentDest.d.cts.map | 1 - types/dlt/agents/dest/NrpDltAgentDest.d.ts | 8 - .../dlt/agents/dest/NrpDltAgentDest.d.ts.map | 1 - types/dlt/agents/dest/index.d.cts | 5 - types/dlt/agents/dest/index.d.cts.map | 1 - types/dlt/agents/dest/index.d.ts | 5 - types/dlt/agents/dest/index.d.ts.map | 1 - types/dlt/agents/index.d.cts | 3 - types/dlt/agents/index.d.cts.map | 1 - types/dlt/agents/index.d.ts | 3 - types/dlt/agents/index.d.ts.map | 1 - types/dlt/agents/orig/EthersIoAgentOrig.d.cts | 13 - .../agents/orig/EthersIoAgentOrig.d.cts.map | 1 - types/dlt/agents/orig/EthersIoAgentOrig.d.ts | 13 - .../agents/orig/EthersIoAgentOrig.d.ts.map | 1 - .../orig/I3mServerWalletAgentOrig.d.cts | 9 - .../orig/I3mServerWalletAgentOrig.d.cts.map | 1 - .../agents/orig/I3mServerWalletAgentOrig.d.ts | 9 - .../orig/I3mServerWalletAgentOrig.d.ts.map | 1 - .../dlt/agents/orig/I3mWalletAgentOrig.d.cts | 9 - .../agents/orig/I3mWalletAgentOrig.d.cts.map | 1 - types/dlt/agents/orig/I3mWalletAgentOrig.d.ts | 9 - .../agents/orig/I3mWalletAgentOrig.d.ts.map | 1 - types/dlt/agents/orig/NrpDltAgentOrig.d.cts | 7 - .../dlt/agents/orig/NrpDltAgentOrig.d.cts.map | 1 - types/dlt/agents/orig/NrpDltAgentOrig.d.ts | 7 - .../dlt/agents/orig/NrpDltAgentOrig.d.ts.map | 1 - types/dlt/agents/orig/index.d.cts | 5 - types/dlt/agents/orig/index.d.cts.map | 1 - types/dlt/agents/orig/index.d.ts | 5 - types/dlt/agents/orig/index.d.ts.map | 1 - types/dlt/agents/secret.d.cts | 9 - types/dlt/agents/secret.d.cts.map | 1 - types/dlt/agents/secret.d.ts | 9 - types/dlt/agents/secret.d.ts.map | 1 - types/dlt/defaultDltConfig.d.cts | 3 - types/dlt/defaultDltConfig.d.cts.map | 1 - types/dlt/defaultDltConfig.d.ts | 3 - types/dlt/defaultDltConfig.d.ts.map | 1 - types/dlt/index.d.cts | 3 - types/dlt/index.d.cts.map | 1 - types/dlt/index.d.ts | 3 - types/dlt/index.d.ts.map | 1 - types/errors/NrError.d.cts | 7 - types/errors/NrError.d.cts.map | 1 - types/errors/NrError.d.ts | 7 - types/errors/NrError.d.ts.map | 1 - types/errors/index.d.cts | 2 - types/errors/index.d.cts.map | 1 - types/errors/index.d.ts | 2 - types/errors/index.d.ts.map | 1 - types/exchange/checkAgreement.d.cts | 6 - types/exchange/checkAgreement.d.cts.map | 1 - types/exchange/checkAgreement.d.ts | 6 - types/exchange/checkAgreement.d.ts.map | 1 - types/exchange/exchangeId.d.cts | 3 - types/exchange/exchangeId.d.cts.map | 1 - types/exchange/exchangeId.d.ts | 3 - types/exchange/exchangeId.d.ts.map | 1 - types/exchange/index.d.cts | 3 - types/exchange/index.d.cts.map | 1 - types/exchange/index.d.ts | 3 - types/exchange/index.d.ts.map | 1 - types/index.d.cts | 12 - types/index.d.cts.map | 1 - types/index.d.ts | 12 - types/index.d.ts.map | 1 - .../NonRepudiationDest.d.cts | 24 - .../NonRepudiationDest.d.cts.map | 1 - .../NonRepudiationDest.d.ts | 24 - .../NonRepudiationDest.d.ts.map | 1 - .../NonRepudiationOrig.d.cts | 19 - .../NonRepudiationOrig.d.cts.map | 1 - .../NonRepudiationOrig.d.ts | 19 - .../NonRepudiationOrig.d.ts.map | 1 - types/non-repudiation-protocol/index.d.cts | 3 - .../non-repudiation-protocol/index.d.cts.map | 1 - types/non-repudiation-protocol/index.d.ts | 3 - types/non-repudiation-protocol/index.d.ts.map | 1 - types/proofs/createProof.d.cts | 3 - types/proofs/createProof.d.cts.map | 1 - types/proofs/createProof.d.ts | 3 - types/proofs/createProof.d.ts.map | 1 - types/proofs/index.d.cts | 3 - types/proofs/index.d.cts.map | 1 - types/proofs/index.d.ts | 3 - types/proofs/index.d.ts.map | 1 - types/proofs/verifyProof.d.cts | 7 - types/proofs/verifyProof.d.cts.map | 1 - types/proofs/verifyProof.d.ts | 7 - types/proofs/verifyProof.d.ts.map | 1 - types/types.d.cts | 133 - types/types.d.cts.map | 1 - types/types.d.ts | 133 - types/types.d.ts.map | 1 - types/utils/algByteLength.d.cts | 3 - types/utils/algByteLength.d.cts.map | 1 - types/utils/algByteLength.d.ts | 3 - types/utils/algByteLength.d.ts.map | 1 - types/utils/getDltAddress.d.cts | 2 - types/utils/getDltAddress.d.cts.map | 1 - types/utils/getDltAddress.d.ts | 2 - types/utils/getDltAddress.d.ts.map | 1 - types/utils/index.d.cts | 8 - types/utils/index.d.cts.map | 1 - types/utils/index.d.ts | 8 - types/utils/index.d.ts.map | 1 - types/utils/jsonSort.d.cts | 2 - types/utils/jsonSort.d.cts.map | 1 - types/utils/jsonSort.d.ts | 2 - types/utils/jsonSort.d.ts.map | 1 - types/utils/parseAddress.d.cts | 2 - types/utils/parseAddress.d.cts.map | 1 - types/utils/parseAddress.d.ts | 2 - types/utils/parseAddress.d.ts.map | 1 - types/utils/parseHex.d.cts | 2 - types/utils/parseHex.d.cts.map | 1 - types/utils/parseHex.d.ts | 2 - types/utils/parseHex.d.ts.map | 1 - types/utils/parseJwk.d.cts | 4 - types/utils/parseJwk.d.cts.map | 1 - types/utils/parseJwk.d.ts | 4 - types/utils/parseJwk.d.ts.map | 1 - types/utils/sha.d.cts | 3 - types/utils/sha.d.cts.map | 1 - types/utils/sha.d.ts | 3 - types/utils/sha.d.ts.map | 1 - types/utils/timestamps.d.cts | 2 - types/utils/timestamps.d.cts.map | 1 - types/utils/timestamps.d.ts | 2 - types/utils/timestamps.d.ts.map | 1 - 288 files changed, 13293 insertions(+), 3597 deletions(-) rename dist/{bundles/esm.js => bundle.esm.js} (90%) create mode 100644 dist/bundle.esm.min.js create mode 100644 dist/bundle.iife.js create mode 100644 dist/bundle.umd.js delete mode 100644 dist/bundles/esm.min.js delete mode 100644 dist/bundles/iife.js delete mode 100644 dist/bundles/umd.js delete mode 100644 dist/cjs/index.node.cjs delete mode 100644 dist/esm/index.browser.js create mode 100644 dist/index.browser.esm.js create mode 100644 dist/index.d.ts create mode 100644 dist/index.node.cjs rename dist/{esm/index.node.js => index.node.esm.js} (70%) delete mode 100644 types/conflict-resolution/ConflictResolver.d.cts delete mode 100644 types/conflict-resolution/ConflictResolver.d.cts.map delete mode 100644 types/conflict-resolution/ConflictResolver.d.ts delete mode 100644 types/conflict-resolution/ConflictResolver.d.ts.map delete mode 100644 types/conflict-resolution/checkCompleteness.d.cts delete mode 100644 types/conflict-resolution/checkCompleteness.d.cts.map delete mode 100644 types/conflict-resolution/checkCompleteness.d.ts delete mode 100644 types/conflict-resolution/checkCompleteness.d.ts.map delete mode 100644 types/conflict-resolution/checkDecryption.d.cts delete mode 100644 types/conflict-resolution/checkDecryption.d.cts.map delete mode 100644 types/conflict-resolution/checkDecryption.d.ts delete mode 100644 types/conflict-resolution/checkDecryption.d.ts.map delete mode 100644 types/conflict-resolution/generateVerificationRequest.d.cts delete mode 100644 types/conflict-resolution/generateVerificationRequest.d.cts.map delete mode 100644 types/conflict-resolution/generateVerificationRequest.d.ts delete mode 100644 types/conflict-resolution/generateVerificationRequest.d.ts.map delete mode 100644 types/conflict-resolution/index.d.cts delete mode 100644 types/conflict-resolution/index.d.cts.map delete mode 100644 types/conflict-resolution/index.d.ts delete mode 100644 types/conflict-resolution/index.d.ts.map delete mode 100644 types/conflict-resolution/verifyPor.d.cts delete mode 100644 types/conflict-resolution/verifyPor.d.cts.map delete mode 100644 types/conflict-resolution/verifyPor.d.ts delete mode 100644 types/conflict-resolution/verifyPor.d.ts.map delete mode 100644 types/conflict-resolution/verifyResolution.d.cts delete mode 100644 types/conflict-resolution/verifyResolution.d.cts.map delete mode 100644 types/conflict-resolution/verifyResolution.d.ts delete mode 100644 types/conflict-resolution/verifyResolution.d.ts.map delete mode 100644 types/constants.d.cts delete mode 100644 types/constants.d.cts.map delete mode 100644 types/constants.d.ts delete mode 100644 types/constants.d.ts.map delete mode 100644 types/crypto/generateKeys.d.cts delete mode 100644 types/crypto/generateKeys.d.cts.map delete mode 100644 types/crypto/generateKeys.d.ts delete mode 100644 types/crypto/generateKeys.d.ts.map delete mode 100644 types/crypto/importJwk.d.cts delete mode 100644 types/crypto/importJwk.d.cts.map delete mode 100644 types/crypto/importJwk.d.ts delete mode 100644 types/crypto/importJwk.d.ts.map delete mode 100644 types/crypto/index.d.cts delete mode 100644 types/crypto/index.d.cts.map delete mode 100644 types/crypto/index.d.ts delete mode 100644 types/crypto/index.d.ts.map delete mode 100644 types/crypto/jwe.d.cts delete mode 100644 types/crypto/jwe.d.cts.map delete mode 100644 types/crypto/jwe.d.ts delete mode 100644 types/crypto/jwe.d.ts.map delete mode 100644 types/crypto/jwsDecode.d.cts delete mode 100644 types/crypto/jwsDecode.d.cts.map delete mode 100644 types/crypto/jwsDecode.d.ts delete mode 100644 types/crypto/jwsDecode.d.ts.map delete mode 100644 types/crypto/oneTimeSecret.d.cts delete mode 100644 types/crypto/oneTimeSecret.d.cts.map delete mode 100644 types/crypto/oneTimeSecret.d.ts delete mode 100644 types/crypto/oneTimeSecret.d.ts.map delete mode 100644 types/crypto/verifyKeyPair.d.cts delete mode 100644 types/crypto/verifyKeyPair.d.cts.map delete mode 100644 types/crypto/verifyKeyPair.d.ts delete mode 100644 types/crypto/verifyKeyPair.d.ts.map delete mode 100644 types/dlt/agents/EthersIoAgent.d.cts delete mode 100644 types/dlt/agents/EthersIoAgent.d.cts.map delete mode 100644 types/dlt/agents/EthersIoAgent.d.ts delete mode 100644 types/dlt/agents/EthersIoAgent.d.ts.map delete mode 100644 types/dlt/agents/I3mServerWalletAgent.d.cts delete mode 100644 types/dlt/agents/I3mServerWalletAgent.d.cts.map delete mode 100644 types/dlt/agents/I3mServerWalletAgent.d.ts delete mode 100644 types/dlt/agents/I3mServerWalletAgent.d.ts.map delete mode 100644 types/dlt/agents/I3mWalletAgent.d.cts delete mode 100644 types/dlt/agents/I3mWalletAgent.d.cts.map delete mode 100644 types/dlt/agents/I3mWalletAgent.d.ts delete mode 100644 types/dlt/agents/I3mWalletAgent.d.ts.map delete mode 100644 types/dlt/agents/NrpDltAgent.d.cts delete mode 100644 types/dlt/agents/NrpDltAgent.d.cts.map delete mode 100644 types/dlt/agents/NrpDltAgent.d.ts delete mode 100644 types/dlt/agents/NrpDltAgent.d.ts.map delete mode 100644 types/dlt/agents/dest/EthersIoAgentDest.d.cts delete mode 100644 types/dlt/agents/dest/EthersIoAgentDest.d.cts.map delete mode 100644 types/dlt/agents/dest/EthersIoAgentDest.d.ts delete mode 100644 types/dlt/agents/dest/EthersIoAgentDest.d.ts.map delete mode 100644 types/dlt/agents/dest/I3mServerWalletAgentDest.d.cts delete mode 100644 types/dlt/agents/dest/I3mServerWalletAgentDest.d.cts.map delete mode 100644 types/dlt/agents/dest/I3mServerWalletAgentDest.d.ts delete mode 100644 types/dlt/agents/dest/I3mServerWalletAgentDest.d.ts.map delete mode 100644 types/dlt/agents/dest/I3mWalletAgentDest.d.cts delete mode 100644 types/dlt/agents/dest/I3mWalletAgentDest.d.cts.map delete mode 100644 types/dlt/agents/dest/I3mWalletAgentDest.d.ts delete mode 100644 types/dlt/agents/dest/I3mWalletAgentDest.d.ts.map delete mode 100644 types/dlt/agents/dest/NrpDltAgentDest.d.cts delete mode 100644 types/dlt/agents/dest/NrpDltAgentDest.d.cts.map delete mode 100644 types/dlt/agents/dest/NrpDltAgentDest.d.ts delete mode 100644 types/dlt/agents/dest/NrpDltAgentDest.d.ts.map delete mode 100644 types/dlt/agents/dest/index.d.cts delete mode 100644 types/dlt/agents/dest/index.d.cts.map delete mode 100644 types/dlt/agents/dest/index.d.ts delete mode 100644 types/dlt/agents/dest/index.d.ts.map delete mode 100644 types/dlt/agents/index.d.cts delete mode 100644 types/dlt/agents/index.d.cts.map delete mode 100644 types/dlt/agents/index.d.ts delete mode 100644 types/dlt/agents/index.d.ts.map delete mode 100644 types/dlt/agents/orig/EthersIoAgentOrig.d.cts delete mode 100644 types/dlt/agents/orig/EthersIoAgentOrig.d.cts.map delete mode 100644 types/dlt/agents/orig/EthersIoAgentOrig.d.ts delete mode 100644 types/dlt/agents/orig/EthersIoAgentOrig.d.ts.map delete mode 100644 types/dlt/agents/orig/I3mServerWalletAgentOrig.d.cts delete mode 100644 types/dlt/agents/orig/I3mServerWalletAgentOrig.d.cts.map delete mode 100644 types/dlt/agents/orig/I3mServerWalletAgentOrig.d.ts delete mode 100644 types/dlt/agents/orig/I3mServerWalletAgentOrig.d.ts.map delete mode 100644 types/dlt/agents/orig/I3mWalletAgentOrig.d.cts delete mode 100644 types/dlt/agents/orig/I3mWalletAgentOrig.d.cts.map delete mode 100644 types/dlt/agents/orig/I3mWalletAgentOrig.d.ts delete mode 100644 types/dlt/agents/orig/I3mWalletAgentOrig.d.ts.map delete mode 100644 types/dlt/agents/orig/NrpDltAgentOrig.d.cts delete mode 100644 types/dlt/agents/orig/NrpDltAgentOrig.d.cts.map delete mode 100644 types/dlt/agents/orig/NrpDltAgentOrig.d.ts delete mode 100644 types/dlt/agents/orig/NrpDltAgentOrig.d.ts.map delete mode 100644 types/dlt/agents/orig/index.d.cts delete mode 100644 types/dlt/agents/orig/index.d.cts.map delete mode 100644 types/dlt/agents/orig/index.d.ts delete mode 100644 types/dlt/agents/orig/index.d.ts.map delete mode 100644 types/dlt/agents/secret.d.cts delete mode 100644 types/dlt/agents/secret.d.cts.map delete mode 100644 types/dlt/agents/secret.d.ts delete mode 100644 types/dlt/agents/secret.d.ts.map delete mode 100644 types/dlt/defaultDltConfig.d.cts delete mode 100644 types/dlt/defaultDltConfig.d.cts.map delete mode 100644 types/dlt/defaultDltConfig.d.ts delete mode 100644 types/dlt/defaultDltConfig.d.ts.map delete mode 100644 types/dlt/index.d.cts delete mode 100644 types/dlt/index.d.cts.map delete mode 100644 types/dlt/index.d.ts delete mode 100644 types/dlt/index.d.ts.map delete mode 100644 types/errors/NrError.d.cts delete mode 100644 types/errors/NrError.d.cts.map delete mode 100644 types/errors/NrError.d.ts delete mode 100644 types/errors/NrError.d.ts.map delete mode 100644 types/errors/index.d.cts delete mode 100644 types/errors/index.d.cts.map delete mode 100644 types/errors/index.d.ts delete mode 100644 types/errors/index.d.ts.map delete mode 100644 types/exchange/checkAgreement.d.cts delete mode 100644 types/exchange/checkAgreement.d.cts.map delete mode 100644 types/exchange/checkAgreement.d.ts delete mode 100644 types/exchange/checkAgreement.d.ts.map delete mode 100644 types/exchange/exchangeId.d.cts delete mode 100644 types/exchange/exchangeId.d.cts.map delete mode 100644 types/exchange/exchangeId.d.ts delete mode 100644 types/exchange/exchangeId.d.ts.map delete mode 100644 types/exchange/index.d.cts delete mode 100644 types/exchange/index.d.cts.map delete mode 100644 types/exchange/index.d.ts delete mode 100644 types/exchange/index.d.ts.map delete mode 100644 types/index.d.cts delete mode 100644 types/index.d.cts.map delete mode 100644 types/index.d.ts delete mode 100644 types/index.d.ts.map delete mode 100644 types/non-repudiation-protocol/NonRepudiationDest.d.cts delete mode 100644 types/non-repudiation-protocol/NonRepudiationDest.d.cts.map delete mode 100644 types/non-repudiation-protocol/NonRepudiationDest.d.ts delete mode 100644 types/non-repudiation-protocol/NonRepudiationDest.d.ts.map delete mode 100644 types/non-repudiation-protocol/NonRepudiationOrig.d.cts delete mode 100644 types/non-repudiation-protocol/NonRepudiationOrig.d.cts.map delete mode 100644 types/non-repudiation-protocol/NonRepudiationOrig.d.ts delete mode 100644 types/non-repudiation-protocol/NonRepudiationOrig.d.ts.map delete mode 100644 types/non-repudiation-protocol/index.d.cts delete mode 100644 types/non-repudiation-protocol/index.d.cts.map delete mode 100644 types/non-repudiation-protocol/index.d.ts delete mode 100644 types/non-repudiation-protocol/index.d.ts.map delete mode 100644 types/proofs/createProof.d.cts delete mode 100644 types/proofs/createProof.d.cts.map delete mode 100644 types/proofs/createProof.d.ts delete mode 100644 types/proofs/createProof.d.ts.map delete mode 100644 types/proofs/index.d.cts delete mode 100644 types/proofs/index.d.cts.map delete mode 100644 types/proofs/index.d.ts delete mode 100644 types/proofs/index.d.ts.map delete mode 100644 types/proofs/verifyProof.d.cts delete mode 100644 types/proofs/verifyProof.d.cts.map delete mode 100644 types/proofs/verifyProof.d.ts delete mode 100644 types/proofs/verifyProof.d.ts.map delete mode 100644 types/types.d.cts delete mode 100644 types/types.d.cts.map delete mode 100644 types/types.d.ts delete mode 100644 types/types.d.ts.map delete mode 100644 types/utils/algByteLength.d.cts delete mode 100644 types/utils/algByteLength.d.cts.map delete mode 100644 types/utils/algByteLength.d.ts delete mode 100644 types/utils/algByteLength.d.ts.map delete mode 100644 types/utils/getDltAddress.d.cts delete mode 100644 types/utils/getDltAddress.d.cts.map delete mode 100644 types/utils/getDltAddress.d.ts delete mode 100644 types/utils/getDltAddress.d.ts.map delete mode 100644 types/utils/index.d.cts delete mode 100644 types/utils/index.d.cts.map delete mode 100644 types/utils/index.d.ts delete mode 100644 types/utils/index.d.ts.map delete mode 100644 types/utils/jsonSort.d.cts delete mode 100644 types/utils/jsonSort.d.cts.map delete mode 100644 types/utils/jsonSort.d.ts delete mode 100644 types/utils/jsonSort.d.ts.map delete mode 100644 types/utils/parseAddress.d.cts delete mode 100644 types/utils/parseAddress.d.cts.map delete mode 100644 types/utils/parseAddress.d.ts delete mode 100644 types/utils/parseAddress.d.ts.map delete mode 100644 types/utils/parseHex.d.cts delete mode 100644 types/utils/parseHex.d.cts.map delete mode 100644 types/utils/parseHex.d.ts delete mode 100644 types/utils/parseHex.d.ts.map delete mode 100644 types/utils/parseJwk.d.cts delete mode 100644 types/utils/parseJwk.d.cts.map delete mode 100644 types/utils/parseJwk.d.ts delete mode 100644 types/utils/parseJwk.d.ts.map delete mode 100644 types/utils/sha.d.cts delete mode 100644 types/utils/sha.d.cts.map delete mode 100644 types/utils/sha.d.ts delete mode 100644 types/utils/sha.d.ts.map delete mode 100644 types/utils/timestamps.d.cts delete mode 100644 types/utils/timestamps.d.cts.map delete mode 100644 types/utils/timestamps.d.ts delete mode 100644 types/utils/timestamps.d.ts.map diff --git a/.gitignore b/.gitignore index 1168cf5..2b12397 100644 --- a/.gitignore +++ b/.gitignore @@ -18,6 +18,7 @@ coverage # Test temporal files .mocha-ts .tsconfig.json +.types # docs temporal files .nojekyll diff --git a/.npmignore b/.npmignore index a20c3bb..b4307e1 100644 --- a/.npmignore +++ b/.npmignore @@ -44,6 +44,7 @@ src/docs # Test temporal files .mocha-ts .tsconfig.json +.types # docs temporal files .nojekyll diff --git a/README.md b/README.md index 22ae0ee..c8c8e94 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ import * as nonRepudiationLibrary from '@i3m/non-repudiation-library' The appropriate version for browser or node is automatically exported. -You can also download the [IIFE bundle](https://raw.githubusercontent.com/i3-Market-V2-Public-Repository/SP3-SCGBSSW-CR-NonRepudiationLibrary/main/dist/bundles/iife.js), the [ESM bundle](https://raw.githubusercontent.com/i3-Market-V2-Public-Repository/SP3-SCGBSSW-CR-NonRepudiationLibrary/main/dist/bundles/esm.min.js) or the [UMD bundle](https://raw.githubusercontent.com/i3-Market-V2-Public-Repository/SP3-SCGBSSW-CR-NonRepudiationLibrary/main/dist/bundles/umd.js) and manually add it to your project, or, if you have already installed `@i3m/non-repudiation-library` in your project, just get the bundles from `node_modules/@i3m/non-repudiation-library/dist/bundles/`. +You can also download the [IIFE bundle](https://raw.githubusercontent.com/i3-Market-V2-Public-Repository/SP3-SCGBSSW-CR-NonRepudiationLibrary/main/dist/bundle.iife.js), the [ESM bundle](https://raw.githubusercontent.com/i3-Market-V2-Public-Repository/SP3-SCGBSSW-CR-NonRepudiationLibrary/main/dist/bundle.esm.min.js) or the [UMD bundle](https://raw.githubusercontent.com/i3-Market-V2-Public-Repository/SP3-SCGBSSW-CR-NonRepudiationLibrary/main/dist/bundle.umd.js) and manually add it to your project, or, if you have already installed `@i3m/non-repudiation-library` in your project, just get the bundles from `node_modules/@i3m/non-repudiation-library/dist/bundles/`. ### Example for an i3-MARKET Provider running the Non-Repudiation Protocol diff --git a/build/bin/mocha-ts.cjs b/build/bin/mocha-ts.cjs index 2a96f20..c8dbe49 100644 --- a/build/bin/mocha-ts.cjs +++ b/build/bin/mocha-ts.cjs @@ -2,7 +2,7 @@ const fs = require('fs') const path = require('path') const glob = require('glob') -const minimatch = require('minimatch') +const minimatch = require('minimatch').minimatch const rimraf = require('rimraf') const runScript = require('../run-script.cjs') @@ -58,9 +58,11 @@ function parse () { process.exit(1) } - let testsGlob = (args.pop() ?? '').replace(/^['"]/, '').replace(/['"]$/, '') // Let us remove surrounding quotes in string (it gives issues in windows) - if (testsGlob === '') { + let testsGlob = args.pop() + if (testsGlob === undefined) { testsGlob = '{src/ts/**/*.spec.ts,test/**/*.ts}' + } else { + testsGlob = testsGlob.replace(/^['"]/, '').replace(/['"]$/, '') // Let us remove surrounding quotes in string (it gives issues in windows) } const mochaArgs = [] diff --git a/build/build.docs.cjs b/build/build.docs.cjs index f975cf9..5eef1e6 100644 --- a/build/build.docs.cjs +++ b/build/build.docs.cjs @@ -48,8 +48,6 @@ async function typedoc () { const tsConfig = json5.parse(fs.readFileSync(tsConfigPath, 'utf8')) tsConfig.include = ['src/ts/**/*', 'build/typings/**/*.d.ts'] tsConfig.exclude = ['src/**/*.spec.ts'] - delete tsConfig.compilerOptions.outDir - // delete tsConfig.exclude fs.writeFileSync(tempTsConfigPath, JSON.stringify(tsConfig, undefined, 2)) // If you want TypeDoc to load tsconfig.json / typedoc.json files @@ -68,10 +66,7 @@ async function typedoc () { excludePrivate: true }) - // This is the part that seems to skip compile errors - // (normally we would call `app.convert()` here) - const project = app.converter.convert(app.getEntryPoints() ?? []) - // const project = app.convert() + const project = app.convert() if (project) { // Project may not have converted correctly diff --git a/build/rollup-plugin-dts.js b/build/rollup-plugin-dts.js index 547c668..b5151a3 100644 --- a/build/rollup-plugin-dts.js +++ b/build/rollup-plugin-dts.js @@ -1,4 +1,4 @@ -import { mkdirSync, readFileSync, writeFileSync } from 'fs' +import { mkdirSync, writeFileSync } from 'fs' import ts from 'typescript' import { join, dirname, extname } from 'path' import { sync } from 'rimraf' @@ -8,9 +8,7 @@ const __dirname = url.fileURLToPath(new URL('.', import.meta.url)) const { readJsonConfigFile, sys, parseJsonSourceFileConfigFileContent, createCompilerHost, createProgram } = ts const rootDir = join(__dirname, '..') -const pkgJson = JSON.parse(readFileSync(join(rootDir, 'package.json'))) const srcFile = join(rootDir, 'src/ts/index.ts') -const outDir = dirname(join(rootDir, pkgJson.types)) const tsConfigPath = join(rootDir, 'tsconfig.json') @@ -20,31 +18,31 @@ const configFile = readJsonConfigFile(tsConfigPath, (file) => { const tsConfig = parseJsonSourceFileConfigFileContent(configFile, sys, dirname(tsConfigPath)) -const compilerOptions = { - ...tsConfig.options, - declaration: true, - declarationMap: true, - emitDeclarationOnly: true, - outDir -} +export const compile = (outDir) => { + const compilerOptions = { + ...tsConfig.options, + declaration: true, + declarationMap: true, + emitDeclarationOnly: true, + outDir + } -const host = createCompilerHost(compilerOptions) + const host = createCompilerHost(compilerOptions) -host.writeFile = (fileName, contents) => { - mkdirSync(dirname(fileName), { recursive: true }) - writeFileSync(fileName, contents) + host.writeFile = (fileName, contents) => { + mkdirSync(dirname(fileName), { recursive: true }) + writeFileSync(fileName, contents) - // we also write the .d.cts types - let fileName2 = '' - if (extname(fileName) === '.ts') { - fileName2 = fileName.slice(0, -2) + 'cts' - } else { // ext is .d.ts.map - fileName2 = fileName.slice(0, -6) + 'cts.map' + // we also write the .d.cts types + let fileName2 = '' + if (extname(fileName) === '.ts') { + fileName2 = fileName.slice(0, -2) + 'cts' + } else { // ext is .d.ts.map + fileName2 = fileName.slice(0, -6) + 'cts.map' + } + writeFileSync(fileName2, contents) } - writeFileSync(fileName2, contents) -} -export const compile = () => { // Clear the types dir sync(outDir) // Prepare and emit the d.ts files diff --git a/build/rollup.config.js b/build/rollup.config.js index 12f1569..88e9345 100644 --- a/build/rollup.config.js +++ b/build/rollup.config.js @@ -1,17 +1,16 @@ 'use strict' +import commonjs from '@rollup/plugin-commonjs' import inject from '@rollup/plugin-inject' +import json from '@rollup/plugin-json' import { nodeResolve as resolve } from '@rollup/plugin-node-resolve' import replace from '@rollup/plugin-replace' import terser from '@rollup/plugin-terser' -import typescriptPlugin from '@rollup/plugin-typescript' -import commonjs from '@rollup/plugin-commonjs' -import json from '@rollup/plugin-json' - -import { dirname, join } from 'path' +import rollupPluginTs from '@rollup/plugin-typescript' import { existsSync, readFileSync } from 'fs' - -// import { browser, name as _name, exports } from '../package.json' assert { type: 'json' } +import { builtinModules } from 'module' +import { join } from 'path' +import dts from 'rollup-plugin-dts' import { compile } from './rollup-plugin-dts.js' import * as url from 'url' @@ -19,9 +18,11 @@ const __dirname = url.fileURLToPath(new URL('.', import.meta.url)) const rootDir = join(__dirname, '..') const pkgJson = JSON.parse(readFileSync(join(rootDir, 'package.json'))) -// const dstDir = join(rootDir, directories.dist) +const pkgJsonLock = JSON.parse(readFileSync(join(rootDir, 'package-lock.json'))) const srcDir = join(rootDir, 'src', 'ts') +const tsConfigPath = join(rootDir, 'tsconfig.json') + function camelise (str) { return str.replace(/-([a-z])/g, function (m, w) { @@ -29,6 +30,11 @@ function camelise (str) { }) } +function isDevDependency (moduleName) { + const packageEntry = pkgJsonLock.packages['node_modules/' + moduleName] + return (packageEntry ?? {}).dev === true +} + const regex = /^(?:(?@.*?)\/)?(?.*)/ // We are going to take only the package name part if there is a scope, e.g. @my-org/package-name const { name } = pkgJson.name.match(regex).groups const pkgCamelisedName = camelise(name) @@ -36,9 +42,9 @@ const pkgCamelisedName = camelise(name) const input = join(srcDir, 'index.ts') if (existsSync(input) !== true) throw new Error('The entry point should be index.ts') -const tsBundleOptions = { - tsconfig: join(rootDir, 'tsconfig.json'), - outDir: undefined, // ignore outDir in tsconfig.json +const tsPluginOptions = { + tsconfig: tsConfigPath, + outDir: undefined, include: ['src/ts/**/*', 'build/typings/is-browser.d.ts'], exclude: ['src/**/*.spec.ts'] } @@ -48,23 +54,47 @@ const sourcemapOutputOptions = { sourcemapExcludeSources: true } -function compileDts () { +function compileDts (outDir) { return { name: 'compile-dts', closeBundle () { - compile() + compile(outDir) } } } +function resolveOnly (module) { // if a dev dependency is imported we will resolve it so that the dist modules always work + const moduleNameMatch = module.match(/^(?:@[a-z0-9_-]+\/)?(?:node:)?[a-z0-9_-]+/) + if (moduleNameMatch === null || moduleNameMatch.length !== 1) { + return false + } + const moduleName = moduleNameMatch[0].replace(/^node:/, '') + // don't resolve if it is a native module + if (builtinModules.includes(moduleName)) { + return false + } + + if (isDevDependency(moduleName)) { + console.warn(`\x1b[33m⚠ WARM: dev dependency \x1b[0m${module}\x1b[33m being bundled. Should it be a dependency instead?\x1b[0m`) + return true + } + + return false +} + +const tmpDeclarationsDir = join(rootDir, '.types') + export default [ - { // Browser ESM bundle + { // Browser ESM input, output: [ { - file: join(rootDir, pkgJson.browser), + file: join(rootDir, pkgJson.exports['.'].default.default), ...sourcemapOutputOptions, - format: 'es' + format: 'es', + plugins: [ + terser() + ] } ], plugins: [ @@ -73,10 +103,15 @@ export default [ _MODULE_TYPE: "'ESM'", preventAssignment: true }), - typescriptPlugin(tsBundleOptions), - resolve({ resolveOnly: [/^@i3m\/.*$/] }), - commonjs({ extensions: ['.js', '.cjs', '.ts', '.jsx', '.cjsx', '.tsx'] }), // the ".ts" extension is required - json({ compact: true }) + rollupPluginTs(tsPluginOptions), + commonjs({ extensions: ['.js', '.cjs', '.jsx', '.cjsx'] }), + json(), + resolve({ + browser: true, + exportConditions: ['browser', 'default'], + mainFields: ['browser', 'module', 'main'], + resolveOnly + }) ] }, { // Browser bundles @@ -110,17 +145,13 @@ export default [ _MODULE_TYPE: "'BUNDLE'", preventAssignment: true }), - typescriptPlugin({ - ...tsBundleOptions, + rollupPluginTs({ + ...tsPluginOptions, sourceMap: false }), - resolve({ - browser: true, - exportConditions: ['browser', 'default'], - mainFields: ['browser', 'module', 'main'] - }), - commonjs({ extensions: ['.js', '.cjs', '.ts', '.jsx', '.cjsx', '.tsx'] }), // the ".ts" extension is required - json({ compact: true }) + commonjs({ extensions: ['.js', '.cjs', '.jsx', '.cjsx'] }), + json(), + resolve({ browser: true }) ] }, { // Node CJS @@ -137,18 +168,26 @@ export default [ } ], plugins: [ + replace({ + 'await import(': 'require(', + delimiters: ['', ''], + preventAssignment: true + }), replace({ IS_BROWSER: false, _MODULE_TYPE: "'CJS'", preventAssignment: true }), + rollupPluginTs(tsPluginOptions), inject({ crypto: ['crypto', 'webcrypto'] }), - typescriptPlugin(tsBundleOptions), - resolve({ resolveOnly: [/^@i3m\/.*$/] }), - commonjs({ extensions: ['.js', '.cjs', '.ts', '.jsx', '.cjsx', '.tsx'] }), // the ".ts" extension is required - json({ compact: true }) + commonjs({ extensions: ['.js', '.cjs', '.jsx', '.cjsx'] }), + json(), + resolve({ + exportConditions: ['node'], + resolveOnly + }) ] }, { // Node ESM and type declarations @@ -167,22 +206,37 @@ export default [ replace({ IS_BROWSER: false, _MODULE_TYPE: "'ESM'", - __filename: `'${pkgJson.exports['.'].node.import.default}'`, - __dirname: `'${dirname(pkgJson.exports['.'].node.import.default)}'`, + __filename: 'fileURLToPath(import.meta.url)', + __dirname: 'fileURLToPath(new URL(\'.\', import.meta.url))', preventAssignment: true }), + rollupPluginTs(tsPluginOptions), + compileDts(tmpDeclarationsDir), inject({ - crypto: ['crypto', 'webcrypto'] + crypto: ['crypto', 'webcrypto'], + fileURLToPath: ['url', 'fileURLToPath'] }), - typescriptPlugin(tsBundleOptions), - // resolve({ - // browser: false, - // exportConditions: ['node'] - // }), - resolve({ resolveOnly: [/^@i3m\/.*$/] }), - compileDts(), - commonjs({ extensions: ['.js', '.cjs', '.ts', '.jsx', '.cjsx', '.tsx'] }), // the ".ts" extension is required - json({ compact: true }) + commonjs({ extensions: ['.js', '.cjs', '.jsx', '.cjsx'] }), + json(), + resolve({ + exportConditions: ['node'], + resolveOnly + }) ] + }, + { + input: join(tmpDeclarationsDir, 'index.d.ts'), + output: [{ file: 'dist/index.d.ts', format: 'es' }], + plugins: [ + dts({ + respectExternal: true + }) + ], + external: (module) => { + if (/^[./]/.test(module)) { + return false + } + return !resolveOnly(module) + } } ] diff --git a/build/testing/browser/index.cjs b/build/testing/browser/index.cjs index f455aa8..32ab5f4 100644 --- a/build/testing/browser/index.cjs +++ b/build/testing/browser/index.cjs @@ -1,7 +1,7 @@ const path = require('path') const puppeteer = require('puppeteer') -const minimatch = require('minimatch') +const minimatch = require('minimatch').minimatch const glob = require('glob') const rootDir = path.join(__dirname, '../../..') const pkgJson = require(path.join(rootDir, 'package.json')) diff --git a/build/testing/browser/server.cjs b/build/testing/browser/server.cjs index b9b8917..ea1ebb6 100644 --- a/build/testing/browser/server.cjs +++ b/build/testing/browser/server.cjs @@ -60,24 +60,20 @@ async function buildTests (testFiles) { input: testFiles, plugins: [ multi(), - replace({ - '#pkg': `/${name}.esm.js`, - delimiters: ['', ''], - preventAssignment: true - }), replace({ IS_BROWSER: true, _MODULE_TYPE: "'ESM'", preventAssignment: true }), typescriptPlugin(tsBundleOptions), - resolve({ - browser: true, - exportConditions: ['browser', 'default'], - mainFields: ['browser', 'module', 'main'] - }), - commonjs(), - json() + commonjs({ extensions: ['.js', '.cjs', '.jsx', '.cjsx'] }), + json(), + resolve({ browser: true }), + replace({ + '#pkg': `/${name}.esm.js`, + delimiters: ['', ''], + preventAssignment: true + }) ], external: [`/${name}.esm.js`] } diff --git a/dist/bundles/esm.js b/dist/bundle.esm.js similarity index 90% rename from dist/bundles/esm.js rename to dist/bundle.esm.js index 6138ddd..6975c00 100644 --- a/dist/bundles/esm.js +++ b/dist/bundle.esm.js @@ -1,138 +1,8 @@ -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 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}} -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 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 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 randBytes(byteLength, forceLength = false) { - if (byteLength < 1) - throw new RangeError('byteLength MUST be > 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; - } -} +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 { function isObjectLike(value) { return typeof value === 'object' && value !== null; } -function isObject$2(input) { +function isObject$1(input) { if (!isObjectLike(input) || Object.prototype.toString.call(input) !== '[object Object]') { return false; } @@ -10010,7 +9947,7 @@ var asKeyObject = parse$1; async function importJWK(jwk, alg, octAsKeyObject) { var _a; - if (!isObject$2(jwk)) { + if (!isObject$1(jwk)) { throw new TypeError('JWK must be an object'); } alg || (alg = jwk.alg); @@ -10164,7 +10101,7 @@ async function decryptKeyManagement(alg, key, encryptedKey, joseHeader, options) case 'ECDH-ES+A128KW': case 'ECDH-ES+A192KW': case 'ECDH-ES+A256KW': { - if (!isObject$2(joseHeader.epk)) + if (!isObject$1(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'); @@ -10283,7 +10220,7 @@ const validateAlgorithms = (option, algorithms) => { async function flattenedDecrypt(jwe, key, options) { var _a; - if (!isObject$2(jwe)) { + if (!isObject$1(jwe)) { throw new JWEInvalid('Flattened JWE must be an object'); } if (jwe.protected === undefined && jwe.header === undefined && jwe.unprotected === undefined) { @@ -10307,10 +10244,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$2(jwe.header)) { + if (jwe.header !== undefined && !isObject$1(jwe.header)) { throw new JWEInvalid('JWE Shared Unprotected Header incorrect type'); } - if (jwe.unprotected !== undefined && !isObject$2(jwe.unprotected)) { + if (jwe.unprotected !== undefined && !isObject$1(jwe.unprotected)) { throw new JWEInvalid('JWE Per-Recipient Unprotected Header incorrect type'); } let parsedProt; @@ -10755,7 +10692,7 @@ const verify = async (alg, key, signature, data) => { async function flattenedVerify(jws, key, options) { var _a; - if (!isObject$2(jws)) { + if (!isObject$1(jws)) { throw new JWSInvalid('Flattened JWS must be an object'); } if (jws.protected === undefined && jws.header === undefined) { @@ -10770,7 +10707,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$2(jws.header)) { + if (jws.header !== undefined && !isObject$1(jws.header)) { throw new JWSInvalid('JWS Unprotected Header incorrect type'); } let parsedProt = {}; @@ -10869,10 +10806,10 @@ async function compactVerify(jws, key, options) { } async function generalVerify(jws, key, options) { - if (!isObject$2(jws)) { + if (!isObject$1(jws)) { throw new JWSInvalid('General JWS must be an object'); } - if (!Array.isArray(jws.signatures) || !jws.signatures.every(isObject$2)) { + if (!Array.isArray(jws.signatures) || !jws.signatures.every(isObject$1)) { throw new JWSInvalid('JWS Signatures missing or incorrect type'); } for (const signature of jws.signatures) { @@ -10960,7 +10897,7 @@ var jwtPayload = (protectedHeader, encodedPayload, options = {}) => { } catch (_a) { } - if (!isObject$2(payload)) { + if (!isObject$1(payload)) { throw new JWTInvalid('JWT Claims Set must be a top-level JSON object'); } const { issuer } = options; @@ -11221,7 +11158,7 @@ class GeneralSign { jws.payload = payload; } else if (jws.payload !== payload) { - throw new JWSInvalid('inconsistent use of JWS Unencoded Payload Option (RFC7797)'); + throw new JWSInvalid('inconsistent use of JWS Unencoded Payload (RFC7797)'); } jws.signatures.push(rest); } @@ -11231,7 +11168,7 @@ class GeneralSign { class ProduceJWT { constructor(payload) { - if (!isObject$2(payload)) { + if (!isObject$1(payload)) { throw new TypeError('JWT Claims Set MUST be an object'); } this._payload = payload; @@ -11322,7 +11259,7 @@ function decodeProtectedHeader(token) { throw new Error(); } const result = JSON.parse(decoder.decode(decode$3(protectedB64u))); - if (!isObject$2(result)) { + if (!isObject$1(result)) { throw new Error(); } return result; @@ -11454,8 +11391,8 @@ async function jwsDecode(jws, publicJwk) { let header; let payload; try { - header = JSON.parse(decode$5(match[1], true)); - payload = JSON.parse(decode$5(match[2], true)); + header = JSON.parse(r$4(match[1], true)); + payload = JSON.parse(r$4(match[2], true)); } catch (error) { throw new NrError(error, ['invalid format', 'not a compact jws']); @@ -11495,14 +11432,14 @@ async function oneTimeSecret(encAlg, secret, base64) { if (secret !== undefined) { if (typeof secret === 'string') { if (base64 === true) { - key = decode$5(secret); + key = r$4(secret); } else { - const parsedSecret = parseHex$1(secret, false); - if (parsedSecret !== parseHex$1(secret, false, secretLength)) { + const parsedSecret = n$1(secret, false); + if (parsedSecret !== n$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(hexToBuf(secret)); + key = new Uint8Array(l(secret)); } } else { @@ -11522,7 +11459,7 @@ async function oneTimeSecret(encAlg, secret, base64) { } const jwk = await exportJWK(key); jwk.alg = encAlg; - return { jwk: jwk, hex: bufToHex(decode$5(jwk.k), false, secretLength) }; + return { jwk: jwk, hex: g$1(r$4(jwk.k), false, secretLength) }; } async function verifyKeyPair(pubJWK, privJWK) { @@ -11532,7 +11469,7 @@ async function verifyKeyPair(pubJWK, privJWK) { const pubKey = await importJwk(pubJWK); const privKey = await importJwk(privJWK); try { - const nonce = await randBytes(16); + const nonce = await g(16); const jws = await new GeneralSign(nonce) .addSignature(privKey) .setProtectedHeader({ alg: privJWK.alg }) @@ -11544,30 +11481,7 @@ async function verifyKeyPair(pubJWK, privJWK) { } } -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 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 checkTimestamp(timestamp, notBefore, notAfter, tolerance = 2000) { if (timestamp < notBefore - tolerance) { @@ -11599,7 +11513,7 @@ function jsonSort(obj) { function parseHex(a, prefix0x = false, byteLength) { try { - return parseHex$1(a, prefix0x, byteLength); + return n$1(a, prefix0x, byteLength); } catch (error) { throw new NrError(error, ['invalid format']); @@ -11636,11 +11550,7 @@ async function sha(input, algorithm) { } } -var bnExports = {}; -var bn = { - get exports(){ return bnExports; }, - set exports(v){ bnExports = v; }, -}; +var bn = {exports: {}}; (function (module) { (function (module, exports) { @@ -14990,10 +14900,11 @@ var bn = { var res = this.imod(a._invmp(this.m).mul(this.r2)); return res._forceRed(this); }; - })(module, commonjsGlobal); + })(module, commonjsGlobal); } (bn)); -var BN$1 = bnExports; +var bnExports = bn.exports; +var BN$1 = /*@__PURE__*/getDefaultExportFromCjs(bnExports); const version$o = "logger/5.7.0"; @@ -15347,10 +15258,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"; @@ -15762,23 +15673,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"; @@ -16556,14 +16467,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"; @@ -17557,11 +17468,7 @@ class Reader { } } -var sha3Exports = {}; -var sha3$1 = { - get exports(){ return sha3Exports; }, - set exports(v){ sha3Exports = v; }, -}; +var sha3$1 = {exports: {}}; /** * [js-sha3]{@link https://github.com/emn178/js-sha3} @@ -18213,18 +18120,19 @@ var sha3$1 = { root[methodNames[i]] = methods[methodNames[i]]; } } - })(); + })(); } (sha3$1)); -var sha3 = sha3Exports; +var sha3Exports = sha3$1.exports; +var sha3 = /*@__PURE__*/getDefaultExportFromCjs(sha3Exports); function keccak256$1(data) { return '0x' + sha3.keccak_256(arrayify(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"; @@ -18345,9 +18253,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"; @@ -18479,12 +18387,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 { @@ -19311,17 +19219,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 { @@ -19496,9 +19404,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 }); /** @@ -20434,15 +20342,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); @@ -21043,21 +20951,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"; @@ -23926,10 +23834,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"; @@ -24304,13 +24212,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"; @@ -25312,10 +25220,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; @@ -25347,12 +25255,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) { @@ -25784,14 +25692,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"; @@ -25845,16 +25753,12 @@ function shuffled(array) { } var lib_esm$5 = /*#__PURE__*/Object.freeze({ - __proto__: null, - randomBytes: randomBytes, - shuffled: shuffled + __proto__: null, + randomBytes: randomBytes, + shuffled: shuffled }); -var aesJsExports = {}; -var aesJs = { - get exports(){ return aesJsExports; }, - set exports(v){ aesJsExports = v; }, -}; +var aesJs = {exports: {}}; (function (module, exports) { @@ -26641,10 +26545,11 @@ var aesJs = { } - })(); + })(); } (aesJs)); -var aes = aesJsExports; +var aesJsExports = aesJs.exports; +var aes = /*@__PURE__*/getDefaultExportFromCjs(aesJsExports); const version$6 = "json-wallets/5.7.0"; @@ -26792,11 +26697,7 @@ function getJsonWalletAddress(json) { return null; } -var scryptExports = {}; -var scrypt$1 = { - get exports(){ return scryptExports; }, - set exports(v){ scryptExports = v; }, -}; +var scrypt$1 = {exports: {}}; (function (module, exports) { @@ -27273,10 +27174,11 @@ var scrypt$1 = { // https://github.com/amdjs/amdjs-api/wiki/AMD } - })(); + })(); } (scrypt$1)); -var scrypt = scryptExports; +var scryptExports = scrypt$1.exports; +var scrypt = /*@__PURE__*/getDefaultExportFromCjs(scryptExports); var __awaiter$5 = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } @@ -27606,16 +27508,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"; @@ -27782,10 +27684,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"; @@ -28498,10 +28400,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'; @@ -28686,6 +28588,8 @@ var bech32 = { fromWords: fromWords }; +var bech32$1 = /*@__PURE__*/getDefaultExportFromCjs(bech32); + const version$2 = "providers/5.7.2"; const logger$4 = new Logger(version$2); @@ -29457,9 +29361,9 @@ class Resolver { version = -1; } if (version >= 0 && bytes.length === 2 + length && length >= 1 && length <= 75) { - const words = bech32.toWords(bytes.slice(2)); + const words = bech32$1.toWords(bytes.slice(2)); words.unshift(version); - return bech32.encode(coinInfo.prefix, words); + return bech32$1.encode(coinInfo.prefix, words); } } return null; @@ -31836,10 +31740,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"; @@ -31925,12 +31829,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) { @@ -31960,7 +31864,7 @@ function getDltAddress(didOrKeyInHex) { } async function exchangeId(exchange) { - return encode$4(await sha(hashable(exchange), 'SHA-256'), true, false); + return e(await sha(t(exchange), 'SHA-256'), true, false); } async function createProof(payload, privateJwk) { @@ -32002,7 +31906,7 @@ async function verifyProof(proof, expectedPayloadClaims, options) { } const payload = verification.payload; const issuer = payload.exchange[payload.iss]; - if (hashable(publicJwk) !== hashable(JSON.parse(issuer))) { + if (t(publicJwk) !== t(JSON.parse(issuer))) { throw new Error(`The proof is issued by ${issuer} instead of ${JSON.stringify(publicJwk)}`); } const expectedClaimsDict = expectedPayloadClaims; @@ -32014,7 +31918,7 @@ async function verifyProof(proof, expectedPayloadClaims, options) { const dataExchange = payload.exchange; checkDataExchange(dataExchange, expectedDataExchange); } - else if (expectedClaimsDict[key] !== '' && hashable(expectedClaimsDict[key]) !== hashable(payload[key])) { + else if (expectedClaimsDict[key] !== '' && t(expectedClaimsDict[key]) !== t(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)}`); } } @@ -32028,7 +31932,7 @@ function checkDataExchange(dataExchange, expectedDataExchange) { } } for (const key in expectedDataExchange) { - if (expectedDataExchange[key] !== '' && hashable(expectedDataExchange[key]) !== hashable(dataExchange[key])) { + if (expectedDataExchange[key] !== '' && t(expectedDataExchange[key]) !== t(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)}`); } } @@ -32142,7 +32046,7 @@ async function checkDecryption(disputeRequest, wallet) { } throw error; } - const cipherblockDgst = encode$4(await sha(drPayload.cipherblock, porPayload.exchange.hashAlg), true, false); + const cipherblockDgst = e(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']); } @@ -32270,16 +32174,207 @@ 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";var 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"}];var transactionHash="0x6a3828f8fe232819dc40ca66f93930b3bd1619db31a67ec34b44446b3e7c8289";var 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:true};var args=[];var solcInputHash="c528a37588793ef74285d75e08d6b8eb";var metadata$1="{\"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}";var bytecode="0x608060405234801561001057600080fd5b506103a2806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c8063032439371461003b578063d05cb54514610057575b600080fd5b6100556004803603810190610050919061023a565b610088565b005b610071600480360381019061006c91906101fe565b6101a3565b60405161007f9291906102d9565b60405180910390f35b60008060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002060010154146100e757600080fd5b6040518060400160405280428152602001828152506000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002060008201518160000155602082015181600101559050507faa58599838af2e5e0f3251cfbb4eac5d5d447ded49f6b0ac28d6b44098224e63338342846040516101979493929190610294565b60405180910390a15050565b6000602052816000526040600020602052806000526040600020600091509150508060000154908060010154905082565b6000813590506101e38161033e565b92915050565b6000813590506101f881610355565b92915050565b6000806040838503121561021157600080fd5b600061021f858286016101d4565b9250506020610230858286016101e9565b9150509250929050565b6000806040838503121561024d57600080fd5b600061025b858286016101e9565b925050602061026c858286016101e9565b9150509250929050565b61027f81610302565b82525050565b61028e81610334565b82525050565b60006080820190506102a96000830187610276565b6102b66020830186610285565b6102c36040830185610285565b6102d06060830184610285565b95945050505050565b60006040820190506102ee6000830185610285565b6102fb6020830184610285565b9392505050565b600061030d82610314565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b61034781610302565b811461035257600080fd5b50565b61035e81610334565b811461036957600080fd5b5056fea26469706673582212204fd0fc653fb487221da9a14a4ca5d5499f9e9bc7b27ac8ab0f8d397fd6e3148564736f6c63430008040033";var deployedBytecode="0x608060405234801561001057600080fd5b50600436106100365760003560e01c8063032439371461003b578063d05cb54514610057575b600080fd5b6100556004803603810190610050919061023a565b610088565b005b610071600480360381019061006c91906101fe565b6101a3565b60405161007f9291906102d9565b60405180910390f35b60008060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002060010154146100e757600080fd5b6040518060400160405280428152602001828152506000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002060008201518160000155602082015181600101559050507faa58599838af2e5e0f3251cfbb4eac5d5d447ded49f6b0ac28d6b44098224e63338342846040516101979493929190610294565b60405180910390a15050565b6000602052816000526040600020602052806000526040600020600091509150508060000154908060010154905082565b6000813590506101e38161033e565b92915050565b6000813590506101f881610355565b92915050565b6000806040838503121561021157600080fd5b600061021f858286016101d4565b9250506020610230858286016101e9565b9150509250929050565b6000806040838503121561024d57600080fd5b600061025b858286016101e9565b925050602061026c858286016101e9565b9150509250929050565b61027f81610302565b82525050565b61028e81610334565b82525050565b60006080820190506102a96000830187610276565b6102b66020830186610285565b6102c36040830185610285565b6102d06060830184610285565b95945050505050565b60006040820190506102ee6000830185610285565b6102fb6020830184610285565b9392505050565b600061030d82610314565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b61034781610302565b811461035257600080fd5b50565b61035e81610334565b811461036957600080fd5b5056fea26469706673582212204fd0fc653fb487221da9a14a4ca5d5499f9e9bc7b27ac8ab0f8d397fd6e3148564736f6c63430008040033";var devdoc={kind:"dev",methods:{},version:1};var userdoc={kind:"user",methods:{},version:1};var 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"}}};var contractConfig = {address:address,abi:abi,transactionHash:transactionHash,receipt:receipt,args:args,solcInputHash:solcInputHash,metadata:metadata$1,bytecode:bytecode,deployedBytecode:deployedBytecode,devdoc:devdoc,userdoc:userdoc,storageLayout:storageLayout}; +var address = "0x8d407A1722633bDD1dcf221474be7a44C05d7c2F"; +var 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" + } +]; +var transactionHash = "0x6a3828f8fe232819dc40ca66f93930b3bd1619db31a67ec34b44446b3e7c8289"; +var 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: true +}; +var args = [ +]; +var solcInputHash = "c528a37588793ef74285d75e08d6b8eb"; +var metadata$1 = "{\"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}"; +var bytecode = "0x608060405234801561001057600080fd5b506103a2806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c8063032439371461003b578063d05cb54514610057575b600080fd5b6100556004803603810190610050919061023a565b610088565b005b610071600480360381019061006c91906101fe565b6101a3565b60405161007f9291906102d9565b60405180910390f35b60008060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002060010154146100e757600080fd5b6040518060400160405280428152602001828152506000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002060008201518160000155602082015181600101559050507faa58599838af2e5e0f3251cfbb4eac5d5d447ded49f6b0ac28d6b44098224e63338342846040516101979493929190610294565b60405180910390a15050565b6000602052816000526040600020602052806000526040600020600091509150508060000154908060010154905082565b6000813590506101e38161033e565b92915050565b6000813590506101f881610355565b92915050565b6000806040838503121561021157600080fd5b600061021f858286016101d4565b9250506020610230858286016101e9565b9150509250929050565b6000806040838503121561024d57600080fd5b600061025b858286016101e9565b925050602061026c858286016101e9565b9150509250929050565b61027f81610302565b82525050565b61028e81610334565b82525050565b60006080820190506102a96000830187610276565b6102b66020830186610285565b6102c36040830185610285565b6102d06060830184610285565b95945050505050565b60006040820190506102ee6000830185610285565b6102fb6020830184610285565b9392505050565b600061030d82610314565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b61034781610302565b811461035257600080fd5b50565b61035e81610334565b811461036957600080fd5b5056fea26469706673582212204fd0fc653fb487221da9a14a4ca5d5499f9e9bc7b27ac8ab0f8d397fd6e3148564736f6c63430008040033"; +var deployedBytecode = "0x608060405234801561001057600080fd5b50600436106100365760003560e01c8063032439371461003b578063d05cb54514610057575b600080fd5b6100556004803603810190610050919061023a565b610088565b005b610071600480360381019061006c91906101fe565b6101a3565b60405161007f9291906102d9565b60405180910390f35b60008060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002060010154146100e757600080fd5b6040518060400160405280428152602001828152506000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002060008201518160000155602082015181600101559050507faa58599838af2e5e0f3251cfbb4eac5d5d447ded49f6b0ac28d6b44098224e63338342846040516101979493929190610294565b60405180910390a15050565b6000602052816000526040600020602052806000526040600020600091509150508060000154908060010154905082565b6000813590506101e38161033e565b92915050565b6000813590506101f881610355565b92915050565b6000806040838503121561021157600080fd5b600061021f858286016101d4565b9250506020610230858286016101e9565b9150509250929050565b6000806040838503121561024d57600080fd5b600061025b858286016101e9565b925050602061026c858286016101e9565b9150509250929050565b61027f81610302565b82525050565b61028e81610334565b82525050565b60006080820190506102a96000830187610276565b6102b66020830186610285565b6102c36040830185610285565b6102d06060830184610285565b95945050505050565b60006040820190506102ee6000830185610285565b6102fb6020830184610285565b9392505050565b600061030d82610314565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b61034781610302565b811461035257600080fd5b50565b61035e81610334565b811461036957600080fd5b5056fea26469706673582212204fd0fc653fb487221da9a14a4ca5d5499f9e9bc7b27ac8ab0f8d397fd6e3148564736f6c63430008040033"; +var devdoc = { + kind: "dev", + methods: { + }, + version: 1 +}; +var userdoc = { + kind: "user", + methods: { + }, + version: 1 +}; +var 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" + } + } +}; +var contractConfig = { + address: address, + abi: abi, + transactionHash: transactionHash, + receipt: receipt, + args: args, + solcInputHash: solcInputHash, + metadata: metadata$1, + bytecode: bytecode, + deployedBytecode: deployedBytecode, + devdoc: devdoc, + userdoc: userdoc, + storageLayout: storageLayout +}; const defaultDltConfig = { gasLimit: 12500000, @@ -32289,7 +32384,7 @@ const defaultDltConfig = { async function getSecretFromLedger(contract, signerAddress, exchangeId, timeout, secretLength) { let secretBn = BigNumber.from(0); let timestampBn = BigNumber.from(0); - const exchangeIdHex = parseHex(bufToHex(decode$5(exchangeId)), true); + const exchangeIdHex = parseHex(g$1(r$4(exchangeId)), true); let counter = 0; do { try { @@ -32312,7 +32407,7 @@ async function getSecretFromLedger(contract, signerAddress, exchangeId, timeout, } async function secretUnisgnedTransaction(secretHex, exchangeId, agent) { const secret = BigNumber.from(parseHex(secretHex, true)); - const exchangeIdHex = parseHex(bufToHex(decode$5(exchangeId)), true); + const exchangeIdHex = parseHex(g$1(r$4(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; @@ -32623,10 +32718,10 @@ class EthersIoAgentOrig extends EthersIoAgent { this.count = -1; let privKey; if (privateKey === undefined) { - privKey = randBytesSync(32); + privKey = m(32); } else { - privKey = (typeof privateKey === 'string') ? new Uint8Array(hexToBuf(privateKey)) : privateKey; + privKey = (typeof privateKey === 'string') ? new Uint8Array(l(privateKey)) : privateKey; } const signingKey = new utils.SigningKey(privKey); this.signer = new Wallet(signingKey, this.provider); @@ -32720,22 +32815,5907 @@ 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";var info={version:"v2",title:"i3M-Wallet Developers API",description:"i3M-Wallet Developers API that can be used to interact with the i3M-Wallet. In production it is encapsulated inside a secure connection. Please use the @i3m/wallet-protocol-api to interact with the wallet.",license:{name:"EUPL-1.2",url:"https://joinup.ec.europa.eu/sites/default/files/custom-page/attachment/2020-03/EUPL-1.2%20EN.txt"},contact:{name:"Juan Hernández Serrano",email:"j.hernandez@upc.edu",url:"https://github.com/juanelas"}};var tags=[{name:"identities",description:"Endpoints to manage identities (DIDs).\n"},{name:"resources",description:"Besides identities, the wallet MAY securely store arbitrary resources in a secure vault, which may be selectively disclosed upon request. Currently storing verifiable credentials\n"},{name:"selectiveDisclosure",description:"Ednpoints for the selective disclosure process (used to present verifiable credentials)\n"},{name:"transaction",description:"Endpoints for deploying signed transactions to the DLT the wallet is connected to.\n"},{name:"utils",description:"Additional helpler functions\n"}];var paths={"/identities":{get:{summary:"List all DIDs",operationId:"identityList","x-eov-operation-handler":"identities",tags:["identities"],parameters:[{"in":"query",name:"alias",schema:{type:"string",description:"An alias for the identity"}}],responses:{"200":{description:"An array of identities",content:{"application/json":{schema:{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"]}}}}},"default":{description:"unexpected error",content:{"application/json":{schema:{type:"object",title:"Error",required:["code","message"],properties:{code:{type:"integer",format:"int32"},message:{type:"string"}}}}}}}},post:{summary:"Create an account",operationId:"identityCreate","x-eov-operation-handler":"identities",tags:["identities"],requestBody:{description:"Create a DID.",required:false,content:{"application/json":{schema:{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:true}}}},responses:{"201":{description:"the ID and type of the created account",content:{"application/json":{schema:{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:true,required:["did"]}}}},"default":{description:"unexpected error",content:{"application/json":{schema:{type:"object",title:"Error",required:["code","message"],properties:{code:{type:"integer",format:"int32"},message:{type:"string"}}}}}}}}},"/identities/select":{get:{summary:"Gets an identity selected by the user.",operationId:"identitySelect","x-eov-operation-handler":"identities",tags:["identities"],parameters:[{"in":"query",name:"reason",schema:{type:"string",description:"Message to show to the user with the reason to pick an identity"}}],responses:{"200":{description:"Selected identity",content:{"application/json":{schema:{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"]}}}},"default":{description:"unexpected error",content:{"application/json":{schema:{type:"object",title:"Error",required:["code","message"],properties:{code:{type:"integer",format:"int32"},message:{type:"string"}}}}}}}}},"/identities/{did}/sign":{post:{summary:"Signs a message",operationId:"identitySign","x-eov-operation-handler":"identities",tags:["identities"],parameters:[{"in":"path",name:"did",schema:{description:"a DID using the 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:true}],requestBody:{description:"Data to sign.",required:true,content:{"application/json":{schema:{title:"SignInput",oneOf:[{title:"SignTransaction",type:"object",properties:{type:{"enum":["Transaction"]},data:{title:"Transaction",type:"object",additionalProperties:true,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:true},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:true}},required:["payload"]}},required:["type","data"]}]}}}},responses:{"200":{description:"Signed data",content:{"application/json":{schema:{title:"SignOutput",type:"object",properties:{signature:{type:"string"}},required:["signature"]}}}},"default":{description:"unexpected error",content:{"application/json":{schema:{type:"object",title:"Error",required:["code","message"],properties:{code:{type:"integer",format:"int32"},message:{type:"string"}}}}}}}}},"/identities/{did}/info":{get:{summary:"Gets extra information of an identity.",operationId:"identityInfo","x-eov-operation-handler":"identities",tags:["identities"],parameters:[{"in":"path",name:"did",schema:{description:"a DID using the 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:true}],responses:{"200":{description:"Identity data",content:{"application/json":{schema:{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"]}}}},"default":{description:"unexpected error",content:{"application/json":{schema:{type:"object",title:"Error",required:["code","message"],properties:{code:{type:"integer",format:"int32"},message:{type:"string"}}}}}}}}},"/identities/{did}/deploy-tx":{post:{summary:"Signs and deploys a transaction",operationId:"identityDeployTransaction","x-eov-operation-handler":"identities",tags:["identities"],parameters:[{"in":"path",name:"did",schema:{description:"a DID using the 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:true}],requestBody:{description:"Transaction to sign and deploy",required:true,content:{"application/json":{schema:{title:"Transaction",type:"object",additionalProperties:true,properties:{from:{type:"string"},to:{type:"string"},nonce:{type:"number"}}}}}},responses:{"200":{description:"Selected identity",content:{"application/json":{schema:{title:"Receipt",type:"object",properties:{receipt:{type:"string"}},required:["receipt"]}}}},"default":{description:"unexpected error",content:{"application/json":{schema:{type:"object",title:"Error",required:["code","message"],properties:{code:{type:"integer",format:"int32"},message:{type:"string"}}}}}}}}},"/resources":{get:{summary:"Lists the resources that match the filter specified in the query parameters.",operationId:"resourceList","x-eov-operation-handler":"resources",tags:["resources"],parameters:[{"in":"query",name:"type",example:"Contract",required:false,schema:{type:"string","enum":["VerifiableCredential","Object","KeyPair","Contract","DataExchange","NonRepudiationProof"]},description:"Filter the resources by resource type."},{"in":"query",name:"identity",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863",allowEmptyValue:true,required:false,schema:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},description:"Filter the resource associated to an identity DID. Send empty value to get all the resources that are not associated to any identity."},{"in":"query",name:"parentResource",required:false,schema:{type:"string"},description:"Get only resources with the given parent resource id."}],responses:{"200":{description:"A paged array of resources. Only the props requested will be returned. Security policies may prevent some props from being returned.",content:{"application/json":{schema:{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:true,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:true},proof:{type:"object",properties:{type:{type:"string","enum":["JwtProof2020"]}},required:["type"],additionalProperties:true}},additionalProperties:true,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:true}},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:10000},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:20000},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:180000},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:10000},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:20000},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:180000},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"]}]}}}}},"default":{description:"unexpected error",content:{"application/json":{schema:{type:"object",title:"Error",required:["code","message"],properties:{code:{type:"integer",format:"int32"},message:{type:"string"}}}}}}}},post:{summary:"Create a resource",operationId:"resourceCreate","x-eov-operation-handler":"resources",tags:["resources"],requestBody:{description:"Create a resource. Nowadays it only supports storage of verifiable credentials.",content:{"application/json":{schema:{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:true,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:true},proof:{type:"object",properties:{type:{type:"string","enum":["JwtProof2020"]}},required:["type"],additionalProperties:true}},additionalProperties:true,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:true}},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:10000},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:20000},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:180000},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:10000},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:20000},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:180000},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"]}]}}}},responses:{"201":{description:"the ID and type of the created resource",content:{"application/json":{schema:{type:"object",properties:{id:{type:"string"}},required:["id"]}}}},"default":{description:"unexpected error",content:{"application/json":{schema:{type:"object",title:"Error",required:["code","message"],properties:{code:{type:"integer",format:"int32"},message:{type:"string"}}}}}}}}},"/disclosure/{jwt}":{get:{summary:"Request selective disclosure of resources",operationId:"selectiveDisclosure","x-eov-operation-handler":"disclosure",tags:["selectiveDisclosure"],parameters:[{"in":"path",name:"jwt",schema:{type:"string",pattern:"^[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+$"},required:true,description:"A JWT containing a selective disclosure object. The payload MUST contain:\n\n```json\n{\n \"type\": \"selectiveDisclosureReq\", // MUST be selectiveDisclosureReq\n \"iss\": \"did:\", // the DID of the OIDC Provider\n \"aud\": \"\", // DID of the OIDC RP\n \"iat\": 4354535,\t// The time of issuance\n \"exp\": 3452345, // [OPTIONAL] Expiration time of JWT\n callback: \"https://...\", // Callback URL for returning the response to a request\n resources: [\n { \"id\": \"id\", \"mandatory\": true, \"iss\": [ { did: or url:} ], \"reason\": \"\" }\n ]\n}\n```\n"}],responses:{"200":{description:"Disclosure ok (mandatory claims provided)",content:{"application/json":{schema:{type:"object",properties:{jwt:{type:"string"}}}}}},"default":{description:"unexpected error",content:{"application/json":{schema:{type:"object",title:"Error",required:["code","message"],properties:{code:{type:"integer",format:"int32"},message:{type:"string"}}}}}}}}},"/transaction/deploy":{post:{summary:"Deploy a signed transaction",operationId:"transactionDeploy","x-eov-operation-handler":"transaction",tags:["transaction"],requestBody:{description:"Create a resource.",content:{"application/json":{schema:{title:"SignedTransaction",description:"A list of resources",type:"object",properties:{transaction:{type:"string",pattern:"^0x(?:[A-Fa-f0-9])+$"}}}}}},responses:{"200":{description:"Deployment OK"},"default":{description:"unexpected error",content:{"application/json":{schema:{type:"object",title:"Error",required:["code","message"],properties:{code:{type:"integer",format:"int32"},message:{type:"string"}}}}}}}}},"/did-jwt/verify":{post:{summary:"Use the wallet to verify a JWT. The Wallet only supports DID issuers and the 'ES256K1' algorithm. Useful to verify JWT created by another wallet instance.\n",operationId:"didJwtVerify","x-eov-operation-handler":"did-jwt",tags:["utils"],requestBody:{description:"Verify a JWT resolving the public key from the signer DID and optionally check values for expected payload claims",required:true,content:{"application/json":{schema:{type:"object",properties:{jwt:{type:"string",pattern:"^[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+$",example:"eyJhbGciOiJFUzI1NksiLCJ0eXAiOiJKV1QifQ.eyJmaWVsZDEiOiJzYWRzYWQ3NSIsImZpZWxkMiI6ImFmZnNhczlmODdzIiwiaXNzIjoiZGlkOmV0aHI6aTNtOjB4MDNmOTcwNjRhMzUzZmFmNWRkNTQwYWE2N2I2OTE2YmY1NmMwOWM1MGNjODAzN2E0NTNlNzg1ODdmMjdmYjg4ZTk0IiwiaWF0IjoxNjY1NDAwMzYzfQ.IpQ7WprvDMk6QWcJXuPBazat-2657dWIK-iGvOOB5oAhAmMqDBm8OEtKordqeqcEWwhWw_C7_ziMMZkPz1JIkw"},expectedPayloadClaims:{type:"object",additionalProperties:true,description:"The expected values of the proof's payload claims. An expected value of '' can be used to just check that the claim is in the payload. An example could be:\n\n```json\n{\n iss: 'orig',\n exchange: {\n id: '9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d',\n orig: '{\"kty\":\"EC\",\"x\":\"rPMP39e-o8cU6m4WL8_qd2wxo-nBTjWXZtPGBiiGCTY\",\"y\":\"0uvxGEebFDxKOHYUlHREzq4mRULuZvQ6LB2I11yE1E0\",\"crv\":\"P-256\"}', // Public key in JSON.stringify(JWK) of the block origin (sender)\n dest: '{\"kty\":\"EC\",\"x\":\"qf_mNdy57ia1vAq5QLpTPxJUCRhS2003-gL0nLcbXoA\",\"y\":\"H_8YwSCKJhDbZv17YEgDfAiKTaQ8x0jpLYCC2myxAeY\",\"crv\":\"P-256\"}', // Public key in JSON.stringify(JWK) of the block destination (receiver)\n hash_alg: 'SHA-256',\n cipherblock_dgst: 'IBUIstf98_afbiuh7UaifkasytNih7as-Jah61ls9UI', // hash of the cipherblock in base64url with no padding\n block_commitment: '', // hash of the plaintext block in base64url with no padding\n secret_commitment: '' // hash of the secret that can be used to decrypt the block in base64url with no padding\n }\n}\n```\n"}},required:["jwt"]}}}},responses:{"200":{description:"A verification object. If `verification` equals `success` all checkings have passed; if it is `failed`, you can access the error message in `error`. Unless the JWT decoding fails (invalid format), the decoded JWT payload can be accessed in `payload`.\n\nExample of success:\n\n```json\n{\n \"verification\": \"success\",\n \"payload\": {\n \"iss\": \"did:ethr:i3m:0x02d846307c9fd53106eb20db5a774c4b71f25c59c7bc423990f942e3fdb02c5898\",\n \"iat\": 1665138018,\n \"action\": \"buy 1457adf6\"\n }\n}\n```\n\nExample of failure:\n\n```json\n{\n \"verification\": \"failed\",\n \"error\": \"invalid_jwt: JWT iss is required\"\n \"payload\": {\n \"iat\": 1665138018,\n \"action\": \"buy 1457adf6\"\n }\n}\n```\n",content:{"application/json":{schema:{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"]}}}},"default":{description:"unexpected error",content:{"application/json":{schema:{type:"object",title:"Error",required:["code","message"],properties:{code:{type:"integer",format:"int32"},message:{type:"string"}}}}}}}}},"/providerinfo":{get:{summary:"Gets info of the DLT provider the wallet is using",operationId:"providerinfoGet","x-eov-operation-handler":"providerinfo",tags:["utils"],responses:{"200":{description:"A JSON object with information of the DLT provider currently in use.",content:{"application/json":{schema:{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:true}}}},"default":{description:"unexpected error",content:{"application/json":{schema:{type:"object",title:"Error",required:["code","message"],properties:{code:{type:"integer",format:"int32"},message:{type:"string"}}}}}}}}}};var components={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:true,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:true},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:true}},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:true,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:true},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:true}},required:["payload"]}},required:["type","data"]},Transaction:{title:"Transaction",type:"object",additionalProperties:true,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:true},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:true,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:true,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:true},proof:{type:"object",properties:{type:{type:"string","enum":["JwtProof2020"]}},required:["type"],additionalProperties:true}},additionalProperties:true,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:true}},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:10000},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:20000},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:180000},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:10000},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:20000},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:180000},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:true,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:true},proof:{type:"object",properties:{type:{type:"string","enum":["JwtProof2020"]}},required:["type"],additionalProperties:true}},additionalProperties:true,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:true}},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:10000},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:20000},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:180000},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:10000},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:20000},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:180000},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:true,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:true},proof:{type:"object",properties:{type:{type:"string","enum":["JwtProof2020"]}},required:["type"],additionalProperties:true}},additionalProperties:true,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:true}},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:10000},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:20000},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:180000},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:10000},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:20000},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:180000},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:true},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:true},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:true},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:10000},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:20000},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:180000},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:10000},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:20000},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:180000},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:10000},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:20000},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:180000},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"]}]}}};var spec = {openapi:openapi,info:info,tags:tags,paths:paths,components:components}; - -var distExports$1 = {}; -var dist$1 = { - get exports(){ return distExports$1; }, - set exports(v){ distExports$1 = v; }, +var openapi = "3.0.3"; +var info = { + version: "v2", + title: "i3M-Wallet Developers API", + description: "i3M-Wallet Developers API that can be used to interact with the i3M-Wallet. In production it is encapsulated inside a secure connection. Please use the @i3m/wallet-protocol-api to interact with the wallet.", + license: { + name: "EUPL-1.2", + url: "https://joinup.ec.europa.eu/sites/default/files/custom-page/attachment/2020-03/EUPL-1.2%20EN.txt" + }, + contact: { + name: "Juan Hernández Serrano", + email: "j.hernandez@upc.edu", + url: "https://github.com/juanelas" + } +}; +var tags = [ + { + name: "identities", + description: "Endpoints to manage identities (DIDs).\n" + }, + { + name: "resources", + description: "Besides identities, the wallet MAY securely store arbitrary resources in a secure vault, which may be selectively disclosed upon request. Currently storing verifiable credentials\n" + }, + { + name: "selectiveDisclosure", + description: "Ednpoints for the selective disclosure process (used to present verifiable credentials)\n" + }, + { + name: "transaction", + description: "Endpoints for deploying signed transactions to the DLT the wallet is connected to.\n" + }, + { + name: "utils", + description: "Additional helpler functions\n" + } +]; +var paths = { + "/identities": { + get: { + summary: "List all DIDs", + operationId: "identityList", + "x-eov-operation-handler": "identities", + tags: [ + "identities" + ], + parameters: [ + { + "in": "query", + name: "alias", + schema: { + type: "string", + description: "An alias for the identity" + } + } + ], + responses: { + "200": { + description: "An array of identities", + content: { + "application/json": { + schema: { + 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" + ] + } + } + } + } + }, + "default": { + description: "unexpected error", + content: { + "application/json": { + schema: { + type: "object", + title: "Error", + required: [ + "code", + "message" + ], + properties: { + code: { + type: "integer", + format: "int32" + }, + message: { + type: "string" + } + } + } + } + } + } + } + }, + post: { + summary: "Create an account", + operationId: "identityCreate", + "x-eov-operation-handler": "identities", + tags: [ + "identities" + ], + requestBody: { + description: "Create a DID.", + required: false, + content: { + "application/json": { + schema: { + 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: true + } + } + } + }, + responses: { + "201": { + description: "the ID and type of the created account", + content: { + "application/json": { + schema: { + 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: true, + required: [ + "did" + ] + } + } + } + }, + "default": { + description: "unexpected error", + content: { + "application/json": { + schema: { + type: "object", + title: "Error", + required: [ + "code", + "message" + ], + properties: { + code: { + type: "integer", + format: "int32" + }, + message: { + type: "string" + } + } + } + } + } + } + } + } + }, + "/identities/select": { + get: { + summary: "Gets an identity selected by the user.", + operationId: "identitySelect", + "x-eov-operation-handler": "identities", + tags: [ + "identities" + ], + parameters: [ + { + "in": "query", + name: "reason", + schema: { + type: "string", + description: "Message to show to the user with the reason to pick an identity" + } + } + ], + responses: { + "200": { + description: "Selected identity", + content: { + "application/json": { + schema: { + 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" + ] + } + } + } + }, + "default": { + description: "unexpected error", + content: { + "application/json": { + schema: { + type: "object", + title: "Error", + required: [ + "code", + "message" + ], + properties: { + code: { + type: "integer", + format: "int32" + }, + message: { + type: "string" + } + } + } + } + } + } + } + } + }, + "/identities/{did}/sign": { + post: { + summary: "Signs a message", + operationId: "identitySign", + "x-eov-operation-handler": "identities", + tags: [ + "identities" + ], + parameters: [ + { + "in": "path", + name: "did", + schema: { + description: "a DID using the 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: true + } + ], + requestBody: { + description: "Data to sign.", + required: true, + content: { + "application/json": { + schema: { + title: "SignInput", + oneOf: [ + { + title: "SignTransaction", + type: "object", + properties: { + type: { + "enum": [ + "Transaction" + ] + }, + data: { + title: "Transaction", + type: "object", + additionalProperties: true, + 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: true + }, + 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: true + } + }, + required: [ + "payload" + ] + } + }, + required: [ + "type", + "data" + ] + } + ] + } + } + } + }, + responses: { + "200": { + description: "Signed data", + content: { + "application/json": { + schema: { + title: "SignOutput", + type: "object", + properties: { + signature: { + type: "string" + } + }, + required: [ + "signature" + ] + } + } + } + }, + "default": { + description: "unexpected error", + content: { + "application/json": { + schema: { + type: "object", + title: "Error", + required: [ + "code", + "message" + ], + properties: { + code: { + type: "integer", + format: "int32" + }, + message: { + type: "string" + } + } + } + } + } + } + } + } + }, + "/identities/{did}/info": { + get: { + summary: "Gets extra information of an identity.", + operationId: "identityInfo", + "x-eov-operation-handler": "identities", + tags: [ + "identities" + ], + parameters: [ + { + "in": "path", + name: "did", + schema: { + description: "a DID using the 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: true + } + ], + responses: { + "200": { + description: "Identity data", + content: { + "application/json": { + schema: { + 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" + ] + } + } + } + }, + "default": { + description: "unexpected error", + content: { + "application/json": { + schema: { + type: "object", + title: "Error", + required: [ + "code", + "message" + ], + properties: { + code: { + type: "integer", + format: "int32" + }, + message: { + type: "string" + } + } + } + } + } + } + } + } + }, + "/identities/{did}/deploy-tx": { + post: { + summary: "Signs and deploys a transaction", + operationId: "identityDeployTransaction", + "x-eov-operation-handler": "identities", + tags: [ + "identities" + ], + parameters: [ + { + "in": "path", + name: "did", + schema: { + description: "a DID using the 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: true + } + ], + requestBody: { + description: "Transaction to sign and deploy", + required: true, + content: { + "application/json": { + schema: { + title: "Transaction", + type: "object", + additionalProperties: true, + properties: { + from: { + type: "string" + }, + to: { + type: "string" + }, + nonce: { + type: "number" + } + } + } + } + } + }, + responses: { + "200": { + description: "Selected identity", + content: { + "application/json": { + schema: { + title: "Receipt", + type: "object", + properties: { + receipt: { + type: "string" + } + }, + required: [ + "receipt" + ] + } + } + } + }, + "default": { + description: "unexpected error", + content: { + "application/json": { + schema: { + type: "object", + title: "Error", + required: [ + "code", + "message" + ], + properties: { + code: { + type: "integer", + format: "int32" + }, + message: { + type: "string" + } + } + } + } + } + } + } + } + }, + "/resources": { + get: { + summary: "Lists the resources that match the filter specified in the query parameters.", + operationId: "resourceList", + "x-eov-operation-handler": "resources", + tags: [ + "resources" + ], + parameters: [ + { + "in": "query", + name: "type", + example: "Contract", + required: false, + schema: { + type: "string", + "enum": [ + "VerifiableCredential", + "Object", + "KeyPair", + "Contract", + "DataExchange", + "NonRepudiationProof" + ] + }, + description: "Filter the resources by resource type." + }, + { + "in": "query", + name: "identity", + example: "did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863", + allowEmptyValue: true, + required: false, + schema: { + description: "a DID using the ethr resolver", + type: "string", + pattern: "^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$", + example: "did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863" + }, + description: "Filter the resource associated to an identity DID. Send empty value to get all the resources that are not associated to any identity." + }, + { + "in": "query", + name: "parentResource", + required: false, + schema: { + type: "string" + }, + description: "Get only resources with the given parent resource id." + } + ], + responses: { + "200": { + description: "A paged array of resources. Only the props requested will be returned. Security policies may prevent some props from being returned.", + content: { + "application/json": { + schema: { + 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: true, + 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: true + }, + proof: { + type: "object", + properties: { + type: { + type: "string", + "enum": [ + "JwtProof2020" + ] + } + }, + required: [ + "type" + ], + additionalProperties: true + } + }, + additionalProperties: true, + 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: true + } + }, + 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: 10000 + }, + pooToPopDelay: { + description: "Maximum acceptable time in milliseconds between issued PoO and issued PoP", + type: "integer", + minimum: 1, + example: 20000 + }, + pooToSecretDelay: { + description: "Maximum acceptable time between issued PoO and secret published on the ledger", + type: "integer", + minimum: 1, + example: 180000 + }, + 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: 10000 + }, + pooToPopDelay: { + description: "Maximum acceptable time in milliseconds between issued PoO and issued PoP", + type: "integer", + minimum: 1, + example: 20000 + }, + pooToSecretDelay: { + description: "Maximum acceptable time between issued PoO and secret published on the ledger", + type: "integer", + minimum: 1, + example: 180000 + }, + 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" + ] + } + ] + } + } + } + } + }, + "default": { + description: "unexpected error", + content: { + "application/json": { + schema: { + type: "object", + title: "Error", + required: [ + "code", + "message" + ], + properties: { + code: { + type: "integer", + format: "int32" + }, + message: { + type: "string" + } + } + } + } + } + } + } + }, + post: { + summary: "Create a resource", + operationId: "resourceCreate", + "x-eov-operation-handler": "resources", + tags: [ + "resources" + ], + requestBody: { + description: "Create a resource. Nowadays it only supports storage of verifiable credentials.", + content: { + "application/json": { + schema: { + 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: true, + 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: true + }, + proof: { + type: "object", + properties: { + type: { + type: "string", + "enum": [ + "JwtProof2020" + ] + } + }, + required: [ + "type" + ], + additionalProperties: true + } + }, + additionalProperties: true, + 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: true + } + }, + 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: 10000 + }, + pooToPopDelay: { + description: "Maximum acceptable time in milliseconds between issued PoO and issued PoP", + type: "integer", + minimum: 1, + example: 20000 + }, + pooToSecretDelay: { + description: "Maximum acceptable time between issued PoO and secret published on the ledger", + type: "integer", + minimum: 1, + example: 180000 + }, + 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: 10000 + }, + pooToPopDelay: { + description: "Maximum acceptable time in milliseconds between issued PoO and issued PoP", + type: "integer", + minimum: 1, + example: 20000 + }, + pooToSecretDelay: { + description: "Maximum acceptable time between issued PoO and secret published on the ledger", + type: "integer", + minimum: 1, + example: 180000 + }, + 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" + ] + } + ] + } + } + } + }, + responses: { + "201": { + description: "the ID and type of the created resource", + content: { + "application/json": { + schema: { + type: "object", + properties: { + id: { + type: "string" + } + }, + required: [ + "id" + ] + } + } + } + }, + "default": { + description: "unexpected error", + content: { + "application/json": { + schema: { + type: "object", + title: "Error", + required: [ + "code", + "message" + ], + properties: { + code: { + type: "integer", + format: "int32" + }, + message: { + type: "string" + } + } + } + } + } + } + } + } + }, + "/disclosure/{jwt}": { + get: { + summary: "Request selective disclosure of resources", + operationId: "selectiveDisclosure", + "x-eov-operation-handler": "disclosure", + tags: [ + "selectiveDisclosure" + ], + parameters: [ + { + "in": "path", + name: "jwt", + schema: { + type: "string", + pattern: "^[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+$" + }, + required: true, + description: "A JWT containing a selective disclosure object. The payload MUST contain:\n\n```json\n{\n \"type\": \"selectiveDisclosureReq\", // MUST be selectiveDisclosureReq\n \"iss\": \"did:\", // the DID of the OIDC Provider\n \"aud\": \"\", // DID of the OIDC RP\n \"iat\": 4354535,\t// The time of issuance\n \"exp\": 3452345, // [OPTIONAL] Expiration time of JWT\n callback: \"https://...\", // Callback URL for returning the response to a request\n resources: [\n { \"id\": \"id\", \"mandatory\": true, \"iss\": [ { did: or url:} ], \"reason\": \"\" }\n ]\n}\n```\n" + } + ], + responses: { + "200": { + description: "Disclosure ok (mandatory claims provided)", + content: { + "application/json": { + schema: { + type: "object", + properties: { + jwt: { + type: "string" + } + } + } + } + } + }, + "default": { + description: "unexpected error", + content: { + "application/json": { + schema: { + type: "object", + title: "Error", + required: [ + "code", + "message" + ], + properties: { + code: { + type: "integer", + format: "int32" + }, + message: { + type: "string" + } + } + } + } + } + } + } + } + }, + "/transaction/deploy": { + post: { + summary: "Deploy a signed transaction", + operationId: "transactionDeploy", + "x-eov-operation-handler": "transaction", + tags: [ + "transaction" + ], + requestBody: { + description: "Create a resource.", + content: { + "application/json": { + schema: { + title: "SignedTransaction", + description: "A list of resources", + type: "object", + properties: { + transaction: { + type: "string", + pattern: "^0x(?:[A-Fa-f0-9])+$" + } + } + } + } + } + }, + responses: { + "200": { + description: "Deployment OK" + }, + "default": { + description: "unexpected error", + content: { + "application/json": { + schema: { + type: "object", + title: "Error", + required: [ + "code", + "message" + ], + properties: { + code: { + type: "integer", + format: "int32" + }, + message: { + type: "string" + } + } + } + } + } + } + } + } + }, + "/did-jwt/verify": { + post: { + summary: "Use the wallet to verify a JWT. The Wallet only supports DID issuers and the 'ES256K1' algorithm. Useful to verify JWT created by another wallet instance.\n", + operationId: "didJwtVerify", + "x-eov-operation-handler": "did-jwt", + tags: [ + "utils" + ], + requestBody: { + description: "Verify a JWT resolving the public key from the signer DID and optionally check values for expected payload claims", + required: true, + content: { + "application/json": { + schema: { + type: "object", + properties: { + jwt: { + type: "string", + pattern: "^[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+$", + example: "eyJhbGciOiJFUzI1NksiLCJ0eXAiOiJKV1QifQ.eyJmaWVsZDEiOiJzYWRzYWQ3NSIsImZpZWxkMiI6ImFmZnNhczlmODdzIiwiaXNzIjoiZGlkOmV0aHI6aTNtOjB4MDNmOTcwNjRhMzUzZmFmNWRkNTQwYWE2N2I2OTE2YmY1NmMwOWM1MGNjODAzN2E0NTNlNzg1ODdmMjdmYjg4ZTk0IiwiaWF0IjoxNjY1NDAwMzYzfQ.IpQ7WprvDMk6QWcJXuPBazat-2657dWIK-iGvOOB5oAhAmMqDBm8OEtKordqeqcEWwhWw_C7_ziMMZkPz1JIkw" + }, + expectedPayloadClaims: { + type: "object", + additionalProperties: true, + description: "The expected values of the proof's payload claims. An expected value of '' can be used to just check that the claim is in the payload. An example could be:\n\n```json\n{\n iss: 'orig',\n exchange: {\n id: '9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d',\n orig: '{\"kty\":\"EC\",\"x\":\"rPMP39e-o8cU6m4WL8_qd2wxo-nBTjWXZtPGBiiGCTY\",\"y\":\"0uvxGEebFDxKOHYUlHREzq4mRULuZvQ6LB2I11yE1E0\",\"crv\":\"P-256\"}', // Public key in JSON.stringify(JWK) of the block origin (sender)\n dest: '{\"kty\":\"EC\",\"x\":\"qf_mNdy57ia1vAq5QLpTPxJUCRhS2003-gL0nLcbXoA\",\"y\":\"H_8YwSCKJhDbZv17YEgDfAiKTaQ8x0jpLYCC2myxAeY\",\"crv\":\"P-256\"}', // Public key in JSON.stringify(JWK) of the block destination (receiver)\n hash_alg: 'SHA-256',\n cipherblock_dgst: 'IBUIstf98_afbiuh7UaifkasytNih7as-Jah61ls9UI', // hash of the cipherblock in base64url with no padding\n block_commitment: '', // hash of the plaintext block in base64url with no padding\n secret_commitment: '' // hash of the secret that can be used to decrypt the block in base64url with no padding\n }\n}\n```\n" + } + }, + required: [ + "jwt" + ] + } + } + } + }, + responses: { + "200": { + description: "A verification object. If `verification` equals `success` all checkings have passed; if it is `failed`, you can access the error message in `error`. Unless the JWT decoding fails (invalid format), the decoded JWT payload can be accessed in `payload`.\n\nExample of success:\n\n```json\n{\n \"verification\": \"success\",\n \"payload\": {\n \"iss\": \"did:ethr:i3m:0x02d846307c9fd53106eb20db5a774c4b71f25c59c7bc423990f942e3fdb02c5898\",\n \"iat\": 1665138018,\n \"action\": \"buy 1457adf6\"\n }\n}\n```\n\nExample of failure:\n\n```json\n{\n \"verification\": \"failed\",\n \"error\": \"invalid_jwt: JWT iss is required\"\n \"payload\": {\n \"iat\": 1665138018,\n \"action\": \"buy 1457adf6\"\n }\n}\n```\n", + content: { + "application/json": { + schema: { + 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" + ] + } + } + } + }, + "default": { + description: "unexpected error", + content: { + "application/json": { + schema: { + type: "object", + title: "Error", + required: [ + "code", + "message" + ], + properties: { + code: { + type: "integer", + format: "int32" + }, + message: { + type: "string" + } + } + } + } + } + } + } + } + }, + "/providerinfo": { + get: { + summary: "Gets info of the DLT provider the wallet is using", + operationId: "providerinfoGet", + "x-eov-operation-handler": "providerinfo", + tags: [ + "utils" + ], + responses: { + "200": { + description: "A JSON object with information of the DLT provider currently in use.", + content: { + "application/json": { + schema: { + 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: true + } + } + } + }, + "default": { + description: "unexpected error", + content: { + "application/json": { + schema: { + type: "object", + title: "Error", + required: [ + "code", + "message" + ], + properties: { + code: { + type: "integer", + format: "int32" + }, + message: { + type: "string" + } + } + } + } + } + } + } + } + } }; +var components = { + 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: true, + 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: true + }, + 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: true + } + }, + 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: true, + 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: true + }, + 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: true + } + }, + required: [ + "payload" + ] + } + }, + required: [ + "type", + "data" + ] + }, + Transaction: { + title: "Transaction", + type: "object", + additionalProperties: true, + 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: true + }, + 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: true, + 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: true, + 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: true + }, + proof: { + type: "object", + properties: { + type: { + type: "string", + "enum": [ + "JwtProof2020" + ] + } + }, + required: [ + "type" + ], + additionalProperties: true + } + }, + additionalProperties: true, + 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: true + } + }, + 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: 10000 + }, + pooToPopDelay: { + description: "Maximum acceptable time in milliseconds between issued PoO and issued PoP", + type: "integer", + minimum: 1, + example: 20000 + }, + pooToSecretDelay: { + description: "Maximum acceptable time between issued PoO and secret published on the ledger", + type: "integer", + minimum: 1, + example: 180000 + }, + 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: 10000 + }, + pooToPopDelay: { + description: "Maximum acceptable time in milliseconds between issued PoO and issued PoP", + type: "integer", + minimum: 1, + example: 20000 + }, + pooToSecretDelay: { + description: "Maximum acceptable time between issued PoO and secret published on the ledger", + type: "integer", + minimum: 1, + example: 180000 + }, + 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: true, + 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: true + }, + proof: { + type: "object", + properties: { + type: { + type: "string", + "enum": [ + "JwtProof2020" + ] + } + }, + required: [ + "type" + ], + additionalProperties: true + } + }, + additionalProperties: true, + 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: true + } + }, + 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: 10000 + }, + pooToPopDelay: { + description: "Maximum acceptable time in milliseconds between issued PoO and issued PoP", + type: "integer", + minimum: 1, + example: 20000 + }, + pooToSecretDelay: { + description: "Maximum acceptable time between issued PoO and secret published on the ledger", + type: "integer", + minimum: 1, + example: 180000 + }, + 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: 10000 + }, + pooToPopDelay: { + description: "Maximum acceptable time in milliseconds between issued PoO and issued PoP", + type: "integer", + minimum: 1, + example: 20000 + }, + pooToSecretDelay: { + description: "Maximum acceptable time between issued PoO and secret published on the ledger", + type: "integer", + minimum: 1, + example: 180000 + }, + 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: true, + 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: true + }, + proof: { + type: "object", + properties: { + type: { + type: "string", + "enum": [ + "JwtProof2020" + ] + } + }, + required: [ + "type" + ], + additionalProperties: true + } + }, + additionalProperties: true, + 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: true + } + }, + 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: 10000 + }, + pooToPopDelay: { + description: "Maximum acceptable time in milliseconds between issued PoO and issued PoP", + type: "integer", + minimum: 1, + example: 20000 + }, + pooToSecretDelay: { + description: "Maximum acceptable time between issued PoO and secret published on the ledger", + type: "integer", + minimum: 1, + example: 180000 + }, + 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: 10000 + }, + pooToPopDelay: { + description: "Maximum acceptable time in milliseconds between issued PoO and issued PoP", + type: "integer", + minimum: 1, + example: 20000 + }, + pooToSecretDelay: { + description: "Maximum acceptable time between issued PoO and secret published on the ledger", + type: "integer", + minimum: 1, + example: 180000 + }, + 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: true + }, + 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: true + }, + 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: true + }, + 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: 10000 + }, + pooToPopDelay: { + description: "Maximum acceptable time in milliseconds between issued PoO and issued PoP", + type: "integer", + minimum: 1, + example: 20000 + }, + pooToSecretDelay: { + description: "Maximum acceptable time between issued PoO and secret published on the ledger", + type: "integer", + minimum: 1, + example: 180000 + }, + 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: 10000 + }, + pooToPopDelay: { + description: "Maximum acceptable time in milliseconds between issued PoO and issued PoP", + type: "integer", + minimum: 1, + example: 20000 + }, + pooToSecretDelay: { + description: "Maximum acceptable time between issued PoO and secret published on the ledger", + type: "integer", + minimum: 1, + example: 180000 + }, + 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: 10000 + }, + pooToPopDelay: { + description: "Maximum acceptable time in milliseconds between issued PoO and issued PoP", + type: "integer", + minimum: 1, + example: 20000 + }, + pooToSecretDelay: { + description: "Maximum acceptable time between issued PoO and secret published on the ledger", + type: "integer", + minimum: 1, + example: 180000 + }, + 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" + ] + } + ] + } + } +}; +var spec = { + openapi: openapi, + info: info, + tags: tags, + paths: paths, + components: components +}; + +var dist$1 = {exports: {}}; var core$4 = {}; @@ -34812,11 +40792,7 @@ var fastDeepEqual = function equal(a, b) { return a!==a && b!==b; }; -var jsonSchemaTraverseExports = {}; -var jsonSchemaTraverse = { - get exports(){ return jsonSchemaTraverseExports; }, - set exports(v){ jsonSchemaTraverseExports = v; }, -}; +var jsonSchemaTraverse = {exports: {}}; var traverse$1 = jsonSchemaTraverse.exports = function (schema, opts, cb) { // Legacy support for v0.3.1 and earlier. @@ -34910,6 +40886,8 @@ function escapeJsonPtr(str) { return str.replace(/~/g, '~0').replace(/\//g, '~1'); } +var jsonSchemaTraverseExports = jsonSchemaTraverse.exports; + Object.defineProperty(resolve$1, "__esModule", { value: true }); resolve$1.getSchemaRefs = resolve$1.resolveUrl = resolve$1.normalizeId = resolve$1._getFullPath = resolve$1.getFullPath = resolve$1.inlineRef = void 0; const util_1$m = util; @@ -35850,15 +41828,38 @@ function getJsonPointer(parsedRef, { baseId, schema, root }) { return undefined; } -var $id$1="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#";var description$2="Meta-schema for $data reference (JSON AnySchema extension proposal)";var type$3="object";var required$2=["$data"];var properties$4={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}};var additionalProperties$2=false;var require$$9 = {$id:$id$1,description:description$2,type:type$3,required:required$2,properties:properties$4,additionalProperties:additionalProperties$2}; +var $id$1 = "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"; +var description$2 = "Meta-schema for $data reference (JSON AnySchema extension proposal)"; +var type$3 = "object"; +var required$2 = [ + "$data" +]; +var properties$4 = { + $data: { + type: "string", + anyOf: [ + { + format: "relative-json-pointer" + }, + { + format: "json-pointer" + } + ] + } +}; +var additionalProperties$2 = false; +var require$$9 = { + $id: $id$1, + description: description$2, + type: type$3, + required: required$2, + properties: properties$4, + additionalProperties: additionalProperties$2 +}; var uri$1 = {}; -var uri_allExports = {}; -var uri_all = { - get exports(){ return uri_allExports; }, - set exports(v){ uri_allExports = v; }, -}; +var uri_all = {exports: {}}; /** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */ @@ -37264,7 +43265,9 @@ var uri_all = { }))); -} (uri_all, uri_allExports)); +} (uri_all, uri_all.exports)); + +var uri_allExports = uri_all.exports; Object.defineProperty(uri$1, "__esModule", { value: true }); const uri = uri_allExports; @@ -39601,7 +45604,242 @@ const def$2 = { }; discriminator.default = def$2; -var id$2="http://json-schema.org/draft-04/schema#";var $schema$2="http://json-schema.org/draft-04/schema#";var description$1="Core schema meta-schema";var definitions$2={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:true}};var type$2="object";var properties$2={id:{type:"string",format:"uri"},$schema:{type:"string",format:"uri"},title:{type:"string"},description:{type:"string"},"default":{},multipleOf:{type:"number",minimum:0,exclusiveMinimum:true},maximum:{type:"number"},exclusiveMaximum:{type:"boolean","default":false},minimum:{type:"number"},exclusiveMinimum:{type:"boolean","default":false},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":false},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:true},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:true}]},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}};var dependencies={exclusiveMaximum:["maximum"],exclusiveMinimum:["minimum"]};var require$$3$1 = {id:id$2,$schema:$schema$2,description:description$1,definitions:definitions$2,type:type$2,properties:properties$2,dependencies:dependencies,"default":{}}; +var id$2 = "http://json-schema.org/draft-04/schema#"; +var $schema$2 = "http://json-schema.org/draft-04/schema#"; +var description$1 = "Core schema meta-schema"; +var definitions$2 = { + 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: true + } +}; +var type$2 = "object"; +var properties$2 = { + id: { + type: "string", + format: "uri" + }, + $schema: { + type: "string", + format: "uri" + }, + title: { + type: "string" + }, + description: { + type: "string" + }, + "default": { + }, + multipleOf: { + type: "number", + minimum: 0, + exclusiveMinimum: true + }, + maximum: { + type: "number" + }, + exclusiveMaximum: { + type: "boolean", + "default": false + }, + minimum: { + type: "number" + }, + exclusiveMinimum: { + type: "boolean", + "default": false + }, + 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": false + }, + 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: true + }, + type: { + anyOf: [ + { + $ref: "#/definitions/simpleTypes" + }, + { + type: "array", + items: { + $ref: "#/definitions/simpleTypes" + }, + minItems: 1, + uniqueItems: true + } + ] + }, + allOf: { + $ref: "#/definitions/schemaArray" + }, + anyOf: { + $ref: "#/definitions/schemaArray" + }, + oneOf: { + $ref: "#/definitions/schemaArray" + }, + not: { + $ref: "#" + } +}; +var dependencies = { + exclusiveMaximum: [ + "maximum" + ], + exclusiveMinimum: [ + "minimum" + ] +}; +var require$$3$1 = { + id: id$2, + $schema: $schema$2, + description: description$1, + definitions: definitions$2, + type: type$2, + properties: properties$2, + dependencies: dependencies, + "default": { +} +}; (function (module, exports) { Object.defineProperty(exports, "__esModule", { value: true }); @@ -39653,15 +45891,12 @@ var id$2="http://json-schema.org/draft-04/schema#";var $schema$2="http://json-sc Object.defineProperty(exports, "Name", { enumerable: true, get: function () { return core_3.Name; } }); Object.defineProperty(exports, "CodeGen", { enumerable: true, get: function () { return core_3.CodeGen; } }); -} (dist$1, distExports$1)); +} (dist$1, dist$1.exports)); +var distExports$1 = dist$1.exports; var Ajv = /*@__PURE__*/getDefaultExportFromCjs(distExports$1); -var distExports = {}; -var dist = { - get exports(){ return distExports; }, - set exports(v){ distExports = v; }, -}; +var dist = {exports: {}}; var formats = {}; @@ -39842,11 +46077,7 @@ var formats = {}; var limit = {}; -var ajvExports = {}; -var ajv = { - get exports(){ return ajvExports; }, - set exports(v){ ajvExports = v; }, -}; +var ajv = {exports: {}}; var draft7 = {}; @@ -39975,7 +46206,257 @@ const draft7Vocabularies = [ ]; draft7.default = draft7Vocabularies; -var $schema$1="http://json-schema.org/draft-07/schema#";var $id="http://json-schema.org/draft-07/schema#";var title="Core schema meta-schema";var definitions$1={schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{"default":0}]},simpleTypes:{"enum":["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:true,"default":[]}};var type$1=["object","boolean"];var properties$1={$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},"default":true,readOnly:{type:"boolean","default":false},examples:{type:"array",items:true},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],"default":true},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean","default":false},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},"default":{}},properties:{type:"object",additionalProperties:{$ref:"#"},"default":{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},"default":{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},"const":true,"enum":{type:"array",items:true,minItems:1,uniqueItems:true},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:true}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},"if":{$ref:"#"},then:{$ref:"#"},"else":{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}};var require$$3 = {$schema:$schema$1,$id:$id,title:title,definitions:definitions$1,type:type$1,properties:properties$1,"default":true}; +var $schema$1 = "http://json-schema.org/draft-07/schema#"; +var $id = "http://json-schema.org/draft-07/schema#"; +var title = "Core schema meta-schema"; +var definitions$1 = { + schemaArray: { + type: "array", + minItems: 1, + items: { + $ref: "#" + } + }, + nonNegativeInteger: { + type: "integer", + minimum: 0 + }, + nonNegativeIntegerDefault0: { + allOf: [ + { + $ref: "#/definitions/nonNegativeInteger" + }, + { + "default": 0 + } + ] + }, + simpleTypes: { + "enum": [ + "array", + "boolean", + "integer", + "null", + "number", + "object", + "string" + ] + }, + stringArray: { + type: "array", + items: { + type: "string" + }, + uniqueItems: true, + "default": [ + ] + } +}; +var type$1 = [ + "object", + "boolean" +]; +var properties$1 = { + $id: { + type: "string", + format: "uri-reference" + }, + $schema: { + type: "string", + format: "uri" + }, + $ref: { + type: "string", + format: "uri-reference" + }, + $comment: { + type: "string" + }, + title: { + type: "string" + }, + description: { + type: "string" + }, + "default": true, + readOnly: { + type: "boolean", + "default": false + }, + examples: { + type: "array", + items: true + }, + multipleOf: { + type: "number", + exclusiveMinimum: 0 + }, + maximum: { + type: "number" + }, + exclusiveMaximum: { + type: "number" + }, + minimum: { + type: "number" + }, + exclusiveMinimum: { + type: "number" + }, + maxLength: { + $ref: "#/definitions/nonNegativeInteger" + }, + minLength: { + $ref: "#/definitions/nonNegativeIntegerDefault0" + }, + pattern: { + type: "string", + format: "regex" + }, + additionalItems: { + $ref: "#" + }, + items: { + anyOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/schemaArray" + } + ], + "default": true + }, + maxItems: { + $ref: "#/definitions/nonNegativeInteger" + }, + minItems: { + $ref: "#/definitions/nonNegativeIntegerDefault0" + }, + uniqueItems: { + type: "boolean", + "default": false + }, + contains: { + $ref: "#" + }, + maxProperties: { + $ref: "#/definitions/nonNegativeInteger" + }, + minProperties: { + $ref: "#/definitions/nonNegativeIntegerDefault0" + }, + required: { + $ref: "#/definitions/stringArray" + }, + additionalProperties: { + $ref: "#" + }, + definitions: { + type: "object", + additionalProperties: { + $ref: "#" + }, + "default": { + } + }, + properties: { + type: "object", + additionalProperties: { + $ref: "#" + }, + "default": { + } + }, + patternProperties: { + type: "object", + additionalProperties: { + $ref: "#" + }, + propertyNames: { + format: "regex" + }, + "default": { + } + }, + dependencies: { + type: "object", + additionalProperties: { + anyOf: [ + { + $ref: "#" + }, + { + $ref: "#/definitions/stringArray" + } + ] + } + }, + propertyNames: { + $ref: "#" + }, + "const": true, + "enum": { + type: "array", + items: true, + minItems: 1, + uniqueItems: true + }, + type: { + anyOf: [ + { + $ref: "#/definitions/simpleTypes" + }, + { + type: "array", + items: { + $ref: "#/definitions/simpleTypes" + }, + minItems: 1, + uniqueItems: true + } + ] + }, + format: { + type: "string" + }, + contentMediaType: { + type: "string" + }, + contentEncoding: { + type: "string" + }, + "if": { + $ref: "#" + }, + then: { + $ref: "#" + }, + "else": { + $ref: "#" + }, + allOf: { + $ref: "#/definitions/schemaArray" + }, + anyOf: { + $ref: "#/definitions/schemaArray" + }, + oneOf: { + $ref: "#/definitions/schemaArray" + }, + not: { + $ref: "#" + } +}; +var require$$3 = { + $schema: $schema$1, + $id: $id, + title: title, + definitions: definitions$1, + type: type$1, + properties: properties$1, + "default": true +}; (function (module, exports) { Object.defineProperty(exports, "__esModule", { value: true }); @@ -40025,7 +46506,9 @@ var $schema$1="http://json-schema.org/draft-07/schema#";var $id="http://json-sch var ref_error_1 = ref_error; Object.defineProperty(exports, "MissingRefError", { enumerable: true, get: function () { return ref_error_1.default; } }); -} (ajv, ajvExports)); +} (ajv, ajv.exports)); + +var ajvExports = ajv.exports; (function (exports) { Object.defineProperty(exports, "__esModule", { value: true }); @@ -40135,15 +46618,12 @@ var $schema$1="http://json-schema.org/draft-07/schema#";var $id="http://json-sch Object.defineProperty(exports, "__esModule", { value: true }); exports.default = formatsPlugin; -} (dist, distExports)); +} (dist, dist.exports)); +var distExports = dist.exports; var addFormats = /*@__PURE__*/getDefaultExportFromCjs(distExports); -var lodashExports = {}; -var lodash = { - get exports(){ return lodashExports; }, - set exports(v){ lodashExports = v; }, -}; +var lodash = {exports: {}}; /** * @license @@ -40153,6 +46633,7 @@ var lodash = { * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */ +lodash.exports; (function (module, exports) { (function() { @@ -57341,12 +63822,1683 @@ var lodash = { // Export to the global object. root._ = _; } - }.call(commonjsGlobal)); -} (lodash, lodashExports)); - -var _ = lodashExports; - -var id="https://spec.openapis.org/oas/3.0/schema/2021-09-28";var $schema="http://json-schema.org/draft-04/schema#";var description="The description of OpenAPI v3.0.x documents, as defined by https://spec.openapis.org/oas/v3.0.3";var type="object";var required=["openapi","info","paths"];var 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:true},paths:{$ref:"#/definitions/Paths"},components:{$ref:"#/definitions/Components"}};var patternProperties={"^x-":{}};var additionalProperties=false;var 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:false},Contact:{type:"object",properties:{name:{type:"string"},url:{type:"string",format:"uri-reference"},email:{type:"string",format:"email"}},patternProperties:{"^x-":{}},additionalProperties:false},License:{type:"object",required:["name"],properties:{name:{type:"string"},url:{type:"string",format:"uri-reference"}},patternProperties:{"^x-":{}},additionalProperties:false},Server:{type:"object",required:["url"],properties:{url:{type:"string"},description:{type:"string"},variables:{type:"object",additionalProperties:{$ref:"#/definitions/ServerVariable"}}},patternProperties:{"^x-":{}},additionalProperties:false},ServerVariable:{type:"object",required:["default"],properties:{"enum":{type:"array",items:{type:"string"}},"default":{type:"string"},description:{type:"string"}},patternProperties:{"^x-":{}},additionalProperties:false},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:false},Schema:{type:"object",properties:{title:{type:"string"},multipleOf:{type:"number",minimum:0,exclusiveMinimum:true},maximum:{type:"number"},exclusiveMaximum:{type:"boolean","default":false},minimum:{type:"number"},exclusiveMinimum:{type:"boolean","default":false},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":false},maxProperties:{type:"integer",minimum:0},minProperties:{type:"integer",minimum:0,"default":0},required:{type:"array",items:{type:"string"},minItems:1,uniqueItems:true},"enum":{type:"array",items:{},minItems:1,uniqueItems:false},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":true},description:{type:"string"},format:{type:"string"},"default":{},nullable:{type:"boolean","default":false},discriminator:{$ref:"#/definitions/Discriminator"},readOnly:{type:"boolean","default":false},writeOnly:{type:"boolean","default":false},example:{},externalDocs:{$ref:"#/definitions/ExternalDocumentation"},deprecated:{type:"boolean","default":false},xml:{$ref:"#/definitions/XML"}},patternProperties:{"^x-":{}},additionalProperties:false},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":false},wrapped:{type:"boolean","default":false}},patternProperties:{"^x-":{}},additionalProperties:false},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:false},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:false,allOf:[{$ref:"#/definitions/ExampleXORExamples"}]},Example:{type:"object",properties:{summary:{type:"string"},description:{type:"string"},value:{},externalValue:{type:"string",format:"uri-reference"}},patternProperties:{"^x-":{}},additionalProperties:false},Header:{type:"object",properties:{description:{type:"string"},required:{type:"boolean","default":false},deprecated:{type:"boolean","default":false},allowEmptyValue:{type:"boolean","default":false},style:{type:"string","enum":["simple"],"default":"simple"},explode:{type:"boolean"},allowReserved:{type:"boolean","default":false},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:false,allOf:[{$ref:"#/definitions/ExampleXORExamples"},{$ref:"#/definitions/SchemaXORContent"}]},Paths:{type:"object",patternProperties:{"^\\/":{$ref:"#/definitions/PathItem"},"^x-":{}},additionalProperties:false},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:true}},patternProperties:{"^(get|put|post|delete|options|head|patch|trace)$":{$ref:"#/definitions/Operation"},"^x-":{}},additionalProperties:false},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:true},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":false},security:{type:"array",items:{$ref:"#/definitions/SecurityRequirement"}},servers:{type:"array",items:{$ref:"#/definitions/Server"}}},patternProperties:{"^x-":{}},additionalProperties:false},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:false},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:false},ExternalDocumentation:{type:"object",required:["url"],properties:{description:{type:"string"},url:{type:"string",format:"uri-reference"}},patternProperties:{"^x-":{}},additionalProperties:false},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":false},deprecated:{type:"boolean","default":false},allowEmptyValue:{type:"boolean","default":false},style:{type:"string"},explode:{type:"boolean"},allowReserved:{type:"boolean","default":false},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:false,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":[true]}}},{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":false}},patternProperties:{"^x-":{}},additionalProperties:false},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:false},HTTPSecurityScheme:{type:"object",required:["scheme","type"],properties:{scheme:{type:"string"},bearerFormat:{type:"string"},description:{type:"string"},type:{type:"string","enum":["http"]}},patternProperties:{"^x-":{}},additionalProperties:false,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:false},OpenIdConnectSecurityScheme:{type:"object",required:["type","openIdConnectUrl"],properties:{type:{type:"string","enum":["openIdConnect"]},openIdConnectUrl:{type:"string",format:"uri-reference"},description:{type:"string"}},patternProperties:{"^x-":{}},additionalProperties:false},OAuthFlows:{type:"object",properties:{implicit:{$ref:"#/definitions/ImplicitOAuthFlow"},password:{$ref:"#/definitions/PasswordOAuthFlow"},clientCredentials:{$ref:"#/definitions/ClientCredentialsFlow"},authorizationCode:{$ref:"#/definitions/AuthorizationCodeOAuthFlow"}},patternProperties:{"^x-":{}},additionalProperties:false},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:false},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:false},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:false},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:false},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:false,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":false}},additionalProperties:false}};var jsonSchema = {id:id,$schema:$schema,description:description,type:type,required:required,properties:properties,patternProperties:patternProperties,additionalProperties:additionalProperties,definitions:definitions}; + }.call(commonjsGlobal)); +} (lodash, lodash.exports)); + +var lodashExports = lodash.exports; +var _ = /*@__PURE__*/getDefaultExportFromCjs(lodashExports); + +var id = "https://spec.openapis.org/oas/3.0/schema/2021-09-28"; +var $schema = "http://json-schema.org/draft-04/schema#"; +var description = "The description of OpenAPI v3.0.x documents, as defined by https://spec.openapis.org/oas/v3.0.3"; +var type = "object"; +var required = [ + "openapi", + "info", + "paths" +]; +var 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: true + }, + paths: { + $ref: "#/definitions/Paths" + }, + components: { + $ref: "#/definitions/Components" + } +}; +var patternProperties = { + "^x-": { + } +}; +var additionalProperties = false; +var 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: false + }, + Contact: { + type: "object", + properties: { + name: { + type: "string" + }, + url: { + type: "string", + format: "uri-reference" + }, + email: { + type: "string", + format: "email" + } + }, + patternProperties: { + "^x-": { + } + }, + additionalProperties: false + }, + License: { + type: "object", + required: [ + "name" + ], + properties: { + name: { + type: "string" + }, + url: { + type: "string", + format: "uri-reference" + } + }, + patternProperties: { + "^x-": { + } + }, + additionalProperties: false + }, + Server: { + type: "object", + required: [ + "url" + ], + properties: { + url: { + type: "string" + }, + description: { + type: "string" + }, + variables: { + type: "object", + additionalProperties: { + $ref: "#/definitions/ServerVariable" + } + } + }, + patternProperties: { + "^x-": { + } + }, + additionalProperties: false + }, + ServerVariable: { + type: "object", + required: [ + "default" + ], + properties: { + "enum": { + type: "array", + items: { + type: "string" + } + }, + "default": { + type: "string" + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-": { + } + }, + additionalProperties: false + }, + 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: false + }, + Schema: { + type: "object", + properties: { + title: { + type: "string" + }, + multipleOf: { + type: "number", + minimum: 0, + exclusiveMinimum: true + }, + maximum: { + type: "number" + }, + exclusiveMaximum: { + type: "boolean", + "default": false + }, + minimum: { + type: "number" + }, + exclusiveMinimum: { + type: "boolean", + "default": false + }, + 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": false + }, + maxProperties: { + type: "integer", + minimum: 0 + }, + minProperties: { + type: "integer", + minimum: 0, + "default": 0 + }, + required: { + type: "array", + items: { + type: "string" + }, + minItems: 1, + uniqueItems: true + }, + "enum": { + type: "array", + items: { + }, + minItems: 1, + uniqueItems: false + }, + 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": true + }, + description: { + type: "string" + }, + format: { + type: "string" + }, + "default": { + }, + nullable: { + type: "boolean", + "default": false + }, + discriminator: { + $ref: "#/definitions/Discriminator" + }, + readOnly: { + type: "boolean", + "default": false + }, + writeOnly: { + type: "boolean", + "default": false + }, + example: { + }, + externalDocs: { + $ref: "#/definitions/ExternalDocumentation" + }, + deprecated: { + type: "boolean", + "default": false + }, + xml: { + $ref: "#/definitions/XML" + } + }, + patternProperties: { + "^x-": { + } + }, + additionalProperties: false + }, + 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": false + }, + wrapped: { + type: "boolean", + "default": false + } + }, + patternProperties: { + "^x-": { + } + }, + additionalProperties: false + }, + 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: false + }, + 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: false, + allOf: [ + { + $ref: "#/definitions/ExampleXORExamples" + } + ] + }, + Example: { + type: "object", + properties: { + summary: { + type: "string" + }, + description: { + type: "string" + }, + value: { + }, + externalValue: { + type: "string", + format: "uri-reference" + } + }, + patternProperties: { + "^x-": { + } + }, + additionalProperties: false + }, + Header: { + type: "object", + properties: { + description: { + type: "string" + }, + required: { + type: "boolean", + "default": false + }, + deprecated: { + type: "boolean", + "default": false + }, + allowEmptyValue: { + type: "boolean", + "default": false + }, + style: { + type: "string", + "enum": [ + "simple" + ], + "default": "simple" + }, + explode: { + type: "boolean" + }, + allowReserved: { + type: "boolean", + "default": false + }, + 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: false, + allOf: [ + { + $ref: "#/definitions/ExampleXORExamples" + }, + { + $ref: "#/definitions/SchemaXORContent" + } + ] + }, + Paths: { + type: "object", + patternProperties: { + "^\\/": { + $ref: "#/definitions/PathItem" + }, + "^x-": { + } + }, + additionalProperties: false + }, + 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: true + } + }, + patternProperties: { + "^(get|put|post|delete|options|head|patch|trace)$": { + $ref: "#/definitions/Operation" + }, + "^x-": { + } + }, + additionalProperties: false + }, + 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: true + }, + 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": false + }, + security: { + type: "array", + items: { + $ref: "#/definitions/SecurityRequirement" + } + }, + servers: { + type: "array", + items: { + $ref: "#/definitions/Server" + } + } + }, + patternProperties: { + "^x-": { + } + }, + additionalProperties: false + }, + 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: false + }, + 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: false + }, + ExternalDocumentation: { + type: "object", + required: [ + "url" + ], + properties: { + description: { + type: "string" + }, + url: { + type: "string", + format: "uri-reference" + } + }, + patternProperties: { + "^x-": { + } + }, + additionalProperties: false + }, + 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": false + }, + deprecated: { + type: "boolean", + "default": false + }, + allowEmptyValue: { + type: "boolean", + "default": false + }, + style: { + type: "string" + }, + explode: { + type: "boolean" + }, + allowReserved: { + type: "boolean", + "default": false + }, + 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: false, + 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": [ + true + ] + } + } + }, + { + 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": false + } + }, + patternProperties: { + "^x-": { + } + }, + additionalProperties: false + }, + 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: false + }, + HTTPSecurityScheme: { + type: "object", + required: [ + "scheme", + "type" + ], + properties: { + scheme: { + type: "string" + }, + bearerFormat: { + type: "string" + }, + description: { + type: "string" + }, + type: { + type: "string", + "enum": [ + "http" + ] + } + }, + patternProperties: { + "^x-": { + } + }, + additionalProperties: false, + 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: false + }, + OpenIdConnectSecurityScheme: { + type: "object", + required: [ + "type", + "openIdConnectUrl" + ], + properties: { + type: { + type: "string", + "enum": [ + "openIdConnect" + ] + }, + openIdConnectUrl: { + type: "string", + format: "uri-reference" + }, + description: { + type: "string" + } + }, + patternProperties: { + "^x-": { + } + }, + additionalProperties: false + }, + OAuthFlows: { + type: "object", + properties: { + implicit: { + $ref: "#/definitions/ImplicitOAuthFlow" + }, + password: { + $ref: "#/definitions/PasswordOAuthFlow" + }, + clientCredentials: { + $ref: "#/definitions/ClientCredentialsFlow" + }, + authorizationCode: { + $ref: "#/definitions/AuthorizationCodeOAuthFlow" + } + }, + patternProperties: { + "^x-": { + } + }, + additionalProperties: false + }, + 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: false + }, + 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: false + }, + 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: false + }, + 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: false + }, + 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: false, + 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": false + } + }, + additionalProperties: false + } +}; +var jsonSchema = { + id: id, + $schema: $schema, + description: description, + type: type, + required: required, + properties: properties, + patternProperties: patternProperties, + additionalProperties: additionalProperties, + definitions: definitions +}; function parseTimestamp(timestamp) { if ((new Date(timestamp)).getTime() > 0) { @@ -57373,7 +65525,7 @@ async function validateDataSharingAgreementSchema(agreement) { }); } } - if (hashable(clonedAgreement) !== hashable(agreement)) { + if (t(clonedAgreement) !== t(agreement)) { errors.push(new NrError('Additional claims beyond the schema are not supported', ['invalid format'])); } } @@ -57508,7 +65660,7 @@ class NonRepudiationDest { } async verifyPoO(poo, cipherblock, options) { await this.initialized; - const cipherblockDgst = encode$4(await sha(cipherblock, this.agreement.hashAlg), true, false); + const cipherblockDgst = e(await sha(cipherblock, this.agreement.hashAlg), true, false); const { payload } = await jwsDecode(poo); const dataExchangePreview = { ...this.agreement, @@ -57579,7 +65731,7 @@ class NonRepudiationDest { const verified = await verifyProof(pop, expectedPayloadClaims, opts); const secret = JSON.parse(verified.payload.secret); this.block.secret = { - hex: bufToHex(decode$5(secret.k)), + hex: g$1(r$4(secret.k)), jwk: secret }; this.block.pop = { @@ -57618,7 +65770,7 @@ class NonRepudiationDest { throw new Error('No cipherblock to decrypt'); } const decryptedBlock = (await jweDecrypt(this.block.jwe, this.block.secret.jwk)).plaintext; - const decryptedDgst = encode$4(await sha(decryptedBlock, this.agreement.hashAlg), true, false); + const decryptedDgst = e(await sha(decryptedBlock, this.agreement.hashAlg), true, false); if (decryptedDgst !== this.exchange.blockCommitment) { throw new Error('Decrypted block does not meet the committed one'); } @@ -57698,9 +65850,9 @@ class NonRepudiationOrig { secret, jwe: await jweEncrypt(this.block.raw, secret.jwk, this.agreement.encAlg) }; - 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 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 dataExchangePreview = { ...this.agreement, cipherblockDgst, @@ -57786,9 +65938,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 new file mode 100644 index 0000000..c7d037a --- /dev/null +++ b/dist/bundle.esm.min.js @@ -0,0 +1,15 @@ +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{issuer:o}=r;if(o&&!(Array.isArray(o)?o:[o]).includes(i.iss))throw new wn('unexpected "iss" claim value',"iss","check_failed");const{subject:a}=r;if(a&&i.sub!==a)throw new wn('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 wn('unexpected "aud" claim value',"aud","check_failed");var c,u;let f;switch(typeof r.clockTolerance){case"string":f=Ni(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=Ci(d||new Date);if((void 0!==i.iat||r.maxTokenAge)&&"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>l+f)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<=l-f)throw new An('"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:Ni(r.maxTokenAge)))throw new An('"iat" claim timestamp check failed (too far in the past)',"iat","check_failed");if(e<0-f)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:{}}; +/** + * [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 + */es=ts,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=a:n&&(r=self);var i=!r.JS_SHA3_NO_COMMON_JS&&es.exports,o=!r.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,s="0123456789abcdef".split(""),c=[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]+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("AEQF2AO2DEsA2wIrAGsBRABxAN8AZwCcAEwAqgA0AGwAUgByADcATAAVAFYAIQAyACEAKAAYAFgAGwAjABQAMAAmADIAFAAfABQAKwATACoADgAbAA8AHQAYABoAGQAxADgALAAoADwAEwA9ABMAGgARAA4ADwAWABMAFgAIAA8AHgQXBYMA5BHJAS8JtAYoAe4AExozi0UAH21tAaMnBT8CrnIyhrMDhRgDygIBUAEHcoFHUPe8AXBjAewCjgDQR8IICIcEcQLwATXCDgzvHwBmBoHNAqsBdBcUAykgDhAMShskMgo8AY8jqAQfAUAfHw8BDw87MioGlCIPBwZCa4ELatMAAMspJVgsDl8AIhckSg8XAHdvTwBcIQEiDT4OPhUqbyECAEoAS34Aej8Ybx83JgT/Xw8gHxZ/7w8RICxPHA9vBw+Pfw8PHwAPFv+fAsAvCc8vEr8ivwD/EQ8Bol8OEBa/A78hrwAPCU8vESNvvwWfHwNfAVoDHr+ZAAED34YaAdJPAK7PLwSEgDLHAGo1Pz8Pvx9fUwMrpb8O/58VTzAPIBoXIyQJNF8hpwIVAT8YGAUADDNBaX3RAMomJCg9EhUeA29MABsZBTMNJipjOhc19gcIDR8bBwQHEggCWi6DIgLuAQYA+BAFCha3A5XiAEsqM7UFFgFLhAMjFTMYE1Klnw74nRVBG/ASCm0BYRN/BrsU3VoWy+S0vV8LQx+vN8gF2AC2AK5EAWwApgYDKmAAroQ0NDQ0AT+OCg7wAAIHRAbpNgVcBV0APTA5BfbPFgMLzcYL/QqqA82eBALKCjQCjqYCht0/k2+OAsXQAoP3ASTKDgDw6ACKAUYCMpIKJpRaAE4A5womABzZvs0REEKiACIQAd5QdAECAj4Ywg/wGqY2AVgAYADYvAoC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ywJ/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==")),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:i})})).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:i})})).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:{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"]}]}}},$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 + || (${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}, + 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)?)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\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-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: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}; diff --git a/dist/bundle.iife.js b/dist/bundle.iife.js new file mode 100644 index 0000000..ae16119 --- /dev/null +++ b/dist/bundle.iife.js @@ -0,0 +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{issuer:o}=r;if(o&&!(Array.isArray(o)?o:[o]).includes(i.iss))throw new wn('unexpected "iss" claim value',"iss","check_failed");const{subject:a}=r;if(a&&i.sub!==a)throw new wn('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 wn('unexpected "aud" claim value',"aud","check_failed");var c,u;let f;switch(typeof r.clockTolerance){case"string":f=Ni(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=Ci(d||new Date);if((void 0!==i.iat||r.maxTokenAge)&&"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>l+f)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<=l-f)throw new An('"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:Ni(r.maxTokenAge)))throw new An('"iat" claim timestamp check failed (too far in the past)',"iat","check_failed");if(e<0-f)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:{}}; +/** + * [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[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^~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+Pf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WFudpsgVYwiTwT31ljskD8ZyDOlm5DkGh9N/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:i})})).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:i})})).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:{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"]}]}}},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 + || (${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:{}}; +/** @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}, + 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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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}({}); diff --git a/dist/bundle.umd.js b/dist/bundle.umd.js new file mode 100644 index 0000000..a041919 --- /dev/null +++ b/dist/bundle.umd.js @@ -0,0 +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{issuer:o}=r;if(o&&!(Array.isArray(o)?o:[o]).includes(i.iss))throw new wn('unexpected "iss" claim value',"iss","check_failed");const{subject:a}=r;if(a&&i.sub!==a)throw new wn('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 wn('unexpected "aud" claim value',"aud","check_failed");var c,u;let f;switch(typeof r.clockTolerance){case"string":f=Ni(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=Ci(d||new Date);if((void 0!==i.iat||r.maxTokenAge)&&"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>l+f)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<=l-f)throw new An('"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:Ni(r.maxTokenAge)))throw new An('"iat" claim timestamp check failed (too far in the past)',"iat","check_failed");if(e<0-f)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:{}}; +/** + * [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("AEQF2AO2DEsA2wIrAGsBRABxAN8AZwCcAEwAqgA0AGwAUgByADcATAAVAFYAIQAyACEAKAAYAFgAGwAjABQAMAAmADIAFAAfABQAKwATACoADgAbAA8AHQAYABoAGQAxADgALAAoADwAEwA9ABMAGgARAA4ADwAWABMAFgAIAA8AHgQXBYMA5BHJAS8JtAYoAe4AExozi0UAH21tAaMnBT8CrnIyhrMDhRgDygIBUAEHcoFHUPe8A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P08KyP0ubGO+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:i})})).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:i})})).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:{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"]}]}}},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 + || (${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:{}}; +/** @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}, + 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}:){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,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)}}});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})); diff --git a/dist/bundles/esm.min.js b/dist/bundles/esm.min.js deleted file mode 100644 index 1acd8af..0000000 --- a/dist/bundles/esm.min.js +++ /dev/null @@ -1,25 +0,0 @@ -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 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,c);var 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=p,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={};function _(e){this.rand=e}if({get exports(){return A},set exports(e){A=e}}.exports=function(e){return w||(w=new _(null)),w.generate(e)},A.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 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)},$(L,D.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=p,H=O,K=R,J=h;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=p,X=O,Q=R,Y=h.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=y,se=O;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=y;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 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=h,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=ne,Er=A,Sr=h.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=h,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=h,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=ie,qr=ne,Hr=h,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,sn=async(e,t)=>{const r=`SHA-${e.slice(-3)}`;return new Uint8Array(await on.subtle.digest(r,t))},cn=new TextEncoder,un=new TextDecoder,fn=2**32;function dn(...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 ln(e,t,r){if(t<0||t>=fn)throw new RangeError(`value must be >= 0 and <= ${fn-1}. Received ${t}`);e.set([t>>>24,t>>>16,t>>>8,255&t],r)}function hn(e){const t=Math.floor(e/fn),r=e%fn,n=new Uint8Array(8);return ln(n,t,0),ln(n,r,4),n}function pn(e){const t=new Uint8Array(4);return ln(t,e),t}function mn(e){return dn(pn(e.length),e)}const gn=e=>(e=>{let t=e;"string"==typeof t&&(t=cn.encode(t));const r=[];for(let e=0;e{let t=e;t instanceof Uint8Array&&(t=un.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;eMn(new Uint8Array(Cn(e)>>3));const Rn=(e,t)=>{if(t.length<<3!==Cn(e))throw new Sn("Invalid Initialization Vector length")},Nn=(e,t)=>{const r=e.byteLength<<3;if(r!==t)throw new Sn(`Invalid Content Encryption Key length. Expected ${t} bits, got ${r} bits`)};function On(){return"undefined"!=typeof WebSocketPair||"undefined"!=typeof navigator&&"Cloudflare-Workers"===navigator.userAgent||"undefined"!=typeof EdgeRuntime&&"vercel"===EdgeRuntime}function Tn(e,t="algorithm.name"){return new TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`)}function jn(e,t){return e.name===t}function $n(e){return parseInt(e.name.slice(4),10)}function Dn(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 Bn(e,t,...r){switch(t){case"HS256":case"HS384":case"HS512":{if(!jn(e.algorithm,"HMAC"))throw Tn("HMAC");const r=parseInt(t.slice(2),10);if($n(e.algorithm.hash)!==r)throw Tn(`SHA-${r}`,"algorithm.hash");break}case"RS256":case"RS384":case"RS512":{if(!jn(e.algorithm,"RSASSA-PKCS1-v1_5"))throw Tn("RSASSA-PKCS1-v1_5");const r=parseInt(t.slice(2),10);if($n(e.algorithm.hash)!==r)throw Tn(`SHA-${r}`,"algorithm.hash");break}case"PS256":case"PS384":case"PS512":{if(!jn(e.algorithm,"RSA-PSS"))throw Tn("RSA-PSS");const r=parseInt(t.slice(2),10);if($n(e.algorithm.hash)!==r)throw Tn(`SHA-${r}`,"algorithm.hash");break}case"EdDSA":if("Ed25519"!==e.algorithm.name&&"Ed448"!==e.algorithm.name){if(On()){if(jn(e.algorithm,"NODE-ED25519"))break;throw Tn("Ed25519, Ed448, or NODE-ED25519")}throw Tn("Ed25519 or Ed448")}break;case"ES256":case"ES384":case"ES512":{if(!jn(e.algorithm,"ECDSA"))throw Tn("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 Tn(r,"algorithm.namedCurve");break}default:throw new TypeError("CryptoKey does not support this operation")}Dn(e,r)}function Fn(e,t,...r){switch(t){case"A128GCM":case"A192GCM":case"A256GCM":{if(!jn(e.algorithm,"AES-GCM"))throw Tn("AES-GCM");const r=parseInt(t.slice(1,4),10);if(e.algorithm.length!==r)throw Tn(r,"algorithm.length");break}case"A128KW":case"A192KW":case"A256KW":{if(!jn(e.algorithm,"AES-KW"))throw Tn("AES-KW");const r=parseInt(t.slice(1,4),10);if(e.algorithm.length!==r)throw Tn(r,"algorithm.length");break}case"ECDH":switch(e.algorithm.name){case"ECDH":case"X25519":case"X448":break;default:throw Tn("ECDH, X25519, or X448")}break;case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":if(!jn(e.algorithm,"PBKDF2"))throw Tn("PBKDF2");break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":{if(!jn(e.algorithm,"RSA-OAEP"))throw Tn("RSA-OAEP");const r=parseInt(t.slice(9),10)||1;if($n(e.algorithm.hash)!==r)throw Tn(`SHA-${r}`,"algorithm.hash");break}default:throw new TypeError("CryptoKey does not support this operation")}Dn(e,r)}function zn(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 Un=(e,...t)=>zn("Key must be ",e,...t);function Ln(e,t,...r){return zn(`Key for the ${e} algorithm must be `,t,...r)}var qn=e=>an(e);const Hn=["CryptoKey"];async function Kn(e,t,r,n,i,o){if(!(t instanceof Uint8Array))throw new TypeError(Un(t,"Uint8Array"));const a=parseInt(e.slice(1,4),10),s=await on.subtle.importKey("raw",t.subarray(a>>3),"AES-CBC",!1,["decrypt"]),c=await on.subtle.importKey("raw",t.subarray(0,a>>3),{hash:"SHA-"+(a<<1),name:"HMAC"},!1,["sign"]),u=dn(o,n,r,hn(o.length<<3)),f=new Uint8Array((await on.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(!(an(t)||t instanceof Uint8Array))throw new TypeError(Un(t,...Hn,"Uint8Array"));switch(Rn(e,n),e){case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return t instanceof Uint8Array&&Nn(t,parseInt(e.slice(-3),10)),Kn(e,t,r,n,i,o);case"A128GCM":case"A192GCM":case"A256GCM":return t instanceof Uint8Array&&Nn(t,parseInt(e.slice(1,4),10)),async function(e,t,r,n,i,o){let a;t instanceof Uint8Array?a=await on.subtle.importKey("raw",t,"AES-GCM",!1,["decrypt"]):(Fn(t,e,"decrypt"),a=t);try{return new Uint8Array(await on.subtle.decrypt({additionalData:o,iv:n,name:"AES-GCM",tagLength:128},a,dn(r,i)))}catch(e){throw new En}}(e,t,r,n,i,o);default:throw new _n("Unsupported JWE Content Encryption Algorithm")}},Wn=async()=>{throw new _n('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.')},Gn=async()=>{throw new _n('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.')},Vn=(...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 Zn(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 Xn=[{hash:"SHA-256",name:"HMAC"},!0,["sign"]];function Qn(e,t){if(e.algorithm.length!==parseInt(t.slice(1,4),10))throw new TypeError(`Invalid key size for alg: ${t}`)}function Yn(e,t,r){if(an(e))return Fn(e,t,r),e;if(e instanceof Uint8Array)return on.subtle.importKey("raw",e,"AES-KW",!0,[r]);throw new TypeError(Un(e,...Hn,"Uint8Array"))}const ei=async(e,t,r)=>{const n=await Yn(t,e,"wrapKey");Qn(n,e);const i=await on.subtle.importKey("raw",r,...Xn);return new Uint8Array(await on.subtle.wrapKey("raw",i,n,"AES-KW"))},ti=async(e,t,r)=>{const n=await Yn(t,e,"unwrapKey");Qn(n,e);const i=await on.subtle.unwrapKey("raw",r,n,"AES-KW",...Xn);return new Uint8Array(await on.subtle.exportKey("raw",i))};async function ri(e,t,r,n,i=new Uint8Array(0),o=new Uint8Array(0)){if(!an(e))throw new TypeError(Un(e,...Hn));if(Fn(e,"ECDH"),!an(t))throw new TypeError(Un(t,...Hn));Fn(t,"ECDH","deriveBits");const a=dn(mn(cn.encode(r)),mn(i),mn(o),pn(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 on.subtle.deriveBits({name:e.algorithm.name,public:e},t,s)),n,a)}function ni(e){if(!an(e))throw new TypeError(Un(e,...Hn));return["P-256","P-384","P-521"].includes(e.algorithm.namedCurve)||"X25519"===e.algorithm.name||"X448"===e.algorithm.name}async function ii(e,t,r,n){!function(e){if(!(e instanceof Uint8Array)||e.length<8)throw new Sn("PBES2 Salt Input must be 8 or more octets")}(e);const i=function(e,t){return dn(cn.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 on.subtle.importKey("raw",e,"PBKDF2",!1,["deriveBits"]);if(an(e))return Fn(e,t,"deriveBits","deriveKey"),e;throw new TypeError(Un(e,...Hn,"Uint8Array"))}(n,t);if(c.usages.includes("deriveBits"))return new Uint8Array(await on.subtle.deriveBits(a,c,o));if(c.usages.includes("deriveKey"))return on.subtle.deriveKey(a,c,s,!1,["wrapKey","unwrapKey"]);throw new TypeError('PBKDF2 key "usages" must include "deriveBits" or "deriveKey"')}const oi=async(e,t,r,n,i)=>{const o=await ii(i,e,n,t);return ti(e.slice(-6),o,r)};function ai(e){switch(e){case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":return"RSA-OAEP";default:throw new _n(`alg ${e} is not supported either by JOSE or your javascript runtime`)}}var si=(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 ci=async(e,t,r)=>{if(!an(t))throw new TypeError(Un(t,...Hn));if(Fn(t,e,"decrypt","unwrapKey"),si(e,t),t.usages.includes("decrypt"))return new Uint8Array(await on.subtle.decrypt(ai(e),t,r));if(t.usages.includes("unwrapKey")){const n=await on.subtle.unwrapKey("raw",r,t,ai(e),...Xn);return new Uint8Array(await on.subtle.exportKey("raw",n))}throw new TypeError('RSA-OAEP key "usages" must include "decrypt" or "unwrapKey" for this operation')};function ui(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 _n(`Unsupported JWE Algorithm: ${e}`)}}var fi=e=>Mn(new Uint8Array(ui(e)>>3));var di=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 _n(`${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 _n('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 _n('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 _n('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 _n('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;default:throw new _n('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 on.subtle.importKey("raw",yn(e.k),...o);const a={...e};delete a.alg,delete a.use;try{return await on.subtle.importKey("jwk",a,...o)}catch(e){if("Ed25519"===n.name&&"NotSupportedError"===(null==e?void 0:e.name)&&On())return o[0]={name:"NODE-ED25519",namedCurve:"NODE-ED25519"},await on.subtle.importKey("jwk",a,...o);throw e}};async function li(e,t,r){var n;if(!Zn(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?di({...e,alg:t,ext:null!==(n=e.ext)&&void 0!==n&&n}):yn(e.k);case"RSA":if(void 0!==e.oth)throw new _n('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');case"EC":case"OKP":return di({...e,alg:t});default:throw new _n('Unsupported "kty" (Key Type) Parameter value')}}const hi=(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(!qn(t))throw new TypeError(Ln(e,t,...Hn,"Uint8Array"));if("secret"!==t.type)throw new TypeError(`${Hn.join(" or ")} instances for symmetric algorithms must be of type "secret"`)}})(e,t):((e,t,r)=>{if(!qn(t))throw new TypeError(Ln(e,t,...Hn));if("secret"===t.type)throw new TypeError(`${Hn.join(" or ")} instances for asymmetric algorithms must not be of type "secret"`);if("sign"===r&&"public"===t.type)throw new TypeError(`${Hn.join(" or ")} instances for asymmetric algorithm signing must be of type "private"`);if("decrypt"===r&&"public"===t.type)throw new TypeError(`${Hn.join(" or ")} instances for asymmetric algorithm decryption must be of type "private"`);if(t.algorithm&&"verify"===r&&"private"===t.type)throw new TypeError(`${Hn.join(" or ")} instances for asymmetric algorithm verifying must be of type "public"`);if(t.algorithm&&"encrypt"===r&&"private"===t.type)throw new TypeError(`${Hn.join(" or ")} instances for asymmetric algorithm encryption must be of type "public"`)})(e,t,r)};const pi=async(e,t,r,n,i)=>{if(!(an(r)||r instanceof Uint8Array))throw new TypeError(Un(r,...Hn,"Uint8Array"));switch(Rn(e,n),e){case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return r instanceof Uint8Array&&Nn(r,parseInt(e.slice(-3),10)),async function(e,t,r,n,i){if(!(r instanceof Uint8Array))throw new TypeError(Un(r,"Uint8Array"));const o=parseInt(e.slice(1,4),10),a=await on.subtle.importKey("raw",r.subarray(o>>3),"AES-CBC",!1,["encrypt"]),s=await on.subtle.importKey("raw",r.subarray(0,o>>3),{hash:"SHA-"+(o<<1),name:"HMAC"},!1,["sign"]),c=new Uint8Array(await on.subtle.encrypt({iv:n,name:"AES-CBC"},a,t)),u=dn(i,n,c,hn(i.length<<3));return{ciphertext:c,tag:new Uint8Array((await on.subtle.sign("HMAC",s,u)).slice(0,o>>3))}}(e,t,r,n,i);case"A128GCM":case"A192GCM":case"A256GCM":return r instanceof Uint8Array&&Nn(r,parseInt(e.slice(1,4),10)),async function(e,t,r,n,i){let o;r instanceof Uint8Array?o=await on.subtle.importKey("raw",r,"AES-GCM",!1,["encrypt"]):(Fn(r,e,"encrypt"),o=r);const a=new Uint8Array(await on.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 _n("Unsupported JWE Content Encryption Algorithm")}};async function mi(e,t,r,n,i){switch(hi(e,t,"decrypt"),e){case"dir":if(void 0!==r)throw new Sn("Encountered unexpected JWE Encrypted Key");return t;case"ECDH-ES":if(void 0!==r)throw new Sn("Encountered unexpected JWE Encrypted Key");case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{if(!Zn(n.epk))throw new Sn('JOSE Header "epk" (Ephemeral Public Key) missing or invalid');if(!ni(t))throw new _n("ECDH with the provided key is not allowed or not supported by your javascript runtime");const i=await li(n.epk,e);let o,a;if(void 0!==n.apu){if("string"!=typeof n.apu)throw new Sn('JOSE Header "apu" (Agreement PartyUInfo) invalid');o=yn(n.apu)}if(void 0!==n.apv){if("string"!=typeof n.apv)throw new Sn('JOSE Header "apv" (Agreement PartyVInfo) invalid');a=yn(n.apv)}const s=await ri(i,t,"ECDH-ES"===e?n.enc:e,"ECDH-ES"===e?ui(n.enc):parseInt(e.slice(-5,-2),10),o,a);if("ECDH-ES"===e)return s;if(void 0===r)throw new Sn("JWE Encrypted Key missing");return ti(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 Sn("JWE Encrypted Key missing");return ci(e,t,r);case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":{if(void 0===r)throw new Sn("JWE Encrypted Key missing");if("number"!=typeof n.p2c)throw new Sn('JOSE Header "p2c" (PBES2 Count) missing or invalid');const o=(null==i?void 0:i.maxPBES2Count)||1e4;if(n.p2c>o)throw new Sn('JOSE Header "p2c" (PBES2 Count) out is of acceptable bounds');if("string"!=typeof n.p2s)throw new Sn('JOSE Header "p2s" (PBES2 Salt) missing or invalid');return oi(e,t,r,n.p2c,yn(n.p2s))}case"A128KW":case"A192KW":case"A256KW":if(void 0===r)throw new Sn("JWE Encrypted Key missing");return ti(e,t,r);case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":if(void 0===r)throw new Sn("JWE Encrypted Key missing");if("string"!=typeof n.iv)throw new Sn('JOSE Header "iv" (Initialization Vector) missing or invalid');if("string"!=typeof n.tag)throw new Sn('JOSE Header "tag" (Authentication Tag) missing or invalid');return async function(e,t,r,n,i){const o=e.slice(0,7);return Jn(o,t,r,n,i,new Uint8Array(0))}(e,t,r,yn(n.iv),yn(n.tag));default:throw new _n('Invalid or unsupported "alg" (JWE Algorithm) header value')}}function gi(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 _n(`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 yi=(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 bi(e,t,r){if(e instanceof Uint8Array&&(e=un.decode(e)),"string"!=typeof e)throw new Sn("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 Sn("Invalid Compact JWE");const u=await async function(e,t,r){var n;if(!Zn(e))throw new Sn("Flattened JWE must be an object");if(void 0===e.protected&&void 0===e.header&&void 0===e.unprotected)throw new Sn("JOSE Header missing");if("string"!=typeof e.iv)throw new Sn("JWE Initialization Vector missing or incorrect type");if("string"!=typeof e.ciphertext)throw new Sn("JWE Ciphertext missing or incorrect type");if("string"!=typeof e.tag)throw new Sn("JWE Authentication Tag missing or incorrect type");if(void 0!==e.protected&&"string"!=typeof e.protected)throw new Sn("JWE Protected Header incorrect type");if(void 0!==e.encrypted_key&&"string"!=typeof e.encrypted_key)throw new Sn("JWE Encrypted Key incorrect type");if(void 0!==e.aad&&"string"!=typeof e.aad)throw new Sn("JWE AAD incorrect type");if(void 0!==e.header&&!Zn(e.header))throw new Sn("JWE Shared Unprotected Header incorrect type");if(void 0!==e.unprotected&&!Zn(e.unprotected))throw new Sn("JWE Per-Recipient Unprotected Header incorrect type");let i;if(e.protected)try{const t=yn(e.protected);i=JSON.parse(un.decode(t))}catch(e){throw new Sn("JWE Protected Header is invalid")}if(!Vn(i,e.header,e.unprotected))throw new Sn("JWE Protected, JWE Unprotected Header, and JWE Per-Recipient Unprotected Header Parameter names must be disjoint");const o={...i,...e.header,...e.unprotected};if(gi(Sn,new Map,null==r?void 0:r.crit,i,o),void 0!==o.zip){if(!i||!i.zip)throw new Sn('JWE "zip" (Compression Algorithm) Header MUST be integrity protected');if("DEF"!==o.zip)throw new _n('Unsupported JWE "zip" (Compression Algorithm) Header Parameter value')}const{alg:a,enc:s}=o;if("string"!=typeof a||!a)throw new Sn("missing JWE Algorithm (alg) in JWE Header");if("string"!=typeof s||!s)throw new Sn("missing JWE Encryption Algorithm (enc) in JWE Header");const c=r&&yi("keyManagementAlgorithms",r.keyManagementAlgorithms),u=r&&yi("contentEncryptionAlgorithms",r.contentEncryptionAlgorithms);if(c&&!c.has(a))throw new An('"alg" (Algorithm) Header Parameter not allowed');if(u&&!u.has(s))throw new An('"enc" (Encryption Algorithm) Header Parameter not allowed');let f;void 0!==e.encrypted_key&&(f=yn(e.encrypted_key));let d,l=!1;"function"==typeof t&&(t=await t(i,e),l=!0);try{d=await mi(a,t,f,o,r)}catch(e){if(e instanceof TypeError||e instanceof Sn||e instanceof _n)throw e;d=fi(s)}const h=yn(e.iv),p=yn(e.tag),m=cn.encode(null!==(n=e.protected)&&void 0!==n?n:"");let g;g=void 0!==e.aad?dn(m,cn.encode("."),cn.encode(e.aad)):m;let y=await Jn(s,d,yn(e.ciphertext),h,p,g);"DEF"===o.zip&&(y=await((null==r?void 0:r.inflateRaw)||Wn)(y));const b={plaintext:y};return void 0!==e.protected&&(b.protectedHeader=i),void 0!==e.aad&&(b.additionalAuthenticatedData=yn(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 vi=async e=>{if(e instanceof Uint8Array)return{kty:"oct",k:gn(e)};if(!an(e))throw new TypeError(Un(e,...Hn,"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 on.subtle.exportKey("jwk",e);return o};async function wi(e){return vi(e)}async function Ai(e,t,r,n,i={}){let o,a,s;switch(hi(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(!ni(r))throw new _n("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(!an(e))throw new TypeError(Un(e,...Hn));return on.subtle.generateKey(e.algorithm,!0,["deriveBits"])}(r)).privateKey);const{x:d,y:l,crv:h,kty:p}=await wi(f),m=await ri(r,f,"ECDH-ES"===e?t:e,"ECDH-ES"===e?ui(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=gn(c)),u&&(a.apv=gn(u)),"ECDH-ES"===e){s=m;break}s=n||fi(t);const g=e.slice(-6);o=await ei(g,m,s);break}case"RSA1_5":case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":s=n||fi(t),o=await(async(e,t,r)=>{if(!an(t))throw new TypeError(Un(t,...Hn));if(Fn(t,e,"encrypt","wrapKey"),si(e,t),t.usages.includes("encrypt"))return new Uint8Array(await on.subtle.encrypt(ai(e),t,r));if(t.usages.includes("wrapKey")){const n=await on.subtle.importKey("raw",r,...Xn);return new Uint8Array(await on.subtle.wrapKey("raw",n,t,ai(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||fi(t);const{p2c:c,p2s:u}=i;({encryptedKey:o,...a}=await(async(e,t,r,n=2048,i=Mn(new Uint8Array(16)))=>{const o=await ii(i,e,n,t);return{encryptedKey:await ei(e.slice(-6),o,r),p2c:n,p2s:gn(i)}})(e,r,s,c,u));break}case"A128KW":case"A192KW":case"A256KW":s=n||fi(t),o=await ei(e,r,s);break;case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":{s=n||fi(t);const{iv:c}=i;({encryptedKey:o,...a}=await async function(e,t,r,n){const i=e.slice(0,7);n||(n=In(i));const{ciphertext:o,tag:a}=await pi(i,r,t,n,new Uint8Array(0));return{encryptedKey:o,iv:gn(n),tag:gn(a)}}(e,r,s,c));break}default:throw new _n('Invalid or unsupported "alg" (JWE Algorithm) header value')}return{cek:s,encryptedKey:o,parameters:a}}const _i=Symbol();class Ei{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 Sn("either setProtectedHeader, setUnprotectedHeader, or sharedUnprotectedHeader must be called before #encrypt()");if(!Vn(this._protectedHeader,this._unprotectedHeader,this._sharedUnprotectedHeader))throw new Sn("JWE Protected, JWE Shared Unprotected and JWE Per-Recipient Header Parameter names must be disjoint");const r={...this._protectedHeader,...this._unprotectedHeader,...this._sharedUnprotectedHeader};if(gi(Sn,new Map,null==t?void 0:t.crit,this._protectedHeader,r),void 0!==r.zip){if(!this._protectedHeader||!this._protectedHeader.zip)throw new Sn('JWE "zip" (Compression Algorithm) Header MUST be integrity protected');if("DEF"!==r.zip)throw new _n('Unsupported JWE "zip" (Compression Algorithm) Header Parameter value')}const{alg:n,enc:i}=r;if("string"!=typeof n||!n)throw new Sn('JWE "alg" (Algorithm) Header Parameter missing or invalid');if("string"!=typeof i||!i)throw new Sn('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 Ai(n,i,e,this._cek,this._keyManagementParameters)),r&&(t&&_i 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=In(i)),c=this._protectedHeader?cn.encode(gn(JSON.stringify(this._protectedHeader))):cn.encode(""),this._aad?(u=gn(this._aad),s=dn(c,cn.encode("."),cn.encode(u))):s=c,"DEF"===r.zip){const e=await((null==t?void 0:t.deflateRaw)||Gn)(this._plaintext);({ciphertext:f,tag:d}=await pi(i,e,a,this._iv,s))}else({ciphertext:f,tag:d}=await pi(i,this._plaintext,a,this._iv,s));const l={ciphertext:gn(f),iv:gn(this._iv),tag:gn(d)};return o&&(l.encrypted_key=gn(o)),u&&(l.aad=u),this._protectedHeader&&(l.protected=un.decode(c)),this._sharedUnprotectedHeader&&(l.unprotected=this._sharedUnprotectedHeader),this._unprotectedHeader&&(l.header=this._unprotectedHeader),l}}function Si(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 On()&&"NODE-ED25519"===t.name?{name:"NODE-ED25519",namedCurve:"NODE-ED25519"}:{name:t.name};default:throw new _n(`alg ${e} is not supported either by JOSE or your javascript runtime`)}}function Pi(e,t,r){if(an(t))return Bn(t,e,r),t;if(t instanceof Uint8Array){if(!e.startsWith("HS"))throw new TypeError(Un(t,...Hn));return on.subtle.importKey("raw",t,{hash:`SHA-${e.slice(-3)}`,name:"HMAC"},!1,[r])}throw new TypeError(Un(t,...Hn,"Uint8Array"))}const xi=async(e,t,r,n)=>{const i=await Pi(e,t,"verify");si(e,i);const o=Si(e,i.algorithm);try{return await on.subtle.verify(o,i,r,n)}catch(e){return!1}};async function ki(e,t,r){var n;if(!Zn(e))throw new Pn("Flattened JWS must be an object");if(void 0===e.protected&&void 0===e.header)throw new Pn('Flattened JWS must have either of the "protected" or "header" members');if(void 0!==e.protected&&"string"!=typeof e.protected)throw new Pn("JWS Protected Header incorrect type");if(void 0===e.payload)throw new Pn("JWS Payload missing");if("string"!=typeof e.signature)throw new Pn("JWS Signature missing or incorrect type");if(void 0!==e.header&&!Zn(e.header))throw new Pn("JWS Unprotected Header incorrect type");let i={};if(e.protected)try{const t=yn(e.protected);i=JSON.parse(un.decode(t))}catch(e){throw new Pn("JWS Protected Header is invalid")}if(!Vn(i,e.header))throw new Pn("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");const o={...i,...e.header};let a=!0;if(gi(Pn,new Map([["b64",!0]]),null==r?void 0:r.crit,i,o).has("b64")&&(a=i.b64,"boolean"!=typeof a))throw new Pn('The "b64" (base64url-encode payload) Header Parameter must be a boolean');const{alg:s}=o;if("string"!=typeof s||!s)throw new Pn('JWS "alg" (Algorithm) Header Parameter missing or invalid');const c=r&&yi("algorithms",r.algorithms);if(c&&!c.has(s))throw new An('"alg" (Algorithm) Header Parameter not allowed');if(a){if("string"!=typeof e.payload)throw new Pn("JWS Payload must be a string")}else if("string"!=typeof e.payload&&!(e.payload instanceof Uint8Array))throw new Pn("JWS Payload must be a string or an Uint8Array instance");let u=!1;"function"==typeof t&&(t=await t(i,e),u=!0),hi(s,t,"verify");const f=dn(cn.encode(null!==(n=e.protected)&&void 0!==n?n:""),cn.encode("."),"string"==typeof e.payload?cn.encode(e.payload):e.payload),d=yn(e.signature);if(!await xi(s,t,d,f))throw new kn;let l;l=a?yn(e.payload):"string"==typeof e.payload?cn.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 Mi=e=>Math.floor(e.getTime()/1e3);const Ci=86400,Ii=/^(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)$/i;var Ri=e=>{const t=Ii.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*Ci);case"week":case"weeks":case"w":return Math.round(604800*r);default:return Math.round(31557600*r)}};const Ni=e=>e.toLowerCase().replace(/^application\//,"");var Oi=(e,t,r={})=>{const{typ:n}=r;if(n&&("string"!=typeof e.typ||Ni(e.typ)!==Ni(n)))throw new vn('unexpected "typ" JWT header value',"typ","check_failed");let i;try{i=JSON.parse(un.decode(t))}catch(e){}if(!Zn(i))throw new xn("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 vn('unexpected "iss" claim value',"iss","check_failed");const{subject:a}=r;if(a&&i.sub!==a)throw new vn('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 vn('unexpected "aud" claim value',"aud","check_failed");var c,u;let f;switch(typeof r.clockTolerance){case"string":f=Ri(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=Mi(d||new Date);if((void 0!==i.iat||r.maxTokenAge)&&"number"!=typeof i.iat)throw new vn('"iat" claim must be a number',"iat","invalid");if(void 0!==i.nbf){if("number"!=typeof i.nbf)throw new vn('"nbf" claim must be a number',"nbf","invalid");if(i.nbf>l+f)throw new vn('"nbf" claim timestamp check failed',"nbf","check_failed")}if(void 0!==i.exp){if("number"!=typeof i.exp)throw new vn('"exp" claim must be a number',"exp","invalid");if(i.exp<=l-f)throw new wn('"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:Ri(r.maxTokenAge)))throw new wn('"iat" claim timestamp check failed (too far in the past)',"iat","check_failed");if(e<0-f)throw new vn('"iat" claim timestamp check failed (it should be in the past)',"iat","check_failed")}return i};async function Ti(e,t,r){var n;const i=await async function(e,t,r){if(e instanceof Uint8Array&&(e=un.decode(e)),"string"!=typeof e)throw new Pn("Compact JWS must be a string or Uint8Array");const{0:n,1:i,2:o,length:a}=e.split(".");if(3!==a)throw new Pn("Invalid Compact JWS");const s=await ki({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 xn("JWTs MUST NOT use unencoded payload");const o={payload:Oi(i.protectedHeader,i.payload,r),protectedHeader:i.protectedHeader};return"function"==typeof t?{...o,key:i.key}:o}class ji{constructor(e){this._flattened=new Ei(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 Pn("either setProtectedHeader or setUnprotectedHeader must be called before #sign()");if(!Vn(this._protectedHeader,this._unprotectedHeader))throw new Pn("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");const r={...this._protectedHeader,...this._unprotectedHeader};let n=!0;if(gi(Pn,new Map([["b64",!0]]),null==t?void 0:t.crit,this._protectedHeader,r).has("b64")&&(n=this._protectedHeader.b64,"boolean"!=typeof n))throw new Pn('The "b64" (base64url-encode payload) Header Parameter must be a boolean');const{alg:i}=r;if("string"!=typeof i||!i)throw new Pn('JWS "alg" (Algorithm) Header Parameter missing or invalid');hi(i,e,"sign");let o,a=this._payload;n&&(a=cn.encode(gn(a))),o=this._protectedHeader?cn.encode(gn(JSON.stringify(this._protectedHeader))):cn.encode("");const s=dn(o,cn.encode("."),a),c=await(async(e,t,r)=>{const n=await Pi(e,t,"sign");si(e,n);const i=await on.subtle.sign(Si(e,n.algorithm),n,r);return new Uint8Array(i)})(i,e,s),u={signature:gn(c),payload:""};return n&&(u.payload=un.decode(a)),this._unprotectedHeader&&(u.header=this._unprotectedHeader),this._protectedHeader&&(u.protected=un.decode(o)),u}}class Di{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 Bi{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 Fi{constructor(e){this._signatures=[],this._payload=e}addSignature(e,t){const r=new Bi(this,e,t);return this._signatures.push(r),r}async sign(){if(!this._signatures.length)throw new Pn("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 _n('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}return on.subtle.generateKey(i,null!==(r=null==t?void 0:t.extractable)&&void 0!==r&&r,o)}(e,t)}async function Hi(e,t){const r=void 0===t?e.alg:t,n=Yr.concat(Qr).concat(en);if(!n.includes(r))throw new tn("invalid alg. Must be one of: "+n.join(","),["invalid algorithm"]);try{const r=await li(e,t);if(null==r)throw new tn(new Error("failed importing keys"),["invalid key"]);return r}catch(e){throw new tn(e,["invalid key"])}}async function Ki(e,t,r){let n,i;const o={...t};if(Yr.includes(t.alg))n="dir",i=void 0!==r?r:t.alg;else{if(!Qr.concat(en).includes(t.alg))throw new tn(`Not a valid symmetric or assymetric alg: ${t.alg}`,["encryption failed","invalid key","invalid algorithm"]);if(void 0===r)throw new tn("An encryption algorith encAlg for content encryption should be provided. Allowed values are: "+Yr.join(","),["encryption failed"]);i=r,n="ECDH-ES",o.alg=n}const a=await Hi(o);let s;try{return s=await new ji(e).setProtectedHeader({alg:n,enc:i,kid:t.kid}).encrypt(a),s}catch(e){throw new tn(e,["encryption failed"])}}async function Ji(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(un.decode(Li(t)));if(!Zn(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 tn("missing enc or alg in jwe header",["invalid format"]);"ECDH-ES"===n&&(r.alg=n);const o=await Hi(r);return await bi(e,o,{contentEncryptionAlgorithms:[i]})}catch(e){throw new tn(e,["decryption failed"])}}async function Wi(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 tn(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 tn(e,["invalid format","not a compact jws"])}if(void 0!==t){const r="function"==typeof t?await t(i,o):t,n=await Hi(r);try{const t=await Ti(e,n);return{header:t.protectedHeader,payload:t.payload,signer:r}}catch(e){throw new tn(e,["jws verification failed"])}}return{header:i,payload:o}}function Gi(e){if(Yr.concat(Xr).concat(Qr).includes(e))return Number(e.match(/\d{3}/)[0])/8;throw new tn("unsupported algorithm",["invalid algorithm"])}async function Vi(e,t,r){let s;if(!Yr.includes(e))throw new tn(new Error(`Invalid encAlg '${e}'. Supported values are: ${Yr.toString()}`),["invalid algorithm"]);const c=Gi(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 tn(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 tn(new RangeError(`Expected secret length ${c} does not meet provided one ${s.length}`),["invalid key"])}else try{s=await qi(e,{extractable:!0})}catch(e){throw new tn(e,["unexpected error"])}const u=await wi(s);return u.alg=e,{jwk:u,hex:o(n(u.k),!1,c)}}async function Zi(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 Hi(e),n=await Hi(t);try{const e=await s(16),i=await new Fi(e).addSignature(n).setProtectedHeader({alg:t.alg}).sign();await async function(e,t,r){if(!Zn(e))throw new Pn("General JWS must be an object");if(!Array.isArray(e.signatures)||!e.signatures.every(Zn))throw new Pn("JWS Signatures missing or incorrect type");for(const n of e.signatures)try{return await ki({header:n.header,payload:e.payload,protected:n.protected,signature:n.signature},t,r)}catch(e){}throw new kn}(i,r)}catch(e){throw new tn(e,["unexpected error"])}}function Xi(e){return null!=e&&"object"==typeof e&&!Array.isArray(e)}function Qi(e){return Xi(e)||Array.isArray(e)?Array.isArray(e)?e.map((e=>Array.isArray(e)||Xi(e)?Qi(e):e)):Object.keys(e).sort().map((t=>[t,Qi(e[t])])):e}function Yi(e){return JSON.stringify(Qi(e))}function eo(e,t,r,n=2e3){if(er+n)throw new tn(new Error(`timestamp ${new Date(e).toTimeString()} after 'notAfter' ${new Date(r).toTimeString()} with tolerance of ${n/1e3}s`),["invalid timestamp"])}function to(e){return Array.isArray(e)?e.sort().map(to):(t=e,"[object Object]"===Object.prototype.toString.call(t)?Object.keys(e).sort().reduce((function(t,r){return t[r]=to(e[r]),t}),{}):e);var t}function ro(e,t=!1,r){try{return i(e,t,r)}catch(e){throw new tn(e,["invalid format"])}}async function no(e,t){try{await Hi(e,e.alg);const r=to(e);return t?JSON.stringify(r):r}catch(e){throw new tn(e,["invalid key"])}}async function io(e,t){const r=Xr;if(!r.includes(t))throw new tn(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 tn(e,["unexpected error"])}}var oo={};!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];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||(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)}}({get exports(){return oo},set exports(e){oo=e}},c);var ao=oo;let so=!1,co=!1;const uo={debug:1,default:2,info:2,warning:3,error:4,off:5};let fo=uo.default,lo=null;const ho=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 po,mo;!function(e){e.DEBUG="DEBUG",e.INFO="INFO",e.WARNING="WARNING",e.ERROR="ERROR",e.OFF="OFF"}(po||(po={})),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"}(mo||(mo={}));const go="0123456789abcdef";class yo{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,t){const r=e.toLowerCase();null==uo[r]&&this.throwArgumentError("invalid log level name","logLevel",e),fo>uo[r]||console.log.apply(console,t)}debug(...e){this._log(yo.levels.DEBUG,e)}info(...e){this._log(yo.levels.INFO,e)}warn(...e){this._log(yo.levels.WARNING,e)}makeError(e,t,r){if(co)return this.makeError("censored error",t,{});t||(t=yo.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+=go[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 mo.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 mo.CALL_EXCEPTION:case mo.INSUFFICIENT_FUNDS:case mo.MISSING_NEW:case mo.NONCE_EXPIRED:case mo.REPLACEMENT_UNDERPRICED:case mo.TRANSACTION_REPLACED:case mo.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,yo.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){ho&&this.throwError("platform missing String.prototype.normalize",yo.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:ho})}checkSafeUint53(e,t){"number"==typeof e&&(null==t&&(t="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(t,yo.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(t,yo.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,t,r){r=r?": "+r:"",et&&this.throwError("too many arguments"+r,yo.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:t})}checkNew(e,t){e!==Object&&null!=e||this.throwError("missing new",yo.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",yo.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):e!==Object&&null!=e||this.throwError("missing new",yo.errors.MISSING_NEW,{name:t.name})}static globalLogger(){return lo||(lo=new yo("logger/5.7.0")),lo}static setCensorship(e,t){if(!e&&t&&this.globalLogger().throwError("cannot permanently disable censorship",yo.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),so){if(!e)return;this.globalLogger().throwError("error censorship permanent",yo.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}co=!!e,so=!!t}static setLogLevel(e){const t=uo[e.toLowerCase()];null!=t?fo=t:yo.globalLogger().warn("invalid log level - "+e)}static from(e){return new yo(e)}}yo.errors=mo,yo.levels=po;var bo=Object.freeze({__proto__:null,get ErrorCode(){return mo},get LogLevel(){return po},Logger:yo});const vo=new yo("bytes/5.7.0");function wo(e){return!!e.toHexString}function Ao(e){return e.slice||(e.slice=function(){const t=Array.prototype.slice.call(arguments);return Ao(new Uint8Array(Array.prototype.slice.apply(e,t)))}),e}function _o(e){return Co(e)&&!(e.length%2)||So(e)}function Eo(e){return"number"==typeof e&&e==e&&e%1==0}function So(e){if(null==e)return!1;if(e.constructor===Uint8Array)return!0;if("string"==typeof e)return!1;if(!Eo(e.length)||e.length<0)return!1;for(let t=0;t=256)return!1}return!0}function Po(e,t){if(t||(t={}),"number"==typeof e){vo.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),Ao(new Uint8Array(t))}if(t.allowMissingPrefix&&"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),wo(e)&&(e=e.toHexString()),Co(e)){let r=e.substring(2);r.length%2&&("left"===t.hexPad?r="0"+r:"right"===t.hexPad?r+="0":vo.throwArgumentError("hex data is odd-length","value",e));const n=[];for(let e=0;ePo(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),Ao(n)}function ko(e){let t=Po(e);if(0===t.length)return t;let r=0;for(;rt&&vo.throwArgumentError("value out of range","value",arguments[0]);const r=new Uint8Array(t);return r.set(e,t-e.length),Ao(r)}function Co(e,t){return!("string"!=typeof e||!e.match(/^0x[0-9A-Fa-f]*$/))&&(!t||e.length===2+2*t)}const Io="0123456789abcdef";function Ro(e,t){if(t||(t={}),"number"==typeof e){vo.checkSafeUint53(e,"invalid hexlify value");let t="";for(;e;)t=Io[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),wo(e))return e.toHexString();if(Co(e))return e.length%2&&("left"===t.hexPad?e="0x0"+e.substring(2):"right"===t.hexPad?e+="0":vo.throwArgumentError("hex data is odd-length","value",e)),e.toLowerCase();if(So(e)){let t="0x";for(let r=0;r>4]+Io[15&n]}return t}return vo.throwArgumentError("invalid hexlify value","value",e)}function No(e){if("string"!=typeof e)e=Ro(e);else if(!Co(e)||e.length%2)return null;return(e.length-2)/2}function Oo(e,t,r){return"string"!=typeof e?e=Ro(e):(!Co(e)||e.length%2)&&vo.throwArgumentError("invalid hexData","value",e),t=2+2*t,null!=r?"0x"+e.substring(t,2+2*r):"0x"+e.substring(t)}function To(e){let t="0x";return e.forEach((e=>{t+=Ro(e).substring(2)})),t}function jo(e){const t=$o(Ro(e,{hexPad:"left"}));return"0x"===t?"0x0":t}function $o(e){"string"!=typeof e&&(e=Ro(e)),Co(e)||vo.throwArgumentError("invalid hex string","value",e),e=e.substring(2);let t=0;for(;t2*t+2&&vo.throwArgumentError("value out of range","value",arguments[1]);e.length<2*t+2;)e="0x0"+e.substring(2);return e}function Bo(e){const t={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(_o(e)){let r=Po(e);64===r.length?(t.v=27+(r[32]>>7),r[32]&=127,t.r=Ro(r.slice(0,32)),t.s=Ro(r.slice(32,64))):65===r.length?(t.r=Ro(r.slice(0,32)),t.s=Ro(r.slice(32,64)),t.v=r[64]):vo.throwArgumentError("invalid signature string","signature",e),t.v<27&&(0===t.v||1===t.v?t.v+=27:vo.throwArgumentError("signature invalid v byte","signature",e)),t.recoveryParam=1-t.v%2,t.recoveryParam&&(r[32]|=128),t._vs=Ro(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=Mo(Po(t._vs),32);t._vs=Ro(r);const n=r[0]>=128?1:0;null==t.recoveryParam?t.recoveryParam=n:t.recoveryParam!==n&&vo.throwArgumentError("signature recoveryParam mismatch _vs","signature",e),r[0]&=127;const i=Ro(r);null==t.s?t.s=i:t.s!==i&&vo.throwArgumentError("signature v mismatch _vs","signature",e)}if(null==t.recoveryParam)null==t.v?vo.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&&vo.throwArgumentError("signature recoveryParam mismatch v","signature",e)}null!=t.r&&Co(t.r)?t.r=Do(t.r,32):vo.throwArgumentError("signature missing or invalid r","signature",e),null!=t.s&&Co(t.s)?t.s=Do(t.s,32):vo.throwArgumentError("signature missing or invalid s","signature",e);const r=Po(t.s);r[0]>=128&&vo.throwArgumentError("signature s out of range","signature",e),t.recoveryParam&&(r[0]|=128);const n=Ro(r);t._vs&&(Co(t._vs)||vo.throwArgumentError("signature invalid _vs","signature",e),t._vs=Do(t._vs,32)),null==t._vs?t._vs=n:t._vs!==n&&vo.throwArgumentError("signature _vs mismatch v and s","signature",e)}return t.yParityAndS=t._vs,t.compact=t.r+t.yParityAndS.substring(2),t}function Fo(e){return Ro(xo([(e=Bo(e)).r,e.s,e.recoveryParam?"0x1c":"0x1b"]))}var zo=Object.freeze({__proto__:null,arrayify:Po,concat:xo,hexConcat:To,hexDataLength:No,hexDataSlice:Oo,hexStripZeros:$o,hexValue:jo,hexZeroPad:Do,hexlify:Ro,isBytes:So,isBytesLike:_o,isHexString:Co,joinSignature:Fo,splitSignature:Bo,stripZeros:ko,zeroPad:Mo});const Uo="bignumber/5.7.0";var Lo=ao.BN;const qo=new yo(Uo),Ho={},Ko=9007199254740991;let Jo=!1;class Wo{constructor(e,t){e!==Ho&&qo.throwError("cannot call constructor directly; use BigNumber.from",yo.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=t,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return Vo(Zo(this).fromTwos(e))}toTwos(e){return Vo(Zo(this).toTwos(e))}abs(){return"-"===this._hex[0]?Wo.from(this._hex.substring(1)):this}add(e){return Vo(Zo(this).add(Zo(e)))}sub(e){return Vo(Zo(this).sub(Zo(e)))}div(e){return Wo.from(e).isZero()&&Xo("division-by-zero","div"),Vo(Zo(this).div(Zo(e)))}mul(e){return Vo(Zo(this).mul(Zo(e)))}mod(e){const t=Zo(e);return t.isNeg()&&Xo("division-by-zero","mod"),Vo(Zo(this).umod(t))}pow(e){const t=Zo(e);return t.isNeg()&&Xo("negative-power","pow"),Vo(Zo(this).pow(t))}and(e){const t=Zo(e);return(this.isNegative()||t.isNeg())&&Xo("unbound-bitwise-result","and"),Vo(Zo(this).and(t))}or(e){const t=Zo(e);return(this.isNegative()||t.isNeg())&&Xo("unbound-bitwise-result","or"),Vo(Zo(this).or(t))}xor(e){const t=Zo(e);return(this.isNegative()||t.isNeg())&&Xo("unbound-bitwise-result","xor"),Vo(Zo(this).xor(t))}mask(e){return(this.isNegative()||e<0)&&Xo("negative-width","mask"),Vo(Zo(this).maskn(e))}shl(e){return(this.isNegative()||e<0)&&Xo("negative-width","shl"),Vo(Zo(this).shln(e))}shr(e){return(this.isNegative()||e<0)&&Xo("negative-width","shr"),Vo(Zo(this).shrn(e))}eq(e){return Zo(this).eq(Zo(e))}lt(e){return Zo(this).lt(Zo(e))}lte(e){return Zo(this).lte(Zo(e))}gt(e){return Zo(this).gt(Zo(e))}gte(e){return Zo(this).gte(Zo(e))}isNegative(){return"-"===this._hex[0]}isZero(){return Zo(this).isZero()}toNumber(){try{return Zo(this).toNumber()}catch(e){Xo("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch(e){}return qo.throwError("this platform does not support BigInt",yo.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(10===arguments[0]?Jo||(Jo=!0,qo.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?qo.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",yo.errors.UNEXPECTED_ARGUMENT,{}):qo.throwError("BigNumber.toString does not accept parameters",yo.errors.UNEXPECTED_ARGUMENT,{})),Zo(this).toString(10)}toHexString(){return this._hex}toJSON(e){return{type:"BigNumber",hex:this.toHexString()}}static from(e){if(e instanceof Wo)return e;if("string"==typeof e)return e.match(/^-?0x[0-9a-f]+$/i)?new Wo(Ho,Go(e)):e.match(/^-?[0-9]+$/)?new Wo(Ho,Go(new Lo(e))):qo.throwArgumentError("invalid BigNumber string","value",e);if("number"==typeof e)return e%1&&Xo("underflow","BigNumber.from",e),(e>=Ko||e<=-Ko)&&Xo("overflow","BigNumber.from",e),Wo.from(String(e));const t=e;if("bigint"==typeof t)return Wo.from(t.toString());if(So(t))return Wo.from(Ro(t));if(t)if(t.toHexString){const e=t.toHexString();if("string"==typeof e)return Wo.from(e)}else{let e=t._hex;if(null==e&&"BigNumber"===t.type&&(e=t.hex),"string"==typeof e&&(Co(e)||"-"===e[0]&&Co(e.substring(1))))return Wo.from(e)}return qo.throwArgumentError("invalid BigNumber value","value",e)}static isBigNumber(e){return!(!e||!e._isBigNumber)}}function Go(e){if("string"!=typeof e)return Go(e.toString(16));if("-"===e[0])return"-"===(e=e.substring(1))[0]&&qo.throwArgumentError("invalid hex","value",e),"0x00"===(e=Go(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 Vo(e){return Wo.from(Go(e))}function Zo(e){const t=Wo.from(e).toHexString();return"-"===t[0]?new Lo("-"+t.substring(3),16):new Lo(t.substring(2),16)}function Xo(e,t,r){const n={fault:e,operation:t};return null!=r&&(n.value=r),qo.throwError(e,yo.errors.NUMERIC_FAULT,n)}const Qo=new yo(Uo),Yo={},ea=Wo.from(0),ta=Wo.from(-1);function ra(e,t,r,n){const i={fault:t,operation:r};return void 0!==n&&(i.value=n),Qo.throwError(e,yo.errors.NUMERIC_FAULT,i)}let na="0";for(;na.length<256;)na+=na;function ia(e){if("number"!=typeof e)try{e=Wo.from(e).toNumber()}catch(e){}return"number"==typeof e&&e>=0&&e<=256&&!(e%1)?"1"+na.substring(0,e):Qo.throwArgumentError("invalid decimal size","decimals",e)}function oa(e,t){null==t&&(t=0);const r=ia(t),n=(e=Wo.from(e)).lt(ea);n&&(e=e.mul(ta));let i=e.mod(r).toString();for(;i.length2&&Qo.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&&ra("fractional component exceeds decimals","underflow","parseFixed"),""===a&&(a="0");a.lengthnull==e[t]?n:(typeof e[t]!==r&&Qo.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&&Qo.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",r),n>80&&Qo.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",n),new sa(Yo,t,r,n)}}class ca{constructor(e,t,r,n){e!==Yo&&Qo.throwError("cannot use FixedNumber constructor; use FixedNumber.from",yo.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&&Qo.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",e)}addUnsafe(e){this._checkFormat(e);const t=aa(this._value,this.format.decimals),r=aa(e._value,e.format.decimals);return ca.fromValue(t.add(r),this.format.decimals,this.format)}subUnsafe(e){this._checkFormat(e);const t=aa(this._value,this.format.decimals),r=aa(e._value,e.format.decimals);return ca.fromValue(t.sub(r),this.format.decimals,this.format)}mulUnsafe(e){this._checkFormat(e);const t=aa(this._value,this.format.decimals),r=aa(e._value,e.format.decimals);return ca.fromValue(t.mul(r).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(e){this._checkFormat(e);const t=aa(this._value,this.format.decimals),r=aa(e._value,e.format.decimals);return ca.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=ca.from(e[0],this.format);const r=!e[1].match(/^(0*)$/);return this.isNegative()&&r&&(t=t.subUnsafe(ua.toFormat(t.format))),t}ceiling(){const e=this.toString().split(".");1===e.length&&e.push("0");let t=ca.from(e[0],this.format);const r=!e[1].match(/^(0*)$/);return!this.isNegative()&&r&&(t=t.addUnsafe(ua.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)&&Qo.throwArgumentError("invalid decimal count","decimals",e),t[1].length<=e)return this;const r=ca.from("1"+na.substring(0,e),this.format),n=fa.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&&Qo.throwArgumentError("invalid byte width","width",e);return Do(Wo.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString(),e/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return ca.fromString(this._value,e)}static fromValue(e,t,r){return null!=r||null==t||function(e){return null!=e&&(Wo.isBigNumber(e)||"number"==typeof e&&e%1==0||"string"==typeof e&&!!e.match(/^-?[0-9]+$/)||Co(e)||"bigint"==typeof e||So(e))}(t)||(r=t,t=null),null==t&&(t=0),null==r&&(r="fixed"),ca.fromString(oa(e,t),sa.from(r))}static fromString(e,t){null==t&&(t="fixed");const r=sa.from(t),n=aa(e,r.decimals);!r.signed&&n.lt(ea)&&ra("unsigned value cannot be negative","overflow","value",e);let i=null;r.signed?i=n.toTwos(r.width).toHexString():(i=n.toHexString(),i=Do(i,r.width/8));const o=oa(n,r.decimals);return new ca(Yo,i,o,r)}static fromBytes(e,t){null==t&&(t="fixed");const r=sa.from(t);if(Po(e).length>r.width/8)throw new Error("overflow");let n=Wo.from(e);r.signed&&(n=n.fromTwos(r.width));const i=n.toTwos((r.signed?0:1)+r.width).toHexString(),o=oa(n,r.decimals);return new ca(Yo,i,o,r)}static from(e,t){if("string"==typeof e)return ca.fromString(e,t);if(So(e))return ca.fromBytes(e,t);try{return ca.fromValue(e,0,t)}catch(e){if(e.code!==yo.errors.INVALID_ARGUMENT)throw e}return Qo.throwArgumentError("invalid FixedNumber value","value",e)}static isFixedNumber(e){return!(!e||!e._isFixedNumber)}}const ua=ca.from(1),fa=ca.from("0.5");var da=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 la=new yo("properties/5.7.0");function ha(e,t,r){Object.defineProperty(e,t,{enumerable:!0,value:r,writable:!1})}function pa(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 ma(e){return da(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 ga(e,t){e&&"object"==typeof e||la.throwArgumentError("invalid object","object",e),Object.keys(e).forEach((r=>{t[r]||la.throwArgumentError("invalid object key - "+r,"transaction:"+r,e)}))}function ya(e){const t={};for(const r in e)t[r]=e[r];return t}const ba={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function va(e){if(null==e||ba[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;rAa(e))));if("object"==typeof e){const t={};for(const r in e){const n=e[r];void 0!==n&&ha(t,r,Aa(n))}return t}return la.throwArgumentError("Cannot deepCopy "+typeof e,"object",e)}function Aa(e){return wa(e)}class _a{constructor(e){for(const t in e)this[t]=Aa(e[t])}}var Ea=Object.freeze({__proto__:null,Description:_a,checkProperties:ga,deepCopy:Aa,defineReadOnly:ha,getStatic:pa,resolveProperties:ma,shallowCopy:ya});const Sa="abi/5.7.0",Pa=new yo(Sa),xa={};let ka={calldata:!0,memory:!0,storage:!0},Ma={calldata:!0,memory:!0};function Ca(e,t){if("bytes"===e||"string"===e){if(ka[t])return!0}else if("address"===e){if("payable"===t)return!0}else if((e.indexOf("[")>=0||"tuple"===e)&&Ma[t])return!0;return(ka[t]||"payable"===t)&&Pa.throwArgumentError("invalid modifier","name",t),!1}function Ia(e,t){for(let r in t)ha(e,r,t[r])}const Ra=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),Na=new RegExp(/^(.*)\[([0-9]*)\]$/);class Oa{constructor(e,t){e!==xa&&Pa.throwError("use fromString",yo.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),Ia(this,t);let r=this.type.match(Na);Ia(this,r?{arrayLength:parseInt(r[2]||"-1"),arrayChildren:Oa.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=Ra.sighash),Ra[e]||Pa.throwArgumentError("invalid format type","format",e),e===Ra.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!==Ra.sighash&&(t+=this.type),t+="("+this.components.map((t=>t.format(e))).join(e===Ra.full?", ":",")+")"):t+=this.type,e!==Ra.sighash&&(!0===this.indexed&&(t+=" indexed"),e===Ra.full&&this.name&&(t+=" "+this.name)),t}static from(e,t){return"string"==typeof e?Oa.fromString(e,t):Oa.fromObject(e)}static fromObject(e){return Oa.isParamType(e)?e:new Oa(xa,{name:e.name||null,type:Ha(e.type),indexed:null==e.indexed?null:!!e.indexed,components:e.components?e.components.map(Oa.fromObject):null})}static fromString(e,t){return r=function(e,t){let r=e;function n(t){Pa.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;rOa.fromString(e,t)))}class ja{constructor(e,t){e!==xa&&Pa.throwError("use a static from method",yo.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),Ia(this,t),this._isFragment=!0,Object.freeze(this)}static from(e){return ja.isFragment(e)?e:"string"==typeof e?ja.fromString(e):ja.fromObject(e)}static fromObject(e){if(ja.isFragment(e))return e;switch(e.type){case"function":return Ua.fromObject(e);case"event":return $a.fromObject(e);case"constructor":return za.fromObject(e);case"error":return qa.fromObject(e);case"fallback":case"receive":return null}return Pa.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]?Ua.fromString(e.substring(8).trim()):"constructor"===e.split("(")[0].trim()?za.fromString(e.trim()):"error"===e.split(" ")[0]?qa.fromString(e.substring(5).trim()):Pa.throwArgumentError("unsupported fragment","value",e)}static isFragment(e){return!(!e||!e._isFragment)}}class $a extends ja{format(e){if(e||(e=Ra.sighash),Ra[e]||Pa.throwArgumentError("invalid format type","format",e),e===Ra.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!==Ra.sighash&&(t+="event "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===Ra.full?", ":",")+") ",e!==Ra.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&&Pa.throwArgumentError("invalid event object","value",e);const t={name:Ja(e.name),anonymous:e.anonymous,inputs:e.inputs?e.inputs.map(Oa.fromObject):[],type:"event"};return new $a(xa,t)}static fromString(e){let t=e.match(Wa);t||Pa.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:Pa.warn("unknown modifier: "+e)}})),$a.fromObject({name:t[1].trim(),anonymous:r,inputs:Ta(t[2],!0),type:"event"})}static isEventFragment(e){return e&&e._isFragment&&"event"===e.type}}function Da(e,t){t.gas=null;let r=e.split("@");return 1!==r.length?(r.length>2&&Pa.throwArgumentError("invalid human-readable ABI signature","value",e),r[1].match(/^[0-9]+$/)||Pa.throwArgumentError("invalid human-readable ABI signature gas","value",e),t.gas=Wo.from(r[1]),r[0]):e}function Ba(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 Fa(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&&Pa.throwArgumentError("cannot have constant function with mutability "+t.stateMutability,"value",e),t.payable="payable"===t.stateMutability,null!=e.payable&&!!e.payable!==t.payable&&Pa.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||Pa.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&&Pa.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&&Pa.throwArgumentError("unable to determine stateMutability","value",e),t}class za extends ja{format(e){if(e||(e=Ra.sighash),Ra[e]||Pa.throwArgumentError("invalid format type","format",e),e===Ra.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===Ra.sighash&&Pa.throwError("cannot format a constructor for sighash",yo.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});let t="constructor("+this.inputs.map((t=>t.format(e))).join(e===Ra.full?", ":",")+") ";return this.stateMutability&&"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "),t.trim()}static from(e){return"string"==typeof e?za.fromString(e):za.fromObject(e)}static fromObject(e){if(za.isConstructorFragment(e))return e;"constructor"!==e.type&&Pa.throwArgumentError("invalid constructor object","value",e);let t=Fa(e);t.constant&&Pa.throwArgumentError("constructor cannot be constant","value",e);const r={name:null,type:e.type,inputs:e.inputs?e.inputs.map(Oa.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?Wo.from(e.gas):null};return new za(xa,r)}static fromString(e){let t={type:"constructor"},r=(e=Da(e,t)).match(Wa);return r&&"constructor"===r[1].trim()||Pa.throwArgumentError("invalid constructor string","value",e),t.inputs=Ta(r[2].trim(),!1),Ba(r[3].trim(),t),za.fromObject(t)}static isConstructorFragment(e){return e&&e._isFragment&&"constructor"===e.type}}class Ua extends za{format(e){if(e||(e=Ra.sighash),Ra[e]||Pa.throwArgumentError("invalid format type","format",e),e===Ra.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!==Ra.sighash&&(t+="function "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===Ra.full?", ":",")+") ",e!==Ra.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?Ua.fromString(e):Ua.fromObject(e)}static fromObject(e){if(Ua.isFunctionFragment(e))return e;"function"!==e.type&&Pa.throwArgumentError("invalid function object","value",e);let t=Fa(e);const r={type:e.type,name:Ja(e.name),constant:t.constant,inputs:e.inputs?e.inputs.map(Oa.fromObject):[],outputs:e.outputs?e.outputs.map(Oa.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?Wo.from(e.gas):null};return new Ua(xa,r)}static fromString(e){let t={type:"function"},r=(e=Da(e,t)).split(" returns ");r.length>2&&Pa.throwArgumentError("invalid function string","value",e);let n=r[0].match(Wa);if(n||Pa.throwArgumentError("invalid function signature","value",e),t.name=n[1].trim(),t.name&&Ja(t.name),t.inputs=Ta(n[2],!1),Ba(n[3].trim(),t),r.length>1){let n=r[1].match(Wa);""==n[1].trim()&&""==n[3].trim()||Pa.throwArgumentError("unexpected tokens","value",e),t.outputs=Ta(n[2],!1)}else t.outputs=[];return Ua.fromObject(t)}static isFunctionFragment(e){return e&&e._isFragment&&"function"===e.type}}function La(e){const t=e.format();return"Error(string)"!==t&&"Panic(uint256)"!==t||Pa.throwArgumentError(`cannot specify user defined ${t} error`,"fragment",e),e}class qa extends ja{format(e){if(e||(e=Ra.sighash),Ra[e]||Pa.throwArgumentError("invalid format type","format",e),e===Ra.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==Ra.sighash&&(t+="error "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===Ra.full?", ":",")+") ",t.trim()}static from(e){return"string"==typeof e?qa.fromString(e):qa.fromObject(e)}static fromObject(e){if(qa.isErrorFragment(e))return e;"error"!==e.type&&Pa.throwArgumentError("invalid error object","value",e);const t={type:e.type,name:Ja(e.name),inputs:e.inputs?e.inputs.map(Oa.fromObject):[]};return La(new qa(xa,t))}static fromString(e){let t={type:"error"},r=e.match(Wa);return r||Pa.throwArgumentError("invalid error signature","value",e),t.name=r[1].trim(),t.name&&Ja(t.name),t.inputs=Ta(r[2],!1),La(qa.fromObject(t))}static isErrorFragment(e){return e&&e._isFragment&&"error"===e.type}}function Ha(e){return e.match(/^uint($|[^1-9])/)?e="uint256"+e.substring(4):e.match(/^int($|[^1-9])/)&&(e="int256"+e.substring(3)),e}const Ka=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function Ja(e){return e&&e.match(Ka)||Pa.throwArgumentError(`invalid identifier "${e}"`,"value",e),e}const Wa=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$");const Ga=new yo(Sa);function Va(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 Za{constructor(e,t,r,n){this.name=e,this.type=t,this.localName=r,this.dynamic=n}_throwError(e,t){Ga.throwArgumentError(e,this.localName,t)}}class Xa{constructor(e){ha(this,"wordSize",e||32),this._data=[],this._dataLength=0,this._padding=new Uint8Array(e)}get data(){return To(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(xo(e._data))}writeBytes(e){let t=Po(e);const r=t.length%this.wordSize;return r&&(t=xo([t,this._padding.slice(r)])),this._writeData(t)}_getValue(e){let t=Po(Wo.from(e));return t.length>this.wordSize&&Ga.throwError("value out-of-bounds",yo.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:t.length}),t.length%this.wordSize&&(t=xo([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 Qa{constructor(e,t,r,n){ha(this,"_data",Po(e)),ha(this,"wordSize",t||32),ha(this,"_coerceFunc",r),ha(this,"allowLoose",n),this._offset=0}get data(){return Ro(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):Qa.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:Ga.throwError("data out-of-bounds",yo.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+n})),this._data.slice(this._offset,this._offset+n)}subReader(e){return new Qa(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 Wo.from(this.readBytes(this.wordSize))}}var Ya,es={}; -/** - * [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 - */ -Ya={get exports(){return es},set exports(e){es=e}},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&&Ya.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)Ya.exports=_;else for(S=0;S>=8;return t}function as(e,t,r){let n=0;for(let i=0;it+1+n&&is.throwError("child data too short",yo.errors.BUFFER_OVERRUN,{})}return{consumed:1+n,result:i}}function fs(e,t){if(0===e.length&&is.throwError("data too short",yo.errors.BUFFER_OVERRUN,{}),e[t]>=248){const r=e[t]-247;t+1+r>e.length&&is.throwError("data short segment too short",yo.errors.BUFFER_OVERRUN,{});const n=as(e,t+1,r);return t+1+r+n>e.length&&is.throwError("data long segment too short",yo.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",yo.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",yo.errors.BUFFER_OVERRUN,{});const n=as(e,t+1,r);t+1+r+n>e.length&&is.throwError("data array too short",yo.errors.BUFFER_OVERRUN,{});return{consumed:1+r+n,result:Ro(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",yo.errors.BUFFER_OVERRUN,{});return{consumed:1+r,result:Ro(e.slice(t+1,t+1+r))}}return{consumed:1,result:Ro(e[t])}}function ds(e){const t=Po(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 yo("address/5.7.0");function ps(e){Co(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=Po(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 Lo(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(Oo(rs(cs([t,ko(Po(Wo.from(e.nonce).toHexString()))])),12))}var ws=Object.freeze({__proto__:null,getAddress:bs,getContractAddress:vs,getCreate2Address:function(e,t,r){return 32!==No(t)&&hs.throwArgumentError("salt must be 32 bytes","salt",t),32!==No(r)&&hs.throwArgumentError("initCodeHash must be 32 bytes","initCodeHash",r),bs(Oo(rs(xo(["0xff",bs(e),t,r])),12))},getIcapAddress:function(e){let t=(r=bs(e).substring(2),new Lo(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 Za{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(Do(e.readValue().toHexString(),20))}}class _s extends Za{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 yo(Sa);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",yo.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:r}),e[n]&&Es.throwError("cannot encode object for signature with duplicate names",yo.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 Xa(e.wordSize),o=new Xa(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===yo.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===yo.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 Za{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",yo.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=Po(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 Po(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 Ro(xo([t,$s]).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=Po(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 Za{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 yo(Sa),uc=new RegExp(/^bytes([0-9]*)$/),fc=new RegExp(/^(u?int)([0-9]*)$/);class dc{constructor(e){ha(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 Ds(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 Qa(e,this._getWordSize(),this.coerceFunc,t)}_getWriter(){return new Xa(this._getWordSize())}getDefaultValue(e){const t=e.map((e=>this._getCoder(Oa.from(e))));return new sc(t,"_").defaultValue()}encode(e,t){e.length!==t.length&&cc.throwError("types/values length mismatch",yo.errors.INVALID_ARGUMENT,{count:{types:e.length,values:t.length},value:{types:e,values:t}});const r=e.map((e=>this._getCoder(Oa.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(Oa.from(e))));return new sc(n,"_").decode(this._getReader(Po(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+vN8gF2AC2AK5EAWwApgYDKmAAroQ0NDQ0AT+OCg7wAAIHRAbpNgVcBV0APTA5BfbPFgMLzcYL/QqqA82eBALKCjQCjqYCht0/k2+OAsXQAoP3ASTKDgDw6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==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 $c(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 Dc(e){return $c(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 $c(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 yo(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(Dc(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(xo([t,rs(r.pop())]));return Ro(t)}function Hc(e){return Ro(xo(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(xo([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 yo(pc),Vc=new Uint8Array(32);Vc.fill(0);const Zc=Wo.from(-1),Xc=Wo.from(0),Qc=Wo.from(1),Yc=Wo.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");const eu=Do(Qc.toHexString(),32),tu=Do(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 Wo.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=Po(e);if(32!==t.length)throw new Error("bad length");return Ro(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=Wo.from(t);return(r.lt(o)||r.gt(i))&&Gc.throwArgumentError(`value out-of-bounds for ${e}`,"value",t),Do(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 Po(t).length!==r&&Gc.throwArgumentError(`invalid length for ${e}`,"value",t),function(e){const t=Po(e),r=t.length%32;return r?To([t,Vc.slice(r)]):Ro(t)}(t)}}}switch(e){case"address":return function(e){return Do(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){ha(this,"types",Object.freeze(Aa(e))),ha(this,"_encoderCache",{}),ha(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),ha(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(To(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),To(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 To(["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=ya(e);const i={};e.verifyingContract&&!Co(e.verifyingContract,20)&&(i[e.verifyingContract]="0x");const o=cu.from(t);o.visit(r,((e,t)=>("address"!==e||Co(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=ya(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 Ro(Po(t));if(e.match(/^u?int/))return Wo.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 yo(Sa);class du extends _a{}class lu extends _a{}class hu extends _a{}class pu extends _a{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,ha(this,"fragments",t.map((e=>ja.from(e))).filter((e=>null!=e))),ha(this,"_abiCoder",pa(new.target,"getAbiCoder")()),ha(this,"functions",{}),ha(this,"errors",{}),ha(this,"events",{}),ha(this,"structs",{}),this.fragments.forEach((e=>{let t=null;switch(e.type){case"constructor":return this.deploy?void fu.warn("duplicate definition - constructor"):void ha(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||ha(this,"deploy",za.from({payable:!1,type:"constructor"})),ha(this,"_isInterface",!0)}format(e){e||(e=Ra.full),e===Ra.sighash&&fu.throwArgumentError("interface does not support formatting sighash","format",e);const t=this.fragments.map((t=>t.format(e)));return e===Ra.json?JSON.stringify(t.map((e=>JSON.parse(e)))):t}static getAbiCoder(){return lc}static getAddress(e){return bs(e)}static getSighash(e){return Oo(hc(e.format()),0,4)}static getEventTopic(e){return hc(e.format())}getFunction(e){if(Co(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[Ua.fromString(e).format()];return t||fu.throwArgumentError("no matching function","signature",e),t}getEvent(e){if(Co(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(Co(e)){const t=pa(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[Ua.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 pa(this.constructor,"getSighash")(e)}getEventTopic(e){return"string"==typeof e&&(e=this.getEvent(e)),pa(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=Po(t);return Ro(r.slice(0,4))!==this.getSighash(e)&&fu.throwArgumentError(`data signature does not match error ${e.name}.`,"data",Ro(r)),this._decodeParams(e.inputs,r.slice(4))}encodeErrorResult(e,t){return"string"==typeof e&&(e=this.getError(e)),Ro(xo([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}decodeFunctionData(e,t){"string"==typeof e&&(e=this.getFunction(e));const r=Po(t);return Ro(r.slice(0,4))!==this.getSighash(e)&&fu.throwArgumentError(`data signature does not match function ${e.name}.`,"data",Ro(r)),this._decodeParams(e.inputs,r.slice(4))}encodeFunctionData(e,t){return"string"==typeof e&&(e=this.getFunction(e)),Ro(xo([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}decodeFunctionResult(e,t){"string"==typeof e&&(e=this.getFunction(e));let r=Po(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=Ro(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,yo.errors.CALL_EXCEPTION,{method:e.format(),data:Ro(t),errorArgs:o,errorName:a,errorSignature:s,reason:n})}encodeFunctionResult(e,t){return"string"==typeof e&&(e=this.getFunction(e)),Ro(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(),yo.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(Ro(t)):("bool"===e.type&&"boolean"==typeof t&&(t=t?"0x01":"0x00"),e.type.match(/^u?int/)&&(t=Wo.from(t).toHexString()),"address"===e.type&&this._abiCoder.encode(["address"],[t]),Do(Ro(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);Co(r[0],32)&&r[0].toLowerCase()===t||fu.throwError("fragment/topic mismatch",yo.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(Oa.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,xo(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:Wo.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=Ro(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:za,ErrorFragment:qa,EventFragment:$a,FormatTypes:Ra,Fragment:ja,FunctionFragment:Ua,Indexed:pu,Interface:yu,LogDescription:du,ParamType:Oa,TransactionDescription:lu,checkResultErrors:Va,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 yo("abstract-provider/5.7.0");class Au extends _a{static isForkEvent(e){return!(!e||!e._isForkEvent)}}class _u{constructor(){wu.checkAbstract(new.target,_u),ha(this,"_isProvider",!0)}getFeeData(){return vu(this,void 0,void 0,(function*(){const{block:e,gasPrice:t}=yield ma({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=Wo.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 yo("abstract-signer/5.7.0"),Pu=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],xu=[yo.errors.INSUFFICIENT_FUNDS,yo.errors.NONCE_EXPIRED,yo.errors.REPLACEMENT_UNDERPRICED];class ku{constructor(){Su.checkAbstract(new.target,ku),ha(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 ma(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 ma(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=ya(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 ma(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",yo.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),null==t.gasPrice&&(t.gasPrice=e.gasPrice),t.type=0):Su.throwError("failed to get consistent fee data",yo.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",yo.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 ma(t)}))}_checkProvider(e){this.provider||Su.throwError("missing provider",yo.errors.UNSUPPORTED_OPERATION,{operation:e||"_checkProvider"})}static isSigner(e){return!(!e||!e._isSigner)}}class Mu extends ku{constructor(e,t){super(),ha(this,"address",e),ha(this,"provider",t||null)}getAddress(){return Promise.resolve(this.address)}_fail(e,t){return Promise.resolve().then((()=>{Su.throwError(e,yo.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 ao(e,"hex","le")}})),Tu=Ou.getNAF,ju=Ou.getJSF,$u=Ou.assert;function Du(e,t){this.type=e,this.p=new ao(t.p,16),this.red=t.prime?ao.red(t.prime):ao.mont(this.p),this.zero=new ao(0).toRed(this.red),this.one=new ao(1).toRed(this.red),this.two=new ao(2).toRed(this.red),this.n=t.n&&new ao(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=Du;function Fu(e,t){this.curve=e,this.type=t,this.precomputed=null}Du.prototype.point=function(){throw new Error("Not implemented")},Du.prototype.validate=function(){throw new Error("Not implemented")},Du.prototype._fixedNafMul=function(e,t){$u(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];$u(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},Du.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 ao(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 ao(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:ie.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:ie.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:ie.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:ie.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:ie.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:ie.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:ie.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:ie.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 ao(e.r,16),this.s=new ao(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 ao(o),this.s=new ao(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 ao(2));;){var i=new ao(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 ao(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 ao(1)),u=0;;u++){var f=n.k?n.k(u):new ao(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 ao(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 ao(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 yo("signing-key/5.7.0");let pf=null;function mf(){return pf||(pf=new lf("secp256k1")),pf}class gf{constructor(e){ha(this,"curve","secp256k1"),ha(this,"privateKey",Ro(e)),32!==No(this.privateKey)&&hf.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const t=mf().keyFromPrivate(Po(this.privateKey));ha(this,"publicKey","0x"+t.getPublic(!1,"hex")),ha(this,"compressedPublicKey","0x"+t.getPublic(!0,"hex")),ha(this,"_isSigningKey",!0)}_addPoint(e){const t=mf().keyFromPublic(Po(this.publicKey)),r=mf().keyFromPublic(Po(e));return"0x"+t.pub.add(r.pub).encodeCompressed("hex")}signDigest(e){const t=mf().keyFromPrivate(Po(this.privateKey)),r=Po(e);32!==r.length&&hf.throwArgumentError("bad digest length","digest",e);const n=t.sign(r,{canonical:!0});return Bo({recoveryParam:n.recoveryParam,r:Do("0x"+n.r.toString(16),32),s:Do("0x"+n.s.toString(16),32)})}computeSharedSecret(e){const t=mf().keyFromPrivate(Po(this.privateKey)),r=mf().keyFromPublic(Po(bf(e)));return Do("0x"+t.derive(r.getPublic()).toString(16),32)}static isSigningKey(e){return!(!e||!e._isSigningKey)}}function yf(e,t){const r=Bo(t),n={r:Po(r.r),s:Po(r.s)};return"0x"+mf().recoverPubKey(Po(e),n,r.recoveryParam).encode("hex",!1)}function bf(e,t){const r=Po(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?Ro(r):"0x"+mf().keyFromPublic(r).getPublic(!1,"hex"):65===r.length?t?"0x"+mf().keyFromPublic(r).getPublic(!0,"hex"):Ro(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 yo("transactions/5.7.0");var Af;function _f(e){return"0x"===e?null:bs(e)}function Ef(e){return"0x"===e?Os:Wo.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(Oo(rs(Oo(bf(e),1)),12))}function kf(e,t){return xf(yf(Po(e),t))}function Mf(e,t){const r=ko(Wo.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!==No(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=Wo.from(e.gasPrice),r=Wo.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=Bo(t);r.push(Mf(e.recoveryParam,"recoveryParam")),r.push(ko(e.r)),r.push(ko(e.s))}return To(["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=Bo(t);r.push(Mf(e.recoveryParam,"recoveryParam")),r.push(ko(e.r)),r.push(ko(e.s))}return To(["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){ga(e,Pf);const r=[];Sf.forEach((function(t){let n=e[t.name]||[];const i={};t.numeric&&(i.hexPad="left"),n=Po(Ro(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=ko(n),n.length>t.maxLength&&wf.throwArgumentError("invalid length for "+t.name,"transaction:"+t.name,n)),r.push(Ro(n))}));let n=0;if(null!=e.chainId?(n=e.chainId,"number"!=typeof n&&wf.throwArgumentError("invalid transaction.chainId","transaction",e)):t&&!_o(t)&&t.v>28&&(n=Math.floor((t.v-35)/2)),0!==n&&(r.push(Ro(n)),r.push("0x"),r.push("0x")),!t)return cs(r);const i=Bo(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(Ro(o)),r.push(ko(Po(i.r))),r.push(ko(Po(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}`,yo.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=Do(t[1],32),e.s=Do(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 $f(e){const t=Po(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=Wo.from(t[6]).toNumber()}catch(e){return r}if(r.r=Do(t[7],32),r.s=Do(t[8],32),Wo.from(r.r).isZero()&&Wo.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(Ro(r.chainId)),i.push("0x"),i.push("0x"),n-=2*r.chainId+8);const o=rs(cs(i));try{r.from=kf(o,{r:Ro(r.r),s:Ro(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",Ro(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",Ro(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]}`,yo.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:t[0]})}var Df=Object.freeze({__proto__:null,get TransactionTypes(){return Af},accessListify:If,computeAddress:xf,parse:$f,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 yo("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",yo.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",yo.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=ya(r.pop())),Ff.checkArgumentCount(r.length,t.inputs.length,"passed to contract"),e.signer?n.from?n.from=ma({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",yo.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 ma({args:Uf(e.signer||e.provider,r,t.inputs),address:e.resolvedAddress,overrides:ma(n)||{}}),o=e.interface.encodeFunctionData(t,i.args),a={data:o,to:i.address},s=i.overrides;if(null!=s.nonce&&(a.nonce=Wo.from(s.nonce).toNumber()),null!=s.gasLimit&&(a.gasLimit=Wo.from(s.gasLimit)),null!=s.gasPrice&&(a.gasPrice=Wo.from(s.gasPrice)),null!=s.maxFeePerGas&&(a.maxFeePerGas=Wo.from(s.maxFeePerGas)),null!=s.maxPriorityFeePerGas&&(a.maxPriorityFeePerGas=Wo.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=Po(o);for(let t=0;tnull!=n[e]));return c.length&&Ff.throwError(`cannot override ${c.map((e=>JSON.stringify(e))).join(",")}`,yo.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=ya(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===yo.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",yo.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=Aa(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){ha(this,"tag",e),ha(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),ha(this,"address",e),ha(this,"interface",t),ha(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=Va(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}),ha(this,"address",e),ha(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){ha(this,"interface",pa(new.target,"getInterface")(t)),null==r?(ha(this,"provider",null),ha(this,"signer",null)):ku.isSigner(r)?(ha(this,"provider",r.provider||null),ha(this,"signer",r)):_u.isProvider(r)?(ha(this,"provider",r),ha(this,"signer",null)):Ff.throwArgumentError("invalid signer or provider","signerOrProvider",r),ha(this,"callStatic",{}),ha(this,"estimateGas",{}),ha(this,"functions",{}),ha(this,"populateTransaction",{}),ha(this,"filters",{});{const e={};Object.keys(this.interface.events).forEach((t=>{const r=this.interface.events[t];ha(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?ha(this.filters,t,this.filters[r[0]]):Ff.warn(`Duplicate definition of ${t} (${r.join(", ")})`)}))}if(ha(this,"_runningEvents",{}),ha(this,"_wrappedEmits",{}),null==e&&Ff.throwArgumentError("invalid contract address or ENS name","addressOrName",e),ha(this,"address",e),this.provider)ha(this,"resolvedAddress",zf(this.provider,e));else try{ha(this,"resolvedAddress",Promise.resolve(bs(e)))}catch(e){Ff.throwError("provider is required to use ENS name as contract address",yo.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]&&ha(this,e,Kf(this,t,!0)),null==this.functions[e]&&ha(this.functions,e,Kf(this,t,!1)),null==this.callStatic[e]&&ha(this.callStatic,e,qf(this,t,!0)),null==this.populateTransaction[e]&&ha(this.populateTransaction,e,function(e,t){return function(...r){return Lf(e,t,r)}}(this,t)),null==this.estimateGas[e]&&ha(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",yo.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]&&ha(this,e,this[r])}catch(e){}null==this.functions[e]&&ha(this.functions,e,this.functions[r]),null==this.callStatic[e]&&ha(this.callStatic,e,this.callStatic[r]),null==this.populateTransaction[e]&&ha(this.populateTransaction,e,this.populateTransaction[r]),null==this.estimateGas[e]&&ha(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",yo.errors.UNSUPPORTED_OPERATION,{contractAddress:this.address,operation:"getDeployed"}),this)))),this._deployedPromise}fallback(e){this.signer||Ff.throwError("sending a transactions require a signer",yo.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction(fallback)"});const t=ya(e||{});return["from","to"].forEach((function(e){null!=t[e]&&Ff.throwError("cannot override "+e,yo.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&&ha(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=Aa(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",yo.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=ya(n.filter);return"string"==typeof t&&Co(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){ha(this,"alphabet",e),ha(this,"base",e.length),ha(this,"_alphabetMap",{}),ha(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=Po(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(xo([null!=this.privateKey?"0x0488ADE4":"0x0488B21E",Ro(this.depth),this.parentFingerprint,Do(Ro(this.index),4),this.chainCode,null!=this.privateKey?xo(["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(Po(this.privateKey),1),t&&(t+="'")}else r.set(Po(this.publicKey));for(let t=24;t>=0;t-=8)r[33+(t>>3)]=e>>24-t&255;const n=Po(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(Wo.from(i).add(this.privateKey).mod(yd));else{s=new gf(Ro(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=Po(e);if(r.length<16||r.length>64)throw new Error("invalid seed");const n=Po(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=Ro(t.slice(5,9)),i=parseInt(Ro(t.slice(9,13)).substring(2),16),o=Ro(t.slice(13,45)),a=t.slice(45,78);switch(Ro(t.slice(0,4))){case"0x0488b21e":case"0x043587cf":return new xd(Sd,null,Ro(a),n,o,i,r,null);case"0x0488ade4":case"0x04358394 ":if(0!==a[0])break;return new xd(Sd,Ro(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=Po(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((Po(ad(n.slice(0,o/8)))[0]&a)!==(n[n.length-1]&a))throw new Error("invalid checksum");return Ro(n.slice(0,o/8))}function Cd(e,t){if(t=Ed(t),(e=Po(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=Po(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 yo("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),Po(t)}Od&&Od.getRandomValues||(Rd.warn("WARNING: Missing strong random number source"),Od={getRandomValues:function(e){return Rd.throwError("no secure random source avaialble",yo.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}}),$d={};!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}()}({get exports(){return Vd},set exports(e){Vd=e}});var Zd=Vd,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 yo(Bd);function Yd(e){return null!=e&&e.mnemonic&&e.mnemonic.phrase}class el extends _a{isKeystoreAccount(e){return!(!e||!e._isKeystoreAccount)}}function tl(e,t){const r=Fd(Ld(e,"crypto/ciphertext"));if(Ro(rs(xo([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 Dd.Counter(n);return Po(new Dd.ModeOfOperation.ctr(t,i).decrypt(r))}return null}(e,t.slice(0,16),r);n||Qd.throwError("unsupported cipher",yo.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:Ro(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 Dd.Counter(r),o=new Dd.ModeOfOperation.ctr(i,n),s=Ld(e,"x-ethers/path")||Pd,c=Ld(e,"x-ethers/locale")||"en",u=Po(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!==yo.errors.INVALID_ARGUMENT||"wordlist"!==e.argument)throw e}}return new el(a)}function rl(e,t,r,n,i){return Po(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=Po(e.privateKey),o=Ud(t);let a=null,s=null,c=null;if(Yd(e)){const t=e.mnemonic;a=Po(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?Po(r.salt):Td(32);let d=null;if(r.iv){if(d=Po(r.iv),16!==d.length)throw new Error("invalid iv")}else d=Td(16);let l=null;if(r.uuid){if(l=Po(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=Po(t)).slice(0,16),n=t.slice(16,32),o=t.slice(32,64),g=new Dd.Counter(d),y=Po(new Dd.ModeOfOperation.ctr(r,g).encrypt(i)),b=rs(xo([n,y])),v={address:e.address.substring(2).toLowerCase(),id:qd(l),version:3,crypto:{cipher:"aes-128-ctr",cipherparams:{iv:Ro(d).substring(2)},ciphertext:Ro(y).substring(2),kdf:"scrypt",kdfparams:{salt:Ro(f).substring(2),n:h,dklen:32,p:m,r:p},mac:b.substring(2)}};if(a){const e=Td(16),t=new Dd.Counter(e),r=Po(new Dd.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:Ro(e).substring(2),mnemonicCiphertext:Ro(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 yo("wallet/5.7.0");class hl extends ku{constructor(e,t){if(super(),null!=(r=e)&&Co(r.privateKey,32)&&null!=r.address){const t=new gf(e.privateKey);if(ha(this,"_signingKey",(()=>t)),ha(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;ha(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 ha(this,"_mnemonic",(()=>null))}else{if(gf.isSigningKey(e))"secp256k1"!==e.curve&&ll.throwArgumentError("unsupported curve; must be secp256k1","privateKey","[REDACTED]"),ha(this,"_signingKey",(()=>e));else{"string"==typeof e&&e.match(/^[0-9a-f]*$/i)&&64===e.length&&(e="0x"+e);const t=new gf(e);ha(this,"_signingKey",(()=>t))}ha(this,"_mnemonic",(()=>null)),ha(this,"address",xf(this.publicKey))}var r;t&&!_u.isProvider(t)&&ll.throwArgumentError("invalid provider","provider",t),ha(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 ma(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 Fo(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",yo.errors.UNSUPPORTED_OPERATION,{operation:"resolveName",value:e}),this.provider.resolveName(e))));return Fo(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=Po(Oo(rs(xo([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 yo("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:Po(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 yo("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(_o(e)){if(t&&("text"===t.split("/")[0]||"application/json"===t.split(";")[0].trim()))try{return Ws(e)}catch(e){}return Ro(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",yo.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=ya(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",yo.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",yo.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",yo.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=ya(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",yo.errors.SERVER_ERROR,{body:e,error:t})}return r&&(n=r(n,t)),n}))}function Il(e,t){return t||(t={}),null==(t=ya(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 Dl(e){for(var t=1,r=0;r126)return"Invalid prefix ("+e+")";t=$l(t)^n>>5}for(t=$l(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=Dl(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=Dl(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=$l(n)^a,i+=Nl.charAt(a)}for(o=0;o<6;++o)n=$l(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)}};const Ul="providers/5.7.2",Ll=new yo(Ul);class ql{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:ql.allowNull(this.accessList.bind(this),null),blockHash:ql.allowNull(o,null),blockNumber:ql.allowNull(s,null),transactionIndex:ql.allowNull(s,null),confirmations:ql.allowNull(s,null),from:t,gasPrice:ql.allowNull(r),maxPriorityFeePerGas:ql.allowNull(r),maxFeePerGas:ql.allowNull(r),gasLimit:r,to:ql.allowNull(t,null),value:r,nonce:s,data:i,r:ql.allowNull(this.uint256),s:ql.allowNull(this.uint256),v:ql.allowNull(s),creates:ql.allowNull(t,null),raw:ql.allowNull(i)},e.transactionRequest={from:ql.allowNull(t),nonce:ql.allowNull(s),gasLimit:ql.allowNull(r),gasPrice:ql.allowNull(r),maxPriorityFeePerGas:ql.allowNull(r),maxFeePerGas:ql.allowNull(r),to:ql.allowNull(t),value:ql.allowNull(r),data:ql.allowNull((e=>this.data(e,!0))),type:ql.allowNull(s),accessList:ql.allowNull(this.accessList.bind(this),null)},e.receiptLog={transactionIndex:s,blockNumber:s,transactionHash:o,address:t,topics:ql.arrayOf(o),data:i,logIndex:s,blockHash:o},e.receipt={to:ql.allowNull(this.address,null),from:ql.allowNull(this.address,null),contractAddress:ql.allowNull(t,null),transactionIndex:s,root:ql.allowNull(a),gasUsed:r,logsBloom:ql.allowNull(i),blockHash:o,transactionHash:o,logs:ql.arrayOf(this.receiptLog.bind(this)),blockNumber:s,confirmations:ql.allowNull(s,null),cumulativeGasUsed:r,effectiveGasPrice:ql.allowNull(r),status:ql.allowNull(s),type:c},e.block={hash:ql.allowNull(o),parentHash:o,number:s,timestamp:s,nonce:ql.allowNull(a),difficulty:this.difficulty.bind(this),gasLimit:r,gasUsed:r,miner:ql.allowNull(t),extraData:i,transactions:ql.allowNull(ql.arrayOf(o)),baseFeePerGas:ql.allowNull(r)},e.blockWithTransactions=ya(e.block),e.blockWithTransactions.transactions=ql.allowNull(ql.arrayOf(this.transactionResponse.bind(this))),e.filter={fromBlock:ql.allowNull(n,void 0),toBlock:ql.allowNull(n,void 0),blockHash:ql.allowNull(o,void 0),address:ql.allowNull(t,void 0),topics:ql.allowNull(this.topics.bind(this),void 0)},e.filterLog={blockNumber:ql.allowNull(s),blockHash:ql.allowNull(o),transactionIndex:s,removed:ql.allowNull(this.boolean.bind(this)),address:t,data:ql.allowFalsish(i,"0x"),topics:ql.arrayOf(o),transactionHash:o,logIndex:s},e}accessList(e){return If(e||[])}number(e){return"0x"===e?0:Wo.from(e).toNumber()}type(e){return"0x"===e||null==e?0:Wo.from(e).toNumber()}bigNumber(e){return Wo.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),Co(e))?e.toLowerCase():Ll.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(!Co(e,32))return null;const t=bs(Oo(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||Co(e))return jo(e);throw new Error("invalid blockTag")}hash(e,t){const r=this.hex(e,t);return 32!==No(r)?Ll.throwArgumentError("invalid hash","value",e):r}difficulty(e){if(null==e)return null;const t=Wo.from(e);try{return t.toNumber()}catch(e){}return null}uint256(e){if(!Co(e))throw new Error("invalid uint256");return Do(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=ql.check(t,e);return n._difficulty=null==r?null:Wo.from(r),n}block(e){return this._block(e,this.formats.block)}blockWithTransactions(e){return this._block(e,this.formats.blockWithTransactions)}transactionRequest(e){return ql.check(this.formats.transactionRequest,e)}transactionResponse(e){null!=e.gas&&null==e.gasLimit&&(e.gasLimit=e.gas),e.to&&Wo.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=ql.check(this.formats.transaction,e);if(null!=e.chainId){let r=e.chainId;Co(r)&&(r=Wo.from(r).toNumber()),t.chainId=r}else{let r=e.networkId;null==r&&null==t.v&&(r=e.chainId),Co(r)&&(r=Wo.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 $f(e)}receiptLog(e){return ql.check(this.formats.receiptLog,e)}receipt(e){const t=ql.check(this.formats.receipt,e);if(null!=t.root)if(t.root.length<=4){const e=Wo.from(t.root).toNumber();0===e||1===e?(null!=t.status&&t.status!==e&&Ll.throwArgumentError("alt-root-status/status mismatch","value",{root:t.root,status:t.status}),t.status=e,delete t.root):Ll.throwArgumentError("invalid alt-root-status","value.root",t.root)}else 66!==t.root.length&&Ll.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 ql.check(this.formats.filter,e)}filterLog(e){return ql.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 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 Kl=new yo(Ul);function Jl(e){return null==e?"null":(32!==No(e)&&Kl.throwArgumentError("invalid topic","topic",e),e.toLowerCase())}function Wl(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[Jl(e)]=!0}));const r=Object.keys(t);return r.sort(),r.join("|")}return Jl(e)})).join("&")}function Gl(e){if("string"==typeof e){if(32===No(e=e.toLowerCase()))return"tx:"+e;if(-1===e.indexOf(":"))return e}else{if(Array.isArray(e))return"filter:*:"+Wl(e);if(Au.isForkEvent(e))throw Kl.warn("not implemented"),new Error("not implemented");if(e&&"object"==typeof e)return"filter:"+(e.address||"*")+":"+Wl(e.topics||[])}throw new Error("invalid event - "+e)}function Vl(){return(new Date).getTime()}function Zl(e){return new Promise((t=>{setTimeout(t,e)}))}const Xl=["block","network","pending","poll"];class Ql{constructor(e,t,r){ha(this,"tag",e),ha(this,"listener",t),ha(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||Xl.indexOf(this.tag)>=0}}const Yl={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 eh(e){return Do(Wo.from(e).toHexString(),32)}function th(e){return td.encode(xo([e,Oo(ad(ad(e)),0,4)]))}const rh=new RegExp("^(ipfs)://(.*)$","i"),nh=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),rh,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function ih(e,t){try{return Ws(oh(e,t))}catch(e){}return null}function oh(e,t){if("0x"===e)return null;const r=Wo.from(Oo(e,t,t+32)).toNumber(),n=Wo.from(Oo(e,r,r+32)).toNumber();return Oo(e,r+32,r+32+n)}function ah(e){return e.match(/^ipfs:\/\/ipfs\//i)?e=e.substring(12):e.match(/^ipfs:\/\//i)?e=e.substring(7):Kl.throwArgumentError("unsupported IPFS format","link",e),`https://gateway.ipfs.io/ipfs/${e}`}function sh(e){const t=Po(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 ch(e){if(e.length%32==0)return e;const t=new Uint8Array(32*Math.ceil(e.length/32));return t.set(e),t}function uh(e){const t=[];let r=0;for(let n=0;nWo.from(e).eq(1))).catch((e=>{if(e.code===yo.errors.CALL_EXCEPTION)return!1;throw this._supportsEip2544=null,e}))),this._supportsEip2544}_fetch(e,t){return Hl(this,void 0,void 0,(function*(){const r={to:this.address,ccipReadEnabled:!0,data:To([e,qc(this.name),t||"0x"])};let n=!1;(yield this.supportsWildcard())&&(n=!0,r.data=To(["0x9061b923",uh([Hc(this.name),r.data])]));try{let e=yield this.provider.call(r);return Po(e).length%32==4&&Kl.throwError("resolver threw error",yo.errors.CALL_EXCEPTION,{transaction:r,data:e}),n&&(e=oh(e,0)),e}catch(e){if(e.code===yo.errors.CALL_EXCEPTION)return null;throw e}}))}_fetchBytes(e,t){return Hl(this,void 0,void 0,(function*(){const r=yield this._fetch(e,t);return null!=r?oh(r,0):null}))}_getAddress(e,t){const r=Yl[String(e)];if(null==r&&Kl.throwError(`unsupported coin type: ${e}`,yo.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`}),"eth"===r.ilk)return this.provider.formatter.address(t);const n=Po(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 th(xo([[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 th(xo([[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=zl.toWords(n.slice(2));return e.unshift(t),zl.encode(r.prefix,e)}}return null}getAddress(e){return Hl(this,void 0,void 0,(function*(){if(null==e&&(e=60),60===e)try{const e=yield this._fetch("0x3b3b57de");return"0x"===e||e===$s?null:this.provider.formatter.callAddress(e)}catch(e){if(e.code===yo.errors.CALL_EXCEPTION)return null;throw e}const t=yield this._fetchBytes("0xf1cb7e06",eh(e));if(null==t||"0x"===t)return null;const r=this._getAddress(e,t);return null==r&&Kl.throwError("invalid or unsupported coin data",yo.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`,coinType:e,data:t}),r}))}getAvatar(){return Hl(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 Kl.throwError("invalid or unsupported content hash data",yo.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:e})}))}getText(e){return Hl(this,void 0,void 0,(function*(){let t=Hs(e);t=xo([eh(64),eh(t.length),t]),t.length%32!=0&&(t=xo([t,Do("0x",32-e.length%32)]));const r=yield this._fetchBytes("0x59d1d43c",Ro(t));return null==r||"0x"===r?null:Ws(r)}))}}let dh=null,lh=1;class hh extends _u{constructor(e){if(super(),this._events=[],this._emitted={block:-2},this.disableCcipRead=!1,this.formatter=new.target.getFormatter(),ha(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=pa(new.target,"getNetwork")(e);t?(ha(this,"_network",t),this.emit("network",t,null)):Kl.throwArgumentError("invalid network","network",e)}this._maxInternalBlockNumber=-1024,this._lastBlockNumber=-2,this._maxFilterBlockRange=10,this._pollingInterval=4e3,this._fastQueryDate=0}_ready(){return Hl(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||Kl.throwError("no network detected",yo.errors.UNKNOWN_ERROR,{}),null==this._network&&(this.anyNetwork?this._network=e:ha(this,"_network",e),this.emit("network",e,null))}return this._network}))}get ready(){return Il((()=>this._ready().then((e=>e),(e=>{if(e.code!==yo.errors.NETWORK_ERROR||"noNetwork"!==e.event)throw e}))))}static getFormatter(){return null==dh&&(dh=new ql),dh}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 Hl(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 Kl.throwError(`response not found during CCIP fetch: ${u}`,yo.errors.SERVER_ERROR,{url:t,errorMessage:u});o.push(u)}return Kl.throwError(`error encountered during CCIP fetch: ${o.map((e=>JSON.stringify(e))).join(", ")}`,yo.errors.SERVER_ERROR,{urls:r,errorMessages:o})}))}_getInternalBlockNumber(e){return Hl(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(Vl()-r.respTime<=e)return r.blockNumber;break}catch(e){if(this._internalBlockNumber===t)break}}const t=Vl(),r=ma({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=Vl();return(e=Wo.from(e).toNumber()){this._internalBlockNumber===r&&(this._internalBlockNumber=null)})),(yield r).blockNumber}))}poll(){return Hl(this,void 0,void 0,(function*(){const e=lh++,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)Kl.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${r})`),this.emit("error",Kl.makeError("network block skew detected",yo.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 Hl(this,void 0,void 0,(function*(){return Kl.throwError("provider does not support network detection",yo.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"})}))}getNetwork(){return Hl(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 Zl(0),this._network;const r=Kl.makeError("underlying network changed",yo.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=Vl();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 Hl(this,void 0,void 0,(function*(){return this._waitForTransaction(e,null==t?1:t,r||0,null)}))}_waitForTransaction(e,t,r,n){return Hl(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=>Hl(this,void 0,void 0,(function*(){s||(yield Zl(1e3),this.getTransactionCount(n.from).then((f=>Hl(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(Kl.makeError("timeout exceeded",yo.errors.TIMEOUT,{timeout:r}))}),r);e.unref&&e.unref(),a.push((()=>{clearTimeout(e)}))}}))}))}getBlockNumber(){return Hl(this,void 0,void 0,(function*(){return this._getInternalBlockNumber(0)}))}getGasPrice(){return Hl(this,void 0,void 0,(function*(){yield this.getNetwork();const e=yield this.perform("getGasPrice",{});try{return Wo.from(e)}catch(t){return Kl.throwError("bad result from backend",yo.errors.SERVER_ERROR,{method:"getGasPrice",result:e,error:t})}}))}getBalance(e,t){return Hl(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield ma({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),n=yield this.perform("getBalance",r);try{return Wo.from(n)}catch(e){return Kl.throwError("bad result from backend",yo.errors.SERVER_ERROR,{method:"getBalance",params:r,result:n,error:e})}}))}getTransactionCount(e,t){return Hl(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield ma({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),n=yield this.perform("getTransactionCount",r);try{return Wo.from(n).toNumber()}catch(e){return Kl.throwError("bad result from backend",yo.errors.SERVER_ERROR,{method:"getTransactionCount",params:r,result:n,error:e})}}))}getCode(e,t){return Hl(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield ma({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),n=yield this.perform("getCode",r);try{return Ro(n)}catch(e){return Kl.throwError("bad result from backend",yo.errors.SERVER_ERROR,{method:"getCode",params:r,result:n,error:e})}}))}getStorageAt(e,t,r){return Hl(this,void 0,void 0,(function*(){yield this.getNetwork();const n=yield ma({address:this._getAddress(e),blockTag:this._getBlockTag(r),position:Promise.resolve(t).then((e=>jo(e)))}),i=yield this.perform("getStorageAt",n);try{return Ro(i)}catch(e){return Kl.throwError("bad result from backend",yo.errors.SERVER_ERROR,{method:"getStorageAt",params:n,result:i,error:e})}}))}_wrapTransaction(e,t,r){if(null!=t&&32!==No(t))throw new Error("invalid response - sendTransaction");const n=e;return null!=t&&e.hash!==t&&Kl.throwError("Transaction hash mismatch from Provider.sendTransaction.",yo.errors.UNKNOWN_ERROR,{expectedHash:e.hash,returnedHash:t}),n.wait=(t,n)=>Hl(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&&Kl.throwError("transaction failed",yo.errors.CALL_EXCEPTION,{transactionHash:e.hash,transaction:e,receipt:o}),o)})),n}sendTransaction(e){return Hl(this,void 0,void 0,(function*(){yield this.getNetwork();const t=yield Promise.resolve(e).then((e=>Ro(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 Hl(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?Wo.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?Ro(e):null)))})),this.formatter.transactionRequest(yield ma(r))}))}_getFilter(e){return Hl(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 ma(t))}))}_call(e,t,r){return Hl(this,void 0,void 0,(function*(){r>=10&&Kl.throwError("CCIP read exceeded maximum redirections",yo.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)&&No(i)%32==4)try{const o=Oo(i,4),a=Oo(o,0,32);Wo.from(a).eq(n)||Kl.throwError("CCIP Read sender did not match",yo.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:i});const s=[],c=Wo.from(Oo(o,32,64)).toNumber(),u=Wo.from(Oo(o,c,c+32)).toNumber(),f=Oo(o,c+32);for(let t=0;tHl(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 Hl(this,void 0,void 0,(function*(){yield this.getNetwork(),e=yield e;const t={transactionHash:this.formatter.hash(e,!0)};return Il((()=>Hl(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 Hl(this,void 0,void 0,(function*(){yield this.getNetwork(),e=yield e;const t={transactionHash:this.formatter.hash(e,!0)};return Il((()=>Hl(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 Hl(this,void 0,void 0,(function*(){yield this.getNetwork();const t=yield ma({filter:this._getFilter(e)}),r=yield this.perform("getLogs",t);return r.forEach((e=>{null==e.removed&&(e.removed=!1)})),ql.arrayOf(this.formatter.filterLog.bind(this.formatter))(r)}))}getEtherPrice(){return Hl(this,void 0,void 0,(function*(){return yield this.getNetwork(),this.perform("getEtherPrice",{})}))}_getBlockTag(e){return Hl(this,void 0,void 0,(function*(){if("number"==typeof(e=yield e)&&e<0){e%1&&Kl.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 Hl(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 fh(this,r,e);return t===e||(yield n.supportsWildcard())?n:null}t=t.split(".").slice(1).join(".")}}))}_getResolver(e,t){return Hl(this,void 0,void 0,(function*(){null==t&&(t="ENS");const r=yield this.getNetwork();r.ensAddress||Kl.throwError("network does not support ENS",yo.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 Hl(this,void 0,void 0,(function*(){e=yield e;try{return Promise.resolve(this.formatter.address(e))}catch(t){if(Co(e))throw t}"string"!=typeof e&&Kl.throwArgumentError("invalid ENS name","name",e);const t=yield this.getResolver(e);return t?yield t.getAddress():null}))}lookupAddress(e){return Hl(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=ih(yield this.call({to:r,data:"0x691f3431"+qc(t).substring(2)}),0);return(yield this.resolveName(n))!=e?null:n}))}getAvatar(e){return Hl(this,void 0,void 0,(function*(){let t=null;if(Co(e)){const r=this.formatter.address(e).substring(2).toLowerCase()+".addr.reverse",n=yield this._getResolver(r,"getAvatar");if(!n)return null;t=new fh(this,n,r);try{const e=yield t.getAvatar();if(e)return e.url}catch(e){if(e.code!==yo.errors.CALL_EXCEPTION)throw e}try{const e=ih(yield this.call({to:n,data:"0x691f3431"+qc(r).substring(2)}),0);t=yield this.getResolver(e)}catch(e){if(e.code!==yo.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 Kl.throwError(e+" not implemented",yo.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 Ql(Gl(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=Gl(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=Gl(e);return this._events.filter((e=>e.tag===t)).length}listeners(e){if(null==e)return this._events.map((e=>e.listener));let t=Gl(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=Gl(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=Gl(e);this._events=this._events.filter((e=>e.tag!==r||(t.push(e),!1)))}return t.forEach((e=>{this._stopEvent(e)})),this}}var ph=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 mh=new yo(Ul),gh=["call","estimateGas"];function yh(e,t){if(null==e)return null;if("string"==typeof e.message&&e.message.match("reverted")){const r=Co(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=yh(e[r],t);if(n)return n}return null}if("string"==typeof e)try{return yh(JSON.parse(e),t)}catch(e){}return null}function bh(e,t,r){const n=r.transaction||r.signedTransaction;if("call"===e){const e=yh(t,!0);if(e)return e.data;mh.throwError("missing revert data in call exception; Transaction reverted without a reason string",yo.errors.CALL_EXCEPTION,{data:"0x",transaction:n,error:t})}if("estimateGas"===e){let r=yh(t.body,!1);null==r&&(r=yh(t,!1)),r&&mh.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",yo.errors.UNPREDICTABLE_GAS_LIMIT,{reason:r.message,method:e,transaction:n,error:t})}let i=t.message;throw t.code===yo.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)&&mh.throwError("insufficient funds for intrinsic transaction cost",yo.errors.INSUFFICIENT_FUNDS,{error:t,method:e,transaction:n}),i.match(/nonce (is )?too low/i)&&mh.throwError("nonce has already been used",yo.errors.NONCE_EXPIRED,{error:t,method:e,transaction:n}),i.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&mh.throwError("replacement fee too low",yo.errors.REPLACEMENT_UNDERPRICED,{error:t,method:e,transaction:n}),i.match(/only replay-protected/i)&&mh.throwError("legacy pre-eip-155 transactions not supported",yo.errors.UNSUPPORTED_OPERATION,{error:t,method:e,transaction:n}),gh.indexOf(e)>=0&&i.match(/gas required exceeds allowance|always failing transaction|execution reverted|revert/)&&mh.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",yo.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,method:e,transaction:n}),t}function vh(e){return new Promise((function(t){setTimeout(t,e)}))}function wh(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 Ah(e){return e?e.toLowerCase():e}const _h={};class Eh extends ku{constructor(e,t,r){if(super(),e!==_h)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");ha(this,"provider",t),null==r&&(r=0),"string"==typeof r?(ha(this,"_address",this.provider.formatter.address(r)),ha(this,"_index",null)):"number"==typeof r?(ha(this,"_index",r),ha(this,"_address",null)):mh.throwArgumentError("invalid address or index","addressOrIndex",r)}connect(e){return mh.throwError("cannot alter JSON-RPC Signer connection",yo.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}connectUnchecked(){return new Sh(_h,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&&mh.throwError("unknown account #"+this._index,yo.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),this.provider.formatter.address(e[this._index]))))}sendUncheckedTransaction(e){e=ya(e);const t=this.getAddress().then((e=>(e&&(e=e.toLowerCase()),e)));if(null==e.gasLimit){const r=ya(e);r.from=t,e.gasLimit=this.provider.estimateGas(r)}return null!=e.to&&(e.to=Promise.resolve(e.to).then((e=>ph(this,void 0,void 0,(function*(){if(null==e)return null;const t=yield this.provider.resolveName(e);return null==t&&mh.throwArgumentError("provided ENS name resolves to null","tx.to",e),t}))))),ma({tx:ma(e),sender:t}).then((({tx:t,sender:r})=>{null!=t.from?t.from.toLowerCase()!==r&&mh.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)&&mh.throwError("user rejected transaction",yo.errors.ACTION_REJECTED,{action:"sendTransaction",transaction:t}),bh("sendTransaction",e,n))))}))}signTransaction(e){return mh.throwError("signing transactions is unsupported",yo.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}sendTransaction(e){return ph(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((()=>ph(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 ph(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",[Ro(t),r.toLowerCase()])}catch(t){throw"string"==typeof t.message&&t.message.match(/user denied/i)&&mh.throwError("user rejected signing",yo.errors.ACTION_REJECTED,{action:"signMessage",from:r,messageData:e}),t}}))}_legacySignMessage(e){return ph(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(),Ro(t)])}catch(t){throw"string"==typeof t.message&&t.message.match(/user denied/i)&&mh.throwError("user rejected signing",yo.errors.ACTION_REJECTED,{action:"_legacySignMessage",from:r,messageData:e}),t}}))}_signTypedData(e,t,r){return ph(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)&&mh.throwError("user rejected signing",yo.errors.ACTION_REJECTED,{action:"_signTypedData",from:i,messageData:{domain:n.domain,types:t,value:n.value}}),e}}))}unlock(e){return ph(this,void 0,void 0,(function*(){const t=this.provider,r=yield this.getAddress();return t.send("personal_unlockAccount",[r.toLowerCase(),e,null])}))}}class Sh extends Eh{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 Ph={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0};class xh extends hh{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=pa(this.constructor,"defaultUrl")()),ha(this,"connection","string"==typeof e?Object.freeze({url:e}):Object.freeze(ya(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 ph(this,void 0,void 0,(function*(){yield vh(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=pa(this.constructor,"getNetwork");try{return t(Wo.from(e).toNumber())}catch(t){return mh.throwError("could not detect network",yo.errors.NETWORK_ERROR,{chainId:e,event:"invalidNetwork",serverError:t})}}return mh.throwError("could not detect network",yo.errors.NETWORK_ERROR,{event:"noNetwork"})}))}getSigner(e){return new Eh(_h,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:Aa(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),wh).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",[Ah(t.address),t.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[Ah(t.address),t.blockTag]];case"getCode":return["eth_getCode",[Ah(t.address),t.blockTag]];case"getStorageAt":return["eth_getStorageAt",[Ah(t.address),Do(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",[pa(this.constructor,"hexlifyTransaction")(t.transaction,{from:!0}),t.blockTag]];case"estimateGas":return["eth_estimateGas",[pa(this.constructor,"hexlifyTransaction")(t.transaction,{from:!0})]];case"getLogs":return t.filter&&null!=t.filter.address&&(t.filter.address=Ah(t.filter.address)),["eth_getLogs",[t.filter]]}return null}perform(e,t){return ph(this,void 0,void 0,(function*(){if("call"===e||"estimateGas"===e){const e=t.transaction;if(e&&null!=e.type&&Wo.from(e.type).isZero()&&null==e.maxFeePerGas&&null==e.maxPriorityFeePerGas){const r=yield this.getFeeData();null==r.maxFeePerGas&&null==r.maxPriorityFeePerGas&&((t=ya(t)).transaction=ya(e),delete t.transaction.type)}}const r=this.prepareRequest(e,t);null==r&&mh.throwError(e+" not implemented",yo.errors.NOT_IMPLEMENTED,{operation:e});try{return yield this.send(r[0],r[1])}catch(r){return bh(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 vh(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=ya(Ph);if(t)for(const e in t)t[e]&&(r[e]=!0);ga(e,r);const n={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach((function(t){if(null==e[t])return;const r=jo(Wo.from(e[t]));"gasLimit"===t&&(t="gas"),n[t]=r})),["from","to","data"].forEach((function(t){null!=e[t]&&(n[t]=Ro(e[t]))})),e.accessList&&(n.accessList=If(e.accessList)),n}}const kh=new RegExp("^bytes([0-9]+)$"),Mh=new RegExp("^(u?int)([0-9]*)$"),Ch=new RegExp("^(.*)\\[([0-9]*)\\]$"),Ih="0000000000000000000000000000000000000000000000000000000000000000",Rh=new yo("solidity/5.7.0");function Nh(e,t,r){switch(e){case"address":return r?Mo(t,32):Po(t);case"string":return Hs(t);case"bytes":return Po(t);case"bool":return t=t?"0x01":"0x00",r?Mo(t,32):Po(t)}let n=e.match(Mh);if(n){let i=parseInt(n[2]||"256");return(n[2]&&String(i)!==n[2]||i%8!=0||0===i||i>256)&&Rh.throwArgumentError("invalid number type","type",e),r&&(i=256),Mo(t=Wo.from(t).toTwos(i),i/8)}if(n=e.match(kh),n){const i=parseInt(n[1]);return(String(i)!==n[1]||0===i||i>32)&&Rh.throwArgumentError("invalid bytes type","type",e),Po(t).byteLength!==i&&Rh.throwArgumentError(`invalid value for ${e}`,"value",t),r?Po((t+Ih).substring(0,66)):t}if(n=e.match(Ch),n&&Array.isArray(t)){const r=n[1];parseInt(n[2]||String(t.length))!=t.length&&Rh.throwArgumentError(`invalid array length for ${e}`,"value",t);const i=[];return t.forEach((function(e){i.push(Nh(r,e,!0))})),xo(i)}return Rh.throwArgumentError("invalid type","type",e)}function Oh(e,t){e.length!=t.length&&Rh.throwArgumentError("wrong number of values; expected ${ types.length }","values",t);const r=[];return e.forEach((function(e,n){r.push(Nh(e,t[n]))})),Ro(xo(r))}var Th=Object.freeze({__proto__:null,keccak256:function(e,t){return rs(Oh(e,t))},pack:Oh,sha256:function(e,t){return ad(Oh(e,t))}});const jh=new yo("units/5.7.0"),$h=["wei","kwei","mwei","gwei","szabo","finney","ether"];function Dh(e,t){if("string"==typeof t){const e=$h.indexOf(t);-1!==e&&(t=3*e)}return oa(e,null!=t?t:18)}function Bh(e,t){if("string"!=typeof e&&jh.throwArgumentError("value must be a string","value",e),"string"==typeof t){const e=$h.indexOf(t);-1!==e&&(t=3*e)}return aa(e,null!=t?t:18)}var Fh=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)&&jh.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 Dh(e,18)},formatUnits:Dh,parseEther:function(e){return Bh(e,18)},parseUnits:Bh});function zh(e){if(null==e.match(/^(0x)?([\da-fA-F]{40})$/))throw new RangeError("incorrect address format");try{return bs(ro(e,!0,20))}catch(e){throw new tn(e,["invalid EIP-55 address"])}}function Uh(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 tn("no a DID or a valid public or private key",["invalid format"])}}async function Lh(e){return r(await io(Yi(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 Zi(r,t);const n=await Hi(t),i=t.alg,o={...e,iat:Math.floor(Date.now()/1e3)};return{jws:await new Ui(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 Wi(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){eo("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(Yi(n)!==Yi(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]&&Yi(s[e])!==Yi(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]&&Yi(t[r])!==Yi(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 Wi(e),i=n.exchange,o={...i};delete o.id;if(await Lh(o)!==i.id)throw new tn(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 tn(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 tn(e,["invalid por"])}try{const e=await t.getSecretFromLedger(Gi(i.encAlg),i.ledgerSignerAddress,i.id,r);u=e.hex,f=e.iat}catch(e){throw new tn(e,["cannot verify"])}try{eo(1e3*f,1e3*n.iat,1e3*c.iat+i.pooToSecretDelay)}catch(e){throw new tn(`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 Wi(e)).payload}catch(e){throw new tn(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 tn(e,["invalid por","invalid verification request"])}try{await Wi(e,"dest"===n.iss?i:o)}catch(e){throw new tn(e,["invalid verification request"])}return{pooPayload:a,porPayload:s,vrPayload:n,destPublicJwk:i,origPublicJwk:o}}async function Gh(e,t){const{payload:n}=await Wi(e),{destPublicJwk:i,origPublicJwk:o,secretHex:a,pooPayload:s,porPayload:c}=await Jh(n.por,t);try{await Wi(e,i)}catch(e){throw e instanceof tn&&e.add("invalid dispute request"),e}if(r(await io(n.cipherblock,c.exchange.hashAlg),!0,!1)!==c.exchange.cipherblockDgst)throw new tn(new Error("cipherblock does not meet the committed (and already accepted) one"),["invalid dispute request"]);return await Ji(n.cipherblock,(await Vi(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 li(n);return await new Ui(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 Zi(this.jwkPair.publicJwk,this.jwkPair.privateJwk)}async resolveCompleteness(e){await this.initialized;const{payload:t}=await Wi(e);let r;try{r=(await Wi(t.por)).payload}catch(e){throw new tn(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 tn)||e.nrErrors.includes("invalid verification request")||e.nrErrors.includes("unexpected error"))throw e}const i=await li(this.jwkPair.privateJwk);return await new Ui(n).setProtectedHeader({alg:this.jwkPair.privateJwk.alg}).setIssuedAt(n.iat).sign(i)}async resolveDispute(e){await this.initialized;const{payload:t}=await Wi(e);let r;try{r=(await Wi(t.por)).payload}catch(e){throw new tn(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 tn&&e.nrErrors.includes("decryption failed")))throw new tn(e,["cannot verify"]);n.resolution="accepted"}const i=await li(this.jwkPair.privateJwk);return await new Ui(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 no(this.jwkPair.publicJwk,!0),sub:t}}},checkCompleteness:Wh,checkDecryption:Gh,generateVerificationRequest:Vh,verifyPor:Jh,verifyResolution:async function(e,t){return await Wi(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,r,i,a){let s=Wo.from(0),c=Wo.from(0);const u=ro(o(n(r)),!0);let f=0;do{try{({secret:s,timestamp:c}=await e.registry(ro(t,!0),u))}catch(e){throw new tn(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 xh(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 xh(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:i})})).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:i})})).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=f(bu),up=f(ws),fp=f(yc),dp=f(nd),lp=f(zo),hp=f(uu),pp=f(Id),mp=f(fl),gp=f(ns),yp=f(bo),bp=f(cd),vp=f(Th),wp=f(jd),Ap=f(Ea),_p=f(ls),Ep=f(vf),Sp=f(oc),Pp=f(Df),xp=f(Fh),kp=f(pl),Mp=f(Rl);!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=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 s=dp;Object.defineProperty(e,"base58",{enumerable:!0,get:function(){return s.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 tn(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 tn(`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:{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"]}]}}},Tp={},jp={get exports(){return Tp},set exports(e){Tp=e}},$p={},Dp={},Bp={},Fp={},zp={},Up={};!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}}}(Lp),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=Up,r=Lp;var n=Up;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=Lp;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)}}(zp);var qp={};!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=zp,r=Up;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}(qp);var Hp={};Object.defineProperty(Hp,"__esModule",{value:!0});const Kp=zp,Jp={data:new Kp.Name("data"),valCxt:new Kp.Name("valCxt"),instancePath:new Kp.Name("instancePath"),parentData:new Kp.Name("parentData"),parentDataProperty:new Kp.Name("parentDataProperty"),rootData:new Kp.Name("rootData"),dynamicAnchors:new Kp.Name("dynamicAnchors"),vErrors:new Kp.Name("vErrors"),errors:new Kp.Name("errors"),this:new Kp.Name("this"),self:new Kp.Name("self"),scope:new Kp.Name("scope"),json:new Kp.Name("json"),jsonPos:new Kp.Name("jsonPos"),jsonLen:new Kp.Name("jsonLen"),jsonPart:new Kp.Name("jsonPart")};Hp.default=Jp,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=zp,r=qp,n=Hp;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]}}(Fp),Object.defineProperty(Bp,"__esModule",{value:!0}),Bp.boolOrEmptySchema=Bp.topBoolOrEmptySchema=void 0;const Wp=Fp,Gp=zp,Vp=Hp,Zp={message:"boolean schema is false"};function Xp(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,Wp.reportError)(i,Zp,void 0,t)}Bp.topBoolOrEmptySchema=function(e){const{gen:t,schema:r,validateName:n}=e;!1===r?Xp(e,!1):"object"==typeof r&&!0===r.$async?t.return(Vp.default.data):(t.assign(Gp._`${n}.errors`,null),t.return(!0))},Bp.boolOrEmptySchema=function(e,t){const{gen:r,schema:n}=e;!1===n?(r.var(t,!1),Xp(e)):r.var(t,!0)};var Qp={},Yp={};Object.defineProperty(Yp,"__esModule",{value:!0}),Yp.getRules=Yp.isJSONType=void 0;const em=new Set(["string","number","integer","boolean","null","object","array"]);Yp.isJSONType=function(e){return"string"==typeof e&&em.has(e)},Yp.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 tm={};function rm(e,t){return t.rules.some((t=>nm(e,t)))}function nm(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(tm,"__esModule",{value:!0}),tm.shouldUseRule=tm.shouldUseGroup=tm.schemaHasRulesForType=void 0,tm.schemaHasRulesForType=function({schema:e,self:t},r){const n=t.RULES.types[r];return n&&!0!==n&&rm(e,n)},tm.shouldUseGroup=rm,tm.shouldUseRule=nm,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=Yp,r=tm,n=Fp,i=zp,o=qp;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}(Qp);var im={};Object.defineProperty(im,"__esModule",{value:!0}),im.assignDefaults=void 0;const om=zp,am=qp;function sm(e,t,r){const{gen:n,compositeRule:i,data:o,opts:a}=e;if(void 0===r)return;const s=om._`${o}${(0,om.getProperty)(t)}`;if(i)return void(0,am.checkStrictMode)(e,`default is ignored for: ${s}`);let c=om._`${s} === undefined`;"empty"===a.useDefaults&&(c=om._`${c} || ${s} === null || ${s} === ""`),n.if(c,om._`${s} = ${(0,om.stringify)(r)}`)}im.assignDefaults=function(e,t){const{properties:r,items:n}=e.schema;if("object"===t&&r)for(const t in r)sm(e,t,r[t].default);else"array"===t&&Array.isArray(n)&&n.forEach(((t,r)=>sm(e,r,t.default)))};var cm={},um={};Object.defineProperty(um,"__esModule",{value:!0}),um.validateUnion=um.validateArray=um.usePattern=um.callValidateCode=um.schemaProperties=um.allSchemaProperties=um.noPropertyInData=um.propertyInData=um.isOwnProperty=um.hasPropFunc=um.reportMissingProp=um.checkMissingProp=um.checkReportMissingProp=void 0;const fm=zp,dm=qp,lm=Hp,hm=qp;function pm(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:fm._`Object.prototype.hasOwnProperty`})}function mm(e,t,r){return fm._`${pm(e)}.call(${t}, ${r})`}function gm(e,t,r,n){const i=fm._`${t}${(0,fm.getProperty)(r)} === undefined`;return n?(0,fm.or)(i,(0,fm.not)(mm(e,t,r))):i}function ym(e){return e?Object.keys(e).filter((e=>"__proto__"!==e)):[]}um.checkReportMissingProp=function(e,t){const{gen:r,data:n,it:i}=e;r.if(gm(r,n,t,i.opts.ownProperties),(()=>{e.setParams({missingProperty:fm._`${t}`},!0),e.error()}))},um.checkMissingProp=function({gen:e,data:t,it:{opts:r}},n,i){return(0,fm.or)(...n.map((n=>(0,fm.and)(gm(e,t,n,r.ownProperties),fm._`${i} = ${n}`))))},um.reportMissingProp=function(e,t){e.setParams({missingProperty:t},!0),e.error()},um.hasPropFunc=pm,um.isOwnProperty=mm,um.propertyInData=function(e,t,r,n){const i=fm._`${t}${(0,fm.getProperty)(r)} !== undefined`;return n?fm._`${i} && ${mm(e,t,r)}`:i},um.noPropertyInData=gm,um.allSchemaProperties=ym,um.schemaProperties=function(e,t){return ym(t).filter((r=>!(0,dm.alwaysValidSchema)(e,t[r])))},um.callValidateCode=function({schemaCode:e,data:t,it:{gen:r,topSchemaRef:n,schemaPath:i,errorPath:o},it:a},s,c,u){const f=u?fm._`${e}, ${t}, ${n}${i}`:t,d=[[lm.default.instancePath,(0,fm.strConcat)(lm.default.instancePath,o)],[lm.default.parentData,a.parentData],[lm.default.parentDataProperty,a.parentDataProperty],[lm.default.rootData,lm.default.rootData]];a.opts.dynamicRef&&d.push([lm.default.dynamicAnchors,lm.default.dynamicAnchors]);const l=fm._`${f}, ${r.object(...d)}`;return c!==fm.nil?fm._`${s}.call(${c}, ${l})`:fm._`${s}(${l})`};const bm=fm._`new RegExp`;um.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:fm._`${"new RegExp"===i.code?bm:(0,hm.useFunc)(e,i)}(${r}, ${n})`})},um.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",fm._`${r}.length`);t.forRange("i",0,a,(r=>{e.subschema({keyword:n,dataProp:r,dataPropType:dm.Type.Num},o),t.if((0,fm.not)(o),i)}))}},um.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,dm.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,fm._`${o} || ${a}`);e.mergeValidEvaluated(s,a)||t.if((0,fm.not)(o))})))),e.result(o,(()=>e.reset()),(()=>e.error(!0)))},Object.defineProperty(cm,"__esModule",{value:!0}),cm.validateKeywordUsage=cm.validSchemaType=cm.funcKeywordCode=cm.macroKeywordCode=void 0;const vm=zp,wm=Hp,Am=um,_m=Fp;function Em(e){const{gen:t,data:r,it:n}=e;t.if(n.parentData,(()=>t.assign(r,vm._`${n.parentData}[${n.parentDataProperty}]`)))}function Sm(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,vm.stringify)(r)})}cm.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=Sm(r,n,s);!1!==a.opts.validateSchema&&a.self.validateSchema(s,!0);const u=r.name("valid");e.subschema({schema:s,schemaPath:vm.nil,errSchemaPath:`${a.errSchemaPath}/${n}`,topSchemaRef:c,compositeRule:!0},u),e.pass(u,(()=>e.error(!0)))},cm.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=Sm(n,i,u),d=n.let("valid");function l(r=(t.async?vm._`await `:vm.nil)){const i=c.opts.passContext?wm.default.this:wm.default.self,o=!("compile"in t&&!s||!1===t.schema);n.assign(d,vm._`${r}${(0,Am.callValidateCode)(e,f,i,o)}`,t.modifying)}function h(e){var r;n.if((0,vm.not)(null!==(r=t.valid)&&void 0!==r?r:d),e)}e.block$data(d,(function(){if(!1===t.errors)l(),t.modifying&&Em(e),h((()=>e.error()));else{const r=t.async?function(){const e=n.let("ruleErrs",null);return n.try((()=>l(vm._`await `)),(t=>n.assign(d,!1).if(vm._`${t} instanceof ${c.ValidationError}`,(()=>n.assign(e,vm._`${t}.errors`)),(()=>n.throw(t))))),e}():function(){const e=vm._`${f}.errors`;return n.assign(e,null),l(vm.nil),e}();t.modifying&&Em(e),h((()=>function(e,t){const{gen:r}=e;r.if(vm._`Array.isArray(${t})`,(()=>{r.assign(wm.default.vErrors,vm._`${wm.default.vErrors} === null ? ${t} : ${wm.default.vErrors}.concat(${t})`).assign(wm.default.errors,vm._`${wm.default.vErrors}.length`),(0,_m.extendErrors)(e)}),(()=>e.error()))}(e,r)))}})),e.ok(null!==(r=t.valid)&&void 0!==r?r:d)},cm.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))},cm.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 Pm={};Object.defineProperty(Pm,"__esModule",{value:!0}),Pm.extendSubschemaMode=Pm.extendSubschemaData=Pm.getSubschema=void 0;const xm=zp,km=qp;Pm.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:xm._`${e.schemaPath}${(0,xm.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:n[r],schemaPath:xm._`${e.schemaPath}${(0,xm.getProperty)(t)}${(0,xm.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,km.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')},Pm.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",xm._`${t.data}${(0,xm.getProperty)(r)}`,!0)),e.errorPath=xm.str`${i}${(0,km.getErrorPath)(r,n,a.jsPropertySyntax)}`,e.parentDataProperty=xm._`${r}`,e.dataPathArr=[...o,e.parentDataProperty]}if(void 0!==i){c(i instanceof xm.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)},Pm.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 Mm={},Cm=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},Im={},Rm={get exports(){return Im},set exports(e){Im=e}}.exports=function(e,t,r){"function"==typeof t&&(r=t,t={}),Nm(t,"function"==typeof(r=t.cb||r)?r:r.pre||function(){},r.post||function(){},e,"",e)};function Nm(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 Rm.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]+"#"}Mm.getFullPath=zm,Mm._getFullPath=Um;const Lm=/#\/?$/;function qm(e){return e?e.replace(Lm,""):""}Mm.normalizeId=qm,Mm.resolveUrl=function(e,t,r){return r=qm(r),e.resolve(t,r)};const Hm=/^[a-z_][-a-z0-9._]*$/i;Mm.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=Bp,Jm=Qp,Wm=tm,Gm=Qp,Vm=im,Zm=cm,Xm=Pm,Qm=zp,Ym=Hp,eg=Mm,tg=qp,rg=Fp;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=Mm;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=zp,Mg=Ag,Cg=Hp,Ig=Mm,Rg=qp,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=$g.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 $g(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 Dg(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=Dg.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=$g,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={};!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]}}}($p);var Kg={},Jg={},Wg={};Object.defineProperty(Wg,"__esModule",{value:!0}),Wg.callRef=Wg.getValidate=void 0;const Gg=Eg,Vg=um,Zg=zp,Xg=Hp,Qg=xg,Yg=qp,ey={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 ry(e,a,o,o.$async);const r=t.scopeValue("root",{ref:u});return ry(e,Zg._`${r}.validate`,u,u.$async)}();const f=Qg.resolveRef.call(c,u,i,r);if(void 0===f)throw new Gg.default(n.opts.uriResolver,i,r);return f instanceof Qg.SchemaEnv?function(t){const r=ty(e,t);ry(e,r,t,t.$async)}(f):function(n){const i=t.scopeValue("schema",!0===s.code.source?{ref:n,code:(0,Zg.stringify)(n)}:{ref:n}),o=t.name("valid"),a=e.subschema({schema:n,dataTypes:[],schemaPath:Zg.nil,topSchemaRef:i,errSchemaPath:r},o);e.mergeEvaluated(a),e.ok(o)}(f)}};function ty(e,t){const{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):Zg._`${r.scopeValue("wrapper",{ref:t})}.validate`}function ry(e,t,r,n){const{gen:i,it:o}=e,{allErrors:a,schemaEnv:s,opts:c}=o,u=c.passContext?Xg.default.this:Zg.nil;function f(e){const t=Zg._`${e}.errors`;i.assign(Xg.default.vErrors,Zg._`${Xg.default.vErrors} === null ? ${t} : ${Xg.default.vErrors}.concat(${t})`),i.assign(Xg.default.errors,Zg._`${Xg.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=Yg.mergeEvaluated.props(i,n.props,o.props));else{const t=i.var("props",Zg._`${e}.evaluated.props`);o.props=Yg.mergeEvaluated.props(i,t,o.props,Zg.Name)}if(!0!==o.items)if(n&&!n.dynamicItems)void 0!==n.items&&(o.items=Yg.mergeEvaluated.items(i,n.items,o.items));else{const t=i.var("items",Zg._`${e}.evaluated.items`);o.items=Yg.mergeEvaluated.items(i,t,o.items,Zg.Name)}}n?function(){if(!s.$async)throw new Error("async schema referenced by sync schema");const r=i.let("valid");i.try((()=>{i.code(Zg._`await ${(0,Vg.callValidateCode)(e,t,u)}`),d(t),a||i.assign(r,!0)}),(e=>{i.if(Zg._`!(${e} instanceof ${o.ValidationError})`,(()=>i.throw(e))),f(e),a||i.assign(r,!1)})),e.ok(r)}():e.result((0,Vg.callValidateCode)(e,t,u),(()=>d(t)),(()=>f(t)))}Wg.getValidate=ty,Wg.callRef=ry,Wg.default=ey,Object.defineProperty(Jg,"__esModule",{value:!0});const ny=["$schema","id","$defs",{keyword:"$comment"},"definitions",Wg.default];Jg.default=ny;var iy={},oy={};Object.defineProperty(oy,"__esModule",{value:!0});const ay=$p,sy=zp.operators,cy={maximum:{exclusive:"exclusiveMaximum",ops:[{okStr:"<=",ok:sy.LTE,fail:sy.GT},{okStr:"<",ok:sy.LT,fail:sy.GTE}]},minimum:{exclusive:"exclusiveMinimum",ops:[{okStr:">=",ok:sy.GTE,fail:sy.LT},{okStr:">",ok:sy.GT,fail:sy.LTE}]}},uy={message:e=>ay.str`must be ${dy(e).okStr} ${e.schemaCode}`,params:e=>ay._`{comparison: ${dy(e).okStr}, limit: ${e.schemaCode}}`},fy={keyword:Object.keys(cy),type:"number",schemaType:"number",$data:!0,error:uy,code(e){const{data:t,schemaCode:r}=e;e.fail$data(ay._`${t} ${dy(e).fail} ${r} || isNaN(${t})`)}};function dy(e){var t;const r=e.keyword,n=(null===(t=e.parentSchema)||void 0===t?void 0:t[cy[r].exclusive])?1:0;return cy[r].ops[n]}oy.default=fy;var ly={};Object.defineProperty(ly,"__esModule",{value:!0});const hy={exclusiveMaximum:"maximum",exclusiveMinimum:"minimum"},py={keyword:Object.keys(hy),type:"number",schemaType:"boolean",code({keyword:e,parentSchema:t}){const r=hy[e];if(void 0===t[r])throw new Error(`${e} can only be used with ${r}`)}};ly.default=py;var my={};Object.defineProperty(my,"__esModule",{value:!0});const gy=zp,yy={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:e})=>gy.str`must be multiple of ${e}`,params:({schemaCode:e})=>gy._`{multipleOf: ${e}}`},code(e){const{gen:t,data:r,schemaCode:n,it:i}=e,o=i.opts.multipleOfPrecision,a=t.let("res"),s=o?gy._`Math.abs(Math.round(${a}) - ${a}) > 1e-${o}`:gy._`${a} !== parseInt(${a})`;e.fail$data(gy._`(${n} === 0 || (${a} = ${r}/${n}, ${s}))`)}};my.default=yy;var by={},vy={};function wy(e){const t=e.length;let r,n=0,i=0;for(;i=55296&&r<=56319&&iAy.str`must NOT have ${"maxLength"===e?"more":"fewer"} than ${t} characters`,params:({schemaCode:e})=>Ay._`{limit: ${e}}`},Py={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:Sy,code(e){const{keyword:t,data:r,schemaCode:n,it:i}=e,o="maxLength"===t?Ay.operators.GT:Ay.operators.LT,a=!1===i.opts.unicode?Ay._`${r}.length`:Ay._`${(0,_y.useFunc)(e.gen,Ey.default)}(${r})`;e.fail$data(Ay._`${a} ${o} ${n}`)}};by.default=Py;var xy={};Object.defineProperty(xy,"__esModule",{value:!0});const ky=um,My=zp,Cy={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>My.str`must match pattern "${e}"`,params:({schemaCode:e})=>My._`{pattern: ${e}}`},code(e){const{data:t,$data:r,schema:n,schemaCode:i,it:o}=e,a=o.opts.unicodeRegExp?"u":"",s=r?My._`(new RegExp(${i}, ${a}))`:(0,ky.usePattern)(e,n);e.fail$data(My._`!${s}.test(${t})`)}};xy.default=Cy;var Iy={};Object.defineProperty(Iy,"__esModule",{value:!0});const Ry=zp,Ny={message:({keyword:e,schemaCode:t})=>Ry.str`must NOT have ${"maxProperties"===e?"more":"fewer"} than ${t} properties`,params:({schemaCode:e})=>Ry._`{limit: ${e}}`},Oy={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:Ny,code(e){const{keyword:t,data:r,schemaCode:n}=e,i="maxProperties"===t?Ry.operators.GT:Ry.operators.LT;e.fail$data(Ry._`Object.keys(${r}).length ${i} ${n}`)}};Iy.default=Oy;var Ty={};Object.defineProperty(Ty,"__esModule",{value:!0});const jy=um,$y=zp,Dy=qp,By={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,jy.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,jy.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,jy.checkMissingProp)(e,r,a)),(0,jy.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,Dy.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,jy.noPropertyInData)(t,i,r,s.ownProperties),(()=>e.error()))}))}}};Ty.default=By;var Fy={};Object.defineProperty(Fy,"__esModule",{value:!0});const zy=zp,Uy={message:({keyword:e,schemaCode:t})=>zy.str`must NOT have ${"maxItems"===e?"more":"fewer"} than ${t} items`,params:({schemaCode:e})=>zy._`{limit: ${e}}`},Ly={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:Uy,code(e){const{keyword:t,data:r,schemaCode:n}=e,i="maxItems"===t?zy.operators.GT:zy.operators.LT;e.fail$data(zy._`${r}.length ${i} ${n}`)}};Fy.default=Ly;var qy={},Hy={};Object.defineProperty(Hy,"__esModule",{value:!0});const Ky=Cm;Ky.code='require("ajv/dist/runtime/equal").default',Hy.default=Ky,Object.defineProperty(qy,"__esModule",{value:!0});const Jy=Qp,Wy=zp,Gy=qp,Vy=Hy,Zy={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:e,j:t}})=>Wy.str`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>Wy._`{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,Jy.getSchemaTypes)(o.items):[];function f(n,i){const o=t.name("item"),a=(0,Jy.checkDataTypes)(u,o,s.opts.strictNumbers,Jy.DataType.Wrong),f=t.const("indices",Wy._`{}`);t.for(Wy._`;${n}--;`,(()=>{t.let(o,Wy._`${r}[${n}]`),t.if(a,Wy._`continue`),u.length>1&&t.if(Wy._`typeof ${o} == "string"`,Wy._`${o} += "_"`),t.if(Wy._`typeof ${f}[${o}] == "number"`,(()=>{t.assign(i,Wy._`${f}[${o}]`),e.error(),t.assign(c,!1).break()})).code(Wy._`${f}[${o}] = ${n}`)}))}function d(n,i){const o=(0,Gy.useFunc)(t,Vy.default),a=t.name("outer");t.label(a).for(Wy._`;${n}--;`,(()=>t.for(Wy._`${i} = ${n}; ${i}--;`,(()=>t.if(Wy._`${o}(${r}[${n}], ${r}[${i}])`,(()=>{e.error(),t.assign(c,!1).break(a)}))))))}e.block$data(c,(function(){const n=t.let("i",Wy._`${r}.length`),i=t.let("j");e.setParams({i:n,j:i}),t.assign(c,!0),t.if(Wy._`${n} > 1`,(()=>(u.length>0&&!u.some((e=>"object"===e||"array"===e))?f:d)(n,i)))}),Wy._`${a} === false`),e.ok(c)}};qy.default=Zy;var Xy={};Object.defineProperty(Xy,"__esModule",{value:!0});const Qy=zp,Yy=qp,eb=Hy,tb={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:e})=>Qy._`{allowedValue: ${e}}`},code(e){const{gen:t,data:r,$data:n,schemaCode:i,schema:o}=e;n||o&&"object"==typeof o?e.fail$data(Qy._`!${(0,Yy.useFunc)(t,eb.default)}(${r}, ${i})`):e.fail(Qy._`${o} !== ${r}`)}};Xy.default=tb;var rb={};Object.defineProperty(rb,"__esModule",{value:!0});const nb=zp,ib=qp,ob=Hy,ab={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:e})=>nb._`{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,ib.useFunc)(t,ob.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(nb._`${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,nb.or)(...i.map(((t,n)=>function(e,t){const n=i[t];return"object"==typeof n&&null!==n?nb._`${u()}(${r}, ${e}[${t}])`:nb._`${r} === ${n}`}(e,n))))}e.pass(f)}};rb.default=ab,Object.defineProperty(iy,"__esModule",{value:!0});const sb=ly,cb=my,ub=by,fb=xy,db=Iy,lb=Ty,hb=Fy,pb=qy,mb=Xy,gb=rb,yb=[oy.default,sb.default,cb.default,ub.default,fb.default,db.default,lb.default,hb.default,pb.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},mb.default,gb.default];iy.default=yb;var bb={},vb={};Object.defineProperty(vb,"__esModule",{value:!0}),vb.validateAdditionalItems=void 0;const wb=zp,Ab=qp,_b={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:e}})=>wb.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>wb._`{limit: ${e}}`},code(e){const{parentSchema:t,it:r}=e,{items:n}=t;Array.isArray(n)?Eb(e,n):(0,Ab.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas')}};function Eb(e,t){const{gen:r,schema:n,data:i,keyword:o,it:a}=e;a.items=!0;const s=r.const("len",wb._`${i}.length`);if(!1===n)e.setParams({len:t.length}),e.pass(wb._`${s} <= ${t.length}`);else if("object"==typeof n&&!(0,Ab.alwaysValidSchema)(a,n)){const n=r.var("valid",wb._`${s} <= ${t.length}`);r.if((0,wb.not)(n),(()=>function(n){r.forRange("i",t.length,s,(t=>{e.subschema({keyword:o,dataProp:t,dataPropType:Ab.Type.Num},n),a.allErrors||r.if((0,wb.not)(n),(()=>r.break()))}))}(n))),e.ok(n)}}vb.validateAdditionalItems=Eb,vb.default=_b;var Sb={},Pb={};Object.defineProperty(Pb,"__esModule",{value:!0}),Pb.validateTuple=void 0;const xb=zp,kb=qp,Mb=um,Cb={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){const{schema:t,it:r}=e;if(Array.isArray(t))return Ib(e,"additionalItems",t);r.items=!0,(0,kb.alwaysValidSchema)(r,t)||e.ok((0,Mb.validateArray)(e))}};function Ib(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,kb.checkStrictMode)(s,e,n.strictTuples)}}(i),s.opts.unevaluated&&r.length&&!0!==s.items&&(s.items=kb.mergeEvaluated.items(n,r.length,s.items));const c=n.name("valid"),u=n.const("len",xb._`${o}.length`);r.forEach(((t,r)=>{(0,kb.alwaysValidSchema)(s,t)||(n.if(xb._`${u} > ${r}`,(()=>e.subschema({keyword:a,schemaProp:r,dataProp:r},c))),e.ok(c))}))}Pb.validateTuple=Ib,Pb.default=Cb,Object.defineProperty(Sb,"__esModule",{value:!0});const Rb=Pb,Nb={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,Rb.validateTuple)(e,"items")};Sb.default=Nb;var Ob={};Object.defineProperty(Ob,"__esModule",{value:!0});const Tb=zp,jb=qp,$b=um,Db=vb,Bb={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:e}})=>Tb.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>Tb._`{limit: ${e}}`},code(e){const{schema:t,parentSchema:r,it:n}=e,{prefixItems:i}=r;n.items=!0,(0,jb.alwaysValidSchema)(n,t)||(i?(0,Db.validateAdditionalItems)(e,i):e.ok((0,$b.validateArray)(e)))}};Ob.default=Bb;var Fb={};Object.defineProperty(Fb,"__esModule",{value:!0});const zb=zp,Ub=qp,Lb={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:e,max:t}})=>void 0===t?zb.str`must contain at least ${e} valid item(s)`:zb.str`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>void 0===t?zb._`{minContains: ${e}}`:zb._`{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",zb._`${i}.length`);if(e.setParams({min:a,max:s}),void 0===s&&0===a)return void(0,Ub.checkStrictMode)(o,'"minContains" == 0 without "maxContains": "contains" keyword ignored');if(void 0!==s&&a>s)return(0,Ub.checkStrictMode)(o,'"minContains" > "maxContains" is always invalid'),void e.fail();if((0,Ub.alwaysValidSchema)(o,r)){let t=zb._`${f} >= ${a}`;return void 0!==s&&(t=zb._`${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(zb._`${e}++`),void 0===s?t.if(zb._`${e} >= ${a}`,(()=>t.assign(d,!0).break())):(t.if(zb._`${e} > ${s}`,(()=>t.assign(d,!1).break())),1===a?t.assign(d,!0):t.if(zb._`${e} >= ${a}`,(()=>t.assign(d,!0))))}(r)))))}function h(r,n){t.forRange("i",0,f,(t=>{e.subschema({keyword:"contains",dataProp:t,dataPropType:Ub.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(zb._`${i}.length > 0`,l)):(t.let(d,!1),l()),e.result(d,(()=>e.reset()))}};Fb.default=Lb;var qb={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const t=zp,r=qp,n=um;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}(qb);var Hb={};Object.defineProperty(Hb,"__esModule",{value:!0});const Kb=zp,Jb=qp,Wb={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:e})=>Kb._`{propertyName: ${e.propertyName}}`},code(e){const{gen:t,schema:r,data:n,it:i}=e;if((0,Jb.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,Kb.not)(o),(()=>{e.error(!0),i.allErrors||t.break()}))})),e.ok(o)}};Hb.default=Wb;var Gb={};Object.defineProperty(Gb,"__esModule",{value:!0});const Vb=um,Zb=zp,Xb=Hp,Qb=qp,Yb={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:e})=>Zb._`{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,Qb.alwaysValidSchema)(a,r))return;const u=(0,Vb.allSchemaProperties)(n.properties),f=(0,Vb.allSchemaProperties)(n.patternProperties);function d(e){t.code(Zb._`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,Qb.alwaysValidSchema)(a,r)){const r=t.name("valid");"failing"===c.removeAdditional?(h(n,r,!1),t.if((0,Zb.not)(r),(()=>{e.reset(),d(n)}))):(h(n,r),s||t.if((0,Zb.not)(r),(()=>t.break())))}}}function h(t,r,n){const i={keyword:"additionalProperties",dataProp:t,dataPropType:Qb.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,Qb.schemaRefOrVal)(a,n.properties,"properties");i=(0,Vb.isOwnProperty)(t,e,r)}else i=u.length?(0,Zb.or)(...u.map((e=>Zb._`${r} === ${e}`))):Zb.nil;return f.length&&(i=(0,Zb.or)(i,...f.map((t=>Zb._`${(0,Vb.usePattern)(e,t)}.test(${r})`)))),(0,Zb.not)(i)}(r),(()=>l(r))):l(r)})),e.ok(Zb._`${o} === ${Xb.default.errors}`)}};Gb.default=Yb;var ev={};Object.defineProperty(ev,"__esModule",{value:!0});const tv=Dp,rv=um,nv=qp,iv=Gb,ov={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&&iv.default.code(new tv.KeywordCxt(o,iv.default,"additionalProperties"));const a=(0,rv.allSchemaProperties)(r);for(const e of a)o.definedProperties.add(e);o.opts.unevaluated&&a.length&&!0!==o.props&&(o.props=nv.mergeEvaluated.props(t,(0,nv.toHash)(a),o.props));const s=a.filter((e=>!(0,nv.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,rv.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)}}};ev.default=ov;var av={};Object.defineProperty(av,"__esModule",{value:!0});const sv=um,cv=zp,uv=qp,fv=qp,dv={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,sv.allSchemaProperties)(r),c=s.filter((e=>(0,uv.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 cv.Name||(o.props=(0,fv.evaluatedPropsToName)(t,o.props));const{props:d}=o;function l(e){for(const t in u)new RegExp(e).test(t)&&(0,uv.checkStrictMode)(o,`property ${t} matches pattern ${e} (use allowMatchingProperties)`)}function h(r){t.forIn("key",n,(n=>{t.if(cv._`${(0,sv.usePattern)(e,r)}.test(${n})`,(()=>{const i=c.includes(r);i||e.subschema({keyword:"patternProperties",schemaProp:r,dataProp:n,dataPropType:fv.Type.Str},f),o.opts.unevaluated&&!0!==d?t.assign(cv._`${d}[${n}]`,!0):i||o.allErrors||t.if((0,cv.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))}()}};av.default=dv;var lv={};Object.defineProperty(lv,"__esModule",{value:!0});const hv=qp,pv={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){const{gen:t,schema:r,it:n}=e;if((0,hv.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"}};lv.default=pv;var mv={};Object.defineProperty(mv,"__esModule",{value:!0});const gv={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:um.validateUnion,error:{message:"must match a schema in anyOf"}};mv.default=gv;var yv={};Object.defineProperty(yv,"__esModule",{value:!0});const bv=zp,vv=qp,wv={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:e})=>bv._`{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,vv.alwaysValidSchema)(i,r)?t.var(c,!0):o=e.subschema({keyword:"oneOf",schemaProp:n,compositeRule:!0},c),n>0&&t.if(bv._`${c} && ${a}`).assign(a,!1).assign(s,bv._`[${s}, ${n}]`).else(),t.if(c,(()=>{t.assign(a,!0),t.assign(s,n),o&&e.mergeEvaluated(o,bv.Name)}))}))})),e.result(a,(()=>e.reset()),(()=>e.error(!0)))}};yv.default=wv;var Av={};Object.defineProperty(Av,"__esModule",{value:!0});const _v=qp,Ev={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,_v.alwaysValidSchema)(n,t))return;const o=e.subschema({keyword:"allOf",schemaProp:r},i);e.ok(i),e.mergeEvaluated(o)}))}};Av.default=Ev;var Sv={};Object.defineProperty(Sv,"__esModule",{value:!0});const Pv=zp,xv=qp,kv={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:e})=>Pv.str`must match "${e.ifClause}" schema`,params:({params:e})=>Pv._`{failingKeyword: ${e.ifClause}}`},code(e){const{gen:t,parentSchema:r,it:n}=e;void 0===r.then&&void 0===r.else&&(0,xv.checkStrictMode)(n,'"if" without "then" and "else" is ignored');const i=Mv(n,"then"),o=Mv(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,Pv.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,Pv._`${r}`):e.setParams({ifClause:r})}}e.pass(a,(()=>e.error(!0)))}};function Mv(e,t){const r=e.schema[t];return void 0!==r&&!(0,xv.alwaysValidSchema)(e,r)}Sv.default=kv;var Cv={};Object.defineProperty(Cv,"__esModule",{value:!0});const Iv=qp,Rv={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){void 0===t.if&&(0,Iv.checkStrictMode)(r,`"${e}" without "if" is ignored`)}};Cv.default=Rv,Object.defineProperty(bb,"__esModule",{value:!0});const Nv=vb,Ov=Sb,Tv=Pb,jv=Ob,$v=Fb,Dv=qb,Bv=Hb,Fv=Gb,zv=ev,Uv=av,Lv=lv,qv=mv,Hv=yv,Kv=Av,Jv=Sv,Wv=Cv;bb.default=function(e=!1){const t=[Lv.default,qv.default,Hv.default,Kv.default,Jv.default,Wv.default,Bv.default,Fv.default,Dv.default,zv.default,Uv.default];return e?t.push(Ov.default,jv.default):t.push(Nv.default,Tv.default),t.push($v.default),t};var Gv={},Vv={};Object.defineProperty(Vv,"__esModule",{value:!0});const Zv=zp,Xv={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>Zv.str`must match format "${e}"`,params:({schemaCode:e})=>Zv._`{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",Zv._`${i}[${a}]`),s=r.let("fType"),u=r.let("format");r.if(Zv._`typeof ${o} == "object" && !(${o} instanceof RegExp)`,(()=>r.assign(s,Zv._`${o}.type || "string"`).assign(u,Zv._`${o}.validate`)),(()=>r.assign(s,Zv._`"string"`).assign(u,o))),e.fail$data((0,Zv.or)(!1===c.strictSchema?Zv.nil:Zv._`${a} && !${u}`,function(){const e=f.$async?Zv._`(${o}.async ? await ${u}(${n}) : ${u}(${n}))`:Zv._`${u}(${n})`,r=Zv._`(typeof ${u} == "function" ? ${e} : ${u}.test(${n}))`;return Zv._`${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,Zv.regexpCode)(e):c.code.formats?Zv._`${c.code.formats}${(0,Zv.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,Zv._`${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 Zv._`await ${l}(${n})`}return"function"==typeof s?Zv._`${l}(${n})`:Zv._`${l}.test(${n})`}())}())}};Vv.default=Xv,Object.defineProperty(Gv,"__esModule",{value:!0});const Qv=[Vv.default];Gv.default=Qv,Object.defineProperty(Kg,"__esModule",{value:!0});const Yv=iy,ew=bb,tw=Gv,rw=[Jg.default,Yv.default,ew.default(),tw.default,["title","description","default"]];Kg.default=rw;var nw,iw,ow={},aw={};nw=aw,Object.defineProperty(nw,"__esModule",{value:!0}),nw.DiscrError=void 0,(iw=nw.DiscrError||(nw.DiscrError={})).Tag="tag",iw.Mapping="mapping",Object.defineProperty(ow,"__esModule",{value:!0});const sw=zp,cw=aw,uw=xg,fw=qp,dw={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:e,tagName:t}})=>e===cw.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>sw._`{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",sw._`${r}${(0,sw.getProperty)(s)}`);function f(r){const n=t.name("valid"),i=e.subschema({keyword:"oneOf",schemaProp:r},n);return e.mergeEvaluated(i,sw.Name),n}t.if(sw._`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:cw.DiscrError.Tag,tag:u,tagName:s}))),e.ok(c)}};ow.default=dw;var lw={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=Kg,i=ow,o=lw,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}})}(jp,Tp);var hw=u(Tp),pw={},mw={get exports(){return pw},set exports(e){pw=e}},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})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d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-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:Cw.GTE,fail:Cw.LT},exclusiveMaximum:{okStr:"<",ok:Cw.LT,fail:Cw.GTE},exclusiveMinimum:{okStr:">",ok:Cw.GT,fail:Cw.LTE}},Rw={message:({keyword:e,schemaCode:t})=>Mw.str`must be ${Iw[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>Mw._`{comparison: ${Iw[e].okStr}, limit: ${t}}`},Nw={keyword:Object.keys(Iw),type:"number",schemaType:"number",$data:!0,error:Rw,code(e){const{keyword:t,data:r,schemaCode:n}=e;e.fail$data(Mw._`${r} ${Iw[t].fail} ${n} || isNaN(${r})`)}};kw.default=Nw,Object.defineProperty(xw,"__esModule",{value:!0});const Ow=my,Tw=by,jw=xy,$w=Iy,Dw=Ty,Bw=Fy,Fw=qy,zw=Xy,Uw=rb,Lw=[kw.default,Ow.default,Tw.default,jw.default,$w.default,Dw.default,Bw.default,Fw.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},zw.default,Uw.default];xw.default=Lw;var qw={};Object.defineProperty(qw,"__esModule",{value:!0}),qw.contentVocabulary=qw.metadataVocabulary=void 0,qw.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],qw.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"],Object.defineProperty(ww,"__esModule",{value:!0});const Hw=xw,Kw=bb,Jw=Gv,Ww=qw,Gw=[Aw.default,Hw.default,(0,Kw.default)(),Jw.default,Ww.metadataVocabulary,Ww.contentVocabulary];ww.default=Gw;var Vw={$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=ww,i=ow,o=Vw,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=zp;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}})}(vw,bw),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;const t=bw,r=zp,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=zp,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,pw);var Zw=u(pw),Xw={}; -/** - * @license - * Lodash - * Copyright OpenJS Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */ -!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)}({get exports(){return Xw},set exports(e){Xw=e}},Xw);var Qw=Xw,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 tn(new Error("invalid timestamp"),["invalid timestamp"])}async function tA(e){const t=[],r=new hw({strictSchema:!1,removeAdditional:"all"});r.addMetaSchema(Yw),Zw(r);const n=Op.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 tn(`[${e.instancePath}] ${e.message??"unknown"}`,["invalid format"]))})),Yi(o)!==Yi(e)&&t.push(new tn("Additional claims beyond the schema are not supported",["invalid format"]))}catch(e){t.push(new tn(e,["invalid format"]))}return t}async function rA(e){const t=[];try{const{id:r,...n}=e;r!==await Lh(n)&&t.push(new tn("Invalid dataExchange id",["cannot verify","invalid format"]));const{blockCommitment:i,secretCommitment:o,cipherblockDgst:a,...s}=n,c=await nA(s);c.length>0&&c.forEach((e=>{t.push(e)}))}catch(e){t.push(new tn("Invalid dataExchange",["cannot verify","invalid format"]))}return t}async function nA(e){const t=[],r=Object.keys(e);(r.length<10||r.length>11)&&t.push(new tn(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 no(JSON.parse(e[n]),!0)&&t.push(new tn(`[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 tn(`[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=zh(e[n]),e[n]!==r&&t.push(new tn(`[dataExchangeAgreeement.${n}] Invalid EIP-55 address ${e[n]}. Did you mean ${r} instead?`,["invalid EIP-55 address","invalid format"]))}catch(r){t.push(new tn(`[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 tn(`[dataExchangeAgreeement.${n}] < 0 or not a number`,["invalid timestamp","invalid format"]))}catch(e){t.push(new tn(`[dataExchangeAgreeement.${n}] < 0 or not a number`,["invalid timestamp","invalid format"]))}break;case"hashAlg":Xr.includes(e[n])||t.push(new tn(`[dataExchangeAgreeement.${n}Invalid hash algorithm '${e[n]}'. It must be one of: ${Xr.join(", ")}`,["invalid algorithm"]));break;case"encAlg":Yr.includes(e[n])||t.push(new tn(`[dataExchangeAgreeement.${n}Invalid encryption algorithm '${e[n]}'. It must be one of: ${Yr.join(", ")}`,["invalid algorithm"]));break;case"signingAlg":Qr.includes(e[n])||t.push(new tn(`[dataExchangeAgreeement.${n}Invalid signing algorithm '${e[n]}'. It must be one of: ${Qr.join(", ")}`,["invalid algorithm"]));break;case"schema":break;default:t.push(new tn(new Error(`Property ${n} not allowed in dataAgreement`),["invalid format"]))}}return t}var iA=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 nA(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 tn("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 Zi(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 io(t,this.agreement.hashAlg),!0,!1),{payload:o}=await Wi(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: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 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 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 Hh(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(Gi(this.agreement.encAlg),this.agreement.ledgerSignerAddress,this.exchange.id,r);this.block.secret=await Vi(this.exchange.encAlg,n);try{eo(1e3*i,1e3*this.block.por.payload.iat,1e3*this.block.poo.payload.iat+this.exchange.pooToSecretDelay)}catch(e){throw new tn(`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 Ji(this.block.jwe,this.block.secret.jwk)).plaintext;if(r(await io(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 Hi(this.jwkPairDest.privateJwk);try{return await new Ui(e).setProtectedHeader({alg:this.jwkPairDest.privateJwk.alg}).setIssuedAt(e.iat).sign(t)}catch(e){throw new tn(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 nA(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 tn("Resource has not been validated:\n"+e.join("\n"),t)}this.agreement=e,await Zi(this.jwkPairOrig.publicJwk,this.jwkPairOrig.privateJwk);const i=await Vi(this.agreement.encAlg);this.block={...this.block,secret:i,jwe:await Ki(this.block.raw,i.jwk,this.agreement.encAlg)};const o=r(await io(this.block.jwe,this.agreement.hashAlg),!0,!1),s=r(await io(this.block.raw,this.agreement.hashAlg),!0,!1),c=r(await io(new Uint8Array(a(this.block.secret.hex)),this.agreement.hashAlg),!0,!1),u={...this.agreement,cipherblockDgst:o,blockCommitment:s,secretCommitment:c},f=await Lh(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!==ro(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)}}});export{Zh as ConflictResolution,Yr as ENC_ALGS,rp as EthersIoAgentDest,Cp as EthersIoAgentOrig,Xr as HASH_ALGS,ap as I3mServerWalletAgentDest,Rp as I3mServerWalletAgentOrig,ip as I3mWalletAgentDest,Ip as I3mWalletAgentOrig,en as KEY_AGREEMENT_ALGS,iA as NonRepudiationProtocol,tn as NrError,Qr as SIGNING_ALGS,Np as Signers,eo as checkTimestamp,qh as createProof,Xh as defaultDltConfig,Lh as exchangeId,nn as generateKeys,Uh as getDltAddress,Hi as importJwk,to as jsonSort,Ji as jweDecrypt,Ki as jweEncrypt,Wi as jwsDecode,Vi as oneTimeSecret,zh as parseAddress,ro as parseHex,no as parseJwk,io as sha,rA as validateDataExchange,nA as validateDataExchangeAgreement,tA as validateDataSharingAgreementSchema,Zi as verifyKeyPair,Hh as verifyProof}; diff --git a/dist/bundles/iife.js b/dist/bundles/iife.js deleted file mode 100644 index c2af7a2..0000000 --- a/dist/bundles/iife.js +++ /dev/null @@ -1,27 +0,0 @@ -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 g={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(g[e])return g[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 g[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)}})(g,u);var 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=m,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,_={};function E(e){this.rand=e}if({get exports(){return _},set exports(e){_=e}}.exports=function(e){return A||(A=new E(null)),A.generate(e)},_.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 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 D(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 D(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)},$(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=m,K=T,J=N,W=p;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=m,Q=T,Y=N,ee=p.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=b,ce=T;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=b;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 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=p,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=ie,Sr=_,Pr=p.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=p,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=p,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=oe,Hr=ie,Kr=p,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,sn=async(e,t)=>{const r=`SHA-${e.slice(-3)}`;return new Uint8Array(await on.subtle.digest(r,t))},cn=new TextEncoder,un=new TextDecoder,fn=2**32;function dn(...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 ln(e,t,r){if(t<0||t>=fn)throw new RangeError(`value must be >= 0 and <= ${fn-1}. Received ${t}`);e.set([t>>>24,t>>>16,t>>>8,255&t],r)}function hn(e){const t=Math.floor(e/fn),r=e%fn,n=new Uint8Array(8);return ln(n,t,0),ln(n,r,4),n}function pn(e){const t=new Uint8Array(4);return ln(t,e),t}function mn(e){return dn(pn(e.length),e)}const gn=e=>(e=>{let t=e;"string"==typeof t&&(t=cn.encode(t));const r=[];for(let e=0;e{let t=e;t instanceof Uint8Array&&(t=un.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;eMn(new Uint8Array(Cn(e)>>3));const Rn=(e,t)=>{if(t.length<<3!==Cn(e))throw new Sn("Invalid Initialization Vector length")},Nn=(e,t)=>{const r=e.byteLength<<3;if(r!==t)throw new Sn(`Invalid Content Encryption Key length. Expected ${t} bits, got ${r} bits`)};function On(){return"undefined"!=typeof WebSocketPair||"undefined"!=typeof navigator&&"Cloudflare-Workers"===navigator.userAgent||"undefined"!=typeof EdgeRuntime&&"vercel"===EdgeRuntime}function Tn(e,t="algorithm.name"){return new TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`)}function jn(e,t){return e.name===t}function Dn(e){return parseInt(e.name.slice(4),10)}function $n(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 Bn(e,t,...r){switch(t){case"HS256":case"HS384":case"HS512":{if(!jn(e.algorithm,"HMAC"))throw Tn("HMAC");const r=parseInt(t.slice(2),10);if(Dn(e.algorithm.hash)!==r)throw Tn(`SHA-${r}`,"algorithm.hash");break}case"RS256":case"RS384":case"RS512":{if(!jn(e.algorithm,"RSASSA-PKCS1-v1_5"))throw Tn("RSASSA-PKCS1-v1_5");const r=parseInt(t.slice(2),10);if(Dn(e.algorithm.hash)!==r)throw Tn(`SHA-${r}`,"algorithm.hash");break}case"PS256":case"PS384":case"PS512":{if(!jn(e.algorithm,"RSA-PSS"))throw Tn("RSA-PSS");const r=parseInt(t.slice(2),10);if(Dn(e.algorithm.hash)!==r)throw Tn(`SHA-${r}`,"algorithm.hash");break}case"EdDSA":if("Ed25519"!==e.algorithm.name&&"Ed448"!==e.algorithm.name){if(On()){if(jn(e.algorithm,"NODE-ED25519"))break;throw Tn("Ed25519, Ed448, or NODE-ED25519")}throw Tn("Ed25519 or Ed448")}break;case"ES256":case"ES384":case"ES512":{if(!jn(e.algorithm,"ECDSA"))throw Tn("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 Tn(r,"algorithm.namedCurve");break}default:throw new TypeError("CryptoKey does not support this operation")}$n(e,r)}function Fn(e,t,...r){switch(t){case"A128GCM":case"A192GCM":case"A256GCM":{if(!jn(e.algorithm,"AES-GCM"))throw Tn("AES-GCM");const r=parseInt(t.slice(1,4),10);if(e.algorithm.length!==r)throw Tn(r,"algorithm.length");break}case"A128KW":case"A192KW":case"A256KW":{if(!jn(e.algorithm,"AES-KW"))throw Tn("AES-KW");const r=parseInt(t.slice(1,4),10);if(e.algorithm.length!==r)throw Tn(r,"algorithm.length");break}case"ECDH":switch(e.algorithm.name){case"ECDH":case"X25519":case"X448":break;default:throw Tn("ECDH, X25519, or X448")}break;case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":if(!jn(e.algorithm,"PBKDF2"))throw Tn("PBKDF2");break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":{if(!jn(e.algorithm,"RSA-OAEP"))throw Tn("RSA-OAEP");const r=parseInt(t.slice(9),10)||1;if(Dn(e.algorithm.hash)!==r)throw Tn(`SHA-${r}`,"algorithm.hash");break}default:throw new TypeError("CryptoKey does not support this operation")}$n(e,r)}function zn(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 Un=(e,...t)=>zn("Key must be ",e,...t);function Ln(e,t,...r){return zn(`Key for the ${e} algorithm must be `,t,...r)}var qn=e=>an(e);const Hn=["CryptoKey"];async function Kn(e,t,r,n,i,o){if(!(t instanceof Uint8Array))throw new TypeError(Un(t,"Uint8Array"));const a=parseInt(e.slice(1,4),10),s=await on.subtle.importKey("raw",t.subarray(a>>3),"AES-CBC",!1,["decrypt"]),c=await on.subtle.importKey("raw",t.subarray(0,a>>3),{hash:"SHA-"+(a<<1),name:"HMAC"},!1,["sign"]),u=dn(o,n,r,hn(o.length<<3)),f=new Uint8Array((await on.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(!(an(t)||t instanceof Uint8Array))throw new TypeError(Un(t,...Hn,"Uint8Array"));switch(Rn(e,n),e){case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return t instanceof Uint8Array&&Nn(t,parseInt(e.slice(-3),10)),Kn(e,t,r,n,i,o);case"A128GCM":case"A192GCM":case"A256GCM":return t instanceof Uint8Array&&Nn(t,parseInt(e.slice(1,4),10)),async function(e,t,r,n,i,o){let a;t instanceof Uint8Array?a=await on.subtle.importKey("raw",t,"AES-GCM",!1,["decrypt"]):(Fn(t,e,"decrypt"),a=t);try{return new Uint8Array(await on.subtle.decrypt({additionalData:o,iv:n,name:"AES-GCM",tagLength:128},a,dn(r,i)))}catch(e){throw new En}}(e,t,r,n,i,o);default:throw new _n("Unsupported JWE Content Encryption Algorithm")}},Wn=async()=>{throw new _n('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.')},Gn=async()=>{throw new _n('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.')},Vn=(...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 Zn(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 Xn=[{hash:"SHA-256",name:"HMAC"},!0,["sign"]];function Qn(e,t){if(e.algorithm.length!==parseInt(t.slice(1,4),10))throw new TypeError(`Invalid key size for alg: ${t}`)}function Yn(e,t,r){if(an(e))return Fn(e,t,r),e;if(e instanceof Uint8Array)return on.subtle.importKey("raw",e,"AES-KW",!0,[r]);throw new TypeError(Un(e,...Hn,"Uint8Array"))}const ei=async(e,t,r)=>{const n=await Yn(t,e,"wrapKey");Qn(n,e);const i=await on.subtle.importKey("raw",r,...Xn);return new Uint8Array(await on.subtle.wrapKey("raw",i,n,"AES-KW"))},ti=async(e,t,r)=>{const n=await Yn(t,e,"unwrapKey");Qn(n,e);const i=await on.subtle.unwrapKey("raw",r,n,"AES-KW",...Xn);return new Uint8Array(await on.subtle.exportKey("raw",i))};async function ri(e,t,r,n,i=new Uint8Array(0),o=new Uint8Array(0)){if(!an(e))throw new TypeError(Un(e,...Hn));if(Fn(e,"ECDH"),!an(t))throw new TypeError(Un(t,...Hn));Fn(t,"ECDH","deriveBits");const a=dn(mn(cn.encode(r)),mn(i),mn(o),pn(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 on.subtle.deriveBits({name:e.algorithm.name,public:e},t,s)),n,a)}function ni(e){if(!an(e))throw new TypeError(Un(e,...Hn));return["P-256","P-384","P-521"].includes(e.algorithm.namedCurve)||"X25519"===e.algorithm.name||"X448"===e.algorithm.name}async function ii(e,t,r,n){!function(e){if(!(e instanceof Uint8Array)||e.length<8)throw new Sn("PBES2 Salt Input must be 8 or more octets")}(e);const i=function(e,t){return dn(cn.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 on.subtle.importKey("raw",e,"PBKDF2",!1,["deriveBits"]);if(an(e))return Fn(e,t,"deriveBits","deriveKey"),e;throw new TypeError(Un(e,...Hn,"Uint8Array"))}(n,t);if(c.usages.includes("deriveBits"))return new Uint8Array(await on.subtle.deriveBits(a,c,o));if(c.usages.includes("deriveKey"))return on.subtle.deriveKey(a,c,s,!1,["wrapKey","unwrapKey"]);throw new TypeError('PBKDF2 key "usages" must include "deriveBits" or "deriveKey"')}const oi=async(e,t,r,n,i)=>{const o=await ii(i,e,n,t);return ti(e.slice(-6),o,r)};function ai(e){switch(e){case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":return"RSA-OAEP";default:throw new _n(`alg ${e} is not supported either by JOSE or your javascript runtime`)}}var si=(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 ci=async(e,t,r)=>{if(!an(t))throw new TypeError(Un(t,...Hn));if(Fn(t,e,"decrypt","unwrapKey"),si(e,t),t.usages.includes("decrypt"))return new Uint8Array(await on.subtle.decrypt(ai(e),t,r));if(t.usages.includes("unwrapKey")){const n=await on.subtle.unwrapKey("raw",r,t,ai(e),...Xn);return new Uint8Array(await on.subtle.exportKey("raw",n))}throw new TypeError('RSA-OAEP key "usages" must include "decrypt" or "unwrapKey" for this operation')};function ui(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 _n(`Unsupported JWE Algorithm: ${e}`)}}var fi=e=>Mn(new Uint8Array(ui(e)>>3));var di=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 _n(`${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 _n('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 _n('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 _n('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 _n('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;default:throw new _n('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 on.subtle.importKey("raw",yn(e.k),...o);const a={...e};delete a.alg,delete a.use;try{return await on.subtle.importKey("jwk",a,...o)}catch(e){if("Ed25519"===n.name&&"NotSupportedError"===(null==e?void 0:e.name)&&On())return o[0]={name:"NODE-ED25519",namedCurve:"NODE-ED25519"},await on.subtle.importKey("jwk",a,...o);throw e}};async function li(e,t,r){var n;if(!Zn(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?di({...e,alg:t,ext:null!==(n=e.ext)&&void 0!==n&&n}):yn(e.k);case"RSA":if(void 0!==e.oth)throw new _n('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');case"EC":case"OKP":return di({...e,alg:t});default:throw new _n('Unsupported "kty" (Key Type) Parameter value')}}const hi=(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(!qn(t))throw new TypeError(Ln(e,t,...Hn,"Uint8Array"));if("secret"!==t.type)throw new TypeError(`${Hn.join(" or ")} instances for symmetric algorithms must be of type "secret"`)}})(e,t):((e,t,r)=>{if(!qn(t))throw new TypeError(Ln(e,t,...Hn));if("secret"===t.type)throw new TypeError(`${Hn.join(" or ")} instances for asymmetric algorithms must not be of type "secret"`);if("sign"===r&&"public"===t.type)throw new TypeError(`${Hn.join(" or ")} instances for asymmetric algorithm signing must be of type "private"`);if("decrypt"===r&&"public"===t.type)throw new TypeError(`${Hn.join(" or ")} instances for asymmetric algorithm decryption must be of type "private"`);if(t.algorithm&&"verify"===r&&"private"===t.type)throw new TypeError(`${Hn.join(" or ")} instances for asymmetric algorithm verifying must be of type "public"`);if(t.algorithm&&"encrypt"===r&&"private"===t.type)throw new TypeError(`${Hn.join(" or ")} instances for asymmetric algorithm encryption must be of type "public"`)})(e,t,r)};const pi=async(e,t,r,n,i)=>{if(!(an(r)||r instanceof Uint8Array))throw new TypeError(Un(r,...Hn,"Uint8Array"));switch(Rn(e,n),e){case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return r instanceof Uint8Array&&Nn(r,parseInt(e.slice(-3),10)),async function(e,t,r,n,i){if(!(r instanceof Uint8Array))throw new TypeError(Un(r,"Uint8Array"));const o=parseInt(e.slice(1,4),10),a=await on.subtle.importKey("raw",r.subarray(o>>3),"AES-CBC",!1,["encrypt"]),s=await on.subtle.importKey("raw",r.subarray(0,o>>3),{hash:"SHA-"+(o<<1),name:"HMAC"},!1,["sign"]),c=new Uint8Array(await on.subtle.encrypt({iv:n,name:"AES-CBC"},a,t)),u=dn(i,n,c,hn(i.length<<3));return{ciphertext:c,tag:new Uint8Array((await on.subtle.sign("HMAC",s,u)).slice(0,o>>3))}}(e,t,r,n,i);case"A128GCM":case"A192GCM":case"A256GCM":return r instanceof Uint8Array&&Nn(r,parseInt(e.slice(1,4),10)),async function(e,t,r,n,i){let o;r instanceof Uint8Array?o=await on.subtle.importKey("raw",r,"AES-GCM",!1,["encrypt"]):(Fn(r,e,"encrypt"),o=r);const a=new Uint8Array(await on.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 _n("Unsupported JWE Content Encryption Algorithm")}};async function mi(e,t,r,n,i){switch(hi(e,t,"decrypt"),e){case"dir":if(void 0!==r)throw new Sn("Encountered unexpected JWE Encrypted Key");return t;case"ECDH-ES":if(void 0!==r)throw new Sn("Encountered unexpected JWE Encrypted Key");case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{if(!Zn(n.epk))throw new Sn('JOSE Header "epk" (Ephemeral Public Key) missing or invalid');if(!ni(t))throw new _n("ECDH with the provided key is not allowed or not supported by your javascript runtime");const i=await li(n.epk,e);let o,a;if(void 0!==n.apu){if("string"!=typeof n.apu)throw new Sn('JOSE Header "apu" (Agreement PartyUInfo) invalid');o=yn(n.apu)}if(void 0!==n.apv){if("string"!=typeof n.apv)throw new Sn('JOSE Header "apv" (Agreement PartyVInfo) invalid');a=yn(n.apv)}const s=await ri(i,t,"ECDH-ES"===e?n.enc:e,"ECDH-ES"===e?ui(n.enc):parseInt(e.slice(-5,-2),10),o,a);if("ECDH-ES"===e)return s;if(void 0===r)throw new Sn("JWE Encrypted Key missing");return ti(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 Sn("JWE Encrypted Key missing");return ci(e,t,r);case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":{if(void 0===r)throw new Sn("JWE Encrypted Key missing");if("number"!=typeof n.p2c)throw new Sn('JOSE Header "p2c" (PBES2 Count) missing or invalid');const o=(null==i?void 0:i.maxPBES2Count)||1e4;if(n.p2c>o)throw new Sn('JOSE Header "p2c" (PBES2 Count) out is of acceptable bounds');if("string"!=typeof n.p2s)throw new Sn('JOSE Header "p2s" (PBES2 Salt) missing or invalid');return oi(e,t,r,n.p2c,yn(n.p2s))}case"A128KW":case"A192KW":case"A256KW":if(void 0===r)throw new Sn("JWE Encrypted Key missing");return ti(e,t,r);case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":if(void 0===r)throw new Sn("JWE Encrypted Key missing");if("string"!=typeof n.iv)throw new Sn('JOSE Header "iv" (Initialization Vector) missing or invalid');if("string"!=typeof n.tag)throw new Sn('JOSE Header "tag" (Authentication Tag) missing or invalid');return async function(e,t,r,n,i){const o=e.slice(0,7);return Jn(o,t,r,n,i,new Uint8Array(0))}(e,t,r,yn(n.iv),yn(n.tag));default:throw new _n('Invalid or unsupported "alg" (JWE Algorithm) header value')}}function gi(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 _n(`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 yi=(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 bi(e,t,r){if(e instanceof Uint8Array&&(e=un.decode(e)),"string"!=typeof e)throw new Sn("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 Sn("Invalid Compact JWE");const u=await async function(e,t,r){var n;if(!Zn(e))throw new Sn("Flattened JWE must be an object");if(void 0===e.protected&&void 0===e.header&&void 0===e.unprotected)throw new Sn("JOSE Header missing");if("string"!=typeof e.iv)throw new Sn("JWE Initialization Vector missing or incorrect type");if("string"!=typeof e.ciphertext)throw new Sn("JWE Ciphertext missing or incorrect type");if("string"!=typeof e.tag)throw new Sn("JWE Authentication Tag missing or incorrect type");if(void 0!==e.protected&&"string"!=typeof e.protected)throw new Sn("JWE Protected Header incorrect type");if(void 0!==e.encrypted_key&&"string"!=typeof e.encrypted_key)throw new Sn("JWE Encrypted Key incorrect type");if(void 0!==e.aad&&"string"!=typeof e.aad)throw new Sn("JWE AAD incorrect type");if(void 0!==e.header&&!Zn(e.header))throw new Sn("JWE Shared Unprotected Header incorrect type");if(void 0!==e.unprotected&&!Zn(e.unprotected))throw new Sn("JWE Per-Recipient Unprotected Header incorrect type");let i;if(e.protected)try{const t=yn(e.protected);i=JSON.parse(un.decode(t))}catch(e){throw new Sn("JWE Protected Header is invalid")}if(!Vn(i,e.header,e.unprotected))throw new Sn("JWE Protected, JWE Unprotected Header, and JWE Per-Recipient Unprotected Header Parameter names must be disjoint");const o={...i,...e.header,...e.unprotected};if(gi(Sn,new Map,null==r?void 0:r.crit,i,o),void 0!==o.zip){if(!i||!i.zip)throw new Sn('JWE "zip" (Compression Algorithm) Header MUST be integrity protected');if("DEF"!==o.zip)throw new _n('Unsupported JWE "zip" (Compression Algorithm) Header Parameter value')}const{alg:a,enc:s}=o;if("string"!=typeof a||!a)throw new Sn("missing JWE Algorithm (alg) in JWE Header");if("string"!=typeof s||!s)throw new Sn("missing JWE Encryption Algorithm (enc) in JWE Header");const c=r&&yi("keyManagementAlgorithms",r.keyManagementAlgorithms),u=r&&yi("contentEncryptionAlgorithms",r.contentEncryptionAlgorithms);if(c&&!c.has(a))throw new An('"alg" (Algorithm) Header Parameter not allowed');if(u&&!u.has(s))throw new An('"enc" (Encryption Algorithm) Header Parameter not allowed');let f;void 0!==e.encrypted_key&&(f=yn(e.encrypted_key));let d,l=!1;"function"==typeof t&&(t=await t(i,e),l=!0);try{d=await mi(a,t,f,o,r)}catch(e){if(e instanceof TypeError||e instanceof Sn||e instanceof _n)throw e;d=fi(s)}const h=yn(e.iv),p=yn(e.tag),m=cn.encode(null!==(n=e.protected)&&void 0!==n?n:"");let g;g=void 0!==e.aad?dn(m,cn.encode("."),cn.encode(e.aad)):m;let y=await Jn(s,d,yn(e.ciphertext),h,p,g);"DEF"===o.zip&&(y=await((null==r?void 0:r.inflateRaw)||Wn)(y));const b={plaintext:y};return void 0!==e.protected&&(b.protectedHeader=i),void 0!==e.aad&&(b.additionalAuthenticatedData=yn(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 vi=async e=>{if(e instanceof Uint8Array)return{kty:"oct",k:gn(e)};if(!an(e))throw new TypeError(Un(e,...Hn,"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 on.subtle.exportKey("jwk",e);return o};async function wi(e){return vi(e)}async function Ai(e,t,r,n,i={}){let o,a,s;switch(hi(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(!ni(r))throw new _n("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(!an(e))throw new TypeError(Un(e,...Hn));return on.subtle.generateKey(e.algorithm,!0,["deriveBits"])}(r)).privateKey);const{x:d,y:l,crv:h,kty:p}=await wi(f),m=await ri(r,f,"ECDH-ES"===e?t:e,"ECDH-ES"===e?ui(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=gn(c)),u&&(a.apv=gn(u)),"ECDH-ES"===e){s=m;break}s=n||fi(t);const g=e.slice(-6);o=await ei(g,m,s);break}case"RSA1_5":case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":s=n||fi(t),o=await(async(e,t,r)=>{if(!an(t))throw new TypeError(Un(t,...Hn));if(Fn(t,e,"encrypt","wrapKey"),si(e,t),t.usages.includes("encrypt"))return new Uint8Array(await on.subtle.encrypt(ai(e),t,r));if(t.usages.includes("wrapKey")){const n=await on.subtle.importKey("raw",r,...Xn);return new Uint8Array(await on.subtle.wrapKey("raw",n,t,ai(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||fi(t);const{p2c:c,p2s:u}=i;({encryptedKey:o,...a}=await(async(e,t,r,n=2048,i=Mn(new Uint8Array(16)))=>{const o=await ii(i,e,n,t);return{encryptedKey:await ei(e.slice(-6),o,r),p2c:n,p2s:gn(i)}})(e,r,s,c,u));break}case"A128KW":case"A192KW":case"A256KW":s=n||fi(t),o=await ei(e,r,s);break;case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":{s=n||fi(t);const{iv:c}=i;({encryptedKey:o,...a}=await async function(e,t,r,n){const i=e.slice(0,7);n||(n=In(i));const{ciphertext:o,tag:a}=await pi(i,r,t,n,new Uint8Array(0));return{encryptedKey:o,iv:gn(n),tag:gn(a)}}(e,r,s,c));break}default:throw new _n('Invalid or unsupported "alg" (JWE Algorithm) header value')}return{cek:s,encryptedKey:o,parameters:a}}const _i=Symbol();class Ei{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 Sn("either setProtectedHeader, setUnprotectedHeader, or sharedUnprotectedHeader must be called before #encrypt()");if(!Vn(this._protectedHeader,this._unprotectedHeader,this._sharedUnprotectedHeader))throw new Sn("JWE Protected, JWE Shared Unprotected and JWE Per-Recipient Header Parameter names must be disjoint");const r={...this._protectedHeader,...this._unprotectedHeader,...this._sharedUnprotectedHeader};if(gi(Sn,new Map,null==t?void 0:t.crit,this._protectedHeader,r),void 0!==r.zip){if(!this._protectedHeader||!this._protectedHeader.zip)throw new Sn('JWE "zip" (Compression Algorithm) Header MUST be integrity protected');if("DEF"!==r.zip)throw new _n('Unsupported JWE "zip" (Compression Algorithm) Header Parameter value')}const{alg:n,enc:i}=r;if("string"!=typeof n||!n)throw new Sn('JWE "alg" (Algorithm) Header Parameter missing or invalid');if("string"!=typeof i||!i)throw new Sn('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 Ai(n,i,e,this._cek,this._keyManagementParameters)),r&&(t&&_i 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=In(i)),c=this._protectedHeader?cn.encode(gn(JSON.stringify(this._protectedHeader))):cn.encode(""),this._aad?(u=gn(this._aad),s=dn(c,cn.encode("."),cn.encode(u))):s=c,"DEF"===r.zip){const e=await((null==t?void 0:t.deflateRaw)||Gn)(this._plaintext);({ciphertext:f,tag:d}=await pi(i,e,a,this._iv,s))}else({ciphertext:f,tag:d}=await pi(i,this._plaintext,a,this._iv,s));const l={ciphertext:gn(f),iv:gn(this._iv),tag:gn(d)};return o&&(l.encrypted_key=gn(o)),u&&(l.aad=u),this._protectedHeader&&(l.protected=un.decode(c)),this._sharedUnprotectedHeader&&(l.unprotected=this._sharedUnprotectedHeader),this._unprotectedHeader&&(l.header=this._unprotectedHeader),l}}function Si(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 On()&&"NODE-ED25519"===t.name?{name:"NODE-ED25519",namedCurve:"NODE-ED25519"}:{name:t.name};default:throw new _n(`alg ${e} is not supported either by JOSE or your javascript runtime`)}}function Pi(e,t,r){if(an(t))return Bn(t,e,r),t;if(t instanceof Uint8Array){if(!e.startsWith("HS"))throw new TypeError(Un(t,...Hn));return on.subtle.importKey("raw",t,{hash:`SHA-${e.slice(-3)}`,name:"HMAC"},!1,[r])}throw new TypeError(Un(t,...Hn,"Uint8Array"))}const xi=async(e,t,r,n)=>{const i=await Pi(e,t,"verify");si(e,i);const o=Si(e,i.algorithm);try{return await on.subtle.verify(o,i,r,n)}catch(e){return!1}};async function ki(e,t,r){var n;if(!Zn(e))throw new Pn("Flattened JWS must be an object");if(void 0===e.protected&&void 0===e.header)throw new Pn('Flattened JWS must have either of the "protected" or "header" members');if(void 0!==e.protected&&"string"!=typeof e.protected)throw new Pn("JWS Protected Header incorrect type");if(void 0===e.payload)throw new Pn("JWS Payload missing");if("string"!=typeof e.signature)throw new Pn("JWS Signature missing or incorrect type");if(void 0!==e.header&&!Zn(e.header))throw new Pn("JWS Unprotected Header incorrect type");let i={};if(e.protected)try{const t=yn(e.protected);i=JSON.parse(un.decode(t))}catch(e){throw new Pn("JWS Protected Header is invalid")}if(!Vn(i,e.header))throw new Pn("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");const o={...i,...e.header};let a=!0;if(gi(Pn,new Map([["b64",!0]]),null==r?void 0:r.crit,i,o).has("b64")&&(a=i.b64,"boolean"!=typeof a))throw new Pn('The "b64" (base64url-encode payload) Header Parameter must be a boolean');const{alg:s}=o;if("string"!=typeof s||!s)throw new Pn('JWS "alg" (Algorithm) Header Parameter missing or invalid');const c=r&&yi("algorithms",r.algorithms);if(c&&!c.has(s))throw new An('"alg" (Algorithm) Header Parameter not allowed');if(a){if("string"!=typeof e.payload)throw new Pn("JWS Payload must be a string")}else if("string"!=typeof e.payload&&!(e.payload instanceof Uint8Array))throw new Pn("JWS Payload must be a string or an Uint8Array instance");let u=!1;"function"==typeof t&&(t=await t(i,e),u=!0),hi(s,t,"verify");const f=dn(cn.encode(null!==(n=e.protected)&&void 0!==n?n:""),cn.encode("."),"string"==typeof e.payload?cn.encode(e.payload):e.payload),d=yn(e.signature);if(!await xi(s,t,d,f))throw new kn;let l;l=a?yn(e.payload):"string"==typeof e.payload?cn.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 Mi=e=>Math.floor(e.getTime()/1e3);const Ci=86400,Ii=/^(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)$/i;var Ri=e=>{const t=Ii.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*Ci);case"week":case"weeks":case"w":return Math.round(604800*r);default:return Math.round(31557600*r)}};const Ni=e=>e.toLowerCase().replace(/^application\//,"");var Oi=(e,t,r={})=>{const{typ:n}=r;if(n&&("string"!=typeof e.typ||Ni(e.typ)!==Ni(n)))throw new vn('unexpected "typ" JWT header value',"typ","check_failed");let i;try{i=JSON.parse(un.decode(t))}catch(e){}if(!Zn(i))throw new xn("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 vn('unexpected "iss" claim value',"iss","check_failed");const{subject:a}=r;if(a&&i.sub!==a)throw new vn('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 vn('unexpected "aud" claim value',"aud","check_failed");var c,u;let f;switch(typeof r.clockTolerance){case"string":f=Ri(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=Mi(d||new Date);if((void 0!==i.iat||r.maxTokenAge)&&"number"!=typeof i.iat)throw new vn('"iat" claim must be a number',"iat","invalid");if(void 0!==i.nbf){if("number"!=typeof i.nbf)throw new vn('"nbf" claim must be a number',"nbf","invalid");if(i.nbf>l+f)throw new vn('"nbf" claim timestamp check failed',"nbf","check_failed")}if(void 0!==i.exp){if("number"!=typeof i.exp)throw new vn('"exp" claim must be a number',"exp","invalid");if(i.exp<=l-f)throw new wn('"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:Ri(r.maxTokenAge)))throw new wn('"iat" claim timestamp check failed (too far in the past)',"iat","check_failed");if(e<0-f)throw new vn('"iat" claim timestamp check failed (it should be in the past)',"iat","check_failed")}return i};async function Ti(e,t,r){var n;const i=await async function(e,t,r){if(e instanceof Uint8Array&&(e=un.decode(e)),"string"!=typeof e)throw new Pn("Compact JWS must be a string or Uint8Array");const{0:n,1:i,2:o,length:a}=e.split(".");if(3!==a)throw new Pn("Invalid Compact JWS");const s=await ki({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 xn("JWTs MUST NOT use unencoded payload");const o={payload:Oi(i.protectedHeader,i.payload,r),protectedHeader:i.protectedHeader};return"function"==typeof t?{...o,key:i.key}:o}class ji{constructor(e){this._flattened=new Ei(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 Pn("either setProtectedHeader or setUnprotectedHeader must be called before #sign()");if(!Vn(this._protectedHeader,this._unprotectedHeader))throw new Pn("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");const r={...this._protectedHeader,...this._unprotectedHeader};let n=!0;if(gi(Pn,new Map([["b64",!0]]),null==t?void 0:t.crit,this._protectedHeader,r).has("b64")&&(n=this._protectedHeader.b64,"boolean"!=typeof n))throw new Pn('The "b64" (base64url-encode payload) Header Parameter must be a boolean');const{alg:i}=r;if("string"!=typeof i||!i)throw new Pn('JWS "alg" (Algorithm) Header Parameter missing or invalid');hi(i,e,"sign");let o,a=this._payload;n&&(a=cn.encode(gn(a))),o=this._protectedHeader?cn.encode(gn(JSON.stringify(this._protectedHeader))):cn.encode("");const s=dn(o,cn.encode("."),a),c=await(async(e,t,r)=>{const n=await Pi(e,t,"sign");si(e,n);const i=await on.subtle.sign(Si(e,n.algorithm),n,r);return new Uint8Array(i)})(i,e,s),u={signature:gn(c),payload:""};return n&&(u.payload=un.decode(a)),this._unprotectedHeader&&(u.header=this._unprotectedHeader),this._protectedHeader&&(u.protected=un.decode(o)),u}}class $i{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 Bi{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 Fi{constructor(e){this._signatures=[],this._payload=e}addSignature(e,t){const r=new Bi(this,e,t);return this._signatures.push(r),r}async sign(){if(!this._signatures.length)throw new Pn("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 _n('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}return on.subtle.generateKey(i,null!==(r=null==t?void 0:t.extractable)&&void 0!==r&&r,o)}(e,t)}async function Hi(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 li(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 Ki(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 Hi(o);let s;try{return s=await new ji(e).setProtectedHeader({alg:n,enc:i,kid:t.kid}).encrypt(a),s}catch(e){throw new rn(e,["encryption failed"])}}async function Ji(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(un.decode(Li(t)));if(!Zn(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 Hi(r);return await bi(e,o,{contentEncryptionAlgorithms:[i]})}catch(e){throw new rn(e,["decryption failed"])}}async function Wi(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 rn(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 rn(e,["invalid format","not a compact jws"])}if(void 0!==t){const r="function"==typeof t?await t(n,o):t,i=await Hi(r);try{const t=await Ti(e,i);return{header:t.protectedHeader,payload:t.payload,signer:r}}catch(e){throw new rn(e,["jws verification failed"])}}return{header:n,payload:o}}function Gi(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 Vi(e,t,r){let n;if(!en.includes(e))throw new rn(new Error(`Invalid encAlg '${e}'. Supported values are: ${en.toString()}`),["invalid algorithm"]);const c=Gi(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 rn(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 rn(new RangeError(`Expected secret length ${c} does not meet provided one ${n.length}`),["invalid key"])}else try{n=await qi(e,{extractable:!0})}catch(e){throw new rn(e,["unexpected error"])}const u=await wi(n);return u.alg=e,{jwk:u,hex:a(i(u.k),!1,c)}}async function Zi(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 Hi(e),n=await Hi(t);try{const e=await c(16),i=await new Fi(e).addSignature(n).setProtectedHeader({alg:t.alg}).sign();await async function(e,t,r){if(!Zn(e))throw new Pn("General JWS must be an object");if(!Array.isArray(e.signatures)||!e.signatures.every(Zn))throw new Pn("JWS Signatures missing or incorrect type");for(const n of e.signatures)try{return await ki({header:n.header,payload:e.payload,protected:n.protected,signature:n.signature},t,r)}catch(e){}throw new kn}(i,r)}catch(e){throw new rn(e,["unexpected error"])}}function Xi(e){return null!=e&&"object"==typeof e&&!Array.isArray(e)}function Qi(e){return Xi(e)||Array.isArray(e)?Array.isArray(e)?e.map((e=>Array.isArray(e)||Xi(e)?Qi(e):e)):Object.keys(e).sort().map((t=>[t,Qi(e[t])])):e}function Yi(e){return JSON.stringify(Qi(e))}function eo(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 to(e){return Array.isArray(e)?e.sort().map(to):(t=e,"[object Object]"===Object.prototype.toString.call(t)?Object.keys(e).sort().reduce((function(t,r){return t[r]=to(e[r]),t}),{}):e);var t}function ro(e,t=!1,r){try{return o(e,t,r)}catch(e){throw new rn(e,["invalid format"])}}async function no(e,t){try{await Hi(e,e.alg);const r=to(e);return t?JSON.stringify(r):r}catch(e){throw new rn(e,["invalid key"])}}async function io(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 oo={};!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:y.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 g(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 g(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?g(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)}({get exports(){return oo},set exports(e){oo=e}});var ao=oo;let so=!1,co=!1;const uo={debug:1,default:2,info:2,warning:3,error:4,off:5};let fo=uo.default,lo=null;const ho=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 po,mo;!function(e){e.DEBUG="DEBUG",e.INFO="INFO",e.WARNING="WARNING",e.ERROR="ERROR",e.OFF="OFF"}(po||(po={})),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"}(mo||(mo={}));const go="0123456789abcdef";class yo{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,t){const r=e.toLowerCase();null==uo[r]&&this.throwArgumentError("invalid log level name","logLevel",e),fo>uo[r]||console.log.apply(console,t)}debug(...e){this._log(yo.levels.DEBUG,e)}info(...e){this._log(yo.levels.INFO,e)}warn(...e){this._log(yo.levels.WARNING,e)}makeError(e,t,r){if(co)return this.makeError("censored error",t,{});t||(t=yo.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+=go[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 mo.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 mo.CALL_EXCEPTION:case mo.INSUFFICIENT_FUNDS:case mo.MISSING_NEW:case mo.NONCE_EXPIRED:case mo.REPLACEMENT_UNDERPRICED:case mo.TRANSACTION_REPLACED:case mo.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,yo.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){ho&&this.throwError("platform missing String.prototype.normalize",yo.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:ho})}checkSafeUint53(e,t){"number"==typeof e&&(null==t&&(t="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(t,yo.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(t,yo.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,t,r){r=r?": "+r:"",et&&this.throwError("too many arguments"+r,yo.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:t})}checkNew(e,t){e!==Object&&null!=e||this.throwError("missing new",yo.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",yo.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):e!==Object&&null!=e||this.throwError("missing new",yo.errors.MISSING_NEW,{name:t.name})}static globalLogger(){return lo||(lo=new yo("logger/5.7.0")),lo}static setCensorship(e,t){if(!e&&t&&this.globalLogger().throwError("cannot permanently disable censorship",yo.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),so){if(!e)return;this.globalLogger().throwError("error censorship permanent",yo.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}co=!!e,so=!!t}static setLogLevel(e){const t=uo[e.toLowerCase()];null!=t?fo=t:yo.globalLogger().warn("invalid log level - "+e)}static from(e){return new yo(e)}}yo.errors=mo,yo.levels=po;var bo=Object.freeze({__proto__:null,get ErrorCode(){return mo},get LogLevel(){return po},Logger:yo});const vo=new yo("bytes/5.7.0");function wo(e){return!!e.toHexString}function Ao(e){return e.slice||(e.slice=function(){const t=Array.prototype.slice.call(arguments);return Ao(new Uint8Array(Array.prototype.slice.apply(e,t)))}),e}function _o(e){return Co(e)&&!(e.length%2)||So(e)}function Eo(e){return"number"==typeof e&&e==e&&e%1==0}function So(e){if(null==e)return!1;if(e.constructor===Uint8Array)return!0;if("string"==typeof e)return!1;if(!Eo(e.length)||e.length<0)return!1;for(let t=0;t=256)return!1}return!0}function Po(e,t){if(t||(t={}),"number"==typeof e){vo.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),Ao(new Uint8Array(t))}if(t.allowMissingPrefix&&"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),wo(e)&&(e=e.toHexString()),Co(e)){let r=e.substring(2);r.length%2&&("left"===t.hexPad?r="0"+r:"right"===t.hexPad?r+="0":vo.throwArgumentError("hex data is odd-length","value",e));const n=[];for(let e=0;ePo(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),Ao(n)}function ko(e){let t=Po(e);if(0===t.length)return t;let r=0;for(;rt&&vo.throwArgumentError("value out of range","value",arguments[0]);const r=new Uint8Array(t);return r.set(e,t-e.length),Ao(r)}function Co(e,t){return!("string"!=typeof e||!e.match(/^0x[0-9A-Fa-f]*$/))&&(!t||e.length===2+2*t)}const Io="0123456789abcdef";function Ro(e,t){if(t||(t={}),"number"==typeof e){vo.checkSafeUint53(e,"invalid hexlify value");let t="";for(;e;)t=Io[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),wo(e))return e.toHexString();if(Co(e))return e.length%2&&("left"===t.hexPad?e="0x0"+e.substring(2):"right"===t.hexPad?e+="0":vo.throwArgumentError("hex data is odd-length","value",e)),e.toLowerCase();if(So(e)){let t="0x";for(let r=0;r>4]+Io[15&n]}return t}return vo.throwArgumentError("invalid hexlify value","value",e)}function No(e){if("string"!=typeof e)e=Ro(e);else if(!Co(e)||e.length%2)return null;return(e.length-2)/2}function Oo(e,t,r){return"string"!=typeof e?e=Ro(e):(!Co(e)||e.length%2)&&vo.throwArgumentError("invalid hexData","value",e),t=2+2*t,null!=r?"0x"+e.substring(t,2+2*r):"0x"+e.substring(t)}function To(e){let t="0x";return e.forEach((e=>{t+=Ro(e).substring(2)})),t}function jo(e){const t=Do(Ro(e,{hexPad:"left"}));return"0x"===t?"0x0":t}function Do(e){"string"!=typeof e&&(e=Ro(e)),Co(e)||vo.throwArgumentError("invalid hex string","value",e),e=e.substring(2);let t=0;for(;t2*t+2&&vo.throwArgumentError("value out of range","value",arguments[1]);e.length<2*t+2;)e="0x0"+e.substring(2);return e}function Bo(e){const t={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(_o(e)){let r=Po(e);64===r.length?(t.v=27+(r[32]>>7),r[32]&=127,t.r=Ro(r.slice(0,32)),t.s=Ro(r.slice(32,64))):65===r.length?(t.r=Ro(r.slice(0,32)),t.s=Ro(r.slice(32,64)),t.v=r[64]):vo.throwArgumentError("invalid signature string","signature",e),t.v<27&&(0===t.v||1===t.v?t.v+=27:vo.throwArgumentError("signature invalid v byte","signature",e)),t.recoveryParam=1-t.v%2,t.recoveryParam&&(r[32]|=128),t._vs=Ro(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=Mo(Po(t._vs),32);t._vs=Ro(r);const n=r[0]>=128?1:0;null==t.recoveryParam?t.recoveryParam=n:t.recoveryParam!==n&&vo.throwArgumentError("signature recoveryParam mismatch _vs","signature",e),r[0]&=127;const i=Ro(r);null==t.s?t.s=i:t.s!==i&&vo.throwArgumentError("signature v mismatch _vs","signature",e)}if(null==t.recoveryParam)null==t.v?vo.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&&vo.throwArgumentError("signature recoveryParam mismatch v","signature",e)}null!=t.r&&Co(t.r)?t.r=$o(t.r,32):vo.throwArgumentError("signature missing or invalid r","signature",e),null!=t.s&&Co(t.s)?t.s=$o(t.s,32):vo.throwArgumentError("signature missing or invalid s","signature",e);const r=Po(t.s);r[0]>=128&&vo.throwArgumentError("signature s out of range","signature",e),t.recoveryParam&&(r[0]|=128);const n=Ro(r);t._vs&&(Co(t._vs)||vo.throwArgumentError("signature invalid _vs","signature",e),t._vs=$o(t._vs,32)),null==t._vs?t._vs=n:t._vs!==n&&vo.throwArgumentError("signature _vs mismatch v and s","signature",e)}return t.yParityAndS=t._vs,t.compact=t.r+t.yParityAndS.substring(2),t}function Fo(e){return Ro(xo([(e=Bo(e)).r,e.s,e.recoveryParam?"0x1c":"0x1b"]))}var zo=Object.freeze({__proto__:null,arrayify:Po,concat:xo,hexConcat:To,hexDataLength:No,hexDataSlice:Oo,hexStripZeros:Do,hexValue:jo,hexZeroPad:$o,hexlify:Ro,isBytes:So,isBytesLike:_o,isHexString:Co,joinSignature:Fo,splitSignature:Bo,stripZeros:ko,zeroPad:Mo});const Uo="bignumber/5.7.0";var Lo=ao.BN;const qo=new yo(Uo),Ho={},Ko=9007199254740991;let Jo=!1;class Wo{constructor(e,t){e!==Ho&&qo.throwError("cannot call constructor directly; use BigNumber.from",yo.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=t,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return Vo(Zo(this).fromTwos(e))}toTwos(e){return Vo(Zo(this).toTwos(e))}abs(){return"-"===this._hex[0]?Wo.from(this._hex.substring(1)):this}add(e){return Vo(Zo(this).add(Zo(e)))}sub(e){return Vo(Zo(this).sub(Zo(e)))}div(e){return Wo.from(e).isZero()&&Xo("division-by-zero","div"),Vo(Zo(this).div(Zo(e)))}mul(e){return Vo(Zo(this).mul(Zo(e)))}mod(e){const t=Zo(e);return t.isNeg()&&Xo("division-by-zero","mod"),Vo(Zo(this).umod(t))}pow(e){const t=Zo(e);return t.isNeg()&&Xo("negative-power","pow"),Vo(Zo(this).pow(t))}and(e){const t=Zo(e);return(this.isNegative()||t.isNeg())&&Xo("unbound-bitwise-result","and"),Vo(Zo(this).and(t))}or(e){const t=Zo(e);return(this.isNegative()||t.isNeg())&&Xo("unbound-bitwise-result","or"),Vo(Zo(this).or(t))}xor(e){const t=Zo(e);return(this.isNegative()||t.isNeg())&&Xo("unbound-bitwise-result","xor"),Vo(Zo(this).xor(t))}mask(e){return(this.isNegative()||e<0)&&Xo("negative-width","mask"),Vo(Zo(this).maskn(e))}shl(e){return(this.isNegative()||e<0)&&Xo("negative-width","shl"),Vo(Zo(this).shln(e))}shr(e){return(this.isNegative()||e<0)&&Xo("negative-width","shr"),Vo(Zo(this).shrn(e))}eq(e){return Zo(this).eq(Zo(e))}lt(e){return Zo(this).lt(Zo(e))}lte(e){return Zo(this).lte(Zo(e))}gt(e){return Zo(this).gt(Zo(e))}gte(e){return Zo(this).gte(Zo(e))}isNegative(){return"-"===this._hex[0]}isZero(){return Zo(this).isZero()}toNumber(){try{return Zo(this).toNumber()}catch(e){Xo("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch(e){}return qo.throwError("this platform does not support BigInt",yo.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(10===arguments[0]?Jo||(Jo=!0,qo.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?qo.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",yo.errors.UNEXPECTED_ARGUMENT,{}):qo.throwError("BigNumber.toString does not accept parameters",yo.errors.UNEXPECTED_ARGUMENT,{})),Zo(this).toString(10)}toHexString(){return this._hex}toJSON(e){return{type:"BigNumber",hex:this.toHexString()}}static from(e){if(e instanceof Wo)return e;if("string"==typeof e)return e.match(/^-?0x[0-9a-f]+$/i)?new Wo(Ho,Go(e)):e.match(/^-?[0-9]+$/)?new Wo(Ho,Go(new Lo(e))):qo.throwArgumentError("invalid BigNumber string","value",e);if("number"==typeof e)return e%1&&Xo("underflow","BigNumber.from",e),(e>=Ko||e<=-Ko)&&Xo("overflow","BigNumber.from",e),Wo.from(String(e));const t=e;if("bigint"==typeof t)return Wo.from(t.toString());if(So(t))return Wo.from(Ro(t));if(t)if(t.toHexString){const e=t.toHexString();if("string"==typeof e)return Wo.from(e)}else{let e=t._hex;if(null==e&&"BigNumber"===t.type&&(e=t.hex),"string"==typeof e&&(Co(e)||"-"===e[0]&&Co(e.substring(1))))return Wo.from(e)}return qo.throwArgumentError("invalid BigNumber value","value",e)}static isBigNumber(e){return!(!e||!e._isBigNumber)}}function Go(e){if("string"!=typeof e)return Go(e.toString(16));if("-"===e[0])return"-"===(e=e.substring(1))[0]&&qo.throwArgumentError("invalid hex","value",e),"0x00"===(e=Go(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 Vo(e){return Wo.from(Go(e))}function Zo(e){const t=Wo.from(e).toHexString();return"-"===t[0]?new Lo("-"+t.substring(3),16):new Lo(t.substring(2),16)}function Xo(e,t,r){const n={fault:e,operation:t};return null!=r&&(n.value=r),qo.throwError(e,yo.errors.NUMERIC_FAULT,n)}const Qo=new yo(Uo),Yo={},ea=Wo.from(0),ta=Wo.from(-1);function ra(e,t,r,n){const i={fault:t,operation:r};return void 0!==n&&(i.value=n),Qo.throwError(e,yo.errors.NUMERIC_FAULT,i)}let na="0";for(;na.length<256;)na+=na;function ia(e){if("number"!=typeof e)try{e=Wo.from(e).toNumber()}catch(e){}return"number"==typeof e&&e>=0&&e<=256&&!(e%1)?"1"+na.substring(0,e):Qo.throwArgumentError("invalid decimal size","decimals",e)}function oa(e,t){null==t&&(t=0);const r=ia(t),n=(e=Wo.from(e)).lt(ea);n&&(e=e.mul(ta));let i=e.mod(r).toString();for(;i.length2&&Qo.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&&ra("fractional component exceeds decimals","underflow","parseFixed"),""===a&&(a="0");a.lengthnull==e[t]?n:(typeof e[t]!==r&&Qo.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&&Qo.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",r),n>80&&Qo.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",n),new sa(Yo,t,r,n)}}class ca{constructor(e,t,r,n){e!==Yo&&Qo.throwError("cannot use FixedNumber constructor; use FixedNumber.from",yo.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&&Qo.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",e)}addUnsafe(e){this._checkFormat(e);const t=aa(this._value,this.format.decimals),r=aa(e._value,e.format.decimals);return ca.fromValue(t.add(r),this.format.decimals,this.format)}subUnsafe(e){this._checkFormat(e);const t=aa(this._value,this.format.decimals),r=aa(e._value,e.format.decimals);return ca.fromValue(t.sub(r),this.format.decimals,this.format)}mulUnsafe(e){this._checkFormat(e);const t=aa(this._value,this.format.decimals),r=aa(e._value,e.format.decimals);return ca.fromValue(t.mul(r).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(e){this._checkFormat(e);const t=aa(this._value,this.format.decimals),r=aa(e._value,e.format.decimals);return ca.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=ca.from(e[0],this.format);const r=!e[1].match(/^(0*)$/);return this.isNegative()&&r&&(t=t.subUnsafe(ua.toFormat(t.format))),t}ceiling(){const e=this.toString().split(".");1===e.length&&e.push("0");let t=ca.from(e[0],this.format);const r=!e[1].match(/^(0*)$/);return!this.isNegative()&&r&&(t=t.addUnsafe(ua.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)&&Qo.throwArgumentError("invalid decimal count","decimals",e),t[1].length<=e)return this;const r=ca.from("1"+na.substring(0,e),this.format),n=fa.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&&Qo.throwArgumentError("invalid byte width","width",e);return $o(Wo.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString(),e/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return ca.fromString(this._value,e)}static fromValue(e,t,r){return null!=r||null==t||function(e){return null!=e&&(Wo.isBigNumber(e)||"number"==typeof e&&e%1==0||"string"==typeof e&&!!e.match(/^-?[0-9]+$/)||Co(e)||"bigint"==typeof e||So(e))}(t)||(r=t,t=null),null==t&&(t=0),null==r&&(r="fixed"),ca.fromString(oa(e,t),sa.from(r))}static fromString(e,t){null==t&&(t="fixed");const r=sa.from(t),n=aa(e,r.decimals);!r.signed&&n.lt(ea)&&ra("unsigned value cannot be negative","overflow","value",e);let i=null;r.signed?i=n.toTwos(r.width).toHexString():(i=n.toHexString(),i=$o(i,r.width/8));const o=oa(n,r.decimals);return new ca(Yo,i,o,r)}static fromBytes(e,t){null==t&&(t="fixed");const r=sa.from(t);if(Po(e).length>r.width/8)throw new Error("overflow");let n=Wo.from(e);r.signed&&(n=n.fromTwos(r.width));const i=n.toTwos((r.signed?0:1)+r.width).toHexString(),o=oa(n,r.decimals);return new ca(Yo,i,o,r)}static from(e,t){if("string"==typeof e)return ca.fromString(e,t);if(So(e))return ca.fromBytes(e,t);try{return ca.fromValue(e,0,t)}catch(e){if(e.code!==yo.errors.INVALID_ARGUMENT)throw e}return Qo.throwArgumentError("invalid FixedNumber value","value",e)}static isFixedNumber(e){return!(!e||!e._isFixedNumber)}}const ua=ca.from(1),fa=ca.from("0.5");var da=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 la=new yo("properties/5.7.0");function ha(e,t,r){Object.defineProperty(e,t,{enumerable:!0,value:r,writable:!1})}function pa(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 ma(e){return da(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 ga(e,t){e&&"object"==typeof e||la.throwArgumentError("invalid object","object",e),Object.keys(e).forEach((r=>{t[r]||la.throwArgumentError("invalid object key - "+r,"transaction:"+r,e)}))}function ya(e){const t={};for(const r in e)t[r]=e[r];return t}const ba={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function va(e){if(null==e||ba[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;rAa(e))));if("object"==typeof e){const t={};for(const r in e){const n=e[r];void 0!==n&&ha(t,r,Aa(n))}return t}return la.throwArgumentError("Cannot deepCopy "+typeof e,"object",e)}function Aa(e){return wa(e)}class _a{constructor(e){for(const t in e)this[t]=Aa(e[t])}}var Ea=Object.freeze({__proto__:null,Description:_a,checkProperties:ga,deepCopy:Aa,defineReadOnly:ha,getStatic:pa,resolveProperties:ma,shallowCopy:ya});const Sa="abi/5.7.0",Pa=new yo(Sa),xa={};let ka={calldata:!0,memory:!0,storage:!0},Ma={calldata:!0,memory:!0};function Ca(e,t){if("bytes"===e||"string"===e){if(ka[t])return!0}else if("address"===e){if("payable"===t)return!0}else if((e.indexOf("[")>=0||"tuple"===e)&&Ma[t])return!0;return(ka[t]||"payable"===t)&&Pa.throwArgumentError("invalid modifier","name",t),!1}function Ia(e,t){for(let r in t)ha(e,r,t[r])}const Ra=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),Na=new RegExp(/^(.*)\[([0-9]*)\]$/);class Oa{constructor(e,t){e!==xa&&Pa.throwError("use fromString",yo.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),Ia(this,t);let r=this.type.match(Na);Ia(this,r?{arrayLength:parseInt(r[2]||"-1"),arrayChildren:Oa.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=Ra.sighash),Ra[e]||Pa.throwArgumentError("invalid format type","format",e),e===Ra.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!==Ra.sighash&&(t+=this.type),t+="("+this.components.map((t=>t.format(e))).join(e===Ra.full?", ":",")+")"):t+=this.type,e!==Ra.sighash&&(!0===this.indexed&&(t+=" indexed"),e===Ra.full&&this.name&&(t+=" "+this.name)),t}static from(e,t){return"string"==typeof e?Oa.fromString(e,t):Oa.fromObject(e)}static fromObject(e){return Oa.isParamType(e)?e:new Oa(xa,{name:e.name||null,type:Ha(e.type),indexed:null==e.indexed?null:!!e.indexed,components:e.components?e.components.map(Oa.fromObject):null})}static fromString(e,t){return r=function(e,t){let r=e;function n(t){Pa.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;rOa.fromString(e,t)))}class ja{constructor(e,t){e!==xa&&Pa.throwError("use a static from method",yo.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),Ia(this,t),this._isFragment=!0,Object.freeze(this)}static from(e){return ja.isFragment(e)?e:"string"==typeof e?ja.fromString(e):ja.fromObject(e)}static fromObject(e){if(ja.isFragment(e))return e;switch(e.type){case"function":return Ua.fromObject(e);case"event":return Da.fromObject(e);case"constructor":return za.fromObject(e);case"error":return qa.fromObject(e);case"fallback":case"receive":return null}return Pa.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]?Ua.fromString(e.substring(8).trim()):"constructor"===e.split("(")[0].trim()?za.fromString(e.trim()):"error"===e.split(" ")[0]?qa.fromString(e.substring(5).trim()):Pa.throwArgumentError("unsupported fragment","value",e)}static isFragment(e){return!(!e||!e._isFragment)}}class Da extends ja{format(e){if(e||(e=Ra.sighash),Ra[e]||Pa.throwArgumentError("invalid format type","format",e),e===Ra.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!==Ra.sighash&&(t+="event "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===Ra.full?", ":",")+") ",e!==Ra.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&&Pa.throwArgumentError("invalid event object","value",e);const t={name:Ja(e.name),anonymous:e.anonymous,inputs:e.inputs?e.inputs.map(Oa.fromObject):[],type:"event"};return new Da(xa,t)}static fromString(e){let t=e.match(Wa);t||Pa.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:Pa.warn("unknown modifier: "+e)}})),Da.fromObject({name:t[1].trim(),anonymous:r,inputs:Ta(t[2],!0),type:"event"})}static isEventFragment(e){return e&&e._isFragment&&"event"===e.type}}function $a(e,t){t.gas=null;let r=e.split("@");return 1!==r.length?(r.length>2&&Pa.throwArgumentError("invalid human-readable ABI signature","value",e),r[1].match(/^[0-9]+$/)||Pa.throwArgumentError("invalid human-readable ABI signature gas","value",e),t.gas=Wo.from(r[1]),r[0]):e}function Ba(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 Fa(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&&Pa.throwArgumentError("cannot have constant function with mutability "+t.stateMutability,"value",e),t.payable="payable"===t.stateMutability,null!=e.payable&&!!e.payable!==t.payable&&Pa.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||Pa.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&&Pa.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&&Pa.throwArgumentError("unable to determine stateMutability","value",e),t}class za extends ja{format(e){if(e||(e=Ra.sighash),Ra[e]||Pa.throwArgumentError("invalid format type","format",e),e===Ra.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===Ra.sighash&&Pa.throwError("cannot format a constructor for sighash",yo.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});let t="constructor("+this.inputs.map((t=>t.format(e))).join(e===Ra.full?", ":",")+") ";return this.stateMutability&&"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "),t.trim()}static from(e){return"string"==typeof e?za.fromString(e):za.fromObject(e)}static fromObject(e){if(za.isConstructorFragment(e))return e;"constructor"!==e.type&&Pa.throwArgumentError("invalid constructor object","value",e);let t=Fa(e);t.constant&&Pa.throwArgumentError("constructor cannot be constant","value",e);const r={name:null,type:e.type,inputs:e.inputs?e.inputs.map(Oa.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?Wo.from(e.gas):null};return new za(xa,r)}static fromString(e){let t={type:"constructor"},r=(e=$a(e,t)).match(Wa);return r&&"constructor"===r[1].trim()||Pa.throwArgumentError("invalid constructor string","value",e),t.inputs=Ta(r[2].trim(),!1),Ba(r[3].trim(),t),za.fromObject(t)}static isConstructorFragment(e){return e&&e._isFragment&&"constructor"===e.type}}class Ua extends za{format(e){if(e||(e=Ra.sighash),Ra[e]||Pa.throwArgumentError("invalid format type","format",e),e===Ra.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!==Ra.sighash&&(t+="function "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===Ra.full?", ":",")+") ",e!==Ra.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?Ua.fromString(e):Ua.fromObject(e)}static fromObject(e){if(Ua.isFunctionFragment(e))return e;"function"!==e.type&&Pa.throwArgumentError("invalid function object","value",e);let t=Fa(e);const r={type:e.type,name:Ja(e.name),constant:t.constant,inputs:e.inputs?e.inputs.map(Oa.fromObject):[],outputs:e.outputs?e.outputs.map(Oa.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?Wo.from(e.gas):null};return new Ua(xa,r)}static fromString(e){let t={type:"function"},r=(e=$a(e,t)).split(" returns ");r.length>2&&Pa.throwArgumentError("invalid function string","value",e);let n=r[0].match(Wa);if(n||Pa.throwArgumentError("invalid function signature","value",e),t.name=n[1].trim(),t.name&&Ja(t.name),t.inputs=Ta(n[2],!1),Ba(n[3].trim(),t),r.length>1){let n=r[1].match(Wa);""==n[1].trim()&&""==n[3].trim()||Pa.throwArgumentError("unexpected tokens","value",e),t.outputs=Ta(n[2],!1)}else t.outputs=[];return Ua.fromObject(t)}static isFunctionFragment(e){return e&&e._isFragment&&"function"===e.type}}function La(e){const t=e.format();return"Error(string)"!==t&&"Panic(uint256)"!==t||Pa.throwArgumentError(`cannot specify user defined ${t} error`,"fragment",e),e}class qa extends ja{format(e){if(e||(e=Ra.sighash),Ra[e]||Pa.throwArgumentError("invalid format type","format",e),e===Ra.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==Ra.sighash&&(t+="error "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===Ra.full?", ":",")+") ",t.trim()}static from(e){return"string"==typeof e?qa.fromString(e):qa.fromObject(e)}static fromObject(e){if(qa.isErrorFragment(e))return e;"error"!==e.type&&Pa.throwArgumentError("invalid error object","value",e);const t={type:e.type,name:Ja(e.name),inputs:e.inputs?e.inputs.map(Oa.fromObject):[]};return La(new qa(xa,t))}static fromString(e){let t={type:"error"},r=e.match(Wa);return r||Pa.throwArgumentError("invalid error signature","value",e),t.name=r[1].trim(),t.name&&Ja(t.name),t.inputs=Ta(r[2],!1),La(qa.fromObject(t))}static isErrorFragment(e){return e&&e._isFragment&&"error"===e.type}}function Ha(e){return e.match(/^uint($|[^1-9])/)?e="uint256"+e.substring(4):e.match(/^int($|[^1-9])/)&&(e="int256"+e.substring(3)),e}const Ka=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function Ja(e){return e&&e.match(Ka)||Pa.throwArgumentError(`invalid identifier "${e}"`,"value",e),e}const Wa=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$");const Ga=new yo(Sa);function Va(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 Za{constructor(e,t,r,n){this.name=e,this.type=t,this.localName=r,this.dynamic=n}_throwError(e,t){Ga.throwArgumentError(e,this.localName,t)}}class Xa{constructor(e){ha(this,"wordSize",e||32),this._data=[],this._dataLength=0,this._padding=new Uint8Array(e)}get data(){return To(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(xo(e._data))}writeBytes(e){let t=Po(e);const r=t.length%this.wordSize;return r&&(t=xo([t,this._padding.slice(r)])),this._writeData(t)}_getValue(e){let t=Po(Wo.from(e));return t.length>this.wordSize&&Ga.throwError("value out-of-bounds",yo.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:t.length}),t.length%this.wordSize&&(t=xo([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 Qa{constructor(e,t,r,n){ha(this,"_data",Po(e)),ha(this,"wordSize",t||32),ha(this,"_coerceFunc",r),ha(this,"allowLoose",n),this._offset=0}get data(){return Ro(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):Qa.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:Ga.throwError("data out-of-bounds",yo.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+n})),this._data.slice(this._offset,this._offset+n)}subReader(e){return new Qa(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 Wo.from(this.readBytes(this.wordSize))}}var Ya={}; -/** - * [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 os(e,t,r){let n=0;for(let i=0;it+1+n&&ns.throwError("child data too short",yo.errors.BUFFER_OVERRUN,{})}return{consumed:1+n,result:i}}function us(e,t){if(0===e.length&&ns.throwError("data too short",yo.errors.BUFFER_OVERRUN,{}),e[t]>=248){const r=e[t]-247;t+1+r>e.length&&ns.throwError("data short segment too short",yo.errors.BUFFER_OVERRUN,{});const n=os(e,t+1,r);return t+1+r+n>e.length&&ns.throwError("data long segment too short",yo.errors.BUFFER_OVERRUN,{}),cs(e,t,t+1+r,r+n)}if(e[t]>=192){const r=e[t]-192;return t+1+r>e.length&&ns.throwError("data array too short",yo.errors.BUFFER_OVERRUN,{}),cs(e,t,t+1,r)}if(e[t]>=184){const r=e[t]-183;t+1+r>e.length&&ns.throwError("data array too short",yo.errors.BUFFER_OVERRUN,{});const n=os(e,t+1,r);t+1+r+n>e.length&&ns.throwError("data array too short",yo.errors.BUFFER_OVERRUN,{});return{consumed:1+r+n,result:Ro(e.slice(t+1+r,t+1+r+n))}}if(e[t]>=128){const r=e[t]-128;t+1+r>e.length&&ns.throwError("data too short",yo.errors.BUFFER_OVERRUN,{});return{consumed:1+r,result:Ro(e.slice(t+1,t+1+r))}}return{consumed:1,result:Ro(e[t])}}function fs(e){const t=Po(e),r=us(t,0);return r.consumed!==t.length&&ns.throwArgumentError("invalid rlp data","data",e),r.result}var ds=Object.freeze({__proto__:null,decode:fs,encode:ss});const ls=new yo("address/5.7.0");function hs(e){Co(e,20)||ls.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=Po(ts(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 ps={};for(let e=0;e<10;e++)ps[String(e)]=String(e);for(let e=0;e<26;e++)ps[String.fromCharCode(65+e)]=String(10+e);const ms=Math.floor(function(e){return Math.log10?Math.log10(e):Math.log(e)/Math.LN10}(9007199254740991));function gs(e){let t=(e=(e=e.toUpperCase()).substring(4)+e.substring(0,2)+"00").split("").map((e=>ps[e])).join("");for(;t.length>=ms;){let e=t.substring(0,ms);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 ys(e){let t=null;if("string"!=typeof e&&ls.throwArgumentError("invalid address","address",e),e.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==e.substring(0,2)&&(e="0x"+e),t=hs(e),e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==e&&ls.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)!==gs(e)&&ls.throwArgumentError("bad icap checksum","address",e),r=e.substring(4),t=new Lo(r,36).toString(16);t.length<40;)t="0"+t;t=hs("0x"+t)}else ls.throwArgumentError("invalid address","address",e);var r;return t}function bs(e){let t=null;try{t=ys(e.from)}catch(t){ls.throwArgumentError("missing from address","transaction",e)}return ys(Oo(ts(ss([t,ko(Po(Wo.from(e.nonce).toHexString()))])),12))}var vs=Object.freeze({__proto__:null,getAddress:ys,getContractAddress:bs,getCreate2Address:function(e,t,r){return 32!==No(t)&&ls.throwArgumentError("salt must be 32 bytes","salt",t),32!==No(r)&&ls.throwArgumentError("initCodeHash must be 32 bytes","initCodeHash",r),ys(Oo(ts(xo(["0xff",ys(e),t,r])),12))},getIcapAddress:function(e){let t=(r=ys(e).substring(2),new Lo(r,16).toString(36)).toUpperCase();for(var r;t.length<30;)t="0"+t;return"XE"+gs("XE00"+t)+t},isAddress:function(e){try{return ys(e),!0}catch(e){}return!1}});class ws extends Za{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,t){try{t=ys(t)}catch(e){this._throwError(e.message,t)}return e.writeValue(t)}decode(e){return ys($o(e.readValue().toHexString(),20))}}class As extends Za{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 _s=new yo(Sa);function Es(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||_s.throwError("cannot encode object for signature with missing names",yo.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:r}),e[n]&&_s.throwError("cannot encode object for signature with duplicate names",yo.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:r}),e[n]=!0,r[n]}))}else _s.throwArgumentError("invalid tuple value","tuple",r);t.length!==n.length&&_s.throwArgumentError("types/value length mismatch","tuple",r);let i=new Xa(e.wordSize),o=new Xa(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 Ss(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===yo.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===yo.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 Ps extends Za{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&&_s.throwError("insufficient data length",yo.errors.BUFFER_OVERRUN,{length:e._data.length,count:t}));let r=[];for(let e=0;e>6==2;n++)e++;return e}return e===Fs.OVERRUN?r.length-t-1:0}!function(e){e.current="",e.NFC="NFC",e.NFD="NFD",e.NFKC="NFKC",e.NFKD="NFKD"}(Bs||(Bs={})),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"}(Fs||(Fs={}));const Us=Object.freeze({error:function(e,t,r,n,i){return $s.throwArgumentError(`invalid codepoint at offset ${t}; ${e}`,"bytes",r)},ignore:zs,replace:function(e,t,r,n,i){return e===Fs.OVERLONG?(n.push(i),0):(n.push(65533),zs(e,t,r))}});function Ls(e,t){null==t&&(t=Us.error),e=Po(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)?Fs.UNEXPECTED_CONTINUE:Fs.BAD_PREFIX,n-1,e,r);continue}o=3,a=65535}if(n-1+o>=e.length){n+=t(Fs.OVERRUN,n-1,e,r);continue}let s=i&(1<<8-o-1)-1;for(let i=0;i1114111?n+=t(Fs.OUT_OF_RANGE,n-1-o,e,r,s):s>=55296&&s<=57343?n+=t(Fs.UTF16_SURROGATE,n-1-o,e,r,s):s<=a?n+=t(Fs.OVERLONG,n-1-o,e,r,s):r.push(s))}return r}function qs(e,t=Bs.current){t!=Bs.current&&($s.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 Po(r)}function Hs(e){const t="0000"+e.toString(16);return"\\u"+t.substring(t.length-4)}function Ks(e){return e.map((e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10&1023),56320+(1023&e))))).join("")}function Js(e,t){return Ks(Ls(e,t))}function Ws(e,t=Bs.current){return Ls(qs(e,t))}function Gs(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 Vs(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 Zs(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 Xs=Vs("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"),Qs="ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map((e=>parseInt(e,16))),Ys=[{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}],ec=Gs("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"),tc=Gs("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"),rc=Gs("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?Hs(e):Hs(55296+((e-=65536)>>10&1023))+Hs(56320+(1023&e))})).join("")+'"'},formatBytes32String:function(e){const t=qs(e);if(t.length>31)throw new Error("bytes32 string must be less than 32 bytes");return Ro(xo([t,js]).slice(0,32))},nameprep:function(e){if(e.match(/^[a-z0-9-]*$/i)&&e.length<=59)return e.toLowerCase();let t=Ws(e);var r;r=t.map((e=>{if(Qs.indexOf(e)>=0)return[];if(e>=65024&&e<=65039)return[];let t=function(e){let t=Zs(e,Ys);if(t)return[e+t.s];let r=ec[e];if(r)return r;let n=tc[e];return n?[e+n[0]]:rc[e]||null}(e);return t||[e]})),t=r.reduce(((e,t)=>(t.forEach((t=>{e.push(t)})),e)),[]),t=Ws(Ks(t),Bs.NFKC),t.forEach((e=>{if(Zs(e,nc))throw new Error("STRINGPREP_CONTAINS_PROHIBITED")})),t.forEach((e=>{if(Zs(e,Xs))throw new Error("STRINGPREP_CONTAINS_UNASSIGNED")}));let n=Ks(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=Po(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 Js(t.slice(0,r))},toUtf8Bytes:qs,toUtf8CodePoints:Ws,toUtf8String:Js});class oc extends ks{constructor(e){super("string",e)}defaultValue(){return""}encode(e,t){return super.encode(e,qs(t))}decode(e){return Js(super.decode(e))}}class ac extends Za{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 Es(e,this.coders,t)}decode(e){return e.coerce(this.name,Ss(e,this.coders))}}const sc=new yo(Sa),cc=new RegExp(/^bytes([0-9]*)$/),uc=new RegExp(/^(u?int)([0-9]*)$/);class fc{constructor(e){ha(this,"coerceFunc",e||null)}_getCoder(e){switch(e.baseType){case"address":return new ws(e.name);case"bool":return new xs(e.name);case"string":return new oc(e.name);case"bytes":return new Ms(e.name);case"array":return new Ps(this._getCoder(e.arrayChildren),e.arrayLength,e.name);case"tuple":return new ac((e.components||[]).map((e=>this._getCoder(e))),e.name);case"":return new Is(e.name)}let t=e.type.match(uc);if(t){let r=parseInt(t[2]||"256");return(0===r||r>256||r%8!=0)&&sc.throwArgumentError("invalid "+t[1]+" bit length","param",e),new Ds(r/8,"int"===t[1],e.name)}if(t=e.type.match(cc),t){let r=parseInt(t[1]);return(0===r||r>32)&&sc.throwArgumentError("invalid bytes length","param",e),new Cs(r,e.name)}return sc.throwArgumentError("invalid type","type",e.type)}_getWordSize(){return 32}_getReader(e,t){return new Qa(e,this._getWordSize(),this.coerceFunc,t)}_getWriter(){return new Xa(this._getWordSize())}getDefaultValue(e){const t=e.map((e=>this._getCoder(Oa.from(e))));return new ac(t,"_").defaultValue()}encode(e,t){e.length!==t.length&&sc.throwError("types/values length mismatch",yo.errors.INVALID_ARGUMENT,{count:{types:e.length,values:t.length},value:{types:e,values:t}});const r=e.map((e=>this._getCoder(Oa.from(e)))),n=new ac(r,"_"),i=this._getWriter();return n.encode(i,t),i.data}decode(e,t,r){const n=e.map((e=>this._getCoder(Oa.from(e))));return new ac(n,"_").decode(this._getReader(Po(t),r))}}const dc=new fc;function lc(e){return ts(qs(e))}const hc="hash/5.7.0";function pc(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 bc(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 vc(e){return 1&e?~e>>1:e>>1}function wc(e,t){let r=Array(e);for(let n=0,i=-1;nt[e])):r}function Ec(e,t,r){let n=Array(e).fill(void 0).map((()=>[]));for(let i=0;in[t].push(e)));return n}function Sc(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 yc(Ec(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 Pc(e,t){return Ec(1+t(),1+e,t).map((e=>[e[0],e.slice(1)]))}const xc=bc(pc("AEQF2AO2DEsA2wIrAGsBRABxAN8AZwCcAEwAqgA0AGwAUgByADcATAAVAFYAIQAyACEAKAAYAFgAGwAjABQAMAAmADIAFAAfABQAKwATACoADgAbAA8AHQAYABoAGQAxADgALAAoADwAEwA9ABMAGgARAA4ADwAWABMAFgAIAA8AHgQXBYMA5BHJAS8JtAYoAe4AExozi0UAH21tAaMnBT8CrnIyhrMDhRgDygIBUAEHcoFHUPe8AXBjAewCjgDQR8IICIcEcQLwATXCDgzvHwBmBoHNAqsBdBcUAykgDhAMShskMgo8AY8jqAQfAUAfHw8BDw87MioGlCIPBwZCa4ELatMAAMspJVgsDl8AIhckSg8XAHdvTwBcIQEiDT4OPhUqbyECAEoAS34Aej8Ybx83JgT/Xw8gHxZ/7w8RICxPHA9vBw+Pfw8PHwAPFv+fAsAvCc8vEr8ivwD/EQ8Bol8OEBa/A78hrwAPCU8vESNvvwWfHwNfAVoDHr+ZAAED34YaAdJPAK7PLwSEgDLHAGo1Pz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pFP+SpMGJNWvbIl5SOodbCczW2RKleksPoUeGEzrjtKHVdtZA+kfqO+rVx/iclCqwoopepvJpSTDjT+b9GWylGRF8EDbGlw6eUzmJM95Ovoz+kwLX3c2fTjFeYEsE7vUZm3mqdGJuKh2w9/QGSaqRHs99aScGOdDqkFcACoqdbBoQqqjamhH6Q9ng39JCg3lrGJwd50Qk9ovnqBTr8MME7Ps2wiVfygUmPoUBJJfJWX5Nda0nuncbFkA==")),kc=new Set(_c(xc)),Mc=new Set(_c(xc)),Cc=function(e){let t=[];for(;;){let r=e();if(0==r)break;t.push(Sc(r,e))}for(;;){let r=e()-1;if(r<0)break;t.push(Pc(r,e))}return function(e){const t={};for(let r=0;re-t));return function r(){let n=[];for(;;){let i=_c(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}}()}(xc),Rc=45,Nc=95;function Oc(e){return Ws(e)}function Tc(e){return e.filter((e=>65039!=e))}function jc(e){for(let t of e.split(".")){let e=Oc(t);try{for(let t=e.lastIndexOf(Nc)-1;t>=0;t--)if(e[t]!==Nc)throw new Error("underscore only allowed at start");if(e.length>=4&&e.every((e=>e<128))&&e[2]===Rc&&e[3]===Rc)throw new Error("invalid label extension")}catch(e){throw new Error(`Invalid label "${t}": ${e.message}`)}}return e}function Dc(e){return jc(function(e,t){let r=Oc(e).reverse(),n=[];for(;r.length;){let e=$c(r);if(e){n.push(...t(e));continue}let i=r.pop();if(kc.has(i)){n.push(i);continue}if(Mc.has(i))continue;let o=Cc[i];if(!o)throw new Error(`Disallowed codepoint: 0x${i.toString(16).toUpperCase()}`);n.push(...o)}return jc(function(e){return e.normalize("NFC")}(String.fromCodePoint(...n)))}(e,Tc))}function $c(e,t){var r;let n,i,o=Ic,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 Bc=new yo(hc),Fc=new Uint8Array(32);function zc(e){if(0===e.length)throw new Error("invalid ENS name; empty component");return e}function Uc(e){const t=qs(Dc(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(zc(t.slice(n))),r}function Lc(e){"string"!=typeof e&&Bc.throwArgumentError("invalid ENS name; not a string","name",e);let t=Fc;const r=Uc(e);for(;r.length;)t=ts(xo([t,ts(r.pop())]));return Ro(t)}function qc(e){return Ro(xo(Uc(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"}Fc.fill(0);const Hc="Ethereum Signed Message:\n";function Kc(e){return"string"==typeof e&&(e=qs(e)),ts(xo([qs(Hc),qs(String(e.length)),e]))}var Jc=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 Wc=new yo(hc),Gc=new Uint8Array(32);Gc.fill(0);const Vc=Wo.from(-1),Zc=Wo.from(0),Xc=Wo.from(1),Qc=Wo.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");const Yc=$o(Xc.toHexString(),32),eu=$o(Zc.toHexString(),32),tu={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},ru=["name","version","chainId","verifyingContract","salt"];function nu(e){return function(t){return"string"!=typeof t&&Wc.throwArgumentError(`invalid domain value for ${JSON.stringify(e)}`,`domain.${e}`,t),t}}const iu={name:nu("name"),version:nu("version"),chainId:function(e){try{return Wo.from(e).toString()}catch(e){}return Wc.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",e)},verifyingContract:function(e){try{return ys(e).toLowerCase()}catch(e){}return Wc.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",e)},salt:function(e){try{const t=Po(e);if(32!==t.length)throw new Error("bad length");return Ro(t)}catch(e){}return Wc.throwArgumentError('invalid domain value "salt"',"domain.salt",e)}};function ou(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))&&Wc.throwArgumentError("invalid numeric width","type",e);const i=Qc.mask(r?n-1:n),o=r?i.add(Xc).mul(Vc):Zc;return function(t){const r=Wo.from(t);return(r.lt(o)||r.gt(i))&&Wc.throwArgumentError(`value out-of-bounds for ${e}`,"value",t),$o(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))&&Wc.throwArgumentError("invalid bytes width","type",e),function(t){return Po(t).length!==r&&Wc.throwArgumentError(`invalid length for ${e}`,"value",t),function(e){const t=Po(e),r=t.length%32;return r?To([t,Gc.slice(r)]):Ro(t)}(t)}}}switch(e){case"address":return function(e){return $o(ys(e),32)};case"bool":return function(e){return e?Yc:eu};case"bytes":return function(e){return ts(e)};case"string":return function(e){return lc(e)}}return null}function au(e,t){return`${e}(${t.map((({name:e,type:t})=>t+" "+e)).join(",")})`}class su{constructor(e){ha(this,"types",Object.freeze(Aa(e))),ha(this,"_encoderCache",{}),ha(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]&&Wc.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&&Wc.throwArgumentError(`circular type reference to ${JSON.stringify(a)}`,"types",e);ou(a)||(r[a]||Wc.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?Wc.throwArgumentError("missing primary type","types",e):i.length>1&&Wc.throwArgumentError(`ambiguous primary types or unused types: ${i.map((e=>JSON.stringify(e))).join(", ")}`,"types",e),ha(this,"primaryType",i[0]),function i(o,a){a[o]&&Wc.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]=au(t,e[t])+r.map((t=>au(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=ou(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&&Wc.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",t);let i=t.map(r);return this._types[e]&&(i=i.map(ts)),ts(To(i))}}const r=this.types[e];if(r){const t=lc(this._types[e]);return e=>{const n=r.map((({name:t,type:r})=>{const n=this.getEncoder(r)(e[t]);return this._types[r]?ts(n):n}));return n.unshift(t),To(n)}}return Wc.throwArgumentError(`unknown type: ${e}`,"type",e)}encodeType(e){const t=this._types[e];return t||Wc.throwArgumentError(`unknown type: ${JSON.stringify(e)}`,"name",e),t}encodeData(e,t){return this.getEncoder(e)(t)}hashStruct(e,t){return ts(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(ou(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&&Wc.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)),{}):Wc.throwArgumentError(`unknown type: ${e}`,"type",e)}visit(e,t){return this._visit(this.primaryType,e,t)}static from(e){return new su(e)}static getPrimaryType(e){return su.from(e).primaryType}static hashStruct(e,t,r){return su.from(t).hashStruct(e,r)}static hashDomain(e){const t=[];for(const r in e){const n=tu[r];n||Wc.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(r)}`,"domain",e),t.push({name:r,type:n})}return t.sort(((e,t)=>ru.indexOf(e.name)-ru.indexOf(t.name))),su.hashStruct("EIP712Domain",{EIP712Domain:t},e)}static encode(e,t,r){return To(["0x1901",su.hashDomain(e),su.from(t).hash(r)])}static hash(e,t,r){return ts(su.encode(e,t,r))}static resolveNames(e,t,r,n){return Jc(this,void 0,void 0,(function*(){e=ya(e);const i={};e.verifyingContract&&!Co(e.verifyingContract,20)&&(i[e.verifyingContract]="0x");const o=su.from(t);o.visit(r,((e,t)=>("address"!==e||Co(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){su.hashDomain(e);const n={},i=[];ru.forEach((t=>{const r=e[t];null!=r&&(n[t]=iu[t](r),i.push({name:t,type:tu[t]}))}));const o=su.from(t),a=ya(t);return a.EIP712Domain?Wc.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 Ro(Po(t));if(e.match(/^u?int/))return Wo.from(t).toString();switch(e){case"address":return t.toLowerCase();case"bool":return!!t;case"string":return"string"!=typeof t&&Wc.throwArgumentError("invalid string","value",t),t}return Wc.throwArgumentError("unsupported type","type",e)}))}}}var cu=Object.freeze({__proto__:null,_TypedDataEncoder:su,dnsEncode:qc,ensNormalize:function(e){return Uc(e).map((e=>Js(e))).join(".")},hashMessage:Kc,id:lc,isValidName:function(e){try{return 0!==Uc(e).length}catch(e){}return!1},messagePrefix:Hc,namehash:Lc});const uu=new yo(Sa);class fu extends _a{}class du extends _a{}class lu extends _a{}class hu extends _a{static isIndexed(e){return!(!e||!e._isIndexed)}}const pu={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function mu(e,t){const r=new Error(`deferred error during ABI decoding triggered accessing ${e}`);return r.error=t,r}class gu{constructor(e){let t=[];t="string"==typeof e?JSON.parse(e):e,ha(this,"fragments",t.map((e=>ja.from(e))).filter((e=>null!=e))),ha(this,"_abiCoder",pa(new.target,"getAbiCoder")()),ha(this,"functions",{}),ha(this,"errors",{}),ha(this,"events",{}),ha(this,"structs",{}),this.fragments.forEach((e=>{let t=null;switch(e.type){case"constructor":return this.deploy?void uu.warn("duplicate definition - constructor"):void ha(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]?uu.warn("duplicate definition - "+r):t[r]=e})),this.deploy||ha(this,"deploy",za.from({payable:!1,type:"constructor"})),ha(this,"_isInterface",!0)}format(e){e||(e=Ra.full),e===Ra.sighash&&uu.throwArgumentError("interface does not support formatting sighash","format",e);const t=this.fragments.map((t=>t.format(e)));return e===Ra.json?JSON.stringify(t.map((e=>JSON.parse(e)))):t}static getAbiCoder(){return dc}static getAddress(e){return ys(e)}static getSighash(e){return Oo(lc(e.format()),0,4)}static getEventTopic(e){return lc(e.format())}getFunction(e){if(Co(e)){for(const t in this.functions)if(e===this.getSighash(t))return this.functions[t];uu.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?uu.throwArgumentError("no matching function","name",t):r.length>1&&uu.throwArgumentError("multiple matching functions","name",t),this.functions[r[0]]}const t=this.functions[Ua.fromString(e).format()];return t||uu.throwArgumentError("no matching function","signature",e),t}getEvent(e){if(Co(e)){const t=e.toLowerCase();for(const e in this.events)if(t===this.getEventTopic(e))return this.events[e];uu.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?uu.throwArgumentError("no matching event","name",t):r.length>1&&uu.throwArgumentError("multiple matching events","name",t),this.events[r[0]]}const t=this.events[Da.fromString(e).format()];return t||uu.throwArgumentError("no matching event","signature",e),t}getError(e){if(Co(e)){const t=pa(this.constructor,"getSighash");for(const r in this.errors){if(e===t(this.errors[r]))return this.errors[r]}uu.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?uu.throwArgumentError("no matching error","name",t):r.length>1&&uu.throwArgumentError("multiple matching errors","name",t),this.errors[r[0]]}const t=this.errors[Ua.fromString(e).format()];return t||uu.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 pa(this.constructor,"getSighash")(e)}getEventTopic(e){return"string"==typeof e&&(e=this.getEvent(e)),pa(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=Po(t);return Ro(r.slice(0,4))!==this.getSighash(e)&&uu.throwArgumentError(`data signature does not match error ${e.name}.`,"data",Ro(r)),this._decodeParams(e.inputs,r.slice(4))}encodeErrorResult(e,t){return"string"==typeof e&&(e=this.getError(e)),Ro(xo([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}decodeFunctionData(e,t){"string"==typeof e&&(e=this.getFunction(e));const r=Po(t);return Ro(r.slice(0,4))!==this.getSighash(e)&&uu.throwArgumentError(`data signature does not match function ${e.name}.`,"data",Ro(r)),this._decodeParams(e.inputs,r.slice(4))}encodeFunctionData(e,t){return"string"==typeof e&&(e=this.getFunction(e)),Ro(xo([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}decodeFunctionResult(e,t){"string"==typeof e&&(e=this.getFunction(e));let r=Po(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=Ro(r.slice(0,4)),t=pu[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 uu.throwError("call revert exception"+i,yo.errors.CALL_EXCEPTION,{method:e.format(),data:Ro(t),errorArgs:o,errorName:a,errorSignature:s,reason:n})}encodeFunctionResult(e,t){return"string"==typeof e&&(e=this.getFunction(e)),Ro(this._abiCoder.encode(e.outputs,t||[]))}encodeFilterTopics(e,t){"string"==typeof e&&(e=this.getEvent(e)),t.length>e.inputs.length&&uu.throwError("too many arguments for "+e.format(),yo.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:t});let r=[];e.anonymous||r.push(this.getEventTopic(e));const n=(e,t)=>"string"===e.type?lc(t):"bytes"===e.type?ts(Ro(t)):("bool"===e.type&&"boolean"==typeof t&&(t=t?"0x01":"0x00"),e.type.match(/^u?int/)&&(t=Wo.from(t).toHexString()),"address"===e.type&&this._abiCoder.encode(["address"],[t]),$o(Ro(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?uu.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&&uu.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&&uu.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(lc(a));else if("bytes"===e.type)r.push(ts(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);Co(r[0],32)&&r[0].toLowerCase()===t||uu.throwError("fragment/topic mismatch",yo.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(Oa.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,xo(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 hu({_isIndexed:!0,hash:null});else if(o[t])c[t]=new hu({_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 mu(`property ${JSON.stringify(e.name)}`,r)}}):c[e.name]=r}}));for(let e=0;e{throw mu(`index ${e}`,t)}})}return Object.freeze(c)}parseTransaction(e){let t=this.getFunction(e.data.substring(0,10).toLowerCase());return t?new du({args:this._abiCoder.decode(t.inputs,"0x"+e.data.substring(10)),functionFragment:t,name:t.name,signature:t.format(),sighash:this.getSighash(t),value:Wo.from(e.value||"0")}):null}parseLog(e){let t=this.getEvent(e.topics[0]);return!t||t.anonymous?null:new fu({eventFragment:t,name:t.name,signature:t.format(),topic:this.getEventTopic(t),args:this.decodeEventLog(t,e.data,e.topics)})}parseError(e){const t=Ro(e);let r=this.getError(t.substring(0,10).toLowerCase());return r?new lu({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 yu=Object.freeze({__proto__:null,AbiCoder:fc,ConstructorFragment:za,ErrorFragment:qa,EventFragment:Da,FormatTypes:Ra,Fragment:ja,FunctionFragment:Ua,Indexed:hu,Interface:gu,LogDescription:fu,ParamType:Oa,TransactionDescription:du,checkResultErrors:Va,defaultAbiCoder:dc});var bu=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 vu=new yo("abstract-provider/5.7.0");class wu extends _a{static isForkEvent(e){return!(!e||!e._isForkEvent)}}class Au{constructor(){vu.checkAbstract(new.target,Au),ha(this,"_isProvider",!0)}getFeeData(){return bu(this,void 0,void 0,(function*(){const{block:e,gasPrice:t}=yield ma({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=Wo.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 _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 yo("abstract-signer/5.7.0"),Su=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],Pu=[yo.errors.INSUFFICIENT_FUNDS,yo.errors.NONCE_EXPIRED,yo.errors.REPLACEMENT_UNDERPRICED];class xu{constructor(){Eu.checkAbstract(new.target,xu),ha(this,"_isSigner",!0)}getBalance(e){return _u(this,void 0,void 0,(function*(){return this._checkProvider("getBalance"),yield this.provider.getBalance(this.getAddress(),e)}))}getTransactionCount(e){return _u(this,void 0,void 0,(function*(){return this._checkProvider("getTransactionCount"),yield this.provider.getTransactionCount(this.getAddress(),e)}))}estimateGas(e){return _u(this,void 0,void 0,(function*(){this._checkProvider("estimateGas");const t=yield ma(this.checkTransaction(e));return yield this.provider.estimateGas(t)}))}call(e,t){return _u(this,void 0,void 0,(function*(){this._checkProvider("call");const r=yield ma(this.checkTransaction(e));return yield this.provider.call(r,t)}))}sendTransaction(e){return _u(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 _u(this,void 0,void 0,(function*(){this._checkProvider("getChainId");return(yield this.provider.getNetwork()).chainId}))}getGasPrice(){return _u(this,void 0,void 0,(function*(){return this._checkProvider("getGasPrice"),yield this.provider.getGasPrice()}))}getFeeData(){return _u(this,void 0,void 0,(function*(){return this._checkProvider("getFeeData"),yield this.provider.getFeeData()}))}resolveName(e){return _u(this,void 0,void 0,(function*(){return this._checkProvider("resolveName"),yield this.provider.resolveName(e)}))}checkTransaction(e){for(const t in e)-1===Su.indexOf(t)&&Eu.throwArgumentError("invalid transaction key: "+t,"transaction",e);const t=ya(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()&&Eu.throwArgumentError("from address mismatch","transaction",e),t[0]))),t}populateTransaction(e){return _u(this,void 0,void 0,(function*(){const t=yield ma(this.checkTransaction(e));null!=t.to&&(t.to=Promise.resolve(t.to).then((e=>_u(this,void 0,void 0,(function*(){if(null==e)return null;const t=yield this.resolveName(e);return null==t&&Eu.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||Eu.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",e):Eu.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&&Eu.throwError("network does not support EIP-1559",yo.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),null==t.gasPrice&&(t.gasPrice=e.gasPrice),t.type=0):Eu.throwError("failed to get consistent fee data",yo.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(Pu.indexOf(e.code)>=0)throw e;return Eu.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",yo.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]&&Eu.throwArgumentError("chainId address mismatch","transaction",e),t[0]))),yield ma(t)}))}_checkProvider(e){this.provider||Eu.throwError("missing provider",yo.errors.UNSUPPORTED_OPERATION,{operation:e||"_checkProvider"})}static isSigner(e){return!(!e||!e._isSigner)}}class ku extends xu{constructor(e,t){super(),ha(this,"address",e),ha(this,"provider",t||null)}getAddress(){return Promise.resolve(this.address)}_fail(e,t){return Promise.resolve().then((()=>{Eu.throwError(e,yo.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 ku(this.address,e)}}function Mu(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 Cu=Iu;function Iu(e,t){if(!e)throw new Error(t||"Assertion failed")}Iu.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)};var Ru=Mu((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}})),Nu=Mu((function(e,t){var r=t;r.assert=Cu,r.toArray=Ru.toArray,r.zero2=Ru.zero2,r.toHex=Ru.toHex,r.encode=Ru.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 ao(e,"hex","le")}})),Ou=Nu.getNAF,Tu=Nu.getJSF,ju=Nu.assert;function Du(e,t){this.type=e,this.p=new ao(t.p,16),this.red=t.prime?ao.red(t.prime):ao.mont(this.p),this.zero=new ao(0).toRed(this.red),this.one=new ao(1).toRed(this.red),this.two=new ao(2).toRed(this.red),this.n=t.n&&new ao(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 $u=Du;function Bu(e,t){this.curve=e,this.type=t,this.precomputed=null}Du.prototype.point=function(){throw new Error("Not implemented")},Du.prototype.validate=function(){throw new Error("Not implemented")},Du.prototype._fixedNafMul=function(e,t){ju(e.precomputed);var r=e._getDoubles(),n=Ou(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];ju(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},Du.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=Tu(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)},Bu.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}]},Uu.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()}},Uu.prototype.pointFromX=function(e,t){(e=new ao(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)},Uu.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)},Uu.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o":""},qu.prototype.isInfinity=function(){return this.inf},qu.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)},qu.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)},qu.prototype.getX=function(){return this.x.fromRed()},qu.prototype.getY=function(){return this.y.fromRed()},qu.prototype.mul=function(e){return e=new ao(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)},qu.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)},qu.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)},qu.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))},qu.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},qu.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},Fu(Hu,$u.BasePoint),Uu.prototype.jpoint=function(e,t,r){return new Hu(this,e,t,r)},Hu.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)},Hu.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},Hu.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)},Hu.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)},Hu.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}},Hu.prototype.inspect=function(){return this.isInfinity()?"":""},Hu.prototype.isInfinity=function(){return 0===this.z.cmpn(0)};var Ku=Mu((function(e,t){var r=t;r.base=$u,r.short=Lu,r.mont=null,r.edwards=null})),Ju=Mu((function(e,t){var r,n=t,i=Nu.assert;function o(e){"short"===e.type?this.curve=new Ku.short(e):"edwards"===e.type?this.curve=new Ku.edwards(e):this.curve=new Ku.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:oe.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:oe.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:oe.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:oe.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:oe.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:oe.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:oe.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:oe.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})}));function Wu(e){if(!(this instanceof Wu))return new Wu(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=Ru.toArray(e.entropy,e.entropyEnc||"hex"),r=Ru.toArray(e.nonce,e.nonceEnc||"hex"),n=Ru.toArray(e.pers,e.persEnc||"hex");Cu(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}var Gu=Wu;Wu.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},Wu.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=Ru.toArray(r,n||"hex"),this._update(r));for(var i=[];i.length"};var Qu=Nu.assert;function Yu(e,t){if(e instanceof Yu)return e;this._importDER(e,t)||(Qu(e.r&&e.s,"Signature without r or s"),this.r=new ao(e.r,16),this.s=new ao(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}var ef=Yu;function tf(){this.place=0}function rf(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 nf(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)}}Yu.prototype._importDER=function(e,t){e=Nu.toArray(e,t);var r=new tf;if(48!==e[r.place++])return!1;var n=rf(e,r);if(!1===n)return!1;if(n+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var i=rf(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=rf(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 ao(o),this.s=new ao(s),this.recoveryParam=null,!0},Yu.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=nf(t),r=nf(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];of(n,t.length),(n=n.concat(t)).push(2),of(n,r.length);var i=n.concat(r),o=[48];return of(o,i.length),o=o.concat(i),Nu.encode(o,e)};var af=function(){throw new Error("unsupported")},sf=Nu.assert;function cf(e){if(!(this instanceof cf))return new cf(e);"string"==typeof e&&(sf(Object.prototype.hasOwnProperty.call(Ju,e),"Unknown curve "+e),e=Ju[e]),e instanceof Ju.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 uf=cf;cf.prototype.keyPair=function(e){return new Xu(this,e)},cf.prototype.keyFromPrivate=function(e,t){return Xu.fromPrivate(this,e,t)},cf.prototype.keyFromPublic=function(e,t){return Xu.fromPublic(this,e,t)},cf.prototype.genKeyPair=function(e){e||(e={});for(var t=new Gu({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||af(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),n=this.n.sub(new ao(2));;){var i=new ao(t.generate(r));if(!(i.cmp(n)>0))return i.iaddn(1),this.keyFromPrivate(i)}},cf.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},cf.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 ao(e,16));for(var i=this.n.byteLength(),o=t.getPrivate().toArray("be",i),a=e.toArray("be",i),s=new Gu({hash:this.hash,entropy:o,nonce:a,pers:n.pers,persEnc:n.persEnc||"utf8"}),c=this.n.sub(new ao(1)),u=0;;u++){var f=n.k?n.k(u):new ao(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 ef({r:h,s:p,recoveryParam:m})}}}}}},cf.prototype.verify=function(e,t,r,n){e=this._truncateToN(new ao(e,16)),r=this.keyFromPublic(r,n);var i=(t=new ef(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)},cf.prototype.recoverPubKey=function(e,t,r,n){sf((3&r)===r,"The recovery param is more than two bits"),t=new ef(t,n);var i=this.n,o=new ao(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)},cf.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new ef(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 ff=Mu((function(e,t){var r=t;r.version="6.5.4",r.utils=Nu,r.rand=function(){throw new Error("unsupported")},r.curve=Ku,r.curves=Ju,r.ec=uf,r.eddsa=null})),df=ff.ec;const lf=new yo("signing-key/5.7.0");let hf=null;function pf(){return hf||(hf=new df("secp256k1")),hf}class mf{constructor(e){ha(this,"curve","secp256k1"),ha(this,"privateKey",Ro(e)),32!==No(this.privateKey)&&lf.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const t=pf().keyFromPrivate(Po(this.privateKey));ha(this,"publicKey","0x"+t.getPublic(!1,"hex")),ha(this,"compressedPublicKey","0x"+t.getPublic(!0,"hex")),ha(this,"_isSigningKey",!0)}_addPoint(e){const t=pf().keyFromPublic(Po(this.publicKey)),r=pf().keyFromPublic(Po(e));return"0x"+t.pub.add(r.pub).encodeCompressed("hex")}signDigest(e){const t=pf().keyFromPrivate(Po(this.privateKey)),r=Po(e);32!==r.length&&lf.throwArgumentError("bad digest length","digest",e);const n=t.sign(r,{canonical:!0});return Bo({recoveryParam:n.recoveryParam,r:$o("0x"+n.r.toString(16),32),s:$o("0x"+n.s.toString(16),32)})}computeSharedSecret(e){const t=pf().keyFromPrivate(Po(this.privateKey)),r=pf().keyFromPublic(Po(yf(e)));return $o("0x"+t.derive(r.getPublic()).toString(16),32)}static isSigningKey(e){return!(!e||!e._isSigningKey)}}function gf(e,t){const r=Bo(t),n={r:Po(r.r),s:Po(r.s)};return"0x"+pf().recoverPubKey(Po(e),n,r.recoveryParam).encode("hex",!1)}function yf(e,t){const r=Po(e);if(32===r.length){const e=new mf(r);return t?"0x"+pf().keyFromPrivate(r).getPublic(!0,"hex"):e.publicKey}return 33===r.length?t?Ro(r):"0x"+pf().keyFromPublic(r).getPublic(!1,"hex"):65===r.length?t?"0x"+pf().keyFromPublic(r).getPublic(!0,"hex"):Ro(r):lf.throwArgumentError("invalid public or private key","key","[REDACTED]")}var bf=Object.freeze({__proto__:null,SigningKey:mf,computePublicKey:yf,recoverPublicKey:gf});const vf=new yo("transactions/5.7.0");var wf;function Af(e){return"0x"===e?null:ys(e)}function _f(e){return"0x"===e?Ns:Wo.from(e)}!function(e){e[e.legacy=0]="legacy",e[e.eip2930=1]="eip2930",e[e.eip1559=2]="eip1559"}(wf||(wf={}));const Ef=[{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"}],Sf={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,type:!0,value:!0};function Pf(e){return ys(Oo(ts(Oo(yf(e),1)),12))}function xf(e,t){return Pf(gf(Po(e),t))}function kf(e,t){const r=ko(Wo.from(e).toHexString());return r.length>32&&vf.throwArgumentError("invalid length for "+t,"transaction:"+t,e),r}function Mf(e,t){return{address:ys(e),storageKeys:(t||[]).map(((t,r)=>(32!==No(t)&&vf.throwArgumentError("invalid access list storageKey",`accessList[${e}:${r}]`,t),t.toLowerCase())))}}function Cf(e){if(Array.isArray(e))return e.map(((e,t)=>Array.isArray(e)?(e.length>2&&vf.throwArgumentError("access list expected to be [ address, storageKeys[] ]",`value[${t}]`,e),Mf(e[0],e[1])):Mf(e.address,e.storageKeys)));const t=Object.keys(e).map((t=>{const r=e[t].reduce(((e,t)=>(e[t]=!0,e)),{});return Mf(t,Object.keys(r).sort())}));return t.sort(((e,t)=>e.address.localeCompare(t.address))),t}function If(e){return Cf(e).map((e=>[e.address,e.storageKeys]))}function Rf(e,t){if(null!=e.gasPrice){const t=Wo.from(e.gasPrice),r=Wo.from(e.maxFeePerGas||0);t.eq(r)||vf.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:t,maxFeePerGas:r})}const r=[kf(e.chainId||0,"chainId"),kf(e.nonce||0,"nonce"),kf(e.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),kf(e.maxFeePerGas||0,"maxFeePerGas"),kf(e.gasLimit||0,"gasLimit"),null!=e.to?ys(e.to):"0x",kf(e.value||0,"value"),e.data||"0x",If(e.accessList||[])];if(t){const e=Bo(t);r.push(kf(e.recoveryParam,"recoveryParam")),r.push(ko(e.r)),r.push(ko(e.s))}return To(["0x02",ss(r)])}function Nf(e,t){const r=[kf(e.chainId||0,"chainId"),kf(e.nonce||0,"nonce"),kf(e.gasPrice||0,"gasPrice"),kf(e.gasLimit||0,"gasLimit"),null!=e.to?ys(e.to):"0x",kf(e.value||0,"value"),e.data||"0x",If(e.accessList||[])];if(t){const e=Bo(t);r.push(kf(e.recoveryParam,"recoveryParam")),r.push(ko(e.r)),r.push(ko(e.s))}return To(["0x01",ss(r)])}function Of(e,t){if(null==e.type||0===e.type)return null!=e.accessList&&vf.throwArgumentError("untyped transactions do not support accessList; include type: 1","transaction",e),function(e,t){ga(e,Sf);const r=[];Ef.forEach((function(t){let n=e[t.name]||[];const i={};t.numeric&&(i.hexPad="left"),n=Po(Ro(n,i)),t.length&&n.length!==t.length&&n.length>0&&vf.throwArgumentError("invalid length for "+t.name,"transaction:"+t.name,n),t.maxLength&&(n=ko(n),n.length>t.maxLength&&vf.throwArgumentError("invalid length for "+t.name,"transaction:"+t.name,n)),r.push(Ro(n))}));let n=0;if(null!=e.chainId?(n=e.chainId,"number"!=typeof n&&vf.throwArgumentError("invalid transaction.chainId","transaction",e)):t&&!_o(t)&&t.v>28&&(n=Math.floor((t.v-35)/2)),0!==n&&(r.push(Ro(n)),r.push("0x"),r.push("0x")),!t)return ss(r);const i=Bo(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&&vf.throwArgumentError("transaction.chainId/signature.v mismatch","signature",t)):i.v!==o&&vf.throwArgumentError("transaction.chainId/signature.v mismatch","signature",t),r.push(Ro(o)),r.push(ko(Po(i.r))),r.push(ko(Po(i.s))),ss(r)}(e,t);switch(e.type){case 1:return Nf(e,t);case 2:return Rf(e,t)}return vf.throwError(`unsupported transaction type: ${e.type}`,yo.errors.UNSUPPORTED_OPERATION,{operation:"serializeTransaction",transactionType:e.type})}function Tf(e,t,r){try{const r=_f(t[0]).toNumber();if(0!==r&&1!==r)throw new Error("bad recid");e.v=r}catch(e){vf.throwArgumentError("invalid v for transaction type: 1","v",t[0])}e.r=$o(t[1],32),e.s=$o(t[2],32);try{const t=ts(r(e));e.from=xf(t,{r:e.r,s:e.s,recoveryParam:e.v})}catch(e){}}function jf(e){const t=Po(e);if(t[0]>127)return function(e){const t=fs(e);9!==t.length&&6!==t.length&&vf.throwArgumentError("invalid raw transaction","rawTransaction",e);const r={nonce:_f(t[0]).toNumber(),gasPrice:_f(t[1]),gasLimit:_f(t[2]),to:Af(t[3]),value:_f(t[4]),data:t[5],chainId:0};if(6===t.length)return r;try{r.v=Wo.from(t[6]).toNumber()}catch(e){return r}if(r.r=$o(t[7],32),r.s=$o(t[8],32),Wo.from(r.r).isZero()&&Wo.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(Ro(r.chainId)),i.push("0x"),i.push("0x"),n-=2*r.chainId+8);const o=ts(ss(i));try{r.from=xf(o,{r:Ro(r.r),s:Ro(r.s),recoveryParam:n})}catch(e){}r.hash=ts(e)}return r.type=null,r}(t);switch(t[0]){case 1:return function(e){const t=fs(e.slice(1));8!==t.length&&11!==t.length&&vf.throwArgumentError("invalid component count for transaction type: 1","payload",Ro(e));const r={type:1,chainId:_f(t[0]).toNumber(),nonce:_f(t[1]).toNumber(),gasPrice:_f(t[2]),gasLimit:_f(t[3]),to:Af(t[4]),value:_f(t[5]),data:t[6],accessList:Cf(t[7])};return 8===t.length||(r.hash=ts(e),Tf(r,t.slice(8),Nf)),r}(t);case 2:return function(e){const t=fs(e.slice(1));9!==t.length&&12!==t.length&&vf.throwArgumentError("invalid component count for transaction type: 2","payload",Ro(e));const r=_f(t[2]),n=_f(t[3]),i={type:2,chainId:_f(t[0]).toNumber(),nonce:_f(t[1]).toNumber(),maxPriorityFeePerGas:r,maxFeePerGas:n,gasPrice:null,gasLimit:_f(t[4]),to:Af(t[5]),value:_f(t[6]),data:t[7],accessList:Cf(t[8])};return 9===t.length||(i.hash=ts(e),Tf(i,t.slice(9),Rf)),i}(t)}return vf.throwError(`unsupported transaction type: ${t[0]}`,yo.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:t[0]})}var Df=Object.freeze({__proto__:null,get TransactionTypes(){return wf},accessListify:Cf,computeAddress:Pf,parse:jf,recoverAddress:xf,serialize:Of});var $f=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 Bf=new yo("contracts/5.7.0");function Ff(e,t){return $f(this,void 0,void 0,(function*(){const r=yield t;"string"!=typeof r&&Bf.throwArgumentError("invalid address or ENS name","name",r);try{return ys(r)}catch(e){}e||Bf.throwError("a provider or signer is needed to resolve ENS names",yo.errors.UNSUPPORTED_OPERATION,{operation:"resolveName"});const n=yield e.resolveName(r);return null==n&&Bf.throwArgumentError("resolver or addr is not configured for ENS name","name",r),n}))}function zf(e,t,r){return $f(this,void 0,void 0,(function*(){return Array.isArray(r)?yield Promise.all(r.map(((r,n)=>zf(e,Array.isArray(t)?t[n]:t[r.name],r)))):"address"===r.type?yield Ff(e,t):"tuple"===r.type?yield zf(e,t,r.components):"array"===r.baseType?Array.isArray(t)?yield Promise.all(t.map((t=>zf(e,t,r.arrayChildren)))):Promise.reject(Bf.makeError("invalid value for array",yo.errors.INVALID_ARGUMENT,{argument:"value",value:t})):t}))}function Uf(e,t,r){return $f(this,void 0,void 0,(function*(){let n={};r.length===t.inputs.length+1&&"object"==typeof r[r.length-1]&&(n=ya(r.pop())),Bf.checkArgumentCount(r.length,t.inputs.length,"passed to contract"),e.signer?n.from?n.from=ma({override:Ff(e.signer,n.from),signer:e.signer.getAddress()}).then((e=>$f(this,void 0,void 0,(function*(){return ys(e.signer)!==e.override&&Bf.throwError("Contract with a Signer cannot override from",yo.errors.UNSUPPORTED_OPERATION,{operation:"overrides.from"}),e.override})))):n.from=e.signer.getAddress():n.from&&(n.from=Ff(e.provider,n.from));const i=yield ma({args:zf(e.signer||e.provider,r,t.inputs),address:e.resolvedAddress,overrides:ma(n)||{}}),o=e.interface.encodeFunctionData(t,i.args),a={data:o,to:i.address},s=i.overrides;if(null!=s.nonce&&(a.nonce=Wo.from(s.nonce).toNumber()),null!=s.gasLimit&&(a.gasLimit=Wo.from(s.gasLimit)),null!=s.gasPrice&&(a.gasPrice=Wo.from(s.gasPrice)),null!=s.maxFeePerGas&&(a.maxFeePerGas=Wo.from(s.maxFeePerGas)),null!=s.maxPriorityFeePerGas&&(a.maxPriorityFeePerGas=Wo.from(s.maxPriorityFeePerGas)),null!=s.from&&(a.from=s.from),null!=s.type&&(a.type=s.type),null!=s.accessList&&(a.accessList=Cf(s.accessList)),null==a.gasLimit&&null!=t.gas){let e=21e3;const r=Po(o);for(let t=0;tnull!=n[e]));return c.length&&Bf.throwError(`cannot override ${c.map((e=>JSON.stringify(e))).join(",")}`,yo.errors.UNSUPPORTED_OPERATION,{operation:"overrides",overrides:c}),a}))}function Lf(e,t,r){const n=e.signer||e.provider;return function(...i){return $f(this,void 0,void 0,(function*(){let o;if(i.length===t.inputs.length+1&&"object"==typeof i[i.length-1]){const e=ya(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 Uf(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===yo.errors.CALL_EXCEPTION&&(t.address=e.address,t.args=i,t.transaction=a),t}}))}}function qf(e,t){return function(...r){return $f(this,void 0,void 0,(function*(){e.signer||Bf.throwError("sending a transaction requires a signer",yo.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction"}),null!=e.deployTransaction&&(yield e._deployed());const n=yield Uf(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=Aa(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 Hf(e,t,r){return t.constant?Lf(e,t,r):qf(e,t)}function Kf(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 Jf{constructor(e,t){ha(this,"tag",e),ha(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 Wf extends Jf{constructor(){super("error",null)}}class Gf extends Jf{constructor(e,t,r,n){const i={address:e};let o=t.getEventTopic(r);n?(o!==n[0]&&Bf.throwArgumentError("topic mismatch","topics",n),i.topics=n.slice()):i.topics=[o],super(Kf(i),i),ha(this,"address",e),ha(this,"interface",t),ha(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=Va(e.args);if(t.length)throw t[0].error;const r=(e.args||[]).slice();return r.push(e),r}}class Vf extends Jf{constructor(e,t){super("*",{address:e}),ha(this,"address",e),ha(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 Zf{constructor(e,t,r){ha(this,"interface",pa(new.target,"getInterface")(t)),null==r?(ha(this,"provider",null),ha(this,"signer",null)):xu.isSigner(r)?(ha(this,"provider",r.provider||null),ha(this,"signer",r)):Au.isProvider(r)?(ha(this,"provider",r),ha(this,"signer",null)):Bf.throwArgumentError("invalid signer or provider","signerOrProvider",r),ha(this,"callStatic",{}),ha(this,"estimateGas",{}),ha(this,"functions",{}),ha(this,"populateTransaction",{}),ha(this,"filters",{});{const e={};Object.keys(this.interface.events).forEach((t=>{const r=this.interface.events[t];ha(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?ha(this.filters,t,this.filters[r[0]]):Bf.warn(`Duplicate definition of ${t} (${r.join(", ")})`)}))}if(ha(this,"_runningEvents",{}),ha(this,"_wrappedEmits",{}),null==e&&Bf.throwArgumentError("invalid contract address or ENS name","addressOrName",e),ha(this,"address",e),this.provider)ha(this,"resolvedAddress",Ff(this.provider,e));else try{ha(this,"resolvedAddress",Promise.resolve(ys(e)))}catch(e){Bf.throwError("provider is required to use ENS name as contract address",yo.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])Bf.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]&&ha(this,e,Hf(this,t,!0)),null==this.functions[e]&&ha(this.functions,e,Hf(this,t,!1)),null==this.callStatic[e]&&ha(this.callStatic,e,Lf(this,t,!0)),null==this.populateTransaction[e]&&ha(this.populateTransaction,e,function(e,t){return function(...r){return Uf(e,t,r)}}(this,t)),null==this.estimateGas[e]&&ha(this.estimateGas,e,function(e,t){const r=e.signer||e.provider;return function(...n){return $f(this,void 0,void 0,(function*(){r||Bf.throwError("estimate require a provider or signer",yo.errors.UNSUPPORTED_OPERATION,{operation:"estimateGas"});const i=yield Uf(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]&&ha(this,e,this[r])}catch(e){}null==this.functions[e]&&ha(this.functions,e,this.functions[r]),null==this.callStatic[e]&&ha(this.callStatic,e,this.callStatic[r]),null==this.populateTransaction[e]&&ha(this.populateTransaction,e,this.populateTransaction[r]),null==this.estimateGas[e]&&ha(this.estimateGas,e,this.estimateGas[r])}))}static getContractAddress(e){return bs(e)}static getInterface(e){return gu.isInterface(e)?e:new gu(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&&Bf.throwError("contract not deployed",yo.errors.UNSUPPORTED_OPERATION,{contractAddress:this.address,operation:"getDeployed"}),this)))),this._deployedPromise}fallback(e){this.signer||Bf.throwError("sending a transactions require a signer",yo.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction(fallback)"});const t=ya(e||{});return["from","to"].forEach((function(e){null!=t[e]&&Bf.throwError("cannot override "+e,yo.errors.UNSUPPORTED_OPERATION,{operation:e})})),t.to=this.resolvedAddress,this.deployed().then((()=>this.signer.sendTransaction(t)))}connect(e){"string"==typeof e&&(e=new ku(e,this.provider));const t=new this.constructor(this.address,this.interface,e);return this.deployTransaction&&ha(t,"deployTransaction",this.deployTransaction),t}attach(e){return new this.constructor(e,this.interface,this.signer||this.provider)}static isIndexed(e){return hu.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 Wf);if("event"===e)return this._normalizeRunningEvent(new Jf("event",null));if("*"===e)return this._normalizeRunningEvent(new Vf(this.address,this.interface));const t=this.interface.getEvent(e);return this._normalizeRunningEvent(new Gf(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 Gf(this.address,this.interface,r,e.topics))}catch(e){}const t={address:this.address,topics:e.topics};return this._normalizeRunningEvent(new Jf(Kf(t),t))}return this._normalizeRunningEvent(new Vf(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=Aa(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||Bf.throwError("events require a provider or a signer with a provider",yo.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=ya(n.filter);return"string"==typeof t&&Co(t,32)?(null!=r&&Bf.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 Xf extends Zf{}class Qf{constructor(e){ha(this,"alphabet",e),ha(this,"base",e.length),ha(this,"_alphabetMap",{}),ha(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=Po(ad(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 Ad(xo([null!=this.privateKey?"0x0488ADE4":"0x0488B21E",Ro(this.depth),this.parentFingerprint,$o(Ro(this.index),4),this.chainCode,null!=this.privateKey?xo(["0x00",this.privateKey]):this.publicKey]))}neuter(){return new Pd(Ed,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&bd){if(!this.privateKey)throw new Error("cannot derive child of neutered node");r.set(Po(this.privateKey),1),t&&(t+="'")}else r.set(Po(this.publicKey));for(let t=24;t>=0;t-=8)r[33+(t>>3)]=e>>24-t&255;const n=Po(ad(td.sha512,this.chainCode,r)),i=n.slice(0,32),o=n.slice(32);let a=null,s=null;if(this.privateKey)a=wd(Wo.from(i).add(this.privateKey).mod(gd));else{s=new mf(Ro(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 Pd(Ed,a,s,this.fingerprint,wd(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=bd)throw new Error("invalid path index - "+n);r=r._derive(bd+e)}else{if(!n.match(/^[0-9]+$/))throw new Error("invalid path component - "+n);{const e=parseInt(n);if(e>=bd)throw new Error("invalid path index - "+n);r=r._derive(e)}}}return r}static _fromSeed(e,t){const r=Po(e);if(r.length<16||r.length>64)throw new Error("invalid seed");const n=Po(ad(td.sha512,yd,r));return new Pd(Ed,wd(n.slice(0,32)),null,"0x00000000",wd(n.slice(32)),0,0,t)}static fromMnemonic(e,t,r){return e=Md(kd(e,r=_d(r)),r),Pd._fromSeed(xd(e,t),{phrase:e,path:"m",locale:r.locale})}static fromSeed(e){return Pd._fromSeed(e,null)}static fromExtendedKey(e){const t=ed.decode(e);82===t.length&&Ad(t.slice(0,78))===e||md.throwArgumentError("invalid extended key","extendedKey","[REDACTED]");const r=t[4],n=Ro(t.slice(5,9)),i=parseInt(Ro(t.slice(9,13)).substring(2),16),o=Ro(t.slice(13,45)),a=t.slice(45,78);switch(Ro(t.slice(0,4))){case"0x0488b21e":case"0x043587cf":return new Pd(Ed,null,Ro(a),n,o,i,r,null);case"0x0488ade4":case"0x04358394 ":if(0!==a[0])break;return new Pd(Ed,Ro(a.slice(1)),null,n,o,i,r,null)}return md.throwArgumentError("invalid extended key","extendedKey","[REDACTED]")}}function xd(e,t){t||(t="");const r=qs("mnemonic"+t,Bs.NFKD);return cd(qs(e,Bs.NFKD),r,2048,64,"sha512")}function kd(e,t){t=_d(t),md.checkNormalize();const r=t.split(e);if(r.length%3!=0)throw new Error("invalid mnemonic");const n=Po(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=vd(r.length/3);if((Po(od(n.slice(0,o/8)))[0]&a)!==(n[n.length-1]&a))throw new Error("invalid checksum");return Ro(n.slice(0,o/8))}function Md(e,t){if(t=_d(t),(e=Po(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=Po(od(e))[0]&vd(i);return r[r.length-1]<<=i,r[r.length-1]|=o>>8-i,t.join(r.map((e=>t.getWord(e))))}var Cd=Object.freeze({__proto__:null,HDNode:Pd,defaultPath:Sd,entropyToMnemonic:Md,getAccountPath:function(e){return("number"!=typeof e||e<0||e>=bd||e%1)&&md.throwArgumentError("invalid account index","index",e),`m/44'/60'/${e}'/0/0`},isValidMnemonic:function(e,t){try{return kd(e,t),!0}catch(e){}return!1},mnemonicToEntropy:kd,mnemonicToSeed:xd});const Id=new yo("random/5.7.0");const Rd=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 Nd=Rd.crypto||Rd.msCrypto;function Od(e){(e<=0||e>1024||e%1||e!=e)&&Id.throwArgumentError("invalid length","length",e);const t=new Uint8Array(e);return Nd.getRandomValues(t),Po(t)}Nd&&Nd.getRandomValues||(Id.warn("WARNING: Missing strong random number source"),Nd={getRandomValues:function(e){return Id.throwError("no secure random source avaialble",yo.errors.UNSUPPORTED_OPERATION,{operation:"crypto.getRandomValues"})}});var Td=Object.freeze({__proto__:null,randomBytes:Od,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}}),jd={};!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}()}({get exports(){return Gd},set exports(e){Gd=e}});var Vd=Gd,Zd=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 Xd=new yo($d);function Qd(e){return null!=e&&e.mnemonic&&e.mnemonic.phrase}class Yd extends _a{isKeystoreAccount(e){return!(!e||!e._isKeystoreAccount)}}function el(e,t){const r=Bd(Ud(e,"crypto/ciphertext"));if(Ro(ts(xo([t.slice(16,32),r]))).substring(2)!==Ud(e,"crypto/mac").toLowerCase())throw new Error("invalid password");const n=function(e,t,r){if("aes-128-ctr"===Ud(e,"crypto/cipher")){const n=Bd(Ud(e,"crypto/cipherparams/iv")),i=new Dd.Counter(n);return Po(new Dd.ModeOfOperation.ctr(t,i).decrypt(r))}return null}(e,t.slice(0,16),r);n||Xd.throwError("unsupported cipher",yo.errors.UNSUPPORTED_OPERATION,{operation:"decrypt"});const i=t.slice(32,64),o=Pf(n);if(e.address){let t=e.address.toLowerCase();if("0x"!==t.substring(0,2)&&(t="0x"+t),ys(t)!==o)throw new Error("address mismatch")}const a={_isKeystoreAccount:!0,address:o,privateKey:Ro(n)};if("0.1"===Ud(e,"x-ethers/version")){const t=Bd(Ud(e,"x-ethers/mnemonicCiphertext")),r=Bd(Ud(e,"x-ethers/mnemonicCounter")),n=new Dd.Counter(r),o=new Dd.ModeOfOperation.ctr(i,n),s=Ud(e,"x-ethers/path")||Sd,c=Ud(e,"x-ethers/locale")||"en",u=Po(o.decrypt(t));try{const e=Md(u,c),t=Pd.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!==yo.errors.INVALID_ARGUMENT||"wordlist"!==e.argument)throw e}}return new Yd(a)}function tl(e,t,r,n,i){return Po(cd(e,t,r,n,i))}function rl(e,t,r,n,i){return Promise.resolve(tl(e,t,r,n,i))}function nl(e,t,r,n,i){const o=zd(t),a=Ud(e,"crypto/kdf");if(a&&"string"==typeof a){const t=function(e,t){return Xd.throwArgumentError("invalid key-derivation function parameters",e,t)};if("scrypt"===a.toLowerCase()){const r=Bd(Ud(e,"crypto/kdfparams/salt")),s=parseInt(Ud(e,"crypto/kdfparams/n")),c=parseInt(Ud(e,"crypto/kdfparams/r")),u=parseInt(Ud(e,"crypto/kdfparams/p"));s&&c&&u||t("kdf",a),0!=(s&s-1)&&t("N",s);const f=parseInt(Ud(e,"crypto/kdfparams/dklen"));return 32!==f&&t("dklen",f),n(o,r,s,c,u,64,i)}if("pbkdf2"===a.toLowerCase()){const n=Bd(Ud(e,"crypto/kdfparams/salt"));let i=null;const a=Ud(e,"crypto/kdfparams/prf");"hmac-sha256"===a?i="sha256":"hmac-sha512"===a?i="sha512":t("prf",a);const s=parseInt(Ud(e,"crypto/kdfparams/c")),c=parseInt(Ud(e,"crypto/kdfparams/dklen"));return 32!==c&&t("dklen",c),r(o,n,s,c,i)}}return Xd.throwArgumentError("unsupported key-derivation function","kdf",a)}function il(e,t){const r=JSON.parse(e);return el(r,nl(r,t,tl,Vd.syncScrypt))}function ol(e,t,r){return Zd(this,void 0,void 0,(function*(){const n=JSON.parse(e);return el(n,yield nl(n,t,rl,Vd.scrypt,r))}))}function al(e,t,r,n){try{if(ys(e.address)!==Pf(e.privateKey))throw new Error("address/privateKey mismatch");if(Qd(e)){const t=e.mnemonic;if(Pd.fromMnemonic(t.phrase,null,t.locale).derivePath(t.path||Sd).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=Po(e.privateKey),o=zd(t);let a=null,s=null,c=null;if(Qd(e)){const t=e.mnemonic;a=Po(kd(t.phrase,t.locale||"en")),s=t.path||Sd,c=t.locale||"en"}let u=r.client;u||(u="ethers.js");let f=null;f=r.salt?Po(r.salt):Od(32);let d=null;if(r.iv){if(d=Po(r.iv),16!==d.length)throw new Error("invalid iv")}else d=Od(16);let l=null;if(r.uuid){if(l=Po(r.uuid),16!==l.length)throw new Error("invalid uuid")}else l=Od(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)),Vd.scrypt(o,f,h,p,m,64,n).then((t=>{const r=(t=Po(t)).slice(0,16),n=t.slice(16,32),o=t.slice(32,64),g=new Dd.Counter(d),y=Po(new Dd.ModeOfOperation.ctr(r,g).encrypt(i)),b=ts(xo([n,y])),v={address:e.address.substring(2).toLowerCase(),id:Ld(l),version:3,crypto:{cipher:"aes-128-ctr",cipherparams:{iv:Ro(d).substring(2)},ciphertext:Ro(y).substring(2),kdf:"scrypt",kdfparams:{salt:Ro(f).substring(2),n:h,dklen:32,p:m,r:p},mac:b.substring(2)}};if(a){const e=Od(16),t=new Dd.Counter(e),r=Po(new Dd.ModeOfOperation.ctr(o,t).encrypt(a)),n=new Date,i=n.getUTCFullYear()+"-"+Fd(n.getUTCMonth()+1,2)+"-"+Fd(n.getUTCDate(),2)+"T"+Fd(n.getUTCHours(),2)+"-"+Fd(n.getUTCMinutes(),2)+"-"+Fd(n.getUTCSeconds(),2)+".0Z";v["x-ethers"]={client:u,gethFilename:"UTC--"+i+"--"+v.address,mnemonicCounter:Ro(e).substring(2),mnemonicCiphertext:Ro(r).substring(2),path:s,locale:c,version:"0.1"}}return JSON.stringify(v)}))}function sl(e,t,r){if(Jd(e)){r&&r(0);const n=Kd(e,t);return r&&r(1),Promise.resolve(n)}return Wd(e)?ol(e,t,r):Promise.reject(new Error("invalid JSON wallet"))}function cl(e,t){if(Jd(e))return Kd(e,t);if(Wd(e))return il(e,t);throw new Error("invalid JSON wallet")}var ul=Object.freeze({__proto__:null,decryptCrowdsale:Kd,decryptJsonWallet:sl,decryptJsonWalletSync:cl,decryptKeystore:ol,decryptKeystoreSync:il,encryptKeystore:al,getJsonWalletAddress:function(e){if(Jd(e))try{return ys(JSON.parse(e).ethaddr)}catch(e){return null}if(Wd(e))try{return ys(JSON.parse(e).address)}catch(e){return null}return null},isCrowdsaleWallet:Jd,isKeystoreWallet:Wd});var fl=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 dl=new yo("wallet/5.7.0");class ll extends xu{constructor(e,t){if(super(),null!=(r=e)&&Co(r.privateKey,32)&&null!=r.address){const t=new mf(e.privateKey);if(ha(this,"_signingKey",(()=>t)),ha(this,"address",Pf(this.publicKey)),this.address!==ys(e.address)&&dl.throwArgumentError("privateKey/address mismatch","privateKey","[REDACTED]"),function(e){const t=e.mnemonic;return t&&t.phrase}(e)){const t=e.mnemonic;ha(this,"_mnemonic",(()=>({phrase:t.phrase,path:t.path||Sd,locale:t.locale||"en"})));const r=this.mnemonic;Pf(Pd.fromMnemonic(r.phrase,null,r.locale).derivePath(r.path).privateKey)!==this.address&&dl.throwArgumentError("mnemonic/address mismatch","privateKey","[REDACTED]")}else ha(this,"_mnemonic",(()=>null))}else{if(mf.isSigningKey(e))"secp256k1"!==e.curve&&dl.throwArgumentError("unsupported curve; must be secp256k1","privateKey","[REDACTED]"),ha(this,"_signingKey",(()=>e));else{"string"==typeof e&&e.match(/^[0-9a-f]*$/i)&&64===e.length&&(e="0x"+e);const t=new mf(e);ha(this,"_signingKey",(()=>t))}ha(this,"_mnemonic",(()=>null)),ha(this,"address",Pf(this.publicKey))}var r;t&&!Au.isProvider(t)&&dl.throwArgumentError("invalid provider","provider",t),ha(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 ll(this,e)}signTransaction(e){return ma(e).then((t=>{null!=t.from&&(ys(t.from)!==this.address&&dl.throwArgumentError("transaction from address mismatch","transaction.from",e.from),delete t.from);const r=this._signingKey().signDigest(ts(Of(t)));return Of(t,r)}))}signMessage(e){return fl(this,void 0,void 0,(function*(){return Fo(this._signingKey().signDigest(Kc(e)))}))}_signTypedData(e,t,r){return fl(this,void 0,void 0,(function*(){const n=yield su.resolveNames(e,t,r,(e=>(null==this.provider&&dl.throwError("cannot resolve ENS names without a provider",yo.errors.UNSUPPORTED_OPERATION,{operation:"resolveName",value:e}),this.provider.resolveName(e))));return Fo(this._signingKey().signDigest(su.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={}),al(this,e,t,r)}static createRandom(e){let t=Od(16);e||(e={}),e.extraEntropy&&(t=Po(Oo(ts(xo([t,e.extraEntropy])),0,16)));const r=Md(t,e.locale);return ll.fromMnemonic(r,e.path,e.locale)}static fromEncryptedJson(e,t,r){return sl(e,t,r).then((e=>new ll(e)))}static fromEncryptedJsonSync(e,t){return new ll(cl(e,t))}static fromMnemonic(e,t,r){return t||(t=Sd),new ll(Pd.fromMnemonic(e,null,r).derivePath(t))}}var hl=Object.freeze({__proto__:null,Wallet:ll,verifyMessage:function(e,t){return xf(Kc(e),t)},verifyTypedData:function(e,t,r,n){return xf(su.hash(e,t,r),n)}});const pl=new yo("networks/5.7.1");function ml(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 ml(e)},t}function gl(e,t){const r=function(r,n){return r.JsonRpcProvider?new r.JsonRpcProvider(e,t):null};return r.renetwork=function(t){return gl(e,t)},r}const yl={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:ml("homestead")},bl={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:ml("ropsten")},vl={chainId:63,name:"classicMordor",_defaultProvider:gl("https://www.ethercluster.com/mordor","classicMordor")},wl={unspecified:{chainId:0,name:"unspecified"},homestead:yl,mainnet:yl,morden:{chainId:2,name:"morden"},ropsten:bl,testnet:bl,rinkeby:{chainId:4,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"rinkeby",_defaultProvider:ml("rinkeby")},kovan:{chainId:42,name:"kovan",_defaultProvider:ml("kovan")},goerli:{chainId:5,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"goerli",_defaultProvider:ml("goerli")},kintsugi:{chainId:1337702,name:"kintsugi"},sepolia:{chainId:11155111,name:"sepolia",_defaultProvider:ml("sepolia")},classic:{chainId:61,name:"classic",_defaultProvider:gl("https://www.ethercluster.com/etc","classic")},classicMorden:{chainId:62,name:"classicMorden"},classicMordor:vl,classicTestnet:vl,classicKotti:{chainId:6,name:"classicKotti",_defaultProvider:gl("https://www.ethercluster.com/kotti","classicKotti")},xdai:{chainId:100,name:"xdai"},matic:{chainId:137,name:"matic",_defaultProvider:ml("matic")},maticmum:{chainId:80001,name:"maticmum"},optimism:{chainId:10,name:"optimism",_defaultProvider:ml("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 Al=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 _l(e,t){return Al(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:Po(new Uint8Array(i))}}))}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())}))};const Sl=new yo("web/5.7.1");function Pl(e){return new Promise((t=>{setTimeout(t,e)}))}function xl(e,t){if(null==e)return null;if("string"==typeof e)return e;if(_o(e)){if(t&&("text"===t.split("/")[0]||"application/json"===t.split(";")[0].trim()))try{return Js(e)}catch(e){}return Ro(e)}return e}function kl(e,t,r){const n="object"==typeof e&&null!=e.throttleLimit?e.throttleLimit:12;Sl.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;Sl.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||Sl.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&&Sl.throwError("basic authentication requires a secure https url",yo.errors.INVALID_ARGUMENT,{argument:"url",url:c,user:e.user,password:"[REDACTED]"});const t=e.user+":"+e.password;s.authorization={key:"Authorization",value:"Basic "+mc(qs(t))}}null!=e.skipFetchSetup&&(u.skipFetchSetup=!!e.skipFetchSetup),null!=e.fetchOptions&&(u.fetchOptions=ya(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]?pc(h[3]):(p=h[3],qs(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){Sl.throwError("processing response error",yo.errors.SERVER_ERROR,{body:xl(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(Sl.makeError("timeout",yo.errors.TIMEOUT,{requestBody:xl(u.body,m["content-type"]),requestMethod:u.method,timeout:d,url:c})))}),d))})),cancel:function(){null!=e&&(clearTimeout(e),e=null)}}}(),y=function(){return El(this,void 0,void 0,(function*(){for(let e=0;e=300)&&(g.cancel(),Sl.throwError("bad response",yo.errors.SERVER_ERROR,{status:t.statusCode,headers:t.headers,body:xl(s,t.headers?t.headers["content-type"]:null),requestBody:xl(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=ya(r.headers),r.headers["content-type"]="application/json")}else r.headers={"content-type":"application/json"};e=r}return kl(e,n,((e,t)=>{let n=null;if(null!=e)try{n=JSON.parse(Js(e))}catch(t){Sl.throwError("invalid JSON",yo.errors.SERVER_ERROR,{body:e,error:t})}return r&&(n=r(n,t)),n}))}function Cl(e,t){return t||(t={}),null==(t=ya(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 Il=Object.freeze({__proto__:null,_fetchData:kl,fetchJson:Ml,poll:Cl}),Rl="qpzry9x8gf2tvdw0s3jn54khce6mua7l",Nl={},Ol=0;Ol>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 Dl(e){for(var t=1,r=0;r126)return"Invalid prefix ("+e+")";t=jl(t)^n>>5}for(t=jl(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=Dl(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 Bl(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=Dl(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=jl(n)^a,i+=Rl.charAt(a)}for(o=0;o<6;++o)n=jl(n);for(n^=1,o=0;o<6;++o){i+=Rl.charAt(n>>5*(5-o)&31)}return i},toWordsUnsafe:function(e){var t=Bl(e,8,5,!0);if(Array.isArray(t))return t},toWords:function(e){var t=Bl(e,8,5,!0);if(Array.isArray(t))return t;throw new Error(t)},fromWordsUnsafe:function(e){var t=Bl(e,5,8,!1);if(Array.isArray(t))return t},fromWords:function(e){var t=Bl(e,5,8,!1);if(Array.isArray(t))return t;throw new Error(t)}};const zl="providers/5.7.2",Ul=new yo(zl);class Ll{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:Ll.allowNull(this.accessList.bind(this),null),blockHash:Ll.allowNull(o,null),blockNumber:Ll.allowNull(s,null),transactionIndex:Ll.allowNull(s,null),confirmations:Ll.allowNull(s,null),from:t,gasPrice:Ll.allowNull(r),maxPriorityFeePerGas:Ll.allowNull(r),maxFeePerGas:Ll.allowNull(r),gasLimit:r,to:Ll.allowNull(t,null),value:r,nonce:s,data:i,r:Ll.allowNull(this.uint256),s:Ll.allowNull(this.uint256),v:Ll.allowNull(s),creates:Ll.allowNull(t,null),raw:Ll.allowNull(i)},e.transactionRequest={from:Ll.allowNull(t),nonce:Ll.allowNull(s),gasLimit:Ll.allowNull(r),gasPrice:Ll.allowNull(r),maxPriorityFeePerGas:Ll.allowNull(r),maxFeePerGas:Ll.allowNull(r),to:Ll.allowNull(t),value:Ll.allowNull(r),data:Ll.allowNull((e=>this.data(e,!0))),type:Ll.allowNull(s),accessList:Ll.allowNull(this.accessList.bind(this),null)},e.receiptLog={transactionIndex:s,blockNumber:s,transactionHash:o,address:t,topics:Ll.arrayOf(o),data:i,logIndex:s,blockHash:o},e.receipt={to:Ll.allowNull(this.address,null),from:Ll.allowNull(this.address,null),contractAddress:Ll.allowNull(t,null),transactionIndex:s,root:Ll.allowNull(a),gasUsed:r,logsBloom:Ll.allowNull(i),blockHash:o,transactionHash:o,logs:Ll.arrayOf(this.receiptLog.bind(this)),blockNumber:s,confirmations:Ll.allowNull(s,null),cumulativeGasUsed:r,effectiveGasPrice:Ll.allowNull(r),status:Ll.allowNull(s),type:c},e.block={hash:Ll.allowNull(o),parentHash:o,number:s,timestamp:s,nonce:Ll.allowNull(a),difficulty:this.difficulty.bind(this),gasLimit:r,gasUsed:r,miner:Ll.allowNull(t),extraData:i,transactions:Ll.allowNull(Ll.arrayOf(o)),baseFeePerGas:Ll.allowNull(r)},e.blockWithTransactions=ya(e.block),e.blockWithTransactions.transactions=Ll.allowNull(Ll.arrayOf(this.transactionResponse.bind(this))),e.filter={fromBlock:Ll.allowNull(n,void 0),toBlock:Ll.allowNull(n,void 0),blockHash:Ll.allowNull(o,void 0),address:Ll.allowNull(t,void 0),topics:Ll.allowNull(this.topics.bind(this),void 0)},e.filterLog={blockNumber:Ll.allowNull(s),blockHash:Ll.allowNull(o),transactionIndex:s,removed:Ll.allowNull(this.boolean.bind(this)),address:t,data:Ll.allowFalsish(i,"0x"),topics:Ll.arrayOf(o),transactionHash:o,logIndex:s},e}accessList(e){return Cf(e||[])}number(e){return"0x"===e?0:Wo.from(e).toNumber()}type(e){return"0x"===e||null==e?0:Wo.from(e).toNumber()}bigNumber(e){return Wo.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),Co(e))?e.toLowerCase():Ul.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 ys(e)}callAddress(e){if(!Co(e,32))return null;const t=ys(Oo(e,12));return"0x0000000000000000000000000000000000000000"===t?null:t}contractAddress(e){return bs(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||Co(e))return jo(e);throw new Error("invalid blockTag")}hash(e,t){const r=this.hex(e,t);return 32!==No(r)?Ul.throwArgumentError("invalid hash","value",e):r}difficulty(e){if(null==e)return null;const t=Wo.from(e);try{return t.toNumber()}catch(e){}return null}uint256(e){if(!Co(e))throw new Error("invalid uint256");return $o(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=Ll.check(t,e);return n._difficulty=null==r?null:Wo.from(r),n}block(e){return this._block(e,this.formats.block)}blockWithTransactions(e){return this._block(e,this.formats.blockWithTransactions)}transactionRequest(e){return Ll.check(this.formats.transactionRequest,e)}transactionResponse(e){null!=e.gas&&null==e.gasLimit&&(e.gasLimit=e.gas),e.to&&Wo.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=Ll.check(this.formats.transaction,e);if(null!=e.chainId){let r=e.chainId;Co(r)&&(r=Wo.from(r).toNumber()),t.chainId=r}else{let r=e.networkId;null==r&&null==t.v&&(r=e.chainId),Co(r)&&(r=Wo.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 jf(e)}receiptLog(e){return Ll.check(this.formats.receiptLog,e)}receipt(e){const t=Ll.check(this.formats.receipt,e);if(null!=t.root)if(t.root.length<=4){const e=Wo.from(t.root).toNumber();0===e||1===e?(null!=t.status&&t.status!==e&&Ul.throwArgumentError("alt-root-status/status mismatch","value",{root:t.root,status:t.status}),t.status=e,delete t.root):Ul.throwArgumentError("invalid alt-root-status","value.root",t.root)}else 66!==t.root.length&&Ul.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 Ll.check(this.formats.filter,e)}filterLog(e){return Ll.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 ql=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 yo(zl);function Kl(e){return null==e?"null":(32!==No(e)&&Hl.throwArgumentError("invalid topic","topic",e),e.toLowerCase())}function Jl(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[Kl(e)]=!0}));const r=Object.keys(t);return r.sort(),r.join("|")}return Kl(e)})).join("&")}function Wl(e){if("string"==typeof e){if(32===No(e=e.toLowerCase()))return"tx:"+e;if(-1===e.indexOf(":"))return e}else{if(Array.isArray(e))return"filter:*:"+Jl(e);if(wu.isForkEvent(e))throw Hl.warn("not implemented"),new Error("not implemented");if(e&&"object"==typeof e)return"filter:"+(e.address||"*")+":"+Jl(e.topics||[])}throw new Error("invalid event - "+e)}function Gl(){return(new Date).getTime()}function Vl(e){return new Promise((t=>{setTimeout(t,e)}))}const Zl=["block","network","pending","poll"];class Xl{constructor(e,t,r){ha(this,"tag",e),ha(this,"listener",t),ha(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||Zl.indexOf(this.tag)>=0}}const Ql={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 Yl(e){return $o(Wo.from(e).toHexString(),32)}function eh(e){return ed.encode(xo([e,Oo(od(od(e)),0,4)]))}const th=new RegExp("^(ipfs)://(.*)$","i"),rh=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),th,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function nh(e,t){try{return Js(ih(e,t))}catch(e){}return null}function ih(e,t){if("0x"===e)return null;const r=Wo.from(Oo(e,t,t+32)).toNumber(),n=Wo.from(Oo(e,r,r+32)).toNumber();return Oo(e,r+32,r+32+n)}function oh(e){return e.match(/^ipfs:\/\/ipfs\//i)?e=e.substring(12):e.match(/^ipfs:\/\//i)?e=e.substring(7):Hl.throwArgumentError("unsupported IPFS format","link",e),`https://gateway.ipfs.io/ipfs/${e}`}function ah(e){const t=Po(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 sh(e){if(e.length%32==0)return e;const t=new Uint8Array(32*Math.ceil(e.length/32));return t.set(e),t}function ch(e){const t=[];let r=0;for(let n=0;nWo.from(e).eq(1))).catch((e=>{if(e.code===yo.errors.CALL_EXCEPTION)return!1;throw this._supportsEip2544=null,e}))),this._supportsEip2544}_fetch(e,t){return ql(this,void 0,void 0,(function*(){const r={to:this.address,ccipReadEnabled:!0,data:To([e,Lc(this.name),t||"0x"])};let n=!1;(yield this.supportsWildcard())&&(n=!0,r.data=To(["0x9061b923",ch([qc(this.name),r.data])]));try{let e=yield this.provider.call(r);return Po(e).length%32==4&&Hl.throwError("resolver threw error",yo.errors.CALL_EXCEPTION,{transaction:r,data:e}),n&&(e=ih(e,0)),e}catch(e){if(e.code===yo.errors.CALL_EXCEPTION)return null;throw e}}))}_fetchBytes(e,t){return ql(this,void 0,void 0,(function*(){const r=yield this._fetch(e,t);return null!=r?ih(r,0):null}))}_getAddress(e,t){const r=Ql[String(e)];if(null==r&&Hl.throwError(`unsupported coin type: ${e}`,yo.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`}),"eth"===r.ilk)return this.provider.formatter.address(t);const n=Po(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 eh(xo([[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 eh(xo([[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=Fl.toWords(n.slice(2));return e.unshift(t),Fl.encode(r.prefix,e)}}return null}getAddress(e){return ql(this,void 0,void 0,(function*(){if(null==e&&(e=60),60===e)try{const e=yield this._fetch("0x3b3b57de");return"0x"===e||e===js?null:this.provider.formatter.callAddress(e)}catch(e){if(e.code===yo.errors.CALL_EXCEPTION)return null;throw e}const t=yield this._fetchBytes("0xf1cb7e06",Yl(e));if(null==t||"0x"===t)return null;const r=this._getAddress(e,t);return null==r&&Hl.throwError("invalid or unsupported coin data",yo.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`,coinType:e,data:t}),r}))}getAvatar(){return ql(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 Hl.throwError("invalid or unsupported content hash data",yo.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:e})}))}getText(e){return ql(this,void 0,void 0,(function*(){let t=qs(e);t=xo([Yl(64),Yl(t.length),t]),t.length%32!=0&&(t=xo([t,$o("0x",32-e.length%32)]));const r=yield this._fetchBytes("0x59d1d43c",Ro(t));return null==r||"0x"===r?null:Js(r)}))}}let fh=null,dh=1;class lh extends Au{constructor(e){if(super(),this._events=[],this._emitted={block:-2},this.disableCcipRead=!1,this.formatter=new.target.getFormatter(),ha(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=pa(new.target,"getNetwork")(e);t?(ha(this,"_network",t),this.emit("network",t,null)):Hl.throwArgumentError("invalid network","network",e)}this._maxInternalBlockNumber=-1024,this._lastBlockNumber=-2,this._maxFilterBlockRange=10,this._pollingInterval=4e3,this._fastQueryDate=0}_ready(){return ql(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||Hl.throwError("no network detected",yo.errors.UNKNOWN_ERROR,{}),null==this._network&&(this.anyNetwork?this._network=e:ha(this,"_network",e),this.emit("network",e,null))}return this._network}))}get ready(){return Cl((()=>this._ready().then((e=>e),(e=>{if(e.code!==yo.errors.NETWORK_ERROR||"noNetwork"!==e.event)throw e}))))}static getFormatter(){return null==fh&&(fh=new Ll),fh}static getNetwork(e){return function(e){if(null==e)return null;if("number"==typeof e){for(const t in wl){const r=wl[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=wl[e];return null==t?null:{name:t.name,chainId:t.chainId,ensAddress:t.ensAddress,_defaultProvider:t._defaultProvider||null}}const t=wl[e.name];if(!t)return"number"!=typeof e.chainId&&pl.throwArgumentError("invalid network chainId","network",e),e;0!==e.chainId&&e.chainId!==t.chainId&&pl.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 ql(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 Ml({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 Hl.throwError(`response not found during CCIP fetch: ${u}`,yo.errors.SERVER_ERROR,{url:t,errorMessage:u});o.push(u)}return Hl.throwError(`error encountered during CCIP fetch: ${o.map((e=>JSON.stringify(e))).join(", ")}`,yo.errors.SERVER_ERROR,{urls:r,errorMessages:o})}))}_getInternalBlockNumber(e){return ql(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(Gl()-r.respTime<=e)return r.blockNumber;break}catch(e){if(this._internalBlockNumber===t)break}}const t=Gl(),r=ma({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=Gl();return(e=Wo.from(e).toNumber()){this._internalBlockNumber===r&&(this._internalBlockNumber=null)})),(yield r).blockNumber}))}poll(){return ql(this,void 0,void 0,(function*(){const e=dh++,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)Hl.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${r})`),this.emit("error",Hl.makeError("network block skew detected",yo.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 ql(this,void 0,void 0,(function*(){return Hl.throwError("provider does not support network detection",yo.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"})}))}getNetwork(){return ql(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 Vl(0),this._network;const r=Hl.makeError("underlying network changed",yo.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=Gl();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 ql(this,void 0,void 0,(function*(){return this._waitForTransaction(e,null==t?1:t,r||0,null)}))}_waitForTransaction(e,t,r,n){return ql(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=>ql(this,void 0,void 0,(function*(){s||(yield Vl(1e3),this.getTransactionCount(n.from).then((f=>ql(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(Hl.makeError("timeout exceeded",yo.errors.TIMEOUT,{timeout:r}))}),r);e.unref&&e.unref(),a.push((()=>{clearTimeout(e)}))}}))}))}getBlockNumber(){return ql(this,void 0,void 0,(function*(){return this._getInternalBlockNumber(0)}))}getGasPrice(){return ql(this,void 0,void 0,(function*(){yield this.getNetwork();const e=yield this.perform("getGasPrice",{});try{return Wo.from(e)}catch(t){return Hl.throwError("bad result from backend",yo.errors.SERVER_ERROR,{method:"getGasPrice",result:e,error:t})}}))}getBalance(e,t){return ql(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield ma({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),n=yield this.perform("getBalance",r);try{return Wo.from(n)}catch(e){return Hl.throwError("bad result from backend",yo.errors.SERVER_ERROR,{method:"getBalance",params:r,result:n,error:e})}}))}getTransactionCount(e,t){return ql(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield ma({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),n=yield this.perform("getTransactionCount",r);try{return Wo.from(n).toNumber()}catch(e){return Hl.throwError("bad result from backend",yo.errors.SERVER_ERROR,{method:"getTransactionCount",params:r,result:n,error:e})}}))}getCode(e,t){return ql(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield ma({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),n=yield this.perform("getCode",r);try{return Ro(n)}catch(e){return Hl.throwError("bad result from backend",yo.errors.SERVER_ERROR,{method:"getCode",params:r,result:n,error:e})}}))}getStorageAt(e,t,r){return ql(this,void 0,void 0,(function*(){yield this.getNetwork();const n=yield ma({address:this._getAddress(e),blockTag:this._getBlockTag(r),position:Promise.resolve(t).then((e=>jo(e)))}),i=yield this.perform("getStorageAt",n);try{return Ro(i)}catch(e){return Hl.throwError("bad result from backend",yo.errors.SERVER_ERROR,{method:"getStorageAt",params:n,result:i,error:e})}}))}_wrapTransaction(e,t,r){if(null!=t&&32!==No(t))throw new Error("invalid response - sendTransaction");const n=e;return null!=t&&e.hash!==t&&Hl.throwError("Transaction hash mismatch from Provider.sendTransaction.",yo.errors.UNKNOWN_ERROR,{expectedHash:e.hash,returnedHash:t}),n.wait=(t,n)=>ql(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&&Hl.throwError("transaction failed",yo.errors.CALL_EXCEPTION,{transactionHash:e.hash,transaction:e,receipt:o}),o)})),n}sendTransaction(e){return ql(this,void 0,void 0,(function*(){yield this.getNetwork();const t=yield Promise.resolve(e).then((e=>Ro(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 ql(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?Wo.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?Ro(e):null)))})),this.formatter.transactionRequest(yield ma(r))}))}_getFilter(e){return ql(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 ma(t))}))}_call(e,t,r){return ql(this,void 0,void 0,(function*(){r>=10&&Hl.throwError("CCIP read exceeded maximum redirections",yo.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)&&No(i)%32==4)try{const o=Oo(i,4),a=Oo(o,0,32);Wo.from(a).eq(n)||Hl.throwError("CCIP Read sender did not match",yo.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:i});const s=[],c=Wo.from(Oo(o,32,64)).toNumber(),u=Wo.from(Oo(o,c,c+32)).toNumber(),f=Oo(o,c+32);for(let t=0;tql(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 ql(this,void 0,void 0,(function*(){yield this.getNetwork(),e=yield e;const t={transactionHash:this.formatter.hash(e,!0)};return Cl((()=>ql(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 ql(this,void 0,void 0,(function*(){yield this.getNetwork(),e=yield e;const t={transactionHash:this.formatter.hash(e,!0)};return Cl((()=>ql(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 ql(this,void 0,void 0,(function*(){yield this.getNetwork();const t=yield ma({filter:this._getFilter(e)}),r=yield this.perform("getLogs",t);return r.forEach((e=>{null==e.removed&&(e.removed=!1)})),Ll.arrayOf(this.formatter.filterLog.bind(this.formatter))(r)}))}getEtherPrice(){return ql(this,void 0,void 0,(function*(){return yield this.getNetwork(),this.perform("getEtherPrice",{})}))}_getBlockTag(e){return ql(this,void 0,void 0,(function*(){if("number"==typeof(e=yield e)&&e<0){e%1&&Hl.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 ql(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 uh(this,r,e);return t===e||(yield n.supportsWildcard())?n:null}t=t.split(".").slice(1).join(".")}}))}_getResolver(e,t){return ql(this,void 0,void 0,(function*(){null==t&&(t="ENS");const r=yield this.getNetwork();r.ensAddress||Hl.throwError("network does not support ENS",yo.errors.UNSUPPORTED_OPERATION,{operation:t,network:r.name});try{const t=yield this.call({to:r.ensAddress,data:"0x0178b8bf"+Lc(e).substring(2)});return this.formatter.callAddress(t)}catch(e){}return null}))}resolveName(e){return ql(this,void 0,void 0,(function*(){e=yield e;try{return Promise.resolve(this.formatter.address(e))}catch(t){if(Co(e))throw t}"string"!=typeof e&&Hl.throwArgumentError("invalid ENS name","name",e);const t=yield this.getResolver(e);return t?yield t.getAddress():null}))}lookupAddress(e){return ql(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=nh(yield this.call({to:r,data:"0x691f3431"+Lc(t).substring(2)}),0);return(yield this.resolveName(n))!=e?null:n}))}getAvatar(e){return ql(this,void 0,void 0,(function*(){let t=null;if(Co(e)){const r=this.formatter.address(e).substring(2).toLowerCase()+".addr.reverse",n=yield this._getResolver(r,"getAvatar");if(!n)return null;t=new uh(this,n,r);try{const e=yield t.getAvatar();if(e)return e.url}catch(e){if(e.code!==yo.errors.CALL_EXCEPTION)throw e}try{const e=nh(yield this.call({to:n,data:"0x691f3431"+Lc(r).substring(2)}),0);t=yield this.getResolver(e)}catch(e){if(e.code!==yo.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 Hl.throwError(e+" not implemented",yo.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 Xl(Wl(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=Wl(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=Wl(e);return this._events.filter((e=>e.tag===t)).length}listeners(e){if(null==e)return this._events.map((e=>e.listener));let t=Wl(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=Wl(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=Wl(e);this._events=this._events.filter((e=>e.tag!==r||(t.push(e),!1)))}return t.forEach((e=>{this._stopEvent(e)})),this}}var hh=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 ph=new yo(zl),mh=["call","estimateGas"];function gh(e,t){if(null==e)return null;if("string"==typeof e.message&&e.message.match("reverted")){const r=Co(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=gh(e[r],t);if(n)return n}return null}if("string"==typeof e)try{return gh(JSON.parse(e),t)}catch(e){}return null}function yh(e,t,r){const n=r.transaction||r.signedTransaction;if("call"===e){const e=gh(t,!0);if(e)return e.data;ph.throwError("missing revert data in call exception; Transaction reverted without a reason string",yo.errors.CALL_EXCEPTION,{data:"0x",transaction:n,error:t})}if("estimateGas"===e){let r=gh(t.body,!1);null==r&&(r=gh(t,!1)),r&&ph.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",yo.errors.UNPREDICTABLE_GAS_LIMIT,{reason:r.message,method:e,transaction:n,error:t})}let i=t.message;throw t.code===yo.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)&&ph.throwError("insufficient funds for intrinsic transaction cost",yo.errors.INSUFFICIENT_FUNDS,{error:t,method:e,transaction:n}),i.match(/nonce (is )?too low/i)&&ph.throwError("nonce has already been used",yo.errors.NONCE_EXPIRED,{error:t,method:e,transaction:n}),i.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&ph.throwError("replacement fee too low",yo.errors.REPLACEMENT_UNDERPRICED,{error:t,method:e,transaction:n}),i.match(/only replay-protected/i)&&ph.throwError("legacy pre-eip-155 transactions not supported",yo.errors.UNSUPPORTED_OPERATION,{error:t,method:e,transaction:n}),mh.indexOf(e)>=0&&i.match(/gas required exceeds allowance|always failing transaction|execution reverted|revert/)&&ph.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",yo.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,method:e,transaction:n}),t}function bh(e){return new Promise((function(t){setTimeout(t,e)}))}function vh(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 wh(e){return e?e.toLowerCase():e}const Ah={};class _h extends xu{constructor(e,t,r){if(super(),e!==Ah)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");ha(this,"provider",t),null==r&&(r=0),"string"==typeof r?(ha(this,"_address",this.provider.formatter.address(r)),ha(this,"_index",null)):"number"==typeof r?(ha(this,"_index",r),ha(this,"_address",null)):ph.throwArgumentError("invalid address or index","addressOrIndex",r)}connect(e){return ph.throwError("cannot alter JSON-RPC Signer connection",yo.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}connectUnchecked(){return new Eh(Ah,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&&ph.throwError("unknown account #"+this._index,yo.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),this.provider.formatter.address(e[this._index]))))}sendUncheckedTransaction(e){e=ya(e);const t=this.getAddress().then((e=>(e&&(e=e.toLowerCase()),e)));if(null==e.gasLimit){const r=ya(e);r.from=t,e.gasLimit=this.provider.estimateGas(r)}return null!=e.to&&(e.to=Promise.resolve(e.to).then((e=>hh(this,void 0,void 0,(function*(){if(null==e)return null;const t=yield this.provider.resolveName(e);return null==t&&ph.throwArgumentError("provided ENS name resolves to null","tx.to",e),t}))))),ma({tx:ma(e),sender:t}).then((({tx:t,sender:r})=>{null!=t.from?t.from.toLowerCase()!==r&&ph.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)&&ph.throwError("user rejected transaction",yo.errors.ACTION_REJECTED,{action:"sendTransaction",transaction:t}),yh("sendTransaction",e,n))))}))}signTransaction(e){return ph.throwError("signing transactions is unsupported",yo.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}sendTransaction(e){return hh(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 Cl((()=>hh(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 hh(this,void 0,void 0,(function*(){const t="string"==typeof e?qs(e):e,r=yield this.getAddress();try{return yield this.provider.send("personal_sign",[Ro(t),r.toLowerCase()])}catch(t){throw"string"==typeof t.message&&t.message.match(/user denied/i)&&ph.throwError("user rejected signing",yo.errors.ACTION_REJECTED,{action:"signMessage",from:r,messageData:e}),t}}))}_legacySignMessage(e){return hh(this,void 0,void 0,(function*(){const t="string"==typeof e?qs(e):e,r=yield this.getAddress();try{return yield this.provider.send("eth_sign",[r.toLowerCase(),Ro(t)])}catch(t){throw"string"==typeof t.message&&t.message.match(/user denied/i)&&ph.throwError("user rejected signing",yo.errors.ACTION_REJECTED,{action:"_legacySignMessage",from:r,messageData:e}),t}}))}_signTypedData(e,t,r){return hh(this,void 0,void 0,(function*(){const n=yield su.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(su.getPayload(n.domain,t,n.value))])}catch(e){throw"string"==typeof e.message&&e.message.match(/user denied/i)&&ph.throwError("user rejected signing",yo.errors.ACTION_REJECTED,{action:"_signTypedData",from:i,messageData:{domain:n.domain,types:t,value:n.value}}),e}}))}unlock(e){return hh(this,void 0,void 0,(function*(){const t=this.provider,r=yield this.getAddress();return t.send("personal_unlockAccount",[r.toLowerCase(),e,null])}))}}class Eh extends _h{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 Sh={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0};class Ph extends lh{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=pa(this.constructor,"defaultUrl")()),ha(this,"connection","string"==typeof e?Object.freeze({url:e}):Object.freeze(ya(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 hh(this,void 0,void 0,(function*(){yield bh(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=pa(this.constructor,"getNetwork");try{return t(Wo.from(e).toNumber())}catch(t){return ph.throwError("could not detect network",yo.errors.NETWORK_ERROR,{chainId:e,event:"invalidNetwork",serverError:t})}}return ph.throwError("could not detect network",yo.errors.NETWORK_ERROR,{event:"noNetwork"})}))}getSigner(e){return new _h(Ah,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:Aa(r),provider:this});const n=["eth_chainId","eth_blockNumber"].indexOf(e)>=0;if(n&&this._cache[e])return this._cache[e];const i=Ml(this.connection,JSON.stringify(r),vh).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",[wh(t.address),t.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[wh(t.address),t.blockTag]];case"getCode":return["eth_getCode",[wh(t.address),t.blockTag]];case"getStorageAt":return["eth_getStorageAt",[wh(t.address),$o(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",[pa(this.constructor,"hexlifyTransaction")(t.transaction,{from:!0}),t.blockTag]];case"estimateGas":return["eth_estimateGas",[pa(this.constructor,"hexlifyTransaction")(t.transaction,{from:!0})]];case"getLogs":return t.filter&&null!=t.filter.address&&(t.filter.address=wh(t.filter.address)),["eth_getLogs",[t.filter]]}return null}perform(e,t){return hh(this,void 0,void 0,(function*(){if("call"===e||"estimateGas"===e){const e=t.transaction;if(e&&null!=e.type&&Wo.from(e.type).isZero()&&null==e.maxFeePerGas&&null==e.maxPriorityFeePerGas){const r=yield this.getFeeData();null==r.maxFeePerGas&&null==r.maxPriorityFeePerGas&&((t=ya(t)).transaction=ya(e),delete t.transaction.type)}}const r=this.prepareRequest(e,t);null==r&&ph.throwError(e+" not implemented",yo.errors.NOT_IMPLEMENTED,{operation:e});try{return yield this.send(r[0],r[1])}catch(r){return yh(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 bh(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=ya(Sh);if(t)for(const e in t)t[e]&&(r[e]=!0);ga(e,r);const n={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach((function(t){if(null==e[t])return;const r=jo(Wo.from(e[t]));"gasLimit"===t&&(t="gas"),n[t]=r})),["from","to","data"].forEach((function(t){null!=e[t]&&(n[t]=Ro(e[t]))})),e.accessList&&(n.accessList=Cf(e.accessList)),n}}const xh=new RegExp("^bytes([0-9]+)$"),kh=new RegExp("^(u?int)([0-9]*)$"),Mh=new RegExp("^(.*)\\[([0-9]*)\\]$"),Ch="0000000000000000000000000000000000000000000000000000000000000000",Ih=new yo("solidity/5.7.0");function Rh(e,t,r){switch(e){case"address":return r?Mo(t,32):Po(t);case"string":return qs(t);case"bytes":return Po(t);case"bool":return t=t?"0x01":"0x00",r?Mo(t,32):Po(t)}let n=e.match(kh);if(n){let i=parseInt(n[2]||"256");return(n[2]&&String(i)!==n[2]||i%8!=0||0===i||i>256)&&Ih.throwArgumentError("invalid number type","type",e),r&&(i=256),Mo(t=Wo.from(t).toTwos(i),i/8)}if(n=e.match(xh),n){const i=parseInt(n[1]);return(String(i)!==n[1]||0===i||i>32)&&Ih.throwArgumentError("invalid bytes type","type",e),Po(t).byteLength!==i&&Ih.throwArgumentError(`invalid value for ${e}`,"value",t),r?Po((t+Ch).substring(0,66)):t}if(n=e.match(Mh),n&&Array.isArray(t)){const r=n[1];parseInt(n[2]||String(t.length))!=t.length&&Ih.throwArgumentError(`invalid array length for ${e}`,"value",t);const i=[];return t.forEach((function(e){i.push(Rh(r,e,!0))})),xo(i)}return Ih.throwArgumentError("invalid type","type",e)}function Nh(e,t){e.length!=t.length&&Ih.throwArgumentError("wrong number of values; expected ${ types.length }","values",t);const r=[];return e.forEach((function(e,n){r.push(Rh(e,t[n]))})),Ro(xo(r))}var Oh=Object.freeze({__proto__:null,keccak256:function(e,t){return ts(Nh(e,t))},pack:Nh,sha256:function(e,t){return od(Nh(e,t))}});const Th=new yo("units/5.7.0"),jh=["wei","kwei","mwei","gwei","szabo","finney","ether"];function Dh(e,t){if("string"==typeof t){const e=jh.indexOf(t);-1!==e&&(t=3*e)}return oa(e,null!=t?t:18)}function $h(e,t){if("string"!=typeof e&&Th.throwArgumentError("value must be a string","value",e),"string"==typeof t){const e=jh.indexOf(t);-1!==e&&(t=3*e)}return aa(e,null!=t?t:18)}var Bh=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)&&Th.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 Dh(e,18)},formatUnits:Dh,parseEther:function(e){return $h(e,18)},parseUnits:$h});function Fh(e){if(null==e.match(/^(0x)?([\da-fA-F]{40})$/))throw new RangeError("incorrect address format");try{return ys(ro(e,!0,20))}catch(e){throw new rn(e,["invalid EIP-55 address"])}}async function zh(e){return n(await io(Yi(e),"SHA-256"),!0,!1)}async function Uh(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 Zi(r,t);const n=await Hi(t),i=t.alg,o={...e,iat:Math.floor(Date.now()/1e3)};return{jws:await new Ui(o).setProtectedHeader({alg:i}).setIssuedAt(o.iat).sign(n),payload:o}}async function Lh(e,t,r){const n=JSON.parse(t.exchange[t.iss]),i=await Wi(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){eo("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(Yi(n)!==Yi(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;qh(o.exchange,e)}else if(""!==s[e]&&Yi(s[e])!==Yi(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 qh(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]&&Yi(t[r])!==Yi(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 Hh(e,t,r=10){const{payload:n}=await Wi(e),i=n.exchange,o={...i};delete o.id;if(await zh(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 Lh(n.poo,{iss:"orig",proofType:"PoO",exchange:i})).payload}catch(e){throw new rn(e,["invalid poo"])}try{await Lh(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(Gi(i.encAlg),i.ledgerSignerAddress,i.id,r);u=e.hex,f=e.iat}catch(e){throw new rn(e,["cannot verify"])}try{eo(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 Kh(e,t,r=10){let n,i,o,a,s;try{n=(await Wi(e)).payload}catch(e){throw new rn(e,["invalid verification request"])}try{const e=await Hh(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 Wi(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 Jh(e,t){const{payload:r}=await Wi(e),{destPublicJwk:i,origPublicJwk:o,secretHex:a,pooPayload:s,porPayload:c}=await Hh(r.por,t);try{await Wi(e,i)}catch(e){throw e instanceof rn&&e.add("invalid dispute request"),e}if(n(await io(r.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 Ji(r.cipherblock,(await Vi(c.exchange.encAlg,a)).jwk),{pooPayload:s,porPayload:c,drPayload:r,destPublicJwk:i,origPublicJwk:o}}async function Wh(e,t,r,n){const i={proofType:"request",iss:e,dataExchangeId:t,por:r,type:"verificationRequest",iat:Math.floor(Date.now()/1e3)},o=await li(n);return await new Ui(i).setProtectedHeader({alg:n.alg}).setIssuedAt(i.iat).sign(o)}var Gh=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 Zi(this.jwkPair.publicJwk,this.jwkPair.privateJwk)}async resolveCompleteness(e){await this.initialized;const{payload:t}=await Wi(e);let r;try{r=(await Wi(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 Kh(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 li(this.jwkPair.privateJwk);return await new Ui(n).setProtectedHeader({alg:this.jwkPair.privateJwk.alg}).setIssuedAt(n.iat).sign(i)}async resolveDispute(e){await this.initialized;const{payload:t}=await Wi(e);let r;try{r=(await Wi(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 Jh(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 li(this.jwkPair.privateJwk);return await new Ui(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 no(this.jwkPair.publicJwk,!0),sub:t}}},checkCompleteness:Kh,checkDecryption:Jh,generateVerificationRequest:Wh,verifyPor:Hh,verifyResolution:async function(e,t){return await Wi(e,t??((e,t)=>JSON.parse(t.iss)))}});const Vh={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 Zh(e,t,r,n,o){let s=Wo.from(0),c=Wo.from(0);const u=ro(a(i(r)),!0);let f=0;do{try{({secret:s,timestamp:c}=await e.registry(ro(t,!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={...Vh,...e},this.provider=new Ph(this.dltConfig.rpcProviderUrl),this.contract=new Xf(this.dltConfig.contract.address,this.dltConfig.contract.abi,this.provider),t(!0)})).catch((e=>r(e))):(this.dltConfig={...Vh,...e},this.provider=new Ph(this.dltConfig.rpcProviderUrl),this.contract=new Xf(this.dltConfig.contract.address,this.dltConfig.contract.abi,this.provider),t(!0))}))}async getContractAddress(){return await this.initialized,this.contract.address}}class ep extends Yh{async getSecretFromLedger(e,t,r,n){return await this.initialized,await Zh(this.contract,t,r,n,e)}}class tp extends Yh{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:i})})).catch((e=>{n(e)}))}));super(n),this.wallet=e,this.did=t}}class rp extends tp{async getSecretFromLedger(e,t,r,n){return await this.initialized,await Zh(this.contract,t,r,n,e)}}class np extends Yh{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:i})})).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 Zh(this.contract,t,r,n,e)}}var op={},ap=d(yu),sp=d(vs),cp=d(gc),up=d(rd),fp=d(zo),dp=d(cu),lp=d(Cd),hp=d(ul),pp=d(rs),mp=d(bo),gp=d(sd),yp=d(Oh),bp=d(Td),vp=d(Ea),wp=d(ds),Ap=d(bf),_p=d(ic),Ep=d(Df),Sp=d(Bh),Pp=d(hl),xp=d(Il);!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=ap;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=sp;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(cp);e.base64=a;var s=up;Object.defineProperty(e,"base58",{enumerable:!0,get:function(){return s.Base58}});var c=fp;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=dp;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=lp;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=hp;Object.defineProperty(e,"getJsonWalletAddress",{enumerable:!0,get:function(){return l.getJsonWalletAddress}});var h=pp;Object.defineProperty(e,"keccak256",{enumerable:!0,get:function(){return h.keccak256}});var p=mp;Object.defineProperty(e,"Logger",{enumerable:!0,get:function(){return p.Logger}});var m=gp;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=yp;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=bp;Object.defineProperty(e,"randomBytes",{enumerable:!0,get:function(){return y.randomBytes}}),Object.defineProperty(e,"shuffled",{enumerable:!0,get:function(){return y.shuffled}});var b=vp;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(wp);e.RLP=v;var w=Ap;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=_p;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 _=Ep;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=Sp;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=Pp;Object.defineProperty(e,"verifyMessage",{enumerable:!0,get:function(){return S.verifyMessage}}),Object.defineProperty(e,"verifyTypedData",{enumerable:!0,get:function(){return S.verifyTypedData}});var P=xp;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=gp;Object.defineProperty(e,"SupportedAlgorithm",{enumerable:!0,get:function(){return x.SupportedAlgorithm}});var k=_p;Object.defineProperty(e,"UnicodeNormalizationForm",{enumerable:!0,get:function(){return k.UnicodeNormalizationForm}}),Object.defineProperty(e,"Utf8ErrorReason",{enumerable:!0,get:function(){return k.Utf8ErrorReason}})}(op);class kp extends Yh{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 Mp extends tp{constructor(){super(...arguments),this.count=-1}async deploySecret(e,t){await this.initialized;const r=await Xh(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 Cp extends np{constructor(){super(...arguments),this.count=-1}async deploySecret(e,t){await this.initialized;const r=await Xh(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 Ip=Object.freeze({__proto__:null,EthersIoAgentDest:ep,EthersIoAgentOrig:kp,I3mServerWalletAgentDest:ip,I3mServerWalletAgentOrig:Cp,I3mWalletAgentDest:rp,I3mWalletAgentOrig:Mp}),Rp={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"]}]}}},Np={},Op={get exports(){return Np},set exports(e){Np=e}},Tp={},jp={},Dp={},$p={},Bp={},Fp={};!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}}}(zp),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=Fp,r=zp;var n=Fp;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=zp;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)}}(Bp);var Up={};!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=Bp,r=Fp;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}(Up);var Lp={};Object.defineProperty(Lp,"__esModule",{value:!0});const qp=Bp,Hp={data:new qp.Name("data"),valCxt:new qp.Name("valCxt"),instancePath:new qp.Name("instancePath"),parentData:new qp.Name("parentData"),parentDataProperty:new qp.Name("parentDataProperty"),rootData:new qp.Name("rootData"),dynamicAnchors:new qp.Name("dynamicAnchors"),vErrors:new qp.Name("vErrors"),errors:new qp.Name("errors"),this:new qp.Name("this"),self:new qp.Name("self"),scope:new qp.Name("scope"),json:new qp.Name("json"),jsonPos:new qp.Name("jsonPos"),jsonLen:new qp.Name("jsonLen"),jsonPart:new qp.Name("jsonPart")};Lp.default=Hp,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=Bp,r=Up,n=Lp;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]}}($p),Object.defineProperty(Dp,"__esModule",{value:!0}),Dp.boolOrEmptySchema=Dp.topBoolOrEmptySchema=void 0;const Kp=$p,Jp=Bp,Wp=Lp,Gp={message:"boolean schema is false"};function Vp(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,Kp.reportError)(i,Gp,void 0,t)}Dp.topBoolOrEmptySchema=function(e){const{gen:t,schema:r,validateName:n}=e;!1===r?Vp(e,!1):"object"==typeof r&&!0===r.$async?t.return(Wp.default.data):(t.assign(Jp._`${n}.errors`,null),t.return(!0))},Dp.boolOrEmptySchema=function(e,t){const{gen:r,schema:n}=e;!1===n?(r.var(t,!1),Vp(e)):r.var(t,!0)};var Zp={},Xp={};Object.defineProperty(Xp,"__esModule",{value:!0}),Xp.getRules=Xp.isJSONType=void 0;const Qp=new Set(["string","number","integer","boolean","null","object","array"]);Xp.isJSONType=function(e){return"string"==typeof e&&Qp.has(e)},Xp.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 Yp={};function em(e,t){return t.rules.some((t=>tm(e,t)))}function tm(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(Yp,"__esModule",{value:!0}),Yp.shouldUseRule=Yp.shouldUseGroup=Yp.schemaHasRulesForType=void 0,Yp.schemaHasRulesForType=function({schema:e,self:t},r){const n=t.RULES.types[r];return n&&!0!==n&&em(e,n)},Yp.shouldUseGroup=em,Yp.shouldUseRule=tm,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=Xp,r=Yp,n=$p,i=Bp,o=Up;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}(Zp);var rm={};Object.defineProperty(rm,"__esModule",{value:!0}),rm.assignDefaults=void 0;const nm=Bp,im=Up;function om(e,t,r){const{gen:n,compositeRule:i,data:o,opts:a}=e;if(void 0===r)return;const s=nm._`${o}${(0,nm.getProperty)(t)}`;if(i)return void(0,im.checkStrictMode)(e,`default is ignored for: ${s}`);let c=nm._`${s} === undefined`;"empty"===a.useDefaults&&(c=nm._`${c} || ${s} === null || ${s} === ""`),n.if(c,nm._`${s} = ${(0,nm.stringify)(r)}`)}rm.assignDefaults=function(e,t){const{properties:r,items:n}=e.schema;if("object"===t&&r)for(const t in r)om(e,t,r[t].default);else"array"===t&&Array.isArray(n)&&n.forEach(((t,r)=>om(e,r,t.default)))};var am={},sm={};Object.defineProperty(sm,"__esModule",{value:!0}),sm.validateUnion=sm.validateArray=sm.usePattern=sm.callValidateCode=sm.schemaProperties=sm.allSchemaProperties=sm.noPropertyInData=sm.propertyInData=sm.isOwnProperty=sm.hasPropFunc=sm.reportMissingProp=sm.checkMissingProp=sm.checkReportMissingProp=void 0;const cm=Bp,um=Up,fm=Lp,dm=Up;function lm(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:cm._`Object.prototype.hasOwnProperty`})}function hm(e,t,r){return cm._`${lm(e)}.call(${t}, ${r})`}function pm(e,t,r,n){const i=cm._`${t}${(0,cm.getProperty)(r)} === undefined`;return n?(0,cm.or)(i,(0,cm.not)(hm(e,t,r))):i}function mm(e){return e?Object.keys(e).filter((e=>"__proto__"!==e)):[]}sm.checkReportMissingProp=function(e,t){const{gen:r,data:n,it:i}=e;r.if(pm(r,n,t,i.opts.ownProperties),(()=>{e.setParams({missingProperty:cm._`${t}`},!0),e.error()}))},sm.checkMissingProp=function({gen:e,data:t,it:{opts:r}},n,i){return(0,cm.or)(...n.map((n=>(0,cm.and)(pm(e,t,n,r.ownProperties),cm._`${i} = ${n}`))))},sm.reportMissingProp=function(e,t){e.setParams({missingProperty:t},!0),e.error()},sm.hasPropFunc=lm,sm.isOwnProperty=hm,sm.propertyInData=function(e,t,r,n){const i=cm._`${t}${(0,cm.getProperty)(r)} !== undefined`;return n?cm._`${i} && ${hm(e,t,r)}`:i},sm.noPropertyInData=pm,sm.allSchemaProperties=mm,sm.schemaProperties=function(e,t){return mm(t).filter((r=>!(0,um.alwaysValidSchema)(e,t[r])))},sm.callValidateCode=function({schemaCode:e,data:t,it:{gen:r,topSchemaRef:n,schemaPath:i,errorPath:o},it:a},s,c,u){const f=u?cm._`${e}, ${t}, ${n}${i}`:t,d=[[fm.default.instancePath,(0,cm.strConcat)(fm.default.instancePath,o)],[fm.default.parentData,a.parentData],[fm.default.parentDataProperty,a.parentDataProperty],[fm.default.rootData,fm.default.rootData]];a.opts.dynamicRef&&d.push([fm.default.dynamicAnchors,fm.default.dynamicAnchors]);const l=cm._`${f}, ${r.object(...d)}`;return c!==cm.nil?cm._`${s}.call(${c}, ${l})`:cm._`${s}(${l})`};const gm=cm._`new RegExp`;sm.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:cm._`${"new RegExp"===i.code?gm:(0,dm.useFunc)(e,i)}(${r}, ${n})`})},sm.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",cm._`${r}.length`);t.forRange("i",0,a,(r=>{e.subschema({keyword:n,dataProp:r,dataPropType:um.Type.Num},o),t.if((0,cm.not)(o),i)}))}},sm.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,um.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,cm._`${o} || ${a}`);e.mergeValidEvaluated(s,a)||t.if((0,cm.not)(o))})))),e.result(o,(()=>e.reset()),(()=>e.error(!0)))},Object.defineProperty(am,"__esModule",{value:!0}),am.validateKeywordUsage=am.validSchemaType=am.funcKeywordCode=am.macroKeywordCode=void 0;const ym=Bp,bm=Lp,vm=sm,wm=$p;function Am(e){const{gen:t,data:r,it:n}=e;t.if(n.parentData,(()=>t.assign(r,ym._`${n.parentData}[${n.parentDataProperty}]`)))}function _m(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,ym.stringify)(r)})}am.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=_m(r,n,s);!1!==a.opts.validateSchema&&a.self.validateSchema(s,!0);const u=r.name("valid");e.subschema({schema:s,schemaPath:ym.nil,errSchemaPath:`${a.errSchemaPath}/${n}`,topSchemaRef:c,compositeRule:!0},u),e.pass(u,(()=>e.error(!0)))},am.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=_m(n,i,u),d=n.let("valid");function l(r=(t.async?ym._`await `:ym.nil)){const i=c.opts.passContext?bm.default.this:bm.default.self,o=!("compile"in t&&!s||!1===t.schema);n.assign(d,ym._`${r}${(0,vm.callValidateCode)(e,f,i,o)}`,t.modifying)}function h(e){var r;n.if((0,ym.not)(null!==(r=t.valid)&&void 0!==r?r:d),e)}e.block$data(d,(function(){if(!1===t.errors)l(),t.modifying&&Am(e),h((()=>e.error()));else{const r=t.async?function(){const e=n.let("ruleErrs",null);return n.try((()=>l(ym._`await `)),(t=>n.assign(d,!1).if(ym._`${t} instanceof ${c.ValidationError}`,(()=>n.assign(e,ym._`${t}.errors`)),(()=>n.throw(t))))),e}():function(){const e=ym._`${f}.errors`;return n.assign(e,null),l(ym.nil),e}();t.modifying&&Am(e),h((()=>function(e,t){const{gen:r}=e;r.if(ym._`Array.isArray(${t})`,(()=>{r.assign(bm.default.vErrors,ym._`${bm.default.vErrors} === null ? ${t} : ${bm.default.vErrors}.concat(${t})`).assign(bm.default.errors,ym._`${bm.default.vErrors}.length`),(0,wm.extendErrors)(e)}),(()=>e.error()))}(e,r)))}})),e.ok(null!==(r=t.valid)&&void 0!==r?r:d)},am.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))},am.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 Em={};Object.defineProperty(Em,"__esModule",{value:!0}),Em.extendSubschemaMode=Em.extendSubschemaData=Em.getSubschema=void 0;const Sm=Bp,Pm=Up;Em.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:Sm._`${e.schemaPath}${(0,Sm.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:n[r],schemaPath:Sm._`${e.schemaPath}${(0,Sm.getProperty)(t)}${(0,Sm.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,Pm.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')},Em.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",Sm._`${t.data}${(0,Sm.getProperty)(r)}`,!0)),e.errorPath=Sm.str`${i}${(0,Pm.getErrorPath)(r,n,a.jsPropertySyntax)}`,e.parentDataProperty=Sm._`${r}`,e.dataPathArr=[...o,e.parentDataProperty]}if(void 0!==i){c(i instanceof Sm.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)},Em.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 xm={},km=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},Mm={},Cm={get exports(){return Mm},set exports(e){Mm=e}}.exports=function(e,t,r){"function"==typeof t&&(r=t,t={}),Im(t,"function"==typeof(r=t.cb||r)?r:r.pre||function(){},r.post||function(){},e,"",e)};function Im(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 Cm.arrayKeywords)for(var l=0;lt+=$m(e))),t===1/0))return 1/0}return t}function Bm(e,t="",r){!1!==r&&(t=Um(t));const n=e.parse(t);return Fm(e,n)}function Fm(e,t){return e.serialize(t).split("#")[0]+"#"}xm.getFullPath=Bm,xm._getFullPath=Fm;const zm=/#\/?$/;function Um(e){return e?e.replace(zm,""):""}xm.normalizeId=Um,xm.resolveUrl=function(e,t,r){return r=Um(r),e.resolve(t,r)};const Lm=/^[a-z_][-a-z0-9._]*$/i;xm.getSchemaRefs=function(e,t){if("boolean"==typeof e)return{};const{schemaId:r,uriResolver:n}=this.opts,i=Um(e[r]||t),o={"":i},a=Bm(n,i,!1),s={},c=new Set;return Om(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=Um(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!==Um(d)&&("#"===t[0]?(u(e,s[t],t),s[t]=e):this.refs[t]=d),t}function p(e){if("string"==typeof e){if(!Lm.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&&!Nm(e,t))throw f(r)}function f(e){return new Error(`reference "${e}" resolves to more than one schema`)}},Object.defineProperty(jp,"__esModule",{value:!0}),jp.getData=jp.KeywordCxt=jp.validateFunctionCode=void 0;const qm=Dp,Hm=Zp,Km=Yp,Jm=Zp,Wm=rm,Gm=am,Vm=Em,Zm=Bp,Xm=Lp,Qm=xm,Ym=Up,eg=$p;function tg({gen:e,validateName:t,schema:r,schemaEnv:n,opts:i},o){i.code.es5?e.func(t,Zm._`${Xm.default.data}, ${Xm.default.valCxt}`,n.$async,(()=>{e.code(Zm._`"use strict"; ${rg(r,i)}`),function(e,t){e.if(Xm.default.valCxt,(()=>{e.var(Xm.default.instancePath,Zm._`${Xm.default.valCxt}.${Xm.default.instancePath}`),e.var(Xm.default.parentData,Zm._`${Xm.default.valCxt}.${Xm.default.parentData}`),e.var(Xm.default.parentDataProperty,Zm._`${Xm.default.valCxt}.${Xm.default.parentDataProperty}`),e.var(Xm.default.rootData,Zm._`${Xm.default.valCxt}.${Xm.default.rootData}`),t.dynamicRef&&e.var(Xm.default.dynamicAnchors,Zm._`${Xm.default.valCxt}.${Xm.default.dynamicAnchors}`)}),(()=>{e.var(Xm.default.instancePath,Zm._`""`),e.var(Xm.default.parentData,Zm._`undefined`),e.var(Xm.default.parentDataProperty,Zm._`undefined`),e.var(Xm.default.rootData,Xm.default.data),t.dynamicRef&&e.var(Xm.default.dynamicAnchors,Zm._`{}`)}))}(e,i),e.code(o)})):e.func(t,Zm._`${Xm.default.data}, ${function(e){return Zm._`{${Xm.default.instancePath}="", ${Xm.default.parentData}, ${Xm.default.parentDataProperty}, ${Xm.default.rootData}=${Xm.default.data}${e.dynamicRef?Zm._`, ${Xm.default.dynamicAnchors}={}`:Zm.nil}}={}`}(i)}`,n.$async,(()=>e.code(rg(r,i)).code(o)))}function rg(e,t){const r="object"==typeof e&&e[t.schemaId];return r&&(t.code.source||t.code.process)?Zm._`/*# sourceURL=${r} */`:Zm.nil}function ng(e,t){og(e)&&(ag(e),ig(e))?function(e,t){const{schema:r,gen:n,opts:i}=e;i.$comment&&r.$comment&&cg(e);(function(e){const t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,Qm.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",Xm.default.errors);sg(e,o),n.var(t,Zm._`${o} === ${Xm.default.errors}`)}(e,t):(0,qm.boolOrEmptySchema)(e,t)}function ig({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 og(e){return"boolean"!=typeof e.schema}function ag(e){(0,Ym.checkUnknownRules)(e),function(e){const{schema:t,errSchemaPath:r,opts:n,self:i}=e;t.$ref&&n.ignoreKeywordsWithRef&&(0,Ym.schemaHasRulesButRef)(t,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}(e)}function sg(e,t){if(e.opts.jtd)return ug(e,[],!1,t);const r=(0,Hm.getSchemaTypes)(e.schema);ug(e,r,!(0,Hm.coerceAndCheckDataType)(e,r),t)}function cg({gen:e,schemaEnv:t,schema:r,errSchemaPath:n,opts:i}){const o=r.$comment;if(!0===i.$comment)e.code(Zm._`${Xm.default.self}.logger.log(${o})`);else if("function"==typeof i.$comment){const r=Zm.str`${n}/$comment`,i=e.scopeValue("root",{ref:t.root});e.code(Zm._`${Xm.default.self}.opts.$comment(${o}, ${r}, ${i}.schema)`)}}function ug(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,Km.shouldUseGroup)(o,u)&&(u.type?(i.if((0,Jm.checkDataType)(u.type,a,c.strictNumbers)),fg(e,u),1===t.length&&t[0]===u.type&&r&&(i.else(),(0,Jm.reportTypeError)(e)),i.endIf()):fg(e,u),s||i.if(Zm._`${Xm.default.errors} === ${n||0}`))}!o.$ref||!c.ignoreKeywordsWithRef&&(0,Ym.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=>{lg(e.dataTypes,t)||hg(e,`type "${t}" not allowed by context "${e.dataTypes.join(",")}"`)})),function(e,t){const r=[];for(const n of e.dataTypes)lg(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"))&&hg(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,Km.shouldUseRule)(e.schema,i)){const{type:r}=i.definition;r.length&&!r.some((e=>dg(t,e)))&&hg(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((()=>mg(e,"$ref",f.all.$ref.definition)))}function fg(e,t){const{gen:r,schema:n,opts:{useDefaults:i}}=e;i&&(0,Wm.assignDefaults)(e,t.type),r.block((()=>{for(const r of t.rules)(0,Km.shouldUseRule)(n,r)&&mg(e,r.keyword,r.definition,t.type)}))}function dg(e,t){return e.includes(t)||"number"===t&&e.includes("integer")}function lg(e,t){return e.includes(t)||"integer"===t&&e.includes("number")}function hg(e,t){t+=` at "${e.schemaEnv.baseId+e.errSchemaPath}" (strictTypes)`,(0,Ym.checkStrictMode)(e,t,e.opts.strictTypes)}jp.validateFunctionCode=function(e){og(e)&&(ag(e),ig(e))?function(e){const{schema:t,opts:r,gen:n}=e;tg(e,(()=>{r.$comment&&t.$comment&&cg(e),function(e){const{schema:t,opts:r}=e;void 0!==t.default&&r.useDefaults&&r.strictSchema&&(0,Ym.checkStrictMode)(e,"default is ignored in the schema root")}(e),n.let(Xm.default.vErrors,null),n.let(Xm.default.errors,0),r.unevaluated&&function(e){const{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",Zm._`${r}.evaluated`),t.if(Zm._`${e.evaluated}.dynamicProps`,(()=>t.assign(Zm._`${e.evaluated}.props`,Zm._`undefined`))),t.if(Zm._`${e.evaluated}.dynamicItems`,(()=>t.assign(Zm._`${e.evaluated}.items`,Zm._`undefined`)))}(e),sg(e),function(e){const{gen:t,schemaEnv:r,validateName:n,ValidationError:i,opts:o}=e;r.$async?t.if(Zm._`${Xm.default.errors} === 0`,(()=>t.return(Xm.default.data)),(()=>t.throw(Zm._`new ${i}(${Xm.default.vErrors})`))):(t.assign(Zm._`${n}.errors`,Xm.default.vErrors),o.unevaluated&&function({gen:e,evaluated:t,props:r,items:n}){r instanceof Zm.Name&&e.assign(Zm._`${t}.props`,r);n instanceof Zm.Name&&e.assign(Zm._`${t}.items`,n)}(e),t.return(Zm._`${Xm.default.errors} === 0`))}(e)}))}(e):tg(e,(()=>(0,qm.topBoolOrEmptySchema)(e)))};class pg{constructor(e,t,r){if((0,Gm.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,Ym.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",bg(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,Gm.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",Xm.default.errors))}result(e,t,r){this.failResult((0,Zm.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,Zm.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(Zm._`${t} !== undefined && (${(0,Zm.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?eg.reportExtraError:eg.reportError)(this,this.def.error,t)}$dataError(){(0,eg.reportError)(this,this.def.$dataError||eg.keyword$DataError)}reset(){if(void 0===this.errsCount)throw new Error('add "trackErrors" to keyword definition');(0,eg.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=Zm.nil){this.gen.block((()=>{this.check$data(e,r),t()}))}check$data(e=Zm.nil,t=Zm.nil){if(!this.$data)return;const{gen:r,schemaCode:n,schemaType:i,def:o}=this;r.if((0,Zm.or)(Zm._`${n} === undefined`,t)),e!==Zm.nil&&r.assign(e,!0),(i.length||o.validateSchema)&&(r.elseIf(this.invalid$data()),this.$dataError(),e!==Zm.nil&&r.assign(e,!1)),r.else()}invalid$data(){const{gen:e,schemaCode:t,schemaType:r,def:n,it:i}=this;return(0,Zm.or)(function(){if(r.length){if(!(t instanceof Zm.Name))throw new Error("ajv implementation error");const e=Array.isArray(r)?r:[r];return Zm._`${(0,Jm.checkDataTypes)(e,t,i.opts.strictNumbers,Jm.DataType.Wrong)}`}return Zm.nil}(),function(){if(n.validateSchema){const r=e.scopeValue("validate$data",{ref:n.validateSchema});return Zm._`!${r}(${t})`}return Zm.nil}())}subschema(e,t){const r=(0,Vm.getSubschema)(this.it,e);(0,Vm.extendSubschemaData)(r,this.it,e),(0,Vm.extendSubschemaMode)(r,e);const n={...this.it,...r,items:void 0,props:void 0};return ng(n,t),n}mergeEvaluated(e,t){const{it:r,gen:n}=this;r.opts.unevaluated&&(!0!==r.props&&void 0!==e.props&&(r.props=Ym.mergeEvaluated.props(n,e.props,r.props,t)),!0!==r.items&&void 0!==e.items&&(r.items=Ym.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,Zm.Name))),!0}}function mg(e,t,r,n){const i=new pg(e,r,t);"code"in r?r.code(i,n):i.$data&&r.validate?(0,Gm.funcKeywordCode)(i,r):"macro"in r?(0,Gm.macroKeywordCode)(i,r):(r.compile||r.validate)&&(0,Gm.funcKeywordCode)(i,r)}jp.KeywordCxt=pg;const gg=/^\/(?:[^~]|~0|~1)*$/,yg=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function bg(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let i,o;if(""===e)return Xm.default.rootData;if("/"===e[0]){if(!gg.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);i=e,o=Xm.default.rootData}else{const a=yg.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=Zm._`${o}${(0,Zm.getProperty)((0,Ym.unescapeJsonPointer)(e))}`,a=Zm._`${a} && ${o}`);return a;function c(e,r){return`Cannot access ${e} ${r} levels up, current level is ${t}`}}jp.getData=bg;var vg={};Object.defineProperty(vg,"__esModule",{value:!0});class wg extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}}vg.default=wg;var Ag={};Object.defineProperty(Ag,"__esModule",{value:!0});const _g=xm;class Eg extends Error{constructor(e,t,r,n){super(n||`can't resolve reference ${r} from id ${t}`),this.missingRef=(0,_g.resolveUrl)(e,t,r),this.missingSchema=(0,_g.normalizeId)((0,_g.getFullPath)(e,this.missingRef))}}Ag.default=Eg;var Sg={};Object.defineProperty(Sg,"__esModule",{value:!0}),Sg.resolveSchema=Sg.getCompilingSchema=Sg.resolveRef=Sg.compileSchema=Sg.SchemaEnv=void 0;const Pg=Bp,xg=vg,kg=Lp,Mg=xm,Cg=Up,Ig=jp;class Rg{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,Mg.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 Ng(e){const t=Tg.call(this,e);if(t)return t;const r=(0,Mg.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:n,lines:i}=this.opts.code,{ownProperties:o}=this.opts,a=new Pg.CodeGen(this.scope,{es5:n,lines:i,ownProperties:o});let s;e.$async&&(s=a.scopeValue("Error",{ref:xg.default,code:Pg._`require("ajv/dist/runtime/validation_error").default`}));const c=a.scopeName("validate");e.validateName=c;const u={gen:a,allErrors:this.opts.allErrors,data:kg.default.data,parentData:kg.default.parentData,parentDataProperty:kg.default.parentDataProperty,dataNames:[kg.default.data],dataPathArr:[Pg.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:a.scopeValue("schema",!0===this.opts.code.source?{ref:e.schema,code:(0,Pg.stringify)(e.schema)}:{ref:e.schema}),validateName:c,ValidationError:s,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:Pg.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:Pg._`""`,opts:this.opts,self:this};let f;try{this._compilations.add(e),(0,Ig.validateFunctionCode)(u),a.optimize(this.opts.code.optimize);const t=a.toString();f=`${a.scopeRefs(kg.default.scope)}return ${t}`,this.opts.code.process&&(f=this.opts.code.process(f,e));const r=new Function(`${kg.default.self}`,`${kg.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 Pg.Name?void 0:e,items:t instanceof Pg.Name?void 0:t,dynamicProps:e instanceof Pg.Name,dynamicItems:t instanceof Pg.Name},r.source&&(r.source.evaluated=(0,Pg.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 Og(e){return(0,Mg.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:Ng.call(this,e)}function Tg(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 jg(e,t){let r;for(;"string"==typeof(r=this.refs[t]);)t=r;return r||this.schemas[t]||Dg.call(this,e,t)}function Dg(e,t){const r=this.opts.uriResolver.parse(t),n=(0,Mg._getFullPath)(this.opts.uriResolver,r);let i=(0,Mg.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===i)return Bg.call(this,r,e);const o=(0,Mg.normalizeId)(n),a=this.refs[o]||this.schemas[o];if("string"==typeof a){const t=Dg.call(this,e,a);if("object"!=typeof(null==t?void 0:t.schema))return;return Bg.call(this,r,t)}if("object"==typeof(null==a?void 0:a.schema)){if(a.validate||Ng.call(this,a),o===(0,Mg.normalizeId)(t)){const{schema:t}=a,{schemaId:r}=this.opts,n=t[r];return n&&(i=(0,Mg.resolveUrl)(this.opts.uriResolver,i,n)),new Rg({schema:t,schemaId:r,root:e,baseId:i})}return Bg.call(this,r,a)}}Sg.SchemaEnv=Rg,Sg.compileSchema=Ng,Sg.resolveRef=function(e,t,r){var n;r=(0,Mg.resolveUrl)(this.opts.uriResolver,t,r);const i=e.refs[r];if(i)return i;let o=jg.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 Rg({schema:i,schemaId:a,root:e,baseId:t}))}return void 0!==o?e.refs[r]=Og.call(this,o):void 0},Sg.getCompilingSchema=Tg,Sg.resolveSchema=Dg;const $g=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Bg(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,Cg.unescapeFragment)(n)];if(void 0===e)return;const i="object"==typeof(r=e)&&r[this.opts.schemaId];!$g.has(n)&&i&&(t=(0,Mg.resolveUrl)(this.opts.uriResolver,t,i))}let o;if("boolean"!=typeof r&&r.$ref&&!(0,Cg.schemaHasRulesButRef)(r,this.RULES)){const e=(0,Mg.resolveUrl)(this.opts.uriResolver,t,r.$ref);o=Dg.call(this,n,e)}const{schemaId:a}=this.opts;return o=o||new Rg({schema:r,schemaId:a,root:n,baseId:t}),o.schema!==o.root.schema?o:void 0}var Fg={$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},zg={},Ug={}; -/** @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]}}}(Tp);var qg={},Hg={},Kg={};Object.defineProperty(Kg,"__esModule",{value:!0}),Kg.callRef=Kg.getValidate=void 0;const Jg=Ag,Wg=sm,Gg=Bp,Vg=Lp,Zg=Sg,Xg=Up,Qg={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 ey(e,a,o,o.$async);const r=t.scopeValue("root",{ref:u});return ey(e,Gg._`${r}.validate`,u,u.$async)}();const f=Zg.resolveRef.call(c,u,i,r);if(void 0===f)throw new Jg.default(n.opts.uriResolver,i,r);return f instanceof Zg.SchemaEnv?function(t){const r=Yg(e,t);ey(e,r,t,t.$async)}(f):function(n){const i=t.scopeValue("schema",!0===s.code.source?{ref:n,code:(0,Gg.stringify)(n)}:{ref:n}),o=t.name("valid"),a=e.subschema({schema:n,dataTypes:[],schemaPath:Gg.nil,topSchemaRef:i,errSchemaPath:r},o);e.mergeEvaluated(a),e.ok(o)}(f)}};function Yg(e,t){const{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):Gg._`${r.scopeValue("wrapper",{ref:t})}.validate`}function ey(e,t,r,n){const{gen:i,it:o}=e,{allErrors:a,schemaEnv:s,opts:c}=o,u=c.passContext?Vg.default.this:Gg.nil;function f(e){const t=Gg._`${e}.errors`;i.assign(Vg.default.vErrors,Gg._`${Vg.default.vErrors} === null ? ${t} : ${Vg.default.vErrors}.concat(${t})`),i.assign(Vg.default.errors,Gg._`${Vg.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=Xg.mergeEvaluated.props(i,n.props,o.props));else{const t=i.var("props",Gg._`${e}.evaluated.props`);o.props=Xg.mergeEvaluated.props(i,t,o.props,Gg.Name)}if(!0!==o.items)if(n&&!n.dynamicItems)void 0!==n.items&&(o.items=Xg.mergeEvaluated.items(i,n.items,o.items));else{const t=i.var("items",Gg._`${e}.evaluated.items`);o.items=Xg.mergeEvaluated.items(i,t,o.items,Gg.Name)}}n?function(){if(!s.$async)throw new Error("async schema referenced by sync schema");const r=i.let("valid");i.try((()=>{i.code(Gg._`await ${(0,Wg.callValidateCode)(e,t,u)}`),d(t),a||i.assign(r,!0)}),(e=>{i.if(Gg._`!(${e} instanceof ${o.ValidationError})`,(()=>i.throw(e))),f(e),a||i.assign(r,!1)})),e.ok(r)}():e.result((0,Wg.callValidateCode)(e,t,u),(()=>d(t)),(()=>f(t)))}Kg.getValidate=Yg,Kg.callRef=ey,Kg.default=Qg,Object.defineProperty(Hg,"__esModule",{value:!0});const ty=["$schema","id","$defs",{keyword:"$comment"},"definitions",Kg.default];Hg.default=ty;var ry={},ny={};Object.defineProperty(ny,"__esModule",{value:!0});const iy=Tp,oy=Bp.operators,ay={maximum:{exclusive:"exclusiveMaximum",ops:[{okStr:"<=",ok:oy.LTE,fail:oy.GT},{okStr:"<",ok:oy.LT,fail:oy.GTE}]},minimum:{exclusive:"exclusiveMinimum",ops:[{okStr:">=",ok:oy.GTE,fail:oy.LT},{okStr:">",ok:oy.GT,fail:oy.LTE}]}},sy={message:e=>iy.str`must be ${uy(e).okStr} ${e.schemaCode}`,params:e=>iy._`{comparison: ${uy(e).okStr}, limit: ${e.schemaCode}}`},cy={keyword:Object.keys(ay),type:"number",schemaType:"number",$data:!0,error:sy,code(e){const{data:t,schemaCode:r}=e;e.fail$data(iy._`${t} ${uy(e).fail} ${r} || isNaN(${t})`)}};function uy(e){var t;const r=e.keyword,n=(null===(t=e.parentSchema)||void 0===t?void 0:t[ay[r].exclusive])?1:0;return ay[r].ops[n]}ny.default=cy;var fy={};Object.defineProperty(fy,"__esModule",{value:!0});const dy={exclusiveMaximum:"maximum",exclusiveMinimum:"minimum"},ly={keyword:Object.keys(dy),type:"number",schemaType:"boolean",code({keyword:e,parentSchema:t}){const r=dy[e];if(void 0===t[r])throw new Error(`${e} can only be used with ${r}`)}};fy.default=ly;var hy={};Object.defineProperty(hy,"__esModule",{value:!0});const py=Bp,my={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:e})=>py.str`must be multiple of ${e}`,params:({schemaCode:e})=>py._`{multipleOf: ${e}}`},code(e){const{gen:t,data:r,schemaCode:n,it:i}=e,o=i.opts.multipleOfPrecision,a=t.let("res"),s=o?py._`Math.abs(Math.round(${a}) - ${a}) > 1e-${o}`:py._`${a} !== parseInt(${a})`;e.fail$data(py._`(${n} === 0 || (${a} = ${r}/${n}, ${s}))`)}};hy.default=my;var gy={},yy={};function by(e){const t=e.length;let r,n=0,i=0;for(;i=55296&&r<=56319&&ivy.str`must NOT have ${"maxLength"===e?"more":"fewer"} than ${t} characters`,params:({schemaCode:e})=>vy._`{limit: ${e}}`},Ey={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:_y,code(e){const{keyword:t,data:r,schemaCode:n,it:i}=e,o="maxLength"===t?vy.operators.GT:vy.operators.LT,a=!1===i.opts.unicode?vy._`${r}.length`:vy._`${(0,wy.useFunc)(e.gen,Ay.default)}(${r})`;e.fail$data(vy._`${a} ${o} ${n}`)}};gy.default=Ey;var Sy={};Object.defineProperty(Sy,"__esModule",{value:!0});const Py=sm,xy=Bp,ky={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>xy.str`must match pattern "${e}"`,params:({schemaCode:e})=>xy._`{pattern: ${e}}`},code(e){const{data:t,$data:r,schema:n,schemaCode:i,it:o}=e,a=o.opts.unicodeRegExp?"u":"",s=r?xy._`(new RegExp(${i}, ${a}))`:(0,Py.usePattern)(e,n);e.fail$data(xy._`!${s}.test(${t})`)}};Sy.default=ky;var My={};Object.defineProperty(My,"__esModule",{value:!0});const Cy=Bp,Iy={message:({keyword:e,schemaCode:t})=>Cy.str`must NOT have ${"maxProperties"===e?"more":"fewer"} than ${t} properties`,params:({schemaCode:e})=>Cy._`{limit: ${e}}`},Ry={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:Iy,code(e){const{keyword:t,data:r,schemaCode:n}=e,i="maxProperties"===t?Cy.operators.GT:Cy.operators.LT;e.fail$data(Cy._`Object.keys(${r}).length ${i} ${n}`)}};My.default=Ry;var Ny={};Object.defineProperty(Ny,"__esModule",{value:!0});const Oy=sm,Ty=Bp,jy=Up,Dy={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:e}})=>Ty.str`must have required property '${e}'`,params:({params:{missingProperty:e}})=>Ty._`{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(Ty.nil,u);else for(const t of r)(0,Oy.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,Oy.propertyInData)(t,i,r,s.ownProperties)),t.if((0,Ty.not)(o),(()=>{e.error(),t.break()}))}),Ty.nil)}(a,r))),e.ok(r)}else t.if((0,Oy.checkMissingProp)(e,r,a)),(0,Oy.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,jy.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,Oy.noPropertyInData)(t,i,r,s.ownProperties),(()=>e.error()))}))}}};Ny.default=Dy;var $y={};Object.defineProperty($y,"__esModule",{value:!0});const By=Bp,Fy={message:({keyword:e,schemaCode:t})=>By.str`must NOT have ${"maxItems"===e?"more":"fewer"} than ${t} items`,params:({schemaCode:e})=>By._`{limit: ${e}}`},zy={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:Fy,code(e){const{keyword:t,data:r,schemaCode:n}=e,i="maxItems"===t?By.operators.GT:By.operators.LT;e.fail$data(By._`${r}.length ${i} ${n}`)}};$y.default=zy;var Uy={},Ly={};Object.defineProperty(Ly,"__esModule",{value:!0});const qy=km;qy.code='require("ajv/dist/runtime/equal").default',Ly.default=qy,Object.defineProperty(Uy,"__esModule",{value:!0});const Hy=Zp,Ky=Bp,Jy=Up,Wy=Ly,Gy={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:e,j:t}})=>Ky.str`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>Ky._`{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,Hy.getSchemaTypes)(o.items):[];function f(n,i){const o=t.name("item"),a=(0,Hy.checkDataTypes)(u,o,s.opts.strictNumbers,Hy.DataType.Wrong),f=t.const("indices",Ky._`{}`);t.for(Ky._`;${n}--;`,(()=>{t.let(o,Ky._`${r}[${n}]`),t.if(a,Ky._`continue`),u.length>1&&t.if(Ky._`typeof ${o} == "string"`,Ky._`${o} += "_"`),t.if(Ky._`typeof ${f}[${o}] == "number"`,(()=>{t.assign(i,Ky._`${f}[${o}]`),e.error(),t.assign(c,!1).break()})).code(Ky._`${f}[${o}] = ${n}`)}))}function d(n,i){const o=(0,Jy.useFunc)(t,Wy.default),a=t.name("outer");t.label(a).for(Ky._`;${n}--;`,(()=>t.for(Ky._`${i} = ${n}; ${i}--;`,(()=>t.if(Ky._`${o}(${r}[${n}], ${r}[${i}])`,(()=>{e.error(),t.assign(c,!1).break(a)}))))))}e.block$data(c,(function(){const n=t.let("i",Ky._`${r}.length`),i=t.let("j");e.setParams({i:n,j:i}),t.assign(c,!0),t.if(Ky._`${n} > 1`,(()=>(u.length>0&&!u.some((e=>"object"===e||"array"===e))?f:d)(n,i)))}),Ky._`${a} === false`),e.ok(c)}};Uy.default=Gy;var Vy={};Object.defineProperty(Vy,"__esModule",{value:!0});const Zy=Bp,Xy=Up,Qy=Ly,Yy={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:e})=>Zy._`{allowedValue: ${e}}`},code(e){const{gen:t,data:r,$data:n,schemaCode:i,schema:o}=e;n||o&&"object"==typeof o?e.fail$data(Zy._`!${(0,Xy.useFunc)(t,Qy.default)}(${r}, ${i})`):e.fail(Zy._`${o} !== ${r}`)}};Vy.default=Yy;var eb={};Object.defineProperty(eb,"__esModule",{value:!0});const tb=Bp,rb=Up,nb=Ly,ib={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:e})=>tb._`{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,rb.useFunc)(t,nb.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(tb._`${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,tb.or)(...i.map(((t,n)=>function(e,t){const n=i[t];return"object"==typeof n&&null!==n?tb._`${u()}(${r}, ${e}[${t}])`:tb._`${r} === ${n}`}(e,n))))}e.pass(f)}};eb.default=ib,Object.defineProperty(ry,"__esModule",{value:!0});const ob=fy,ab=hy,sb=gy,cb=Sy,ub=My,fb=Ny,db=$y,lb=Uy,hb=Vy,pb=eb,mb=[ny.default,ob.default,ab.default,sb.default,cb.default,ub.default,fb.default,db.default,lb.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},hb.default,pb.default];ry.default=mb;var gb={},yb={};Object.defineProperty(yb,"__esModule",{value:!0}),yb.validateAdditionalItems=void 0;const bb=Bp,vb=Up,wb={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:e}})=>bb.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>bb._`{limit: ${e}}`},code(e){const{parentSchema:t,it:r}=e,{items:n}=t;Array.isArray(n)?Ab(e,n):(0,vb.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas')}};function Ab(e,t){const{gen:r,schema:n,data:i,keyword:o,it:a}=e;a.items=!0;const s=r.const("len",bb._`${i}.length`);if(!1===n)e.setParams({len:t.length}),e.pass(bb._`${s} <= ${t.length}`);else if("object"==typeof n&&!(0,vb.alwaysValidSchema)(a,n)){const n=r.var("valid",bb._`${s} <= ${t.length}`);r.if((0,bb.not)(n),(()=>function(n){r.forRange("i",t.length,s,(t=>{e.subschema({keyword:o,dataProp:t,dataPropType:vb.Type.Num},n),a.allErrors||r.if((0,bb.not)(n),(()=>r.break()))}))}(n))),e.ok(n)}}yb.validateAdditionalItems=Ab,yb.default=wb;var _b={},Eb={};Object.defineProperty(Eb,"__esModule",{value:!0}),Eb.validateTuple=void 0;const Sb=Bp,Pb=Up,xb=sm,kb={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){const{schema:t,it:r}=e;if(Array.isArray(t))return Mb(e,"additionalItems",t);r.items=!0,(0,Pb.alwaysValidSchema)(r,t)||e.ok((0,xb.validateArray)(e))}};function Mb(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,Pb.checkStrictMode)(s,e,n.strictTuples)}}(i),s.opts.unevaluated&&r.length&&!0!==s.items&&(s.items=Pb.mergeEvaluated.items(n,r.length,s.items));const c=n.name("valid"),u=n.const("len",Sb._`${o}.length`);r.forEach(((t,r)=>{(0,Pb.alwaysValidSchema)(s,t)||(n.if(Sb._`${u} > ${r}`,(()=>e.subschema({keyword:a,schemaProp:r,dataProp:r},c))),e.ok(c))}))}Eb.validateTuple=Mb,Eb.default=kb,Object.defineProperty(_b,"__esModule",{value:!0});const Cb=Eb,Ib={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,Cb.validateTuple)(e,"items")};_b.default=Ib;var Rb={};Object.defineProperty(Rb,"__esModule",{value:!0});const Nb=Bp,Ob=Up,Tb=sm,jb=yb,Db={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:e}})=>Nb.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>Nb._`{limit: ${e}}`},code(e){const{schema:t,parentSchema:r,it:n}=e,{prefixItems:i}=r;n.items=!0,(0,Ob.alwaysValidSchema)(n,t)||(i?(0,jb.validateAdditionalItems)(e,i):e.ok((0,Tb.validateArray)(e)))}};Rb.default=Db;var $b={};Object.defineProperty($b,"__esModule",{value:!0});const Bb=Bp,Fb=Up,zb={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:e,max:t}})=>void 0===t?Bb.str`must contain at least ${e} valid item(s)`:Bb.str`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>void 0===t?Bb._`{minContains: ${e}}`:Bb._`{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",Bb._`${i}.length`);if(e.setParams({min:a,max:s}),void 0===s&&0===a)return void(0,Fb.checkStrictMode)(o,'"minContains" == 0 without "maxContains": "contains" keyword ignored');if(void 0!==s&&a>s)return(0,Fb.checkStrictMode)(o,'"minContains" > "maxContains" is always invalid'),void e.fail();if((0,Fb.alwaysValidSchema)(o,r)){let t=Bb._`${f} >= ${a}`;return void 0!==s&&(t=Bb._`${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(Bb._`${e}++`),void 0===s?t.if(Bb._`${e} >= ${a}`,(()=>t.assign(d,!0).break())):(t.if(Bb._`${e} > ${s}`,(()=>t.assign(d,!1).break())),1===a?t.assign(d,!0):t.if(Bb._`${e} >= ${a}`,(()=>t.assign(d,!0))))}(r)))))}function h(r,n){t.forRange("i",0,f,(t=>{e.subschema({keyword:"contains",dataProp:t,dataPropType:Fb.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(Bb._`${i}.length > 0`,l)):(t.let(d,!1),l()),e.result(d,(()=>e.reset()))}};$b.default=zb;var Ub={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const t=Bp,r=Up,n=sm;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}(Ub);var Lb={};Object.defineProperty(Lb,"__esModule",{value:!0});const qb=Bp,Hb=Up,Kb={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:e})=>qb._`{propertyName: ${e.propertyName}}`},code(e){const{gen:t,schema:r,data:n,it:i}=e;if((0,Hb.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,qb.not)(o),(()=>{e.error(!0),i.allErrors||t.break()}))})),e.ok(o)}};Lb.default=Kb;var Jb={};Object.defineProperty(Jb,"__esModule",{value:!0});const Wb=sm,Gb=Bp,Vb=Lp,Zb=Up,Xb={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:e})=>Gb._`{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,Zb.alwaysValidSchema)(a,r))return;const u=(0,Wb.allSchemaProperties)(n.properties),f=(0,Wb.allSchemaProperties)(n.patternProperties);function d(e){t.code(Gb._`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,Zb.alwaysValidSchema)(a,r)){const r=t.name("valid");"failing"===c.removeAdditional?(h(n,r,!1),t.if((0,Gb.not)(r),(()=>{e.reset(),d(n)}))):(h(n,r),s||t.if((0,Gb.not)(r),(()=>t.break())))}}}function h(t,r,n){const i={keyword:"additionalProperties",dataProp:t,dataPropType:Zb.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,Zb.schemaRefOrVal)(a,n.properties,"properties");i=(0,Wb.isOwnProperty)(t,e,r)}else i=u.length?(0,Gb.or)(...u.map((e=>Gb._`${r} === ${e}`))):Gb.nil;return f.length&&(i=(0,Gb.or)(i,...f.map((t=>Gb._`${(0,Wb.usePattern)(e,t)}.test(${r})`)))),(0,Gb.not)(i)}(r),(()=>l(r))):l(r)})),e.ok(Gb._`${o} === ${Vb.default.errors}`)}};Jb.default=Xb;var Qb={};Object.defineProperty(Qb,"__esModule",{value:!0});const Yb=jp,ev=sm,tv=Up,rv=Jb,nv={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&&rv.default.code(new Yb.KeywordCxt(o,rv.default,"additionalProperties"));const a=(0,ev.allSchemaProperties)(r);for(const e of a)o.definedProperties.add(e);o.opts.unevaluated&&a.length&&!0!==o.props&&(o.props=tv.mergeEvaluated.props(t,(0,tv.toHash)(a),o.props));const s=a.filter((e=>!(0,tv.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,ev.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)}}};Qb.default=nv;var iv={};Object.defineProperty(iv,"__esModule",{value:!0});const ov=sm,av=Bp,sv=Up,cv=Up,uv={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,ov.allSchemaProperties)(r),c=s.filter((e=>(0,sv.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 av.Name||(o.props=(0,cv.evaluatedPropsToName)(t,o.props));const{props:d}=o;function l(e){for(const t in u)new RegExp(e).test(t)&&(0,sv.checkStrictMode)(o,`property ${t} matches pattern ${e} (use allowMatchingProperties)`)}function h(r){t.forIn("key",n,(n=>{t.if(av._`${(0,ov.usePattern)(e,r)}.test(${n})`,(()=>{const i=c.includes(r);i||e.subschema({keyword:"patternProperties",schemaProp:r,dataProp:n,dataPropType:cv.Type.Str},f),o.opts.unevaluated&&!0!==d?t.assign(av._`${d}[${n}]`,!0):i||o.allErrors||t.if((0,av.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))}()}};iv.default=uv;var fv={};Object.defineProperty(fv,"__esModule",{value:!0});const dv=Up,lv={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){const{gen:t,schema:r,it:n}=e;if((0,dv.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"}};fv.default=lv;var hv={};Object.defineProperty(hv,"__esModule",{value:!0});const pv={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:sm.validateUnion,error:{message:"must match a schema in anyOf"}};hv.default=pv;var mv={};Object.defineProperty(mv,"__esModule",{value:!0});const gv=Bp,yv=Up,bv={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:e})=>gv._`{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,yv.alwaysValidSchema)(i,r)?t.var(c,!0):o=e.subschema({keyword:"oneOf",schemaProp:n,compositeRule:!0},c),n>0&&t.if(gv._`${c} && ${a}`).assign(a,!1).assign(s,gv._`[${s}, ${n}]`).else(),t.if(c,(()=>{t.assign(a,!0),t.assign(s,n),o&&e.mergeEvaluated(o,gv.Name)}))}))})),e.result(a,(()=>e.reset()),(()=>e.error(!0)))}};mv.default=bv;var vv={};Object.defineProperty(vv,"__esModule",{value:!0});const wv=Up,Av={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,wv.alwaysValidSchema)(n,t))return;const o=e.subschema({keyword:"allOf",schemaProp:r},i);e.ok(i),e.mergeEvaluated(o)}))}};vv.default=Av;var _v={};Object.defineProperty(_v,"__esModule",{value:!0});const Ev=Bp,Sv=Up,Pv={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:e})=>Ev.str`must match "${e.ifClause}" schema`,params:({params:e})=>Ev._`{failingKeyword: ${e.ifClause}}`},code(e){const{gen:t,parentSchema:r,it:n}=e;void 0===r.then&&void 0===r.else&&(0,Sv.checkStrictMode)(n,'"if" without "then" and "else" is ignored');const i=xv(n,"then"),o=xv(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,Ev.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,Ev._`${r}`):e.setParams({ifClause:r})}}e.pass(a,(()=>e.error(!0)))}};function xv(e,t){const r=e.schema[t];return void 0!==r&&!(0,Sv.alwaysValidSchema)(e,r)}_v.default=Pv;var kv={};Object.defineProperty(kv,"__esModule",{value:!0});const Mv=Up,Cv={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){void 0===t.if&&(0,Mv.checkStrictMode)(r,`"${e}" without "if" is ignored`)}};kv.default=Cv,Object.defineProperty(gb,"__esModule",{value:!0});const Iv=yb,Rv=_b,Nv=Eb,Ov=Rb,Tv=$b,jv=Ub,Dv=Lb,$v=Jb,Bv=Qb,Fv=iv,zv=fv,Uv=hv,Lv=mv,qv=vv,Hv=_v,Kv=kv;gb.default=function(e=!1){const t=[zv.default,Uv.default,Lv.default,qv.default,Hv.default,Kv.default,Dv.default,$v.default,jv.default,Bv.default,Fv.default];return e?t.push(Rv.default,Ov.default):t.push(Iv.default,Nv.default),t.push(Tv.default),t};var Jv={},Wv={};Object.defineProperty(Wv,"__esModule",{value:!0});const Gv=Bp,Vv={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>Gv.str`must match format "${e}"`,params:({schemaCode:e})=>Gv._`{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",Gv._`${i}[${a}]`),s=r.let("fType"),u=r.let("format");r.if(Gv._`typeof ${o} == "object" && !(${o} instanceof RegExp)`,(()=>r.assign(s,Gv._`${o}.type || "string"`).assign(u,Gv._`${o}.validate`)),(()=>r.assign(s,Gv._`"string"`).assign(u,o))),e.fail$data((0,Gv.or)(!1===c.strictSchema?Gv.nil:Gv._`${a} && !${u}`,function(){const e=f.$async?Gv._`(${o}.async ? await ${u}(${n}) : ${u}(${n}))`:Gv._`${u}(${n})`,r=Gv._`(typeof ${u} == "function" ? ${e} : ${u}.test(${n}))`;return Gv._`${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,Gv.regexpCode)(e):c.code.formats?Gv._`${c.code.formats}${(0,Gv.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,Gv._`${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 Gv._`await ${l}(${n})`}return"function"==typeof s?Gv._`${l}(${n})`:Gv._`${l}.test(${n})`}())}())}};Wv.default=Vv,Object.defineProperty(Jv,"__esModule",{value:!0});const Zv=[Wv.default];Jv.default=Zv,Object.defineProperty(qg,"__esModule",{value:!0});const Xv=ry,Qv=gb,Yv=Jv,ew=[Hg.default,Xv.default,Qv.default(),Yv.default,["title","description","default"]];qg.default=ew;var tw={},rw={};!function(e){var t;Object.defineProperty(e,"__esModule",{value:!0}),e.DiscrError=void 0,(t=e.DiscrError||(e.DiscrError={})).Tag="tag",t.Mapping="mapping"}(rw),Object.defineProperty(tw,"__esModule",{value:!0});const nw=Bp,iw=rw,ow=Sg,aw=Up,sw={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:e,tagName:t}})=>e===iw.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>nw._`{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",nw._`${r}${(0,nw.getProperty)(s)}`);function f(r){const n=t.name("valid"),i=e.subschema({keyword:"oneOf",schemaProp:r},n);return e.mergeEvaluated(i,nw.Name),n}t.if(nw._`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:iw.DiscrError.Tag,tag:u,tagName:s}))),e.ok(c)}};tw.default=sw;var cw={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=Tp,n=qg,i=tw,o=cw,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=Tp;Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return u.KeywordCxt}});var f=Tp;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}})}(Op,Np);var uw=f(Np),fw={},dw={get exports(){return fw},set exports(e){fw=e}},lw={};!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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){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:Pw.GTE,fail:Pw.LT},exclusiveMaximum:{okStr:"<",ok:Pw.LT,fail:Pw.GTE},exclusiveMinimum:{okStr:">",ok:Pw.GT,fail:Pw.LTE}},kw={message:({keyword:e,schemaCode:t})=>Sw.str`must be ${xw[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>Sw._`{comparison: ${xw[e].okStr}, limit: ${t}}`},Mw={keyword:Object.keys(xw),type:"number",schemaType:"number",$data:!0,error:kw,code(e){const{keyword:t,data:r,schemaCode:n}=e;e.fail$data(Sw._`${r} ${xw[t].fail} ${n} || isNaN(${r})`)}};Ew.default=Mw,Object.defineProperty(_w,"__esModule",{value:!0});const Cw=hy,Iw=gy,Rw=Sy,Nw=My,Ow=Ny,Tw=$y,jw=Uy,Dw=Vy,$w=eb,Bw=[Ew.default,Cw.default,Iw.default,Rw.default,Nw.default,Ow.default,Tw.default,jw.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},Dw.default,$w.default];_w.default=Bw;var Fw={};Object.defineProperty(Fw,"__esModule",{value:!0}),Fw.contentVocabulary=Fw.metadataVocabulary=void 0,Fw.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],Fw.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"],Object.defineProperty(gw,"__esModule",{value:!0});const zw=_w,Uw=gb,Lw=Jv,qw=Fw,Hw=[yw.default,zw.default,(0,Uw.default)(),Lw.default,qw.metadataVocabulary,qw.contentVocabulary];gw.default=Hw;var Kw={$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=Tp,n=gw,i=tw,o=Kw,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=jp;Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return u.KeywordCxt}});var f=Bp;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=vg;Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return d.default}});var l=Ag;Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return l.default}})}(mw,pw),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;const t=pw,r=Bp,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)}(hw),function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=lw,n=hw,i=Bp,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}(dw,fw);var Jw=f(fw),Ww={}; -/** - * @license - * Lodash - * Copyright OpenJS Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */ -!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)}({get exports(){return Ww},set exports(e){Ww=e}},Ww);var Gw=Ww,Vw={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 Zw(e){if(new Date(e).getTime()>0)return Number(e);throw new rn(new Error("invalid timestamp"),["invalid timestamp"])}async function Xw(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 no(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=Fh(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]!==Zw(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 Qw=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 Xw(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 Zi(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 io(t,this.agreement.hashAlg),!0,!1),{payload:o}=await Wi(e),a={...this.agreement,cipherblockDgst:i,blockCommitment:o.exchange.blockCommitment,secretCommitment:o.exchange.secretCommitment},s={proofType:"PoO",iss:"orig",exchange:{...a,id:await zh(a)}},c={timestamp:Date.now(),notBefore:"iat",notAfter:"iat",...r},u=await Lh(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 Uh(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 Lh(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(Gi(this.agreement.encAlg),this.agreement.ledgerSignerAddress,this.exchange.id,r);this.block.secret=await Vi(this.exchange.encAlg,n);try{eo(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 e=(await Ji(this.block.jwe,this.block.secret.jwk)).plaintext;if(n(await io(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 Wh("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 Hi(this.jwkPairDest.privateJwk);try{return await new Ui(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(e,t){const r=await Xw(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 rn("Resource has not been validated:\n"+e.join("\n"),t)}this.agreement=e,await Zi(this.jwkPairOrig.publicJwk,this.jwkPairOrig.privateJwk);const i=await Vi(this.agreement.encAlg);this.block={...this.block,secret:i,jwe:await Ki(this.block.raw,i.jwk,this.agreement.encAlg)};const o=n(await io(this.block.jwe,this.agreement.hashAlg),!0,!1),a=n(await io(this.block.raw,this.agreement.hashAlg),!0,!1),c=n(await io(new Uint8Array(s(this.block.secret.hex)),this.agreement.hashAlg),!0,!1),u={...this.agreement,cipherblockDgst:o,blockCommitment:a,secretCommitment:c},f=await zh(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!==ro(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 Uh({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 Lh(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 Uh(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 Wh("orig",this.exchange.id,this.block.por.jws,this.jwkPairOrig.privateJwk)}}});return e.ConflictResolution=Gh,e.ENC_ALGS=en,e.EthersIoAgentDest=ep,e.EthersIoAgentOrig=kp,e.HASH_ALGS=Qr,e.I3mServerWalletAgentDest=ip,e.I3mServerWalletAgentOrig=Cp,e.I3mWalletAgentDest=rp,e.I3mWalletAgentOrig=Mp,e.KEY_AGREEMENT_ALGS=tn,e.NonRepudiationProtocol=Qw,e.NrError=rn,e.SIGNING_ALGS=Yr,e.Signers=Ip,e.checkTimestamp=eo,e.createProof=Uh,e.defaultDltConfig=Vh,e.exchangeId=zh,e.generateKeys=async function(e,t,r){if(!Yr.includes(e))throw new rn(new RangeError(`Invalid signature algorithm '${e}''. Allowed algorithms are ${Yr.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 nn("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 Pf(r)}catch(e){throw new rn("no a DID or a valid public or private key",["invalid format"])}},e.importJwk=Hi,e.jsonSort=to,e.jweDecrypt=Ji,e.jweEncrypt=Ki,e.jwsDecode=Wi,e.oneTimeSecret=Vi,e.parseAddress=Fh,e.parseHex=ro,e.parseJwk=no,e.sha=io,e.validateDataExchange=async function(e){const t=[];try{const{id:r,...n}=e;r!==await zh(n)&&t.push(new rn("Invalid dataExchange id",["cannot verify","invalid format"]));const{blockCommitment:i,secretCommitment:o,cipherblockDgst:a,...s}=n,c=await Xw(s);c.length>0&&c.forEach((e=>{t.push(e)}))}catch(e){t.push(new rn("Invalid dataExchange",["cannot verify","invalid format"]))}return t},e.validateDataExchangeAgreement=Xw,e.validateDataSharingAgreementSchema=async function(e){const t=[],r=new uw({strictSchema:!1,removeAdditional:"all"});r.addMetaSchema(Vw),Jw(r);const n=Rp.schemas.DataSharingAgreement;try{const i=r.compile(n),o=Gw.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"]))})),Yi(o)!==Yi(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},e.verifyKeyPair=Zi,e.verifyProof=Lh,e}({}); diff --git a/dist/bundles/umd.js b/dist/bundles/umd.js deleted file mode 100644 index e8737fe..0000000 --- a/dist/bundles/umd.js +++ /dev/null @@ -1,27 +0,0 @@ -!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 g={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(g[e])return g[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 g[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)}(g);var 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=m,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,_={};function E(e){this.rand=e}if({get exports(){return _},set exports(e){_=e}}.exports=function(e){return A||(A=new E(null)),A.generate(e)},_.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 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 D(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 D(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)},$(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=m,K=T,J=N,W=p;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=m,Q=T,Y=N,ee=p.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=b,ce=T;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=b;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 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=p,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=ie,Sr=_,Pr=p.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=p,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=p,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=oe,Hr=ie,Kr=p,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,sn=async(e,t)=>{const r=`SHA-${e.slice(-3)}`;return new Uint8Array(await on.subtle.digest(r,t))},cn=new TextEncoder,un=new TextDecoder,fn=2**32;function dn(...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 ln(e,t,r){if(t<0||t>=fn)throw new RangeError(`value must be >= 0 and <= ${fn-1}. Received ${t}`);e.set([t>>>24,t>>>16,t>>>8,255&t],r)}function hn(e){const t=Math.floor(e/fn),r=e%fn,n=new Uint8Array(8);return ln(n,t,0),ln(n,r,4),n}function pn(e){const t=new Uint8Array(4);return ln(t,e),t}function mn(e){return dn(pn(e.length),e)}const gn=e=>(e=>{let t=e;"string"==typeof t&&(t=cn.encode(t));const r=[];for(let e=0;e{let t=e;t instanceof Uint8Array&&(t=un.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;eMn(new Uint8Array(Cn(e)>>3));const Rn=(e,t)=>{if(t.length<<3!==Cn(e))throw new Sn("Invalid Initialization Vector length")},Nn=(e,t)=>{const r=e.byteLength<<3;if(r!==t)throw new Sn(`Invalid Content Encryption Key length. Expected ${t} bits, got ${r} bits`)};function On(){return"undefined"!=typeof WebSocketPair||"undefined"!=typeof navigator&&"Cloudflare-Workers"===navigator.userAgent||"undefined"!=typeof EdgeRuntime&&"vercel"===EdgeRuntime}function Tn(e,t="algorithm.name"){return new TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`)}function jn(e,t){return e.name===t}function Dn(e){return parseInt(e.name.slice(4),10)}function $n(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 Bn(e,t,...r){switch(t){case"HS256":case"HS384":case"HS512":{if(!jn(e.algorithm,"HMAC"))throw Tn("HMAC");const r=parseInt(t.slice(2),10);if(Dn(e.algorithm.hash)!==r)throw Tn(`SHA-${r}`,"algorithm.hash");break}case"RS256":case"RS384":case"RS512":{if(!jn(e.algorithm,"RSASSA-PKCS1-v1_5"))throw Tn("RSASSA-PKCS1-v1_5");const r=parseInt(t.slice(2),10);if(Dn(e.algorithm.hash)!==r)throw Tn(`SHA-${r}`,"algorithm.hash");break}case"PS256":case"PS384":case"PS512":{if(!jn(e.algorithm,"RSA-PSS"))throw Tn("RSA-PSS");const r=parseInt(t.slice(2),10);if(Dn(e.algorithm.hash)!==r)throw Tn(`SHA-${r}`,"algorithm.hash");break}case"EdDSA":if("Ed25519"!==e.algorithm.name&&"Ed448"!==e.algorithm.name){if(On()){if(jn(e.algorithm,"NODE-ED25519"))break;throw Tn("Ed25519, Ed448, or NODE-ED25519")}throw Tn("Ed25519 or Ed448")}break;case"ES256":case"ES384":case"ES512":{if(!jn(e.algorithm,"ECDSA"))throw Tn("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 Tn(r,"algorithm.namedCurve");break}default:throw new TypeError("CryptoKey does not support this operation")}$n(e,r)}function Fn(e,t,...r){switch(t){case"A128GCM":case"A192GCM":case"A256GCM":{if(!jn(e.algorithm,"AES-GCM"))throw Tn("AES-GCM");const r=parseInt(t.slice(1,4),10);if(e.algorithm.length!==r)throw Tn(r,"algorithm.length");break}case"A128KW":case"A192KW":case"A256KW":{if(!jn(e.algorithm,"AES-KW"))throw Tn("AES-KW");const r=parseInt(t.slice(1,4),10);if(e.algorithm.length!==r)throw Tn(r,"algorithm.length");break}case"ECDH":switch(e.algorithm.name){case"ECDH":case"X25519":case"X448":break;default:throw Tn("ECDH, X25519, or X448")}break;case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":if(!jn(e.algorithm,"PBKDF2"))throw Tn("PBKDF2");break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":{if(!jn(e.algorithm,"RSA-OAEP"))throw Tn("RSA-OAEP");const r=parseInt(t.slice(9),10)||1;if(Dn(e.algorithm.hash)!==r)throw Tn(`SHA-${r}`,"algorithm.hash");break}default:throw new TypeError("CryptoKey does not support this operation")}$n(e,r)}function zn(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 Un=(e,...t)=>zn("Key must be ",e,...t);function Ln(e,t,...r){return zn(`Key for the ${e} algorithm must be `,t,...r)}var qn=e=>an(e);const Hn=["CryptoKey"];async function Kn(e,t,r,n,i,o){if(!(t instanceof Uint8Array))throw new TypeError(Un(t,"Uint8Array"));const a=parseInt(e.slice(1,4),10),s=await on.subtle.importKey("raw",t.subarray(a>>3),"AES-CBC",!1,["decrypt"]),c=await on.subtle.importKey("raw",t.subarray(0,a>>3),{hash:"SHA-"+(a<<1),name:"HMAC"},!1,["sign"]),u=dn(o,n,r,hn(o.length<<3)),f=new Uint8Array((await on.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(!(an(t)||t instanceof Uint8Array))throw new TypeError(Un(t,...Hn,"Uint8Array"));switch(Rn(e,n),e){case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return t instanceof Uint8Array&&Nn(t,parseInt(e.slice(-3),10)),Kn(e,t,r,n,i,o);case"A128GCM":case"A192GCM":case"A256GCM":return t instanceof Uint8Array&&Nn(t,parseInt(e.slice(1,4),10)),async function(e,t,r,n,i,o){let a;t instanceof Uint8Array?a=await on.subtle.importKey("raw",t,"AES-GCM",!1,["decrypt"]):(Fn(t,e,"decrypt"),a=t);try{return new Uint8Array(await on.subtle.decrypt({additionalData:o,iv:n,name:"AES-GCM",tagLength:128},a,dn(r,i)))}catch(e){throw new En}}(e,t,r,n,i,o);default:throw new _n("Unsupported JWE Content Encryption Algorithm")}},Wn=async()=>{throw new _n('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.')},Gn=async()=>{throw new _n('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.')},Vn=(...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 Zn(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 Xn=[{hash:"SHA-256",name:"HMAC"},!0,["sign"]];function Qn(e,t){if(e.algorithm.length!==parseInt(t.slice(1,4),10))throw new TypeError(`Invalid key size for alg: ${t}`)}function Yn(e,t,r){if(an(e))return Fn(e,t,r),e;if(e instanceof Uint8Array)return on.subtle.importKey("raw",e,"AES-KW",!0,[r]);throw new TypeError(Un(e,...Hn,"Uint8Array"))}const ei=async(e,t,r)=>{const n=await Yn(t,e,"wrapKey");Qn(n,e);const i=await on.subtle.importKey("raw",r,...Xn);return new Uint8Array(await on.subtle.wrapKey("raw",i,n,"AES-KW"))},ti=async(e,t,r)=>{const n=await Yn(t,e,"unwrapKey");Qn(n,e);const i=await on.subtle.unwrapKey("raw",r,n,"AES-KW",...Xn);return new Uint8Array(await on.subtle.exportKey("raw",i))};async function ri(e,t,r,n,i=new Uint8Array(0),o=new Uint8Array(0)){if(!an(e))throw new TypeError(Un(e,...Hn));if(Fn(e,"ECDH"),!an(t))throw new TypeError(Un(t,...Hn));Fn(t,"ECDH","deriveBits");const a=dn(mn(cn.encode(r)),mn(i),mn(o),pn(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 on.subtle.deriveBits({name:e.algorithm.name,public:e},t,s)),n,a)}function ni(e){if(!an(e))throw new TypeError(Un(e,...Hn));return["P-256","P-384","P-521"].includes(e.algorithm.namedCurve)||"X25519"===e.algorithm.name||"X448"===e.algorithm.name}async function ii(e,t,r,n){!function(e){if(!(e instanceof Uint8Array)||e.length<8)throw new Sn("PBES2 Salt Input must be 8 or more octets")}(e);const i=function(e,t){return dn(cn.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 on.subtle.importKey("raw",e,"PBKDF2",!1,["deriveBits"]);if(an(e))return Fn(e,t,"deriveBits","deriveKey"),e;throw new TypeError(Un(e,...Hn,"Uint8Array"))}(n,t);if(c.usages.includes("deriveBits"))return new Uint8Array(await on.subtle.deriveBits(a,c,o));if(c.usages.includes("deriveKey"))return on.subtle.deriveKey(a,c,s,!1,["wrapKey","unwrapKey"]);throw new TypeError('PBKDF2 key "usages" must include "deriveBits" or "deriveKey"')}const oi=async(e,t,r,n,i)=>{const o=await ii(i,e,n,t);return ti(e.slice(-6),o,r)};function ai(e){switch(e){case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":return"RSA-OAEP";default:throw new _n(`alg ${e} is not supported either by JOSE or your javascript runtime`)}}var si=(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 ci=async(e,t,r)=>{if(!an(t))throw new TypeError(Un(t,...Hn));if(Fn(t,e,"decrypt","unwrapKey"),si(e,t),t.usages.includes("decrypt"))return new Uint8Array(await on.subtle.decrypt(ai(e),t,r));if(t.usages.includes("unwrapKey")){const n=await on.subtle.unwrapKey("raw",r,t,ai(e),...Xn);return new Uint8Array(await on.subtle.exportKey("raw",n))}throw new TypeError('RSA-OAEP key "usages" must include "decrypt" or "unwrapKey" for this operation')};function ui(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 _n(`Unsupported JWE Algorithm: ${e}`)}}var fi=e=>Mn(new Uint8Array(ui(e)>>3));var di=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 _n(`${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 _n('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 _n('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 _n('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 _n('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;default:throw new _n('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 on.subtle.importKey("raw",yn(e.k),...o);const a={...e};delete a.alg,delete a.use;try{return await on.subtle.importKey("jwk",a,...o)}catch(e){if("Ed25519"===n.name&&"NotSupportedError"===(null==e?void 0:e.name)&&On())return o[0]={name:"NODE-ED25519",namedCurve:"NODE-ED25519"},await on.subtle.importKey("jwk",a,...o);throw e}};async function li(e,t,r){var n;if(!Zn(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?di({...e,alg:t,ext:null!==(n=e.ext)&&void 0!==n&&n}):yn(e.k);case"RSA":if(void 0!==e.oth)throw new _n('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');case"EC":case"OKP":return di({...e,alg:t});default:throw new _n('Unsupported "kty" (Key Type) Parameter value')}}const hi=(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(!qn(t))throw new TypeError(Ln(e,t,...Hn,"Uint8Array"));if("secret"!==t.type)throw new TypeError(`${Hn.join(" or ")} instances for symmetric algorithms must be of type "secret"`)}})(e,t):((e,t,r)=>{if(!qn(t))throw new TypeError(Ln(e,t,...Hn));if("secret"===t.type)throw new TypeError(`${Hn.join(" or ")} instances for asymmetric algorithms must not be of type "secret"`);if("sign"===r&&"public"===t.type)throw new TypeError(`${Hn.join(" or ")} instances for asymmetric algorithm signing must be of type "private"`);if("decrypt"===r&&"public"===t.type)throw new TypeError(`${Hn.join(" or ")} instances for asymmetric algorithm decryption must be of type "private"`);if(t.algorithm&&"verify"===r&&"private"===t.type)throw new TypeError(`${Hn.join(" or ")} instances for asymmetric algorithm verifying must be of type "public"`);if(t.algorithm&&"encrypt"===r&&"private"===t.type)throw new TypeError(`${Hn.join(" or ")} instances for asymmetric algorithm encryption must be of type "public"`)})(e,t,r)};const pi=async(e,t,r,n,i)=>{if(!(an(r)||r instanceof Uint8Array))throw new TypeError(Un(r,...Hn,"Uint8Array"));switch(Rn(e,n),e){case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return r instanceof Uint8Array&&Nn(r,parseInt(e.slice(-3),10)),async function(e,t,r,n,i){if(!(r instanceof Uint8Array))throw new TypeError(Un(r,"Uint8Array"));const o=parseInt(e.slice(1,4),10),a=await on.subtle.importKey("raw",r.subarray(o>>3),"AES-CBC",!1,["encrypt"]),s=await on.subtle.importKey("raw",r.subarray(0,o>>3),{hash:"SHA-"+(o<<1),name:"HMAC"},!1,["sign"]),c=new Uint8Array(await on.subtle.encrypt({iv:n,name:"AES-CBC"},a,t)),u=dn(i,n,c,hn(i.length<<3));return{ciphertext:c,tag:new Uint8Array((await on.subtle.sign("HMAC",s,u)).slice(0,o>>3))}}(e,t,r,n,i);case"A128GCM":case"A192GCM":case"A256GCM":return r instanceof Uint8Array&&Nn(r,parseInt(e.slice(1,4),10)),async function(e,t,r,n,i){let o;r instanceof Uint8Array?o=await on.subtle.importKey("raw",r,"AES-GCM",!1,["encrypt"]):(Fn(r,e,"encrypt"),o=r);const a=new Uint8Array(await on.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 _n("Unsupported JWE Content Encryption Algorithm")}};async function mi(e,t,r,n,i){switch(hi(e,t,"decrypt"),e){case"dir":if(void 0!==r)throw new Sn("Encountered unexpected JWE Encrypted Key");return t;case"ECDH-ES":if(void 0!==r)throw new Sn("Encountered unexpected JWE Encrypted Key");case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{if(!Zn(n.epk))throw new Sn('JOSE Header "epk" (Ephemeral Public Key) missing or invalid');if(!ni(t))throw new _n("ECDH with the provided key is not allowed or not supported by your javascript runtime");const i=await li(n.epk,e);let o,a;if(void 0!==n.apu){if("string"!=typeof n.apu)throw new Sn('JOSE Header "apu" (Agreement PartyUInfo) invalid');o=yn(n.apu)}if(void 0!==n.apv){if("string"!=typeof n.apv)throw new Sn('JOSE Header "apv" (Agreement PartyVInfo) invalid');a=yn(n.apv)}const s=await ri(i,t,"ECDH-ES"===e?n.enc:e,"ECDH-ES"===e?ui(n.enc):parseInt(e.slice(-5,-2),10),o,a);if("ECDH-ES"===e)return s;if(void 0===r)throw new Sn("JWE Encrypted Key missing");return ti(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 Sn("JWE Encrypted Key missing");return ci(e,t,r);case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":{if(void 0===r)throw new Sn("JWE Encrypted Key missing");if("number"!=typeof n.p2c)throw new Sn('JOSE Header "p2c" (PBES2 Count) missing or invalid');const o=(null==i?void 0:i.maxPBES2Count)||1e4;if(n.p2c>o)throw new Sn('JOSE Header "p2c" (PBES2 Count) out is of acceptable bounds');if("string"!=typeof n.p2s)throw new Sn('JOSE Header "p2s" (PBES2 Salt) missing or invalid');return oi(e,t,r,n.p2c,yn(n.p2s))}case"A128KW":case"A192KW":case"A256KW":if(void 0===r)throw new Sn("JWE Encrypted Key missing");return ti(e,t,r);case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":if(void 0===r)throw new Sn("JWE Encrypted Key missing");if("string"!=typeof n.iv)throw new Sn('JOSE Header "iv" (Initialization Vector) missing or invalid');if("string"!=typeof n.tag)throw new Sn('JOSE Header "tag" (Authentication Tag) missing or invalid');return async function(e,t,r,n,i){const o=e.slice(0,7);return Jn(o,t,r,n,i,new Uint8Array(0))}(e,t,r,yn(n.iv),yn(n.tag));default:throw new _n('Invalid or unsupported "alg" (JWE Algorithm) header value')}}function gi(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 _n(`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 yi=(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 bi(e,t,r){if(e instanceof Uint8Array&&(e=un.decode(e)),"string"!=typeof e)throw new Sn("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 Sn("Invalid Compact JWE");const u=await async function(e,t,r){var n;if(!Zn(e))throw new Sn("Flattened JWE must be an object");if(void 0===e.protected&&void 0===e.header&&void 0===e.unprotected)throw new Sn("JOSE Header missing");if("string"!=typeof e.iv)throw new Sn("JWE Initialization Vector missing or incorrect type");if("string"!=typeof e.ciphertext)throw new Sn("JWE Ciphertext missing or incorrect type");if("string"!=typeof e.tag)throw new Sn("JWE Authentication Tag missing or incorrect type");if(void 0!==e.protected&&"string"!=typeof e.protected)throw new Sn("JWE Protected Header incorrect type");if(void 0!==e.encrypted_key&&"string"!=typeof e.encrypted_key)throw new Sn("JWE Encrypted Key incorrect type");if(void 0!==e.aad&&"string"!=typeof e.aad)throw new Sn("JWE AAD incorrect type");if(void 0!==e.header&&!Zn(e.header))throw new Sn("JWE Shared Unprotected Header incorrect type");if(void 0!==e.unprotected&&!Zn(e.unprotected))throw new Sn("JWE Per-Recipient Unprotected Header incorrect type");let i;if(e.protected)try{const t=yn(e.protected);i=JSON.parse(un.decode(t))}catch(e){throw new Sn("JWE Protected Header is invalid")}if(!Vn(i,e.header,e.unprotected))throw new Sn("JWE Protected, JWE Unprotected Header, and JWE Per-Recipient Unprotected Header Parameter names must be disjoint");const o={...i,...e.header,...e.unprotected};if(gi(Sn,new Map,null==r?void 0:r.crit,i,o),void 0!==o.zip){if(!i||!i.zip)throw new Sn('JWE "zip" (Compression Algorithm) Header MUST be integrity protected');if("DEF"!==o.zip)throw new _n('Unsupported JWE "zip" (Compression Algorithm) Header Parameter value')}const{alg:a,enc:s}=o;if("string"!=typeof a||!a)throw new Sn("missing JWE Algorithm (alg) in JWE Header");if("string"!=typeof s||!s)throw new Sn("missing JWE Encryption Algorithm (enc) in JWE Header");const c=r&&yi("keyManagementAlgorithms",r.keyManagementAlgorithms),u=r&&yi("contentEncryptionAlgorithms",r.contentEncryptionAlgorithms);if(c&&!c.has(a))throw new An('"alg" (Algorithm) Header Parameter not allowed');if(u&&!u.has(s))throw new An('"enc" (Encryption Algorithm) Header Parameter not allowed');let f;void 0!==e.encrypted_key&&(f=yn(e.encrypted_key));let d,l=!1;"function"==typeof t&&(t=await t(i,e),l=!0);try{d=await mi(a,t,f,o,r)}catch(e){if(e instanceof TypeError||e instanceof Sn||e instanceof _n)throw e;d=fi(s)}const h=yn(e.iv),p=yn(e.tag),m=cn.encode(null!==(n=e.protected)&&void 0!==n?n:"");let g;g=void 0!==e.aad?dn(m,cn.encode("."),cn.encode(e.aad)):m;let y=await Jn(s,d,yn(e.ciphertext),h,p,g);"DEF"===o.zip&&(y=await((null==r?void 0:r.inflateRaw)||Wn)(y));const b={plaintext:y};return void 0!==e.protected&&(b.protectedHeader=i),void 0!==e.aad&&(b.additionalAuthenticatedData=yn(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 vi=async e=>{if(e instanceof Uint8Array)return{kty:"oct",k:gn(e)};if(!an(e))throw new TypeError(Un(e,...Hn,"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 on.subtle.exportKey("jwk",e);return o};async function wi(e){return vi(e)}async function Ai(e,t,r,n,i={}){let o,a,s;switch(hi(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(!ni(r))throw new _n("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(!an(e))throw new TypeError(Un(e,...Hn));return on.subtle.generateKey(e.algorithm,!0,["deriveBits"])}(r)).privateKey);const{x:d,y:l,crv:h,kty:p}=await wi(f),m=await ri(r,f,"ECDH-ES"===e?t:e,"ECDH-ES"===e?ui(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=gn(c)),u&&(a.apv=gn(u)),"ECDH-ES"===e){s=m;break}s=n||fi(t);const g=e.slice(-6);o=await ei(g,m,s);break}case"RSA1_5":case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":s=n||fi(t),o=await(async(e,t,r)=>{if(!an(t))throw new TypeError(Un(t,...Hn));if(Fn(t,e,"encrypt","wrapKey"),si(e,t),t.usages.includes("encrypt"))return new Uint8Array(await on.subtle.encrypt(ai(e),t,r));if(t.usages.includes("wrapKey")){const n=await on.subtle.importKey("raw",r,...Xn);return new Uint8Array(await on.subtle.wrapKey("raw",n,t,ai(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||fi(t);const{p2c:c,p2s:u}=i;({encryptedKey:o,...a}=await(async(e,t,r,n=2048,i=Mn(new Uint8Array(16)))=>{const o=await ii(i,e,n,t);return{encryptedKey:await ei(e.slice(-6),o,r),p2c:n,p2s:gn(i)}})(e,r,s,c,u));break}case"A128KW":case"A192KW":case"A256KW":s=n||fi(t),o=await ei(e,r,s);break;case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":{s=n||fi(t);const{iv:c}=i;({encryptedKey:o,...a}=await async function(e,t,r,n){const i=e.slice(0,7);n||(n=In(i));const{ciphertext:o,tag:a}=await pi(i,r,t,n,new Uint8Array(0));return{encryptedKey:o,iv:gn(n),tag:gn(a)}}(e,r,s,c));break}default:throw new _n('Invalid or unsupported "alg" (JWE Algorithm) header value')}return{cek:s,encryptedKey:o,parameters:a}}const _i=Symbol();class Ei{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 Sn("either setProtectedHeader, setUnprotectedHeader, or sharedUnprotectedHeader must be called before #encrypt()");if(!Vn(this._protectedHeader,this._unprotectedHeader,this._sharedUnprotectedHeader))throw new Sn("JWE Protected, JWE Shared Unprotected and JWE Per-Recipient Header Parameter names must be disjoint");const r={...this._protectedHeader,...this._unprotectedHeader,...this._sharedUnprotectedHeader};if(gi(Sn,new Map,null==t?void 0:t.crit,this._protectedHeader,r),void 0!==r.zip){if(!this._protectedHeader||!this._protectedHeader.zip)throw new Sn('JWE "zip" (Compression Algorithm) Header MUST be integrity protected');if("DEF"!==r.zip)throw new _n('Unsupported JWE "zip" (Compression Algorithm) Header Parameter value')}const{alg:n,enc:i}=r;if("string"!=typeof n||!n)throw new Sn('JWE "alg" (Algorithm) Header Parameter missing or invalid');if("string"!=typeof i||!i)throw new Sn('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 Ai(n,i,e,this._cek,this._keyManagementParameters)),r&&(t&&_i 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=In(i)),c=this._protectedHeader?cn.encode(gn(JSON.stringify(this._protectedHeader))):cn.encode(""),this._aad?(u=gn(this._aad),s=dn(c,cn.encode("."),cn.encode(u))):s=c,"DEF"===r.zip){const e=await((null==t?void 0:t.deflateRaw)||Gn)(this._plaintext);({ciphertext:f,tag:d}=await pi(i,e,a,this._iv,s))}else({ciphertext:f,tag:d}=await pi(i,this._plaintext,a,this._iv,s));const l={ciphertext:gn(f),iv:gn(this._iv),tag:gn(d)};return o&&(l.encrypted_key=gn(o)),u&&(l.aad=u),this._protectedHeader&&(l.protected=un.decode(c)),this._sharedUnprotectedHeader&&(l.unprotected=this._sharedUnprotectedHeader),this._unprotectedHeader&&(l.header=this._unprotectedHeader),l}}function Si(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 On()&&"NODE-ED25519"===t.name?{name:"NODE-ED25519",namedCurve:"NODE-ED25519"}:{name:t.name};default:throw new _n(`alg ${e} is not supported either by JOSE or your javascript runtime`)}}function Pi(e,t,r){if(an(t))return Bn(t,e,r),t;if(t instanceof Uint8Array){if(!e.startsWith("HS"))throw new TypeError(Un(t,...Hn));return on.subtle.importKey("raw",t,{hash:`SHA-${e.slice(-3)}`,name:"HMAC"},!1,[r])}throw new TypeError(Un(t,...Hn,"Uint8Array"))}const xi=async(e,t,r,n)=>{const i=await Pi(e,t,"verify");si(e,i);const o=Si(e,i.algorithm);try{return await on.subtle.verify(o,i,r,n)}catch(e){return!1}};async function ki(e,t,r){var n;if(!Zn(e))throw new Pn("Flattened JWS must be an object");if(void 0===e.protected&&void 0===e.header)throw new Pn('Flattened JWS must have either of the "protected" or "header" members');if(void 0!==e.protected&&"string"!=typeof e.protected)throw new Pn("JWS Protected Header incorrect type");if(void 0===e.payload)throw new Pn("JWS Payload missing");if("string"!=typeof e.signature)throw new Pn("JWS Signature missing or incorrect type");if(void 0!==e.header&&!Zn(e.header))throw new Pn("JWS Unprotected Header incorrect type");let i={};if(e.protected)try{const t=yn(e.protected);i=JSON.parse(un.decode(t))}catch(e){throw new Pn("JWS Protected Header is invalid")}if(!Vn(i,e.header))throw new Pn("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");const o={...i,...e.header};let a=!0;if(gi(Pn,new Map([["b64",!0]]),null==r?void 0:r.crit,i,o).has("b64")&&(a=i.b64,"boolean"!=typeof a))throw new Pn('The "b64" (base64url-encode payload) Header Parameter must be a boolean');const{alg:s}=o;if("string"!=typeof s||!s)throw new Pn('JWS "alg" (Algorithm) Header Parameter missing or invalid');const c=r&&yi("algorithms",r.algorithms);if(c&&!c.has(s))throw new An('"alg" (Algorithm) Header Parameter not allowed');if(a){if("string"!=typeof e.payload)throw new Pn("JWS Payload must be a string")}else if("string"!=typeof e.payload&&!(e.payload instanceof Uint8Array))throw new Pn("JWS Payload must be a string or an Uint8Array instance");let u=!1;"function"==typeof t&&(t=await t(i,e),u=!0),hi(s,t,"verify");const f=dn(cn.encode(null!==(n=e.protected)&&void 0!==n?n:""),cn.encode("."),"string"==typeof e.payload?cn.encode(e.payload):e.payload),d=yn(e.signature);if(!await xi(s,t,d,f))throw new kn;let l;l=a?yn(e.payload):"string"==typeof e.payload?cn.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 Mi=e=>Math.floor(e.getTime()/1e3);const Ci=86400,Ii=/^(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)$/i;var Ri=e=>{const t=Ii.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*Ci);case"week":case"weeks":case"w":return Math.round(604800*r);default:return Math.round(31557600*r)}};const Ni=e=>e.toLowerCase().replace(/^application\//,"");var Oi=(e,t,r={})=>{const{typ:n}=r;if(n&&("string"!=typeof e.typ||Ni(e.typ)!==Ni(n)))throw new vn('unexpected "typ" JWT header value',"typ","check_failed");let i;try{i=JSON.parse(un.decode(t))}catch(e){}if(!Zn(i))throw new xn("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 vn('unexpected "iss" claim value',"iss","check_failed");const{subject:a}=r;if(a&&i.sub!==a)throw new vn('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 vn('unexpected "aud" claim value',"aud","check_failed");var c,u;let f;switch(typeof r.clockTolerance){case"string":f=Ri(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=Mi(d||new Date);if((void 0!==i.iat||r.maxTokenAge)&&"number"!=typeof i.iat)throw new vn('"iat" claim must be a number',"iat","invalid");if(void 0!==i.nbf){if("number"!=typeof i.nbf)throw new vn('"nbf" claim must be a number',"nbf","invalid");if(i.nbf>l+f)throw new vn('"nbf" claim timestamp check failed',"nbf","check_failed")}if(void 0!==i.exp){if("number"!=typeof i.exp)throw new vn('"exp" claim must be a number',"exp","invalid");if(i.exp<=l-f)throw new wn('"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:Ri(r.maxTokenAge)))throw new wn('"iat" claim timestamp check failed (too far in the past)',"iat","check_failed");if(e<0-f)throw new vn('"iat" claim timestamp check failed (it should be in the past)',"iat","check_failed")}return i};async function Ti(e,t,r){var n;const i=await async function(e,t,r){if(e instanceof Uint8Array&&(e=un.decode(e)),"string"!=typeof e)throw new Pn("Compact JWS must be a string or Uint8Array");const{0:n,1:i,2:o,length:a}=e.split(".");if(3!==a)throw new Pn("Invalid Compact JWS");const s=await ki({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 xn("JWTs MUST NOT use unencoded payload");const o={payload:Oi(i.protectedHeader,i.payload,r),protectedHeader:i.protectedHeader};return"function"==typeof t?{...o,key:i.key}:o}class ji{constructor(e){this._flattened=new Ei(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 Pn("either setProtectedHeader or setUnprotectedHeader must be called before #sign()");if(!Vn(this._protectedHeader,this._unprotectedHeader))throw new Pn("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");const r={...this._protectedHeader,...this._unprotectedHeader};let n=!0;if(gi(Pn,new Map([["b64",!0]]),null==t?void 0:t.crit,this._protectedHeader,r).has("b64")&&(n=this._protectedHeader.b64,"boolean"!=typeof n))throw new Pn('The "b64" (base64url-encode payload) Header Parameter must be a boolean');const{alg:i}=r;if("string"!=typeof i||!i)throw new Pn('JWS "alg" (Algorithm) Header Parameter missing or invalid');hi(i,e,"sign");let o,a=this._payload;n&&(a=cn.encode(gn(a))),o=this._protectedHeader?cn.encode(gn(JSON.stringify(this._protectedHeader))):cn.encode("");const s=dn(o,cn.encode("."),a),c=await(async(e,t,r)=>{const n=await Pi(e,t,"sign");si(e,n);const i=await on.subtle.sign(Si(e,n.algorithm),n,r);return new Uint8Array(i)})(i,e,s),u={signature:gn(c),payload:""};return n&&(u.payload=un.decode(a)),this._unprotectedHeader&&(u.header=this._unprotectedHeader),this._protectedHeader&&(u.protected=un.decode(o)),u}}class $i{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 Bi{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 Fi{constructor(e){this._signatures=[],this._payload=e}addSignature(e,t){const r=new Bi(this,e,t);return this._signatures.push(r),r}async sign(){if(!this._signatures.length)throw new Pn("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 _n('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}return on.subtle.generateKey(i,null!==(r=null==t?void 0:t.extractable)&&void 0!==r&&r,o)}(e,t)}async function Hi(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 li(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 Ki(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 Hi(o);let s;try{return s=await new ji(e).setProtectedHeader({alg:n,enc:i,kid:t.kid}).encrypt(a),s}catch(e){throw new rn(e,["encryption failed"])}}async function Ji(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(un.decode(Li(t)));if(!Zn(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 Hi(r);return await bi(e,o,{contentEncryptionAlgorithms:[i]})}catch(e){throw new rn(e,["decryption failed"])}}async function Wi(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 rn(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 rn(e,["invalid format","not a compact jws"])}if(void 0!==t){const r="function"==typeof t?await t(n,o):t,i=await Hi(r);try{const t=await Ti(e,i);return{header:t.protectedHeader,payload:t.payload,signer:r}}catch(e){throw new rn(e,["jws verification failed"])}}return{header:n,payload:o}}function Gi(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 Vi(e,t,r){let n;if(!en.includes(e))throw new rn(new Error(`Invalid encAlg '${e}'. Supported values are: ${en.toString()}`),["invalid algorithm"]);const c=Gi(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 rn(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 rn(new RangeError(`Expected secret length ${c} does not meet provided one ${n.length}`),["invalid key"])}else try{n=await qi(e,{extractable:!0})}catch(e){throw new rn(e,["unexpected error"])}const u=await wi(n);return u.alg=e,{jwk:u,hex:a(i(u.k),!1,c)}}async function Zi(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 Hi(e),n=await Hi(t);try{const e=await c(16),i=await new Fi(e).addSignature(n).setProtectedHeader({alg:t.alg}).sign();await async function(e,t,r){if(!Zn(e))throw new Pn("General JWS must be an object");if(!Array.isArray(e.signatures)||!e.signatures.every(Zn))throw new Pn("JWS Signatures missing or incorrect type");for(const n of e.signatures)try{return await ki({header:n.header,payload:e.payload,protected:n.protected,signature:n.signature},t,r)}catch(e){}throw new kn}(i,r)}catch(e){throw new rn(e,["unexpected error"])}}function Xi(e){return null!=e&&"object"==typeof e&&!Array.isArray(e)}function Qi(e){return Xi(e)||Array.isArray(e)?Array.isArray(e)?e.map((e=>Array.isArray(e)||Xi(e)?Qi(e):e)):Object.keys(e).sort().map((t=>[t,Qi(e[t])])):e}function Yi(e){return JSON.stringify(Qi(e))}function eo(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 to(e){return Array.isArray(e)?e.sort().map(to):(t=e,"[object Object]"===Object.prototype.toString.call(t)?Object.keys(e).sort().reduce((function(t,r){return t[r]=to(e[r]),t}),{}):e);var t}function ro(e,t=!1,r){try{return o(e,t,r)}catch(e){throw new rn(e,["invalid format"])}}async function no(e,t){try{await Hi(e,e.alg);const r=to(e);return t?JSON.stringify(r):r}catch(e){throw new rn(e,["invalid key"])}}async function io(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 oo={};!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:y.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 g(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 g(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?g(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)}({get exports(){return oo},set exports(e){oo=e}});var ao=oo;let so=!1,co=!1;const uo={debug:1,default:2,info:2,warning:3,error:4,off:5};let fo=uo.default,lo=null;const ho=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 po,mo;!function(e){e.DEBUG="DEBUG",e.INFO="INFO",e.WARNING="WARNING",e.ERROR="ERROR",e.OFF="OFF"}(po||(po={})),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"}(mo||(mo={}));const go="0123456789abcdef";class yo{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,t){const r=e.toLowerCase();null==uo[r]&&this.throwArgumentError("invalid log level name","logLevel",e),fo>uo[r]||console.log.apply(console,t)}debug(...e){this._log(yo.levels.DEBUG,e)}info(...e){this._log(yo.levels.INFO,e)}warn(...e){this._log(yo.levels.WARNING,e)}makeError(e,t,r){if(co)return this.makeError("censored error",t,{});t||(t=yo.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+=go[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 mo.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 mo.CALL_EXCEPTION:case mo.INSUFFICIENT_FUNDS:case mo.MISSING_NEW:case mo.NONCE_EXPIRED:case mo.REPLACEMENT_UNDERPRICED:case mo.TRANSACTION_REPLACED:case mo.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,yo.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){ho&&this.throwError("platform missing String.prototype.normalize",yo.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:ho})}checkSafeUint53(e,t){"number"==typeof e&&(null==t&&(t="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(t,yo.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(t,yo.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,t,r){r=r?": "+r:"",et&&this.throwError("too many arguments"+r,yo.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:t})}checkNew(e,t){e!==Object&&null!=e||this.throwError("missing new",yo.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",yo.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):e!==Object&&null!=e||this.throwError("missing new",yo.errors.MISSING_NEW,{name:t.name})}static globalLogger(){return lo||(lo=new yo("logger/5.7.0")),lo}static setCensorship(e,t){if(!e&&t&&this.globalLogger().throwError("cannot permanently disable censorship",yo.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),so){if(!e)return;this.globalLogger().throwError("error censorship permanent",yo.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}co=!!e,so=!!t}static setLogLevel(e){const t=uo[e.toLowerCase()];null!=t?fo=t:yo.globalLogger().warn("invalid log level - "+e)}static from(e){return new yo(e)}}yo.errors=mo,yo.levels=po;var bo=Object.freeze({__proto__:null,get ErrorCode(){return mo},get LogLevel(){return po},Logger:yo});const vo=new yo("bytes/5.7.0");function wo(e){return!!e.toHexString}function Ao(e){return e.slice||(e.slice=function(){const t=Array.prototype.slice.call(arguments);return Ao(new Uint8Array(Array.prototype.slice.apply(e,t)))}),e}function _o(e){return Co(e)&&!(e.length%2)||So(e)}function Eo(e){return"number"==typeof e&&e==e&&e%1==0}function So(e){if(null==e)return!1;if(e.constructor===Uint8Array)return!0;if("string"==typeof e)return!1;if(!Eo(e.length)||e.length<0)return!1;for(let t=0;t=256)return!1}return!0}function Po(e,t){if(t||(t={}),"number"==typeof e){vo.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),Ao(new Uint8Array(t))}if(t.allowMissingPrefix&&"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),wo(e)&&(e=e.toHexString()),Co(e)){let r=e.substring(2);r.length%2&&("left"===t.hexPad?r="0"+r:"right"===t.hexPad?r+="0":vo.throwArgumentError("hex data is odd-length","value",e));const n=[];for(let e=0;ePo(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),Ao(n)}function ko(e){let t=Po(e);if(0===t.length)return t;let r=0;for(;rt&&vo.throwArgumentError("value out of range","value",arguments[0]);const r=new Uint8Array(t);return r.set(e,t-e.length),Ao(r)}function Co(e,t){return!("string"!=typeof e||!e.match(/^0x[0-9A-Fa-f]*$/))&&(!t||e.length===2+2*t)}const Io="0123456789abcdef";function Ro(e,t){if(t||(t={}),"number"==typeof e){vo.checkSafeUint53(e,"invalid hexlify value");let t="";for(;e;)t=Io[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),wo(e))return e.toHexString();if(Co(e))return e.length%2&&("left"===t.hexPad?e="0x0"+e.substring(2):"right"===t.hexPad?e+="0":vo.throwArgumentError("hex data is odd-length","value",e)),e.toLowerCase();if(So(e)){let t="0x";for(let r=0;r>4]+Io[15&n]}return t}return vo.throwArgumentError("invalid hexlify value","value",e)}function No(e){if("string"!=typeof e)e=Ro(e);else if(!Co(e)||e.length%2)return null;return(e.length-2)/2}function Oo(e,t,r){return"string"!=typeof e?e=Ro(e):(!Co(e)||e.length%2)&&vo.throwArgumentError("invalid hexData","value",e),t=2+2*t,null!=r?"0x"+e.substring(t,2+2*r):"0x"+e.substring(t)}function To(e){let t="0x";return e.forEach((e=>{t+=Ro(e).substring(2)})),t}function jo(e){const t=Do(Ro(e,{hexPad:"left"}));return"0x"===t?"0x0":t}function Do(e){"string"!=typeof e&&(e=Ro(e)),Co(e)||vo.throwArgumentError("invalid hex string","value",e),e=e.substring(2);let t=0;for(;t2*t+2&&vo.throwArgumentError("value out of range","value",arguments[1]);e.length<2*t+2;)e="0x0"+e.substring(2);return e}function Bo(e){const t={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(_o(e)){let r=Po(e);64===r.length?(t.v=27+(r[32]>>7),r[32]&=127,t.r=Ro(r.slice(0,32)),t.s=Ro(r.slice(32,64))):65===r.length?(t.r=Ro(r.slice(0,32)),t.s=Ro(r.slice(32,64)),t.v=r[64]):vo.throwArgumentError("invalid signature string","signature",e),t.v<27&&(0===t.v||1===t.v?t.v+=27:vo.throwArgumentError("signature invalid v byte","signature",e)),t.recoveryParam=1-t.v%2,t.recoveryParam&&(r[32]|=128),t._vs=Ro(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=Mo(Po(t._vs),32);t._vs=Ro(r);const n=r[0]>=128?1:0;null==t.recoveryParam?t.recoveryParam=n:t.recoveryParam!==n&&vo.throwArgumentError("signature recoveryParam mismatch _vs","signature",e),r[0]&=127;const i=Ro(r);null==t.s?t.s=i:t.s!==i&&vo.throwArgumentError("signature v mismatch _vs","signature",e)}if(null==t.recoveryParam)null==t.v?vo.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&&vo.throwArgumentError("signature recoveryParam mismatch v","signature",e)}null!=t.r&&Co(t.r)?t.r=$o(t.r,32):vo.throwArgumentError("signature missing or invalid r","signature",e),null!=t.s&&Co(t.s)?t.s=$o(t.s,32):vo.throwArgumentError("signature missing or invalid s","signature",e);const r=Po(t.s);r[0]>=128&&vo.throwArgumentError("signature s out of range","signature",e),t.recoveryParam&&(r[0]|=128);const n=Ro(r);t._vs&&(Co(t._vs)||vo.throwArgumentError("signature invalid _vs","signature",e),t._vs=$o(t._vs,32)),null==t._vs?t._vs=n:t._vs!==n&&vo.throwArgumentError("signature _vs mismatch v and s","signature",e)}return t.yParityAndS=t._vs,t.compact=t.r+t.yParityAndS.substring(2),t}function Fo(e){return Ro(xo([(e=Bo(e)).r,e.s,e.recoveryParam?"0x1c":"0x1b"]))}var zo=Object.freeze({__proto__:null,arrayify:Po,concat:xo,hexConcat:To,hexDataLength:No,hexDataSlice:Oo,hexStripZeros:Do,hexValue:jo,hexZeroPad:$o,hexlify:Ro,isBytes:So,isBytesLike:_o,isHexString:Co,joinSignature:Fo,splitSignature:Bo,stripZeros:ko,zeroPad:Mo});const Uo="bignumber/5.7.0";var Lo=ao.BN;const qo=new yo(Uo),Ho={},Ko=9007199254740991;let Jo=!1;class Wo{constructor(e,t){e!==Ho&&qo.throwError("cannot call constructor directly; use BigNumber.from",yo.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=t,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return Vo(Zo(this).fromTwos(e))}toTwos(e){return Vo(Zo(this).toTwos(e))}abs(){return"-"===this._hex[0]?Wo.from(this._hex.substring(1)):this}add(e){return Vo(Zo(this).add(Zo(e)))}sub(e){return Vo(Zo(this).sub(Zo(e)))}div(e){return Wo.from(e).isZero()&&Xo("division-by-zero","div"),Vo(Zo(this).div(Zo(e)))}mul(e){return Vo(Zo(this).mul(Zo(e)))}mod(e){const t=Zo(e);return t.isNeg()&&Xo("division-by-zero","mod"),Vo(Zo(this).umod(t))}pow(e){const t=Zo(e);return t.isNeg()&&Xo("negative-power","pow"),Vo(Zo(this).pow(t))}and(e){const t=Zo(e);return(this.isNegative()||t.isNeg())&&Xo("unbound-bitwise-result","and"),Vo(Zo(this).and(t))}or(e){const t=Zo(e);return(this.isNegative()||t.isNeg())&&Xo("unbound-bitwise-result","or"),Vo(Zo(this).or(t))}xor(e){const t=Zo(e);return(this.isNegative()||t.isNeg())&&Xo("unbound-bitwise-result","xor"),Vo(Zo(this).xor(t))}mask(e){return(this.isNegative()||e<0)&&Xo("negative-width","mask"),Vo(Zo(this).maskn(e))}shl(e){return(this.isNegative()||e<0)&&Xo("negative-width","shl"),Vo(Zo(this).shln(e))}shr(e){return(this.isNegative()||e<0)&&Xo("negative-width","shr"),Vo(Zo(this).shrn(e))}eq(e){return Zo(this).eq(Zo(e))}lt(e){return Zo(this).lt(Zo(e))}lte(e){return Zo(this).lte(Zo(e))}gt(e){return Zo(this).gt(Zo(e))}gte(e){return Zo(this).gte(Zo(e))}isNegative(){return"-"===this._hex[0]}isZero(){return Zo(this).isZero()}toNumber(){try{return Zo(this).toNumber()}catch(e){Xo("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch(e){}return qo.throwError("this platform does not support BigInt",yo.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(10===arguments[0]?Jo||(Jo=!0,qo.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?qo.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",yo.errors.UNEXPECTED_ARGUMENT,{}):qo.throwError("BigNumber.toString does not accept parameters",yo.errors.UNEXPECTED_ARGUMENT,{})),Zo(this).toString(10)}toHexString(){return this._hex}toJSON(e){return{type:"BigNumber",hex:this.toHexString()}}static from(e){if(e instanceof Wo)return e;if("string"==typeof e)return e.match(/^-?0x[0-9a-f]+$/i)?new Wo(Ho,Go(e)):e.match(/^-?[0-9]+$/)?new Wo(Ho,Go(new Lo(e))):qo.throwArgumentError("invalid BigNumber string","value",e);if("number"==typeof e)return e%1&&Xo("underflow","BigNumber.from",e),(e>=Ko||e<=-Ko)&&Xo("overflow","BigNumber.from",e),Wo.from(String(e));const t=e;if("bigint"==typeof t)return Wo.from(t.toString());if(So(t))return Wo.from(Ro(t));if(t)if(t.toHexString){const e=t.toHexString();if("string"==typeof e)return Wo.from(e)}else{let e=t._hex;if(null==e&&"BigNumber"===t.type&&(e=t.hex),"string"==typeof e&&(Co(e)||"-"===e[0]&&Co(e.substring(1))))return Wo.from(e)}return qo.throwArgumentError("invalid BigNumber value","value",e)}static isBigNumber(e){return!(!e||!e._isBigNumber)}}function Go(e){if("string"!=typeof e)return Go(e.toString(16));if("-"===e[0])return"-"===(e=e.substring(1))[0]&&qo.throwArgumentError("invalid hex","value",e),"0x00"===(e=Go(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 Vo(e){return Wo.from(Go(e))}function Zo(e){const t=Wo.from(e).toHexString();return"-"===t[0]?new Lo("-"+t.substring(3),16):new Lo(t.substring(2),16)}function Xo(e,t,r){const n={fault:e,operation:t};return null!=r&&(n.value=r),qo.throwError(e,yo.errors.NUMERIC_FAULT,n)}const Qo=new yo(Uo),Yo={},ea=Wo.from(0),ta=Wo.from(-1);function ra(e,t,r,n){const i={fault:t,operation:r};return void 0!==n&&(i.value=n),Qo.throwError(e,yo.errors.NUMERIC_FAULT,i)}let na="0";for(;na.length<256;)na+=na;function ia(e){if("number"!=typeof e)try{e=Wo.from(e).toNumber()}catch(e){}return"number"==typeof e&&e>=0&&e<=256&&!(e%1)?"1"+na.substring(0,e):Qo.throwArgumentError("invalid decimal size","decimals",e)}function oa(e,t){null==t&&(t=0);const r=ia(t),n=(e=Wo.from(e)).lt(ea);n&&(e=e.mul(ta));let i=e.mod(r).toString();for(;i.length2&&Qo.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&&ra("fractional component exceeds decimals","underflow","parseFixed"),""===a&&(a="0");a.lengthnull==e[t]?n:(typeof e[t]!==r&&Qo.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&&Qo.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",r),n>80&&Qo.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",n),new sa(Yo,t,r,n)}}class ca{constructor(e,t,r,n){e!==Yo&&Qo.throwError("cannot use FixedNumber constructor; use FixedNumber.from",yo.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&&Qo.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",e)}addUnsafe(e){this._checkFormat(e);const t=aa(this._value,this.format.decimals),r=aa(e._value,e.format.decimals);return ca.fromValue(t.add(r),this.format.decimals,this.format)}subUnsafe(e){this._checkFormat(e);const t=aa(this._value,this.format.decimals),r=aa(e._value,e.format.decimals);return ca.fromValue(t.sub(r),this.format.decimals,this.format)}mulUnsafe(e){this._checkFormat(e);const t=aa(this._value,this.format.decimals),r=aa(e._value,e.format.decimals);return ca.fromValue(t.mul(r).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(e){this._checkFormat(e);const t=aa(this._value,this.format.decimals),r=aa(e._value,e.format.decimals);return ca.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=ca.from(e[0],this.format);const r=!e[1].match(/^(0*)$/);return this.isNegative()&&r&&(t=t.subUnsafe(ua.toFormat(t.format))),t}ceiling(){const e=this.toString().split(".");1===e.length&&e.push("0");let t=ca.from(e[0],this.format);const r=!e[1].match(/^(0*)$/);return!this.isNegative()&&r&&(t=t.addUnsafe(ua.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)&&Qo.throwArgumentError("invalid decimal count","decimals",e),t[1].length<=e)return this;const r=ca.from("1"+na.substring(0,e),this.format),n=fa.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&&Qo.throwArgumentError("invalid byte width","width",e);return $o(Wo.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString(),e/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return ca.fromString(this._value,e)}static fromValue(e,t,r){return null!=r||null==t||function(e){return null!=e&&(Wo.isBigNumber(e)||"number"==typeof e&&e%1==0||"string"==typeof e&&!!e.match(/^-?[0-9]+$/)||Co(e)||"bigint"==typeof e||So(e))}(t)||(r=t,t=null),null==t&&(t=0),null==r&&(r="fixed"),ca.fromString(oa(e,t),sa.from(r))}static fromString(e,t){null==t&&(t="fixed");const r=sa.from(t),n=aa(e,r.decimals);!r.signed&&n.lt(ea)&&ra("unsigned value cannot be negative","overflow","value",e);let i=null;r.signed?i=n.toTwos(r.width).toHexString():(i=n.toHexString(),i=$o(i,r.width/8));const o=oa(n,r.decimals);return new ca(Yo,i,o,r)}static fromBytes(e,t){null==t&&(t="fixed");const r=sa.from(t);if(Po(e).length>r.width/8)throw new Error("overflow");let n=Wo.from(e);r.signed&&(n=n.fromTwos(r.width));const i=n.toTwos((r.signed?0:1)+r.width).toHexString(),o=oa(n,r.decimals);return new ca(Yo,i,o,r)}static from(e,t){if("string"==typeof e)return ca.fromString(e,t);if(So(e))return ca.fromBytes(e,t);try{return ca.fromValue(e,0,t)}catch(e){if(e.code!==yo.errors.INVALID_ARGUMENT)throw e}return Qo.throwArgumentError("invalid FixedNumber value","value",e)}static isFixedNumber(e){return!(!e||!e._isFixedNumber)}}const ua=ca.from(1),fa=ca.from("0.5");var da=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 la=new yo("properties/5.7.0");function ha(e,t,r){Object.defineProperty(e,t,{enumerable:!0,value:r,writable:!1})}function pa(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 ma(e){return da(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 ga(e,t){e&&"object"==typeof e||la.throwArgumentError("invalid object","object",e),Object.keys(e).forEach((r=>{t[r]||la.throwArgumentError("invalid object key - "+r,"transaction:"+r,e)}))}function ya(e){const t={};for(const r in e)t[r]=e[r];return t}const ba={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function va(e){if(null==e||ba[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;rAa(e))));if("object"==typeof e){const t={};for(const r in e){const n=e[r];void 0!==n&&ha(t,r,Aa(n))}return t}return la.throwArgumentError("Cannot deepCopy "+typeof e,"object",e)}function Aa(e){return wa(e)}class _a{constructor(e){for(const t in e)this[t]=Aa(e[t])}}var Ea=Object.freeze({__proto__:null,Description:_a,checkProperties:ga,deepCopy:Aa,defineReadOnly:ha,getStatic:pa,resolveProperties:ma,shallowCopy:ya});const Sa="abi/5.7.0",Pa=new yo(Sa),xa={};let ka={calldata:!0,memory:!0,storage:!0},Ma={calldata:!0,memory:!0};function Ca(e,t){if("bytes"===e||"string"===e){if(ka[t])return!0}else if("address"===e){if("payable"===t)return!0}else if((e.indexOf("[")>=0||"tuple"===e)&&Ma[t])return!0;return(ka[t]||"payable"===t)&&Pa.throwArgumentError("invalid modifier","name",t),!1}function Ia(e,t){for(let r in t)ha(e,r,t[r])}const Ra=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),Na=new RegExp(/^(.*)\[([0-9]*)\]$/);class Oa{constructor(e,t){e!==xa&&Pa.throwError("use fromString",yo.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),Ia(this,t);let r=this.type.match(Na);Ia(this,r?{arrayLength:parseInt(r[2]||"-1"),arrayChildren:Oa.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=Ra.sighash),Ra[e]||Pa.throwArgumentError("invalid format type","format",e),e===Ra.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!==Ra.sighash&&(t+=this.type),t+="("+this.components.map((t=>t.format(e))).join(e===Ra.full?", ":",")+")"):t+=this.type,e!==Ra.sighash&&(!0===this.indexed&&(t+=" indexed"),e===Ra.full&&this.name&&(t+=" "+this.name)),t}static from(e,t){return"string"==typeof e?Oa.fromString(e,t):Oa.fromObject(e)}static fromObject(e){return Oa.isParamType(e)?e:new Oa(xa,{name:e.name||null,type:Ha(e.type),indexed:null==e.indexed?null:!!e.indexed,components:e.components?e.components.map(Oa.fromObject):null})}static fromString(e,t){return r=function(e,t){let r=e;function n(t){Pa.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;rOa.fromString(e,t)))}class ja{constructor(e,t){e!==xa&&Pa.throwError("use a static from method",yo.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),Ia(this,t),this._isFragment=!0,Object.freeze(this)}static from(e){return ja.isFragment(e)?e:"string"==typeof e?ja.fromString(e):ja.fromObject(e)}static fromObject(e){if(ja.isFragment(e))return e;switch(e.type){case"function":return Ua.fromObject(e);case"event":return Da.fromObject(e);case"constructor":return za.fromObject(e);case"error":return qa.fromObject(e);case"fallback":case"receive":return null}return Pa.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]?Ua.fromString(e.substring(8).trim()):"constructor"===e.split("(")[0].trim()?za.fromString(e.trim()):"error"===e.split(" ")[0]?qa.fromString(e.substring(5).trim()):Pa.throwArgumentError("unsupported fragment","value",e)}static isFragment(e){return!(!e||!e._isFragment)}}class Da extends ja{format(e){if(e||(e=Ra.sighash),Ra[e]||Pa.throwArgumentError("invalid format type","format",e),e===Ra.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!==Ra.sighash&&(t+="event "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===Ra.full?", ":",")+") ",e!==Ra.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&&Pa.throwArgumentError("invalid event object","value",e);const t={name:Ja(e.name),anonymous:e.anonymous,inputs:e.inputs?e.inputs.map(Oa.fromObject):[],type:"event"};return new Da(xa,t)}static fromString(e){let t=e.match(Wa);t||Pa.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:Pa.warn("unknown modifier: "+e)}})),Da.fromObject({name:t[1].trim(),anonymous:r,inputs:Ta(t[2],!0),type:"event"})}static isEventFragment(e){return e&&e._isFragment&&"event"===e.type}}function $a(e,t){t.gas=null;let r=e.split("@");return 1!==r.length?(r.length>2&&Pa.throwArgumentError("invalid human-readable ABI signature","value",e),r[1].match(/^[0-9]+$/)||Pa.throwArgumentError("invalid human-readable ABI signature gas","value",e),t.gas=Wo.from(r[1]),r[0]):e}function Ba(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 Fa(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&&Pa.throwArgumentError("cannot have constant function with mutability "+t.stateMutability,"value",e),t.payable="payable"===t.stateMutability,null!=e.payable&&!!e.payable!==t.payable&&Pa.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||Pa.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&&Pa.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&&Pa.throwArgumentError("unable to determine stateMutability","value",e),t}class za extends ja{format(e){if(e||(e=Ra.sighash),Ra[e]||Pa.throwArgumentError("invalid format type","format",e),e===Ra.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===Ra.sighash&&Pa.throwError("cannot format a constructor for sighash",yo.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});let t="constructor("+this.inputs.map((t=>t.format(e))).join(e===Ra.full?", ":",")+") ";return this.stateMutability&&"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "),t.trim()}static from(e){return"string"==typeof e?za.fromString(e):za.fromObject(e)}static fromObject(e){if(za.isConstructorFragment(e))return e;"constructor"!==e.type&&Pa.throwArgumentError("invalid constructor object","value",e);let t=Fa(e);t.constant&&Pa.throwArgumentError("constructor cannot be constant","value",e);const r={name:null,type:e.type,inputs:e.inputs?e.inputs.map(Oa.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?Wo.from(e.gas):null};return new za(xa,r)}static fromString(e){let t={type:"constructor"},r=(e=$a(e,t)).match(Wa);return r&&"constructor"===r[1].trim()||Pa.throwArgumentError("invalid constructor string","value",e),t.inputs=Ta(r[2].trim(),!1),Ba(r[3].trim(),t),za.fromObject(t)}static isConstructorFragment(e){return e&&e._isFragment&&"constructor"===e.type}}class Ua extends za{format(e){if(e||(e=Ra.sighash),Ra[e]||Pa.throwArgumentError("invalid format type","format",e),e===Ra.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!==Ra.sighash&&(t+="function "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===Ra.full?", ":",")+") ",e!==Ra.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?Ua.fromString(e):Ua.fromObject(e)}static fromObject(e){if(Ua.isFunctionFragment(e))return e;"function"!==e.type&&Pa.throwArgumentError("invalid function object","value",e);let t=Fa(e);const r={type:e.type,name:Ja(e.name),constant:t.constant,inputs:e.inputs?e.inputs.map(Oa.fromObject):[],outputs:e.outputs?e.outputs.map(Oa.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?Wo.from(e.gas):null};return new Ua(xa,r)}static fromString(e){let t={type:"function"},r=(e=$a(e,t)).split(" returns ");r.length>2&&Pa.throwArgumentError("invalid function string","value",e);let n=r[0].match(Wa);if(n||Pa.throwArgumentError("invalid function signature","value",e),t.name=n[1].trim(),t.name&&Ja(t.name),t.inputs=Ta(n[2],!1),Ba(n[3].trim(),t),r.length>1){let n=r[1].match(Wa);""==n[1].trim()&&""==n[3].trim()||Pa.throwArgumentError("unexpected tokens","value",e),t.outputs=Ta(n[2],!1)}else t.outputs=[];return Ua.fromObject(t)}static isFunctionFragment(e){return e&&e._isFragment&&"function"===e.type}}function La(e){const t=e.format();return"Error(string)"!==t&&"Panic(uint256)"!==t||Pa.throwArgumentError(`cannot specify user defined ${t} error`,"fragment",e),e}class qa extends ja{format(e){if(e||(e=Ra.sighash),Ra[e]||Pa.throwArgumentError("invalid format type","format",e),e===Ra.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==Ra.sighash&&(t+="error "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===Ra.full?", ":",")+") ",t.trim()}static from(e){return"string"==typeof e?qa.fromString(e):qa.fromObject(e)}static fromObject(e){if(qa.isErrorFragment(e))return e;"error"!==e.type&&Pa.throwArgumentError("invalid error object","value",e);const t={type:e.type,name:Ja(e.name),inputs:e.inputs?e.inputs.map(Oa.fromObject):[]};return La(new qa(xa,t))}static fromString(e){let t={type:"error"},r=e.match(Wa);return r||Pa.throwArgumentError("invalid error signature","value",e),t.name=r[1].trim(),t.name&&Ja(t.name),t.inputs=Ta(r[2],!1),La(qa.fromObject(t))}static isErrorFragment(e){return e&&e._isFragment&&"error"===e.type}}function Ha(e){return e.match(/^uint($|[^1-9])/)?e="uint256"+e.substring(4):e.match(/^int($|[^1-9])/)&&(e="int256"+e.substring(3)),e}const Ka=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function Ja(e){return e&&e.match(Ka)||Pa.throwArgumentError(`invalid identifier "${e}"`,"value",e),e}const Wa=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$");const Ga=new yo(Sa);function Va(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 Za{constructor(e,t,r,n){this.name=e,this.type=t,this.localName=r,this.dynamic=n}_throwError(e,t){Ga.throwArgumentError(e,this.localName,t)}}class Xa{constructor(e){ha(this,"wordSize",e||32),this._data=[],this._dataLength=0,this._padding=new Uint8Array(e)}get data(){return To(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(xo(e._data))}writeBytes(e){let t=Po(e);const r=t.length%this.wordSize;return r&&(t=xo([t,this._padding.slice(r)])),this._writeData(t)}_getValue(e){let t=Po(Wo.from(e));return t.length>this.wordSize&&Ga.throwError("value out-of-bounds",yo.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:t.length}),t.length%this.wordSize&&(t=xo([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 Qa{constructor(e,t,r,n){ha(this,"_data",Po(e)),ha(this,"wordSize",t||32),ha(this,"_coerceFunc",r),ha(this,"allowLoose",n),this._offset=0}get data(){return Ro(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):Qa.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:Ga.throwError("data out-of-bounds",yo.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+n})),this._data.slice(this._offset,this._offset+n)}subReader(e){return new Qa(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 Wo.from(this.readBytes(this.wordSize))}}var Ya={}; -/** - * [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 os(e,t,r){let n=0;for(let i=0;it+1+n&&ns.throwError("child data too short",yo.errors.BUFFER_OVERRUN,{})}return{consumed:1+n,result:i}}function us(e,t){if(0===e.length&&ns.throwError("data too short",yo.errors.BUFFER_OVERRUN,{}),e[t]>=248){const r=e[t]-247;t+1+r>e.length&&ns.throwError("data short segment too short",yo.errors.BUFFER_OVERRUN,{});const n=os(e,t+1,r);return t+1+r+n>e.length&&ns.throwError("data long segment too short",yo.errors.BUFFER_OVERRUN,{}),cs(e,t,t+1+r,r+n)}if(e[t]>=192){const r=e[t]-192;return t+1+r>e.length&&ns.throwError("data array too short",yo.errors.BUFFER_OVERRUN,{}),cs(e,t,t+1,r)}if(e[t]>=184){const r=e[t]-183;t+1+r>e.length&&ns.throwError("data array too short",yo.errors.BUFFER_OVERRUN,{});const n=os(e,t+1,r);t+1+r+n>e.length&&ns.throwError("data array too short",yo.errors.BUFFER_OVERRUN,{});return{consumed:1+r+n,result:Ro(e.slice(t+1+r,t+1+r+n))}}if(e[t]>=128){const r=e[t]-128;t+1+r>e.length&&ns.throwError("data too short",yo.errors.BUFFER_OVERRUN,{});return{consumed:1+r,result:Ro(e.slice(t+1,t+1+r))}}return{consumed:1,result:Ro(e[t])}}function fs(e){const t=Po(e),r=us(t,0);return r.consumed!==t.length&&ns.throwArgumentError("invalid rlp data","data",e),r.result}var ds=Object.freeze({__proto__:null,decode:fs,encode:ss});const ls=new yo("address/5.7.0");function hs(e){Co(e,20)||ls.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=Po(ts(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 ps={};for(let e=0;e<10;e++)ps[String(e)]=String(e);for(let e=0;e<26;e++)ps[String.fromCharCode(65+e)]=String(10+e);const ms=Math.floor(function(e){return Math.log10?Math.log10(e):Math.log(e)/Math.LN10}(9007199254740991));function gs(e){let t=(e=(e=e.toUpperCase()).substring(4)+e.substring(0,2)+"00").split("").map((e=>ps[e])).join("");for(;t.length>=ms;){let e=t.substring(0,ms);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 ys(e){let t=null;if("string"!=typeof e&&ls.throwArgumentError("invalid address","address",e),e.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==e.substring(0,2)&&(e="0x"+e),t=hs(e),e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==e&&ls.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)!==gs(e)&&ls.throwArgumentError("bad icap checksum","address",e),r=e.substring(4),t=new Lo(r,36).toString(16);t.length<40;)t="0"+t;t=hs("0x"+t)}else ls.throwArgumentError("invalid address","address",e);var r;return t}function bs(e){let t=null;try{t=ys(e.from)}catch(t){ls.throwArgumentError("missing from address","transaction",e)}return ys(Oo(ts(ss([t,ko(Po(Wo.from(e.nonce).toHexString()))])),12))}var vs=Object.freeze({__proto__:null,getAddress:ys,getContractAddress:bs,getCreate2Address:function(e,t,r){return 32!==No(t)&&ls.throwArgumentError("salt must be 32 bytes","salt",t),32!==No(r)&&ls.throwArgumentError("initCodeHash must be 32 bytes","initCodeHash",r),ys(Oo(ts(xo(["0xff",ys(e),t,r])),12))},getIcapAddress:function(e){let t=(r=ys(e).substring(2),new Lo(r,16).toString(36)).toUpperCase();for(var r;t.length<30;)t="0"+t;return"XE"+gs("XE00"+t)+t},isAddress:function(e){try{return ys(e),!0}catch(e){}return!1}});class ws extends Za{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,t){try{t=ys(t)}catch(e){this._throwError(e.message,t)}return e.writeValue(t)}decode(e){return ys($o(e.readValue().toHexString(),20))}}class As extends Za{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 _s=new yo(Sa);function Es(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||_s.throwError("cannot encode object for signature with missing names",yo.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:r}),e[n]&&_s.throwError("cannot encode object for signature with duplicate names",yo.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:r}),e[n]=!0,r[n]}))}else _s.throwArgumentError("invalid tuple value","tuple",r);t.length!==n.length&&_s.throwArgumentError("types/value length mismatch","tuple",r);let i=new Xa(e.wordSize),o=new Xa(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 Ss(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===yo.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===yo.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 Ps extends Za{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&&_s.throwError("insufficient data length",yo.errors.BUFFER_OVERRUN,{length:e._data.length,count:t}));let r=[];for(let e=0;e>6==2;n++)e++;return e}return e===Fs.OVERRUN?r.length-t-1:0}!function(e){e.current="",e.NFC="NFC",e.NFD="NFD",e.NFKC="NFKC",e.NFKD="NFKD"}(Bs||(Bs={})),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"}(Fs||(Fs={}));const Us=Object.freeze({error:function(e,t,r,n,i){return $s.throwArgumentError(`invalid codepoint at offset ${t}; ${e}`,"bytes",r)},ignore:zs,replace:function(e,t,r,n,i){return e===Fs.OVERLONG?(n.push(i),0):(n.push(65533),zs(e,t,r))}});function Ls(e,t){null==t&&(t=Us.error),e=Po(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)?Fs.UNEXPECTED_CONTINUE:Fs.BAD_PREFIX,n-1,e,r);continue}o=3,a=65535}if(n-1+o>=e.length){n+=t(Fs.OVERRUN,n-1,e,r);continue}let s=i&(1<<8-o-1)-1;for(let i=0;i1114111?n+=t(Fs.OUT_OF_RANGE,n-1-o,e,r,s):s>=55296&&s<=57343?n+=t(Fs.UTF16_SURROGATE,n-1-o,e,r,s):s<=a?n+=t(Fs.OVERLONG,n-1-o,e,r,s):r.push(s))}return r}function qs(e,t=Bs.current){t!=Bs.current&&($s.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 Po(r)}function Hs(e){const t="0000"+e.toString(16);return"\\u"+t.substring(t.length-4)}function Ks(e){return e.map((e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10&1023),56320+(1023&e))))).join("")}function Js(e,t){return Ks(Ls(e,t))}function Ws(e,t=Bs.current){return Ls(qs(e,t))}function Gs(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 Vs(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 Zs(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 Xs=Vs("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"),Qs="ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map((e=>parseInt(e,16))),Ys=[{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}],ec=Gs("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"),tc=Gs("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"),rc=Gs("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?Hs(e):Hs(55296+((e-=65536)>>10&1023))+Hs(56320+(1023&e))})).join("")+'"'},formatBytes32String:function(e){const t=qs(e);if(t.length>31)throw new Error("bytes32 string must be less than 32 bytes");return Ro(xo([t,js]).slice(0,32))},nameprep:function(e){if(e.match(/^[a-z0-9-]*$/i)&&e.length<=59)return e.toLowerCase();let t=Ws(e);var r;r=t.map((e=>{if(Qs.indexOf(e)>=0)return[];if(e>=65024&&e<=65039)return[];let t=function(e){let t=Zs(e,Ys);if(t)return[e+t.s];let r=ec[e];if(r)return r;let n=tc[e];return n?[e+n[0]]:rc[e]||null}(e);return t||[e]})),t=r.reduce(((e,t)=>(t.forEach((t=>{e.push(t)})),e)),[]),t=Ws(Ks(t),Bs.NFKC),t.forEach((e=>{if(Zs(e,nc))throw new Error("STRINGPREP_CONTAINS_PROHIBITED")})),t.forEach((e=>{if(Zs(e,Xs))throw new Error("STRINGPREP_CONTAINS_UNASSIGNED")}));let n=Ks(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=Po(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 Js(t.slice(0,r))},toUtf8Bytes:qs,toUtf8CodePoints:Ws,toUtf8String:Js});class oc extends ks{constructor(e){super("string",e)}defaultValue(){return""}encode(e,t){return super.encode(e,qs(t))}decode(e){return Js(super.decode(e))}}class ac extends Za{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 Es(e,this.coders,t)}decode(e){return e.coerce(this.name,Ss(e,this.coders))}}const sc=new yo(Sa),cc=new RegExp(/^bytes([0-9]*)$/),uc=new RegExp(/^(u?int)([0-9]*)$/);class fc{constructor(e){ha(this,"coerceFunc",e||null)}_getCoder(e){switch(e.baseType){case"address":return new ws(e.name);case"bool":return new xs(e.name);case"string":return new oc(e.name);case"bytes":return new Ms(e.name);case"array":return new Ps(this._getCoder(e.arrayChildren),e.arrayLength,e.name);case"tuple":return new ac((e.components||[]).map((e=>this._getCoder(e))),e.name);case"":return new Is(e.name)}let t=e.type.match(uc);if(t){let r=parseInt(t[2]||"256");return(0===r||r>256||r%8!=0)&&sc.throwArgumentError("invalid "+t[1]+" bit length","param",e),new Ds(r/8,"int"===t[1],e.name)}if(t=e.type.match(cc),t){let r=parseInt(t[1]);return(0===r||r>32)&&sc.throwArgumentError("invalid bytes length","param",e),new Cs(r,e.name)}return sc.throwArgumentError("invalid type","type",e.type)}_getWordSize(){return 32}_getReader(e,t){return new Qa(e,this._getWordSize(),this.coerceFunc,t)}_getWriter(){return new Xa(this._getWordSize())}getDefaultValue(e){const t=e.map((e=>this._getCoder(Oa.from(e))));return new ac(t,"_").defaultValue()}encode(e,t){e.length!==t.length&&sc.throwError("types/values length mismatch",yo.errors.INVALID_ARGUMENT,{count:{types:e.length,values:t.length},value:{types:e,values:t}});const r=e.map((e=>this._getCoder(Oa.from(e)))),n=new ac(r,"_"),i=this._getWriter();return n.encode(i,t),i.data}decode(e,t,r){const n=e.map((e=>this._getCoder(Oa.from(e))));return new ac(n,"_").decode(this._getReader(Po(t),r))}}const dc=new fc;function lc(e){return ts(qs(e))}const hc="hash/5.7.0";function pc(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 bc(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 vc(e){return 1&e?~e>>1:e>>1}function wc(e,t){let r=Array(e);for(let n=0,i=-1;nt[e])):r}function Ec(e,t,r){let n=Array(e).fill(void 0).map((()=>[]));for(let i=0;in[t].push(e)));return n}function Sc(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 yc(Ec(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 Pc(e,t){return Ec(1+t(),1+e,t).map((e=>[e[0],e.slice(1)]))}const xc=bc(pc("AEQF2AO2DEsA2wIrAGsBRABxAN8AZwCcAEwAqgA0AGwAUgByADcATAAVAFYAIQAyACEAKAAYAFgAGwAjABQAMAAmADIAFAAfABQAKwATACoADgAbAA8AHQAYABoAGQAxADgALAAoADwAEwA9ABMAGgARAA4ADwAWABMAFgAIAA8AHgQXBYMA5BHJAS8JtAYoAe4AExozi0UAH21tAaMnBT8CrnIyhrMDhRgDygIBUAEHcoFHUPe8AXBjAewCjgDQR8IICIcEcQLwATXCDgzvHwBmBoHNAqsBdBcUAykgDhAMShskMgo8AY8jqAQfAUAfHw8BDw87MioGlCIPBwZCa4ELatMAAMspJVgsDl8AIhckSg8XAHdvTwBcIQEiDT4OPhUqbyECAEoAS34Aej8Ybx83JgT/Xw8gHxZ/7w8RICxPHA9vBw+Pfw8PHwAPFv+fAsAvCc8vEr8ivwD/EQ8Bol8OEBa/A78hrwAPCU8vESNvvwWfHwNfAVoDHr+ZAAED34YaAdJPAK7PLwSEgDLHAGo1Pz8Pvx9fUwMrpb8O/58VTzAPIBoXIyQJNF8hpwIVAT8YGAUADDNBaX3RAMomJCg9EhUeA29MABsZBTMNJipjOhc19gcI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Glw6eUzmJM95Ovoz+kwLX3c2fTjFeYEsE7vUZm3mqdGJuKh2w9/QGSaqRHs99aScGOdDqkFcACoqdbBoQqqjamhH6Q9ng39JCg3lrGJwd50Qk9ovnqBTr8MME7Ps2wiVfygUmPoUBJJfJWX5Nda0nuncbFkA==")),kc=new Set(_c(xc)),Mc=new Set(_c(xc)),Cc=function(e){let t=[];for(;;){let r=e();if(0==r)break;t.push(Sc(r,e))}for(;;){let r=e()-1;if(r<0)break;t.push(Pc(r,e))}return function(e){const t={};for(let r=0;re-t));return function r(){let n=[];for(;;){let i=_c(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}}()}(xc),Rc=45,Nc=95;function Oc(e){return Ws(e)}function Tc(e){return e.filter((e=>65039!=e))}function jc(e){for(let t of e.split(".")){let e=Oc(t);try{for(let t=e.lastIndexOf(Nc)-1;t>=0;t--)if(e[t]!==Nc)throw new Error("underscore only allowed at start");if(e.length>=4&&e.every((e=>e<128))&&e[2]===Rc&&e[3]===Rc)throw new Error("invalid label extension")}catch(e){throw new Error(`Invalid label "${t}": ${e.message}`)}}return e}function Dc(e){return jc(function(e,t){let r=Oc(e).reverse(),n=[];for(;r.length;){let e=$c(r);if(e){n.push(...t(e));continue}let i=r.pop();if(kc.has(i)){n.push(i);continue}if(Mc.has(i))continue;let o=Cc[i];if(!o)throw new Error(`Disallowed codepoint: 0x${i.toString(16).toUpperCase()}`);n.push(...o)}return jc(function(e){return e.normalize("NFC")}(String.fromCodePoint(...n)))}(e,Tc))}function $c(e,t){var r;let n,i,o=Ic,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 Bc=new yo(hc),Fc=new Uint8Array(32);function zc(e){if(0===e.length)throw new Error("invalid ENS name; empty component");return e}function Uc(e){const t=qs(Dc(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(zc(t.slice(n))),r}function Lc(e){"string"!=typeof e&&Bc.throwArgumentError("invalid ENS name; not a string","name",e);let t=Fc;const r=Uc(e);for(;r.length;)t=ts(xo([t,ts(r.pop())]));return Ro(t)}function qc(e){return Ro(xo(Uc(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"}Fc.fill(0);const Hc="Ethereum Signed Message:\n";function Kc(e){return"string"==typeof e&&(e=qs(e)),ts(xo([qs(Hc),qs(String(e.length)),e]))}var Jc=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 Wc=new yo(hc),Gc=new Uint8Array(32);Gc.fill(0);const Vc=Wo.from(-1),Zc=Wo.from(0),Xc=Wo.from(1),Qc=Wo.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");const Yc=$o(Xc.toHexString(),32),eu=$o(Zc.toHexString(),32),tu={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},ru=["name","version","chainId","verifyingContract","salt"];function nu(e){return function(t){return"string"!=typeof t&&Wc.throwArgumentError(`invalid domain value for ${JSON.stringify(e)}`,`domain.${e}`,t),t}}const iu={name:nu("name"),version:nu("version"),chainId:function(e){try{return Wo.from(e).toString()}catch(e){}return Wc.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",e)},verifyingContract:function(e){try{return ys(e).toLowerCase()}catch(e){}return Wc.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",e)},salt:function(e){try{const t=Po(e);if(32!==t.length)throw new Error("bad length");return Ro(t)}catch(e){}return Wc.throwArgumentError('invalid domain value "salt"',"domain.salt",e)}};function ou(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))&&Wc.throwArgumentError("invalid numeric width","type",e);const i=Qc.mask(r?n-1:n),o=r?i.add(Xc).mul(Vc):Zc;return function(t){const r=Wo.from(t);return(r.lt(o)||r.gt(i))&&Wc.throwArgumentError(`value out-of-bounds for ${e}`,"value",t),$o(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))&&Wc.throwArgumentError("invalid bytes width","type",e),function(t){return Po(t).length!==r&&Wc.throwArgumentError(`invalid length for ${e}`,"value",t),function(e){const t=Po(e),r=t.length%32;return r?To([t,Gc.slice(r)]):Ro(t)}(t)}}}switch(e){case"address":return function(e){return $o(ys(e),32)};case"bool":return function(e){return e?Yc:eu};case"bytes":return function(e){return ts(e)};case"string":return function(e){return lc(e)}}return null}function au(e,t){return`${e}(${t.map((({name:e,type:t})=>t+" "+e)).join(",")})`}class su{constructor(e){ha(this,"types",Object.freeze(Aa(e))),ha(this,"_encoderCache",{}),ha(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]&&Wc.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&&Wc.throwArgumentError(`circular type reference to ${JSON.stringify(a)}`,"types",e);ou(a)||(r[a]||Wc.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?Wc.throwArgumentError("missing primary type","types",e):i.length>1&&Wc.throwArgumentError(`ambiguous primary types or unused types: ${i.map((e=>JSON.stringify(e))).join(", ")}`,"types",e),ha(this,"primaryType",i[0]),function i(o,a){a[o]&&Wc.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]=au(t,e[t])+r.map((t=>au(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=ou(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&&Wc.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",t);let i=t.map(r);return this._types[e]&&(i=i.map(ts)),ts(To(i))}}const r=this.types[e];if(r){const t=lc(this._types[e]);return e=>{const n=r.map((({name:t,type:r})=>{const n=this.getEncoder(r)(e[t]);return this._types[r]?ts(n):n}));return n.unshift(t),To(n)}}return Wc.throwArgumentError(`unknown type: ${e}`,"type",e)}encodeType(e){const t=this._types[e];return t||Wc.throwArgumentError(`unknown type: ${JSON.stringify(e)}`,"name",e),t}encodeData(e,t){return this.getEncoder(e)(t)}hashStruct(e,t){return ts(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(ou(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&&Wc.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)),{}):Wc.throwArgumentError(`unknown type: ${e}`,"type",e)}visit(e,t){return this._visit(this.primaryType,e,t)}static from(e){return new su(e)}static getPrimaryType(e){return su.from(e).primaryType}static hashStruct(e,t,r){return su.from(t).hashStruct(e,r)}static hashDomain(e){const t=[];for(const r in e){const n=tu[r];n||Wc.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(r)}`,"domain",e),t.push({name:r,type:n})}return t.sort(((e,t)=>ru.indexOf(e.name)-ru.indexOf(t.name))),su.hashStruct("EIP712Domain",{EIP712Domain:t},e)}static encode(e,t,r){return To(["0x1901",su.hashDomain(e),su.from(t).hash(r)])}static hash(e,t,r){return ts(su.encode(e,t,r))}static resolveNames(e,t,r,n){return Jc(this,void 0,void 0,(function*(){e=ya(e);const i={};e.verifyingContract&&!Co(e.verifyingContract,20)&&(i[e.verifyingContract]="0x");const o=su.from(t);o.visit(r,((e,t)=>("address"!==e||Co(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){su.hashDomain(e);const n={},i=[];ru.forEach((t=>{const r=e[t];null!=r&&(n[t]=iu[t](r),i.push({name:t,type:tu[t]}))}));const o=su.from(t),a=ya(t);return a.EIP712Domain?Wc.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 Ro(Po(t));if(e.match(/^u?int/))return Wo.from(t).toString();switch(e){case"address":return t.toLowerCase();case"bool":return!!t;case"string":return"string"!=typeof t&&Wc.throwArgumentError("invalid string","value",t),t}return Wc.throwArgumentError("unsupported type","type",e)}))}}}var cu=Object.freeze({__proto__:null,_TypedDataEncoder:su,dnsEncode:qc,ensNormalize:function(e){return Uc(e).map((e=>Js(e))).join(".")},hashMessage:Kc,id:lc,isValidName:function(e){try{return 0!==Uc(e).length}catch(e){}return!1},messagePrefix:Hc,namehash:Lc});const uu=new yo(Sa);class fu extends _a{}class du extends _a{}class lu extends _a{}class hu extends _a{static isIndexed(e){return!(!e||!e._isIndexed)}}const pu={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function mu(e,t){const r=new Error(`deferred error during ABI decoding triggered accessing ${e}`);return r.error=t,r}class gu{constructor(e){let t=[];t="string"==typeof e?JSON.parse(e):e,ha(this,"fragments",t.map((e=>ja.from(e))).filter((e=>null!=e))),ha(this,"_abiCoder",pa(new.target,"getAbiCoder")()),ha(this,"functions",{}),ha(this,"errors",{}),ha(this,"events",{}),ha(this,"structs",{}),this.fragments.forEach((e=>{let t=null;switch(e.type){case"constructor":return this.deploy?void uu.warn("duplicate definition - constructor"):void ha(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]?uu.warn("duplicate definition - "+r):t[r]=e})),this.deploy||ha(this,"deploy",za.from({payable:!1,type:"constructor"})),ha(this,"_isInterface",!0)}format(e){e||(e=Ra.full),e===Ra.sighash&&uu.throwArgumentError("interface does not support formatting sighash","format",e);const t=this.fragments.map((t=>t.format(e)));return e===Ra.json?JSON.stringify(t.map((e=>JSON.parse(e)))):t}static getAbiCoder(){return dc}static getAddress(e){return ys(e)}static getSighash(e){return Oo(lc(e.format()),0,4)}static getEventTopic(e){return lc(e.format())}getFunction(e){if(Co(e)){for(const t in this.functions)if(e===this.getSighash(t))return this.functions[t];uu.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?uu.throwArgumentError("no matching function","name",t):r.length>1&&uu.throwArgumentError("multiple matching functions","name",t),this.functions[r[0]]}const t=this.functions[Ua.fromString(e).format()];return t||uu.throwArgumentError("no matching function","signature",e),t}getEvent(e){if(Co(e)){const t=e.toLowerCase();for(const e in this.events)if(t===this.getEventTopic(e))return this.events[e];uu.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?uu.throwArgumentError("no matching event","name",t):r.length>1&&uu.throwArgumentError("multiple matching events","name",t),this.events[r[0]]}const t=this.events[Da.fromString(e).format()];return t||uu.throwArgumentError("no matching event","signature",e),t}getError(e){if(Co(e)){const t=pa(this.constructor,"getSighash");for(const r in this.errors){if(e===t(this.errors[r]))return this.errors[r]}uu.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?uu.throwArgumentError("no matching error","name",t):r.length>1&&uu.throwArgumentError("multiple matching errors","name",t),this.errors[r[0]]}const t=this.errors[Ua.fromString(e).format()];return t||uu.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 pa(this.constructor,"getSighash")(e)}getEventTopic(e){return"string"==typeof e&&(e=this.getEvent(e)),pa(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=Po(t);return Ro(r.slice(0,4))!==this.getSighash(e)&&uu.throwArgumentError(`data signature does not match error ${e.name}.`,"data",Ro(r)),this._decodeParams(e.inputs,r.slice(4))}encodeErrorResult(e,t){return"string"==typeof e&&(e=this.getError(e)),Ro(xo([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}decodeFunctionData(e,t){"string"==typeof e&&(e=this.getFunction(e));const r=Po(t);return Ro(r.slice(0,4))!==this.getSighash(e)&&uu.throwArgumentError(`data signature does not match function ${e.name}.`,"data",Ro(r)),this._decodeParams(e.inputs,r.slice(4))}encodeFunctionData(e,t){return"string"==typeof e&&(e=this.getFunction(e)),Ro(xo([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}decodeFunctionResult(e,t){"string"==typeof e&&(e=this.getFunction(e));let r=Po(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=Ro(r.slice(0,4)),t=pu[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 uu.throwError("call revert exception"+i,yo.errors.CALL_EXCEPTION,{method:e.format(),data:Ro(t),errorArgs:o,errorName:a,errorSignature:s,reason:n})}encodeFunctionResult(e,t){return"string"==typeof e&&(e=this.getFunction(e)),Ro(this._abiCoder.encode(e.outputs,t||[]))}encodeFilterTopics(e,t){"string"==typeof e&&(e=this.getEvent(e)),t.length>e.inputs.length&&uu.throwError("too many arguments for "+e.format(),yo.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:t});let r=[];e.anonymous||r.push(this.getEventTopic(e));const n=(e,t)=>"string"===e.type?lc(t):"bytes"===e.type?ts(Ro(t)):("bool"===e.type&&"boolean"==typeof t&&(t=t?"0x01":"0x00"),e.type.match(/^u?int/)&&(t=Wo.from(t).toHexString()),"address"===e.type&&this._abiCoder.encode(["address"],[t]),$o(Ro(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?uu.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&&uu.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&&uu.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(lc(a));else if("bytes"===e.type)r.push(ts(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);Co(r[0],32)&&r[0].toLowerCase()===t||uu.throwError("fragment/topic mismatch",yo.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(Oa.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,xo(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 hu({_isIndexed:!0,hash:null});else if(o[t])c[t]=new hu({_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 mu(`property ${JSON.stringify(e.name)}`,r)}}):c[e.name]=r}}));for(let e=0;e{throw mu(`index ${e}`,t)}})}return Object.freeze(c)}parseTransaction(e){let t=this.getFunction(e.data.substring(0,10).toLowerCase());return t?new du({args:this._abiCoder.decode(t.inputs,"0x"+e.data.substring(10)),functionFragment:t,name:t.name,signature:t.format(),sighash:this.getSighash(t),value:Wo.from(e.value||"0")}):null}parseLog(e){let t=this.getEvent(e.topics[0]);return!t||t.anonymous?null:new fu({eventFragment:t,name:t.name,signature:t.format(),topic:this.getEventTopic(t),args:this.decodeEventLog(t,e.data,e.topics)})}parseError(e){const t=Ro(e);let r=this.getError(t.substring(0,10).toLowerCase());return r?new lu({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 yu=Object.freeze({__proto__:null,AbiCoder:fc,ConstructorFragment:za,ErrorFragment:qa,EventFragment:Da,FormatTypes:Ra,Fragment:ja,FunctionFragment:Ua,Indexed:hu,Interface:gu,LogDescription:fu,ParamType:Oa,TransactionDescription:du,checkResultErrors:Va,defaultAbiCoder:dc});var bu=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 vu=new yo("abstract-provider/5.7.0");class wu extends _a{static isForkEvent(e){return!(!e||!e._isForkEvent)}}class Au{constructor(){vu.checkAbstract(new.target,Au),ha(this,"_isProvider",!0)}getFeeData(){return bu(this,void 0,void 0,(function*(){const{block:e,gasPrice:t}=yield ma({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=Wo.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 _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 yo("abstract-signer/5.7.0"),Su=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],Pu=[yo.errors.INSUFFICIENT_FUNDS,yo.errors.NONCE_EXPIRED,yo.errors.REPLACEMENT_UNDERPRICED];class xu{constructor(){Eu.checkAbstract(new.target,xu),ha(this,"_isSigner",!0)}getBalance(e){return _u(this,void 0,void 0,(function*(){return this._checkProvider("getBalance"),yield this.provider.getBalance(this.getAddress(),e)}))}getTransactionCount(e){return _u(this,void 0,void 0,(function*(){return this._checkProvider("getTransactionCount"),yield this.provider.getTransactionCount(this.getAddress(),e)}))}estimateGas(e){return _u(this,void 0,void 0,(function*(){this._checkProvider("estimateGas");const t=yield ma(this.checkTransaction(e));return yield this.provider.estimateGas(t)}))}call(e,t){return _u(this,void 0,void 0,(function*(){this._checkProvider("call");const r=yield ma(this.checkTransaction(e));return yield this.provider.call(r,t)}))}sendTransaction(e){return _u(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 _u(this,void 0,void 0,(function*(){this._checkProvider("getChainId");return(yield this.provider.getNetwork()).chainId}))}getGasPrice(){return _u(this,void 0,void 0,(function*(){return this._checkProvider("getGasPrice"),yield this.provider.getGasPrice()}))}getFeeData(){return _u(this,void 0,void 0,(function*(){return this._checkProvider("getFeeData"),yield this.provider.getFeeData()}))}resolveName(e){return _u(this,void 0,void 0,(function*(){return this._checkProvider("resolveName"),yield this.provider.resolveName(e)}))}checkTransaction(e){for(const t in e)-1===Su.indexOf(t)&&Eu.throwArgumentError("invalid transaction key: "+t,"transaction",e);const t=ya(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()&&Eu.throwArgumentError("from address mismatch","transaction",e),t[0]))),t}populateTransaction(e){return _u(this,void 0,void 0,(function*(){const t=yield ma(this.checkTransaction(e));null!=t.to&&(t.to=Promise.resolve(t.to).then((e=>_u(this,void 0,void 0,(function*(){if(null==e)return null;const t=yield this.resolveName(e);return null==t&&Eu.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||Eu.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",e):Eu.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&&Eu.throwError("network does not support EIP-1559",yo.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),null==t.gasPrice&&(t.gasPrice=e.gasPrice),t.type=0):Eu.throwError("failed to get consistent fee data",yo.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(Pu.indexOf(e.code)>=0)throw e;return Eu.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",yo.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]&&Eu.throwArgumentError("chainId address mismatch","transaction",e),t[0]))),yield ma(t)}))}_checkProvider(e){this.provider||Eu.throwError("missing provider",yo.errors.UNSUPPORTED_OPERATION,{operation:e||"_checkProvider"})}static isSigner(e){return!(!e||!e._isSigner)}}class ku extends xu{constructor(e,t){super(),ha(this,"address",e),ha(this,"provider",t||null)}getAddress(){return Promise.resolve(this.address)}_fail(e,t){return Promise.resolve().then((()=>{Eu.throwError(e,yo.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 ku(this.address,e)}}function Mu(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 Cu=Iu;function Iu(e,t){if(!e)throw new Error(t||"Assertion failed")}Iu.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)};var Ru=Mu((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}})),Nu=Mu((function(e,t){var r=t;r.assert=Cu,r.toArray=Ru.toArray,r.zero2=Ru.zero2,r.toHex=Ru.toHex,r.encode=Ru.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 ao(e,"hex","le")}})),Ou=Nu.getNAF,Tu=Nu.getJSF,ju=Nu.assert;function Du(e,t){this.type=e,this.p=new ao(t.p,16),this.red=t.prime?ao.red(t.prime):ao.mont(this.p),this.zero=new ao(0).toRed(this.red),this.one=new ao(1).toRed(this.red),this.two=new ao(2).toRed(this.red),this.n=t.n&&new ao(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 $u=Du;function Bu(e,t){this.curve=e,this.type=t,this.precomputed=null}Du.prototype.point=function(){throw new Error("Not implemented")},Du.prototype.validate=function(){throw new Error("Not implemented")},Du.prototype._fixedNafMul=function(e,t){ju(e.precomputed);var r=e._getDoubles(),n=Ou(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];ju(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},Du.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=Tu(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)},Bu.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}]},Uu.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()}},Uu.prototype.pointFromX=function(e,t){(e=new ao(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)},Uu.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)},Uu.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o":""},qu.prototype.isInfinity=function(){return this.inf},qu.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)},qu.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)},qu.prototype.getX=function(){return this.x.fromRed()},qu.prototype.getY=function(){return this.y.fromRed()},qu.prototype.mul=function(e){return e=new ao(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)},qu.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)},qu.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)},qu.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))},qu.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},qu.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},Fu(Hu,$u.BasePoint),Uu.prototype.jpoint=function(e,t,r){return new Hu(this,e,t,r)},Hu.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)},Hu.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},Hu.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)},Hu.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)},Hu.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}},Hu.prototype.inspect=function(){return this.isInfinity()?"":""},Hu.prototype.isInfinity=function(){return 0===this.z.cmpn(0)};var Ku=Mu((function(e,t){var r=t;r.base=$u,r.short=Lu,r.mont=null,r.edwards=null})),Ju=Mu((function(e,t){var r,n=t,i=Nu.assert;function o(e){"short"===e.type?this.curve=new Ku.short(e):"edwards"===e.type?this.curve=new Ku.edwards(e):this.curve=new Ku.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:oe.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:oe.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:oe.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:oe.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:oe.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:oe.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:oe.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:oe.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})}));function Wu(e){if(!(this instanceof Wu))return new Wu(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=Ru.toArray(e.entropy,e.entropyEnc||"hex"),r=Ru.toArray(e.nonce,e.nonceEnc||"hex"),n=Ru.toArray(e.pers,e.persEnc||"hex");Cu(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}var Gu=Wu;Wu.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},Wu.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=Ru.toArray(r,n||"hex"),this._update(r));for(var i=[];i.length"};var Qu=Nu.assert;function Yu(e,t){if(e instanceof Yu)return e;this._importDER(e,t)||(Qu(e.r&&e.s,"Signature without r or s"),this.r=new ao(e.r,16),this.s=new ao(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}var ef=Yu;function tf(){this.place=0}function rf(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 nf(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)}}Yu.prototype._importDER=function(e,t){e=Nu.toArray(e,t);var r=new tf;if(48!==e[r.place++])return!1;var n=rf(e,r);if(!1===n)return!1;if(n+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var i=rf(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=rf(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 ao(o),this.s=new ao(s),this.recoveryParam=null,!0},Yu.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=nf(t),r=nf(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];of(n,t.length),(n=n.concat(t)).push(2),of(n,r.length);var i=n.concat(r),o=[48];return of(o,i.length),o=o.concat(i),Nu.encode(o,e)};var af=function(){throw new Error("unsupported")},sf=Nu.assert;function cf(e){if(!(this instanceof cf))return new cf(e);"string"==typeof e&&(sf(Object.prototype.hasOwnProperty.call(Ju,e),"Unknown curve "+e),e=Ju[e]),e instanceof Ju.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 uf=cf;cf.prototype.keyPair=function(e){return new Xu(this,e)},cf.prototype.keyFromPrivate=function(e,t){return Xu.fromPrivate(this,e,t)},cf.prototype.keyFromPublic=function(e,t){return Xu.fromPublic(this,e,t)},cf.prototype.genKeyPair=function(e){e||(e={});for(var t=new Gu({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||af(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),n=this.n.sub(new ao(2));;){var i=new ao(t.generate(r));if(!(i.cmp(n)>0))return i.iaddn(1),this.keyFromPrivate(i)}},cf.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},cf.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 ao(e,16));for(var i=this.n.byteLength(),o=t.getPrivate().toArray("be",i),a=e.toArray("be",i),s=new Gu({hash:this.hash,entropy:o,nonce:a,pers:n.pers,persEnc:n.persEnc||"utf8"}),c=this.n.sub(new ao(1)),u=0;;u++){var f=n.k?n.k(u):new ao(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 ef({r:h,s:p,recoveryParam:m})}}}}}},cf.prototype.verify=function(e,t,r,n){e=this._truncateToN(new ao(e,16)),r=this.keyFromPublic(r,n);var i=(t=new ef(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)},cf.prototype.recoverPubKey=function(e,t,r,n){sf((3&r)===r,"The recovery param is more than two bits"),t=new ef(t,n);var i=this.n,o=new ao(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)},cf.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new ef(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 ff=Mu((function(e,t){var r=t;r.version="6.5.4",r.utils=Nu,r.rand=function(){throw new Error("unsupported")},r.curve=Ku,r.curves=Ju,r.ec=uf,r.eddsa=null})),df=ff.ec;const lf=new yo("signing-key/5.7.0");let hf=null;function pf(){return hf||(hf=new df("secp256k1")),hf}class mf{constructor(e){ha(this,"curve","secp256k1"),ha(this,"privateKey",Ro(e)),32!==No(this.privateKey)&&lf.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const t=pf().keyFromPrivate(Po(this.privateKey));ha(this,"publicKey","0x"+t.getPublic(!1,"hex")),ha(this,"compressedPublicKey","0x"+t.getPublic(!0,"hex")),ha(this,"_isSigningKey",!0)}_addPoint(e){const t=pf().keyFromPublic(Po(this.publicKey)),r=pf().keyFromPublic(Po(e));return"0x"+t.pub.add(r.pub).encodeCompressed("hex")}signDigest(e){const t=pf().keyFromPrivate(Po(this.privateKey)),r=Po(e);32!==r.length&&lf.throwArgumentError("bad digest length","digest",e);const n=t.sign(r,{canonical:!0});return Bo({recoveryParam:n.recoveryParam,r:$o("0x"+n.r.toString(16),32),s:$o("0x"+n.s.toString(16),32)})}computeSharedSecret(e){const t=pf().keyFromPrivate(Po(this.privateKey)),r=pf().keyFromPublic(Po(yf(e)));return $o("0x"+t.derive(r.getPublic()).toString(16),32)}static isSigningKey(e){return!(!e||!e._isSigningKey)}}function gf(e,t){const r=Bo(t),n={r:Po(r.r),s:Po(r.s)};return"0x"+pf().recoverPubKey(Po(e),n,r.recoveryParam).encode("hex",!1)}function yf(e,t){const r=Po(e);if(32===r.length){const e=new mf(r);return t?"0x"+pf().keyFromPrivate(r).getPublic(!0,"hex"):e.publicKey}return 33===r.length?t?Ro(r):"0x"+pf().keyFromPublic(r).getPublic(!1,"hex"):65===r.length?t?"0x"+pf().keyFromPublic(r).getPublic(!0,"hex"):Ro(r):lf.throwArgumentError("invalid public or private key","key","[REDACTED]")}var bf=Object.freeze({__proto__:null,SigningKey:mf,computePublicKey:yf,recoverPublicKey:gf});const vf=new yo("transactions/5.7.0");var wf;function Af(e){return"0x"===e?null:ys(e)}function _f(e){return"0x"===e?Ns:Wo.from(e)}!function(e){e[e.legacy=0]="legacy",e[e.eip2930=1]="eip2930",e[e.eip1559=2]="eip1559"}(wf||(wf={}));const Ef=[{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"}],Sf={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,type:!0,value:!0};function Pf(e){return ys(Oo(ts(Oo(yf(e),1)),12))}function xf(e,t){return Pf(gf(Po(e),t))}function kf(e,t){const r=ko(Wo.from(e).toHexString());return r.length>32&&vf.throwArgumentError("invalid length for "+t,"transaction:"+t,e),r}function Mf(e,t){return{address:ys(e),storageKeys:(t||[]).map(((t,r)=>(32!==No(t)&&vf.throwArgumentError("invalid access list storageKey",`accessList[${e}:${r}]`,t),t.toLowerCase())))}}function Cf(e){if(Array.isArray(e))return e.map(((e,t)=>Array.isArray(e)?(e.length>2&&vf.throwArgumentError("access list expected to be [ address, storageKeys[] ]",`value[${t}]`,e),Mf(e[0],e[1])):Mf(e.address,e.storageKeys)));const t=Object.keys(e).map((t=>{const r=e[t].reduce(((e,t)=>(e[t]=!0,e)),{});return Mf(t,Object.keys(r).sort())}));return t.sort(((e,t)=>e.address.localeCompare(t.address))),t}function If(e){return Cf(e).map((e=>[e.address,e.storageKeys]))}function Rf(e,t){if(null!=e.gasPrice){const t=Wo.from(e.gasPrice),r=Wo.from(e.maxFeePerGas||0);t.eq(r)||vf.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:t,maxFeePerGas:r})}const r=[kf(e.chainId||0,"chainId"),kf(e.nonce||0,"nonce"),kf(e.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),kf(e.maxFeePerGas||0,"maxFeePerGas"),kf(e.gasLimit||0,"gasLimit"),null!=e.to?ys(e.to):"0x",kf(e.value||0,"value"),e.data||"0x",If(e.accessList||[])];if(t){const e=Bo(t);r.push(kf(e.recoveryParam,"recoveryParam")),r.push(ko(e.r)),r.push(ko(e.s))}return To(["0x02",ss(r)])}function Nf(e,t){const r=[kf(e.chainId||0,"chainId"),kf(e.nonce||0,"nonce"),kf(e.gasPrice||0,"gasPrice"),kf(e.gasLimit||0,"gasLimit"),null!=e.to?ys(e.to):"0x",kf(e.value||0,"value"),e.data||"0x",If(e.accessList||[])];if(t){const e=Bo(t);r.push(kf(e.recoveryParam,"recoveryParam")),r.push(ko(e.r)),r.push(ko(e.s))}return To(["0x01",ss(r)])}function Of(e,t){if(null==e.type||0===e.type)return null!=e.accessList&&vf.throwArgumentError("untyped transactions do not support accessList; include type: 1","transaction",e),function(e,t){ga(e,Sf);const r=[];Ef.forEach((function(t){let n=e[t.name]||[];const i={};t.numeric&&(i.hexPad="left"),n=Po(Ro(n,i)),t.length&&n.length!==t.length&&n.length>0&&vf.throwArgumentError("invalid length for "+t.name,"transaction:"+t.name,n),t.maxLength&&(n=ko(n),n.length>t.maxLength&&vf.throwArgumentError("invalid length for "+t.name,"transaction:"+t.name,n)),r.push(Ro(n))}));let n=0;if(null!=e.chainId?(n=e.chainId,"number"!=typeof n&&vf.throwArgumentError("invalid transaction.chainId","transaction",e)):t&&!_o(t)&&t.v>28&&(n=Math.floor((t.v-35)/2)),0!==n&&(r.push(Ro(n)),r.push("0x"),r.push("0x")),!t)return ss(r);const i=Bo(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&&vf.throwArgumentError("transaction.chainId/signature.v mismatch","signature",t)):i.v!==o&&vf.throwArgumentError("transaction.chainId/signature.v mismatch","signature",t),r.push(Ro(o)),r.push(ko(Po(i.r))),r.push(ko(Po(i.s))),ss(r)}(e,t);switch(e.type){case 1:return Nf(e,t);case 2:return Rf(e,t)}return vf.throwError(`unsupported transaction type: ${e.type}`,yo.errors.UNSUPPORTED_OPERATION,{operation:"serializeTransaction",transactionType:e.type})}function Tf(e,t,r){try{const r=_f(t[0]).toNumber();if(0!==r&&1!==r)throw new Error("bad recid");e.v=r}catch(e){vf.throwArgumentError("invalid v for transaction type: 1","v",t[0])}e.r=$o(t[1],32),e.s=$o(t[2],32);try{const t=ts(r(e));e.from=xf(t,{r:e.r,s:e.s,recoveryParam:e.v})}catch(e){}}function jf(e){const t=Po(e);if(t[0]>127)return function(e){const t=fs(e);9!==t.length&&6!==t.length&&vf.throwArgumentError("invalid raw transaction","rawTransaction",e);const r={nonce:_f(t[0]).toNumber(),gasPrice:_f(t[1]),gasLimit:_f(t[2]),to:Af(t[3]),value:_f(t[4]),data:t[5],chainId:0};if(6===t.length)return r;try{r.v=Wo.from(t[6]).toNumber()}catch(e){return r}if(r.r=$o(t[7],32),r.s=$o(t[8],32),Wo.from(r.r).isZero()&&Wo.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(Ro(r.chainId)),i.push("0x"),i.push("0x"),n-=2*r.chainId+8);const o=ts(ss(i));try{r.from=xf(o,{r:Ro(r.r),s:Ro(r.s),recoveryParam:n})}catch(e){}r.hash=ts(e)}return r.type=null,r}(t);switch(t[0]){case 1:return function(e){const t=fs(e.slice(1));8!==t.length&&11!==t.length&&vf.throwArgumentError("invalid component count for transaction type: 1","payload",Ro(e));const r={type:1,chainId:_f(t[0]).toNumber(),nonce:_f(t[1]).toNumber(),gasPrice:_f(t[2]),gasLimit:_f(t[3]),to:Af(t[4]),value:_f(t[5]),data:t[6],accessList:Cf(t[7])};return 8===t.length||(r.hash=ts(e),Tf(r,t.slice(8),Nf)),r}(t);case 2:return function(e){const t=fs(e.slice(1));9!==t.length&&12!==t.length&&vf.throwArgumentError("invalid component count for transaction type: 2","payload",Ro(e));const r=_f(t[2]),n=_f(t[3]),i={type:2,chainId:_f(t[0]).toNumber(),nonce:_f(t[1]).toNumber(),maxPriorityFeePerGas:r,maxFeePerGas:n,gasPrice:null,gasLimit:_f(t[4]),to:Af(t[5]),value:_f(t[6]),data:t[7],accessList:Cf(t[8])};return 9===t.length||(i.hash=ts(e),Tf(i,t.slice(9),Rf)),i}(t)}return vf.throwError(`unsupported transaction type: ${t[0]}`,yo.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:t[0]})}var Df=Object.freeze({__proto__:null,get TransactionTypes(){return wf},accessListify:Cf,computeAddress:Pf,parse:jf,recoverAddress:xf,serialize:Of});var $f=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 Bf=new yo("contracts/5.7.0");function Ff(e,t){return $f(this,void 0,void 0,(function*(){const r=yield t;"string"!=typeof r&&Bf.throwArgumentError("invalid address or ENS name","name",r);try{return ys(r)}catch(e){}e||Bf.throwError("a provider or signer is needed to resolve ENS names",yo.errors.UNSUPPORTED_OPERATION,{operation:"resolveName"});const n=yield e.resolveName(r);return null==n&&Bf.throwArgumentError("resolver or addr is not configured for ENS name","name",r),n}))}function zf(e,t,r){return $f(this,void 0,void 0,(function*(){return Array.isArray(r)?yield Promise.all(r.map(((r,n)=>zf(e,Array.isArray(t)?t[n]:t[r.name],r)))):"address"===r.type?yield Ff(e,t):"tuple"===r.type?yield zf(e,t,r.components):"array"===r.baseType?Array.isArray(t)?yield Promise.all(t.map((t=>zf(e,t,r.arrayChildren)))):Promise.reject(Bf.makeError("invalid value for array",yo.errors.INVALID_ARGUMENT,{argument:"value",value:t})):t}))}function Uf(e,t,r){return $f(this,void 0,void 0,(function*(){let n={};r.length===t.inputs.length+1&&"object"==typeof r[r.length-1]&&(n=ya(r.pop())),Bf.checkArgumentCount(r.length,t.inputs.length,"passed to contract"),e.signer?n.from?n.from=ma({override:Ff(e.signer,n.from),signer:e.signer.getAddress()}).then((e=>$f(this,void 0,void 0,(function*(){return ys(e.signer)!==e.override&&Bf.throwError("Contract with a Signer cannot override from",yo.errors.UNSUPPORTED_OPERATION,{operation:"overrides.from"}),e.override})))):n.from=e.signer.getAddress():n.from&&(n.from=Ff(e.provider,n.from));const i=yield ma({args:zf(e.signer||e.provider,r,t.inputs),address:e.resolvedAddress,overrides:ma(n)||{}}),o=e.interface.encodeFunctionData(t,i.args),a={data:o,to:i.address},s=i.overrides;if(null!=s.nonce&&(a.nonce=Wo.from(s.nonce).toNumber()),null!=s.gasLimit&&(a.gasLimit=Wo.from(s.gasLimit)),null!=s.gasPrice&&(a.gasPrice=Wo.from(s.gasPrice)),null!=s.maxFeePerGas&&(a.maxFeePerGas=Wo.from(s.maxFeePerGas)),null!=s.maxPriorityFeePerGas&&(a.maxPriorityFeePerGas=Wo.from(s.maxPriorityFeePerGas)),null!=s.from&&(a.from=s.from),null!=s.type&&(a.type=s.type),null!=s.accessList&&(a.accessList=Cf(s.accessList)),null==a.gasLimit&&null!=t.gas){let e=21e3;const r=Po(o);for(let t=0;tnull!=n[e]));return c.length&&Bf.throwError(`cannot override ${c.map((e=>JSON.stringify(e))).join(",")}`,yo.errors.UNSUPPORTED_OPERATION,{operation:"overrides",overrides:c}),a}))}function Lf(e,t,r){const n=e.signer||e.provider;return function(...i){return $f(this,void 0,void 0,(function*(){let o;if(i.length===t.inputs.length+1&&"object"==typeof i[i.length-1]){const e=ya(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 Uf(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===yo.errors.CALL_EXCEPTION&&(t.address=e.address,t.args=i,t.transaction=a),t}}))}}function qf(e,t){return function(...r){return $f(this,void 0,void 0,(function*(){e.signer||Bf.throwError("sending a transaction requires a signer",yo.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction"}),null!=e.deployTransaction&&(yield e._deployed());const n=yield Uf(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=Aa(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 Hf(e,t,r){return t.constant?Lf(e,t,r):qf(e,t)}function Kf(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 Jf{constructor(e,t){ha(this,"tag",e),ha(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 Wf extends Jf{constructor(){super("error",null)}}class Gf extends Jf{constructor(e,t,r,n){const i={address:e};let o=t.getEventTopic(r);n?(o!==n[0]&&Bf.throwArgumentError("topic mismatch","topics",n),i.topics=n.slice()):i.topics=[o],super(Kf(i),i),ha(this,"address",e),ha(this,"interface",t),ha(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=Va(e.args);if(t.length)throw t[0].error;const r=(e.args||[]).slice();return r.push(e),r}}class Vf extends Jf{constructor(e,t){super("*",{address:e}),ha(this,"address",e),ha(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 Zf{constructor(e,t,r){ha(this,"interface",pa(new.target,"getInterface")(t)),null==r?(ha(this,"provider",null),ha(this,"signer",null)):xu.isSigner(r)?(ha(this,"provider",r.provider||null),ha(this,"signer",r)):Au.isProvider(r)?(ha(this,"provider",r),ha(this,"signer",null)):Bf.throwArgumentError("invalid signer or provider","signerOrProvider",r),ha(this,"callStatic",{}),ha(this,"estimateGas",{}),ha(this,"functions",{}),ha(this,"populateTransaction",{}),ha(this,"filters",{});{const e={};Object.keys(this.interface.events).forEach((t=>{const r=this.interface.events[t];ha(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?ha(this.filters,t,this.filters[r[0]]):Bf.warn(`Duplicate definition of ${t} (${r.join(", ")})`)}))}if(ha(this,"_runningEvents",{}),ha(this,"_wrappedEmits",{}),null==e&&Bf.throwArgumentError("invalid contract address or ENS name","addressOrName",e),ha(this,"address",e),this.provider)ha(this,"resolvedAddress",Ff(this.provider,e));else try{ha(this,"resolvedAddress",Promise.resolve(ys(e)))}catch(e){Bf.throwError("provider is required to use ENS name as contract address",yo.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])Bf.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]&&ha(this,e,Hf(this,t,!0)),null==this.functions[e]&&ha(this.functions,e,Hf(this,t,!1)),null==this.callStatic[e]&&ha(this.callStatic,e,Lf(this,t,!0)),null==this.populateTransaction[e]&&ha(this.populateTransaction,e,function(e,t){return function(...r){return Uf(e,t,r)}}(this,t)),null==this.estimateGas[e]&&ha(this.estimateGas,e,function(e,t){const r=e.signer||e.provider;return function(...n){return $f(this,void 0,void 0,(function*(){r||Bf.throwError("estimate require a provider or signer",yo.errors.UNSUPPORTED_OPERATION,{operation:"estimateGas"});const i=yield Uf(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]&&ha(this,e,this[r])}catch(e){}null==this.functions[e]&&ha(this.functions,e,this.functions[r]),null==this.callStatic[e]&&ha(this.callStatic,e,this.callStatic[r]),null==this.populateTransaction[e]&&ha(this.populateTransaction,e,this.populateTransaction[r]),null==this.estimateGas[e]&&ha(this.estimateGas,e,this.estimateGas[r])}))}static getContractAddress(e){return bs(e)}static getInterface(e){return gu.isInterface(e)?e:new gu(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&&Bf.throwError("contract not deployed",yo.errors.UNSUPPORTED_OPERATION,{contractAddress:this.address,operation:"getDeployed"}),this)))),this._deployedPromise}fallback(e){this.signer||Bf.throwError("sending a transactions require a signer",yo.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction(fallback)"});const t=ya(e||{});return["from","to"].forEach((function(e){null!=t[e]&&Bf.throwError("cannot override "+e,yo.errors.UNSUPPORTED_OPERATION,{operation:e})})),t.to=this.resolvedAddress,this.deployed().then((()=>this.signer.sendTransaction(t)))}connect(e){"string"==typeof e&&(e=new ku(e,this.provider));const t=new this.constructor(this.address,this.interface,e);return this.deployTransaction&&ha(t,"deployTransaction",this.deployTransaction),t}attach(e){return new this.constructor(e,this.interface,this.signer||this.provider)}static isIndexed(e){return hu.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 Wf);if("event"===e)return this._normalizeRunningEvent(new Jf("event",null));if("*"===e)return this._normalizeRunningEvent(new Vf(this.address,this.interface));const t=this.interface.getEvent(e);return this._normalizeRunningEvent(new Gf(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 Gf(this.address,this.interface,r,e.topics))}catch(e){}const t={address:this.address,topics:e.topics};return this._normalizeRunningEvent(new Jf(Kf(t),t))}return this._normalizeRunningEvent(new Vf(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=Aa(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||Bf.throwError("events require a provider or a signer with a provider",yo.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=ya(n.filter);return"string"==typeof t&&Co(t,32)?(null!=r&&Bf.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 Xf extends Zf{}class Qf{constructor(e){ha(this,"alphabet",e),ha(this,"base",e.length),ha(this,"_alphabetMap",{}),ha(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=Po(ad(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 Ad(xo([null!=this.privateKey?"0x0488ADE4":"0x0488B21E",Ro(this.depth),this.parentFingerprint,$o(Ro(this.index),4),this.chainCode,null!=this.privateKey?xo(["0x00",this.privateKey]):this.publicKey]))}neuter(){return new Pd(Ed,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&bd){if(!this.privateKey)throw new Error("cannot derive child of neutered node");r.set(Po(this.privateKey),1),t&&(t+="'")}else r.set(Po(this.publicKey));for(let t=24;t>=0;t-=8)r[33+(t>>3)]=e>>24-t&255;const n=Po(ad(td.sha512,this.chainCode,r)),i=n.slice(0,32),o=n.slice(32);let a=null,s=null;if(this.privateKey)a=wd(Wo.from(i).add(this.privateKey).mod(gd));else{s=new mf(Ro(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 Pd(Ed,a,s,this.fingerprint,wd(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=bd)throw new Error("invalid path index - "+n);r=r._derive(bd+e)}else{if(!n.match(/^[0-9]+$/))throw new Error("invalid path component - "+n);{const e=parseInt(n);if(e>=bd)throw new Error("invalid path index - "+n);r=r._derive(e)}}}return r}static _fromSeed(e,t){const r=Po(e);if(r.length<16||r.length>64)throw new Error("invalid seed");const n=Po(ad(td.sha512,yd,r));return new Pd(Ed,wd(n.slice(0,32)),null,"0x00000000",wd(n.slice(32)),0,0,t)}static fromMnemonic(e,t,r){return e=Md(kd(e,r=_d(r)),r),Pd._fromSeed(xd(e,t),{phrase:e,path:"m",locale:r.locale})}static fromSeed(e){return Pd._fromSeed(e,null)}static fromExtendedKey(e){const t=ed.decode(e);82===t.length&&Ad(t.slice(0,78))===e||md.throwArgumentError("invalid extended key","extendedKey","[REDACTED]");const r=t[4],n=Ro(t.slice(5,9)),i=parseInt(Ro(t.slice(9,13)).substring(2),16),o=Ro(t.slice(13,45)),a=t.slice(45,78);switch(Ro(t.slice(0,4))){case"0x0488b21e":case"0x043587cf":return new Pd(Ed,null,Ro(a),n,o,i,r,null);case"0x0488ade4":case"0x04358394 ":if(0!==a[0])break;return new Pd(Ed,Ro(a.slice(1)),null,n,o,i,r,null)}return md.throwArgumentError("invalid extended key","extendedKey","[REDACTED]")}}function xd(e,t){t||(t="");const r=qs("mnemonic"+t,Bs.NFKD);return cd(qs(e,Bs.NFKD),r,2048,64,"sha512")}function kd(e,t){t=_d(t),md.checkNormalize();const r=t.split(e);if(r.length%3!=0)throw new Error("invalid mnemonic");const n=Po(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=vd(r.length/3);if((Po(od(n.slice(0,o/8)))[0]&a)!==(n[n.length-1]&a))throw new Error("invalid checksum");return Ro(n.slice(0,o/8))}function Md(e,t){if(t=_d(t),(e=Po(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=Po(od(e))[0]&vd(i);return r[r.length-1]<<=i,r[r.length-1]|=o>>8-i,t.join(r.map((e=>t.getWord(e))))}var Cd=Object.freeze({__proto__:null,HDNode:Pd,defaultPath:Sd,entropyToMnemonic:Md,getAccountPath:function(e){return("number"!=typeof e||e<0||e>=bd||e%1)&&md.throwArgumentError("invalid account index","index",e),`m/44'/60'/${e}'/0/0`},isValidMnemonic:function(e,t){try{return kd(e,t),!0}catch(e){}return!1},mnemonicToEntropy:kd,mnemonicToSeed:xd});const Id=new yo("random/5.7.0");const Rd=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 Nd=Rd.crypto||Rd.msCrypto;function Od(e){(e<=0||e>1024||e%1||e!=e)&&Id.throwArgumentError("invalid length","length",e);const t=new Uint8Array(e);return Nd.getRandomValues(t),Po(t)}Nd&&Nd.getRandomValues||(Id.warn("WARNING: Missing strong random number source"),Nd={getRandomValues:function(e){return Id.throwError("no secure random source avaialble",yo.errors.UNSUPPORTED_OPERATION,{operation:"crypto.getRandomValues"})}});var Td=Object.freeze({__proto__:null,randomBytes:Od,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}}),jd={};!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}()}({get exports(){return Gd},set exports(e){Gd=e}});var Vd=Gd,Zd=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 Xd=new yo($d);function Qd(e){return null!=e&&e.mnemonic&&e.mnemonic.phrase}class Yd extends _a{isKeystoreAccount(e){return!(!e||!e._isKeystoreAccount)}}function el(e,t){const r=Bd(Ud(e,"crypto/ciphertext"));if(Ro(ts(xo([t.slice(16,32),r]))).substring(2)!==Ud(e,"crypto/mac").toLowerCase())throw new Error("invalid password");const n=function(e,t,r){if("aes-128-ctr"===Ud(e,"crypto/cipher")){const n=Bd(Ud(e,"crypto/cipherparams/iv")),i=new Dd.Counter(n);return Po(new Dd.ModeOfOperation.ctr(t,i).decrypt(r))}return null}(e,t.slice(0,16),r);n||Xd.throwError("unsupported cipher",yo.errors.UNSUPPORTED_OPERATION,{operation:"decrypt"});const i=t.slice(32,64),o=Pf(n);if(e.address){let t=e.address.toLowerCase();if("0x"!==t.substring(0,2)&&(t="0x"+t),ys(t)!==o)throw new Error("address mismatch")}const a={_isKeystoreAccount:!0,address:o,privateKey:Ro(n)};if("0.1"===Ud(e,"x-ethers/version")){const t=Bd(Ud(e,"x-ethers/mnemonicCiphertext")),r=Bd(Ud(e,"x-ethers/mnemonicCounter")),n=new Dd.Counter(r),o=new Dd.ModeOfOperation.ctr(i,n),s=Ud(e,"x-ethers/path")||Sd,c=Ud(e,"x-ethers/locale")||"en",u=Po(o.decrypt(t));try{const e=Md(u,c),t=Pd.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!==yo.errors.INVALID_ARGUMENT||"wordlist"!==e.argument)throw e}}return new Yd(a)}function tl(e,t,r,n,i){return Po(cd(e,t,r,n,i))}function rl(e,t,r,n,i){return Promise.resolve(tl(e,t,r,n,i))}function nl(e,t,r,n,i){const o=zd(t),a=Ud(e,"crypto/kdf");if(a&&"string"==typeof a){const t=function(e,t){return Xd.throwArgumentError("invalid key-derivation function parameters",e,t)};if("scrypt"===a.toLowerCase()){const r=Bd(Ud(e,"crypto/kdfparams/salt")),s=parseInt(Ud(e,"crypto/kdfparams/n")),c=parseInt(Ud(e,"crypto/kdfparams/r")),u=parseInt(Ud(e,"crypto/kdfparams/p"));s&&c&&u||t("kdf",a),0!=(s&s-1)&&t("N",s);const f=parseInt(Ud(e,"crypto/kdfparams/dklen"));return 32!==f&&t("dklen",f),n(o,r,s,c,u,64,i)}if("pbkdf2"===a.toLowerCase()){const n=Bd(Ud(e,"crypto/kdfparams/salt"));let i=null;const a=Ud(e,"crypto/kdfparams/prf");"hmac-sha256"===a?i="sha256":"hmac-sha512"===a?i="sha512":t("prf",a);const s=parseInt(Ud(e,"crypto/kdfparams/c")),c=parseInt(Ud(e,"crypto/kdfparams/dklen"));return 32!==c&&t("dklen",c),r(o,n,s,c,i)}}return Xd.throwArgumentError("unsupported key-derivation function","kdf",a)}function il(e,t){const r=JSON.parse(e);return el(r,nl(r,t,tl,Vd.syncScrypt))}function ol(e,t,r){return Zd(this,void 0,void 0,(function*(){const n=JSON.parse(e);return el(n,yield nl(n,t,rl,Vd.scrypt,r))}))}function al(e,t,r,n){try{if(ys(e.address)!==Pf(e.privateKey))throw new Error("address/privateKey mismatch");if(Qd(e)){const t=e.mnemonic;if(Pd.fromMnemonic(t.phrase,null,t.locale).derivePath(t.path||Sd).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=Po(e.privateKey),o=zd(t);let a=null,s=null,c=null;if(Qd(e)){const t=e.mnemonic;a=Po(kd(t.phrase,t.locale||"en")),s=t.path||Sd,c=t.locale||"en"}let u=r.client;u||(u="ethers.js");let f=null;f=r.salt?Po(r.salt):Od(32);let d=null;if(r.iv){if(d=Po(r.iv),16!==d.length)throw new Error("invalid iv")}else d=Od(16);let l=null;if(r.uuid){if(l=Po(r.uuid),16!==l.length)throw new Error("invalid uuid")}else l=Od(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)),Vd.scrypt(o,f,h,p,m,64,n).then((t=>{const r=(t=Po(t)).slice(0,16),n=t.slice(16,32),o=t.slice(32,64),g=new Dd.Counter(d),y=Po(new Dd.ModeOfOperation.ctr(r,g).encrypt(i)),b=ts(xo([n,y])),v={address:e.address.substring(2).toLowerCase(),id:Ld(l),version:3,crypto:{cipher:"aes-128-ctr",cipherparams:{iv:Ro(d).substring(2)},ciphertext:Ro(y).substring(2),kdf:"scrypt",kdfparams:{salt:Ro(f).substring(2),n:h,dklen:32,p:m,r:p},mac:b.substring(2)}};if(a){const e=Od(16),t=new Dd.Counter(e),r=Po(new Dd.ModeOfOperation.ctr(o,t).encrypt(a)),n=new Date,i=n.getUTCFullYear()+"-"+Fd(n.getUTCMonth()+1,2)+"-"+Fd(n.getUTCDate(),2)+"T"+Fd(n.getUTCHours(),2)+"-"+Fd(n.getUTCMinutes(),2)+"-"+Fd(n.getUTCSeconds(),2)+".0Z";v["x-ethers"]={client:u,gethFilename:"UTC--"+i+"--"+v.address,mnemonicCounter:Ro(e).substring(2),mnemonicCiphertext:Ro(r).substring(2),path:s,locale:c,version:"0.1"}}return JSON.stringify(v)}))}function sl(e,t,r){if(Jd(e)){r&&r(0);const n=Kd(e,t);return r&&r(1),Promise.resolve(n)}return Wd(e)?ol(e,t,r):Promise.reject(new Error("invalid JSON wallet"))}function cl(e,t){if(Jd(e))return Kd(e,t);if(Wd(e))return il(e,t);throw new Error("invalid JSON wallet")}var ul=Object.freeze({__proto__:null,decryptCrowdsale:Kd,decryptJsonWallet:sl,decryptJsonWalletSync:cl,decryptKeystore:ol,decryptKeystoreSync:il,encryptKeystore:al,getJsonWalletAddress:function(e){if(Jd(e))try{return ys(JSON.parse(e).ethaddr)}catch(e){return null}if(Wd(e))try{return ys(JSON.parse(e).address)}catch(e){return null}return null},isCrowdsaleWallet:Jd,isKeystoreWallet:Wd});var fl=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 dl=new yo("wallet/5.7.0");class ll extends xu{constructor(e,t){if(super(),null!=(r=e)&&Co(r.privateKey,32)&&null!=r.address){const t=new mf(e.privateKey);if(ha(this,"_signingKey",(()=>t)),ha(this,"address",Pf(this.publicKey)),this.address!==ys(e.address)&&dl.throwArgumentError("privateKey/address mismatch","privateKey","[REDACTED]"),function(e){const t=e.mnemonic;return t&&t.phrase}(e)){const t=e.mnemonic;ha(this,"_mnemonic",(()=>({phrase:t.phrase,path:t.path||Sd,locale:t.locale||"en"})));const r=this.mnemonic;Pf(Pd.fromMnemonic(r.phrase,null,r.locale).derivePath(r.path).privateKey)!==this.address&&dl.throwArgumentError("mnemonic/address mismatch","privateKey","[REDACTED]")}else ha(this,"_mnemonic",(()=>null))}else{if(mf.isSigningKey(e))"secp256k1"!==e.curve&&dl.throwArgumentError("unsupported curve; must be secp256k1","privateKey","[REDACTED]"),ha(this,"_signingKey",(()=>e));else{"string"==typeof e&&e.match(/^[0-9a-f]*$/i)&&64===e.length&&(e="0x"+e);const t=new mf(e);ha(this,"_signingKey",(()=>t))}ha(this,"_mnemonic",(()=>null)),ha(this,"address",Pf(this.publicKey))}var r;t&&!Au.isProvider(t)&&dl.throwArgumentError("invalid provider","provider",t),ha(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 ll(this,e)}signTransaction(e){return ma(e).then((t=>{null!=t.from&&(ys(t.from)!==this.address&&dl.throwArgumentError("transaction from address mismatch","transaction.from",e.from),delete t.from);const r=this._signingKey().signDigest(ts(Of(t)));return Of(t,r)}))}signMessage(e){return fl(this,void 0,void 0,(function*(){return Fo(this._signingKey().signDigest(Kc(e)))}))}_signTypedData(e,t,r){return fl(this,void 0,void 0,(function*(){const n=yield su.resolveNames(e,t,r,(e=>(null==this.provider&&dl.throwError("cannot resolve ENS names without a provider",yo.errors.UNSUPPORTED_OPERATION,{operation:"resolveName",value:e}),this.provider.resolveName(e))));return Fo(this._signingKey().signDigest(su.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={}),al(this,e,t,r)}static createRandom(e){let t=Od(16);e||(e={}),e.extraEntropy&&(t=Po(Oo(ts(xo([t,e.extraEntropy])),0,16)));const r=Md(t,e.locale);return ll.fromMnemonic(r,e.path,e.locale)}static fromEncryptedJson(e,t,r){return sl(e,t,r).then((e=>new ll(e)))}static fromEncryptedJsonSync(e,t){return new ll(cl(e,t))}static fromMnemonic(e,t,r){return t||(t=Sd),new ll(Pd.fromMnemonic(e,null,r).derivePath(t))}}var hl=Object.freeze({__proto__:null,Wallet:ll,verifyMessage:function(e,t){return xf(Kc(e),t)},verifyTypedData:function(e,t,r,n){return xf(su.hash(e,t,r),n)}});const pl=new yo("networks/5.7.1");function ml(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 ml(e)},t}function gl(e,t){const r=function(r,n){return r.JsonRpcProvider?new r.JsonRpcProvider(e,t):null};return r.renetwork=function(t){return gl(e,t)},r}const yl={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:ml("homestead")},bl={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:ml("ropsten")},vl={chainId:63,name:"classicMordor",_defaultProvider:gl("https://www.ethercluster.com/mordor","classicMordor")},wl={unspecified:{chainId:0,name:"unspecified"},homestead:yl,mainnet:yl,morden:{chainId:2,name:"morden"},ropsten:bl,testnet:bl,rinkeby:{chainId:4,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"rinkeby",_defaultProvider:ml("rinkeby")},kovan:{chainId:42,name:"kovan",_defaultProvider:ml("kovan")},goerli:{chainId:5,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"goerli",_defaultProvider:ml("goerli")},kintsugi:{chainId:1337702,name:"kintsugi"},sepolia:{chainId:11155111,name:"sepolia",_defaultProvider:ml("sepolia")},classic:{chainId:61,name:"classic",_defaultProvider:gl("https://www.ethercluster.com/etc","classic")},classicMorden:{chainId:62,name:"classicMorden"},classicMordor:vl,classicTestnet:vl,classicKotti:{chainId:6,name:"classicKotti",_defaultProvider:gl("https://www.ethercluster.com/kotti","classicKotti")},xdai:{chainId:100,name:"xdai"},matic:{chainId:137,name:"matic",_defaultProvider:ml("matic")},maticmum:{chainId:80001,name:"maticmum"},optimism:{chainId:10,name:"optimism",_defaultProvider:ml("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 Al=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 _l(e,t){return Al(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:Po(new Uint8Array(i))}}))}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())}))};const Sl=new yo("web/5.7.1");function Pl(e){return new Promise((t=>{setTimeout(t,e)}))}function xl(e,t){if(null==e)return null;if("string"==typeof e)return e;if(_o(e)){if(t&&("text"===t.split("/")[0]||"application/json"===t.split(";")[0].trim()))try{return Js(e)}catch(e){}return Ro(e)}return e}function kl(e,t,r){const n="object"==typeof e&&null!=e.throttleLimit?e.throttleLimit:12;Sl.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;Sl.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||Sl.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&&Sl.throwError("basic authentication requires a secure https url",yo.errors.INVALID_ARGUMENT,{argument:"url",url:c,user:e.user,password:"[REDACTED]"});const t=e.user+":"+e.password;s.authorization={key:"Authorization",value:"Basic "+mc(qs(t))}}null!=e.skipFetchSetup&&(u.skipFetchSetup=!!e.skipFetchSetup),null!=e.fetchOptions&&(u.fetchOptions=ya(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]?pc(h[3]):(p=h[3],qs(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){Sl.throwError("processing response error",yo.errors.SERVER_ERROR,{body:xl(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(Sl.makeError("timeout",yo.errors.TIMEOUT,{requestBody:xl(u.body,m["content-type"]),requestMethod:u.method,timeout:d,url:c})))}),d))})),cancel:function(){null!=e&&(clearTimeout(e),e=null)}}}(),y=function(){return El(this,void 0,void 0,(function*(){for(let e=0;e=300)&&(g.cancel(),Sl.throwError("bad response",yo.errors.SERVER_ERROR,{status:t.statusCode,headers:t.headers,body:xl(s,t.headers?t.headers["content-type"]:null),requestBody:xl(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=ya(r.headers),r.headers["content-type"]="application/json")}else r.headers={"content-type":"application/json"};e=r}return kl(e,n,((e,t)=>{let n=null;if(null!=e)try{n=JSON.parse(Js(e))}catch(t){Sl.throwError("invalid JSON",yo.errors.SERVER_ERROR,{body:e,error:t})}return r&&(n=r(n,t)),n}))}function Cl(e,t){return t||(t={}),null==(t=ya(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 Il=Object.freeze({__proto__:null,_fetchData:kl,fetchJson:Ml,poll:Cl}),Rl="qpzry9x8gf2tvdw0s3jn54khce6mua7l",Nl={},Ol=0;Ol>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 Dl(e){for(var t=1,r=0;r126)return"Invalid prefix ("+e+")";t=jl(t)^n>>5}for(t=jl(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=Dl(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 Bl(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=Dl(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=jl(n)^a,i+=Rl.charAt(a)}for(o=0;o<6;++o)n=jl(n);for(n^=1,o=0;o<6;++o){i+=Rl.charAt(n>>5*(5-o)&31)}return i},toWordsUnsafe:function(e){var t=Bl(e,8,5,!0);if(Array.isArray(t))return t},toWords:function(e){var t=Bl(e,8,5,!0);if(Array.isArray(t))return t;throw new Error(t)},fromWordsUnsafe:function(e){var t=Bl(e,5,8,!1);if(Array.isArray(t))return t},fromWords:function(e){var t=Bl(e,5,8,!1);if(Array.isArray(t))return t;throw new Error(t)}};const zl="providers/5.7.2",Ul=new yo(zl);class Ll{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:Ll.allowNull(this.accessList.bind(this),null),blockHash:Ll.allowNull(o,null),blockNumber:Ll.allowNull(s,null),transactionIndex:Ll.allowNull(s,null),confirmations:Ll.allowNull(s,null),from:t,gasPrice:Ll.allowNull(r),maxPriorityFeePerGas:Ll.allowNull(r),maxFeePerGas:Ll.allowNull(r),gasLimit:r,to:Ll.allowNull(t,null),value:r,nonce:s,data:i,r:Ll.allowNull(this.uint256),s:Ll.allowNull(this.uint256),v:Ll.allowNull(s),creates:Ll.allowNull(t,null),raw:Ll.allowNull(i)},e.transactionRequest={from:Ll.allowNull(t),nonce:Ll.allowNull(s),gasLimit:Ll.allowNull(r),gasPrice:Ll.allowNull(r),maxPriorityFeePerGas:Ll.allowNull(r),maxFeePerGas:Ll.allowNull(r),to:Ll.allowNull(t),value:Ll.allowNull(r),data:Ll.allowNull((e=>this.data(e,!0))),type:Ll.allowNull(s),accessList:Ll.allowNull(this.accessList.bind(this),null)},e.receiptLog={transactionIndex:s,blockNumber:s,transactionHash:o,address:t,topics:Ll.arrayOf(o),data:i,logIndex:s,blockHash:o},e.receipt={to:Ll.allowNull(this.address,null),from:Ll.allowNull(this.address,null),contractAddress:Ll.allowNull(t,null),transactionIndex:s,root:Ll.allowNull(a),gasUsed:r,logsBloom:Ll.allowNull(i),blockHash:o,transactionHash:o,logs:Ll.arrayOf(this.receiptLog.bind(this)),blockNumber:s,confirmations:Ll.allowNull(s,null),cumulativeGasUsed:r,effectiveGasPrice:Ll.allowNull(r),status:Ll.allowNull(s),type:c},e.block={hash:Ll.allowNull(o),parentHash:o,number:s,timestamp:s,nonce:Ll.allowNull(a),difficulty:this.difficulty.bind(this),gasLimit:r,gasUsed:r,miner:Ll.allowNull(t),extraData:i,transactions:Ll.allowNull(Ll.arrayOf(o)),baseFeePerGas:Ll.allowNull(r)},e.blockWithTransactions=ya(e.block),e.blockWithTransactions.transactions=Ll.allowNull(Ll.arrayOf(this.transactionResponse.bind(this))),e.filter={fromBlock:Ll.allowNull(n,void 0),toBlock:Ll.allowNull(n,void 0),blockHash:Ll.allowNull(o,void 0),address:Ll.allowNull(t,void 0),topics:Ll.allowNull(this.topics.bind(this),void 0)},e.filterLog={blockNumber:Ll.allowNull(s),blockHash:Ll.allowNull(o),transactionIndex:s,removed:Ll.allowNull(this.boolean.bind(this)),address:t,data:Ll.allowFalsish(i,"0x"),topics:Ll.arrayOf(o),transactionHash:o,logIndex:s},e}accessList(e){return Cf(e||[])}number(e){return"0x"===e?0:Wo.from(e).toNumber()}type(e){return"0x"===e||null==e?0:Wo.from(e).toNumber()}bigNumber(e){return Wo.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),Co(e))?e.toLowerCase():Ul.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 ys(e)}callAddress(e){if(!Co(e,32))return null;const t=ys(Oo(e,12));return"0x0000000000000000000000000000000000000000"===t?null:t}contractAddress(e){return bs(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||Co(e))return jo(e);throw new Error("invalid blockTag")}hash(e,t){const r=this.hex(e,t);return 32!==No(r)?Ul.throwArgumentError("invalid hash","value",e):r}difficulty(e){if(null==e)return null;const t=Wo.from(e);try{return t.toNumber()}catch(e){}return null}uint256(e){if(!Co(e))throw new Error("invalid uint256");return $o(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=Ll.check(t,e);return n._difficulty=null==r?null:Wo.from(r),n}block(e){return this._block(e,this.formats.block)}blockWithTransactions(e){return this._block(e,this.formats.blockWithTransactions)}transactionRequest(e){return Ll.check(this.formats.transactionRequest,e)}transactionResponse(e){null!=e.gas&&null==e.gasLimit&&(e.gasLimit=e.gas),e.to&&Wo.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=Ll.check(this.formats.transaction,e);if(null!=e.chainId){let r=e.chainId;Co(r)&&(r=Wo.from(r).toNumber()),t.chainId=r}else{let r=e.networkId;null==r&&null==t.v&&(r=e.chainId),Co(r)&&(r=Wo.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 jf(e)}receiptLog(e){return Ll.check(this.formats.receiptLog,e)}receipt(e){const t=Ll.check(this.formats.receipt,e);if(null!=t.root)if(t.root.length<=4){const e=Wo.from(t.root).toNumber();0===e||1===e?(null!=t.status&&t.status!==e&&Ul.throwArgumentError("alt-root-status/status mismatch","value",{root:t.root,status:t.status}),t.status=e,delete t.root):Ul.throwArgumentError("invalid alt-root-status","value.root",t.root)}else 66!==t.root.length&&Ul.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 Ll.check(this.formats.filter,e)}filterLog(e){return Ll.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 ql=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 yo(zl);function Kl(e){return null==e?"null":(32!==No(e)&&Hl.throwArgumentError("invalid topic","topic",e),e.toLowerCase())}function Jl(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[Kl(e)]=!0}));const r=Object.keys(t);return r.sort(),r.join("|")}return Kl(e)})).join("&")}function Wl(e){if("string"==typeof e){if(32===No(e=e.toLowerCase()))return"tx:"+e;if(-1===e.indexOf(":"))return e}else{if(Array.isArray(e))return"filter:*:"+Jl(e);if(wu.isForkEvent(e))throw Hl.warn("not implemented"),new Error("not implemented");if(e&&"object"==typeof e)return"filter:"+(e.address||"*")+":"+Jl(e.topics||[])}throw new Error("invalid event - "+e)}function Gl(){return(new Date).getTime()}function Vl(e){return new Promise((t=>{setTimeout(t,e)}))}const Zl=["block","network","pending","poll"];class Xl{constructor(e,t,r){ha(this,"tag",e),ha(this,"listener",t),ha(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||Zl.indexOf(this.tag)>=0}}const Ql={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 Yl(e){return $o(Wo.from(e).toHexString(),32)}function eh(e){return ed.encode(xo([e,Oo(od(od(e)),0,4)]))}const th=new RegExp("^(ipfs)://(.*)$","i"),rh=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),th,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function nh(e,t){try{return Js(ih(e,t))}catch(e){}return null}function ih(e,t){if("0x"===e)return null;const r=Wo.from(Oo(e,t,t+32)).toNumber(),n=Wo.from(Oo(e,r,r+32)).toNumber();return Oo(e,r+32,r+32+n)}function oh(e){return e.match(/^ipfs:\/\/ipfs\//i)?e=e.substring(12):e.match(/^ipfs:\/\//i)?e=e.substring(7):Hl.throwArgumentError("unsupported IPFS format","link",e),`https://gateway.ipfs.io/ipfs/${e}`}function ah(e){const t=Po(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 sh(e){if(e.length%32==0)return e;const t=new Uint8Array(32*Math.ceil(e.length/32));return t.set(e),t}function ch(e){const t=[];let r=0;for(let n=0;nWo.from(e).eq(1))).catch((e=>{if(e.code===yo.errors.CALL_EXCEPTION)return!1;throw this._supportsEip2544=null,e}))),this._supportsEip2544}_fetch(e,t){return ql(this,void 0,void 0,(function*(){const r={to:this.address,ccipReadEnabled:!0,data:To([e,Lc(this.name),t||"0x"])};let n=!1;(yield this.supportsWildcard())&&(n=!0,r.data=To(["0x9061b923",ch([qc(this.name),r.data])]));try{let e=yield this.provider.call(r);return Po(e).length%32==4&&Hl.throwError("resolver threw error",yo.errors.CALL_EXCEPTION,{transaction:r,data:e}),n&&(e=ih(e,0)),e}catch(e){if(e.code===yo.errors.CALL_EXCEPTION)return null;throw e}}))}_fetchBytes(e,t){return ql(this,void 0,void 0,(function*(){const r=yield this._fetch(e,t);return null!=r?ih(r,0):null}))}_getAddress(e,t){const r=Ql[String(e)];if(null==r&&Hl.throwError(`unsupported coin type: ${e}`,yo.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`}),"eth"===r.ilk)return this.provider.formatter.address(t);const n=Po(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 eh(xo([[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 eh(xo([[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=Fl.toWords(n.slice(2));return e.unshift(t),Fl.encode(r.prefix,e)}}return null}getAddress(e){return ql(this,void 0,void 0,(function*(){if(null==e&&(e=60),60===e)try{const e=yield this._fetch("0x3b3b57de");return"0x"===e||e===js?null:this.provider.formatter.callAddress(e)}catch(e){if(e.code===yo.errors.CALL_EXCEPTION)return null;throw e}const t=yield this._fetchBytes("0xf1cb7e06",Yl(e));if(null==t||"0x"===t)return null;const r=this._getAddress(e,t);return null==r&&Hl.throwError("invalid or unsupported coin data",yo.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`,coinType:e,data:t}),r}))}getAvatar(){return ql(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 Hl.throwError("invalid or unsupported content hash data",yo.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:e})}))}getText(e){return ql(this,void 0,void 0,(function*(){let t=qs(e);t=xo([Yl(64),Yl(t.length),t]),t.length%32!=0&&(t=xo([t,$o("0x",32-e.length%32)]));const r=yield this._fetchBytes("0x59d1d43c",Ro(t));return null==r||"0x"===r?null:Js(r)}))}}let fh=null,dh=1;class lh extends Au{constructor(e){if(super(),this._events=[],this._emitted={block:-2},this.disableCcipRead=!1,this.formatter=new.target.getFormatter(),ha(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=pa(new.target,"getNetwork")(e);t?(ha(this,"_network",t),this.emit("network",t,null)):Hl.throwArgumentError("invalid network","network",e)}this._maxInternalBlockNumber=-1024,this._lastBlockNumber=-2,this._maxFilterBlockRange=10,this._pollingInterval=4e3,this._fastQueryDate=0}_ready(){return ql(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||Hl.throwError("no network detected",yo.errors.UNKNOWN_ERROR,{}),null==this._network&&(this.anyNetwork?this._network=e:ha(this,"_network",e),this.emit("network",e,null))}return this._network}))}get ready(){return Cl((()=>this._ready().then((e=>e),(e=>{if(e.code!==yo.errors.NETWORK_ERROR||"noNetwork"!==e.event)throw e}))))}static getFormatter(){return null==fh&&(fh=new Ll),fh}static getNetwork(e){return function(e){if(null==e)return null;if("number"==typeof e){for(const t in wl){const r=wl[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=wl[e];return null==t?null:{name:t.name,chainId:t.chainId,ensAddress:t.ensAddress,_defaultProvider:t._defaultProvider||null}}const t=wl[e.name];if(!t)return"number"!=typeof e.chainId&&pl.throwArgumentError("invalid network chainId","network",e),e;0!==e.chainId&&e.chainId!==t.chainId&&pl.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 ql(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 Ml({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 Hl.throwError(`response not found during CCIP fetch: ${u}`,yo.errors.SERVER_ERROR,{url:t,errorMessage:u});o.push(u)}return Hl.throwError(`error encountered during CCIP fetch: ${o.map((e=>JSON.stringify(e))).join(", ")}`,yo.errors.SERVER_ERROR,{urls:r,errorMessages:o})}))}_getInternalBlockNumber(e){return ql(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(Gl()-r.respTime<=e)return r.blockNumber;break}catch(e){if(this._internalBlockNumber===t)break}}const t=Gl(),r=ma({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=Gl();return(e=Wo.from(e).toNumber()){this._internalBlockNumber===r&&(this._internalBlockNumber=null)})),(yield r).blockNumber}))}poll(){return ql(this,void 0,void 0,(function*(){const e=dh++,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)Hl.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${r})`),this.emit("error",Hl.makeError("network block skew detected",yo.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 ql(this,void 0,void 0,(function*(){return Hl.throwError("provider does not support network detection",yo.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"})}))}getNetwork(){return ql(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 Vl(0),this._network;const r=Hl.makeError("underlying network changed",yo.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=Gl();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 ql(this,void 0,void 0,(function*(){return this._waitForTransaction(e,null==t?1:t,r||0,null)}))}_waitForTransaction(e,t,r,n){return ql(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=>ql(this,void 0,void 0,(function*(){s||(yield Vl(1e3),this.getTransactionCount(n.from).then((f=>ql(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(Hl.makeError("timeout exceeded",yo.errors.TIMEOUT,{timeout:r}))}),r);e.unref&&e.unref(),a.push((()=>{clearTimeout(e)}))}}))}))}getBlockNumber(){return ql(this,void 0,void 0,(function*(){return this._getInternalBlockNumber(0)}))}getGasPrice(){return ql(this,void 0,void 0,(function*(){yield this.getNetwork();const e=yield this.perform("getGasPrice",{});try{return Wo.from(e)}catch(t){return Hl.throwError("bad result from backend",yo.errors.SERVER_ERROR,{method:"getGasPrice",result:e,error:t})}}))}getBalance(e,t){return ql(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield ma({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),n=yield this.perform("getBalance",r);try{return Wo.from(n)}catch(e){return Hl.throwError("bad result from backend",yo.errors.SERVER_ERROR,{method:"getBalance",params:r,result:n,error:e})}}))}getTransactionCount(e,t){return ql(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield ma({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),n=yield this.perform("getTransactionCount",r);try{return Wo.from(n).toNumber()}catch(e){return Hl.throwError("bad result from backend",yo.errors.SERVER_ERROR,{method:"getTransactionCount",params:r,result:n,error:e})}}))}getCode(e,t){return ql(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield ma({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),n=yield this.perform("getCode",r);try{return Ro(n)}catch(e){return Hl.throwError("bad result from backend",yo.errors.SERVER_ERROR,{method:"getCode",params:r,result:n,error:e})}}))}getStorageAt(e,t,r){return ql(this,void 0,void 0,(function*(){yield this.getNetwork();const n=yield ma({address:this._getAddress(e),blockTag:this._getBlockTag(r),position:Promise.resolve(t).then((e=>jo(e)))}),i=yield this.perform("getStorageAt",n);try{return Ro(i)}catch(e){return Hl.throwError("bad result from backend",yo.errors.SERVER_ERROR,{method:"getStorageAt",params:n,result:i,error:e})}}))}_wrapTransaction(e,t,r){if(null!=t&&32!==No(t))throw new Error("invalid response - sendTransaction");const n=e;return null!=t&&e.hash!==t&&Hl.throwError("Transaction hash mismatch from Provider.sendTransaction.",yo.errors.UNKNOWN_ERROR,{expectedHash:e.hash,returnedHash:t}),n.wait=(t,n)=>ql(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&&Hl.throwError("transaction failed",yo.errors.CALL_EXCEPTION,{transactionHash:e.hash,transaction:e,receipt:o}),o)})),n}sendTransaction(e){return ql(this,void 0,void 0,(function*(){yield this.getNetwork();const t=yield Promise.resolve(e).then((e=>Ro(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 ql(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?Wo.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?Ro(e):null)))})),this.formatter.transactionRequest(yield ma(r))}))}_getFilter(e){return ql(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 ma(t))}))}_call(e,t,r){return ql(this,void 0,void 0,(function*(){r>=10&&Hl.throwError("CCIP read exceeded maximum redirections",yo.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)&&No(i)%32==4)try{const o=Oo(i,4),a=Oo(o,0,32);Wo.from(a).eq(n)||Hl.throwError("CCIP Read sender did not match",yo.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:i});const s=[],c=Wo.from(Oo(o,32,64)).toNumber(),u=Wo.from(Oo(o,c,c+32)).toNumber(),f=Oo(o,c+32);for(let t=0;tql(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 ql(this,void 0,void 0,(function*(){yield this.getNetwork(),e=yield e;const t={transactionHash:this.formatter.hash(e,!0)};return Cl((()=>ql(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 ql(this,void 0,void 0,(function*(){yield this.getNetwork(),e=yield e;const t={transactionHash:this.formatter.hash(e,!0)};return Cl((()=>ql(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 ql(this,void 0,void 0,(function*(){yield this.getNetwork();const t=yield ma({filter:this._getFilter(e)}),r=yield this.perform("getLogs",t);return r.forEach((e=>{null==e.removed&&(e.removed=!1)})),Ll.arrayOf(this.formatter.filterLog.bind(this.formatter))(r)}))}getEtherPrice(){return ql(this,void 0,void 0,(function*(){return yield this.getNetwork(),this.perform("getEtherPrice",{})}))}_getBlockTag(e){return ql(this,void 0,void 0,(function*(){if("number"==typeof(e=yield e)&&e<0){e%1&&Hl.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 ql(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 uh(this,r,e);return t===e||(yield n.supportsWildcard())?n:null}t=t.split(".").slice(1).join(".")}}))}_getResolver(e,t){return ql(this,void 0,void 0,(function*(){null==t&&(t="ENS");const r=yield this.getNetwork();r.ensAddress||Hl.throwError("network does not support ENS",yo.errors.UNSUPPORTED_OPERATION,{operation:t,network:r.name});try{const t=yield this.call({to:r.ensAddress,data:"0x0178b8bf"+Lc(e).substring(2)});return this.formatter.callAddress(t)}catch(e){}return null}))}resolveName(e){return ql(this,void 0,void 0,(function*(){e=yield e;try{return Promise.resolve(this.formatter.address(e))}catch(t){if(Co(e))throw t}"string"!=typeof e&&Hl.throwArgumentError("invalid ENS name","name",e);const t=yield this.getResolver(e);return t?yield t.getAddress():null}))}lookupAddress(e){return ql(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=nh(yield this.call({to:r,data:"0x691f3431"+Lc(t).substring(2)}),0);return(yield this.resolveName(n))!=e?null:n}))}getAvatar(e){return ql(this,void 0,void 0,(function*(){let t=null;if(Co(e)){const r=this.formatter.address(e).substring(2).toLowerCase()+".addr.reverse",n=yield this._getResolver(r,"getAvatar");if(!n)return null;t=new uh(this,n,r);try{const e=yield t.getAvatar();if(e)return e.url}catch(e){if(e.code!==yo.errors.CALL_EXCEPTION)throw e}try{const e=nh(yield this.call({to:n,data:"0x691f3431"+Lc(r).substring(2)}),0);t=yield this.getResolver(e)}catch(e){if(e.code!==yo.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 Hl.throwError(e+" not implemented",yo.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 Xl(Wl(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=Wl(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=Wl(e);return this._events.filter((e=>e.tag===t)).length}listeners(e){if(null==e)return this._events.map((e=>e.listener));let t=Wl(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=Wl(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=Wl(e);this._events=this._events.filter((e=>e.tag!==r||(t.push(e),!1)))}return t.forEach((e=>{this._stopEvent(e)})),this}}var hh=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 ph=new yo(zl),mh=["call","estimateGas"];function gh(e,t){if(null==e)return null;if("string"==typeof e.message&&e.message.match("reverted")){const r=Co(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=gh(e[r],t);if(n)return n}return null}if("string"==typeof e)try{return gh(JSON.parse(e),t)}catch(e){}return null}function yh(e,t,r){const n=r.transaction||r.signedTransaction;if("call"===e){const e=gh(t,!0);if(e)return e.data;ph.throwError("missing revert data in call exception; Transaction reverted without a reason string",yo.errors.CALL_EXCEPTION,{data:"0x",transaction:n,error:t})}if("estimateGas"===e){let r=gh(t.body,!1);null==r&&(r=gh(t,!1)),r&&ph.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",yo.errors.UNPREDICTABLE_GAS_LIMIT,{reason:r.message,method:e,transaction:n,error:t})}let i=t.message;throw t.code===yo.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)&&ph.throwError("insufficient funds for intrinsic transaction cost",yo.errors.INSUFFICIENT_FUNDS,{error:t,method:e,transaction:n}),i.match(/nonce (is )?too low/i)&&ph.throwError("nonce has already been used",yo.errors.NONCE_EXPIRED,{error:t,method:e,transaction:n}),i.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&ph.throwError("replacement fee too low",yo.errors.REPLACEMENT_UNDERPRICED,{error:t,method:e,transaction:n}),i.match(/only replay-protected/i)&&ph.throwError("legacy pre-eip-155 transactions not supported",yo.errors.UNSUPPORTED_OPERATION,{error:t,method:e,transaction:n}),mh.indexOf(e)>=0&&i.match(/gas required exceeds allowance|always failing transaction|execution reverted|revert/)&&ph.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",yo.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,method:e,transaction:n}),t}function bh(e){return new Promise((function(t){setTimeout(t,e)}))}function vh(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 wh(e){return e?e.toLowerCase():e}const Ah={};class _h extends xu{constructor(e,t,r){if(super(),e!==Ah)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");ha(this,"provider",t),null==r&&(r=0),"string"==typeof r?(ha(this,"_address",this.provider.formatter.address(r)),ha(this,"_index",null)):"number"==typeof r?(ha(this,"_index",r),ha(this,"_address",null)):ph.throwArgumentError("invalid address or index","addressOrIndex",r)}connect(e){return ph.throwError("cannot alter JSON-RPC Signer connection",yo.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}connectUnchecked(){return new Eh(Ah,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&&ph.throwError("unknown account #"+this._index,yo.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),this.provider.formatter.address(e[this._index]))))}sendUncheckedTransaction(e){e=ya(e);const t=this.getAddress().then((e=>(e&&(e=e.toLowerCase()),e)));if(null==e.gasLimit){const r=ya(e);r.from=t,e.gasLimit=this.provider.estimateGas(r)}return null!=e.to&&(e.to=Promise.resolve(e.to).then((e=>hh(this,void 0,void 0,(function*(){if(null==e)return null;const t=yield this.provider.resolveName(e);return null==t&&ph.throwArgumentError("provided ENS name resolves to null","tx.to",e),t}))))),ma({tx:ma(e),sender:t}).then((({tx:t,sender:r})=>{null!=t.from?t.from.toLowerCase()!==r&&ph.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)&&ph.throwError("user rejected transaction",yo.errors.ACTION_REJECTED,{action:"sendTransaction",transaction:t}),yh("sendTransaction",e,n))))}))}signTransaction(e){return ph.throwError("signing transactions is unsupported",yo.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}sendTransaction(e){return hh(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 Cl((()=>hh(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 hh(this,void 0,void 0,(function*(){const t="string"==typeof e?qs(e):e,r=yield this.getAddress();try{return yield this.provider.send("personal_sign",[Ro(t),r.toLowerCase()])}catch(t){throw"string"==typeof t.message&&t.message.match(/user denied/i)&&ph.throwError("user rejected signing",yo.errors.ACTION_REJECTED,{action:"signMessage",from:r,messageData:e}),t}}))}_legacySignMessage(e){return hh(this,void 0,void 0,(function*(){const t="string"==typeof e?qs(e):e,r=yield this.getAddress();try{return yield this.provider.send("eth_sign",[r.toLowerCase(),Ro(t)])}catch(t){throw"string"==typeof t.message&&t.message.match(/user denied/i)&&ph.throwError("user rejected signing",yo.errors.ACTION_REJECTED,{action:"_legacySignMessage",from:r,messageData:e}),t}}))}_signTypedData(e,t,r){return hh(this,void 0,void 0,(function*(){const n=yield su.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(su.getPayload(n.domain,t,n.value))])}catch(e){throw"string"==typeof e.message&&e.message.match(/user denied/i)&&ph.throwError("user rejected signing",yo.errors.ACTION_REJECTED,{action:"_signTypedData",from:i,messageData:{domain:n.domain,types:t,value:n.value}}),e}}))}unlock(e){return hh(this,void 0,void 0,(function*(){const t=this.provider,r=yield this.getAddress();return t.send("personal_unlockAccount",[r.toLowerCase(),e,null])}))}}class Eh extends _h{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 Sh={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0};class Ph extends lh{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=pa(this.constructor,"defaultUrl")()),ha(this,"connection","string"==typeof e?Object.freeze({url:e}):Object.freeze(ya(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 hh(this,void 0,void 0,(function*(){yield bh(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=pa(this.constructor,"getNetwork");try{return t(Wo.from(e).toNumber())}catch(t){return ph.throwError("could not detect network",yo.errors.NETWORK_ERROR,{chainId:e,event:"invalidNetwork",serverError:t})}}return ph.throwError("could not detect network",yo.errors.NETWORK_ERROR,{event:"noNetwork"})}))}getSigner(e){return new _h(Ah,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:Aa(r),provider:this});const n=["eth_chainId","eth_blockNumber"].indexOf(e)>=0;if(n&&this._cache[e])return this._cache[e];const i=Ml(this.connection,JSON.stringify(r),vh).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",[wh(t.address),t.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[wh(t.address),t.blockTag]];case"getCode":return["eth_getCode",[wh(t.address),t.blockTag]];case"getStorageAt":return["eth_getStorageAt",[wh(t.address),$o(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",[pa(this.constructor,"hexlifyTransaction")(t.transaction,{from:!0}),t.blockTag]];case"estimateGas":return["eth_estimateGas",[pa(this.constructor,"hexlifyTransaction")(t.transaction,{from:!0})]];case"getLogs":return t.filter&&null!=t.filter.address&&(t.filter.address=wh(t.filter.address)),["eth_getLogs",[t.filter]]}return null}perform(e,t){return hh(this,void 0,void 0,(function*(){if("call"===e||"estimateGas"===e){const e=t.transaction;if(e&&null!=e.type&&Wo.from(e.type).isZero()&&null==e.maxFeePerGas&&null==e.maxPriorityFeePerGas){const r=yield this.getFeeData();null==r.maxFeePerGas&&null==r.maxPriorityFeePerGas&&((t=ya(t)).transaction=ya(e),delete t.transaction.type)}}const r=this.prepareRequest(e,t);null==r&&ph.throwError(e+" not implemented",yo.errors.NOT_IMPLEMENTED,{operation:e});try{return yield this.send(r[0],r[1])}catch(r){return yh(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 bh(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=ya(Sh);if(t)for(const e in t)t[e]&&(r[e]=!0);ga(e,r);const n={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach((function(t){if(null==e[t])return;const r=jo(Wo.from(e[t]));"gasLimit"===t&&(t="gas"),n[t]=r})),["from","to","data"].forEach((function(t){null!=e[t]&&(n[t]=Ro(e[t]))})),e.accessList&&(n.accessList=Cf(e.accessList)),n}}const xh=new RegExp("^bytes([0-9]+)$"),kh=new RegExp("^(u?int)([0-9]*)$"),Mh=new RegExp("^(.*)\\[([0-9]*)\\]$"),Ch="0000000000000000000000000000000000000000000000000000000000000000",Ih=new yo("solidity/5.7.0");function Rh(e,t,r){switch(e){case"address":return r?Mo(t,32):Po(t);case"string":return qs(t);case"bytes":return Po(t);case"bool":return t=t?"0x01":"0x00",r?Mo(t,32):Po(t)}let n=e.match(kh);if(n){let i=parseInt(n[2]||"256");return(n[2]&&String(i)!==n[2]||i%8!=0||0===i||i>256)&&Ih.throwArgumentError("invalid number type","type",e),r&&(i=256),Mo(t=Wo.from(t).toTwos(i),i/8)}if(n=e.match(xh),n){const i=parseInt(n[1]);return(String(i)!==n[1]||0===i||i>32)&&Ih.throwArgumentError("invalid bytes type","type",e),Po(t).byteLength!==i&&Ih.throwArgumentError(`invalid value for ${e}`,"value",t),r?Po((t+Ch).substring(0,66)):t}if(n=e.match(Mh),n&&Array.isArray(t)){const r=n[1];parseInt(n[2]||String(t.length))!=t.length&&Ih.throwArgumentError(`invalid array length for ${e}`,"value",t);const i=[];return t.forEach((function(e){i.push(Rh(r,e,!0))})),xo(i)}return Ih.throwArgumentError("invalid type","type",e)}function Nh(e,t){e.length!=t.length&&Ih.throwArgumentError("wrong number of values; expected ${ types.length }","values",t);const r=[];return e.forEach((function(e,n){r.push(Rh(e,t[n]))})),Ro(xo(r))}var Oh=Object.freeze({__proto__:null,keccak256:function(e,t){return ts(Nh(e,t))},pack:Nh,sha256:function(e,t){return od(Nh(e,t))}});const Th=new yo("units/5.7.0"),jh=["wei","kwei","mwei","gwei","szabo","finney","ether"];function Dh(e,t){if("string"==typeof t){const e=jh.indexOf(t);-1!==e&&(t=3*e)}return oa(e,null!=t?t:18)}function $h(e,t){if("string"!=typeof e&&Th.throwArgumentError("value must be a string","value",e),"string"==typeof t){const e=jh.indexOf(t);-1!==e&&(t=3*e)}return aa(e,null!=t?t:18)}var Bh=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)&&Th.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 Dh(e,18)},formatUnits:Dh,parseEther:function(e){return $h(e,18)},parseUnits:$h});function Fh(e){if(null==e.match(/^(0x)?([\da-fA-F]{40})$/))throw new RangeError("incorrect address format");try{return ys(ro(e,!0,20))}catch(e){throw new rn(e,["invalid EIP-55 address"])}}async function zh(e){return n(await io(Yi(e),"SHA-256"),!0,!1)}async function Uh(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 Zi(r,t);const n=await Hi(t),i=t.alg,o={...e,iat:Math.floor(Date.now()/1e3)};return{jws:await new Ui(o).setProtectedHeader({alg:i}).setIssuedAt(o.iat).sign(n),payload:o}}async function Lh(e,t,r){const n=JSON.parse(t.exchange[t.iss]),i=await Wi(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){eo("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(Yi(n)!==Yi(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;qh(o.exchange,e)}else if(""!==s[e]&&Yi(s[e])!==Yi(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 qh(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]&&Yi(t[r])!==Yi(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 Hh(e,t,r=10){const{payload:n}=await Wi(e),i=n.exchange,o={...i};delete o.id;if(await zh(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 Lh(n.poo,{iss:"orig",proofType:"PoO",exchange:i})).payload}catch(e){throw new rn(e,["invalid poo"])}try{await Lh(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(Gi(i.encAlg),i.ledgerSignerAddress,i.id,r);u=e.hex,f=e.iat}catch(e){throw new rn(e,["cannot verify"])}try{eo(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 Kh(e,t,r=10){let n,i,o,a,s;try{n=(await Wi(e)).payload}catch(e){throw new rn(e,["invalid verification request"])}try{const e=await Hh(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 Wi(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 Jh(e,t){const{payload:r}=await Wi(e),{destPublicJwk:i,origPublicJwk:o,secretHex:a,pooPayload:s,porPayload:c}=await Hh(r.por,t);try{await Wi(e,i)}catch(e){throw e instanceof rn&&e.add("invalid dispute request"),e}if(n(await io(r.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 Ji(r.cipherblock,(await Vi(c.exchange.encAlg,a)).jwk),{pooPayload:s,porPayload:c,drPayload:r,destPublicJwk:i,origPublicJwk:o}}async function Wh(e,t,r,n){const i={proofType:"request",iss:e,dataExchangeId:t,por:r,type:"verificationRequest",iat:Math.floor(Date.now()/1e3)},o=await li(n);return await new Ui(i).setProtectedHeader({alg:n.alg}).setIssuedAt(i.iat).sign(o)}var Gh=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 Zi(this.jwkPair.publicJwk,this.jwkPair.privateJwk)}async resolveCompleteness(e){await this.initialized;const{payload:t}=await Wi(e);let r;try{r=(await Wi(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 Kh(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 li(this.jwkPair.privateJwk);return await new Ui(n).setProtectedHeader({alg:this.jwkPair.privateJwk.alg}).setIssuedAt(n.iat).sign(i)}async resolveDispute(e){await this.initialized;const{payload:t}=await Wi(e);let r;try{r=(await Wi(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 Jh(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 li(this.jwkPair.privateJwk);return await new Ui(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 no(this.jwkPair.publicJwk,!0),sub:t}}},checkCompleteness:Kh,checkDecryption:Jh,generateVerificationRequest:Wh,verifyPor:Hh,verifyResolution:async function(e,t){return await Wi(e,t??((e,t)=>JSON.parse(t.iss)))}});const Vh={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 Zh(e,t,r,n,o){let s=Wo.from(0),c=Wo.from(0);const u=ro(a(i(r)),!0);let f=0;do{try{({secret:s,timestamp:c}=await e.registry(ro(t,!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={...Vh,...e},this.provider=new Ph(this.dltConfig.rpcProviderUrl),this.contract=new Xf(this.dltConfig.contract.address,this.dltConfig.contract.abi,this.provider),t(!0)})).catch((e=>r(e))):(this.dltConfig={...Vh,...e},this.provider=new Ph(this.dltConfig.rpcProviderUrl),this.contract=new Xf(this.dltConfig.contract.address,this.dltConfig.contract.abi,this.provider),t(!0))}))}async getContractAddress(){return await this.initialized,this.contract.address}}class ep extends Yh{async getSecretFromLedger(e,t,r,n){return await this.initialized,await Zh(this.contract,t,r,n,e)}}class tp extends Yh{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:i})})).catch((e=>{n(e)}))}));super(n),this.wallet=e,this.did=t}}class rp extends tp{async getSecretFromLedger(e,t,r,n){return await this.initialized,await Zh(this.contract,t,r,n,e)}}class np extends Yh{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:i})})).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 Zh(this.contract,t,r,n,e)}}var op={},ap=d(yu),sp=d(vs),cp=d(gc),up=d(rd),fp=d(zo),dp=d(cu),lp=d(Cd),hp=d(ul),pp=d(rs),mp=d(bo),gp=d(sd),yp=d(Oh),bp=d(Td),vp=d(Ea),wp=d(ds),Ap=d(bf),_p=d(ic),Ep=d(Df),Sp=d(Bh),Pp=d(hl),xp=d(Il);!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=ap;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=sp;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(cp);e.base64=a;var s=up;Object.defineProperty(e,"base58",{enumerable:!0,get:function(){return s.Base58}});var c=fp;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=dp;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=lp;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=hp;Object.defineProperty(e,"getJsonWalletAddress",{enumerable:!0,get:function(){return l.getJsonWalletAddress}});var h=pp;Object.defineProperty(e,"keccak256",{enumerable:!0,get:function(){return h.keccak256}});var p=mp;Object.defineProperty(e,"Logger",{enumerable:!0,get:function(){return p.Logger}});var m=gp;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=yp;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=bp;Object.defineProperty(e,"randomBytes",{enumerable:!0,get:function(){return y.randomBytes}}),Object.defineProperty(e,"shuffled",{enumerable:!0,get:function(){return y.shuffled}});var b=vp;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(wp);e.RLP=v;var w=Ap;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=_p;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 _=Ep;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=Sp;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=Pp;Object.defineProperty(e,"verifyMessage",{enumerable:!0,get:function(){return S.verifyMessage}}),Object.defineProperty(e,"verifyTypedData",{enumerable:!0,get:function(){return S.verifyTypedData}});var P=xp;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=gp;Object.defineProperty(e,"SupportedAlgorithm",{enumerable:!0,get:function(){return x.SupportedAlgorithm}});var k=_p;Object.defineProperty(e,"UnicodeNormalizationForm",{enumerable:!0,get:function(){return k.UnicodeNormalizationForm}}),Object.defineProperty(e,"Utf8ErrorReason",{enumerable:!0,get:function(){return k.Utf8ErrorReason}})}(op);class kp extends Yh{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 Mp extends tp{constructor(){super(...arguments),this.count=-1}async deploySecret(e,t){await this.initialized;const r=await Xh(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 Cp extends np{constructor(){super(...arguments),this.count=-1}async deploySecret(e,t){await this.initialized;const r=await Xh(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 Ip=Object.freeze({__proto__:null,EthersIoAgentDest:ep,EthersIoAgentOrig:kp,I3mServerWalletAgentDest:ip,I3mServerWalletAgentOrig:Cp,I3mWalletAgentDest:rp,I3mWalletAgentOrig:Mp}),Rp={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"]}]}}},Np={},Op={get exports(){return Np},set exports(e){Np=e}},Tp={},jp={},Dp={},$p={},Bp={},Fp={};!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}}}(zp),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=Fp,r=zp;var n=Fp;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=zp;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)}}(Bp);var Up={};!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=Bp,r=Fp;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}(Up);var Lp={};Object.defineProperty(Lp,"__esModule",{value:!0});const qp=Bp,Hp={data:new qp.Name("data"),valCxt:new qp.Name("valCxt"),instancePath:new qp.Name("instancePath"),parentData:new qp.Name("parentData"),parentDataProperty:new qp.Name("parentDataProperty"),rootData:new qp.Name("rootData"),dynamicAnchors:new qp.Name("dynamicAnchors"),vErrors:new qp.Name("vErrors"),errors:new qp.Name("errors"),this:new qp.Name("this"),self:new qp.Name("self"),scope:new qp.Name("scope"),json:new qp.Name("json"),jsonPos:new qp.Name("jsonPos"),jsonLen:new qp.Name("jsonLen"),jsonPart:new qp.Name("jsonPart")};Lp.default=Hp,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=Bp,r=Up,n=Lp;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]}}($p),Object.defineProperty(Dp,"__esModule",{value:!0}),Dp.boolOrEmptySchema=Dp.topBoolOrEmptySchema=void 0;const Kp=$p,Jp=Bp,Wp=Lp,Gp={message:"boolean schema is false"};function Vp(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,Kp.reportError)(i,Gp,void 0,t)}Dp.topBoolOrEmptySchema=function(e){const{gen:t,schema:r,validateName:n}=e;!1===r?Vp(e,!1):"object"==typeof r&&!0===r.$async?t.return(Wp.default.data):(t.assign(Jp._`${n}.errors`,null),t.return(!0))},Dp.boolOrEmptySchema=function(e,t){const{gen:r,schema:n}=e;!1===n?(r.var(t,!1),Vp(e)):r.var(t,!0)};var Zp={},Xp={};Object.defineProperty(Xp,"__esModule",{value:!0}),Xp.getRules=Xp.isJSONType=void 0;const Qp=new Set(["string","number","integer","boolean","null","object","array"]);Xp.isJSONType=function(e){return"string"==typeof e&&Qp.has(e)},Xp.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 Yp={};function em(e,t){return t.rules.some((t=>tm(e,t)))}function tm(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(Yp,"__esModule",{value:!0}),Yp.shouldUseRule=Yp.shouldUseGroup=Yp.schemaHasRulesForType=void 0,Yp.schemaHasRulesForType=function({schema:e,self:t},r){const n=t.RULES.types[r];return n&&!0!==n&&em(e,n)},Yp.shouldUseGroup=em,Yp.shouldUseRule=tm,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=Xp,r=Yp,n=$p,i=Bp,o=Up;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}(Zp);var rm={};Object.defineProperty(rm,"__esModule",{value:!0}),rm.assignDefaults=void 0;const nm=Bp,im=Up;function om(e,t,r){const{gen:n,compositeRule:i,data:o,opts:a}=e;if(void 0===r)return;const s=nm._`${o}${(0,nm.getProperty)(t)}`;if(i)return void(0,im.checkStrictMode)(e,`default is ignored for: ${s}`);let c=nm._`${s} === undefined`;"empty"===a.useDefaults&&(c=nm._`${c} || ${s} === null || ${s} === ""`),n.if(c,nm._`${s} = ${(0,nm.stringify)(r)}`)}rm.assignDefaults=function(e,t){const{properties:r,items:n}=e.schema;if("object"===t&&r)for(const t in r)om(e,t,r[t].default);else"array"===t&&Array.isArray(n)&&n.forEach(((t,r)=>om(e,r,t.default)))};var am={},sm={};Object.defineProperty(sm,"__esModule",{value:!0}),sm.validateUnion=sm.validateArray=sm.usePattern=sm.callValidateCode=sm.schemaProperties=sm.allSchemaProperties=sm.noPropertyInData=sm.propertyInData=sm.isOwnProperty=sm.hasPropFunc=sm.reportMissingProp=sm.checkMissingProp=sm.checkReportMissingProp=void 0;const cm=Bp,um=Up,fm=Lp,dm=Up;function lm(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:cm._`Object.prototype.hasOwnProperty`})}function hm(e,t,r){return cm._`${lm(e)}.call(${t}, ${r})`}function pm(e,t,r,n){const i=cm._`${t}${(0,cm.getProperty)(r)} === undefined`;return n?(0,cm.or)(i,(0,cm.not)(hm(e,t,r))):i}function mm(e){return e?Object.keys(e).filter((e=>"__proto__"!==e)):[]}sm.checkReportMissingProp=function(e,t){const{gen:r,data:n,it:i}=e;r.if(pm(r,n,t,i.opts.ownProperties),(()=>{e.setParams({missingProperty:cm._`${t}`},!0),e.error()}))},sm.checkMissingProp=function({gen:e,data:t,it:{opts:r}},n,i){return(0,cm.or)(...n.map((n=>(0,cm.and)(pm(e,t,n,r.ownProperties),cm._`${i} = ${n}`))))},sm.reportMissingProp=function(e,t){e.setParams({missingProperty:t},!0),e.error()},sm.hasPropFunc=lm,sm.isOwnProperty=hm,sm.propertyInData=function(e,t,r,n){const i=cm._`${t}${(0,cm.getProperty)(r)} !== undefined`;return n?cm._`${i} && ${hm(e,t,r)}`:i},sm.noPropertyInData=pm,sm.allSchemaProperties=mm,sm.schemaProperties=function(e,t){return mm(t).filter((r=>!(0,um.alwaysValidSchema)(e,t[r])))},sm.callValidateCode=function({schemaCode:e,data:t,it:{gen:r,topSchemaRef:n,schemaPath:i,errorPath:o},it:a},s,c,u){const f=u?cm._`${e}, ${t}, ${n}${i}`:t,d=[[fm.default.instancePath,(0,cm.strConcat)(fm.default.instancePath,o)],[fm.default.parentData,a.parentData],[fm.default.parentDataProperty,a.parentDataProperty],[fm.default.rootData,fm.default.rootData]];a.opts.dynamicRef&&d.push([fm.default.dynamicAnchors,fm.default.dynamicAnchors]);const l=cm._`${f}, ${r.object(...d)}`;return c!==cm.nil?cm._`${s}.call(${c}, ${l})`:cm._`${s}(${l})`};const gm=cm._`new RegExp`;sm.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:cm._`${"new RegExp"===i.code?gm:(0,dm.useFunc)(e,i)}(${r}, ${n})`})},sm.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",cm._`${r}.length`);t.forRange("i",0,a,(r=>{e.subschema({keyword:n,dataProp:r,dataPropType:um.Type.Num},o),t.if((0,cm.not)(o),i)}))}},sm.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,um.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,cm._`${o} || ${a}`);e.mergeValidEvaluated(s,a)||t.if((0,cm.not)(o))})))),e.result(o,(()=>e.reset()),(()=>e.error(!0)))},Object.defineProperty(am,"__esModule",{value:!0}),am.validateKeywordUsage=am.validSchemaType=am.funcKeywordCode=am.macroKeywordCode=void 0;const ym=Bp,bm=Lp,vm=sm,wm=$p;function Am(e){const{gen:t,data:r,it:n}=e;t.if(n.parentData,(()=>t.assign(r,ym._`${n.parentData}[${n.parentDataProperty}]`)))}function _m(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,ym.stringify)(r)})}am.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=_m(r,n,s);!1!==a.opts.validateSchema&&a.self.validateSchema(s,!0);const u=r.name("valid");e.subschema({schema:s,schemaPath:ym.nil,errSchemaPath:`${a.errSchemaPath}/${n}`,topSchemaRef:c,compositeRule:!0},u),e.pass(u,(()=>e.error(!0)))},am.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=_m(n,i,u),d=n.let("valid");function l(r=(t.async?ym._`await `:ym.nil)){const i=c.opts.passContext?bm.default.this:bm.default.self,o=!("compile"in t&&!s||!1===t.schema);n.assign(d,ym._`${r}${(0,vm.callValidateCode)(e,f,i,o)}`,t.modifying)}function h(e){var r;n.if((0,ym.not)(null!==(r=t.valid)&&void 0!==r?r:d),e)}e.block$data(d,(function(){if(!1===t.errors)l(),t.modifying&&Am(e),h((()=>e.error()));else{const r=t.async?function(){const e=n.let("ruleErrs",null);return n.try((()=>l(ym._`await `)),(t=>n.assign(d,!1).if(ym._`${t} instanceof ${c.ValidationError}`,(()=>n.assign(e,ym._`${t}.errors`)),(()=>n.throw(t))))),e}():function(){const e=ym._`${f}.errors`;return n.assign(e,null),l(ym.nil),e}();t.modifying&&Am(e),h((()=>function(e,t){const{gen:r}=e;r.if(ym._`Array.isArray(${t})`,(()=>{r.assign(bm.default.vErrors,ym._`${bm.default.vErrors} === null ? ${t} : ${bm.default.vErrors}.concat(${t})`).assign(bm.default.errors,ym._`${bm.default.vErrors}.length`),(0,wm.extendErrors)(e)}),(()=>e.error()))}(e,r)))}})),e.ok(null!==(r=t.valid)&&void 0!==r?r:d)},am.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))},am.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 Em={};Object.defineProperty(Em,"__esModule",{value:!0}),Em.extendSubschemaMode=Em.extendSubschemaData=Em.getSubschema=void 0;const Sm=Bp,Pm=Up;Em.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:Sm._`${e.schemaPath}${(0,Sm.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:n[r],schemaPath:Sm._`${e.schemaPath}${(0,Sm.getProperty)(t)}${(0,Sm.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,Pm.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')},Em.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",Sm._`${t.data}${(0,Sm.getProperty)(r)}`,!0)),e.errorPath=Sm.str`${i}${(0,Pm.getErrorPath)(r,n,a.jsPropertySyntax)}`,e.parentDataProperty=Sm._`${r}`,e.dataPathArr=[...o,e.parentDataProperty]}if(void 0!==i){c(i instanceof Sm.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)},Em.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 xm={},km=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},Mm={},Cm={get exports(){return Mm},set exports(e){Mm=e}}.exports=function(e,t,r){"function"==typeof t&&(r=t,t={}),Im(t,"function"==typeof(r=t.cb||r)?r:r.pre||function(){},r.post||function(){},e,"",e)};function Im(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 Cm.arrayKeywords)for(var l=0;lt+=$m(e))),t===1/0))return 1/0}return t}function Bm(e,t="",r){!1!==r&&(t=Um(t));const n=e.parse(t);return Fm(e,n)}function Fm(e,t){return e.serialize(t).split("#")[0]+"#"}xm.getFullPath=Bm,xm._getFullPath=Fm;const zm=/#\/?$/;function Um(e){return e?e.replace(zm,""):""}xm.normalizeId=Um,xm.resolveUrl=function(e,t,r){return r=Um(r),e.resolve(t,r)};const Lm=/^[a-z_][-a-z0-9._]*$/i;xm.getSchemaRefs=function(e,t){if("boolean"==typeof e)return{};const{schemaId:r,uriResolver:n}=this.opts,i=Um(e[r]||t),o={"":i},a=Bm(n,i,!1),s={},c=new Set;return Om(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=Um(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!==Um(d)&&("#"===t[0]?(u(e,s[t],t),s[t]=e):this.refs[t]=d),t}function p(e){if("string"==typeof e){if(!Lm.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&&!Nm(e,t))throw f(r)}function f(e){return new Error(`reference "${e}" resolves to more than one schema`)}},Object.defineProperty(jp,"__esModule",{value:!0}),jp.getData=jp.KeywordCxt=jp.validateFunctionCode=void 0;const qm=Dp,Hm=Zp,Km=Yp,Jm=Zp,Wm=rm,Gm=am,Vm=Em,Zm=Bp,Xm=Lp,Qm=xm,Ym=Up,eg=$p;function tg({gen:e,validateName:t,schema:r,schemaEnv:n,opts:i},o){i.code.es5?e.func(t,Zm._`${Xm.default.data}, ${Xm.default.valCxt}`,n.$async,(()=>{e.code(Zm._`"use strict"; ${rg(r,i)}`),function(e,t){e.if(Xm.default.valCxt,(()=>{e.var(Xm.default.instancePath,Zm._`${Xm.default.valCxt}.${Xm.default.instancePath}`),e.var(Xm.default.parentData,Zm._`${Xm.default.valCxt}.${Xm.default.parentData}`),e.var(Xm.default.parentDataProperty,Zm._`${Xm.default.valCxt}.${Xm.default.parentDataProperty}`),e.var(Xm.default.rootData,Zm._`${Xm.default.valCxt}.${Xm.default.rootData}`),t.dynamicRef&&e.var(Xm.default.dynamicAnchors,Zm._`${Xm.default.valCxt}.${Xm.default.dynamicAnchors}`)}),(()=>{e.var(Xm.default.instancePath,Zm._`""`),e.var(Xm.default.parentData,Zm._`undefined`),e.var(Xm.default.parentDataProperty,Zm._`undefined`),e.var(Xm.default.rootData,Xm.default.data),t.dynamicRef&&e.var(Xm.default.dynamicAnchors,Zm._`{}`)}))}(e,i),e.code(o)})):e.func(t,Zm._`${Xm.default.data}, ${function(e){return Zm._`{${Xm.default.instancePath}="", ${Xm.default.parentData}, ${Xm.default.parentDataProperty}, ${Xm.default.rootData}=${Xm.default.data}${e.dynamicRef?Zm._`, ${Xm.default.dynamicAnchors}={}`:Zm.nil}}={}`}(i)}`,n.$async,(()=>e.code(rg(r,i)).code(o)))}function rg(e,t){const r="object"==typeof e&&e[t.schemaId];return r&&(t.code.source||t.code.process)?Zm._`/*# sourceURL=${r} */`:Zm.nil}function ng(e,t){og(e)&&(ag(e),ig(e))?function(e,t){const{schema:r,gen:n,opts:i}=e;i.$comment&&r.$comment&&cg(e);(function(e){const t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,Qm.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",Xm.default.errors);sg(e,o),n.var(t,Zm._`${o} === ${Xm.default.errors}`)}(e,t):(0,qm.boolOrEmptySchema)(e,t)}function ig({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 og(e){return"boolean"!=typeof e.schema}function ag(e){(0,Ym.checkUnknownRules)(e),function(e){const{schema:t,errSchemaPath:r,opts:n,self:i}=e;t.$ref&&n.ignoreKeywordsWithRef&&(0,Ym.schemaHasRulesButRef)(t,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}(e)}function sg(e,t){if(e.opts.jtd)return ug(e,[],!1,t);const r=(0,Hm.getSchemaTypes)(e.schema);ug(e,r,!(0,Hm.coerceAndCheckDataType)(e,r),t)}function cg({gen:e,schemaEnv:t,schema:r,errSchemaPath:n,opts:i}){const o=r.$comment;if(!0===i.$comment)e.code(Zm._`${Xm.default.self}.logger.log(${o})`);else if("function"==typeof i.$comment){const r=Zm.str`${n}/$comment`,i=e.scopeValue("root",{ref:t.root});e.code(Zm._`${Xm.default.self}.opts.$comment(${o}, ${r}, ${i}.schema)`)}}function ug(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,Km.shouldUseGroup)(o,u)&&(u.type?(i.if((0,Jm.checkDataType)(u.type,a,c.strictNumbers)),fg(e,u),1===t.length&&t[0]===u.type&&r&&(i.else(),(0,Jm.reportTypeError)(e)),i.endIf()):fg(e,u),s||i.if(Zm._`${Xm.default.errors} === ${n||0}`))}!o.$ref||!c.ignoreKeywordsWithRef&&(0,Ym.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=>{lg(e.dataTypes,t)||hg(e,`type "${t}" not allowed by context "${e.dataTypes.join(",")}"`)})),function(e,t){const r=[];for(const n of e.dataTypes)lg(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"))&&hg(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,Km.shouldUseRule)(e.schema,i)){const{type:r}=i.definition;r.length&&!r.some((e=>dg(t,e)))&&hg(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((()=>mg(e,"$ref",f.all.$ref.definition)))}function fg(e,t){const{gen:r,schema:n,opts:{useDefaults:i}}=e;i&&(0,Wm.assignDefaults)(e,t.type),r.block((()=>{for(const r of t.rules)(0,Km.shouldUseRule)(n,r)&&mg(e,r.keyword,r.definition,t.type)}))}function dg(e,t){return e.includes(t)||"number"===t&&e.includes("integer")}function lg(e,t){return e.includes(t)||"integer"===t&&e.includes("number")}function hg(e,t){t+=` at "${e.schemaEnv.baseId+e.errSchemaPath}" (strictTypes)`,(0,Ym.checkStrictMode)(e,t,e.opts.strictTypes)}jp.validateFunctionCode=function(e){og(e)&&(ag(e),ig(e))?function(e){const{schema:t,opts:r,gen:n}=e;tg(e,(()=>{r.$comment&&t.$comment&&cg(e),function(e){const{schema:t,opts:r}=e;void 0!==t.default&&r.useDefaults&&r.strictSchema&&(0,Ym.checkStrictMode)(e,"default is ignored in the schema root")}(e),n.let(Xm.default.vErrors,null),n.let(Xm.default.errors,0),r.unevaluated&&function(e){const{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",Zm._`${r}.evaluated`),t.if(Zm._`${e.evaluated}.dynamicProps`,(()=>t.assign(Zm._`${e.evaluated}.props`,Zm._`undefined`))),t.if(Zm._`${e.evaluated}.dynamicItems`,(()=>t.assign(Zm._`${e.evaluated}.items`,Zm._`undefined`)))}(e),sg(e),function(e){const{gen:t,schemaEnv:r,validateName:n,ValidationError:i,opts:o}=e;r.$async?t.if(Zm._`${Xm.default.errors} === 0`,(()=>t.return(Xm.default.data)),(()=>t.throw(Zm._`new ${i}(${Xm.default.vErrors})`))):(t.assign(Zm._`${n}.errors`,Xm.default.vErrors),o.unevaluated&&function({gen:e,evaluated:t,props:r,items:n}){r instanceof Zm.Name&&e.assign(Zm._`${t}.props`,r);n instanceof Zm.Name&&e.assign(Zm._`${t}.items`,n)}(e),t.return(Zm._`${Xm.default.errors} === 0`))}(e)}))}(e):tg(e,(()=>(0,qm.topBoolOrEmptySchema)(e)))};class pg{constructor(e,t,r){if((0,Gm.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,Ym.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",bg(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,Gm.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",Xm.default.errors))}result(e,t,r){this.failResult((0,Zm.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,Zm.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(Zm._`${t} !== undefined && (${(0,Zm.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?eg.reportExtraError:eg.reportError)(this,this.def.error,t)}$dataError(){(0,eg.reportError)(this,this.def.$dataError||eg.keyword$DataError)}reset(){if(void 0===this.errsCount)throw new Error('add "trackErrors" to keyword definition');(0,eg.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=Zm.nil){this.gen.block((()=>{this.check$data(e,r),t()}))}check$data(e=Zm.nil,t=Zm.nil){if(!this.$data)return;const{gen:r,schemaCode:n,schemaType:i,def:o}=this;r.if((0,Zm.or)(Zm._`${n} === undefined`,t)),e!==Zm.nil&&r.assign(e,!0),(i.length||o.validateSchema)&&(r.elseIf(this.invalid$data()),this.$dataError(),e!==Zm.nil&&r.assign(e,!1)),r.else()}invalid$data(){const{gen:e,schemaCode:t,schemaType:r,def:n,it:i}=this;return(0,Zm.or)(function(){if(r.length){if(!(t instanceof Zm.Name))throw new Error("ajv implementation error");const e=Array.isArray(r)?r:[r];return Zm._`${(0,Jm.checkDataTypes)(e,t,i.opts.strictNumbers,Jm.DataType.Wrong)}`}return Zm.nil}(),function(){if(n.validateSchema){const r=e.scopeValue("validate$data",{ref:n.validateSchema});return Zm._`!${r}(${t})`}return Zm.nil}())}subschema(e,t){const r=(0,Vm.getSubschema)(this.it,e);(0,Vm.extendSubschemaData)(r,this.it,e),(0,Vm.extendSubschemaMode)(r,e);const n={...this.it,...r,items:void 0,props:void 0};return ng(n,t),n}mergeEvaluated(e,t){const{it:r,gen:n}=this;r.opts.unevaluated&&(!0!==r.props&&void 0!==e.props&&(r.props=Ym.mergeEvaluated.props(n,e.props,r.props,t)),!0!==r.items&&void 0!==e.items&&(r.items=Ym.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,Zm.Name))),!0}}function mg(e,t,r,n){const i=new pg(e,r,t);"code"in r?r.code(i,n):i.$data&&r.validate?(0,Gm.funcKeywordCode)(i,r):"macro"in r?(0,Gm.macroKeywordCode)(i,r):(r.compile||r.validate)&&(0,Gm.funcKeywordCode)(i,r)}jp.KeywordCxt=pg;const gg=/^\/(?:[^~]|~0|~1)*$/,yg=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function bg(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let i,o;if(""===e)return Xm.default.rootData;if("/"===e[0]){if(!gg.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);i=e,o=Xm.default.rootData}else{const a=yg.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=Zm._`${o}${(0,Zm.getProperty)((0,Ym.unescapeJsonPointer)(e))}`,a=Zm._`${a} && ${o}`);return a;function c(e,r){return`Cannot access ${e} ${r} levels up, current level is ${t}`}}jp.getData=bg;var vg={};Object.defineProperty(vg,"__esModule",{value:!0});class wg extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}}vg.default=wg;var Ag={};Object.defineProperty(Ag,"__esModule",{value:!0});const _g=xm;class Eg extends Error{constructor(e,t,r,n){super(n||`can't resolve reference ${r} from id ${t}`),this.missingRef=(0,_g.resolveUrl)(e,t,r),this.missingSchema=(0,_g.normalizeId)((0,_g.getFullPath)(e,this.missingRef))}}Ag.default=Eg;var Sg={};Object.defineProperty(Sg,"__esModule",{value:!0}),Sg.resolveSchema=Sg.getCompilingSchema=Sg.resolveRef=Sg.compileSchema=Sg.SchemaEnv=void 0;const Pg=Bp,xg=vg,kg=Lp,Mg=xm,Cg=Up,Ig=jp;class Rg{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,Mg.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 Ng(e){const t=Tg.call(this,e);if(t)return t;const r=(0,Mg.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:n,lines:i}=this.opts.code,{ownProperties:o}=this.opts,a=new Pg.CodeGen(this.scope,{es5:n,lines:i,ownProperties:o});let s;e.$async&&(s=a.scopeValue("Error",{ref:xg.default,code:Pg._`require("ajv/dist/runtime/validation_error").default`}));const c=a.scopeName("validate");e.validateName=c;const u={gen:a,allErrors:this.opts.allErrors,data:kg.default.data,parentData:kg.default.parentData,parentDataProperty:kg.default.parentDataProperty,dataNames:[kg.default.data],dataPathArr:[Pg.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:a.scopeValue("schema",!0===this.opts.code.source?{ref:e.schema,code:(0,Pg.stringify)(e.schema)}:{ref:e.schema}),validateName:c,ValidationError:s,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:Pg.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:Pg._`""`,opts:this.opts,self:this};let f;try{this._compilations.add(e),(0,Ig.validateFunctionCode)(u),a.optimize(this.opts.code.optimize);const t=a.toString();f=`${a.scopeRefs(kg.default.scope)}return ${t}`,this.opts.code.process&&(f=this.opts.code.process(f,e));const r=new Function(`${kg.default.self}`,`${kg.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 Pg.Name?void 0:e,items:t instanceof Pg.Name?void 0:t,dynamicProps:e instanceof Pg.Name,dynamicItems:t instanceof Pg.Name},r.source&&(r.source.evaluated=(0,Pg.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 Og(e){return(0,Mg.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:Ng.call(this,e)}function Tg(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 jg(e,t){let r;for(;"string"==typeof(r=this.refs[t]);)t=r;return r||this.schemas[t]||Dg.call(this,e,t)}function Dg(e,t){const r=this.opts.uriResolver.parse(t),n=(0,Mg._getFullPath)(this.opts.uriResolver,r);let i=(0,Mg.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===i)return Bg.call(this,r,e);const o=(0,Mg.normalizeId)(n),a=this.refs[o]||this.schemas[o];if("string"==typeof a){const t=Dg.call(this,e,a);if("object"!=typeof(null==t?void 0:t.schema))return;return Bg.call(this,r,t)}if("object"==typeof(null==a?void 0:a.schema)){if(a.validate||Ng.call(this,a),o===(0,Mg.normalizeId)(t)){const{schema:t}=a,{schemaId:r}=this.opts,n=t[r];return n&&(i=(0,Mg.resolveUrl)(this.opts.uriResolver,i,n)),new Rg({schema:t,schemaId:r,root:e,baseId:i})}return Bg.call(this,r,a)}}Sg.SchemaEnv=Rg,Sg.compileSchema=Ng,Sg.resolveRef=function(e,t,r){var n;r=(0,Mg.resolveUrl)(this.opts.uriResolver,t,r);const i=e.refs[r];if(i)return i;let o=jg.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 Rg({schema:i,schemaId:a,root:e,baseId:t}))}return void 0!==o?e.refs[r]=Og.call(this,o):void 0},Sg.getCompilingSchema=Tg,Sg.resolveSchema=Dg;const $g=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Bg(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,Cg.unescapeFragment)(n)];if(void 0===e)return;const i="object"==typeof(r=e)&&r[this.opts.schemaId];!$g.has(n)&&i&&(t=(0,Mg.resolveUrl)(this.opts.uriResolver,t,i))}let o;if("boolean"!=typeof r&&r.$ref&&!(0,Cg.schemaHasRulesButRef)(r,this.RULES)){const e=(0,Mg.resolveUrl)(this.opts.uriResolver,t,r.$ref);o=Dg.call(this,n,e)}const{schemaId:a}=this.opts;return o=o||new Rg({schema:r,schemaId:a,root:n,baseId:t}),o.schema!==o.root.schema?o:void 0}var Fg={$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},zg={},Ug={}; -/** @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]}}}(Tp);var qg={},Hg={},Kg={};Object.defineProperty(Kg,"__esModule",{value:!0}),Kg.callRef=Kg.getValidate=void 0;const Jg=Ag,Wg=sm,Gg=Bp,Vg=Lp,Zg=Sg,Xg=Up,Qg={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 ey(e,a,o,o.$async);const r=t.scopeValue("root",{ref:u});return ey(e,Gg._`${r}.validate`,u,u.$async)}();const f=Zg.resolveRef.call(c,u,i,r);if(void 0===f)throw new Jg.default(n.opts.uriResolver,i,r);return f instanceof Zg.SchemaEnv?function(t){const r=Yg(e,t);ey(e,r,t,t.$async)}(f):function(n){const i=t.scopeValue("schema",!0===s.code.source?{ref:n,code:(0,Gg.stringify)(n)}:{ref:n}),o=t.name("valid"),a=e.subschema({schema:n,dataTypes:[],schemaPath:Gg.nil,topSchemaRef:i,errSchemaPath:r},o);e.mergeEvaluated(a),e.ok(o)}(f)}};function Yg(e,t){const{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):Gg._`${r.scopeValue("wrapper",{ref:t})}.validate`}function ey(e,t,r,n){const{gen:i,it:o}=e,{allErrors:a,schemaEnv:s,opts:c}=o,u=c.passContext?Vg.default.this:Gg.nil;function f(e){const t=Gg._`${e}.errors`;i.assign(Vg.default.vErrors,Gg._`${Vg.default.vErrors} === null ? ${t} : ${Vg.default.vErrors}.concat(${t})`),i.assign(Vg.default.errors,Gg._`${Vg.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=Xg.mergeEvaluated.props(i,n.props,o.props));else{const t=i.var("props",Gg._`${e}.evaluated.props`);o.props=Xg.mergeEvaluated.props(i,t,o.props,Gg.Name)}if(!0!==o.items)if(n&&!n.dynamicItems)void 0!==n.items&&(o.items=Xg.mergeEvaluated.items(i,n.items,o.items));else{const t=i.var("items",Gg._`${e}.evaluated.items`);o.items=Xg.mergeEvaluated.items(i,t,o.items,Gg.Name)}}n?function(){if(!s.$async)throw new Error("async schema referenced by sync schema");const r=i.let("valid");i.try((()=>{i.code(Gg._`await ${(0,Wg.callValidateCode)(e,t,u)}`),d(t),a||i.assign(r,!0)}),(e=>{i.if(Gg._`!(${e} instanceof ${o.ValidationError})`,(()=>i.throw(e))),f(e),a||i.assign(r,!1)})),e.ok(r)}():e.result((0,Wg.callValidateCode)(e,t,u),(()=>d(t)),(()=>f(t)))}Kg.getValidate=Yg,Kg.callRef=ey,Kg.default=Qg,Object.defineProperty(Hg,"__esModule",{value:!0});const ty=["$schema","id","$defs",{keyword:"$comment"},"definitions",Kg.default];Hg.default=ty;var ry={},ny={};Object.defineProperty(ny,"__esModule",{value:!0});const iy=Tp,oy=Bp.operators,ay={maximum:{exclusive:"exclusiveMaximum",ops:[{okStr:"<=",ok:oy.LTE,fail:oy.GT},{okStr:"<",ok:oy.LT,fail:oy.GTE}]},minimum:{exclusive:"exclusiveMinimum",ops:[{okStr:">=",ok:oy.GTE,fail:oy.LT},{okStr:">",ok:oy.GT,fail:oy.LTE}]}},sy={message:e=>iy.str`must be ${uy(e).okStr} ${e.schemaCode}`,params:e=>iy._`{comparison: ${uy(e).okStr}, limit: ${e.schemaCode}}`},cy={keyword:Object.keys(ay),type:"number",schemaType:"number",$data:!0,error:sy,code(e){const{data:t,schemaCode:r}=e;e.fail$data(iy._`${t} ${uy(e).fail} ${r} || isNaN(${t})`)}};function uy(e){var t;const r=e.keyword,n=(null===(t=e.parentSchema)||void 0===t?void 0:t[ay[r].exclusive])?1:0;return ay[r].ops[n]}ny.default=cy;var fy={};Object.defineProperty(fy,"__esModule",{value:!0});const dy={exclusiveMaximum:"maximum",exclusiveMinimum:"minimum"},ly={keyword:Object.keys(dy),type:"number",schemaType:"boolean",code({keyword:e,parentSchema:t}){const r=dy[e];if(void 0===t[r])throw new Error(`${e} can only be used with ${r}`)}};fy.default=ly;var hy={};Object.defineProperty(hy,"__esModule",{value:!0});const py=Bp,my={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:e})=>py.str`must be multiple of ${e}`,params:({schemaCode:e})=>py._`{multipleOf: ${e}}`},code(e){const{gen:t,data:r,schemaCode:n,it:i}=e,o=i.opts.multipleOfPrecision,a=t.let("res"),s=o?py._`Math.abs(Math.round(${a}) - ${a}) > 1e-${o}`:py._`${a} !== parseInt(${a})`;e.fail$data(py._`(${n} === 0 || (${a} = ${r}/${n}, ${s}))`)}};hy.default=my;var gy={},yy={};function by(e){const t=e.length;let r,n=0,i=0;for(;i=55296&&r<=56319&&ivy.str`must NOT have ${"maxLength"===e?"more":"fewer"} than ${t} characters`,params:({schemaCode:e})=>vy._`{limit: ${e}}`},Ey={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:_y,code(e){const{keyword:t,data:r,schemaCode:n,it:i}=e,o="maxLength"===t?vy.operators.GT:vy.operators.LT,a=!1===i.opts.unicode?vy._`${r}.length`:vy._`${(0,wy.useFunc)(e.gen,Ay.default)}(${r})`;e.fail$data(vy._`${a} ${o} ${n}`)}};gy.default=Ey;var Sy={};Object.defineProperty(Sy,"__esModule",{value:!0});const Py=sm,xy=Bp,ky={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>xy.str`must match pattern "${e}"`,params:({schemaCode:e})=>xy._`{pattern: ${e}}`},code(e){const{data:t,$data:r,schema:n,schemaCode:i,it:o}=e,a=o.opts.unicodeRegExp?"u":"",s=r?xy._`(new RegExp(${i}, ${a}))`:(0,Py.usePattern)(e,n);e.fail$data(xy._`!${s}.test(${t})`)}};Sy.default=ky;var My={};Object.defineProperty(My,"__esModule",{value:!0});const Cy=Bp,Iy={message:({keyword:e,schemaCode:t})=>Cy.str`must NOT have ${"maxProperties"===e?"more":"fewer"} than ${t} properties`,params:({schemaCode:e})=>Cy._`{limit: ${e}}`},Ry={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:Iy,code(e){const{keyword:t,data:r,schemaCode:n}=e,i="maxProperties"===t?Cy.operators.GT:Cy.operators.LT;e.fail$data(Cy._`Object.keys(${r}).length ${i} ${n}`)}};My.default=Ry;var Ny={};Object.defineProperty(Ny,"__esModule",{value:!0});const Oy=sm,Ty=Bp,jy=Up,Dy={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:e}})=>Ty.str`must have required property '${e}'`,params:({params:{missingProperty:e}})=>Ty._`{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(Ty.nil,u);else for(const t of r)(0,Oy.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,Oy.propertyInData)(t,i,r,s.ownProperties)),t.if((0,Ty.not)(o),(()=>{e.error(),t.break()}))}),Ty.nil)}(a,r))),e.ok(r)}else t.if((0,Oy.checkMissingProp)(e,r,a)),(0,Oy.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,jy.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,Oy.noPropertyInData)(t,i,r,s.ownProperties),(()=>e.error()))}))}}};Ny.default=Dy;var $y={};Object.defineProperty($y,"__esModule",{value:!0});const By=Bp,Fy={message:({keyword:e,schemaCode:t})=>By.str`must NOT have ${"maxItems"===e?"more":"fewer"} than ${t} items`,params:({schemaCode:e})=>By._`{limit: ${e}}`},zy={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:Fy,code(e){const{keyword:t,data:r,schemaCode:n}=e,i="maxItems"===t?By.operators.GT:By.operators.LT;e.fail$data(By._`${r}.length ${i} ${n}`)}};$y.default=zy;var Uy={},Ly={};Object.defineProperty(Ly,"__esModule",{value:!0});const qy=km;qy.code='require("ajv/dist/runtime/equal").default',Ly.default=qy,Object.defineProperty(Uy,"__esModule",{value:!0});const Hy=Zp,Ky=Bp,Jy=Up,Wy=Ly,Gy={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:e,j:t}})=>Ky.str`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>Ky._`{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,Hy.getSchemaTypes)(o.items):[];function f(n,i){const o=t.name("item"),a=(0,Hy.checkDataTypes)(u,o,s.opts.strictNumbers,Hy.DataType.Wrong),f=t.const("indices",Ky._`{}`);t.for(Ky._`;${n}--;`,(()=>{t.let(o,Ky._`${r}[${n}]`),t.if(a,Ky._`continue`),u.length>1&&t.if(Ky._`typeof ${o} == "string"`,Ky._`${o} += "_"`),t.if(Ky._`typeof ${f}[${o}] == "number"`,(()=>{t.assign(i,Ky._`${f}[${o}]`),e.error(),t.assign(c,!1).break()})).code(Ky._`${f}[${o}] = ${n}`)}))}function d(n,i){const o=(0,Jy.useFunc)(t,Wy.default),a=t.name("outer");t.label(a).for(Ky._`;${n}--;`,(()=>t.for(Ky._`${i} = ${n}; ${i}--;`,(()=>t.if(Ky._`${o}(${r}[${n}], ${r}[${i}])`,(()=>{e.error(),t.assign(c,!1).break(a)}))))))}e.block$data(c,(function(){const n=t.let("i",Ky._`${r}.length`),i=t.let("j");e.setParams({i:n,j:i}),t.assign(c,!0),t.if(Ky._`${n} > 1`,(()=>(u.length>0&&!u.some((e=>"object"===e||"array"===e))?f:d)(n,i)))}),Ky._`${a} === false`),e.ok(c)}};Uy.default=Gy;var Vy={};Object.defineProperty(Vy,"__esModule",{value:!0});const Zy=Bp,Xy=Up,Qy=Ly,Yy={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:e})=>Zy._`{allowedValue: ${e}}`},code(e){const{gen:t,data:r,$data:n,schemaCode:i,schema:o}=e;n||o&&"object"==typeof o?e.fail$data(Zy._`!${(0,Xy.useFunc)(t,Qy.default)}(${r}, ${i})`):e.fail(Zy._`${o} !== ${r}`)}};Vy.default=Yy;var eb={};Object.defineProperty(eb,"__esModule",{value:!0});const tb=Bp,rb=Up,nb=Ly,ib={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:e})=>tb._`{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,rb.useFunc)(t,nb.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(tb._`${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,tb.or)(...i.map(((t,n)=>function(e,t){const n=i[t];return"object"==typeof n&&null!==n?tb._`${u()}(${r}, ${e}[${t}])`:tb._`${r} === ${n}`}(e,n))))}e.pass(f)}};eb.default=ib,Object.defineProperty(ry,"__esModule",{value:!0});const ob=fy,ab=hy,sb=gy,cb=Sy,ub=My,fb=Ny,db=$y,lb=Uy,hb=Vy,pb=eb,mb=[ny.default,ob.default,ab.default,sb.default,cb.default,ub.default,fb.default,db.default,lb.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},hb.default,pb.default];ry.default=mb;var gb={},yb={};Object.defineProperty(yb,"__esModule",{value:!0}),yb.validateAdditionalItems=void 0;const bb=Bp,vb=Up,wb={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:e}})=>bb.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>bb._`{limit: ${e}}`},code(e){const{parentSchema:t,it:r}=e,{items:n}=t;Array.isArray(n)?Ab(e,n):(0,vb.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas')}};function Ab(e,t){const{gen:r,schema:n,data:i,keyword:o,it:a}=e;a.items=!0;const s=r.const("len",bb._`${i}.length`);if(!1===n)e.setParams({len:t.length}),e.pass(bb._`${s} <= ${t.length}`);else if("object"==typeof n&&!(0,vb.alwaysValidSchema)(a,n)){const n=r.var("valid",bb._`${s} <= ${t.length}`);r.if((0,bb.not)(n),(()=>function(n){r.forRange("i",t.length,s,(t=>{e.subschema({keyword:o,dataProp:t,dataPropType:vb.Type.Num},n),a.allErrors||r.if((0,bb.not)(n),(()=>r.break()))}))}(n))),e.ok(n)}}yb.validateAdditionalItems=Ab,yb.default=wb;var _b={},Eb={};Object.defineProperty(Eb,"__esModule",{value:!0}),Eb.validateTuple=void 0;const Sb=Bp,Pb=Up,xb=sm,kb={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){const{schema:t,it:r}=e;if(Array.isArray(t))return Mb(e,"additionalItems",t);r.items=!0,(0,Pb.alwaysValidSchema)(r,t)||e.ok((0,xb.validateArray)(e))}};function Mb(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,Pb.checkStrictMode)(s,e,n.strictTuples)}}(i),s.opts.unevaluated&&r.length&&!0!==s.items&&(s.items=Pb.mergeEvaluated.items(n,r.length,s.items));const c=n.name("valid"),u=n.const("len",Sb._`${o}.length`);r.forEach(((t,r)=>{(0,Pb.alwaysValidSchema)(s,t)||(n.if(Sb._`${u} > ${r}`,(()=>e.subschema({keyword:a,schemaProp:r,dataProp:r},c))),e.ok(c))}))}Eb.validateTuple=Mb,Eb.default=kb,Object.defineProperty(_b,"__esModule",{value:!0});const Cb=Eb,Ib={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,Cb.validateTuple)(e,"items")};_b.default=Ib;var Rb={};Object.defineProperty(Rb,"__esModule",{value:!0});const Nb=Bp,Ob=Up,Tb=sm,jb=yb,Db={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:e}})=>Nb.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>Nb._`{limit: ${e}}`},code(e){const{schema:t,parentSchema:r,it:n}=e,{prefixItems:i}=r;n.items=!0,(0,Ob.alwaysValidSchema)(n,t)||(i?(0,jb.validateAdditionalItems)(e,i):e.ok((0,Tb.validateArray)(e)))}};Rb.default=Db;var $b={};Object.defineProperty($b,"__esModule",{value:!0});const Bb=Bp,Fb=Up,zb={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:e,max:t}})=>void 0===t?Bb.str`must contain at least ${e} valid item(s)`:Bb.str`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>void 0===t?Bb._`{minContains: ${e}}`:Bb._`{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",Bb._`${i}.length`);if(e.setParams({min:a,max:s}),void 0===s&&0===a)return void(0,Fb.checkStrictMode)(o,'"minContains" == 0 without "maxContains": "contains" keyword ignored');if(void 0!==s&&a>s)return(0,Fb.checkStrictMode)(o,'"minContains" > "maxContains" is always invalid'),void e.fail();if((0,Fb.alwaysValidSchema)(o,r)){let t=Bb._`${f} >= ${a}`;return void 0!==s&&(t=Bb._`${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(Bb._`${e}++`),void 0===s?t.if(Bb._`${e} >= ${a}`,(()=>t.assign(d,!0).break())):(t.if(Bb._`${e} > ${s}`,(()=>t.assign(d,!1).break())),1===a?t.assign(d,!0):t.if(Bb._`${e} >= ${a}`,(()=>t.assign(d,!0))))}(r)))))}function h(r,n){t.forRange("i",0,f,(t=>{e.subschema({keyword:"contains",dataProp:t,dataPropType:Fb.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(Bb._`${i}.length > 0`,l)):(t.let(d,!1),l()),e.result(d,(()=>e.reset()))}};$b.default=zb;var Ub={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const t=Bp,r=Up,n=sm;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}(Ub);var Lb={};Object.defineProperty(Lb,"__esModule",{value:!0});const qb=Bp,Hb=Up,Kb={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:e})=>qb._`{propertyName: ${e.propertyName}}`},code(e){const{gen:t,schema:r,data:n,it:i}=e;if((0,Hb.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,qb.not)(o),(()=>{e.error(!0),i.allErrors||t.break()}))})),e.ok(o)}};Lb.default=Kb;var Jb={};Object.defineProperty(Jb,"__esModule",{value:!0});const Wb=sm,Gb=Bp,Vb=Lp,Zb=Up,Xb={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:e})=>Gb._`{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,Zb.alwaysValidSchema)(a,r))return;const u=(0,Wb.allSchemaProperties)(n.properties),f=(0,Wb.allSchemaProperties)(n.patternProperties);function d(e){t.code(Gb._`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,Zb.alwaysValidSchema)(a,r)){const r=t.name("valid");"failing"===c.removeAdditional?(h(n,r,!1),t.if((0,Gb.not)(r),(()=>{e.reset(),d(n)}))):(h(n,r),s||t.if((0,Gb.not)(r),(()=>t.break())))}}}function h(t,r,n){const i={keyword:"additionalProperties",dataProp:t,dataPropType:Zb.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,Zb.schemaRefOrVal)(a,n.properties,"properties");i=(0,Wb.isOwnProperty)(t,e,r)}else i=u.length?(0,Gb.or)(...u.map((e=>Gb._`${r} === ${e}`))):Gb.nil;return f.length&&(i=(0,Gb.or)(i,...f.map((t=>Gb._`${(0,Wb.usePattern)(e,t)}.test(${r})`)))),(0,Gb.not)(i)}(r),(()=>l(r))):l(r)})),e.ok(Gb._`${o} === ${Vb.default.errors}`)}};Jb.default=Xb;var Qb={};Object.defineProperty(Qb,"__esModule",{value:!0});const Yb=jp,ev=sm,tv=Up,rv=Jb,nv={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&&rv.default.code(new Yb.KeywordCxt(o,rv.default,"additionalProperties"));const a=(0,ev.allSchemaProperties)(r);for(const e of a)o.definedProperties.add(e);o.opts.unevaluated&&a.length&&!0!==o.props&&(o.props=tv.mergeEvaluated.props(t,(0,tv.toHash)(a),o.props));const s=a.filter((e=>!(0,tv.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,ev.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)}}};Qb.default=nv;var iv={};Object.defineProperty(iv,"__esModule",{value:!0});const ov=sm,av=Bp,sv=Up,cv=Up,uv={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,ov.allSchemaProperties)(r),c=s.filter((e=>(0,sv.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 av.Name||(o.props=(0,cv.evaluatedPropsToName)(t,o.props));const{props:d}=o;function l(e){for(const t in u)new RegExp(e).test(t)&&(0,sv.checkStrictMode)(o,`property ${t} matches pattern ${e} (use allowMatchingProperties)`)}function h(r){t.forIn("key",n,(n=>{t.if(av._`${(0,ov.usePattern)(e,r)}.test(${n})`,(()=>{const i=c.includes(r);i||e.subschema({keyword:"patternProperties",schemaProp:r,dataProp:n,dataPropType:cv.Type.Str},f),o.opts.unevaluated&&!0!==d?t.assign(av._`${d}[${n}]`,!0):i||o.allErrors||t.if((0,av.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))}()}};iv.default=uv;var fv={};Object.defineProperty(fv,"__esModule",{value:!0});const dv=Up,lv={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){const{gen:t,schema:r,it:n}=e;if((0,dv.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"}};fv.default=lv;var hv={};Object.defineProperty(hv,"__esModule",{value:!0});const pv={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:sm.validateUnion,error:{message:"must match a schema in anyOf"}};hv.default=pv;var mv={};Object.defineProperty(mv,"__esModule",{value:!0});const gv=Bp,yv=Up,bv={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:e})=>gv._`{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,yv.alwaysValidSchema)(i,r)?t.var(c,!0):o=e.subschema({keyword:"oneOf",schemaProp:n,compositeRule:!0},c),n>0&&t.if(gv._`${c} && ${a}`).assign(a,!1).assign(s,gv._`[${s}, ${n}]`).else(),t.if(c,(()=>{t.assign(a,!0),t.assign(s,n),o&&e.mergeEvaluated(o,gv.Name)}))}))})),e.result(a,(()=>e.reset()),(()=>e.error(!0)))}};mv.default=bv;var vv={};Object.defineProperty(vv,"__esModule",{value:!0});const wv=Up,Av={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,wv.alwaysValidSchema)(n,t))return;const o=e.subschema({keyword:"allOf",schemaProp:r},i);e.ok(i),e.mergeEvaluated(o)}))}};vv.default=Av;var _v={};Object.defineProperty(_v,"__esModule",{value:!0});const Ev=Bp,Sv=Up,Pv={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:e})=>Ev.str`must match "${e.ifClause}" schema`,params:({params:e})=>Ev._`{failingKeyword: ${e.ifClause}}`},code(e){const{gen:t,parentSchema:r,it:n}=e;void 0===r.then&&void 0===r.else&&(0,Sv.checkStrictMode)(n,'"if" without "then" and "else" is ignored');const i=xv(n,"then"),o=xv(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,Ev.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,Ev._`${r}`):e.setParams({ifClause:r})}}e.pass(a,(()=>e.error(!0)))}};function xv(e,t){const r=e.schema[t];return void 0!==r&&!(0,Sv.alwaysValidSchema)(e,r)}_v.default=Pv;var kv={};Object.defineProperty(kv,"__esModule",{value:!0});const Mv=Up,Cv={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){void 0===t.if&&(0,Mv.checkStrictMode)(r,`"${e}" without "if" is ignored`)}};kv.default=Cv,Object.defineProperty(gb,"__esModule",{value:!0});const Iv=yb,Rv=_b,Nv=Eb,Ov=Rb,Tv=$b,jv=Ub,Dv=Lb,$v=Jb,Bv=Qb,Fv=iv,zv=fv,Uv=hv,Lv=mv,qv=vv,Hv=_v,Kv=kv;gb.default=function(e=!1){const t=[zv.default,Uv.default,Lv.default,qv.default,Hv.default,Kv.default,Dv.default,$v.default,jv.default,Bv.default,Fv.default];return e?t.push(Rv.default,Ov.default):t.push(Iv.default,Nv.default),t.push(Tv.default),t};var Jv={},Wv={};Object.defineProperty(Wv,"__esModule",{value:!0});const Gv=Bp,Vv={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>Gv.str`must match format "${e}"`,params:({schemaCode:e})=>Gv._`{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",Gv._`${i}[${a}]`),s=r.let("fType"),u=r.let("format");r.if(Gv._`typeof ${o} == "object" && !(${o} instanceof RegExp)`,(()=>r.assign(s,Gv._`${o}.type || "string"`).assign(u,Gv._`${o}.validate`)),(()=>r.assign(s,Gv._`"string"`).assign(u,o))),e.fail$data((0,Gv.or)(!1===c.strictSchema?Gv.nil:Gv._`${a} && !${u}`,function(){const e=f.$async?Gv._`(${o}.async ? await ${u}(${n}) : ${u}(${n}))`:Gv._`${u}(${n})`,r=Gv._`(typeof ${u} == "function" ? ${e} : ${u}.test(${n}))`;return Gv._`${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,Gv.regexpCode)(e):c.code.formats?Gv._`${c.code.formats}${(0,Gv.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,Gv._`${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 Gv._`await ${l}(${n})`}return"function"==typeof s?Gv._`${l}(${n})`:Gv._`${l}.test(${n})`}())}())}};Wv.default=Vv,Object.defineProperty(Jv,"__esModule",{value:!0});const Zv=[Wv.default];Jv.default=Zv,Object.defineProperty(qg,"__esModule",{value:!0});const Xv=ry,Qv=gb,Yv=Jv,ew=[Hg.default,Xv.default,Qv.default(),Yv.default,["title","description","default"]];qg.default=ew;var tw={},rw={};!function(e){var t;Object.defineProperty(e,"__esModule",{value:!0}),e.DiscrError=void 0,(t=e.DiscrError||(e.DiscrError={})).Tag="tag",t.Mapping="mapping"}(rw),Object.defineProperty(tw,"__esModule",{value:!0});const nw=Bp,iw=rw,ow=Sg,aw=Up,sw={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:e,tagName:t}})=>e===iw.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>nw._`{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",nw._`${r}${(0,nw.getProperty)(s)}`);function f(r){const n=t.name("valid"),i=e.subschema({keyword:"oneOf",schemaProp:r},n);return e.mergeEvaluated(i,nw.Name),n}t.if(nw._`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:iw.DiscrError.Tag,tag:u,tagName:s}))),e.ok(c)}};tw.default=sw;var cw={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=Tp,n=qg,i=tw,o=cw,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=Tp;Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return u.KeywordCxt}});var f=Tp;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}})}(Op,Np);var uw=f(Np),fw={},dw={get exports(){return fw},set exports(e){fw=e}},lw={};!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-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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:Pw.GTE,fail:Pw.LT},exclusiveMaximum:{okStr:"<",ok:Pw.LT,fail:Pw.GTE},exclusiveMinimum:{okStr:">",ok:Pw.GT,fail:Pw.LTE}},kw={message:({keyword:e,schemaCode:t})=>Sw.str`must be ${xw[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>Sw._`{comparison: ${xw[e].okStr}, limit: ${t}}`},Mw={keyword:Object.keys(xw),type:"number",schemaType:"number",$data:!0,error:kw,code(e){const{keyword:t,data:r,schemaCode:n}=e;e.fail$data(Sw._`${r} ${xw[t].fail} ${n} || isNaN(${r})`)}};Ew.default=Mw,Object.defineProperty(_w,"__esModule",{value:!0});const Cw=hy,Iw=gy,Rw=Sy,Nw=My,Ow=Ny,Tw=$y,jw=Uy,Dw=Vy,$w=eb,Bw=[Ew.default,Cw.default,Iw.default,Rw.default,Nw.default,Ow.default,Tw.default,jw.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},Dw.default,$w.default];_w.default=Bw;var Fw={};Object.defineProperty(Fw,"__esModule",{value:!0}),Fw.contentVocabulary=Fw.metadataVocabulary=void 0,Fw.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],Fw.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"],Object.defineProperty(gw,"__esModule",{value:!0});const zw=_w,Uw=gb,Lw=Jv,qw=Fw,Hw=[yw.default,zw.default,(0,Uw.default)(),Lw.default,qw.metadataVocabulary,qw.contentVocabulary];gw.default=Hw;var Kw={$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=Tp,n=gw,i=tw,o=Kw,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=jp;Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return u.KeywordCxt}});var f=Bp;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=vg;Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return d.default}});var l=Ag;Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return l.default}})}(mw,pw),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;const t=pw,r=Bp,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)}(hw),function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=lw,n=hw,i=Bp,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}(dw,fw);var Jw=f(fw),Ww={}; -/** - * @license - * Lodash - * Copyright OpenJS Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */ -!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)}({get exports(){return Ww},set exports(e){Ww=e}},Ww);var Gw=Ww,Vw={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 Zw(e){if(new Date(e).getTime()>0)return Number(e);throw new rn(new Error("invalid timestamp"),["invalid timestamp"])}async function Xw(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 no(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=Fh(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]!==Zw(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 Qw=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 Xw(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 Zi(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 io(t,this.agreement.hashAlg),!0,!1),{payload:o}=await Wi(e),a={...this.agreement,cipherblockDgst:i,blockCommitment:o.exchange.blockCommitment,secretCommitment:o.exchange.secretCommitment},s={proofType:"PoO",iss:"orig",exchange:{...a,id:await zh(a)}},c={timestamp:Date.now(),notBefore:"iat",notAfter:"iat",...r},u=await Lh(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 Uh(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 Lh(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(Gi(this.agreement.encAlg),this.agreement.ledgerSignerAddress,this.exchange.id,r);this.block.secret=await Vi(this.exchange.encAlg,n);try{eo(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 e=(await Ji(this.block.jwe,this.block.secret.jwk)).plaintext;if(n(await io(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 Wh("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 Hi(this.jwkPairDest.privateJwk);try{return await new Ui(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(e,t){const r=await Xw(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 rn("Resource has not been validated:\n"+e.join("\n"),t)}this.agreement=e,await Zi(this.jwkPairOrig.publicJwk,this.jwkPairOrig.privateJwk);const i=await Vi(this.agreement.encAlg);this.block={...this.block,secret:i,jwe:await Ki(this.block.raw,i.jwk,this.agreement.encAlg)};const o=n(await io(this.block.jwe,this.agreement.hashAlg),!0,!1),a=n(await io(this.block.raw,this.agreement.hashAlg),!0,!1),c=n(await io(new Uint8Array(s(this.block.secret.hex)),this.agreement.hashAlg),!0,!1),u={...this.agreement,cipherblockDgst:o,blockCommitment:a,secretCommitment:c},f=await zh(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!==ro(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 Uh({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 Lh(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 Uh(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 Wh("orig",this.exchange.id,this.block.por.jws,this.jwkPairOrig.privateJwk)}}});e.ConflictResolution=Gh,e.ENC_ALGS=en,e.EthersIoAgentDest=ep,e.EthersIoAgentOrig=kp,e.HASH_ALGS=Qr,e.I3mServerWalletAgentDest=ip,e.I3mServerWalletAgentOrig=Cp,e.I3mWalletAgentDest=rp,e.I3mWalletAgentOrig=Mp,e.KEY_AGREEMENT_ALGS=tn,e.NonRepudiationProtocol=Qw,e.NrError=rn,e.SIGNING_ALGS=Yr,e.Signers=Ip,e.checkTimestamp=eo,e.createProof=Uh,e.defaultDltConfig=Vh,e.exchangeId=zh,e.generateKeys=async function(e,t,r){if(!Yr.includes(e))throw new rn(new RangeError(`Invalid signature algorithm '${e}''. Allowed algorithms are ${Yr.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 nn("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 Pf(r)}catch(e){throw new rn("no a DID or a valid public or private key",["invalid format"])}},e.importJwk=Hi,e.jsonSort=to,e.jweDecrypt=Ji,e.jweEncrypt=Ki,e.jwsDecode=Wi,e.oneTimeSecret=Vi,e.parseAddress=Fh,e.parseHex=ro,e.parseJwk=no,e.sha=io,e.validateDataExchange=async function(e){const t=[];try{const{id:r,...n}=e;r!==await zh(n)&&t.push(new rn("Invalid dataExchange id",["cannot verify","invalid format"]));const{blockCommitment:i,secretCommitment:o,cipherblockDgst:a,...s}=n,c=await Xw(s);c.length>0&&c.forEach((e=>{t.push(e)}))}catch(e){t.push(new rn("Invalid dataExchange",["cannot verify","invalid format"]))}return t},e.validateDataExchangeAgreement=Xw,e.validateDataSharingAgreementSchema=async function(e){const t=[],r=new uw({strictSchema:!1,removeAdditional:"all"});r.addMetaSchema(Vw),Jw(r);const n=Rp.schemas.DataSharingAgreement;try{const i=r.compile(n),o=Gw.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"]))})),Yi(o)!==Yi(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},e.verifyKeyPair=Zi,e.verifyProof=Lh})); diff --git a/dist/cjs/index.node.cjs b/dist/cjs/index.node.cjs deleted file mode 100644 index 1e86237..0000000 --- a/dist/cjs/index.node.cjs +++ /dev/null @@ -1,2 +0,0 @@ -"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){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 f=l(e);const y=["SHA-256","SHA-384","SHA-512"],g=["ES256","ES384","ES512"],m=["A128GCM","A256GCM"],u=["ECDH-ES"];class h extends Error{constructor(e,t){super(e),e instanceof h?(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:b}=r;async function w(e,t){const i=void 0===t?e.alg:t,r=m.concat(g).concat(u);if(!r.includes(i))throw new h("invalid alg. Must be one of: "+r.join(","),["invalid algorithm"]);try{const i=await a.importJWK(e,t);if(null==i)throw new h(new Error("failed importing keys"),["invalid key"]);return i}catch(e){throw new h(e,["invalid key"])}}async function x(e,t,i){let r,n;const o={...t};if(m.includes(t.alg))r="dir",n=void 0!==i?i:t.alg;else{if(!g.concat(u).includes(t.alg))throw new h(`Not a valid symmetric or assymetric alg: ${t.alg}`,["encryption failed","invalid key","invalid algorithm"]);if(void 0===i)throw new h("An encryption algorith encAlg for content encryption should be provided. Allowed values are: "+m.join(","),["encryption failed"]);n=i,r="ECDH-ES",o.alg=r}const s=await w(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 h(e,["encryption failed"])}}async function P(e,t){try{const i={...t},{alg:r,enc:n}=a.decodeProtectedHeader(e);if(void 0===r||void 0===n)throw new h("missing enc or alg in jwe header",["invalid format"]);"ECDH-ES"===r&&(i.alg=r);const o=await w(i);return await a.compactDecrypt(e,o,{contentEncryptionAlgorithms:[n]})}catch(e){throw new h(e,["decryption failed"])}}async function A(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 h(new Error(`${e} is not a JWS`),["not a compact jws"]);let r,n;try{r=JSON.parse(f.decode(i[1],!0)),n=JSON.parse(f.decode(i[2],!0))}catch(e){throw new h(e,["invalid format","not a compact jws"])}if(void 0!==t){const i="function"==typeof t?await t(r,n):t,o=await w(i);try{const t=await a.jwtVerify(e,o);return{header:t.protectedHeader,payload:t.payload,signer:i}}catch(e){throw new h(e,["jws verification failed"])}}return{header:r,payload:n}}function v(e){if(m.concat(y).concat(g).includes(e))return Number(e.match(/\d{3}/)[0])/8;throw new h("unsupported algorithm",["invalid algorithm"])}async function S(i,r,n){let o;if(!m.includes(i))throw new h(new Error(`Invalid encAlg '${i}'. Supported values are: ${m.toString()}`),["invalid algorithm"]);const s=v(i);if(void 0!==r){if("string"==typeof r)if(!0===n)o=f.decode(r);else{const e=t.parseHex(r,!1);if(e!==t.parseHex(r,!1,s))throw new h(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 h(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 h(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 k(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 w(e),n=await w(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 h(e,["unexpected error"])}}function E(e,t,i,r=2e3){if(ei+r)throw new h(new Error(`timestamp ${new Date(e).toTimeString()} after 'notAfter' ${new Date(i).toTimeString()} with tolerance of ${r/1e3}s`),["invalid timestamp"])}function j(e){return Array.isArray(e)?e.sort().map(j):(t=e,"[object Object]"===Object.prototype.toString.call(t)?Object.keys(e).sort().reduce((function(t,i){return t[i]=j(e[i]),t}),{}):e);var t}function D(e,i=!1,r){try{return t.parseHex(e,i,r)}catch(e){throw new h(e,["invalid format"])}}async function C(e,t){try{await w(e,e.alg);const i=j(e);return t?JSON.stringify(i):i}catch(e){throw new h(e,["invalid key"])}}async function $(e,t){const i=y;if(!i.includes(t))throw new h(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 h(e,["unexpected error"])}}function q(e){if(null==e.match(/^(0x)?([\da-fA-F]{40})$/))throw new RangeError("incorrect address format");try{const t=D(e,!0,20);return o.ethers.utils.getAddress(t)}catch(e){throw new h(e,["invalid EIP-55 address"])}}async function O(e){return f.encode(await $(n.hashable(e),"SHA-256"),!0,!1)}async function R(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 k(i,t);const r=await w(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 J(e,t,i){const r=JSON.parse(t.exchange[t.iss]),a=await A(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){E("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;T(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 T(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 I(e,t,i=10){const{payload:r}=await A(e),a=r.exchange,n={...a};delete n.id;if(await O(n)!==a.id)throw new h(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 J(r.poo,{iss:"orig",proofType:"PoO",exchange:a})).payload}catch(e){throw new h(e,["invalid poo"])}try{await J(e,{iss:"dest",proofType:"PoR",exchange:a},{timestamp:"iat",notBefore:1e3*p.iat,notAfter:1e3*p.iat+a.pooToPorDelay})}catch(e){throw new h(e,["invalid por"])}try{const e=await t.getSecretFromLedger(v(a.encAlg),a.ledgerSignerAddress,a.id,i);d=e.hex,c=e.iat}catch(e){throw new h(e,["cannot verify"])}try{E(1e3*c,1e3*r.iat,1e3*p.iat+a.pooToSecretDelay)}catch(e){throw new h(`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 F(e,t,i=10){let r,a,n,o,s;try{r=(await A(e)).payload}catch(e){throw new h(e,["invalid verification request"])}try{const e=await I(r.por,t,i);a=e.destPublicJwk,n=e.origPublicJwk,o=e.pooPayload,s=e.porPayload}catch(e){throw new h(e,["invalid por","invalid verification request"])}try{await A(e,"dest"===r.iss?a:n)}catch(e){throw new h(e,["invalid verification request"])}return{pooPayload:o,porPayload:s,vrPayload:r,destPublicJwk:a,origPublicJwk:n}}async function z(e,t){const{payload:i}=await A(e),{destPublicJwk:r,origPublicJwk:a,secretHex:n,pooPayload:o,porPayload:s}=await I(i.por,t);try{await A(e,r)}catch(e){throw e instanceof h&&e.add("invalid dispute request"),e}if(f.encode(await $(i.cipherblock,s.exchange.hashAlg),!0,!1)!==s.exchange.cipherblockDgst)throw new h(new Error("cipherblock does not meet the committed (and already accepted) one"),["invalid dispute request"]);return await P(i.cipherblock,(await S(s.exchange.encAlg,n)).jwk),{pooPayload:o,porPayload:s,drPayload:i,destPublicJwk:r,origPublicJwk:a}}async function _(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 M=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 k(this.jwkPair.publicJwk,this.jwkPair.privateJwk)}async resolveCompleteness(e){await this.initialized;const{payload:t}=await A(e);let i;try{i=(await A(t.por)).payload}catch(e){throw new h(e,["invalid por"])}const r={...await this._resolution(t.dataExchangeId,i.exchange[t.iss]),resolution:"not completed",type:"verification"};try{await F(e,this.dltAgent),r.resolution="completed"}catch(e){if(!(e instanceof h)||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 A(e);let i;try{i=(await A(t.por)).payload}catch(e){throw new h(e,["invalid por"])}const r={...await this._resolution(t.dataExchangeId,i.exchange[t.iss]),resolution:"denied",type:"dispute"};try{await z(e,this.dltAgent)}catch(e){if(!(e instanceof h&&e.nrErrors.includes("decryption failed")))throw new h(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 C(this.jwkPair.publicJwk,!0),sub:t}}},checkCompleteness:F,checkDecryption:z,generateVerificationRequest:_,verifyPor:I,verifyResolution:async function(e,t){return await A(e,t??((e,t)=>JSON.parse(t.iss)))}});const W={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 N(e,i,r,a,n){let s=o.ethers.BigNumber.from(0),p=o.ethers.BigNumber.from(0);const d=D(t.bufToHex(f.decode(r)),!0);let c=0;do{try{({secret:s,timestamp:p}=await e.registry(D(i,!0),d))}catch(e){throw new h(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={...W,...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={...W,...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 V extends B{async getSecretFromLedger(e,t,i,r){return await this.initialized,await N(this.contract,t,i,r,e)}}class G extends B{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:a})})).catch((e=>{r(e)}))}))),this.wallet=e,this.did=t}}class Z extends G{async getSecretFromLedger(e,t,i,r){return await this.initialized,await N(this.contract,t,i,r,e)}}class X extends B{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:a})})).catch((e=>{r(e)}))}))),this.wallet=e,this.did=t}}class L extends X{async getSecretFromLedger(e,t,i,r){return await this.initialized,await N(this.contract,t,i,r,e)}}class U extends B{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 H(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 Y extends G{constructor(){super(...arguments),this.count=-1}async deploySecret(e,t){await this.initialized;const i=await H(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 h(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 Q extends X{constructor(){super(...arguments),this.count=-1}async deploySecret(e,t){await this.initialized;const i=await H(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 h(`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 ee=Object.freeze({__proto__:null,EthersIoAgentDest:V,EthersIoAgentOrig:U,I3mServerWalletAgentDest:L,I3mServerWalletAgentOrig:Q,I3mWalletAgentDest:Z,I3mWalletAgentOrig:Y}),te={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"]}]}}},ie={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 re(e){if(new Date(e).getTime()>0)return Number(e);throw new h(new Error("invalid timestamp"),["invalid timestamp"])}async function ae(e){const t=[],i=Object.keys(e);(i.length<10||i.length>11)&&t.push(new h(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 C(JSON.parse(e[r]),!0)&&t.push(new h(`[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 h(`[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=q(e[r]),e[r]!==i&&t.push(new h(`[dataExchangeAgreeement.${r}] Invalid EIP-55 address ${e[r]}. Did you mean ${i} instead?`,["invalid EIP-55 address","invalid format"]))}catch(i){t.push(new h(`[dataExchangeAgreeement.${r}] Invalid EIP-55 address ${e[r]}.`,["invalid EIP-55 address","invalid format"]))}break;case"pooToPorDelay":case"pooToPopDelay":case"pooToSecretDelay":try{e[r]!==re(e[r])&&t.push(new h(`[dataExchangeAgreeement.${r}] < 0 or not a number`,["invalid timestamp","invalid format"]))}catch(e){t.push(new h(`[dataExchangeAgreeement.${r}] < 0 or not a number`,["invalid timestamp","invalid format"]))}break;case"hashAlg":y.includes(e[r])||t.push(new h(`[dataExchangeAgreeement.${r}Invalid hash algorithm '${e[r]}'. It must be one of: ${y.join(", ")}`,["invalid algorithm"]));break;case"encAlg":m.includes(e[r])||t.push(new h(`[dataExchangeAgreeement.${r}Invalid encryption algorithm '${e[r]}'. It must be one of: ${m.join(", ")}`,["invalid algorithm"]));break;case"signingAlg":g.includes(e[r])||t.push(new h(`[dataExchangeAgreeement.${r}Invalid signing algorithm '${e[r]}'. It must be one of: ${g.join(", ")}`,["invalid algorithm"]));break;case"schema":break;default:t.push(new h(new Error(`Property ${r} not allowed in dataAgreement`),["invalid format"]))}}return t}var ne=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 ae(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 h("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 k(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=f.encode(await $(t,this.agreement.hashAlg),!0,!1),{payload:a}=await A(e),n={...this.agreement,cipherblockDgst:r,blockCommitment:a.exchange.blockCommitment,secretCommitment:a.exchange.secretCommitment},o={proofType:"PoO",iss:"orig",exchange:{...n,id:await O(n)}},s={timestamp:Date.now(),notBefore:"iat",notAfter:"iat",...i},p=await J(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 R(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 J(e,r,a),o=JSON.parse(n.payload.secret);return this.block.secret={hex:t.bufToHex(f.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(v(this.agreement.encAlg),this.agreement.ledgerSignerAddress,this.exchange.id,i);this.block.secret=await S(this.exchange.encAlg,r);try{E(1e3*a,1e3*this.block.por.payload.iat,1e3*this.block.poo.payload.iat+this.exchange.pooToSecretDelay)}catch(e){throw new h(`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 P(this.block.jwe,this.block.secret.jwk)).plaintext;if(f.encode(await $(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 _("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 w(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 h(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 ae(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 h("Resource has not been validated:\n"+e.join("\n"),t)}this.agreement=e,await k(this.jwkPairOrig.publicJwk,this.jwkPairOrig.privateJwk);const a=await S(this.agreement.encAlg);this.block={...this.block,secret:a,jwe:await x(this.block.raw,a.jwk,this.agreement.encAlg)};const n=f.encode(await $(this.block.jwe,this.agreement.hashAlg),!0,!1),o=f.encode(await $(this.block.raw,this.agreement.hashAlg),!0,!1),s=f.encode(await $(new Uint8Array(t.hexToBuf(this.block.secret.hex)),this.agreement.hashAlg),!0,!1),p={...this.agreement,cipherblockDgst:n,blockCommitment:o,secretCommitment:s},d=await O(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!==D(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 R({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 J(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 R(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 _("orig",this.exchange.id,this.block.por.jws,this.jwkPairOrig.privateJwk)}}});exports.ConflictResolution=M,exports.ENC_ALGS=m,exports.EthersIoAgentDest=V,exports.EthersIoAgentOrig=U,exports.HASH_ALGS=y,exports.I3mServerWalletAgentDest=L,exports.I3mServerWalletAgentOrig=Q,exports.I3mWalletAgentDest=Z,exports.I3mWalletAgentOrig=Y,exports.KEY_AGREEMENT_ALGS=u,exports.NonRepudiationProtocol=ne,exports.NrError=h,exports.SIGNING_ALGS=g,exports.Signers=ee,exports.checkTimestamp=E,exports.createProof=R,exports.defaultDltConfig=W,exports.exchangeId=O,exports.generateKeys=async function(e,r,a){if(!g.includes(e))throw new h(new RangeError(`Invalid signature algorithm '${e}''. Allowed algorithms are ${g.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?f.decode(r):new Uint8Array(t.hexToBuf(r)):r:new Uint8Array(await i.randBytes(n));const p=new b("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"),y=p.getPrivate("hex").padStart(2*n,"0"),m={kty:"EC",crv:o,x:f.encode(t.hexToBuf(c),!0,!1),y:f.encode(t.hexToBuf(l),!0,!1),d:f.encode(t.hexToBuf(y),!0,!1),alg:e},u={...m};return delete u.d,{publicJwk:u,privateJwk:m}},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 h("no a DID or a valid public or private key",["invalid format"])}},exports.importJwk=w,exports.jsonSort=j,exports.jweDecrypt=P,exports.jweEncrypt=x,exports.jwsDecode=A,exports.oneTimeSecret=S,exports.parseAddress=q,exports.parseHex=D,exports.parseJwk=C,exports.sha=$,exports.validateDataExchange=async function(e){const t=[];try{const{id:i,...r}=e;i!==await O(r)&&t.push(new h("Invalid dataExchange id",["cannot verify","invalid format"]));const{blockCommitment:a,secretCommitment:n,cipherblockDgst:o,...s}=r,p=await ae(s);p.length>0&&p.forEach((e=>{t.push(e)}))}catch(e){t.push(new h("Invalid dataExchange",["cannot verify","invalid format"]))}return t},exports.validateDataExchangeAgreement=ae,exports.validateDataSharingAgreementSchema=async function(e){const t=[],i=new p({strictSchema:!1,removeAdditional:"all"});i.addMetaSchema(ie),d(i);const r=te.schemas.DataSharingAgreement;try{const a=i.compile(r),o=c.cloneDeep(e);a(e)||null!==a.errors&&void 0!==a.errors&&a.errors.length>0&&a.errors.forEach((e=>{t.push(new h(`[${e.instancePath}] ${e.message??"unknown"}`,["invalid format"]))})),n.hashable(o)!==n.hashable(e)&&t.push(new h("Additional claims beyond the schema are not supported",["invalid format"]))}catch(e){t.push(new h(e,["invalid format"]))}return t},exports.verifyKeyPair=k,exports.verifyProof=J; -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXgubm9kZS5janMiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy90cy9jb25zdGFudHMudHMiLCIuLi8uLi9zcmMvdHMvZXJyb3JzL05yRXJyb3IudHMiLCIuLi8uLi9zcmMvdHMvY3J5cHRvL2dlbmVyYXRlS2V5cy50cyIsIi4uLy4uL3NyYy90cy9jcnlwdG8vaW1wb3J0SndrLnRzIiwiLi4vLi4vc3JjL3RzL2NyeXB0by9qd2UudHMiLCIuLi8uLi9zcmMvdHMvY3J5cHRvL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R0FDeEY0UixFQUFTdFYsT0FBTzBSLFNBQVEvUixJQUN0QkssRUFBT3NSLEtBQUssSUFBSTlSLEVBQVEsSUFBSUcsRUFBTWdXLGlCQUFpQmhXLEVBQU1nUyxTQUFXLFlBQWEsQ0FBQyxtQkFBbUIsSUFJdkczSixFQUFRQSxTQUFDd04sS0FBcUJ4TixFQUFRQSxTQUFDb0osSUFDekNwUixFQUFPc1IsS0FBSyxJQUFJOVIsRUFBUSx3REFBeUQsQ0FBQyxtQkFFckYsQ0FBQyxNQUFPRyxHQUNQSyxFQUFPc1IsS0FBSyxJQUFJOVIsRUFBUUcsRUFBTyxDQUFDLG1CQUNqQyxDQUVELE9BQU9LLENBQ1QifQ== diff --git a/dist/esm/index.browser.js b/dist/esm/index.browser.js deleted file mode 100644 index 9d5db2a..0000000 --- a/dist/esm/index.browser.js +++ /dev/null @@ -1,1374 +0,0 @@ -import * as b64 from '@juanelas/base64'; -import { decode } from '@juanelas/base64'; -import { hexToBuf, parseHex as parseHex$1, bufToHex } from 'bigint-conversion'; -import { randBytes, randBytesSync } from 'bigint-crypto-utils'; -import elliptic from 'elliptic'; -import { importJWK, CompactEncrypt, decodeProtectedHeader, compactDecrypt, jwtVerify, generateSecret, exportJWK, GeneralSign, generalVerify, SignJWT } from 'jose'; -import { hashable } from 'object-sha'; -import { ethers, Wallet } from 'ethers'; -import { SigningKey } from 'ethers/lib/utils'; -import Ajv from 'ajv-draft-04'; -import addFormats from 'ajv-formats'; -import _ from 'lodash'; - -const HASH_ALGS = ['SHA-256', 'SHA-384', 'SHA-512']; -const SIGNING_ALGS = ['ES256', 'ES384', 'ES512']; -const ENC_ALGS = ['A128GCM', 'A256GCM']; -const KEY_AGREEMENT_ALGS = ['ECDH-ES']; - -class NrError extends Error { - constructor(error, nrErrors) { - super(error); - if (error instanceof NrError) { - this.nrErrors = error.nrErrors; - this.add(...nrErrors); - } - else { - this.nrErrors = nrErrors; - } - } - add(...nrErrors) { - const errors = this.nrErrors.concat(nrErrors); - this.nrErrors = [...(new Set(errors))]; - } -} - -const { ec: Ec } = elliptic; -async function generateKeys(alg, privateKey, base64) { - if (!SIGNING_ALGS.includes(alg)) - throw new NrError(new RangeError(`Invalid signature algorithm '${alg}''. Allowed algorithms are ${SIGNING_ALGS.toString()}`), ['invalid algorithm']); - let keyLength; - let namedCurve; - switch (alg) { - case 'ES512': - namedCurve = 'P-521'; - keyLength = 66; - break; - case 'ES384': - namedCurve = 'P-384'; - keyLength = 48; - break; - default: - namedCurve = 'P-256'; - keyLength = 32; - } - let privKeyBuf; - if (privateKey !== undefined) { - if (typeof privateKey === 'string') { - if (base64 === true) { - privKeyBuf = b64.decode(privateKey); - } - else { - privKeyBuf = new Uint8Array(hexToBuf(privateKey)); - } - } - else { - privKeyBuf = privateKey; - } - } - else { - privKeyBuf = new Uint8Array(await randBytes(keyLength)); - } - const ec = new Ec('p' + namedCurve.substring(namedCurve.length - 3)); - const ecPriv = ec.keyFromPrivate(privKeyBuf); - const ecPub = ecPriv.getPublic(); - 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 = b64.encode(hexToBuf(xHex), true, false); - const y = b64.encode(hexToBuf(yHex), true, false); - const d = b64.encode(hexToBuf(dHex), true, false); - const privateJwk = { kty: 'EC', crv: namedCurve, x, y, d, alg }; - const publicJwk = { ...privateJwk }; - delete publicJwk.d; - return { - publicJwk, - privateJwk - }; -} - -async function importJwk(jwk, alg) { - const jwkAlg = alg === undefined ? jwk.alg : alg; - const algs = ENC_ALGS.concat(SIGNING_ALGS).concat(KEY_AGREEMENT_ALGS); - if (!algs.includes(jwkAlg)) { - throw new NrError('invalid alg. Must be one of: ' + algs.join(','), ['invalid algorithm']); - } - try { - const key = await importJWK(jwk, alg); - if (key === undefined || key === null) { - throw new NrError(new Error('failed importing keys'), ['invalid key']); - } - return key; - } - catch (error) { - throw new NrError(error, ['invalid key']); - } -} - -async function jweEncrypt(block, secretOrPublicKey, encAlg) { - let alg; - let enc; - const jwk = { ...secretOrPublicKey }; - if (ENC_ALGS.includes(secretOrPublicKey.alg)) { - alg = 'dir'; - enc = encAlg !== undefined ? encAlg : secretOrPublicKey.alg; - } - else if (SIGNING_ALGS.concat(KEY_AGREEMENT_ALGS).includes(secretOrPublicKey.alg)) { - if (encAlg === undefined) { - throw new NrError('An encryption algorith encAlg for content encryption should be provided. Allowed values are: ' + ENC_ALGS.join(','), ['encryption failed']); - } - enc = encAlg; - alg = 'ECDH-ES'; - jwk.alg = alg; - } - else { - throw new NrError(`Not a valid symmetric or assymetric alg: ${secretOrPublicKey.alg}`, ['encryption failed', 'invalid key', 'invalid algorithm']); - } - const key = await importJwk(jwk); - let jwe; - try { - jwe = await new CompactEncrypt(block) - .setProtectedHeader({ alg, enc, kid: secretOrPublicKey.kid }) - .encrypt(key); - return jwe; - } - catch (error) { - throw new NrError(error, ['encryption failed']); - } -} -async function jweDecrypt(jwe, secretOrPrivateKey) { - try { - const jwk = { ...secretOrPrivateKey }; - const { alg, enc } = decodeProtectedHeader(jwe); - if (alg === undefined || enc === undefined) { - throw new NrError('missing enc or alg in jwe header', ['invalid format']); - } - if (alg === 'ECDH-ES') { - jwk.alg = alg; - } - const key = await importJwk(jwk); - return await compactDecrypt(jwe, key, { contentEncryptionAlgorithms: [enc] }); - } - catch (error) { - const nrError = new NrError(error, ['decryption failed']); - throw nrError; - } -} - -async function jwsDecode(jws, publicJwk) { - const regex = /^([a-zA-Z0-9_-]+)\.{1,2}([a-zA-Z0-9_-]+)\.([a-zA-Z0-9_-]+)$/; - const match = jws.match(regex); - if (match === null) { - throw new NrError(new Error(`${jws} is not a JWS`), ['not a compact jws']); - } - let header; - let payload; - try { - header = JSON.parse(b64.decode(match[1], true)); - payload = JSON.parse(b64.decode(match[2], true)); - } - catch (error) { - throw new NrError(error, ['invalid format', 'not a compact jws']); - } - if (publicJwk !== undefined) { - const pubJwk = (typeof publicJwk === 'function') ? await publicJwk(header, payload) : publicJwk; - const pubKey = await importJwk(pubJwk); - try { - const verified = await jwtVerify(jws, pubKey); - return { - header: verified.protectedHeader, - payload: verified.payload, - signer: pubJwk - }; - } - catch (error) { - throw new NrError(error, ['jws verification failed']); - } - } - return { header, payload }; -} - -function algByteLength(alg) { - const algs = ENC_ALGS.concat(HASH_ALGS).concat(SIGNING_ALGS); - if (algs.includes(alg)) { - return Number(alg.match(/\d{3}/)[0]) / 8; - } - throw new NrError('unsupported algorithm', ['invalid algorithm']); -} - -async function oneTimeSecret(encAlg, secret, base64) { - let key; - if (!ENC_ALGS.includes(encAlg)) { - throw new NrError(new Error(`Invalid encAlg '${encAlg}'. Supported values are: ${ENC_ALGS.toString()}`), ['invalid algorithm']); - } - const secretLength = algByteLength(encAlg); - if (secret !== undefined) { - if (typeof secret === 'string') { - if (base64 === true) { - key = b64.decode(secret); - } - else { - 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(hexToBuf(secret)); - } - } - else { - key = secret; - } - if (key.length !== secretLength) { - throw new NrError(new RangeError(`Expected secret length ${secretLength} does not meet provided one ${key.length}`), ['invalid key']); - } - } - else { - try { - key = await generateSecret(encAlg, { extractable: true }); - } - catch (error) { - throw new NrError(error, ['unexpected error']); - } - } - const jwk = await exportJWK(key); - jwk.alg = encAlg; - return { jwk: jwk, hex: bufToHex(decode(jwk.k), false, secretLength) }; -} - -async function verifyKeyPair(pubJWK, privJWK) { - if (pubJWK.alg === undefined || privJWK.alg === undefined || pubJWK.alg !== privJWK.alg) { - throw new Error('alg no present in either pubJwk or privJwk, or pubJWK.alg != privJWK.alg'); - } - const pubKey = await importJwk(pubJWK); - const privKey = await importJwk(privJWK); - try { - const nonce = await randBytes(16); - const jws = await new GeneralSign(nonce) - .addSignature(privKey) - .setProtectedHeader({ alg: privJWK.alg }) - .sign(); - await generalVerify(jws, pubKey); - } - catch (error) { - throw new NrError(error, ['unexpected error']); - } -} - -function checkTimestamp(timestamp, notBefore, notAfter, tolerance = 2000) { - if (timestamp < notBefore - tolerance) { - throw new NrError(new Error(`timestamp ${(new Date(timestamp).toTimeString())} before 'notBefore' ${(new Date(notBefore).toTimeString())} with tolerance of ${tolerance / 1000}s`), ['invalid timestamp']); - } - else if (timestamp > notAfter + tolerance) { - throw new NrError(new Error(`timestamp ${(new Date(timestamp).toTimeString())} after 'notAfter' ${(new Date(notAfter).toTimeString())} with tolerance of ${tolerance / 1000}s`), ['invalid timestamp']); - } -} - -function isObject(v) { - return Object.prototype.toString.call(v) === '[object Object]'; -} -function jsonSort(obj) { - if (Array.isArray(obj)) { - return obj.sort().map(jsonSort); - } - else if (isObject(obj)) { - return Object - .keys(obj) - .sort() - .reduce(function (a, k) { - a[k] = jsonSort(obj[k]); - return a; - }, {}); - } - return obj; -} - -function parseHex(a, prefix0x = false, byteLength) { - try { - return parseHex$1(a, prefix0x, byteLength); - } - catch (error) { - throw new NrError(error, ['invalid format']); - } -} - -async function parseJwk(jwk, stringify) { - try { - await importJwk(jwk, jwk.alg); - const sortedJwk = jsonSort(jwk); - return (stringify) ? JSON.stringify(sortedJwk) : sortedJwk; - } - catch (error) { - throw new NrError(error, ['invalid key']); - } -} - -async function sha(input, algorithm) { - const algorithms = HASH_ALGS; - if (!algorithms.includes(algorithm)) { - throw new NrError(new RangeError(`Valid hash algorith values are any of ${JSON.stringify(algorithms)}`), ['invalid algorithm']); - } - const encoder = new TextEncoder(); - const hashInput = (typeof input === 'string') ? encoder.encode(input).buffer : input; - try { - let digest; - if (true) { - digest = new Uint8Array(await crypto.subtle.digest(algorithm, hashInput)); - } - return digest; - } - catch (error) { - throw new NrError(error, ['unexpected error']); - } -} - -function parseAddress(a) { - const hexMatch = a.match(/^(0x)?([\da-fA-F]{40})$/); - if (hexMatch == null) { - throw new RangeError('incorrect address format'); - } - try { - const hex = parseHex(a, true, 20); - return ethers.utils.getAddress(hex); - } - catch (error) { - throw new NrError(error, ['invalid EIP-55 address']); - } -} - -function getDltAddress(didOrKeyInHex) { - const didRegEx = /^did:ethr:(\w+:)?(0x[0-9a-fA-F]{40}[0-9a-fA-F]{26}?)$/; - const match = didOrKeyInHex.match(didRegEx); - const key = (match !== null) ? match[match.length - 1] : didOrKeyInHex; - try { - return ethers.utils.computeAddress(key); - } - catch (error) { - throw new NrError('no a DID or a valid public or private key', ['invalid format']); - } -} - -async function exchangeId(exchange) { - return b64.encode(await sha(hashable(exchange), 'SHA-256'), true, false); -} - -async function createProof(payload, privateJwk) { - if (payload.iss === undefined) { - throw new Error('Payload iss should be set to either "orig" or "dest"'); - } - const publicJwk = JSON.parse(payload.exchange[payload.iss]); - await verifyKeyPair(publicJwk, privateJwk); - const privateKey = await importJwk(privateJwk); - const alg = privateJwk.alg; - const proofPayload = { - ...payload, - iat: Math.floor(Date.now() / 1000) - }; - const jws = await new SignJWT(proofPayload) - .setProtectedHeader({ alg }) - .setIssuedAt(proofPayload.iat) - .sign(privateKey); - return { - jws, - payload: proofPayload - }; -} - -async function verifyProof(proof, expectedPayloadClaims, options) { - const publicJwk = JSON.parse(expectedPayloadClaims.exchange[expectedPayloadClaims.iss]); - const verification = await jwsDecode(proof, publicJwk); - if (verification.payload.iss === undefined) { - throw new Error('Property "iss" missing'); - } - if (verification.payload.iat === undefined) { - throw new Error('Property claim iat missing'); - } - if (options !== undefined) { - const timestamp = (options.timestamp === 'iat') ? verification.payload.iat * 1000 : options.timestamp; - const notBefore = (options.notBefore === 'iat') ? verification.payload.iat * 1000 : options.notBefore; - const notAfter = (options.notAfter === 'iat') ? verification.payload.iat * 1000 : options.notAfter; - checkTimestamp(timestamp, notBefore, notAfter, options.tolerance); - } - const payload = verification.payload; - const issuer = payload.exchange[payload.iss]; - if (hashable(publicJwk) !== hashable(JSON.parse(issuer))) { - throw new Error(`The proof is issued by ${issuer} instead of ${JSON.stringify(publicJwk)}`); - } - const expectedClaimsDict = expectedPayloadClaims; - for (const key in expectedClaimsDict) { - if (payload[key] === undefined) - throw new Error(`Expected key '${key}' not found in proof`); - if (key === 'exchange') { - const expectedDataExchange = expectedPayloadClaims.exchange; - const dataExchange = payload.exchange; - checkDataExchange(dataExchange, expectedDataExchange); - } - 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)}`); - } - } - return verification; -} -function checkDataExchange(dataExchange, expectedDataExchange) { - const claims = ['id', 'orig', 'dest', 'hashAlg', 'cipherblockDgst', 'blockCommitment', 'blockCommitment', 'secretCommitment', 'schema']; - for (const claim of claims) { - if (claim !== 'schema' && (dataExchange[claim] === undefined || dataExchange[claim] === '')) { - throw new Error(`${claim} is missing on dataExchange.\ndataExchange: ${JSON.stringify(dataExchange, undefined, 2)}`); - } - } - for (const key in expectedDataExchange) { - 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)}`); - } - } -} - -async function verifyPor(por, wallet, connectionTimeout = 10) { - const { payload: porPayload } = await jwsDecode(por); - const exchange = porPayload.exchange; - const dataExchangePreview = { ...exchange }; - delete dataExchangePreview.id; - const expectedExchangeId = await exchangeId(dataExchangePreview); - if (expectedExchangeId !== exchange.id) { - throw new NrError(new Error('data exchange integrity failed'), ['dataExchange integrity violated']); - } - const destPublicJwk = JSON.parse(exchange.dest); - const origPublicJwk = JSON.parse(exchange.orig); - let pooPayload; - try { - const verified = await verifyProof(porPayload.poo, { - iss: 'orig', - proofType: 'PoO', - exchange - }); - pooPayload = verified.payload; - } - catch (error) { - throw new NrError(error, ['invalid poo']); - } - try { - await verifyProof(por, { - iss: 'dest', - proofType: 'PoR', - exchange - }, { - timestamp: 'iat', - notBefore: pooPayload.iat * 1000, - notAfter: pooPayload.iat * 1000 + exchange.pooToPorDelay - }); - } - catch (error) { - throw new NrError(error, ['invalid por']); - } - let secretHex, iat; - try { - const secret = await wallet.getSecretFromLedger(algByteLength(exchange.encAlg), exchange.ledgerSignerAddress, exchange.id, connectionTimeout); - secretHex = secret.hex; - iat = secret.iat; - } - catch (error) { - throw new NrError(error, ['cannot verify']); - } - try { - checkTimestamp(iat * 1000, porPayload.iat * 1000, pooPayload.iat * 1000 + exchange.pooToSecretDelay); - } - catch (error) { - throw new NrError(`Although the secret has been obtained (and you could try to decrypt the cipherblock), it's been published later than agreed: ${(new Date(iat * 1000)).toUTCString()} > ${(new Date(pooPayload.iat * 1000 + exchange.pooToSecretDelay)).toUTCString()}`, ['secret not published in time']); - } - return { - pooPayload, - porPayload, - secretHex, - destPublicJwk, - origPublicJwk - }; -} - -async function checkCompleteness(verificationRequest, wallet, connectionTimeout = 10) { - let vrPayload; - try { - const decoded = await jwsDecode(verificationRequest); - vrPayload = decoded.payload; - } - catch (error) { - throw new NrError(error, ['invalid verification request']); - } - let destPublicJwk, origPublicJwk, pooPayload, porPayload; - try { - const verified = await verifyPor(vrPayload.por, wallet, connectionTimeout); - destPublicJwk = verified.destPublicJwk; - origPublicJwk = verified.origPublicJwk; - pooPayload = verified.pooPayload; - porPayload = verified.porPayload; - } - catch (error) { - throw new NrError(error, ['invalid por', 'invalid verification request']); - } - try { - await jwsDecode(verificationRequest, (vrPayload.iss === 'dest') ? destPublicJwk : origPublicJwk); - } - catch (error) { - throw new NrError(error, ['invalid verification request']); - } - return { - pooPayload, - porPayload, - vrPayload, - destPublicJwk, - origPublicJwk - }; -} - -async function checkDecryption(disputeRequest, wallet) { - const { payload: drPayload } = await jwsDecode(disputeRequest); - const { destPublicJwk, origPublicJwk, secretHex, pooPayload, porPayload } = await verifyPor(drPayload.por, wallet); - try { - await jwsDecode(disputeRequest, destPublicJwk); - } - catch (error) { - if (error instanceof NrError) { - error.add('invalid dispute request'); - } - throw error; - } - const cipherblockDgst = b64.encode(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']); - } - await jweDecrypt(drPayload.cipherblock, (await (oneTimeSecret(porPayload.exchange.encAlg, secretHex))).jwk); - return { - pooPayload, - porPayload, - drPayload, - destPublicJwk, - origPublicJwk - }; -} - -class ConflictResolver { - constructor(jwkPair, dltAgent) { - this.jwkPair = jwkPair; - this.dltAgent = dltAgent; - this.initialized = new Promise((resolve, reject) => { - this.init().then(() => { - resolve(true); - }).catch((error) => { - reject(error); - }); - }); - } - async init() { - await verifyKeyPair(this.jwkPair.publicJwk, this.jwkPair.privateJwk); - } - async resolveCompleteness(verificationRequest) { - await this.initialized; - const { payload: vrPayload } = await jwsDecode(verificationRequest); - let porPayload; - try { - const decoded = await jwsDecode(vrPayload.por); - porPayload = decoded.payload; - } - catch (error) { - throw new NrError(error, ['invalid por']); - } - const verificationResolution = { - ...await this._resolution(vrPayload.dataExchangeId, porPayload.exchange[vrPayload.iss]), - resolution: 'not completed', - type: 'verification' - }; - try { - await checkCompleteness(verificationRequest, this.dltAgent); - verificationResolution.resolution = 'completed'; - } - catch (error) { - if (!(error instanceof NrError) || - error.nrErrors.includes('invalid verification request') || error.nrErrors.includes('unexpected error')) { - throw error; - } - } - const privateKey = await importJWK(this.jwkPair.privateJwk); - return await new SignJWT(verificationResolution) - .setProtectedHeader({ alg: this.jwkPair.privateJwk.alg }) - .setIssuedAt(verificationResolution.iat) - .sign(privateKey); - } - async resolveDispute(disputeRequest) { - await this.initialized; - const { payload: drPayload } = await jwsDecode(disputeRequest); - let porPayload; - try { - const decoded = await jwsDecode(drPayload.por); - porPayload = decoded.payload; - } - catch (error) { - throw new NrError(error, ['invalid por']); - } - const disputeResolution = { - ...await this._resolution(drPayload.dataExchangeId, porPayload.exchange[drPayload.iss]), - resolution: 'denied', - type: 'dispute' - }; - try { - await checkDecryption(disputeRequest, this.dltAgent); - } - catch (error) { - if (error instanceof NrError && error.nrErrors.includes('decryption failed')) { - disputeResolution.resolution = 'accepted'; - } - else { - throw new NrError(error, ['cannot verify']); - } - } - const privateKey = await importJWK(this.jwkPair.privateJwk); - return await new SignJWT(disputeResolution) - .setProtectedHeader({ alg: this.jwkPair.privateJwk.alg }) - .setIssuedAt(disputeResolution.iat) - .sign(privateKey); - } - async _resolution(dataExchangeId, sub) { - return { - proofType: 'resolution', - dataExchangeId, - iat: Math.floor(Date.now() / 1000), - iss: await parseJwk(this.jwkPair.publicJwk, true), - sub - }; - } -} - -async function generateVerificationRequest(iss, dataExchangeId, por, privateJwk) { - const payload = { - proofType: 'request', - iss, - dataExchangeId, - por, - type: 'verificationRequest', - iat: Math.floor(Date.now() / 1000) - }; - const privateKey = await importJWK(privateJwk); - return await new SignJWT(payload) - .setProtectedHeader({ alg: privateJwk.alg }) - .setIssuedAt(payload.iat) - .sign(privateKey); -} - -async function verifyResolution(resolution, pubJwk) { - return await jwsDecode(resolution, pubJwk ?? ((header, payload) => { - return JSON.parse(payload.iss); - })); -} - -var index$2 = /*#__PURE__*/Object.freeze({ - __proto__: null, - ConflictResolver: ConflictResolver, - checkCompleteness: checkCompleteness, - checkDecryption: checkDecryption, - generateVerificationRequest: generateVerificationRequest, - verifyPor: verifyPor, - verifyResolution: verifyResolution -}); - -var address="0x8d407A1722633bDD1dcf221474be7a44C05d7c2F";var 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"}];var transactionHash="0x6a3828f8fe232819dc40ca66f93930b3bd1619db31a67ec34b44446b3e7c8289";var 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:true};var args=[];var solcInputHash="c528a37588793ef74285d75e08d6b8eb";var 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}";var bytecode="0x608060405234801561001057600080fd5b506103a2806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c8063032439371461003b578063d05cb54514610057575b600080fd5b6100556004803603810190610050919061023a565b610088565b005b610071600480360381019061006c91906101fe565b6101a3565b60405161007f9291906102d9565b60405180910390f35b60008060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002060010154146100e757600080fd5b6040518060400160405280428152602001828152506000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002060008201518160000155602082015181600101559050507faa58599838af2e5e0f3251cfbb4eac5d5d447ded49f6b0ac28d6b44098224e63338342846040516101979493929190610294565b60405180910390a15050565b6000602052816000526040600020602052806000526040600020600091509150508060000154908060010154905082565b6000813590506101e38161033e565b92915050565b6000813590506101f881610355565b92915050565b6000806040838503121561021157600080fd5b600061021f858286016101d4565b9250506020610230858286016101e9565b9150509250929050565b6000806040838503121561024d57600080fd5b600061025b858286016101e9565b925050602061026c858286016101e9565b9150509250929050565b61027f81610302565b82525050565b61028e81610334565b82525050565b60006080820190506102a96000830187610276565b6102b66020830186610285565b6102c36040830185610285565b6102d06060830184610285565b95945050505050565b60006040820190506102ee6000830185610285565b6102fb6020830184610285565b9392505050565b600061030d82610314565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b61034781610302565b811461035257600080fd5b50565b61035e81610334565b811461036957600080fd5b5056fea26469706673582212204fd0fc653fb487221da9a14a4ca5d5499f9e9bc7b27ac8ab0f8d397fd6e3148564736f6c63430008040033";var deployedBytecode="0x608060405234801561001057600080fd5b50600436106100365760003560e01c8063032439371461003b578063d05cb54514610057575b600080fd5b6100556004803603810190610050919061023a565b610088565b005b610071600480360381019061006c91906101fe565b6101a3565b60405161007f9291906102d9565b60405180910390f35b60008060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002060010154146100e757600080fd5b6040518060400160405280428152602001828152506000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002060008201518160000155602082015181600101559050507faa58599838af2e5e0f3251cfbb4eac5d5d447ded49f6b0ac28d6b44098224e63338342846040516101979493929190610294565b60405180910390a15050565b6000602052816000526040600020602052806000526040600020600091509150508060000154908060010154905082565b6000813590506101e38161033e565b92915050565b6000813590506101f881610355565b92915050565b6000806040838503121561021157600080fd5b600061021f858286016101d4565b9250506020610230858286016101e9565b9150509250929050565b6000806040838503121561024d57600080fd5b600061025b858286016101e9565b925050602061026c858286016101e9565b9150509250929050565b61027f81610302565b82525050565b61028e81610334565b82525050565b60006080820190506102a96000830187610276565b6102b66020830186610285565b6102c36040830185610285565b6102d06060830184610285565b95945050505050565b60006040820190506102ee6000830185610285565b6102fb6020830184610285565b9392505050565b600061030d82610314565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b61034781610302565b811461035257600080fd5b50565b61035e81610334565b811461036957600080fd5b5056fea26469706673582212204fd0fc653fb487221da9a14a4ca5d5499f9e9bc7b27ac8ab0f8d397fd6e3148564736f6c63430008040033";var devdoc={kind:"dev",methods:{},version:1};var userdoc={kind:"user",methods:{},version:1};var 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"}}};var contractConfig = {address:address,abi:abi,transactionHash:transactionHash,receipt:receipt,args:args,solcInputHash:solcInputHash,metadata:metadata,bytecode:bytecode,deployedBytecode:deployedBytecode,devdoc:devdoc,userdoc:userdoc,storageLayout:storageLayout}; - -const defaultDltConfig = { - gasLimit: 12500000, - contract: contractConfig -}; - -async function getSecretFromLedger(contract, signerAddress, exchangeId, timeout, secretLength) { - let secretBn = ethers.BigNumber.from(0); - let timestampBn = ethers.BigNumber.from(0); - const exchangeIdHex = parseHex(bufToHex(b64.decode(exchangeId)), true); - let counter = 0; - do { - try { - ({ secret: secretBn, timestamp: timestampBn } = await contract.registry(parseHex(signerAddress, true), exchangeIdHex)); - } - catch (error) { - throw new NrError(error, ['cannot contact the ledger']); - } - if (secretBn.isZero()) { - counter++; - await new Promise(resolve => setTimeout(resolve, 1000)); - } - } while (secretBn.isZero() && counter < timeout); - if (secretBn.isZero()) { - throw new NrError(new Error(`timeout of ${timeout}s exceeded when querying the ledger and secret still not published`), ['secret not published']); - } - const hex = parseHex(secretBn.toHexString(), false, secretLength); - const iat = timestampBn.toNumber(); - return { hex, iat }; -} -async function secretUnisgnedTransaction(secretHex, exchangeId, agent) { - const secret = ethers.BigNumber.from(parseHex(secretHex, true)); - const exchangeIdHex = parseHex(bufToHex(b64.decode(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; - unsignedTx.gasPrice = (await agent.provider.getGasPrice())._hex; - unsignedTx.chainId = (await agent.provider.getNetwork()).chainId; - const address = await agent.getAddress(); - unsignedTx.from = parseHex(address, true); - return unsignedTx; -} - -class NrpDltAgent { -} - -class EthersIoAgent extends NrpDltAgent { - constructor(dltConfig) { - super(); - this.initialized = new Promise((resolve, reject) => { - if (dltConfig !== null && typeof dltConfig === 'object' && typeof dltConfig.then === 'function') { - dltConfig.then(dltConfig2 => { - this.dltConfig = { - ...defaultDltConfig, - ...dltConfig2 - }; - this.provider = new ethers.providers.JsonRpcProvider(this.dltConfig.rpcProviderUrl); - this.contract = new ethers.Contract(this.dltConfig.contract.address, this.dltConfig.contract.abi, this.provider); - resolve(true); - }).catch((reason) => reject(reason)); - } - else { - this.dltConfig = { - ...defaultDltConfig, - ...dltConfig - }; - this.provider = new ethers.providers.JsonRpcProvider(this.dltConfig.rpcProviderUrl); - this.contract = new ethers.Contract(this.dltConfig.contract.address, this.dltConfig.contract.abi, this.provider); - resolve(true); - } - }); - } - async getContractAddress() { - await this.initialized; - return this.contract.address; - } -} - -class EthersIoAgentDest extends EthersIoAgent { - async getSecretFromLedger(secretLength, signerAddress, exchangeId, timeout) { - await this.initialized; - return await getSecretFromLedger(this.contract, signerAddress, exchangeId, timeout, secretLength); - } -} - -class I3mWalletAgent extends EthersIoAgent { - constructor(wallet, did, dltConfig) { - const dltConfigPromise = new Promise((resolve, reject) => { - wallet.providerinfo.get().then((providerInfo) => { - const rpcProviderUrl = providerInfo.rpcUrl; - if (rpcProviderUrl === undefined) { - reject(new Error('wallet is not connected to RPC endpoint')); - } - else { - resolve({ - ...dltConfig, - rpcProviderUrl - }); - } - }).catch((reason) => { reject(reason); }); - }); - super(dltConfigPromise); - this.wallet = wallet; - this.did = did; - } -} - -class I3mWalletAgentDest extends I3mWalletAgent { - async getSecretFromLedger(secretLength, signerAddress, exchangeId, timeout) { - await this.initialized; - return await getSecretFromLedger(this.contract, signerAddress, exchangeId, timeout, secretLength); - } -} - -class I3mServerWalletAgent extends EthersIoAgent { - constructor(serverWallet, did, dltConfig) { - const dltConfigPromise = new Promise((resolve, reject) => { - serverWallet.providerinfoGet().then((providerInfo) => { - const rpcProviderUrl = providerInfo.rpcUrl; - if (rpcProviderUrl === undefined) { - reject(new Error('wallet is not connected to RPC endpoint')); - } - else { - resolve({ - ...dltConfig, - rpcProviderUrl - }); - } - }).catch((reason) => { reject(reason); }); - }); - super(dltConfigPromise); - this.wallet = serverWallet; - this.did = did; - } -} - -class I3mServerWalletAgentDest extends I3mServerWalletAgent { - async getSecretFromLedger(secretLength, signerAddress, exchangeId, timeout) { - await this.initialized; - return await getSecretFromLedger(this.contract, signerAddress, exchangeId, timeout, secretLength); - } -} - -class EthersIoAgentOrig extends EthersIoAgent { - constructor(dltConfig, privateKey) { - super(dltConfig); - this.count = -1; - let privKey; - if (privateKey === undefined) { - privKey = randBytesSync(32); - } - else { - privKey = (typeof privateKey === 'string') ? new Uint8Array(hexToBuf(privateKey)) : privateKey; - } - const signingKey = new SigningKey(privKey); - this.signer = new Wallet(signingKey, this.provider); - } - async deploySecret(secretHex, exchangeId) { - await this.initialized; - const unsignedTx = await secretUnisgnedTransaction(secretHex, exchangeId, this); - const signedTx = await this.signer.signTransaction(unsignedTx); - const setRegistryTx = await this.signer.provider.sendTransaction(signedTx); - this.count = this.count + 1; - return setRegistryTx.hash; - } - async getAddress() { - await this.initialized; - return this.signer.address; - } - async nextNonce() { - await this.initialized; - const publishedCount = await this.provider.getTransactionCount(await this.getAddress(), 'pending'); - if (publishedCount > this.count) { - this.count = publishedCount; - } - return this.count; - } -} - -class I3mWalletAgentOrig extends I3mWalletAgent { - constructor() { - super(...arguments); - this.count = -1; - } - async deploySecret(secretHex, exchangeId) { - await this.initialized; - const unsignedTx = await secretUnisgnedTransaction(secretHex, exchangeId, this); - const response = await this.wallet.identities.sign({ did: this.did }, { - type: 'Transaction', - data: unsignedTx - }); - const signedTx = response.signature; - const setRegistryTx = await this.provider.sendTransaction(signedTx); - this.count = this.count + 1; - return setRegistryTx.hash; - } - async getAddress() { - await this.initialized; - const json = await this.wallet.identities.info({ did: this.did }); - if (json.addresses === undefined) { - throw new NrError(new Error('no addresses for did ' + this.did), ['unexpected error']); - } - return json.addresses[0]; - } - async nextNonce() { - await this.initialized; - const publishedCount = await this.provider.getTransactionCount(await this.getAddress(), 'pending'); - if (publishedCount > this.count) { - this.count = publishedCount; - } - return this.count; - } -} - -class I3mServerWalletAgentOrig extends I3mServerWalletAgent { - constructor() { - super(...arguments); - this.count = -1; - } - async deploySecret(secretHex, exchangeId) { - await this.initialized; - const unsignedTx = await secretUnisgnedTransaction(secretHex, exchangeId, this); - const signedTx = (await this.wallet.identitySign({ did: this.did }, { type: 'Transaction', data: unsignedTx })).signature; - const setRegistryTx = await this.provider.sendTransaction(signedTx); - this.count = this.count + 1; - return setRegistryTx.hash; - } - async getAddress() { - await this.initialized; - const json = await this.wallet.identityInfo({ did: this.did }); - if (json.addresses === undefined) { - throw new NrError(`Can't get address for did: ${this.did}`, ['unexpected error']); - } - return json.addresses[0]; - } - async nextNonce() { - await this.initialized; - const publishedCount = await this.provider.getTransactionCount(await this.getAddress(), 'pending'); - if (publishedCount > this.count) { - this.count = publishedCount; - } - return this.count; - } -} - -var index$1 = /*#__PURE__*/Object.freeze({ - __proto__: null, - EthersIoAgentDest: EthersIoAgentDest, - EthersIoAgentOrig: EthersIoAgentOrig, - I3mServerWalletAgentDest: I3mServerWalletAgentDest, - I3mServerWalletAgentOrig: I3mServerWalletAgentOrig, - I3mWalletAgentDest: I3mWalletAgentDest, - I3mWalletAgentOrig: I3mWalletAgentOrig -}); - -var openapi="3.0.3";var info={version:"v2",title:"i3M-Wallet Developers API",description:"i3M-Wallet Developers API that can be used to interact with the i3M-Wallet. In production it is encapsulated inside a secure connection. Please use the @i3m/wallet-protocol-api to interact with the wallet.",license:{name:"EUPL-1.2",url:"https://joinup.ec.europa.eu/sites/default/files/custom-page/attachment/2020-03/EUPL-1.2%20EN.txt"},contact:{name:"Juan Hernández Serrano",email:"j.hernandez@upc.edu",url:"https://github.com/juanelas"}};var tags=[{name:"identities",description:"Endpoints to manage identities (DIDs).\n"},{name:"resources",description:"Besides identities, the wallet MAY securely store arbitrary resources in a secure vault, which may be selectively disclosed upon request. Currently storing verifiable credentials\n"},{name:"selectiveDisclosure",description:"Ednpoints for the selective disclosure process (used to present verifiable credentials)\n"},{name:"transaction",description:"Endpoints for deploying signed transactions to the DLT the wallet is connected to.\n"},{name:"utils",description:"Additional helpler functions\n"}];var paths={"/identities":{get:{summary:"List all DIDs",operationId:"identityList","x-eov-operation-handler":"identities",tags:["identities"],parameters:[{"in":"query",name:"alias",schema:{type:"string",description:"An alias for the identity"}}],responses:{"200":{description:"An array of identities",content:{"application/json":{schema:{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"]}}}}},"default":{description:"unexpected error",content:{"application/json":{schema:{type:"object",title:"Error",required:["code","message"],properties:{code:{type:"integer",format:"int32"},message:{type:"string"}}}}}}}},post:{summary:"Create an account",operationId:"identityCreate","x-eov-operation-handler":"identities",tags:["identities"],requestBody:{description:"Create a DID.",required:false,content:{"application/json":{schema:{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:true}}}},responses:{"201":{description:"the ID and type of the created account",content:{"application/json":{schema:{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:true,required:["did"]}}}},"default":{description:"unexpected error",content:{"application/json":{schema:{type:"object",title:"Error",required:["code","message"],properties:{code:{type:"integer",format:"int32"},message:{type:"string"}}}}}}}}},"/identities/select":{get:{summary:"Gets an identity selected by the user.",operationId:"identitySelect","x-eov-operation-handler":"identities",tags:["identities"],parameters:[{"in":"query",name:"reason",schema:{type:"string",description:"Message to show to the user with the reason to pick an identity"}}],responses:{"200":{description:"Selected identity",content:{"application/json":{schema:{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"]}}}},"default":{description:"unexpected error",content:{"application/json":{schema:{type:"object",title:"Error",required:["code","message"],properties:{code:{type:"integer",format:"int32"},message:{type:"string"}}}}}}}}},"/identities/{did}/sign":{post:{summary:"Signs a message",operationId:"identitySign","x-eov-operation-handler":"identities",tags:["identities"],parameters:[{"in":"path",name:"did",schema:{description:"a DID using the 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:true}],requestBody:{description:"Data to sign.",required:true,content:{"application/json":{schema:{title:"SignInput",oneOf:[{title:"SignTransaction",type:"object",properties:{type:{"enum":["Transaction"]},data:{title:"Transaction",type:"object",additionalProperties:true,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:true},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:true}},required:["payload"]}},required:["type","data"]}]}}}},responses:{"200":{description:"Signed data",content:{"application/json":{schema:{title:"SignOutput",type:"object",properties:{signature:{type:"string"}},required:["signature"]}}}},"default":{description:"unexpected error",content:{"application/json":{schema:{type:"object",title:"Error",required:["code","message"],properties:{code:{type:"integer",format:"int32"},message:{type:"string"}}}}}}}}},"/identities/{did}/info":{get:{summary:"Gets extra information of an identity.",operationId:"identityInfo","x-eov-operation-handler":"identities",tags:["identities"],parameters:[{"in":"path",name:"did",schema:{description:"a DID using the 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:true}],responses:{"200":{description:"Identity data",content:{"application/json":{schema:{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"]}}}},"default":{description:"unexpected error",content:{"application/json":{schema:{type:"object",title:"Error",required:["code","message"],properties:{code:{type:"integer",format:"int32"},message:{type:"string"}}}}}}}}},"/identities/{did}/deploy-tx":{post:{summary:"Signs and deploys a transaction",operationId:"identityDeployTransaction","x-eov-operation-handler":"identities",tags:["identities"],parameters:[{"in":"path",name:"did",schema:{description:"a DID using the 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:true}],requestBody:{description:"Transaction to sign and deploy",required:true,content:{"application/json":{schema:{title:"Transaction",type:"object",additionalProperties:true,properties:{from:{type:"string"},to:{type:"string"},nonce:{type:"number"}}}}}},responses:{"200":{description:"Selected identity",content:{"application/json":{schema:{title:"Receipt",type:"object",properties:{receipt:{type:"string"}},required:["receipt"]}}}},"default":{description:"unexpected error",content:{"application/json":{schema:{type:"object",title:"Error",required:["code","message"],properties:{code:{type:"integer",format:"int32"},message:{type:"string"}}}}}}}}},"/resources":{get:{summary:"Lists the resources that match the filter specified in the query parameters.",operationId:"resourceList","x-eov-operation-handler":"resources",tags:["resources"],parameters:[{"in":"query",name:"type",example:"Contract",required:false,schema:{type:"string","enum":["VerifiableCredential","Object","KeyPair","Contract","DataExchange","NonRepudiationProof"]},description:"Filter the resources by resource type."},{"in":"query",name:"identity",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863",allowEmptyValue:true,required:false,schema:{description:"a DID using the ethr resolver",type:"string",pattern:"^did:ethr:(\\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$",example:"did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863"},description:"Filter the resource associated to an identity DID. Send empty value to get all the resources that are not associated to any identity."},{"in":"query",name:"parentResource",required:false,schema:{type:"string"},description:"Get only resources with the given parent resource id."}],responses:{"200":{description:"A paged array of resources. Only the props requested will be returned. Security policies may prevent some props from being returned.",content:{"application/json":{schema:{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:true,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:true},proof:{type:"object",properties:{type:{type:"string","enum":["JwtProof2020"]}},required:["type"],additionalProperties:true}},additionalProperties:true,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:true}},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:10000},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:20000},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:180000},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:10000},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:20000},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:180000},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"]}]}}}}},"default":{description:"unexpected error",content:{"application/json":{schema:{type:"object",title:"Error",required:["code","message"],properties:{code:{type:"integer",format:"int32"},message:{type:"string"}}}}}}}},post:{summary:"Create a resource",operationId:"resourceCreate","x-eov-operation-handler":"resources",tags:["resources"],requestBody:{description:"Create a resource. Nowadays it only supports storage of verifiable credentials.",content:{"application/json":{schema:{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:true,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:true},proof:{type:"object",properties:{type:{type:"string","enum":["JwtProof2020"]}},required:["type"],additionalProperties:true}},additionalProperties:true,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:true}},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:10000},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:20000},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:180000},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:10000},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:20000},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:180000},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"]}]}}}},responses:{"201":{description:"the ID and type of the created resource",content:{"application/json":{schema:{type:"object",properties:{id:{type:"string"}},required:["id"]}}}},"default":{description:"unexpected error",content:{"application/json":{schema:{type:"object",title:"Error",required:["code","message"],properties:{code:{type:"integer",format:"int32"},message:{type:"string"}}}}}}}}},"/disclosure/{jwt}":{get:{summary:"Request selective disclosure of resources",operationId:"selectiveDisclosure","x-eov-operation-handler":"disclosure",tags:["selectiveDisclosure"],parameters:[{"in":"path",name:"jwt",schema:{type:"string",pattern:"^[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+$"},required:true,description:"A JWT containing a selective disclosure object. The payload MUST contain:\n\n```json\n{\n \"type\": \"selectiveDisclosureReq\", // MUST be selectiveDisclosureReq\n \"iss\": \"did:\", // the DID of the OIDC Provider\n \"aud\": \"\", // DID of the OIDC RP\n \"iat\": 4354535,\t// The time of issuance\n \"exp\": 3452345, // [OPTIONAL] Expiration time of JWT\n callback: \"https://...\", // Callback URL for returning the response to a request\n resources: [\n { \"id\": \"id\", \"mandatory\": true, \"iss\": [ { did: or url:} ], \"reason\": \"\" }\n ]\n}\n```\n"}],responses:{"200":{description:"Disclosure ok (mandatory claims provided)",content:{"application/json":{schema:{type:"object",properties:{jwt:{type:"string"}}}}}},"default":{description:"unexpected error",content:{"application/json":{schema:{type:"object",title:"Error",required:["code","message"],properties:{code:{type:"integer",format:"int32"},message:{type:"string"}}}}}}}}},"/transaction/deploy":{post:{summary:"Deploy a signed transaction",operationId:"transactionDeploy","x-eov-operation-handler":"transaction",tags:["transaction"],requestBody:{description:"Create a resource.",content:{"application/json":{schema:{title:"SignedTransaction",description:"A list of resources",type:"object",properties:{transaction:{type:"string",pattern:"^0x(?:[A-Fa-f0-9])+$"}}}}}},responses:{"200":{description:"Deployment OK"},"default":{description:"unexpected error",content:{"application/json":{schema:{type:"object",title:"Error",required:["code","message"],properties:{code:{type:"integer",format:"int32"},message:{type:"string"}}}}}}}}},"/did-jwt/verify":{post:{summary:"Use the wallet to verify a JWT. The Wallet only supports DID issuers and the 'ES256K1' algorithm. Useful to verify JWT created by another wallet instance.\n",operationId:"didJwtVerify","x-eov-operation-handler":"did-jwt",tags:["utils"],requestBody:{description:"Verify a JWT resolving the public key from the signer DID and optionally check values for expected payload claims",required:true,content:{"application/json":{schema:{type:"object",properties:{jwt:{type:"string",pattern:"^[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+\\.[A-Za-z0-9_-]+$",example:"eyJhbGciOiJFUzI1NksiLCJ0eXAiOiJKV1QifQ.eyJmaWVsZDEiOiJzYWRzYWQ3NSIsImZpZWxkMiI6ImFmZnNhczlmODdzIiwiaXNzIjoiZGlkOmV0aHI6aTNtOjB4MDNmOTcwNjRhMzUzZmFmNWRkNTQwYWE2N2I2OTE2YmY1NmMwOWM1MGNjODAzN2E0NTNlNzg1ODdmMjdmYjg4ZTk0IiwiaWF0IjoxNjY1NDAwMzYzfQ.IpQ7WprvDMk6QWcJXuPBazat-2657dWIK-iGvOOB5oAhAmMqDBm8OEtKordqeqcEWwhWw_C7_ziMMZkPz1JIkw"},expectedPayloadClaims:{type:"object",additionalProperties:true,description:"The expected values of the proof's payload claims. An expected value of '' can be used to just check that the claim is in the payload. An example could be:\n\n```json\n{\n iss: 'orig',\n exchange: {\n id: '9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d',\n orig: '{\"kty\":\"EC\",\"x\":\"rPMP39e-o8cU6m4WL8_qd2wxo-nBTjWXZtPGBiiGCTY\",\"y\":\"0uvxGEebFDxKOHYUlHREzq4mRULuZvQ6LB2I11yE1E0\",\"crv\":\"P-256\"}', // Public key in JSON.stringify(JWK) of the block origin (sender)\n dest: '{\"kty\":\"EC\",\"x\":\"qf_mNdy57ia1vAq5QLpTPxJUCRhS2003-gL0nLcbXoA\",\"y\":\"H_8YwSCKJhDbZv17YEgDfAiKTaQ8x0jpLYCC2myxAeY\",\"crv\":\"P-256\"}', // Public key in JSON.stringify(JWK) of the block destination (receiver)\n hash_alg: 'SHA-256',\n cipherblock_dgst: 'IBUIstf98_afbiuh7UaifkasytNih7as-Jah61ls9UI', // hash of the cipherblock in base64url with no padding\n block_commitment: '', // hash of the plaintext block in base64url with no padding\n secret_commitment: '' // hash of the secret that can be used to decrypt the block in base64url with no padding\n }\n}\n```\n"}},required:["jwt"]}}}},responses:{"200":{description:"A verification object. If `verification` equals `success` all checkings have passed; if it is `failed`, you can access the error message in `error`. Unless the JWT decoding fails (invalid format), the decoded JWT payload can be accessed in `payload`.\n\nExample of success:\n\n```json\n{\n \"verification\": \"success\",\n \"payload\": {\n \"iss\": \"did:ethr:i3m:0x02d846307c9fd53106eb20db5a774c4b71f25c59c7bc423990f942e3fdb02c5898\",\n \"iat\": 1665138018,\n \"action\": \"buy 1457adf6\"\n }\n}\n```\n\nExample of failure:\n\n```json\n{\n \"verification\": \"failed\",\n \"error\": \"invalid_jwt: JWT iss is required\"\n \"payload\": {\n \"iat\": 1665138018,\n \"action\": \"buy 1457adf6\"\n }\n}\n```\n",content:{"application/json":{schema:{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"]}}}},"default":{description:"unexpected error",content:{"application/json":{schema:{type:"object",title:"Error",required:["code","message"],properties:{code:{type:"integer",format:"int32"},message:{type:"string"}}}}}}}}},"/providerinfo":{get:{summary:"Gets info of the DLT provider the wallet is using",operationId:"providerinfoGet","x-eov-operation-handler":"providerinfo",tags:["utils"],responses:{"200":{description:"A JSON object with information of the DLT provider currently in use.",content:{"application/json":{schema:{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:true}}}},"default":{description:"unexpected error",content:{"application/json":{schema:{type:"object",title:"Error",required:["code","message"],properties:{code:{type:"integer",format:"int32"},message:{type:"string"}}}}}}}}}};var components={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:true,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:true},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:true}},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:true,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:true},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:true}},required:["payload"]}},required:["type","data"]},Transaction:{title:"Transaction",type:"object",additionalProperties:true,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:true},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:true,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:true,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:true},proof:{type:"object",properties:{type:{type:"string","enum":["JwtProof2020"]}},required:["type"],additionalProperties:true}},additionalProperties:true,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:true}},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:10000},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:20000},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:180000},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:10000},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:20000},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:180000},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:true,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:true},proof:{type:"object",properties:{type:{type:"string","enum":["JwtProof2020"]}},required:["type"],additionalProperties:true}},additionalProperties:true,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:true}},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:10000},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:20000},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:180000},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:10000},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:20000},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:180000},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:true,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:true},proof:{type:"object",properties:{type:{type:"string","enum":["JwtProof2020"]}},required:["type"],additionalProperties:true}},additionalProperties:true,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:true}},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:10000},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:20000},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:180000},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:10000},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:20000},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:180000},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:true},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:true},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:true},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:10000},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:20000},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:180000},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:10000},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:20000},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:180000},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:10000},pooToPopDelay:{description:"Maximum acceptable time in milliseconds between issued PoO and issued PoP",type:"integer",minimum:1,example:20000},pooToSecretDelay:{description:"Maximum acceptable time between issued PoO and secret published on the ledger",type:"integer",minimum:1,example:180000},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"]}]}}};var spec = {openapi:openapi,info:info,tags:tags,paths:paths,components:components}; - -var id="https://spec.openapis.org/oas/3.0/schema/2021-09-28";var $schema="http://json-schema.org/draft-04/schema#";var description="The description of OpenAPI v3.0.x documents, as defined by https://spec.openapis.org/oas/v3.0.3";var type="object";var required=["openapi","info","paths"];var 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:true},paths:{$ref:"#/definitions/Paths"},components:{$ref:"#/definitions/Components"}};var patternProperties={"^x-":{}};var additionalProperties=false;var 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:false},Contact:{type:"object",properties:{name:{type:"string"},url:{type:"string",format:"uri-reference"},email:{type:"string",format:"email"}},patternProperties:{"^x-":{}},additionalProperties:false},License:{type:"object",required:["name"],properties:{name:{type:"string"},url:{type:"string",format:"uri-reference"}},patternProperties:{"^x-":{}},additionalProperties:false},Server:{type:"object",required:["url"],properties:{url:{type:"string"},description:{type:"string"},variables:{type:"object",additionalProperties:{$ref:"#/definitions/ServerVariable"}}},patternProperties:{"^x-":{}},additionalProperties:false},ServerVariable:{type:"object",required:["default"],properties:{"enum":{type:"array",items:{type:"string"}},"default":{type:"string"},description:{type:"string"}},patternProperties:{"^x-":{}},additionalProperties:false},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:false},Schema:{type:"object",properties:{title:{type:"string"},multipleOf:{type:"number",minimum:0,exclusiveMinimum:true},maximum:{type:"number"},exclusiveMaximum:{type:"boolean","default":false},minimum:{type:"number"},exclusiveMinimum:{type:"boolean","default":false},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":false},maxProperties:{type:"integer",minimum:0},minProperties:{type:"integer",minimum:0,"default":0},required:{type:"array",items:{type:"string"},minItems:1,uniqueItems:true},"enum":{type:"array",items:{},minItems:1,uniqueItems:false},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":true},description:{type:"string"},format:{type:"string"},"default":{},nullable:{type:"boolean","default":false},discriminator:{$ref:"#/definitions/Discriminator"},readOnly:{type:"boolean","default":false},writeOnly:{type:"boolean","default":false},example:{},externalDocs:{$ref:"#/definitions/ExternalDocumentation"},deprecated:{type:"boolean","default":false},xml:{$ref:"#/definitions/XML"}},patternProperties:{"^x-":{}},additionalProperties:false},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":false},wrapped:{type:"boolean","default":false}},patternProperties:{"^x-":{}},additionalProperties:false},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:false},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:false,allOf:[{$ref:"#/definitions/ExampleXORExamples"}]},Example:{type:"object",properties:{summary:{type:"string"},description:{type:"string"},value:{},externalValue:{type:"string",format:"uri-reference"}},patternProperties:{"^x-":{}},additionalProperties:false},Header:{type:"object",properties:{description:{type:"string"},required:{type:"boolean","default":false},deprecated:{type:"boolean","default":false},allowEmptyValue:{type:"boolean","default":false},style:{type:"string","enum":["simple"],"default":"simple"},explode:{type:"boolean"},allowReserved:{type:"boolean","default":false},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:false,allOf:[{$ref:"#/definitions/ExampleXORExamples"},{$ref:"#/definitions/SchemaXORContent"}]},Paths:{type:"object",patternProperties:{"^\\/":{$ref:"#/definitions/PathItem"},"^x-":{}},additionalProperties:false},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:true}},patternProperties:{"^(get|put|post|delete|options|head|patch|trace)$":{$ref:"#/definitions/Operation"},"^x-":{}},additionalProperties:false},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:true},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":false},security:{type:"array",items:{$ref:"#/definitions/SecurityRequirement"}},servers:{type:"array",items:{$ref:"#/definitions/Server"}}},patternProperties:{"^x-":{}},additionalProperties:false},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:false},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:false},ExternalDocumentation:{type:"object",required:["url"],properties:{description:{type:"string"},url:{type:"string",format:"uri-reference"}},patternProperties:{"^x-":{}},additionalProperties:false},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":false},deprecated:{type:"boolean","default":false},allowEmptyValue:{type:"boolean","default":false},style:{type:"string"},explode:{type:"boolean"},allowReserved:{type:"boolean","default":false},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:false,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":[true]}}},{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":false}},patternProperties:{"^x-":{}},additionalProperties:false},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:false},HTTPSecurityScheme:{type:"object",required:["scheme","type"],properties:{scheme:{type:"string"},bearerFormat:{type:"string"},description:{type:"string"},type:{type:"string","enum":["http"]}},patternProperties:{"^x-":{}},additionalProperties:false,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:false},OpenIdConnectSecurityScheme:{type:"object",required:["type","openIdConnectUrl"],properties:{type:{type:"string","enum":["openIdConnect"]},openIdConnectUrl:{type:"string",format:"uri-reference"},description:{type:"string"}},patternProperties:{"^x-":{}},additionalProperties:false},OAuthFlows:{type:"object",properties:{implicit:{$ref:"#/definitions/ImplicitOAuthFlow"},password:{$ref:"#/definitions/PasswordOAuthFlow"},clientCredentials:{$ref:"#/definitions/ClientCredentialsFlow"},authorizationCode:{$ref:"#/definitions/AuthorizationCodeOAuthFlow"}},patternProperties:{"^x-":{}},additionalProperties:false},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:false},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:false},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:false},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:false},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:false,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":false}},additionalProperties:false}};var jsonSchema = {id:id,$schema:$schema,description:description,type:type,required:required,properties:properties,patternProperties:patternProperties,additionalProperties:additionalProperties,definitions:definitions}; - -function parseTimestamp(timestamp) { - if ((new Date(timestamp)).getTime() > 0) { - return Number(timestamp); - } - else { - throw new NrError(new Error('invalid timestamp'), ['invalid timestamp']); - } -} -async function validateDataSharingAgreementSchema(agreement) { - const errors = []; - const ajv = new Ajv({ strictSchema: false, removeAdditional: 'all' }); - ajv.addMetaSchema(jsonSchema); - addFormats(ajv); - const schema = spec.components.schemas.DataSharingAgreement; - try { - const validate = ajv.compile(schema); - const clonedAgreement = _.cloneDeep(agreement); - const valid = validate(agreement); - if (!valid) { - if (validate.errors !== null && validate.errors !== undefined && validate.errors.length > 0) { - validate.errors.forEach(error => { - errors.push(new NrError(`[${error.instancePath}] ${error.message ?? 'unknown'}`, ['invalid format'])); - }); - } - } - if (hashable(clonedAgreement) !== hashable(agreement)) { - errors.push(new NrError('Additional claims beyond the schema are not supported', ['invalid format'])); - } - } - catch (error) { - errors.push(new NrError(error, ['invalid format'])); - } - return errors; -} -async function validateDataExchange(dataExchange) { - const errors = []; - try { - const { id, ...dataExchangeButId } = dataExchange; - if (id !== await exchangeId(dataExchangeButId)) { - errors.push(new NrError('Invalid dataExchange id', ['cannot verify', 'invalid format'])); - } - const { blockCommitment, secretCommitment, cipherblockDgst, ...dataExchangeAgreement } = dataExchangeButId; - const deaErrors = await validateDataExchangeAgreement(dataExchangeAgreement); - if (deaErrors.length > 0) { - deaErrors.forEach((error) => { - errors.push(error); - }); - } - } - catch (error) { - errors.push(new NrError('Invalid dataExchange', ['cannot verify', 'invalid format'])); - } - return errors; -} -async function validateDataExchangeAgreement(agreement) { - const errors = []; - const agreementClaims = Object.keys(agreement); - if (agreementClaims.length < 10 || agreementClaims.length > 11) { - errors.push(new NrError(new Error('Invalid agreeemt: ' + JSON.stringify(agreement, undefined, 2)), ['invalid format'])); - } - for (const key of agreementClaims) { - let parsedAddress; - switch (key) { - case 'orig': - case 'dest': - try { - if (agreement[key] !== await parseJwk(JSON.parse(agreement[key]), true)) { - errors.push(new NrError(`[dataExchangeAgreeement.${key}] 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${agreement[key]}`, ['invalid key', 'invalid format'])); - } - } - catch (error) { - errors.push(new NrError(`[dataExchangeAgreeement.${key}] 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 { - parsedAddress = parseAddress(agreement[key]); - if (agreement[key] !== parsedAddress) { - errors.push(new NrError(`[dataExchangeAgreeement.${key}] Invalid EIP-55 address ${agreement[key]}. Did you mean ${parsedAddress} instead?`, ['invalid EIP-55 address', 'invalid format'])); - } - } - catch (error) { - errors.push(new NrError(`[dataExchangeAgreeement.${key}] Invalid EIP-55 address ${agreement[key]}.`, ['invalid EIP-55 address', 'invalid format'])); - } - break; - case 'pooToPorDelay': - case 'pooToPopDelay': - case 'pooToSecretDelay': - try { - if (agreement[key] !== parseTimestamp(agreement[key])) { - errors.push(new NrError(`[dataExchangeAgreeement.${key}] < 0 or not a number`, ['invalid timestamp', 'invalid format'])); - } - } - catch (error) { - errors.push(new NrError(`[dataExchangeAgreeement.${key}] < 0 or not a number`, ['invalid timestamp', 'invalid format'])); - } - break; - case 'hashAlg': - if (!HASH_ALGS.includes(agreement[key])) { - errors.push(new NrError(`[dataExchangeAgreeement.${key}Invalid hash algorithm '${agreement[key]}'. It must be one of: ${HASH_ALGS.join(', ')}`, ['invalid algorithm'])); - } - break; - case 'encAlg': - if (!ENC_ALGS.includes(agreement[key])) { - errors.push(new NrError(`[dataExchangeAgreeement.${key}Invalid encryption algorithm '${agreement[key]}'. It must be one of: ${ENC_ALGS.join(', ')}`, ['invalid algorithm'])); - } - break; - case 'signingAlg': - if (!SIGNING_ALGS.includes(agreement[key])) { - errors.push(new NrError(`[dataExchangeAgreeement.${key}Invalid signing algorithm '${agreement[key]}'. It must be one of: ${SIGNING_ALGS.join(', ')}`, ['invalid algorithm'])); - } - break; - case 'schema': - break; - default: - errors.push(new NrError(new Error(`Property ${key} not allowed in dataAgreement`), ['invalid format'])); - } - } - return errors; -} - -class NonRepudiationDest { - constructor(agreement, privateJwk, dltAgent) { - this.initialized = new Promise((resolve, reject) => { - this.asyncConstructor(agreement, privateJwk, dltAgent).then(() => { - resolve(true); - }).catch((error) => { - reject(error); - }); - }); - } - async asyncConstructor(agreement, privateJwk, dltAgent) { - const errors = await validateDataExchangeAgreement(agreement); - if (errors.length > 0) { - const errorMsg = []; - let nrErrors = []; - errors.forEach((error) => { - errorMsg.push(error.message); - nrErrors = nrErrors.concat(error.nrErrors); - }); - nrErrors = [...(new Set(nrErrors))]; - throw new NrError('Resource has not been validated:\n' + errorMsg.join('\n'), nrErrors); - } - this.agreement = agreement; - this.jwkPairDest = { - privateJwk, - publicJwk: JSON.parse(agreement.dest) - }; - this.publicJwkOrig = JSON.parse(agreement.orig); - await verifyKeyPair(this.jwkPairDest.publicJwk, this.jwkPairDest.privateJwk); - this.dltAgent = dltAgent; - const contractAddress = await this.dltAgent.getContractAddress(); - if (this.agreement.ledgerContractAddress !== contractAddress) { - throw new Error(`Contract address ${contractAddress} does not meet agreed one ${this.agreement.ledgerContractAddress}`); - } - this.block = {}; - } - async verifyPoO(poo, cipherblock, options) { - await this.initialized; - const cipherblockDgst = b64.encode(await sha(cipherblock, this.agreement.hashAlg), true, false); - const { payload } = await jwsDecode(poo); - const dataExchangePreview = { - ...this.agreement, - cipherblockDgst, - blockCommitment: payload.exchange.blockCommitment, - secretCommitment: payload.exchange.secretCommitment - }; - const dataExchange = { - ...dataExchangePreview, - id: await exchangeId(dataExchangePreview) - }; - const expectedPayloadClaims = { - proofType: 'PoO', - iss: 'orig', - exchange: dataExchange - }; - const currentTimestamp = Date.now(); - const opts = { - timestamp: currentTimestamp, - notBefore: 'iat', - notAfter: 'iat', - ...options - }; - const verified = await verifyProof(poo, expectedPayloadClaims, opts); - this.block = { - jwe: cipherblock, - poo: { - jws: poo, - payload: verified.payload - } - }; - this.exchange = verified.payload.exchange; - return verified; - } - async generatePoR() { - await this.initialized; - if (this.exchange === undefined || this.block.poo === undefined) { - throw new Error('Before computing a PoR, you have first to receive a valid cipherblock with a PoO and validate the PoO'); - } - const payload = { - proofType: 'PoR', - iss: 'dest', - exchange: this.exchange, - poo: this.block.poo.jws - }; - this.block.por = await createProof(payload, this.jwkPairDest.privateJwk); - return this.block.por; - } - async verifyPoP(pop, options) { - await this.initialized; - if (this.exchange === undefined || this.block.por === undefined || this.block.poo === undefined) { - throw new Error('Cannot verify a PoP if not even a PoR have been created'); - } - const expectedPayloadClaims = { - proofType: 'PoP', - iss: 'orig', - exchange: this.exchange, - por: this.block.por.jws, - secret: '', - verificationCode: '' - }; - const opts = { - timestamp: Date.now(), - notBefore: 'iat', - notAfter: this.block.poo.payload.iat * 1000 + this.exchange.pooToPopDelay, - ...options - }; - const verified = await verifyProof(pop, expectedPayloadClaims, opts); - const secret = JSON.parse(verified.payload.secret); - this.block.secret = { - hex: bufToHex(b64.decode(secret.k)), - jwk: secret - }; - this.block.pop = { - jws: pop, - payload: verified.payload - }; - return verified; - } - async getSecretFromLedger() { - await this.initialized; - if (this.exchange === undefined || this.block.poo === undefined || this.block.por === undefined) { - throw new Error('Cannot get secret if a PoR has not been sent before'); - } - const currentTimestamp = Date.now(); - const maxTimeForSecret = this.block.poo.payload.iat * 1000 + this.agreement.pooToSecretDelay; - const timeout = Math.round((maxTimeForSecret - currentTimestamp) / 1000); - const { hex: secretHex, iat } = await this.dltAgent.getSecretFromLedger(algByteLength(this.agreement.encAlg), this.agreement.ledgerSignerAddress, this.exchange.id, timeout); - this.block.secret = await oneTimeSecret(this.exchange.encAlg, secretHex); - try { - checkTimestamp(iat * 1000, this.block.por.payload.iat * 1000, this.block.poo.payload.iat * 1000 + this.exchange.pooToSecretDelay); - } - catch (error) { - throw new NrError(`Although the secret has been obtained (and you could try to decrypt the cipherblock), it's been published later than agreed: ${(new Date(iat * 1000)).toUTCString()} > ${(new Date(this.block.poo.payload.iat * 1000 + this.agreement.pooToSecretDelay)).toUTCString()}`, ['secret not published in time']); - } - return this.block.secret; - } - async decrypt() { - await this.initialized; - if (this.exchange === undefined) { - throw new Error('No agreed exchange'); - } - if (this.block.secret?.jwk === undefined) { - throw new Error('Cannot decrypt without the secret'); - } - if (this.block.jwe === undefined) { - throw new Error('No cipherblock to decrypt'); - } - const decryptedBlock = (await jweDecrypt(this.block.jwe, this.block.secret.jwk)).plaintext; - const decryptedDgst = b64.encode(await sha(decryptedBlock, this.agreement.hashAlg), true, false); - if (decryptedDgst !== this.exchange.blockCommitment) { - throw new Error('Decrypted block does not meet the committed one'); - } - this.block.raw = decryptedBlock; - return decryptedBlock; - } - async generateVerificationRequest() { - await this.initialized; - if (this.block.por === undefined || this.exchange === undefined) { - throw new Error('Before generating a VerificationRequest, you have first to hold a valid PoR for the exchange'); - } - return await generateVerificationRequest('dest', this.exchange.id, this.block.por.jws, this.jwkPairDest.privateJwk); - } - async generateDisputeRequest() { - await this.initialized; - if (this.block.por === undefined || this.block.jwe === undefined || this.exchange === undefined) { - throw new Error('Before generating a VerificationRequest, you have first to hold a valid PoR for the exchange and have received the cipherblock'); - } - const payload = { - proofType: 'request', - iss: 'dest', - por: this.block.por.jws, - type: 'disputeRequest', - cipherblock: this.block.jwe, - iat: Math.floor(Date.now() / 1000), - dataExchangeId: this.exchange.id - }; - const privateKey = await importJwk(this.jwkPairDest.privateJwk); - try { - const jws = await new SignJWT(payload) - .setProtectedHeader({ alg: this.jwkPairDest.privateJwk.alg }) - .setIssuedAt(payload.iat) - .sign(privateKey); - return jws; - } - catch (error) { - throw new NrError(error, ['unexpected error']); - } - } -} - -class NonRepudiationOrig { - constructor(agreement, privateJwk, block, dltAgent) { - this.jwkPairOrig = { - privateJwk, - publicJwk: JSON.parse(agreement.orig) - }; - this.publicJwkDest = JSON.parse(agreement.dest); - this.block = { - raw: block - }; - this.initialized = new Promise((resolve, reject) => { - this.init(agreement, dltAgent).then(() => { - resolve(true); - }).catch((error) => { - reject(error); - }); - }); - } - async init(agreement, dltAgent) { - const errors = await validateDataExchangeAgreement(agreement); - if (errors.length > 0) { - const errorMsg = []; - let nrErrors = []; - errors.forEach((error) => { - errorMsg.push(error.message); - nrErrors = nrErrors.concat(error.nrErrors); - }); - nrErrors = [...(new Set(nrErrors))]; - throw new NrError('Resource has not been validated:\n' + errorMsg.join('\n'), nrErrors); - } - this.agreement = agreement; - await verifyKeyPair(this.jwkPairOrig.publicJwk, this.jwkPairOrig.privateJwk); - const secret = await oneTimeSecret(this.agreement.encAlg); - this.block = { - ...this.block, - secret, - jwe: await jweEncrypt(this.block.raw, secret.jwk, this.agreement.encAlg) - }; - const cipherblockDgst = b64.encode(await sha(this.block.jwe, this.agreement.hashAlg), true, false); - const blockCommitment = b64.encode(await sha(this.block.raw, this.agreement.hashAlg), true, false); - const secretCommitment = b64.encode(await sha(new Uint8Array(hexToBuf(this.block.secret.hex)), this.agreement.hashAlg), true, false); - const dataExchangePreview = { - ...this.agreement, - cipherblockDgst, - blockCommitment, - secretCommitment - }; - const id = await exchangeId(dataExchangePreview); - this.exchange = { - ...dataExchangePreview, - id - }; - await this._dltSetup(dltAgent); - } - async _dltSetup(dltAgent) { - this.dltAgent = dltAgent; - const signerAddress = await this.dltAgent.getAddress(); - if (signerAddress !== this.exchange.ledgerSignerAddress) { - throw new Error(`ledgerSignerAddress: ${this.exchange.ledgerSignerAddress} does not meet the address ${signerAddress} derived from the provided private key`); - } - const contractAddress = await this.dltAgent.getContractAddress(); - if (contractAddress !== parseHex(this.agreement.ledgerContractAddress, true)) { - throw new Error(`Contract address in use ${contractAddress} does not meet the agreed one ${this.agreement.ledgerContractAddress}`); - } - } - async generatePoO() { - await this.initialized; - this.block.poo = await createProof({ - proofType: 'PoO', - iss: 'orig', - exchange: this.exchange - }, this.jwkPairOrig.privateJwk); - return this.block.poo; - } - async verifyPoR(por, options) { - await this.initialized; - if (this.block.poo === undefined) { - throw new Error('Cannot verify a PoR if not even a PoO have been created'); - } - const expectedPayloadClaims = { - proofType: 'PoR', - iss: 'dest', - exchange: this.exchange, - poo: this.block.poo.jws - }; - const pooTs = this.block.poo.payload.iat * 1000; - const opts = { - timestamp: Date.now(), - notBefore: pooTs, - notAfter: pooTs + this.exchange.pooToPorDelay, - ...options - }; - const verified = await verifyProof(por, expectedPayloadClaims, opts); - this.block.por = { - jws: por, - payload: verified.payload - }; - return this.block.por; - } - async generatePoP() { - await this.initialized; - if (this.block.por === undefined) { - throw new Error('Before computing a PoP, you have first to have received and verified the PoR'); - } - const verificationCode = await this.dltAgent.deploySecret(this.block.secret.hex, this.exchange.id); - const payload = { - proofType: 'PoP', - iss: 'orig', - exchange: this.exchange, - por: this.block.por.jws, - secret: JSON.stringify(this.block.secret.jwk), - verificationCode - }; - this.block.pop = await createProof(payload, this.jwkPairOrig.privateJwk); - return this.block.pop; - } - async generateVerificationRequest() { - await this.initialized; - if (this.block.por === undefined) { - throw new Error('Before generating a VerificationRequest, you have first to hold a valid PoR for the exchange'); - } - return await generateVerificationRequest('orig', this.exchange.id, this.block.por.jws, this.jwkPairOrig.privateJwk); - } -} - -var index = /*#__PURE__*/Object.freeze({ - __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, verifyPro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TQUFTLEVBQUU7QUFDaEMsWUFBQSxNQUFNLElBQUksS0FBSyxDQUFDLDhGQUE4RixDQUFDLENBQUE7QUFDaEgsU0FBQTtRQUVELE9BQU8sTUFBTSwyQkFBMkIsQ0FBQyxNQUFNLEVBQUUsSUFBSSxDQUFDLFFBQVEsQ0FBQyxFQUFFLEVBQUUsSUFBSSxDQUFDLEtBQUssQ0FBQyxHQUFHLENBQUMsR0FBRyxFQUFFLElBQUksQ0FBQyxXQUFXLENBQUMsVUFBVSxDQUFDLENBQUE7S0FDcEg7QUFDRjs7Ozs7Ozs7OzsifQ== diff --git a/dist/index.browser.esm.js b/dist/index.browser.esm.js new file mode 100644 index 0000000..21ad3d0 --- /dev/null +++ b/dist/index.browser.esm.js @@ -0,0 +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:a})})).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:a})})).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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguYnJvd3Nlci5lc20uanMiLCJzb3VyY2VzIjpbIi4uL3NyYy90cy9jb25zdGFudHMudHMiLCIuLi9zcmMvdHMvZXJyb3JzL05yRXJyb3IudHMiLCIuLi9zcmMvdHMvY3J5cHRvL2dlbmVyYXRlS2V5cy50cyIsIi4uL3NyYy90cy9jcnlwdG8vaW1wb3J0SndrLnRzIiwiLi4vc3JjL3RzL2NyeXB0by9qd2UudHMiLCIuLi9zcmMvdHMvY3J5cHRvL2p3c0RlY29kZS50cyIsIi4uL3NyYy90cy91dGlscy9hbGdCeXRlTGVuZ3RoLnRzIiwiLi4vc3JjL3RzL2NyeXB0by9vbmVUaW1lU2VjcmV0LnRzIiwiLi4vc3JjL3RzL2NyeXB0by92ZXJpZnlLZXlQYWlyLnRzIiwiLi4vc3JjL3RzL3V0aWxzL3RpbWVzd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3RyxFQUNMckcsUUFBU0ssRUFBU0wsU0FHYnhFLEtBQUtzRCxNQUFNdUgsR0FDbkIsQ0FRRHJLLG9CQUdFLFNBRk1SLEtBQUsrTSxpQkFFWTVMLElBQW5CbkIsS0FBS3NELE1BQU11SCxJQUNiLE1BQU0sSUFBSWxMLE1BQU0sZ0ZBR2xCLE1BQU1xVixRQUF5QmhWLEtBQUs4TSxTQUFTOEksYUFBYTVWLEtBQUtzRCxNQUFNOEIsT0FBT08sSUFBSzNGLEtBQUtxSixTQUFTNkIsSUFFekYxRyxFQUFtQyxDQUN2Q2tILFVBQVcsTUFDWGxDLElBQUssT0FDTEgsU0FBVXJKLEtBQUtxSixTQUNmd0IsSUFBSzdLLEtBQUtzRCxNQUFNdUgsSUFBSXhHLElBQ3BCZSxPQUFRWCxLQUFLdUQsVUFBVWhJLEtBQUtzRCxNQUFNOEIsT0FBT3JDLEtBQ3pDaVMsb0JBR0YsT0FEQWhWLEtBQUtzRCxNQUFNeVIsVUFBWXhMLEVBQVkvRSxFQUFTeEUsS0FBS3dWLFlBQVlsVCxZQUN0RHRDLEtBQUtzRCxNQUFNeVIsR0FDbkIsQ0FRRHZVLG9DQUdFLFNBRk1SLEtBQUsrTSxpQkFFWTVMLElBQW5CbkIsS0FBS3NELE1BQU11SCxJQUNiLE1BQU0sSUFBSWxMLE1BQU0sZ0dBR2xCLGFBQWE4TSxFQUE0QixPQUFRek0sS0FBS3FKLFNBQVM2QixHQUFJbEwsS0FBS3NELE1BQU11SCxJQUFJeEcsSUFBS3JFLEtBQUt3VixZQUFZbFQsV0FDekcifQ== diff --git a/dist/index.d.ts b/dist/index.d.ts new file mode 100644 index 0000000..4af39db --- /dev/null +++ b/dist/index.d.ts @@ -0,0 +1,3909 @@ +/// +import { ContractInterface } from '@ethersproject/contracts'; +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 { KeyObject } from 'crypto'; + +declare const HASH_ALGS: readonly ["SHA-256", "SHA-384", "SHA-512"]; +declare const SIGNING_ALGS: readonly ["ES256", "ES384", "ES512"]; +declare const ENC_ALGS: readonly ["A128GCM", "A256GCM"]; +declare const KEY_AGREEMENT_ALGS: readonly ["ECDH-ES"]; + +/* eslint-disable @typescript-eslint/no-empty-interface */ +declare namespace WalletComponents { + export namespace Schemas { + /** + * Error + */ + export interface ApiError { + code: number // int32 + message: string + } + /** + * CompactJWS + */ + export type CompactJWS = string // ^[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+$ + /** + * Contract + */ + export interface Contract { + /** + * example: + * Contract + */ + type: 'Contract' + /** + * example: + * Resource name + */ + name?: string + identity?: /** + * a DID using the ethr resolver + * example: + * did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863 + */ + Did /* ^did:ethr:(\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$ */ + resource: { + dataSharingAgreement: DataSharingAgreement + keyPair?: JwkPair + } + } + export interface DataExchange { + /** + * A stringified JWK with alphabetically sorted claims + * example: + * {"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"} + */ + orig: string + /** + * A stringified JWK with alphabetically sorted claims + * example: + * {"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"} + */ + dest: string + /** + * example: + * A256GCM + */ + encAlg: 'A128GCM' | 'A256GCM' + /** + * example: + * ES256 + */ + signingAlg: 'ES256' | 'ES384' | 'ES512' + /** + * example: + * SHA-256 + */ + hashAlg: 'SHA-256' | 'SHA-384' | 'SHA-512' + ledgerContractAddress: /** + * Ethereum Address in EIP-55 format (with checksum) + * example: + * 0x71C7656EC7ab88b098defB751B7401B5f6d8976F + */ + EthereumAddress /* ^0x([0-9A-Fa-f]){40}$ */ + ledgerSignerAddress: /** + * Ethereum Address in EIP-55 format (with checksum) + * example: + * 0x71C7656EC7ab88b098defB751B7401B5f6d8976F + */ + EthereumAddress /* ^0x([0-9A-Fa-f]){40}$ */ + /** + * Maximum acceptable time in milliseconds between issued PoO and verified PoR + * example: + * 10000 + */ + pooToPorDelay: number + /** + * Maximum acceptable time in milliseconds between issued PoO and issued PoP + * example: + * 20000 + */ + pooToPopDelay: number + /** + * Maximum acceptable time between issued PoO and secret published on the ledger + * example: + * 180000 + */ + pooToSecretDelay: number + /** + * A stringified JSON-LD schema describing the data format + */ + schema?: string + /** + * hash of the cipherblock in base64url with no padding + */ + cipherblockDgst: string // ^[a-zA-Z0-9_-]+$ + /** + * hash of the plaintext block in base64url with no padding + */ + blockCommitment: string // ^[a-zA-Z0-9_-]+$ + /** + * ash of the secret that can be used to decrypt the block in base64url with no padding + */ + secretCommitment: string // ^[a-zA-Z0-9_-]+$ + } + export interface DataExchangeAgreement { + /** + * A stringified JWK with alphabetically sorted claims + * example: + * {"alg":"ES256","crv":"P-256","kty":"EC","x":"t0ueMqN9j8lWYa2FXZjSw3cycpwSgxjl26qlV6zkFEo","y":"rMqWC9jGfXXLEh_1cku4-f0PfbFa1igbNWLPzos_gb0"} + */ + orig: string + /** + * A stringified JWK with alphabetically sorted claims + * example: + * {"alg":"ES256","crv":"P-256","kty":"EC","x":"sI5lkRCGpfeViQzAnu-gLnZnIGdbtfPiY7dGk4yVn-k","y":"4iFXDnEzPEb7Ce_18RSV22jW6VaVCpwH3FgTAKj3Cf4"} + */ + dest: string + /** + * example: + * A256GCM + */ + encAlg: 'A128GCM' | 'A256GCM' + /** + * example: + * ES256 + */ + signingAlg: 'ES256' | 'ES384' | 'ES512' + /** + * example: + * SHA-256 + */ + hashAlg: 'SHA-256' | 'SHA-384' | 'SHA-512' + ledgerContractAddress: /** + * Ethereum Address in EIP-55 format (with checksum) + * example: + * 0x71C7656EC7ab88b098defB751B7401B5f6d8976F + */ + EthereumAddress /* ^0x([0-9A-Fa-f]){40}$ */ + ledgerSignerAddress: /** + * Ethereum Address in EIP-55 format (with checksum) + * example: + * 0x71C7656EC7ab88b098defB751B7401B5f6d8976F + */ + EthereumAddress /* ^0x([0-9A-Fa-f]){40}$ */ + /** + * Maximum acceptable time in milliseconds between issued PoO and verified PoR + * example: + * 10000 + */ + pooToPorDelay: number + /** + * Maximum acceptable time in milliseconds between issued PoO and issued PoP + * example: + * 20000 + */ + pooToPopDelay: number + /** + * Maximum acceptable time between issued PoO and secret published on the ledger + * example: + * 180000 + */ + pooToSecretDelay: number + /** + * A stringified JSON-LD schema describing the data format + */ + schema?: string + } + /** + * DataExchangeResource + */ + export interface DataExchangeResource { + /** + * example: + * DataExchange + */ + type: 'DataExchange' + /** + * example: + * Resource name + */ + name?: string + resource: DataExchange + } + export interface DataSharingAgreement { + dataOfferingDescription: { + dataOfferingId: string + version: number + category?: string + active: boolean + title?: string + } + parties: { + providerDid: /** + * a DID using the ethr resolver + * example: + * did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863 + */ + Did /* ^did:ethr:(\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$ */ + consumerDid: /** + * a DID using the ethr resolver + * example: + * did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863 + */ + Did /* ^did:ethr:(\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$ */ + } + purpose: string + duration: { + creationDate: number + startDate: number + endDate: number + } + intendedUse: { + processData: boolean + shareDataWithThirdParty: boolean + editData: boolean + } + licenseGrant: { + transferable: boolean + exclusiveness: boolean + paidUp: boolean + revocable: boolean + processing: boolean + modifying: boolean + analyzing: boolean + storingData: boolean + storingCopy: boolean + reproducing: boolean + distributing: boolean + loaning: boolean + selling: boolean + renting: boolean + furtherLicensing: boolean + leasing: boolean + } + dataStream: boolean + personalData: boolean + pricingModel: { + paymentType?: string + pricingModelName?: string + basicPrice: number // float + currency: string + fee?: number // float + hasPaymentOnSubscription?: { + paymentOnSubscriptionName?: string + paymentType?: string + timeDuration?: string + description?: string + repeat?: string + hasSubscriptionPrice?: number + } + hasFreePrice: { + hasPriceFree?: boolean + } + } + dataExchangeAgreement: DataExchangeAgreement + signatures: { + providerSignature: /* CompactJWS */ CompactJWS /* ^[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+$ */ + consumerSignature: /* CompactJWS */ CompactJWS /* ^[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+$ */ + } + } + /** + * JwtPayload + */ + export interface DecodedJwt { + header?: { + [name: string]: any + typ: 'JWT' + alg: 'ES256K' + } + payload?: { + [name: string]: any + iss: /** + * a DID using the ethr resolver + * example: + * did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863 + */ + Did /* ^did:ethr:(\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$ */ + } + signature: string // ^[A-Za-z0-9_-]+$ + /** + * . + */ + data: string // ^[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+$ + } + /** + * a DID using the ethr resolver + * example: + * did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863 + */ + export type Did = string // ^did:ethr:(\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$ + /** + * Ethereum Address in EIP-55 format (with checksum) + * example: + * 0x71C7656EC7ab88b098defB751B7401B5f6d8976F + */ + export type EthereumAddress = string // ^0x([0-9A-Fa-f]){40}$ + /** + * IdentityCreateInput + * 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). + * + */ + export interface IdentityCreateInput { + [name: string]: any + alias?: string + } + /** + * IdentityCreateOutput + * It returns the account id and type + * + */ + export interface IdentityCreateOutput { + [name: string]: any + did: /** + * a DID using the ethr resolver + * example: + * did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863 + */ + Did /* ^did:ethr:(\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$ */ + } + /** + * Identity Data + */ + export interface IdentityData { + /** + * example: + * did:ethr:i3m:0x03142f480f831e835822fc0cd35726844a7069d28df58fb82037f1598812e1ade8 + */ + did: string + /** + * example: + * identity1 + */ + alias?: string + /** + * example: + * did:ethr:i3m + */ + provider?: string + /** + * example: + * [ + * "0x8646cAcF516de1292be1D30AB68E7Ea51e9B1BE7" + * ] + */ + addresses?: /** + * Ethereum Address in EIP-55 format (with checksum) + * example: + * 0x71C7656EC7ab88b098defB751B7401B5f6d8976F + */ + EthereumAddress /* ^0x([0-9A-Fa-f]){40}$ */[] + } + /** + * IdentityListInput + * A list of DIDs + */ + export type IdentityListInput = Array<{ + did: /** + * a DID using the ethr resolver + * example: + * did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863 + */ + Did /* ^did:ethr:(\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$ */ + }> + /** + * IdentitySelectOutput + */ + export interface IdentitySelectOutput { + did: /** + * a DID using the ethr resolver + * example: + * did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863 + */ + Did /* ^did:ethr:(\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$ */ + } + export interface JwkPair { + /** + * A stringified JWK with alphabetically sorted claims that represents a private key (complementary to `publicJwk`) + * + * example: + * {"alg":"ES256","crv":"P-256","d":"rQp_3eZzvXwt1sK7WWsRhVYipqNGblzYDKKaYirlqs0","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"} + */ + privateJwk: string + /** + * A stringified JWK with alphabetically sorted claims that represents the public key (complementary to `privateJwk`). + * + * example: + * {"alg":"ES256","crv":"P-256","kty":"EC","x":"sMGSjfIlRJRseMpx3iHhCx4uh-6N4-AUKX18lmoeSD8","y":"Hu8EcpyH2XrCd-oKqm9keEhnMx2v2QaPs6P4Vs8OkpE"} + */ + publicJwk: string + } + /** + * JWK pair + */ + export interface KeyPair { + /** + * example: + * KeyPair + */ + type: 'KeyPair' + /** + * example: + * Resource name + */ + name?: string + identity?: /** + * a DID using the ethr resolver + * example: + * did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863 + */ + Did /* ^did:ethr:(\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$ */ + resource: { + keyPair: JwkPair + } + } + /** + * NonRepudiationProof + */ + export interface NonRepudiationProof { + /** + * example: + * NonRepudiationProof + */ + type: 'NonRepudiationProof' + /** + * example: + * Resource name + */ + name?: string + /** + * a non-repudiation proof (either a PoO, a PoR or a PoP) as a compact JWS + */ + resource: any + } + /** + * ObjectResource + */ + export interface ObjectResource { + /** + * example: + * Object + */ + type: 'Object' + /** + * example: + * Resource name + */ + name?: string + parentResource?: string + identity?: /** + * a DID using the ethr resolver + * example: + * did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863 + */ + Did /* ^did:ethr:(\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$ */ + resource: { + [name: string]: any + } + } + /** + * ProviderData + * A JSON object with information of the DLT provider currently in use. + */ + export interface ProviderData { + [name: string]: any + /** + * example: + * did:ethr:i3m + */ + provider?: string + /** + * example: + * i3m + */ + network?: string + /** + * example: + * http://95.211.3.250:8545 + */ + rpcUrl?: string + } + /** + * Receipt + */ + export interface Receipt { + receipt: string + } + /** + * Resource + */ + export type Resource = /* Resource */ /* VerifiableCredential */ VerifiableCredential | /* ObjectResource */ ObjectResource | /* JWK pair */ KeyPair | /* Contract */ Contract | /* NonRepudiationProof */ NonRepudiationProof | /* DataExchangeResource */ DataExchangeResource + export interface ResourceId { + id: string + } + /** + * ResourceListOutput + * A list of resources + */ + export type ResourceListOutput = /* Resource */ Resource[] + export type ResourceType = 'VerifiableCredential' | 'Object' | 'KeyPair' | 'Contract' | 'DataExchange' | 'NonRepudiationProof' + /** + * SignInput + */ + export type SignInput = /* SignInput */ /* SignTransaction */ SignTransaction | /* SignRaw */ SignRaw | /* SignJWT */ SignJWT + /** + * SignJWT + */ + export interface SignJWT { + type: 'JWT' + data: { + /** + * header fields to be added to the JWS header. "alg" and "kid" will be ignored since they are automatically added by the wallet. + */ + header?: { + [name: string]: any + } + /** + * 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. + */ + payload: { + [name: string]: any + } + } + } + /** + * SignOutput + */ + export interface SignOutput { + signature: string + } + /** + * SignRaw + */ + export interface SignRaw { + type: 'Raw' + data: { + /** + * Base64Url encoded data to sign + */ + payload: string // ^[A-Za-z0-9_-]+$ + } + } + /** + * SignTransaction + */ + export interface SignTransaction { + type: 'Transaction' + data: /* Transaction */ Transaction + } + /** + * SignTypes + */ + export type SignTypes = 'Transaction' | 'Raw' | 'JWT' + /** + * SignedTransaction + * A list of resources + */ + export interface SignedTransaction { + transaction?: string // ^0x(?:[A-Fa-f0-9])+$ + } + /** + * Transaction + */ + export interface Transaction { + [name: string]: any + from?: string + to?: string + nonce?: number + } + /** + * VerifiableCredential + */ + export interface VerifiableCredential { + /** + * example: + * VerifiableCredential + */ + type: 'VerifiableCredential' + /** + * example: + * Resource name + */ + name?: string + resource: { + [name: string]: any + /** + * example: + * [ + * "https://www.w3.org/2018/credentials/v1" + * ] + */ + '@context': string[] + /** + * example: + * http://example.edu/credentials/1872 + */ + id?: string + /** + * example: + * [ + * "VerifiableCredential" + * ] + */ + type: string[] + issuer: { + [name: string]: any + id: /** + * a DID using the ethr resolver + * example: + * did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863 + */ + Did /* ^did:ethr:(\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$ */ + } + /** + * example: + * 2021-06-10T19:07:28.000Z + */ + issuanceDate: string // date-time + credentialSubject: { + [name: string]: any + id: /** + * a DID using the ethr resolver + * example: + * did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863 + */ + Did /* ^did:ethr:(\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$ */ + } + proof: { + [name: string]: any + type: 'JwtProof2020' + } + } + } + /** + * VerificationOutput + */ + export interface VerificationOutput { + /** + * whether verification has been successful or has failed + */ + verification: 'success' | 'failed' + /** + * error message if verification failed + */ + error?: string + /** + * the decoded JWT + */ + decodedJwt?: any + } + } +} +declare namespace WalletPaths { + export namespace DidJwtVerify { + export interface RequestBody { + /** + * example: + * eyJhbGciOiJFUzI1NksiLCJ0eXAiOiJKV1QifQ.eyJmaWVsZDEiOiJzYWRzYWQ3NSIsImZpZWxkMiI6ImFmZnNhczlmODdzIiwiaXNzIjoiZGlkOmV0aHI6aTNtOjB4MDNmOTcwNjRhMzUzZmFmNWRkNTQwYWE2N2I2OTE2YmY1NmMwOWM1MGNjODAzN2E0NTNlNzg1ODdmMjdmYjg4ZTk0IiwiaWF0IjoxNjY1NDAwMzYzfQ.IpQ7WprvDMk6QWcJXuPBazat-2657dWIK-iGvOOB5oAhAmMqDBm8OEtKordqeqcEWwhWw_C7_ziMMZkPz1JIkw + */ + jwt: string // ^[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+$ + /** + * The expected values of the proof's payload claims. An expected value of '' can be used to just check that the claim is in the payload. An example could be: + * + * ```json + * { + * iss: 'orig', + * exchange: { + * id: '9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d', + * orig: '{"kty":"EC","x":"rPMP39e-o8cU6m4WL8_qd2wxo-nBTjWXZtPGBiiGCTY","y":"0uvxGEebFDxKOHYUlHREzq4mRULuZvQ6LB2I11yE1E0","crv":"P-256"}', // Public key in JSON.stringify(JWK) of the block origin (sender) + * dest: '{"kty":"EC","x":"qf_mNdy57ia1vAq5QLpTPxJUCRhS2003-gL0nLcbXoA","y":"H_8YwSCKJhDbZv17YEgDfAiKTaQ8x0jpLYCC2myxAeY","crv":"P-256"}', // Public key in JSON.stringify(JWK) of the block destination (receiver) + * hash_alg: 'SHA-256', + * cipherblock_dgst: 'IBUIstf98_afbiuh7UaifkasytNih7as-Jah61ls9UI', // hash of the cipherblock in base64url with no padding + * block_commitment: '', // hash of the plaintext block in base64url with no padding + * secret_commitment: '' // hash of the secret that can be used to decrypt the block in base64url with no padding + * } + * } + * ``` + * + */ + expectedPayloadClaims?: { + [name: string]: any + } + } + export namespace Responses { + export type $200 = /* VerificationOutput */ WalletComponents.Schemas.VerificationOutput + export type Default = /* Error */ WalletComponents.Schemas.ApiError + } + } + export namespace IdentityCreate { + export type RequestBody = /** + * IdentityCreateInput + * 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). + * + */ + WalletComponents.Schemas.IdentityCreateInput + export namespace Responses { + export type $201 = /** + * IdentityCreateOutput + * It returns the account id and type + * + */ + WalletComponents.Schemas.IdentityCreateOutput + export type Default = /* Error */ WalletComponents.Schemas.ApiError + } + } + export namespace IdentityDeployTransaction { + export namespace Parameters { + export type Did = /** + * a DID using the ethr resolver + * example: + * did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863 + */ + WalletComponents.Schemas.Did /* ^did:ethr:(\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$ */ + } + export interface PathParameters { + did: Parameters.Did + } + export type RequestBody = /* Transaction */ WalletComponents.Schemas.Transaction + export namespace Responses { + export type $200 = /* Receipt */ WalletComponents.Schemas.Receipt + export type Default = /* Error */ WalletComponents.Schemas.ApiError + } + } + export namespace IdentityInfo { + export namespace Parameters { + export type Did = /** + * a DID using the ethr resolver + * example: + * did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863 + */ + WalletComponents.Schemas.Did /* ^did:ethr:(\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$ */ + } + export interface PathParameters { + did: Parameters.Did + } + export namespace Responses { + export type $200 = /* Identity Data */ WalletComponents.Schemas.IdentityData + export type Default = /* Error */ WalletComponents.Schemas.ApiError + } + } + export namespace IdentityList { + export namespace Parameters { + /** + * An alias for the identity + */ + export type Alias = string + } + export interface QueryParameters { + alias?: /* An alias for the identity */ Parameters.Alias + } + export namespace Responses { + export type $200 = /** + * IdentityListInput + * A list of DIDs + */ + WalletComponents.Schemas.IdentityListInput + export type Default = /* Error */ WalletComponents.Schemas.ApiError + } + } + export namespace IdentitySelect { + export namespace Parameters { + /** + * Message to show to the user with the reason to pick an identity + */ + export type Reason = string + } + export interface QueryParameters { + reason?: /* Message to show to the user with the reason to pick an identity */ Parameters.Reason + } + export namespace Responses { + export type $200 = /* IdentitySelectOutput */ WalletComponents.Schemas.IdentitySelectOutput + export type Default = /* Error */ WalletComponents.Schemas.ApiError + } + } + export namespace IdentitySign { + export namespace Parameters { + export type Did = /** + * a DID using the ethr resolver + * example: + * did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863 + */ + WalletComponents.Schemas.Did /* ^did:ethr:(\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$ */ + } + export interface PathParameters { + did: Parameters.Did + } + export type RequestBody = /* SignInput */ WalletComponents.Schemas.SignInput + export namespace Responses { + export type $200 = /* SignOutput */ WalletComponents.Schemas.SignOutput + export type Default = /* Error */ WalletComponents.Schemas.ApiError + } + } + export namespace ProviderinfoGet { + export namespace Responses { + export type $200 = /** + * ProviderData + * A JSON object with information of the DLT provider currently in use. + */ + WalletComponents.Schemas.ProviderData + export type Default = /* Error */ WalletComponents.Schemas.ApiError + } + } + export namespace ResourceCreate { + export type RequestBody = /* Resource */ WalletComponents.Schemas.Resource + export namespace Responses { + export type $201 = WalletComponents.Schemas.ResourceId + export type Default = /* Error */ WalletComponents.Schemas.ApiError + } + } + export namespace ResourceList { + export namespace Parameters { + export type Identity = /** + * a DID using the ethr resolver + * example: + * did:ethr:i3m:0x031bee96cfae8bad99ea0dd3d08d1a3296084f894e9ddfe1ffe141133e81ac5863 + */ + WalletComponents.Schemas.Did /* ^did:ethr:(\w+:)?0x[0-9a-fA-F]{40}([0-9a-fA-F]{26})?$ */ + export type ParentResource = string + export type Type = WalletComponents.Schemas.ResourceType + } + export interface QueryParameters { + type?: Parameters.Type + identity?: Parameters.Identity + parentResource?: Parameters.ParentResource + } + export namespace Responses { + export type $200 = /** + * ResourceListOutput + * A list of resources + */ + WalletComponents.Schemas.ResourceListOutput + export type Default = /* Error */ WalletComponents.Schemas.ApiError + } + } + export namespace SelectiveDisclosure { + export namespace Parameters { + export type Jwt = string // ^[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+$ + } + export interface PathParameters { + jwt: Parameters.Jwt /* ^[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+$ */ + } + export namespace Responses { + export interface $200 { + jwt?: string + } + export type Default = /* Error */ WalletComponents.Schemas.ApiError + } + } + export namespace TransactionDeploy { + export type RequestBody = /** + * SignedTransaction + * A list of resources + */ + WalletComponents.Schemas.SignedTransaction + export namespace Responses { + export interface $200 { + } + export type Default = /* Error */ WalletComponents.Schemas.ApiError + } + } +} + +type HashAlg = typeof HASH_ALGS[number]; +type SigningAlg = typeof SIGNING_ALGS[number]; +type EncryptionAlg = typeof ENC_ALGS[number]; +type Dict = T & { + [key: string | symbol | number]: any | undefined; +}; +interface Algs { + hashAlg?: HashAlg; + SigningAlg?: SigningAlg; + EncAlg?: EncryptionAlg; +} +interface JWK extends JWK$1 { + alg: SigningAlg | EncryptionAlg; +} +interface ContractConfig { + address: string; + abi: ContractInterface; +} +interface DltConfig { + rpcProviderUrl: string; + gasLimit: number; + contract: ContractConfig; +} +interface StoredProof { + jws: string; + payload: T; +} +interface Block { + raw?: Uint8Array; + jwe?: string; + secret?: { + jwk: JWK; + hex: string; + }; + poo?: StoredProof; + por?: StoredProof; + pop?: StoredProof; +} +interface OrigBlock extends Block { + raw: Uint8Array; + jwe: string; + secret: { + jwk: JWK; + hex: string; + }; +} +interface TimestampVerifyOptions { + timestamp: 'iat' | number; + notBefore: 'iat' | number; + notAfter: 'iat' | number; + tolerance?: number; +} +interface DataSharingAgreement extends WalletComponents.Schemas.DataSharingAgreement { +} +interface DataExchangeAgreement extends WalletComponents.Schemas.DataExchangeAgreement { +} +interface DataExchange extends WalletComponents.Schemas.DataExchange { + id: string; +} +interface JwkPair { + publicJwk: JWK; + privateJwk: JWK; +} +interface ProofPayload { + iat: number; + iss: string; + proofType: string; +} +interface NrProofPayload extends ProofPayload { + exchange: DataExchange; +} +interface PoOPayload extends NrProofPayload { + iss: 'orig'; + proofType: 'PoO'; +} +interface PoRPayload extends NrProofPayload { + iss: 'dest'; + proofType: 'PoR'; + poo: string; +} +interface PoPPayload extends NrProofPayload { + iss: 'orig'; + proofType: 'PoP'; + por: string; + secret: string; + verificationCode: string; +} +interface ConflictResolutionRequestPayload extends ProofPayload { + proofType: 'request'; + iss: 'orig' | 'dest'; + iat: number; + por: string; + dataExchangeId: string; +} +interface VerificationRequestPayload extends ConflictResolutionRequestPayload { + type: 'verificationRequest'; +} +interface DisputeRequestPayload extends ConflictResolutionRequestPayload { + type: 'disputeRequest'; + iss: 'dest'; + cipherblock: string; +} +interface ResolutionPayload extends ProofPayload { + proofType: 'resolution'; + type?: string; + resolution?: string; + dataExchangeId: string; + iat: number; + iss: string; + sub: string; +} +interface VerificationResolutionPayload extends ResolutionPayload { + type: 'verification'; + resolution: 'completed' | 'not completed'; +} +interface DisputeResolutionPayload extends ResolutionPayload { + type: 'dispute'; + resolution: 'accepted' | 'denied'; +} +interface DecodedProof { + header: JWTHeaderParameters; + payload: T; + signer?: JWK; +} +type getFromJws = (header: JWEHeaderParameters, payload: T) => Promise; +type NrErrorName = 'not a compact jws' | 'invalid key' | 'encryption failed' | 'decryption failed' | 'jws verification failed' | 'invalid algorithm' | 'invalid EIP-55 address' | 'invalid poo' | 'invalid por' | 'invalid pop' | 'invalid dispute request' | 'invalid verification request' | 'invalid dispute request' | 'data exchange not as expected' | 'dataExchange integrity violated' | 'secret not published' | 'secret not published in time' | 'received too late' | 'unexpected error' | 'invalid timestamp' | 'invalid format' | 'cannot contact the ledger' | 'cannot verify'; + +declare const defaultDltConfig: Omit; + +declare abstract class NrpDltAgent { + abstract getContractAddress(): Promise; +} + +declare class EthersIoAgent extends NrpDltAgent { + dltConfig: DltConfig; + contract: ethers.Contract; + provider: ethers.providers.Provider; + initialized: Promise; + constructor(dltConfig: (Partial & Pick) | Promise<(Partial & Pick)>); + getContractAddress(): Promise; +} + +interface NrpDltAgentDest extends NrpDltAgent { + getSecretFromLedger: (secretLength: number, signerAddress: string, exchangeId: string, timeout: number) => Promise<{ + hex: string; + iat: number; + }>; +} + +declare class EthersIoAgentDest extends EthersIoAgent implements NrpDltAgentDest { + getSecretFromLedger(secretLength: number, signerAddress: string, exchangeId: string, timeout: number): Promise<{ + hex: string; + iat: number; + }>; +} + +declare class BaseECDH { + generateKeys(): Promise; + getPublicKey(): Promise; + deriveBits(publicKeyHex: string): Promise; +} +declare type CipherAlgorithms = 'aes-256-gcm'; +declare class BaseCipher { + readonly algorithm: CipherAlgorithms; + readonly key: Uint8Array; + constructor(algorithm: CipherAlgorithms, key: Uint8Array); + encrypt(payload: Uint8Array): Promise; + decrypt(ciphertext: Uint8Array): Promise; +} + +declare class EventEmitter { + events: Record; + constructor(); + on(event: string, cb: Function): this; + emit(event: string, ...data: any): boolean; +} + +interface Identity$1 { + name: string; + url?: string; +} +interface PKEData { + id: Identity$1; + rx: Uint8Array; + publicKey: string; +} +interface ProtocolPKEData { + a: PKEData; + b: PKEData; + port: number; + sent: PKEData; + received: PKEData; +} +interface AuthData { + cx: Uint8Array; + nx: Uint8Array; + r: Uint8Array; +} +interface ProtocolAuthData { + a: AuthData; + b: AuthData; + sent: AuthData; + received: AuthData; +} + +declare class MasterKey { + readonly port: number; + readonly from: Identity$1; + readonly to: Identity$1; + readonly na: Uint8Array; + readonly nb: Uint8Array; + protected secret: Uint8Array; + protected cipher: BaseCipher; + protected decipher: BaseCipher; + constructor(port: number, from: Identity$1, to: Identity$1, na: Uint8Array, nb: Uint8Array, secret: Uint8Array, encryptKey: Uint8Array, decryptKey: Uint8Array); + encrypt(message: Uint8Array): Promise; + decrypt(ciphertext: Uint8Array): Promise; + toJSON(): any; + fromHash(): Promise; + toHash(): Promise; + static fromSecret(port: number, from: Identity$1, to: Identity$1, na: Uint8Array, nb: Uint8Array, secret: Uint8Array): Promise; + static fromJSON(data: any): Promise; +} + +declare class Session { + protected transport: T; + protected masterKey: MasterKey; + protected code: Uint8Array; + constructor(transport: T, masterKey: MasterKey, code: Uint8Array); + send(request: TransportRequest): Promise>; + toJSON(): any; + static fromJSON(transport: T, json: any): Promise>; + static fromJSON(transportConstructor: new () => T, json: any): Promise>; +} + +declare class WalletProtocol extends EventEmitter { + transport: T; + constructor(transport: T); + computeR(ra: Uint8Array, rb: Uint8Array): Promise; + computeNx(): Promise; + computeCx(pkeData: ProtocolPKEData, nx: Uint8Array, r: Uint8Array): Promise; + validateAuthData(fullPkeData: ProtocolPKEData, fullAuthData: ProtocolAuthData): Promise; + computeMasterKey(ecdh: BaseECDH, fullPkeData: ProtocolPKEData, fullAuthData: ProtocolAuthData): Promise; + run(): Promise>; + on(event: 'connString', listener: (connString: ConnectionString) => void): this; + on(event: 'masterKey', listener: (masterKey: MasterKey) => void): this; + on(event: 'finished', listener: () => void): this; + emit(event: 'connString', connString: ConnectionString): boolean; + emit(event: 'masterKey', masterKey: MasterKey): boolean; + emit(event: 'finished'): boolean; +} + +declare class ConnectionString { + protected buffer: Uint8Array; + protected l: number; + constructor(buffer: Uint8Array, l: number); + toString(): string; + extractPort(): number; + extractRb(): Uint8Array; + static generate(port: number, l: number): Promise; + static fromString(connString: string, l: number): ConnectionString; +} + +interface Transport { + prepare: (protocol: WalletProtocol, publicKey: string) => Promise; + publicKeyExchange: (protocol: WalletProtocol, pkeData: PKEData) => Promise; + authentication: (protocol: WalletProtocol, authData: AuthData) => Promise; + verification: (protocol: WalletProtocol, masterKey: MasterKey) => Promise; + send: (masterKey: MasterKey, code: Uint8Array, request: Req) => Promise; + finish: (protocol: WalletProtocol) => void; +} +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; + abstract authentication(protocol: WalletProtocol, authData: AuthData): Promise; + abstract verification(protocol: WalletProtocol, masterKey: MasterKey): Promise; + send(masterKey: MasterKey, code: Uint8Array, req: Req): Promise; + finish(protocol: WalletProtocol): void; +} + +interface PublicKeyExchangeRequest { + method: 'publicKeyExchange'; + sender: Identity$1; + publicKey: string; + ra?: string; +} +interface CommitmentRequest { + method: 'commitment'; + cx: string; +} +interface NonceRevealRequest { + method: 'nonce'; + nx: string; +} +interface VerificationRequest { + method: 'verification'; +} +interface VerificationChallengeRequest { + method: 'verificationChallenge'; + ciphertext: string; +} +interface AcknowledgementRequest { + method: 'acknowledgement'; +} +declare type Request = PublicKeyExchangeRequest | CommitmentRequest | NonceRevealRequest | VerificationRequest | VerificationChallengeRequest | AcknowledgementRequest; + +interface InitiatorOptions { + host: string; + id: Identity$1; + l: number; + getConnectionString: () => Promise; +} +declare abstract class InitiatorTransport extends BaseTransport { + protected opts: InitiatorOptions; + connString: ConnectionString | undefined; + constructor(opts?: Partial); + abstract sendRequest(request: Request): Promise; + prepare(protocol: WalletProtocol, publicKey: string): Promise; + publicKeyExchange(protocol: WalletProtocol, pkeData: PKEData): Promise; + authentication(protocol: WalletProtocol, authData: AuthData): Promise; + verification(protocol: WalletProtocol, masterKey: MasterKey): Promise; + finish(protocol: WalletProtocol): void; +} + +interface HttpRequest { + url: string; + init?: RequestInit; +} +interface HttpResponse { + status: number; + body: string; +} +declare class HttpInitiatorTransport extends InitiatorTransport { + baseSend(port: number, httpReq: RequestInit): Promise; + sendRequest(request: Request): Promise; + send(masterKey: MasterKey, code: Uint8Array, req: HttpRequest): Promise; +} + +declare type Params = Record | undefined; +declare type Body = any; +interface ApiMethod { + path: string; + method: string; + headers?: Record; +} +interface ApiExecutor { + executeQuery: (api: ApiMethod, pathParams: Params, queryParams: Params, bodyObject: Body) => Promise; +} + +declare class IdentitiesApi { + protected api: ApiExecutor; + constructor(api: ApiExecutor); + list(queryParams?: WalletPaths.IdentityList.QueryParameters): Promise; + select(queryParams?: WalletPaths.IdentitySelect.QueryParameters): Promise; + create(body: WalletPaths.IdentityCreate.RequestBody): Promise; + sign(pathParams: WalletPaths.IdentitySign.PathParameters, body: WalletPaths.IdentitySign.RequestBody): Promise; + info(pathParams: WalletPaths.IdentityInfo.PathParameters): Promise; + deployTransaction(pathParams: WalletPaths.IdentityDeployTransaction.PathParameters, body: WalletPaths.IdentityDeployTransaction.RequestBody): Promise; +} + +declare class ResourcesApi { + protected api: ApiExecutor; + constructor(api: ApiExecutor); + list(options?: WalletPaths.ResourceList.QueryParameters): Promise; + create(body: WalletPaths.ResourceCreate.RequestBody): Promise; +} + +declare class DisclosureApi { + protected api: ApiExecutor; + constructor(api: ApiExecutor); + disclose(pathParams: WalletPaths.SelectiveDisclosure.PathParameters): Promise; +} + +declare class TransactionApi { + protected api: ApiExecutor; + constructor(api: ApiExecutor); + deploy(body: WalletPaths.TransactionDeploy.RequestBody): Promise; +} + +declare class DidJwtApi { + protected api: ApiExecutor; + constructor(api: ApiExecutor); + verify(body: WalletPaths.DidJwtVerify.RequestBody): Promise; +} + +declare class ProviderInfoApi { + protected api: ApiExecutor; + constructor(api: ApiExecutor); + get(): Promise; +} + +declare class WalletApi implements ApiExecutor { + protected session: Session; + identities: IdentitiesApi; + transaction: TransactionApi; + resources: ResourcesApi; + disclosure: DisclosureApi; + didJwt: DidJwtApi; + providerinfo: ProviderInfoApi; + constructor(session: Session); + executeQuery(api: ApiMethod, pathParams: Params, queryParams: Params, bodyObject: Body): Promise; +} + +declare class I3mWalletAgent extends EthersIoAgent { + wallet: WalletApi; + did: string; + constructor(wallet: WalletApi, did: string, dltConfig?: Partial>); +} + +declare class I3mWalletAgentDest extends I3mWalletAgent implements NrpDltAgentDest { + getSecretFromLedger(secretLength: number, signerAddress: string, exchangeId: string, timeout: number): Promise<{ + hex: string; + iat: number; + }>; +} + +/** + * Agent base interface + * @public + */ +interface IAgentBase { + getSchema: () => IAgentPluginSchema; + availableMethods: () => string[]; +} +/** + * Agent that can execute methods + * @public + */ +interface IAgent extends IAgentBase { + execute: (method: string, args: A) => Promise; + emit: (eventType: string, data: any) => Promise; +} +/** + * Agent plugin method interface + * @public + */ +interface IPluginMethod { + (args: any, context: any): Promise; +} +/** + * Plugin method map interface + * @public + */ +interface IPluginMethodMap extends Record { +} +/** + * Agent plugin schema + * @public + */ +interface IAgentPluginSchema { + components: { + schemas: any; + methods: any; + }; +} +/** + * Removes context parameter from plugin method interface + * @public + */ +interface RemoveContext { + (args?: Parameters[0] | undefined): ReturnType; +} +/** + * Utility type for constructing agent type that has a list of available methods + * @public + */ +declare type TAgent = { + [P in keyof T]: RemoveContext; +} & IAgent; +/** + * Standard plugin method context interface + * + * @remarks + * When executing plugin method, you don't need to pass in the context. + * It is done automatically by the agent + * + * @example + * ```typescript + * await agent.resolveDid({ + * didUrl: 'did:example:123' + * }) + * ``` + * @public + */ +interface IAgentContext { + /** + * Configured agent + */ + agent: TAgent; +} + +/** + * Verifiable Credential {@link https://github.com/decentralized-identifier/did-jwt-vc} + * @public + */ +interface VerifiableCredential { + '@context': string[]; + id?: string; + type: string[]; + issuer: { + id: string; + [x: string]: any; + }; + issuanceDate: string; + expirationDate?: string; + credentialSubject: { + id?: string; + [x: string]: any; + }; + credentialStatus?: { + id: string; + type: string; + }; + proof: { + type?: string; + [x: string]: any; + }; + [x: string]: any; +} +/** + * Verifiable Presentation {@link https://github.com/decentralized-identifier/did-jwt-vc} + * @public + */ +interface VerifiablePresentation { + id?: string; + holder: string; + issuanceDate?: string; + expirationDate?: string; + '@context': string[]; + type: string[]; + verifier: string[]; + verifiableCredential: VerifiableCredential[]; + proof: { + type?: string; + [x: string]: any; + }; + [x: string]: any; +} +/** + * Message meta data + * @public + */ +interface IMetaData { + /** + * Type + */ + type: string; + /** + * Optional. Value + */ + value?: string; +} +/** + * DIDComm message + * @public + */ +interface IMessage { + /** + * Unique message ID + */ + id: string; + /** + * Message type + */ + type: string; + /** + * Optional. Creation date (ISO 8601) + */ + createdAt?: string; + /** + * Optional. Expiration date (ISO 8601) + */ + expiresAt?: string; + /** + * Optional. Thread ID + */ + threadId?: string; + /** + * Optional. Original message raw data + */ + raw?: string; + /** + * Optional. Parsed data + */ + data?: object | null; + /** + * Optional. List of DIDs to reply to + */ + replyTo?: string[]; + /** + * Optional. URL to post a reply message to + */ + replyUrl?: string; + /** + * Optional. Sender DID + */ + from?: string; + /** + * Optional. Recipient DID + */ + to?: string; + /** + * Optional. Array of message metadata + */ + metaData?: IMetaData[] | null; + /** + * Optional. Array of attached verifiable credentials + */ + credentials?: VerifiableCredential[]; + /** + * Optional. Array of attached verifiable presentations + */ + presentations?: VerifiablePresentation[]; +} + +/** + * Input arguments for {@link IDataStore.dataStoreSaveMessage | dataStoreSaveMessage} + * @public + */ +interface IDataStoreSaveMessageArgs { + /** + * Required. Message + */ + message: IMessage; +} +/** + * Input arguments for {@link IDataStore.dataStoreGetMessage | dataStoreGetMessage} + * @public + */ +interface IDataStoreGetMessageArgs { + /** + * Required. Message ID + */ + id: string; +} +/** + * Input arguments for {@link IDataStore.dataStoreSaveVerifiableCredential | dataStoreSaveVerifiableCredential} + * @public + */ +interface IDataStoreSaveVerifiableCredentialArgs { + /** + * Required. VerifiableCredential + */ + verifiableCredential: VerifiableCredential; +} +/** + * Input arguments for {@link IDataStore.dataStoreGetVerifiableCredential | dataStoreGetVerifiableCredential} + * @public + */ +interface IDataStoreGetVerifiableCredentialArgs { + /** + * Required. VerifiableCredential hash + */ + hash: string; +} +/** + * Input arguments for {@link IDataStore.dataStoreSaveVerifiablePresentation | dataStoreSaveVerifiablePresentation} + * @public + */ +interface IDataStoreSaveVerifiablePresentationArgs { + /** + * Required. VerifiablePresentation + */ + verifiablePresentation: VerifiablePresentation; +} +/** + * Input arguments for {@link IDataStore.dataStoreGetVerifiablePresentation | dataStoreGetVerifiablePresentation} + * @public + */ +interface IDataStoreGetVerifiablePresentationArgs { + /** + * Required. VerifiablePresentation hash + */ + hash: string; +} +/** + * Basic data store interface + * @public + */ +interface IDataStore extends IPluginMethodMap { + /** + * Saves message to the data store + * @param args - message + * @returns a promise that resolves to the id of the message + */ + dataStoreSaveMessage(args: IDataStoreSaveMessageArgs): Promise; + /** + * Gets message from the data store + * @param args - arguments for getting message + * @returns a promise that resolves to the message + */ + dataStoreGetMessage(args: IDataStoreGetMessageArgs): Promise; + /** + * Saves verifiable credential to the data store + * @param args - verifiable credential + * @returns a promise that resolves to the hash of the VerifiableCredential + */ + dataStoreSaveVerifiableCredential(args: IDataStoreSaveVerifiableCredentialArgs): Promise; + /** + * Gets verifiable credential from the data store + * @param args - arguments for getting verifiable credential + * @returns a promise that resolves to the verifiable credential + */ + dataStoreGetVerifiableCredential(args: IDataStoreGetVerifiableCredentialArgs): Promise; + /** + * Saves verifiable presentation to the data store + * @param args - verifiable presentation + * @returns a promise that resolves to the hash of the VerifiablePresentation + */ + dataStoreSaveVerifiablePresentation(args: IDataStoreSaveVerifiablePresentationArgs): Promise; + /** + * Gets verifiable presentation from the data store + * @param args - arguments for getting Verifiable Presentation + * @returns a promise that resolves to the Verifiable Presentation + */ + dataStoreGetVerifiablePresentation(args: IDataStoreGetVerifiablePresentationArgs): Promise; +} + +/** + * Identifier interface + * @public + */ +interface IIdentifier { + /** + * Decentralized identifier + */ + did: string; + /** + * Optional. Identifier alias. Can be used to reference an object in an external system + */ + alias?: string; + /** + * Identifier provider name + */ + provider: string; + /** + * Controller key id + */ + controllerKeyId?: string; + /** + * Array of managed keys + */ + keys: IKey[]; + /** + * Array of services + */ + services: IService[]; +} +/** + * Cryptographic key type + * @public + */ +declare type TKeyType = 'Ed25519' | 'Secp256k1'; +/** + * Cryptographic key + * @public + */ +interface IKey { + /** + * Key ID + */ + kid: string; + /** + * Key Management System + */ + kms: string; + /** + * Key type + */ + type: TKeyType; + /** + * Public key + */ + publicKeyHex: string; + /** + * Optional. Private key + */ + privateKeyHex?: string; + /** + * Optional. Key metadata. Can be used to store auth data to access remote kms + */ + meta?: object | null; +} +/** + * Identifier service + * @public + */ +interface IService { + /** + * ID + */ + id: string; + /** + * Service type + */ + type: string; + /** + * Endpoint URL + */ + serviceEndpoint: string; + /** + * Optional. Description + */ + description?: string; +} + +/** + * Input arguments for {@link IKeyManager.keyManagerCreate | keyManagerCreate} + * @public + */ +interface IKeyManagerCreateArgs { + /** + * Key type + */ + type: TKeyType; + /** + * Key Management System + */ + kms: string; + /** + * Optional. Key meta data + */ + meta?: object; +} +/** + * Input arguments for {@link IKeyManager.keyManagerGet | keyManagerGet} + * @public + */ +interface IKeyManagerGetArgs { + /** + * Key ID + */ + kid: string; +} +/** + * Input arguments for {@link IKeyManager.keyManagerDelete | keyManagerDelete} + * @public + */ +interface IKeyManagerDeleteArgs { + /** + * Key ID + */ + kid: string; +} +/** + * Input arguments for {@link IKeyManager.keyManagerEncryptJWE | keyManagerEncryptJWE} + * @beta + */ +interface IKeyManagerEncryptJWEArgs { + /** + * Key ID to use for encryption + */ + kid: string; + /** + * Recipient key object + */ + to: Omit; + /** + * Data to encrypt + */ + data: string; +} +/** + * Input arguments for {@link IKeyManager.keyManagerDecryptJWE | keyManagerDecryptJWE} + * @beta + */ +interface IKeyManagerDecryptJWEArgs { + /** + * Key ID + */ + kid: string; + /** + * Encrypted data + */ + data: string; +} +/** + * Input arguments for {@link IKeyManager.keyManagerSignJWT | keyManagerSignJWT} + * @public + */ +interface IKeyManagerSignJWTArgs { + /** + * Key ID + */ + kid: string; + /** + * Data to sign + */ + data: string | Uint8Array; +} +/** + * Input arguments for {@link IKeyManager.keyManagerSignEthTX | keyManagerSignEthTX} + * @public + */ +interface IKeyManagerSignEthTXArgs { + /** + * Key ID + */ + kid: string; + /** + * Ethereum transaction object + */ + transaction: object; +} +/** + * Key manager interface + * @public + */ +interface IKeyManager extends IPluginMethodMap { + /** + * Lists available key management systems + */ + keyManagerGetKeyManagementSystems(): Promise>; + /** + * Creates and returns a new key + */ + keyManagerCreate(args: IKeyManagerCreateArgs): Promise; + /** + * Returns an existing key + */ + keyManagerGet(args: IKeyManagerGetArgs): Promise; + /** + * Deletes a key + */ + keyManagerDelete(args: IKeyManagerDeleteArgs): Promise; + /** + * Imports a created key + */ + keyManagerImport(args: IKey): Promise; + /** + * Encrypts data + * @beta + */ + keyManagerEncryptJWE(args: IKeyManagerEncryptJWEArgs): Promise; + /** + * Decrypts data + * @beta + */ + keyManagerDecryptJWE(args: IKeyManagerDecryptJWEArgs): Promise; + /** + * Signs JWT + */ + keyManagerSignJWT(args: IKeyManagerSignJWTArgs): Promise; + /** Signs Ethereum transaction */ + keyManagerSignEthTX(args: IKeyManagerSignEthTXArgs): Promise; +} + +/** + * Input arguments for {@link IDIDManager.didManagerGet | didManagerGet} + * @public + */ +interface IDIDManagerGetArgs { + /** + * DID + */ + did: string; +} +/** + * Input arguments for {@link IDIDManager.didManagerFind | didManagerFind} + * @public + */ +interface IDIDManagerFindArgs { + /** + * Optional. Alias + */ + alias?: string; + /** + * Optional. Provider + */ + provider?: string; +} +/** + * Input arguments for {@link IDIDManager.didManagerGetByAlias | didManagerGetByAlias} + * @public + */ +interface IDIDManagerGetByAliasArgs { + /** + * Alias + */ + alias: string; + /** + * Optional provider + */ + provider?: string; +} +/** + * Input arguments for {@link IDIDManager.didManagerDelete | didManagerDelete} + * @public + */ +interface IDIDManagerDeleteArgs { + /** + * DID + */ + did: string; +} +/** + * Input arguments for {@link IDIDManager.didManagerCreate | didManagerCreate} + * @public + */ +interface IDIDManagerCreateArgs { + /** + * Optional. Identifier alias. Can be used to reference an object in an external system + */ + alias?: string; + /** + * Optional. Identifier provider + */ + provider?: string; + /** + * Optional. Key Management System + */ + kms?: string; + /** + * Optional. Identifier provider specific options + */ + options?: object; +} +/** + * Input arguments for {@link IDIDManager.didManagerSetAlias | didManagerSetAlias} + * @public + */ +interface IDIDManagerSetAliasArgs { + /** + * Required. DID + */ + did: string; + /** + * Required. Identifier alias + */ + alias: string; +} +/** + * Input arguments for {@link IDIDManager.didManagerGetOrCreate | didManagerGetOrCreate} + * @public + */ +interface IDIDManagerGetOrCreateArgs { + /** + * Identifier alias. Can be used to reference an object in an external system + */ + alias: string; + /** + * Optional. Identifier provider + */ + provider?: string; + /** + * Optional. Key Management System + */ + kms?: string; + /** + * Optional. Identifier provider specific options + */ + options?: object; +} +/** + * Input arguments for {@link IDIDManager.didManagerAddKey | didManagerAddKey} + * @public + */ +interface IDIDManagerAddKeyArgs { + /** + * DID + */ + did: string; + /** + * Key object + */ + key: IKey; + /** + * Optional. Identifier provider specific options + */ + options?: object; +} +/** + * Input arguments for {@link IDIDManager.didManagerRemoveKey | didManagerRemoveKey} + * @public + */ +interface IDIDManagerRemoveKeyArgs { + /** + * DID + */ + did: string; + /** + * Key ID + */ + kid: string; + /** + * Optional. Identifier provider specific options + */ + options?: object; +} +/** + * Input arguments for {@link IDIDManager.didManagerAddService | didManagerAddService} + * @public + */ +interface IDIDManagerAddServiceArgs { + /** + * DID + */ + did: string; + /** + * Service object + */ + service: IService; + /** + * Optional. Identifier provider specific options + */ + options?: object; +} +/** + * Input arguments for {@link IDIDManager.didManagerRemoveService | didManagerRemoveService} + * @public + */ +interface IDIDManagerRemoveServiceArgs { + /** + * DID + */ + did: string; + /** + * Service ID + */ + id: string; + /** + * Optional. Identifier provider specific options + */ + options?: object; +} +/** + * Identifier manager interface + * @public + */ +interface IDIDManager extends IPluginMethodMap { + /** + * Returns a list of available identifier providers + */ + didManagerGetProviders(): Promise>; + /** + * Returns a list of managed identifiers + * + * @param args - Required. Arguments to get the list of identifiers + * @param context - Execution context. Requires `agent` that has {@link @veramo/core#IKeyManager} methods + * + * @example + * ```typescript + * const aliceIdentifiers = await agent.didManagerFind({ + * alias: 'alice' + * }) + * + * const rinkebyIdentifiers = await agent.didManagerFind({ + * provider: 'did:ethr:rinkeby' + * }) + * ``` + */ + didManagerFind(args: IDIDManagerFindArgs): Promise>; + /** + * Returns a specific identifier + */ + didManagerGet(args: IDIDManagerGetArgs): Promise; + /** + * Returns a specific identifier by alias + * + * @param args - Required. Arguments to get the identifier + * @param context - Execution context. Requires `agent` that has {@link @veramo/core#IKeyManager} methods + * + * @example + * ```typescript + * const identifier = await agent.didManagerGetByAlias({ + * alias: 'alice', + * provider: 'did:ethr:rinkeby' + * }) + * ``` + */ + didManagerGetByAlias(args: IDIDManagerGetByAliasArgs): Promise; + /** + * Creates and returns a new identifier + * + * @param args - Required. Arguments to create the identifier + * @param context - Execution context. Requires `agent` that has {@link @veramo/core#IKeyManager} methods + * + * @example + * ```typescript + * const identifier = await agent.didManagerCreate({ + * alias: 'alice', + * provider: 'did:ethr:rinkeby', + * kms: 'local' + * }) + * ``` + */ + didManagerCreate(args: IDIDManagerCreateArgs, context: IAgentContext): Promise; + /** + * Sets identifier alias + * + * @param args - Required. Arguments to set identifier alias + * @param context - Execution context. Requires `agent` that has {@link @veramo/core#IKeyManager} methods + * + * @example + * ```typescript + * const identifier = await agent.didManagerCreate() + * const result = await agent.didManagerSetAlias({ + * did: identifier.did, + * alias: 'carol', + * }) + * ``` + */ + didManagerSetAlias(args: IDIDManagerSetAliasArgs, context: IAgentContext): Promise; + /** + * Returns an existing identifier or creates a new one for a specific alias + */ + didManagerGetOrCreate(args: IDIDManagerGetOrCreateArgs, context: IAgentContext): Promise; + /** + * Imports identifier + */ + didManagerImport(args: IIdentifier, context: IAgentContext): Promise; + /** + * Deletes identifier + */ + didManagerDelete(args: IDIDManagerDeleteArgs, context: IAgentContext): Promise; + /** + * Adds a key to a DID Document + * @returns identifier provider specific response. Can be txHash, etc, + */ + didManagerAddKey(args: IDIDManagerAddKeyArgs, context: IAgentContext): Promise; + /** + * Removes a key from a DID Document + * @returns identifier provider specific response. Can be txHash, etc, + */ + didManagerRemoveKey(args: IDIDManagerRemoveKeyArgs, context: IAgentContext): Promise; + /** + * Adds a service to a DID Document + * @returns identifier provider specific response. Can be txHash, etc, + */ + didManagerAddService(args: IDIDManagerAddServiceArgs, context: IAgentContext): Promise; + /** + * Removes a service from a DID Document + * @returns identifier provider specific response. Can be txHash, etc, + */ + didManagerRemoveService(args: IDIDManagerRemoveServiceArgs, context: IAgentContext): Promise; +} + +/** + * Input arguments for {@link IMessageHandler.handleMessage | handleMessage} + * @public + */ +interface IHandleMessageArgs { + /** + * Raw message data + */ + raw: string; + /** + * Optional. Message meta data + */ + metaData?: IMetaData[]; + /** + * Optional. If set to `true`, the message will be saved using {@link IDataStore.dataStoreSaveMessage | dataStoreSaveMessage} + */ + save?: boolean; +} +/** + * Message handler interface + * @public + */ +interface IMessageHandler extends IPluginMethodMap { + /** + * Parses and optionally saves a message + * @param context - Execution context. Requires agent with {@link @veramo/core#IDataStore} methods + */ + handleMessage(args: IHandleMessageArgs, context: IAgentContext): Promise; +} + +declare type Extensible = Record; +interface DIDResolutionResult { + '@context'?: 'https://w3id.org/did-resolution/v1' | string | string[]; + didResolutionMetadata: DIDResolutionMetadata; + didDocument: DIDDocument | null; + didDocumentMetadata: DIDDocumentMetadata; +} +interface DIDResolutionOptions extends Extensible { + accept?: string; +} +interface DIDResolutionMetadata extends Extensible { + contentType?: string; + error?: 'invalidDid' | 'notFound' | 'representationNotSupported' | 'unsupportedDidMethod' | string; +} +interface DIDDocumentMetadata extends Extensible { + created?: string; + updated?: string; + deactivated?: boolean; + versionId?: string; + nextUpdate?: string; + nextVersionId?: string; + equivalentId?: string; + canonicalId?: string; +} +declare type KeyCapabilitySection = 'authentication' | 'assertionMethod' | 'keyAgreement' | 'capabilityInvocation' | 'capabilityDelegation'; +declare type DIDDocument = { + '@context'?: 'https://www.w3.org/ns/did/v1' | string | string[]; + id: string; + alsoKnownAs?: string[]; + controller?: string | string[]; + verificationMethod?: VerificationMethod[]; + service?: ServiceEndpoint[]; + /** + * @deprecated + */ + publicKey?: VerificationMethod[]; +} & { + [x in KeyCapabilitySection]?: (string | VerificationMethod)[]; +}; +interface ServiceEndpoint { + id: string; + type: string; + serviceEndpoint: string; + description?: string; +} +/** + * Encapsulates a JSON web key type that includes only the public properties that + * can be used in DID documents. + * + * The private properties are intentionally omitted to discourage the use + * (and accidental disclosure) of private keys in DID documents. + */ +interface JsonWebKey extends Extensible { + alg?: string; + crv?: string; + e?: string; + ext?: boolean; + key_ops?: string[]; + kid?: string; + kty: string; + n?: string; + use?: string; + x?: string; + y?: string; +} +interface VerificationMethod { + id: string; + type: string; + controller: string; + publicKeyBase58?: string; + publicKeyBase64?: string; + publicKeyJwk?: JsonWebKey; + publicKeyHex?: string; + publicKeyMultibase?: string; + blockchainAccountId?: string; + ethereumAddress?: string; +} + +/** + * Input arguments for {@link IResolver.resolveDid | resolveDid} + * @public + */ +interface ResolveDidArgs { + /** + * DID URL + * + * @example + * `did:web:uport.me` + */ + didUrl: string; + /** + * DID resolution options that will be passed to the method specific resolver. + * See: https://w3c.github.io/did-spec-registries/#did-resolution-input-metadata + * See: https://www.w3.org/TR/did-core/#did-resolution-options + */ + options?: DIDResolutionOptions; +} +/** + * DID Resolver interface + * @public + */ +interface IResolver extends IPluginMethodMap { + /** + * Resolves DID and returns DID Document + * + * @example + * ```typescript + * const doc = await agent.resolveDid({ + * didUrl: 'did:ethr:rinkeby:0xb09b66026ba5909a7cfe99b76875431d2b8d5190' + * }) + * expect(doc.didDocument).toEqual({ + * '@context': [ + * 'https://www.w3.org/ns/did/v1', + * 'https://identity.foundation/EcdsaSecp256k1RecoverySignature2020/lds-ecdsa-secp256k1-recovery2020-0.0.jsonld', + * ], + * id: 'did:ethr:rinkeby:0xb09b66026ba5909a7cfe99b76875431d2b8d5190', + * verificationMethod: [ + * { + * id: 'did:ethr:rinkeby:0xb09b66026ba5909a7cfe99b76875431d2b8d5190#controller', + * type: 'EcdsaSecp256k1RecoveryMethod2020', + * controller: 'did:ethr:rinkeby:0xb09b66026ba5909a7cfe99b76875431d2b8d5190', + * blockchainAccountId: '0xb09B66026bA5909A7CFE99b76875431D2b8D5190@eip155:4', + * }, + * ], + * authentication: ['did:ethr:rinkeby:0xb09b66026ba5909a7cfe99b76875431d2b8d5190#controller'], + * assertionMethod: ['did:ethr:rinkeby:0xb09b66026ba5909a7cfe99b76875431d2b8d5190#controller'], + * }) + * ``` + * + * @param args - Input arguments for resolving a DID + * @public + */ + 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 + */ +declare abstract class AbstractIdentifierProvider { + abstract createIdentifier(args: { + kms?: string; + alias?: string; + options?: any; + }, context: IAgentContext): Promise>; + abstract deleteIdentifier(args: IIdentifier, context: IAgentContext): Promise; + abstract addKey(args: { + identifier: IIdentifier; + key: IKey; + options?: any; + }, context: IAgentContext): Promise; + abstract removeKey(args: { + identifier: IIdentifier; + kid: string; + options?: any; + }, context: IAgentContext): Promise; + abstract addService(args: { + identifier: IIdentifier; + service: IService; + options?: any; + }, context: IAgentContext): Promise; + abstract removeService(args: { + identifier: IIdentifier; + id: string; + options?: any; + }, 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 +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ + + +declare global { + namespace Reflect { + /** + * Applies a set of decorators to a target object. + * @param decorators An array of decorators. + * @param target The target object. + * @returns The result of applying the provided decorators. + * @remarks Decorators are applied in reverse order of their positions in the array. + * @example + * + * class Example { } + * + * // constructor + * Example = Reflect.decorate(decoratorsArray, Example); + * + */ + function decorate(decorators: ClassDecorator[], target: Function): Function; + /** + * Applies a set of decorators to a property of a target object. + * @param decorators An array of decorators. + * @param target The target object. + * @param propertyKey The property key to decorate. + * @param attributes A property descriptor. + * @remarks Decorators are applied in reverse order. + * @example + * + * class Example { + * // property declarations are not part of ES6, though they are valid in TypeScript: + * // static staticProperty; + * // property; + * + * static staticMethod() { } + * method() { } + * } + * + * // property (on constructor) + * Reflect.decorate(decoratorsArray, Example, "staticProperty"); + * + * // property (on prototype) + * Reflect.decorate(decoratorsArray, Example.prototype, "property"); + * + * // method (on constructor) + * Object.defineProperty(Example, "staticMethod", + * Reflect.decorate(decoratorsArray, Example, "staticMethod", + * Object.getOwnPropertyDescriptor(Example, "staticMethod"))); + * + * // method (on prototype) + * Object.defineProperty(Example.prototype, "method", + * Reflect.decorate(decoratorsArray, Example.prototype, "method", + * Object.getOwnPropertyDescriptor(Example.prototype, "method"))); + * + */ + function decorate(decorators: (PropertyDecorator | MethodDecorator)[], target: Object, propertyKey: string | symbol, attributes?: PropertyDescriptor): PropertyDescriptor; + /** + * A default metadata decorator factory that can be used on a class, class member, or parameter. + * @param metadataKey The key for the metadata entry. + * @param metadataValue The value for the metadata entry. + * @returns A decorator function. + * @remarks + * If `metadataKey` is already defined for the target and target key, the + * metadataValue for that key will be overwritten. + * @example + * + * // constructor + * @Reflect.metadata(key, value) + * class Example { + * } + * + * // property (on constructor, TypeScript only) + * class Example { + * @Reflect.metadata(key, value) + * static staticProperty; + * } + * + * // property (on prototype, TypeScript only) + * class Example { + * @Reflect.metadata(key, value) + * property; + * } + * + * // method (on constructor) + * class Example { + * @Reflect.metadata(key, value) + * static staticMethod() { } + * } + * + * // method (on prototype) + * class Example { + * @Reflect.metadata(key, value) + * method() { } + * } + * + */ + function metadata(metadataKey: any, metadataValue: any): { + (target: Function): void; + (target: Object, propertyKey: string | symbol): void; + }; + /** + * Define a unique metadata entry on the target. + * @param metadataKey A key used to store and retrieve metadata. + * @param metadataValue A value that contains attached metadata. + * @param target The target object on which to define metadata. + * @example + * + * class Example { + * } + * + * // constructor + * Reflect.defineMetadata("custom:annotation", options, Example); + * + * // decorator factory as metadata-producing annotation. + * function MyAnnotation(options): ClassDecorator { + * return target => Reflect.defineMetadata("custom:annotation", options, target); + * } + * + */ + function defineMetadata(metadataKey: any, metadataValue: any, target: Object): void; + /** + * Define a unique metadata entry on the target. + * @param metadataKey A key used to store and retrieve metadata. + * @param metadataValue A value that contains attached metadata. + * @param target The target object on which to define metadata. + * @param propertyKey The property key for the target. + * @example + * + * class Example { + * // property declarations are not part of ES6, though they are valid in TypeScript: + * // static staticProperty; + * // property; + * + * static staticMethod(p) { } + * method(p) { } + * } + * + * // property (on constructor) + * Reflect.defineMetadata("custom:annotation", Number, Example, "staticProperty"); + * + * // property (on prototype) + * Reflect.defineMetadata("custom:annotation", Number, Example.prototype, "property"); + * + * // method (on constructor) + * Reflect.defineMetadata("custom:annotation", Number, Example, "staticMethod"); + * + * // method (on prototype) + * Reflect.defineMetadata("custom:annotation", Number, Example.prototype, "method"); + * + * // decorator factory as metadata-producing annotation. + * function MyAnnotation(options): PropertyDecorator { + * return (target, key) => Reflect.defineMetadata("custom:annotation", options, target, key); + * } + * + */ + function defineMetadata(metadataKey: any, metadataValue: any, target: Object, propertyKey: string | symbol): void; + /** + * Gets a value indicating whether the target object or its prototype chain has the provided metadata key defined. + * @param metadataKey A key used to store and retrieve metadata. + * @param target The target object on which the metadata is defined. + * @returns `true` if the metadata key was defined on the target object or its prototype chain; otherwise, `false`. + * @example + * + * class Example { + * } + * + * // constructor + * result = Reflect.hasMetadata("custom:annotation", Example); + * + */ + function hasMetadata(metadataKey: any, target: Object): boolean; + /** + * Gets a value indicating whether the target object or its prototype chain has the provided metadata key defined. + * @param metadataKey A key used to store and retrieve metadata. + * @param target The target object on which the metadata is defined. + * @param propertyKey The property key for the target. + * @returns `true` if the metadata key was defined on the target object or its prototype chain; otherwise, `false`. + * @example + * + * class Example { + * // property declarations are not part of ES6, though they are valid in TypeScript: + * // static staticProperty; + * // property; + * + * static staticMethod(p) { } + * method(p) { } + * } + * + * // property (on constructor) + * result = Reflect.hasMetadata("custom:annotation", Example, "staticProperty"); + * + * // property (on prototype) + * result = Reflect.hasMetadata("custom:annotation", Example.prototype, "property"); + * + * // method (on constructor) + * result = Reflect.hasMetadata("custom:annotation", Example, "staticMethod"); + * + * // method (on prototype) + * result = Reflect.hasMetadata("custom:annotation", Example.prototype, "method"); + * + */ + function hasMetadata(metadataKey: any, target: Object, propertyKey: string | symbol): boolean; + /** + * Gets a value indicating whether the target object has the provided metadata key defined. + * @param metadataKey A key used to store and retrieve metadata. + * @param target The target object on which the metadata is defined. + * @returns `true` if the metadata key was defined on the target object; otherwise, `false`. + * @example + * + * class Example { + * } + * + * // constructor + * result = Reflect.hasOwnMetadata("custom:annotation", Example); + * + */ + function hasOwnMetadata(metadataKey: any, target: Object): boolean; + /** + * Gets a value indicating whether the target object has the provided metadata key defined. + * @param metadataKey A key used to store and retrieve metadata. + * @param target The target object on which the metadata is defined. + * @param propertyKey The property key for the target. + * @returns `true` if the metadata key was defined on the target object; otherwise, `false`. + * @example + * + * class Example { + * // property declarations are not part of ES6, though they are valid in TypeScript: + * // static staticProperty; + * // property; + * + * static staticMethod(p) { } + * method(p) { } + * } + * + * // property (on constructor) + * result = Reflect.hasOwnMetadata("custom:annotation", Example, "staticProperty"); + * + * // property (on prototype) + * result = Reflect.hasOwnMetadata("custom:annotation", Example.prototype, "property"); + * + * // method (on constructor) + * result = Reflect.hasOwnMetadata("custom:annotation", Example, "staticMethod"); + * + * // method (on prototype) + * result = Reflect.hasOwnMetadata("custom:annotation", Example.prototype, "method"); + * + */ + function hasOwnMetadata(metadataKey: any, target: Object, propertyKey: string | symbol): boolean; + /** + * Gets the metadata value for the provided metadata key on the target object or its prototype chain. + * @param metadataKey A key used to store and retrieve metadata. + * @param target The target object on which the metadata is defined. + * @returns The metadata value for the metadata key if found; otherwise, `undefined`. + * @example + * + * class Example { + * } + * + * // constructor + * result = Reflect.getMetadata("custom:annotation", Example); + * + */ + function getMetadata(metadataKey: any, target: Object): any; + /** + * Gets the metadata value for the provided metadata key on the target object or its prototype chain. + * @param metadataKey A key used to store and retrieve metadata. + * @param target The target object on which the metadata is defined. + * @param propertyKey The property key for the target. + * @returns The metadata value for the metadata key if found; otherwise, `undefined`. + * @example + * + * class Example { + * // property declarations are not part of ES6, though they are valid in TypeScript: + * // static staticProperty; + * // property; + * + * static staticMethod(p) { } + * method(p) { } + * } + * + * // property (on constructor) + * result = Reflect.getMetadata("custom:annotation", Example, "staticProperty"); + * + * // property (on prototype) + * result = Reflect.getMetadata("custom:annotation", Example.prototype, "property"); + * + * // method (on constructor) + * result = Reflect.getMetadata("custom:annotation", Example, "staticMethod"); + * + * // method (on prototype) + * result = Reflect.getMetadata("custom:annotation", Example.prototype, "method"); + * + */ + function getMetadata(metadataKey: any, target: Object, propertyKey: string | symbol): any; + /** + * Gets the metadata value for the provided metadata key on the target object. + * @param metadataKey A key used to store and retrieve metadata. + * @param target The target object on which the metadata is defined. + * @returns The metadata value for the metadata key if found; otherwise, `undefined`. + * @example + * + * class Example { + * } + * + * // constructor + * result = Reflect.getOwnMetadata("custom:annotation", Example); + * + */ + function getOwnMetadata(metadataKey: any, target: Object): any; + /** + * Gets the metadata value for the provided metadata key on the target object. + * @param metadataKey A key used to store and retrieve metadata. + * @param target The target object on which the metadata is defined. + * @param propertyKey The property key for the target. + * @returns The metadata value for the metadata key if found; otherwise, `undefined`. + * @example + * + * class Example { + * // property declarations are not part of ES6, though they are valid in TypeScript: + * // static staticProperty; + * // property; + * + * static staticMethod(p) { } + * method(p) { } + * } + * + * // property (on constructor) + * result = Reflect.getOwnMetadata("custom:annotation", Example, "staticProperty"); + * + * // property (on prototype) + * result = Reflect.getOwnMetadata("custom:annotation", Example.prototype, "property"); + * + * // method (on constructor) + * result = Reflect.getOwnMetadata("custom:annotation", Example, "staticMethod"); + * + * // method (on prototype) + * result = Reflect.getOwnMetadata("custom:annotation", Example.prototype, "method"); + * + */ + function getOwnMetadata(metadataKey: any, target: Object, propertyKey: string | symbol): any; + /** + * Gets the metadata keys defined on the target object or its prototype chain. + * @param target The target object on which the metadata is defined. + * @returns An array of unique metadata keys. + * @example + * + * class Example { + * } + * + * // constructor + * result = Reflect.getMetadataKeys(Example); + * + */ + function getMetadataKeys(target: Object): any[]; + /** + * Gets the metadata keys defined on the target object or its prototype chain. + * @param target The target object on which the metadata is defined. + * @param propertyKey The property key for the target. + * @returns An array of unique metadata keys. + * @example + * + * class Example { + * // property declarations are not part of ES6, though they are valid in TypeScript: + * // static staticProperty; + * // property; + * + * static staticMethod(p) { } + * method(p) { } + * } + * + * // property (on constructor) + * result = Reflect.getMetadataKeys(Example, "staticProperty"); + * + * // property (on prototype) + * result = Reflect.getMetadataKeys(Example.prototype, "property"); + * + * // method (on constructor) + * result = Reflect.getMetadataKeys(Example, "staticMethod"); + * + * // method (on prototype) + * result = Reflect.getMetadataKeys(Example.prototype, "method"); + * + */ + function getMetadataKeys(target: Object, propertyKey: string | symbol): any[]; + /** + * Gets the unique metadata keys defined on the target object. + * @param target The target object on which the metadata is defined. + * @returns An array of unique metadata keys. + * @example + * + * class Example { + * } + * + * // constructor + * result = Reflect.getOwnMetadataKeys(Example); + * + */ + function getOwnMetadataKeys(target: Object): any[]; + /** + * Gets the unique metadata keys defined on the target object. + * @param target The target object on which the metadata is defined. + * @param propertyKey The property key for the target. + * @returns An array of unique metadata keys. + * @example + * + * class Example { + * // property declarations are not part of ES6, though they are valid in TypeScript: + * // static staticProperty; + * // property; + * + * static staticMethod(p) { } + * method(p) { } + * } + * + * // property (on constructor) + * result = Reflect.getOwnMetadataKeys(Example, "staticProperty"); + * + * // property (on prototype) + * result = Reflect.getOwnMetadataKeys(Example.prototype, "property"); + * + * // method (on constructor) + * result = Reflect.getOwnMetadataKeys(Example, "staticMethod"); + * + * // method (on prototype) + * result = Reflect.getOwnMetadataKeys(Example.prototype, "method"); + * + */ + function getOwnMetadataKeys(target: Object, propertyKey: string | symbol): any[]; + /** + * Deletes the metadata entry from the target object with the provided key. + * @param metadataKey A key used to store and retrieve metadata. + * @param target The target object on which the metadata is defined. + * @returns `true` if the metadata entry was found and deleted; otherwise, false. + * @example + * + * class Example { + * } + * + * // constructor + * result = Reflect.deleteMetadata("custom:annotation", Example); + * + */ + function deleteMetadata(metadataKey: any, target: Object): boolean; + /** + * Deletes the metadata entry from the target object with the provided key. + * @param metadataKey A key used to store and retrieve metadata. + * @param target The target object on which the metadata is defined. + * @param propertyKey The property key for the target. + * @returns `true` if the metadata entry was found and deleted; otherwise, false. + * @example + * + * class Example { + * // property declarations are not part of ES6, though they are valid in TypeScript: + * // static staticProperty; + * // property; + * + * static staticMethod(p) { } + * method(p) { } + * } + * + * // property (on constructor) + * result = Reflect.deleteMetadata("custom:annotation", Example, "staticProperty"); + * + * // property (on prototype) + * result = Reflect.deleteMetadata("custom:annotation", Example.prototype, "property"); + * + * // method (on constructor) + * result = Reflect.deleteMetadata("custom:annotation", Example, "staticMethod"); + * + * // method (on prototype) + * result = Reflect.deleteMetadata("custom:annotation", Example.prototype, "method"); + * + */ + function deleteMetadata(metadataKey: any, target: Object, propertyKey: string | symbol): boolean; + } +} + +interface Order { + column: TColumns; + direction: 'ASC' | 'DESC'; +} +interface Where { + column: TColumns; + value?: string[]; + not?: boolean; + op?: 'LessThan' | 'LessThanOrEqual' | 'MoreThan' | 'MoreThanOrEqual' | 'Equal' | 'Like' | 'Between' | 'In' | 'Any' | 'IsNull'; +} +interface FindArgs { + where?: Where[]; + order?: Order[]; + take?: number; + skip?: number; +} +declare type TIdentifiersColumns = 'did' | 'alias' | 'provider'; +declare type TMessageColumns = 'from' | 'to' | 'id' | 'createdAt' | 'expiresAt' | 'threadId' | 'type' | 'raw' | 'replyTo' | 'replyUrl'; +declare type TCredentialColumns = 'context' | 'type' | 'id' | 'issuer' | 'subject' | 'expirationDate' | 'issuanceDate'; +declare type TClaimsColumns = 'context' | 'credentialType' | 'type' | 'value' | 'isObj' | 'id' | 'issuer' | 'subject' | 'expirationDate' | 'issuanceDate'; +declare type TPresentationColumns = 'context' | 'type' | 'id' | 'holder' | 'verifier' | 'expirationDate' | 'issuanceDate'; + +interface IContext$1 { + authenticatedDid?: string; +} +interface UniqueVerifiableCredential { + hash: string; + verifiableCredential: VerifiableCredential; +} +interface UniqueVerifiablePresentation { + hash: string; + verifiablePresentation: VerifiablePresentation; +} +declare type FindIdentifiersArgs = FindArgs; +declare type FindMessagesArgs = FindArgs; +declare type FindClaimsArgs = FindArgs; +declare type FindCredentialsArgs = FindArgs; +declare type FindPresentationsArgs = FindArgs; +declare type PartialIdentifier = Partial; +interface IDataStoreORM extends IPluginMethodMap { + dataStoreORMGetIdentifiers(args: FindIdentifiersArgs, context: IContext$1): Promise>; + dataStoreORMGetIdentifiersCount(args: FindIdentifiersArgs, context: IContext$1): Promise; + dataStoreORMGetMessages(args: FindMessagesArgs, context: IContext$1): Promise>; + dataStoreORMGetMessagesCount(args: FindMessagesArgs, context: IContext$1): Promise; + dataStoreORMGetVerifiableCredentialsByClaims(args: FindClaimsArgs, context: IContext$1): Promise>; + dataStoreORMGetVerifiableCredentialsByClaimsCount(args: FindClaimsArgs, context: IContext$1): Promise; + dataStoreORMGetVerifiableCredentials(args: FindCredentialsArgs, context: IContext$1): Promise>; + dataStoreORMGetVerifiableCredentialsCount(args: FindCredentialsArgs, context: IContext$1): Promise; + dataStoreORMGetVerifiablePresentations(args: FindPresentationsArgs, context: IContext$1): Promise>; + dataStoreORMGetVerifiablePresentationsCount(args: FindPresentationsArgs, context: IContext$1): Promise; +} + +/** + * The type of encoding to be used for the Verifiable Credential or Presentation to be generated. + * + * Only `jwt` is supported at the moment. + * + * @public + */ +declare type EncodingFormat = 'jwt'; +/** + * Encapsulates the parameters required to create a + * {@link https://www.w3.org/TR/vc-data-model/#presentations | W3C Verifiable Presentation} + * + * @public + */ +interface ICreateVerifiablePresentationArgs { + /** + * The json payload of the Presentation according to the + * {@link https://www.w3.org/TR/vc-data-model/#presentations | canonical model}. + * + * The signer of the Presentation is chosen based on the `holder` property + * of the `presentation` + * + * '@context', 'type' and 'issuanceDate' will be added automatically if omitted + */ + presentation: { + id?: string; + holder: string; + issuanceDate?: string; + expirationDate?: string; + '@context'?: string[]; + type?: string[]; + verifier: string[]; + verifiableCredential: VerifiableCredential[]; + [x: string]: any; + }; + /** + * If this parameter is true, the resulting VerifiablePresentation is sent to the + * {@link @veramo/core#IDataStore | storage plugin} to be saved + */ + save?: boolean; + /** + * The desired format for the VerifiablePresentation to be created. + * Currently, only JWT is supported + */ + proofFormat: EncodingFormat; + /** + * Remove payload members during JWT-JSON transformation. Defaults to `true`. + * See https://www.w3.org/TR/vc-data-model/#jwt-encoding + */ + removeOriginalFields?: boolean; +} +/** + * Encapsulates the parameters required to create a + * {@link https://www.w3.org/TR/vc-data-model/#credentials | W3C Verifiable Credential} + * + * @public + */ +interface ICreateVerifiableCredentialArgs { + /** + * The json payload of the Credential according to the + * {@link https://www.w3.org/TR/vc-data-model/#credentials | canonical model} + * + * The signer of the Credential is chosen based on the `issuer.id` property + * of the `credential` + * + * '@context', 'type' and 'issuanceDate' will be added automatically if omitted + */ + credential: { + '@context'?: string[]; + id?: string; + type?: string[]; + issuer: { + id: string; + [x: string]: any; + }; + issuanceDate?: string; + expirationDate?: string; + credentialSubject: { + id?: string; + [x: string]: any; + }; + credentialStatus?: { + id: string; + type: string; + }; + [x: string]: any; + }; + /** + * If this parameter is true, the resulting VerifiablePresentation is sent to the + * {@link @veramo/core#IDataStore | storage plugin} to be saved + */ + save?: boolean; + /** + * The desired format for the VerifiablePresentation to be created. + * Currently, only JWT is supported + */ + proofFormat: EncodingFormat; + /** + * Remove payload members during JWT-JSON transformation. Defaults to `true`. + * See https://www.w3.org/TR/vc-data-model/#jwt-encoding + */ + removeOriginalFields?: boolean; +} +/** + * The interface definition for a plugin that can generate Verifiable Credentials and Presentations + * + * @remarks Please see {@link https://www.w3.org/TR/vc-data-model | W3C Verifiable Credentials data model} + * + * @public + */ +interface ICredentialIssuer extends IPluginMethodMap { + /** + * Creates a Verifiable Presentation. + * The payload, signer and format are chosen based on the `args` parameter. + * + * @param args - Arguments necessary to create the Presentation. + * @param context - This reserved param is automatically added and handled by the framework, *do not override* + * + * @returns - a promise that resolves to the {@link @veramo/core#VerifiablePresentation} that was requested or rejects with an error + * if there was a problem with the input or while getting the key to sign + * + * @remarks Please see {@link https://www.w3.org/TR/vc-data-model/#presentations | Verifiable Presentation data model } + */ + createVerifiablePresentation(args: ICreateVerifiablePresentationArgs, context: IContext): Promise; + /** + * Creates a Verifiable Credential. + * The payload, signer and format are chosen based on the `args` parameter. + * + * @param args - Arguments necessary to create the Presentation. + * @param context - This reserved param is automatically added and handled by the framework, *do not override* + * + * @returns - a promise that resolves to the {@link @veramo/core#VerifiableCredential} that was requested or rejects with an error + * if there was a problem with the input or while getting the key to sign + * + * @remarks Please see {@link https://www.w3.org/TR/vc-data-model/#credentials | Verifiable Credential data model} + */ + createVerifiableCredential(args: ICreateVerifiableCredentialArgs, context: IContext): Promise; +} +/** + * Represents the requirements that this plugin has. + * The agent that is using this plugin is expected to provide these methods. + * + * This interface can be used for static type checks, to make sure your application is properly initialized. + */ +declare type IContext = IAgentContext & Pick & Pick>; + +/** + * Used for requesting Credentials using Selective Disclosure. + * Represents an accepted issuer of a credential. + * + * @beta + */ +interface Issuer { + /** + * The DID of the issuer of a requested credential. + */ + did: string; + /** + * A URL where a credential of that type can be obtained. + */ + url: string; +} +/** + * Represents the Selective Disclosure request parameters. + * + * @remarks See {@link https://github.com/uport-project/specs/blob/develop/messages/sharereq.md | Selective Disclosure Request} + * + * @beta + */ +interface ISelectiveDisclosureRequest { + /** + * The issuer of the request + */ + issuer: string; + /** + * The target of the request + */ + subject?: string; + /** + * The URL where the response should be sent back + */ + replyUrl?: string; + tag?: string; + /** + * A list of claims that are being requested + */ + claims: ICredentialRequestInput[]; + /** + * A list of issuer credentials that the target will use to establish trust + */ + credentials?: string[]; +} +/** + * Describes a particular credential that is being requested + * + * @remarks See {@link https://github.com/uport-project/specs/blob/develop/messages/sharereq.md | Selective Disclosure Request} + * + * @beta + */ +interface ICredentialRequestInput { + /** + * Motive for requiring this credential. + */ + reason?: string; + /** + * If it is essential. A response that does not include this credential is not sufficient. + */ + essential?: boolean; + /** + * The credential type. See {@link https://www.w3.org/TR/vc-data-model/#types | W3C Credential Types} + */ + credentialType?: string; + /** + * The credential context. See {@link https://www.w3.org/TR/vc-data-model/#contexts | W3C Credential Context} + */ + credentialContext?: string; + /** + * The name of the claim property that the credential should express. + */ + claimType: string; + /** + * The value of the claim that the credential should express. + */ + claimValue?: string; + /** + * A list of accepted Issuers for this credential. + */ + issuers?: Issuer[]; +} +/** + * The credentials that make up a response of a Selective Disclosure + * + * @remarks See {@link https://github.com/uport-project/specs/blob/develop/messages/sharereq.md | Selective Disclosure Request} + * + * @beta + */ +interface ICredentialsForSdr extends ICredentialRequestInput { + credentials: VerifiableCredential[]; +} +/** + * The result of a selective disclosure response validation. + * + * @beta + */ +interface IPresentationValidationResult { + valid: boolean; + claims: ICredentialsForSdr[]; +} +/** + * Contains the parameters of a Selective Disclosure Request. + * + * @remarks See {@link https://github.com/uport-project/specs/blob/develop/messages/sharereq.md | Selective Disclosure Request} + * specs + * + * @beta + */ +interface ICreateSelectiveDisclosureRequestArgs { + data: ISelectiveDisclosureRequest; +} +/** + * Encapsulates the params needed to gather credentials to fulfill a Selective disclosure request. + * + * @remarks See {@link https://github.com/uport-project/specs/blob/develop/messages/sharereq.md | Selective Disclosure Request} + * specs + * + * @beta + */ +interface IGetVerifiableCredentialsForSdrArgs { + /** + * The Selective Disclosure Request (issuer is omitted) + */ + sdr: Omit; + /** + * The DID of the subject + */ + did?: string; +} +/** + * A tuple used to verify a Selective Disclosure Response. + * Encapsulates the response(`presentation`) and the corresponding request (`sdr`) that made it. + * + * @beta + */ +interface IValidatePresentationAgainstSdrArgs { + presentation: VerifiablePresentation; + sdr: ISelectiveDisclosureRequest; +} +/** + * Profile data + * + * @beta + */ +interface ICreateProfileCredentialsArgs { + /** + * Holder DID + */ + holder: string; + /** + * Optional. Verifier DID + */ + verifier?: string; + /** + * Optional. Name + */ + name?: string; + /** + * Optional. Picture URL + */ + picture?: string; + /** + * Optional. URL + */ + url?: string; + /** + * Save presentation + */ + save: boolean; + /** + * Send presentation + */ + send: boolean; +} +/** + * Describes the interface of a Selective Disclosure plugin. + * + * @remarks See {@link https://github.com/uport-project/specs/blob/develop/messages/sharereq.md | Selective Disclosure Request} + * + * @beta + */ +interface ISelectiveDisclosure extends IPluginMethodMap { + createSelectiveDisclosureRequest(args: ICreateSelectiveDisclosureRequestArgs, context: IAgentContext): Promise; + getVerifiableCredentialsForSdr(args: IGetVerifiableCredentialsForSdrArgs, context: IAgentContext): Promise>; + validatePresentationAgainstSdr(args: IValidatePresentationAgainstSdrArgs, context: IAgentContext<{}>): Promise; + createProfilePresentation(args: ICreateProfileCredentialsArgs, context: IAgentContext): Promise; +} + +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; +} + +declare type PluginMap = IDIDManager & IKeyManager & IResolver & IMessageHandler & ISelectiveDisclosure & ICredentialIssuer; +declare type ProviderData = Omit[0], 'defaultKms'>; +declare class Veramo { + agent: TAgent; + providers: Record; + defaultKms: string; + providersData: Record; + constructor(store: Store, keyWallet: KeyWallet, providersData: Record); + getProvider(name: string): AbstractIdentifierProvider; +} + +declare type CanBePromise = Promise | T; +declare type TypedArray = Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array | BigInt64Array | BigUint64Array; +declare type KeyLike = Uint8Array; + +declare type Resource$1 = WalletComponents.Schemas.Resource & WalletComponents.Schemas.ResourceId & { + identity?: WalletComponents.Schemas.ObjectResource['identity']; +} & { + parentResource?: WalletComponents.Schemas.ObjectResource['parentResource']; +}; +declare type Identity = IIdentifier; +interface BaseWalletModel { + resources: { + [id: string]: Resource$1; + }; + identities: { + [did: string]: Identity; + }; +} +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; +} + +declare type ToastType = 'info' | 'success' | 'warning' | 'error'; +interface ToastOptions { + message: string; + type?: ToastType; + details?: string; + timeout?: number; +} +interface Toast { + show: (toast: ToastOptions) => void; + close: (toastId: string) => void; +} + +interface Validation { + validated: boolean; + errors: Error[]; +} +declare type Resource = WalletComponents.Schemas.Resource; +declare type Validator = (resource: T, veramo: Veramo) => Promise; +declare class ResourceValidator { + protected validators: { + [key: string]: Validator | undefined; + }; + constructor(); + private initValidators; + private setValidator; + validate(resource: Resource, veramo: Veramo): Promise; +} + +interface WalletFunctionMetadata { + name: string; + description?: string; + call: string; + scopes?: string[]; +} + +interface Wallet { + call: (functionMetadata: WalletFunctionMetadata) => Promise; + getResources: () => Promise; + getIdentities: () => Promise; + deleteResource: (id: string) => Promise; + deleteIdentity: (did: string) => Promise; + wipe: () => Promise; + identityList(queryParameters: WalletPaths.IdentityList.QueryParameters): Promise; + identityCreate(requestBody: WalletPaths.IdentityCreate.RequestBody): Promise; + identitySelect(queryParameters: WalletPaths.IdentitySelect.QueryParameters): Promise; + identitySign(pathParameters: WalletPaths.IdentitySign.PathParameters, requestBody: WalletPaths.IdentitySign.RequestBody): Promise; + identityInfo(pathParameters: WalletPaths.IdentityInfo.PathParameters): Promise; + identityDeployTransaction(pathParameters: WalletPaths.IdentityDeployTransaction.PathParameters, requestBody: WalletPaths.IdentityDeployTransaction.RequestBody): Promise; + resourceList(queryParameters: WalletPaths.ResourceList.QueryParameters): Promise; + resourceCreate(requestBody: WalletPaths.ResourceCreate.RequestBody): Promise; + selectiveDisclosure(pathParameters: WalletPaths.SelectiveDisclosure.PathParameters): Promise; + transactionDeploy(requestBody: WalletPaths.TransactionDeploy.RequestBody): Promise; + didJwtVerify(requestBody: WalletPaths.DidJwtVerify.RequestBody): Promise; + providerinfoGet(): Promise; +} + +interface WalletOptionsCryptoWallet { + keyWallet: KeyWallet; +} +interface WalletOptionsSettings { + dialog: Dialog; + store: Store; + toast: Toast; + provider?: string; + providersData?: Record; +} +declare type WalletOptions = WalletOptionsSettings & WalletOptionsCryptoWallet; + +interface SelectIdentityOptions { + reason?: string; +} +interface TransactionOptions { + transaction?: string; + notifyUser?: boolean; +} +declare type ResourceMap = BaseWalletModel['resources']; +declare class BaseWallet, Model extends BaseWalletModel = BaseWalletModel> implements Wallet { + dialog: Dialog; + store: Store; + toast: Toast; + veramo: Veramo; + protected keyWallet: KeyWallet; + protected resourceValidator: ResourceValidator; + protected provider: string; + protected providersData: Record; + constructor(opts: Options); + executeTransaction(options?: TransactionOptions): Promise; + queryBalance(): Promise; + createTransaction(): Promise; + wipe(): Promise; + selectIdentity(options?: SelectIdentityOptions): Promise; + 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; +} + +/** + * 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); + private init; + deriveKey(password: string, salt?: Buffer): Promise; + private getModel; + private setModel; + private encryptModel; + private decryptModel; + get(key: any, defaultValue?: any): Promise; + set(keyOrStore: any, value?: any): Promise; + has(key: Key): Promise; + delete(key: Key): Promise; + clear(): Promise; + getStore(): Promise; + getPath(): string; +} + +interface Values { + text: string | undefined; + confirmation: boolean | undefined; + selectMap: (values: T[]) => T | undefined; +} +declare class NullDialog implements Dialog { + private readonly valuesStack; + get values(): Values; + setValues(values: Partial, cb: () => Promise): Promise; + text(options: TextOptions): DialogResponse; + confirmation(options: ConfirmationOptions): DialogResponse; + select(options: SelectOptions): DialogResponse; + authenticate(): DialogResponse; + form(options: FormOptions): DialogResponse; +} + +declare class ConsoleToast implements Toast { + show(toast: ToastOptions): void; + close(toastId: string): void; +} + +declare type KeyType = 'Secp256k1'; +interface Key { + kid: string; + type: KeyType; + publicKeyHex: string; + privateKeyHex: string; +} +interface BokWalletModel extends BaseWalletModel { + keys: { + [kid: string]: Key; + }; +} + +interface ImportInfo { + alias: string; + privateKey: string; +} +declare class BokWallet extends BaseWallet> { + importDid(importInfo?: ImportInfo): Promise; +} + +interface ServerWallet extends BokWallet { + dialog: NullDialog; + store: FileStore; + toast: ConsoleToast; +} + +declare class I3mServerWalletAgent extends EthersIoAgent { + wallet: ServerWallet; + did: string; + constructor(serverWallet: ServerWallet, did: string, dltConfig?: Partial>); +} + +declare class I3mServerWalletAgentDest extends I3mServerWalletAgent implements NrpDltAgentDest { + getSecretFromLedger(secretLength: number, signerAddress: string, exchangeId: string, timeout: number): Promise<{ + hex: string; + iat: number; + }>; +} + +interface NrpDltAgentOrig extends NrpDltAgent { + deploySecret: (secretHex: string, exchangeId: string) => Promise; + getAddress: () => Promise; + nextNonce: () => Promise; +} + +declare class EthersIoAgentOrig extends EthersIoAgent implements NrpDltAgentOrig { + signer: ethers.Wallet; + count: number; + constructor(dltConfig: Partial & Pick, privateKey?: string | Uint8Array); + deploySecret(secretHex: string, exchangeId: string): Promise; + getAddress(): Promise; + nextNonce(): Promise; +} + +declare class I3mWalletAgentOrig extends I3mWalletAgent implements NrpDltAgentOrig { + count: number; + deploySecret(secretHex: string, exchangeId: string): Promise; + getAddress(): Promise; + nextNonce(): Promise; +} + +declare class I3mServerWalletAgentOrig extends I3mServerWalletAgent implements NrpDltAgentOrig { + count: number; + deploySecret(secretHex: string, exchangeId: string): Promise; + getAddress(): Promise; + nextNonce(): Promise; +} + +//# sourceMappingURL=index.d.ts.map + +type index_d$2_EthersIoAgentDest = EthersIoAgentDest; +declare const index_d$2_EthersIoAgentDest: typeof EthersIoAgentDest; +type index_d$2_EthersIoAgentOrig = EthersIoAgentOrig; +declare const index_d$2_EthersIoAgentOrig: typeof EthersIoAgentOrig; +type index_d$2_I3mServerWalletAgentDest = I3mServerWalletAgentDest; +declare const index_d$2_I3mServerWalletAgentDest: typeof I3mServerWalletAgentDest; +type index_d$2_I3mServerWalletAgentOrig = I3mServerWalletAgentOrig; +declare const index_d$2_I3mServerWalletAgentOrig: typeof I3mServerWalletAgentOrig; +type index_d$2_I3mWalletAgentDest = I3mWalletAgentDest; +declare const index_d$2_I3mWalletAgentDest: typeof I3mWalletAgentDest; +type index_d$2_I3mWalletAgentOrig = I3mWalletAgentOrig; +declare const index_d$2_I3mWalletAgentOrig: typeof I3mWalletAgentOrig; +type index_d$2_NrpDltAgentDest = NrpDltAgentDest; +type index_d$2_NrpDltAgentOrig = NrpDltAgentOrig; +declare namespace index_d$2 { + export { + index_d$2_EthersIoAgentDest as EthersIoAgentDest, + index_d$2_EthersIoAgentOrig as EthersIoAgentOrig, + index_d$2_I3mServerWalletAgentDest as I3mServerWalletAgentDest, + index_d$2_I3mServerWalletAgentOrig as I3mServerWalletAgentOrig, + index_d$2_I3mWalletAgentDest as I3mWalletAgentDest, + index_d$2_I3mWalletAgentOrig as I3mWalletAgentOrig, + index_d$2_NrpDltAgentDest as NrpDltAgentDest, + index_d$2_NrpDltAgentOrig as NrpDltAgentOrig, + }; +} + +declare function checkCompleteness(verificationRequest: string, wallet: NrpDltAgentDest, connectionTimeout?: number): Promise<{ + vrPayload: VerificationRequestPayload; + porPayload: PoRPayload; + pooPayload: PoOPayload; + destPublicJwk: JWK; + origPublicJwk: JWK; +}>; + +declare function checkDecryption(disputeRequest: string, wallet: NrpDltAgentDest): Promise<{ + drPayload: DisputeRequestPayload; + porPayload: PoRPayload; + pooPayload: PoOPayload; + destPublicJwk: JWK; + origPublicJwk: JWK; +}>; + +declare class ConflictResolver { + jwkPair: JwkPair; + dltAgent: NrpDltAgentDest; + private readonly initialized; + constructor(jwkPair: JwkPair, dltAgent: NrpDltAgentDest); + private init; + resolveCompleteness(verificationRequest: string): Promise; + resolveDispute(disputeRequest: string): Promise; + private _resolution; +} + +declare function generateVerificationRequest(iss: 'orig' | 'dest', dataExchangeId: string, por: string, privateJwk: JWK): Promise; + +declare function verifyPor(por: string, wallet: NrpDltAgentDest, connectionTimeout?: number): Promise<{ + porPayload: PoRPayload; + pooPayload: PoOPayload; + secretHex: string; + destPublicJwk: JWK; + origPublicJwk: JWK; +}>; + +declare function verifyResolution(resolution: string, pubJwk?: JWK): Promise>; + +//# sourceMappingURL=index.d.ts.map + +type index_d$1_ConflictResolver = ConflictResolver; +declare const index_d$1_ConflictResolver: typeof ConflictResolver; +declare const index_d$1_checkCompleteness: typeof checkCompleteness; +declare const index_d$1_checkDecryption: typeof checkDecryption; +declare const index_d$1_generateVerificationRequest: typeof generateVerificationRequest; +declare const index_d$1_verifyPor: typeof verifyPor; +declare const index_d$1_verifyResolution: typeof verifyResolution; +declare namespace index_d$1 { + export { + index_d$1_ConflictResolver as ConflictResolver, + index_d$1_checkCompleteness as checkCompleteness, + index_d$1_checkDecryption as checkDecryption, + index_d$1_generateVerificationRequest as generateVerificationRequest, + index_d$1_verifyPor as verifyPor, + index_d$1_verifyResolution as verifyResolution, + }; +} + +declare function generateKeys(alg: SigningAlg, privateKey?: Uint8Array | string, base64?: boolean): Promise; + +declare function importJwk(jwk: JWK, alg?: string): Promise; + +declare function jweEncrypt(block: Uint8Array, secretOrPublicKey: JWK, encAlg?: EncryptionAlg): Promise; +declare function jweDecrypt(jwe: string, secretOrPrivateKey: JWK): Promise; + +declare function jwsDecode(jws: string, publicJwk?: JWK | getFromJws): Promise>; + +declare function oneTimeSecret(encAlg: EncryptionAlg, secret?: Uint8Array | string, base64?: boolean): Promise>; + +declare function verifyKeyPair(pubJWK: JWK, privJWK: JWK): Promise; + +declare class NonRepudiationDest { + agreement: DataExchangeAgreement; + exchange?: DataExchange; + jwkPairDest: JwkPair; + publicJwkOrig: JWK; + block: Block; + dltAgent: NrpDltAgentDest; + readonly initialized: Promise; + constructor(agreement: DataExchangeAgreement, privateJwk: JWK, dltAgent: NrpDltAgentDest); + private asyncConstructor; + verifyPoO(poo: string, cipherblock: string, options?: Pick): Promise>; + generatePoR(): Promise>; + verifyPoP(pop: string, options?: Pick): Promise>; + getSecretFromLedger(): Promise<{ + hex: string; + jwk: JWK; + }>; + decrypt(): Promise; + generateVerificationRequest(): Promise; + generateDisputeRequest(): Promise; +} + +declare class NonRepudiationOrig { + agreement: DataExchangeAgreement; + exchange: DataExchange; + jwkPairOrig: JwkPair; + publicJwkDest: JWK; + block: OrigBlock; + dltAgent: NrpDltAgentOrig; + readonly initialized: Promise; + constructor(agreement: DataExchangeAgreement, privateJwk: JWK, block: Uint8Array, dltAgent: NrpDltAgentOrig); + private init; + private _dltSetup; + generatePoO(): Promise>; + verifyPoR(por: string, options?: Pick): Promise>; + generatePoP(): Promise>; + generateVerificationRequest(): Promise; +} + +//# sourceMappingURL=index.d.ts.map + +type index_d_NonRepudiationDest = NonRepudiationDest; +declare const index_d_NonRepudiationDest: typeof NonRepudiationDest; +type index_d_NonRepudiationOrig = NonRepudiationOrig; +declare const index_d_NonRepudiationOrig: typeof NonRepudiationOrig; +declare namespace index_d { + export { + index_d_NonRepudiationDest as NonRepudiationDest, + index_d_NonRepudiationOrig as NonRepudiationOrig, + }; +} + +declare class NrError extends Error { + nrErrors: NrErrorName[]; + constructor(error: any, nrErrors: NrErrorName[]); + add(...nrErrors: NrErrorName[]): void; +} + +declare function createProof(payload: Omit, privateJwk: JWK): Promise>; + +declare function verifyProof(proof: string, expectedPayloadClaims: Partial & { + iss: T['iss']; + proofType: T['proofType']; + exchange: Dict; +}, options?: TimestampVerifyOptions): Promise>; + +declare function checkTimestamp(timestamp: number, notBefore: number, notAfter: number, tolerance?: number): void; + +declare function jsonSort(obj: any): any; + +declare function parseHex(a: string, prefix0x?: boolean, byteLength?: number): string; + +declare function parseJwk(jwk: JWK, stringify: true): Promise; +declare function parseJwk(jwk: JWK, stringify: false): Promise; + +declare function sha(input: string | Uint8Array, algorithm: HashAlg): Promise; + +declare function parseAddress(a: string): string; + +declare function getDltAddress(didOrKeyInHex: string): string; + +declare function exchangeId(exchange: Omit): Promise; + +declare function validateDataSharingAgreementSchema(agreement: DataSharingAgreement): Promise; +declare function validateDataExchange(dataExchange: DataExchange): Promise; +declare function validateDataExchangeAgreement(agreement: DataExchangeAgreement): Promise; + +export { Algs, Block, index_d$1 as ConflictResolution, ConflictResolutionRequestPayload, ContractConfig, DataExchange, DataExchangeAgreement, DataSharingAgreement, DecodedProof, Dict, DisputeRequestPayload, DisputeResolutionPayload, DltConfig, ENC_ALGS, EncryptionAlg, EthersIoAgentDest, EthersIoAgentOrig, HASH_ALGS, HashAlg, I3mServerWalletAgentDest, I3mServerWalletAgentOrig, I3mWalletAgentDest, I3mWalletAgentOrig, JWK, JwkPair, KEY_AGREEMENT_ALGS, index_d as NonRepudiationProtocol, NrError, NrErrorName, NrProofPayload, NrpDltAgentDest, NrpDltAgentOrig, OrigBlock, PoOPayload, PoPPayload, PoRPayload, ProofPayload, ResolutionPayload, SIGNING_ALGS, index_d$2 as Signers, SigningAlg, StoredProof, TimestampVerifyOptions, VerificationRequestPayload, VerificationResolutionPayload, checkTimestamp, createProof, defaultDltConfig, exchangeId, generateKeys, getDltAddress, getFromJws, importJwk, jsonSort, jweDecrypt, jweEncrypt, jwsDecode, oneTimeSecret, parseAddress, parseHex, parseJwk, sha, validateDataExchange, validateDataExchangeAgreement, validateDataSharingAgreementSchema, verifyKeyPair, verifyProof }; diff --git a/dist/index.node.cjs b/dist/index.node.cjs new file mode 100644 index 0000000..1d5cfaf --- /dev/null +++ b/dist/index.node.cjs @@ -0,0 +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){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 f=l(e);const y=["SHA-256","SHA-384","SHA-512"],g=["ES256","ES384","ES512"],m=["A128GCM","A256GCM"],u=["ECDH-ES"];class h extends Error{constructor(e,t){super(e),e instanceof h?(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:b}=r;async function w(e,t){const i=void 0===t?e.alg:t,r=m.concat(g).concat(u);if(!r.includes(i))throw new h("invalid alg. Must be one of: "+r.join(","),["invalid algorithm"]);try{const i=await a.importJWK(e,t);if(null==i)throw new h(new Error("failed importing keys"),["invalid key"]);return i}catch(e){throw new h(e,["invalid key"])}}async function x(e,t,i){let r,n;const o={...t};if(m.includes(t.alg))r="dir",n=void 0!==i?i:t.alg;else{if(!g.concat(u).includes(t.alg))throw new h(`Not a valid symmetric or assymetric alg: ${t.alg}`,["encryption failed","invalid key","invalid algorithm"]);if(void 0===i)throw new h("An encryption algorith encAlg for content encryption should be provided. Allowed values are: "+m.join(","),["encryption failed"]);n=i,r="ECDH-ES",o.alg=r}const s=await w(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 h(e,["encryption failed"])}}async function P(e,t){try{const i={...t},{alg:r,enc:n}=a.decodeProtectedHeader(e);if(void 0===r||void 0===n)throw new h("missing enc or alg in jwe header",["invalid format"]);"ECDH-ES"===r&&(i.alg=r);const o=await w(i);return await a.compactDecrypt(e,o,{contentEncryptionAlgorithms:[n]})}catch(e){throw new h(e,["decryption failed"])}}async function A(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 h(new Error(`${e} is not a JWS`),["not a compact jws"]);let r,n;try{r=JSON.parse(f.decode(i[1],!0)),n=JSON.parse(f.decode(i[2],!0))}catch(e){throw new h(e,["invalid format","not a compact jws"])}if(void 0!==t){const i="function"==typeof t?await t(r,n):t,o=await w(i);try{const t=await a.jwtVerify(e,o);return{header:t.protectedHeader,payload:t.payload,signer:i}}catch(e){throw new h(e,["jws verification failed"])}}return{header:r,payload:n}}function v(e){if(m.concat(y).concat(g).includes(e))return Number(e.match(/\d{3}/)[0])/8;throw new h("unsupported algorithm",["invalid algorithm"])}async function S(i,r,n){let o;if(!m.includes(i))throw new h(new Error(`Invalid encAlg '${i}'. Supported values are: ${m.toString()}`),["invalid algorithm"]);const s=v(i);if(void 0!==r){if("string"==typeof r)if(!0===n)o=f.decode(r);else{const e=t.parseHex(r,!1);if(e!==t.parseHex(r,!1,s))throw new h(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 h(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 h(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 k(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 w(e),n=await w(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 h(e,["unexpected error"])}}function E(e,t,i,r=2e3){if(ei+r)throw new h(new Error(`timestamp ${new Date(e).toTimeString()} after 'notAfter' ${new Date(i).toTimeString()} with tolerance of ${r/1e3}s`),["invalid timestamp"])}function j(e){return Array.isArray(e)?e.sort().map(j):(t=e,"[object Object]"===Object.prototype.toString.call(t)?Object.keys(e).sort().reduce((function(t,i){return t[i]=j(e[i]),t}),{}):e);var t}function D(e,i=!1,r){try{return t.parseHex(e,i,r)}catch(e){throw new h(e,["invalid format"])}}async function C(e,t){try{await w(e,e.alg);const i=j(e);return t?JSON.stringify(i):i}catch(e){throw new h(e,["invalid key"])}}async function $(e,t){const i=y;if(!i.includes(t))throw new h(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(require("crypto").createHash(i).update(Buffer.from(a)).digest())}return e}catch(e){throw new h(e,["unexpected error"])}}function q(e){if(null==e.match(/^(0x)?([\da-fA-F]{40})$/))throw new RangeError("incorrect address format");try{const t=D(e,!0,20);return o.ethers.utils.getAddress(t)}catch(e){throw new h(e,["invalid EIP-55 address"])}}async function O(e){return f.encode(await $(n.hashable(e),"SHA-256"),!0,!1)}async function R(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 k(i,t);const r=await w(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 J(e,t,i){const r=JSON.parse(t.exchange[t.iss]),a=await A(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){E("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;T(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 T(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 I(e,t,i=10){const{payload:r}=await A(e),a=r.exchange,n={...a};delete n.id;if(await O(n)!==a.id)throw new h(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 J(r.poo,{iss:"orig",proofType:"PoO",exchange:a})).payload}catch(e){throw new h(e,["invalid poo"])}try{await J(e,{iss:"dest",proofType:"PoR",exchange:a},{timestamp:"iat",notBefore:1e3*p.iat,notAfter:1e3*p.iat+a.pooToPorDelay})}catch(e){throw new h(e,["invalid por"])}try{const e=await t.getSecretFromLedger(v(a.encAlg),a.ledgerSignerAddress,a.id,i);d=e.hex,c=e.iat}catch(e){throw new h(e,["cannot verify"])}try{E(1e3*c,1e3*r.iat,1e3*p.iat+a.pooToSecretDelay)}catch(e){throw new h(`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 F(e,t,i=10){let r,a,n,o,s;try{r=(await A(e)).payload}catch(e){throw new h(e,["invalid verification request"])}try{const e=await I(r.por,t,i);a=e.destPublicJwk,n=e.origPublicJwk,o=e.pooPayload,s=e.porPayload}catch(e){throw new h(e,["invalid por","invalid verification request"])}try{await A(e,"dest"===r.iss?a:n)}catch(e){throw new h(e,["invalid verification request"])}return{pooPayload:o,porPayload:s,vrPayload:r,destPublicJwk:a,origPublicJwk:n}}async function z(e,t){const{payload:i}=await A(e),{destPublicJwk:r,origPublicJwk:a,secretHex:n,pooPayload:o,porPayload:s}=await I(i.por,t);try{await A(e,r)}catch(e){throw e instanceof h&&e.add("invalid dispute request"),e}if(f.encode(await $(i.cipherblock,s.exchange.hashAlg),!0,!1)!==s.exchange.cipherblockDgst)throw new h(new Error("cipherblock does not meet the committed (and already accepted) one"),["invalid dispute request"]);return await P(i.cipherblock,(await S(s.exchange.encAlg,n)).jwk),{pooPayload:o,porPayload:s,drPayload:i,destPublicJwk:r,origPublicJwk:a}}async function _(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 M=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 k(this.jwkPair.publicJwk,this.jwkPair.privateJwk)}async resolveCompleteness(e){await this.initialized;const{payload:t}=await A(e);let i;try{i=(await A(t.por)).payload}catch(e){throw new h(e,["invalid por"])}const r={...await this._resolution(t.dataExchangeId,i.exchange[t.iss]),resolution:"not completed",type:"verification"};try{await F(e,this.dltAgent),r.resolution="completed"}catch(e){if(!(e instanceof h)||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 A(e);let i;try{i=(await A(t.por)).payload}catch(e){throw new h(e,["invalid por"])}const r={...await this._resolution(t.dataExchangeId,i.exchange[t.iss]),resolution:"denied",type:"dispute"};try{await z(e,this.dltAgent)}catch(e){if(!(e instanceof h&&e.nrErrors.includes("decryption failed")))throw new h(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 C(this.jwkPair.publicJwk,!0),sub:t}}},checkCompleteness:F,checkDecryption:z,generateVerificationRequest:_,verifyPor:I,verifyResolution:async function(e,t){return await A(e,t??((e,t)=>JSON.parse(t.iss)))}});const W={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 N(e,i,r,a,n){let s=o.ethers.BigNumber.from(0),p=o.ethers.BigNumber.from(0);const d=D(t.bufToHex(f.decode(r)),!0);let c=0;do{try{({secret:s,timestamp:p}=await e.registry(D(i,!0),d))}catch(e){throw new h(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={...W,...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={...W,...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 V extends B{async getSecretFromLedger(e,t,i,r){return await this.initialized,await N(this.contract,t,i,r,e)}}class G extends B{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:a})})).catch((e=>{r(e)}))}))),this.wallet=e,this.did=t}}class Z extends G{async getSecretFromLedger(e,t,i,r){return await this.initialized,await N(this.contract,t,i,r,e)}}class X extends B{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:a})})).catch((e=>{r(e)}))}))),this.wallet=e,this.did=t}}class L extends X{async getSecretFromLedger(e,t,i,r){return await this.initialized,await N(this.contract,t,i,r,e)}}class U extends B{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 H(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 Y extends G{constructor(){super(...arguments),this.count=-1}async deploySecret(e,t){await this.initialized;const i=await H(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 h(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 Q extends X{constructor(){super(...arguments),this.count=-1}async deploySecret(e,t){await this.initialized;const i=await H(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 h(`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 ee=Object.freeze({__proto__:null,EthersIoAgentDest:V,EthersIoAgentOrig:U,I3mServerWalletAgentDest:L,I3mServerWalletAgentOrig:Q,I3mWalletAgentDest:Z,I3mWalletAgentOrig:Y}),te={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"]}]}}},ie={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 re(e){if(new Date(e).getTime()>0)return Number(e);throw new h(new Error("invalid timestamp"),["invalid timestamp"])}async function ae(e){const t=[],i=Object.keys(e);(i.length<10||i.length>11)&&t.push(new h(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 C(JSON.parse(e[r]),!0)&&t.push(new h(`[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 h(`[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=q(e[r]),e[r]!==i&&t.push(new h(`[dataExchangeAgreeement.${r}] Invalid EIP-55 address ${e[r]}. Did you mean ${i} instead?`,["invalid EIP-55 address","invalid format"]))}catch(i){t.push(new h(`[dataExchangeAgreeement.${r}] Invalid EIP-55 address ${e[r]}.`,["invalid EIP-55 address","invalid format"]))}break;case"pooToPorDelay":case"pooToPopDelay":case"pooToSecretDelay":try{e[r]!==re(e[r])&&t.push(new h(`[dataExchangeAgreeement.${r}] < 0 or not a number`,["invalid timestamp","invalid format"]))}catch(e){t.push(new h(`[dataExchangeAgreeement.${r}] < 0 or not a number`,["invalid timestamp","invalid format"]))}break;case"hashAlg":y.includes(e[r])||t.push(new h(`[dataExchangeAgreeement.${r}Invalid hash algorithm '${e[r]}'. It must be one of: ${y.join(", ")}`,["invalid algorithm"]));break;case"encAlg":m.includes(e[r])||t.push(new h(`[dataExchangeAgreeement.${r}Invalid encryption algorithm '${e[r]}'. It must be one of: ${m.join(", ")}`,["invalid algorithm"]));break;case"signingAlg":g.includes(e[r])||t.push(new h(`[dataExchangeAgreeement.${r}Invalid signing algorithm '${e[r]}'. It must be one of: ${g.join(", ")}`,["invalid algorithm"]));break;case"schema":break;default:t.push(new h(new Error(`Property ${r} not allowed in dataAgreement`),["invalid format"]))}}return t}var ne=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 ae(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 h("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 k(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=f.encode(await $(t,this.agreement.hashAlg),!0,!1),{payload:a}=await A(e),n={...this.agreement,cipherblockDgst:r,blockCommitment:a.exchange.blockCommitment,secretCommitment:a.exchange.secretCommitment},o={proofType:"PoO",iss:"orig",exchange:{...n,id:await O(n)}},s={timestamp:Date.now(),notBefore:"iat",notAfter:"iat",...i},p=await J(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 R(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 J(e,r,a),o=JSON.parse(n.payload.secret);return this.block.secret={hex:t.bufToHex(f.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(v(this.agreement.encAlg),this.agreement.ledgerSignerAddress,this.exchange.id,i);this.block.secret=await S(this.exchange.encAlg,r);try{E(1e3*a,1e3*this.block.por.payload.iat,1e3*this.block.poo.payload.iat+this.exchange.pooToSecretDelay)}catch(e){throw new h(`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 P(this.block.jwe,this.block.secret.jwk)).plaintext;if(f.encode(await $(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 _("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 w(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 h(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 ae(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 h("Resource has not been validated:\n"+e.join("\n"),t)}this.agreement=e,await k(this.jwkPairOrig.publicJwk,this.jwkPairOrig.privateJwk);const a=await S(this.agreement.encAlg);this.block={...this.block,secret:a,jwe:await x(this.block.raw,a.jwk,this.agreement.encAlg)};const n=f.encode(await $(this.block.jwe,this.agreement.hashAlg),!0,!1),o=f.encode(await $(this.block.raw,this.agreement.hashAlg),!0,!1),s=f.encode(await $(new Uint8Array(t.hexToBuf(this.block.secret.hex)),this.agreement.hashAlg),!0,!1),p={...this.agreement,cipherblockDgst:n,blockCommitment:o,secretCommitment:s},d=await O(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!==D(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 R({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 J(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 R(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 _("orig",this.exchange.id,this.block.por.jws,this.jwkPairOrig.privateJwk)}}});exports.ConflictResolution=M,exports.ENC_ALGS=m,exports.EthersIoAgentDest=V,exports.EthersIoAgentOrig=U,exports.HASH_ALGS=y,exports.I3mServerWalletAgentDest=L,exports.I3mServerWalletAgentOrig=Q,exports.I3mWalletAgentDest=Z,exports.I3mWalletAgentOrig=Y,exports.KEY_AGREEMENT_ALGS=u,exports.NonRepudiationProtocol=ne,exports.NrError=h,exports.SIGNING_ALGS=g,exports.Signers=ee,exports.checkTimestamp=E,exports.createProof=R,exports.defaultDltConfig=W,exports.exchangeId=O,exports.generateKeys=async function(e,r,a){if(!g.includes(e))throw new h(new RangeError(`Invalid signature algorithm '${e}''. Allowed algorithms are ${g.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?f.decode(r):new Uint8Array(t.hexToBuf(r)):r:new Uint8Array(await i.randBytes(n));const p=new b("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"),y=p.getPrivate("hex").padStart(2*n,"0"),m={kty:"EC",crv:o,x:f.encode(t.hexToBuf(c),!0,!1),y:f.encode(t.hexToBuf(l),!0,!1),d:f.encode(t.hexToBuf(y),!0,!1),alg:e},u={...m};return delete u.d,{publicJwk:u,privateJwk:m}},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 h("no a DID or a valid public or private key",["invalid format"])}},exports.importJwk=w,exports.jsonSort=j,exports.jweDecrypt=P,exports.jweEncrypt=x,exports.jwsDecode=A,exports.oneTimeSecret=S,exports.parseAddress=q,exports.parseHex=D,exports.parseJwk=C,exports.sha=$,exports.validateDataExchange=async function(e){const t=[];try{const{id:i,...r}=e;i!==await O(r)&&t.push(new h("Invalid dataExchange id",["cannot verify","invalid format"]));const{blockCommitment:a,secretCommitment:n,cipherblockDgst:o,...s}=r,p=await ae(s);p.length>0&&p.forEach((e=>{t.push(e)}))}catch(e){t.push(new h("Invalid dataExchange",["cannot verify","invalid format"]))}return t},exports.validateDataExchangeAgreement=ae,exports.validateDataSharingAgreementSchema=async function(e){const t=[],i=new p({strictSchema:!1,removeAdditional:"all"});i.addMetaSchema(ie),d(i);const r=te.schemas.DataSharingAgreement;try{const a=i.compile(r),o=c.cloneDeep(e);a(e)||null!==a.errors&&void 0!==a.errors&&a.errors.length>0&&a.errors.forEach((e=>{t.push(new h(`[${e.instancePath}] ${e.message??"unknown"}`,["invalid format"]))})),n.hashable(o)!==n.hashable(e)&&t.push(new h("Additional claims beyond the schema are not supported",["invalid format"]))}catch(e){t.push(new h(e,["invalid format"]))}return t},exports.verifyKeyPair=k,exports.verifyProof=J; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXgubm9kZS5janMiLCJzb3VyY2VzIjpbIi4uL3NyYy90cy9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LEVBQUVDLFVBQVV0RSxHQUN0QmtFLEVBQVNsRSxJQUdHLE9BQXBCa0UsRUFBU3RWLGFBQXVDVyxJQUFwQjJVLEVBQVN0VixRQUF3QnNWLEVBQVN0VixPQUFPMEQsT0FBUyxHQUN4RjRSLEVBQVN0VixPQUFPMFIsU0FBUS9SLElBQ3RCSyxFQUFPc1IsS0FBSyxJQUFJOVIsRUFBUSxJQUFJRyxFQUFNZ1csaUJBQWlCaFcsRUFBTWdTLFNBQVcsWUFBYSxDQUFDLG1CQUFtQixJQUl2RzNKLEVBQVFBLFNBQUN3TixLQUFxQnhOLEVBQVFBLFNBQUNvSixJQUN6Q3BSLEVBQU9zUixLQUFLLElBQUk5UixFQUFRLHdEQUF5RCxDQUFDLG1CQUVyRixDQUFDLE1BQU9HLEdBQ1BLLEVBQU9zUixLQUFLLElBQUk5UixFQUFRRyxFQUFPLENBQUMsbUJBQ2pDLENBRUQsT0FBT0ssQ0FDVCJ9 diff --git a/dist/esm/index.node.js b/dist/index.node.esm.js similarity index 70% rename from dist/esm/index.node.js rename to dist/index.node.esm.js index b5a5f44..fdb2fc9 100644 --- a/dist/esm/index.node.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:a})})).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:a})})).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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXgubm9kZS5qcyIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3RzL2NvbnN0YW50cy50cyIsIi4uLy4uL3NyYy90cy9lcnJvcnMvTnJFcnJvci50cyIsIi4uLy4uL3NyYy90cy9jcnlwdG8vZ2VuZXJhdGVLZXlzLnR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dCeEIsR0FFQzVGLFFBQWlCeUYsRUFBd0JhLEVBQUtYLEVBQXVCMkssR0FPM0UsT0FMQW5WLEtBQUtzRCxNQUFNNkgsSUFBTSxDQUNmOUcsSUFBSzhHLEVBQ0wzRyxRQUFTSyxFQUFTTCxTQUdieEUsS0FBS3NELE1BQU02SCxHQUNuQixDQVFEM0ssb0JBR0UsU0FGTVIsS0FBS3FOLGlCQUVZbE0sSUFBbkJuQixLQUFLc0QsTUFBTTZILElBQ2IsTUFBTSxJQUFJeEwsTUFBTSxnRkFHbEIsTUFBTTBWLFFBQXlCclYsS0FBS29OLFNBQVM2SSxhQUFhalcsS0FBS3NELE1BQU04QixPQUFPTyxJQUFLM0YsS0FBSzJKLFNBQVM2QixJQUV6RmhILEVBQW1DLENBQ3ZDd0gsVUFBVyxNQUNYbEMsSUFBSyxPQUNMSCxTQUFVM0osS0FBSzJKLFNBQ2Z3QixJQUFLbkwsS0FBS3NELE1BQU02SCxJQUFJOUcsSUFDcEJlLE9BQVFYLEtBQUt1RCxVQUFVaEksS0FBS3NELE1BQU04QixPQUFPckMsS0FDekNzUyxvQkFHRixPQURBclYsS0FBS3NELE1BQU04UixVQUFZdkwsRUFBWXJGLEVBQVN4RSxLQUFLNlYsWUFBWXZULFlBQ3REdEMsS0FBS3NELE1BQU04UixHQUNuQixDQVFENVUsb0NBR0UsU0FGTVIsS0FBS3FOLGlCQUVZbE0sSUFBbkJuQixLQUFLc0QsTUFBTTZILElBQ2IsTUFBTSxJQUFJeEwsTUFBTSxnR0FHbEIsYUFBYW9OLEdBQTRCLE9BQVEvTSxLQUFLMkosU0FBUzZCLEdBQUl4TCxLQUFLc0QsTUFBTTZILElBQUk5RyxJQUFLckUsS0FBSzZWLFlBQVl2VCxXQUN6RyJ9 diff --git a/docs/API.md b/docs/API.md index 0097674..c4c26fe 100644 --- a/docs/API.md +++ b/docs/API.md @@ -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/e1c4422/src/ts/types.ts#L13) +[src/ts/types.ts:13](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L13) ___ @@ -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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/src/ts/types.ts#L9) ___ @@ -145,12 +145,13 @@ ___ KeyLike are runtime-specific classes representing asymmetric keys or symmetric secrets. These are instances of [CryptoKey](https://developer.mozilla.org/en-US/docs/Web/API/CryptoKey) and -additionally [KeyObject](https://nodejs.org/api/crypto.html#class-keyobject) in Node.js runtime. +additionally [KeyObject](https://nodejs.org/api/crypto.html#class-keyobject) in Node.js +runtime. [Uint8Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) instances are also accepted as symmetric secret representation only. -[Key Import Functions](../modules/key_import.md#readme) can be used to import PEM, or JWK -formatted asymmetric keys and certificates to these runtime-specific representations. +[Key Import Functions](../modules/key_import.md) can be used to import PEM, or JWK formatted +asymmetric keys and certificates to these runtime-specific representations. In Node.js the [Buffer](https://nodejs.org/api/buffer.html#buffer) class is a subclass of Uint8Array and so Buffer can be provided for symmetric secrets as well. @@ -160,86 +161,15 @@ key/secret available in the Node.js runtime. In addition to the import functions you may use the runtime APIs [crypto.createPublicKey](https://nodejs.org/api/crypto.html#cryptocreatepublickeykey), [crypto.createPrivateKey](https://nodejs.org/api/crypto.html#cryptocreateprivatekeykey), and -[crypto.createSecretKey](https://nodejs.org/api/crypto.html#cryptocreatesecretkeykey-encoding) to -obtain a KeyObject from your existing key material. +[crypto.createSecretKey](https://nodejs.org/api/crypto.html#cryptocreatesecretkeykey-encoding) +to obtain a `KeyObject` from your existing key material. -[CryptoKey](https://developer.mozilla.org/en-US/docs/Web/API/CryptoKey) is a representation of a -key/secret available in the Browser and Web-interoperable runtimes. In addition to the import -functions of this library you may use the +[CryptoKey](https://developer.mozilla.org/en-US/docs/Web/API/CryptoKey) is a representation +of a key/secret available in the Browser and Web-interoperable runtimes. In addition to the +import functions of this library you may use the [SubtleCrypto.importKey](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/importKey) API to obtain a CryptoKey from your existing key material. -**`Example`** - -Import a PEM-encoded SPKI Public Key - -```js -const algorithm = 'ES256' -const spki = `-----BEGIN PUBLIC KEY----- -MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEFlHHWfLk0gLBbsLTcuCrbCqoHqmM -YJepMC+Q+Dd6RBmBiA41evUsNMwLeN+PNFqib+xwi9JkJ8qhZkq8Y/IzGg== ------END PUBLIC KEY-----` -const ecPublicKey = await jose.importSPKI(spki, algorithm) -``` - -**`Example`** - -Import SPKI from an X.509 Certificate - -```js -const algorithm = 'ES256' -const x509 = `-----BEGIN CERTIFICATE----- -MIIBXjCCAQSgAwIBAgIGAXvykuMKMAoGCCqGSM49BAMCMDYxNDAyBgNVBAMMK3Np -QXBNOXpBdk1VaXhXVWVGaGtjZXg1NjJRRzFyQUhXaV96UlFQTVpQaG8wHhcNMjEw -OTE3MDcwNTE3WhcNMjIwNzE0MDcwNTE3WjA2MTQwMgYDVQQDDCtzaUFwTTl6QXZN -VWl4V1VlRmhrY2V4NTYyUUcxckFIV2lfelJRUE1aUGhvMFkwEwYHKoZIzj0CAQYI -KoZIzj0DAQcDQgAE8PbPvCv5D5xBFHEZlBp/q5OEUymq7RIgWIi7tkl9aGSpYE35 -UH+kBKDnphJO3odpPZ5gvgKs2nwRWcrDnUjYLDAKBggqhkjOPQQDAgNIADBFAiEA -1yyMTRe66MhEXID9+uVub7woMkNYd0LhSHwKSPMUUTkCIFQGsfm1ecXOpeGOufAh -v+A1QWZMuTWqYt+uh/YSRNDn ------END CERTIFICATE-----` -const ecPublicKey = await jose.importX509(x509, algorithm) -``` - -**`Example`** - -Import a PEM-encoded PKCS8 Private Key - -```js -const algorithm = 'ES256' -const pkcs8 = `-----BEGIN PRIVATE KEY----- -MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgiyvo0X+VQ0yIrOaN -nlrnUclopnvuuMfoc8HHly3505OhRANCAAQWUcdZ8uTSAsFuwtNy4KtsKqgeqYxg -l6kwL5D4N3pEGYGIDjV69Sw0zAt43480WqJv7HCL0mQnyqFmSrxj8jMa ------END PRIVATE KEY-----` -const ecPrivateKey = await jose.importPKCS8(pkcs8, algorithm) -``` - -**`Example`** - -Import a JSON Web Key (JWK) - -```js -const ecPublicKey = await jose.importJWK( - { - crv: 'P-256', - kty: 'EC', - x: 'ySK38C1jBdLwDsNWKzzBHqKYEE5Cgv-qjWvorUXk9fw', - y: '_LeQBw07cf5t57Iavn4j-BqJsAD1dpoz8gokd3sBsOo', - }, - 'ES256', -) - -const rsaPublicKey = await jose.importJWK( - { - kty: 'RSA', - e: 'AQAB', - n: '12oBZRhCiZFJLcPg59LkZZ9mdhSMTKAQZYq32k_ti5SBB6jerkh-WzOMAO664r_qyLkqHUSp3u5SbXtseZEpN3XPWGKSxjsy-1JyEFTdLSYe6f9gfrmxkUF_7DTpq0gn6rntP05g2-wFW50YO7mosfdslfrTJYWHFhJALabAeYirYD7-9kqq9ebfFMF4sRRELbv9oi36As6Q9B3Qb5_C1rAzqfao_PCsf9EPsTZsVVVkA5qoIAr47lo1ipfiBPxUCCNSdvkmDTYgvvRm6ZoMjFbvOtgyts55fXKdMWv7I9HMD5HwE9uW839PWA514qhbcIsXEYSFMPMV6fnlsiZvQQ', - }, - 'PS256', -) -``` - #### Type declaration | Name | Type | @@ -248,7 +178,7 @@ const rsaPublicKey = await jose.importJWK( #### Defined in -node_modules/jose/dist/types/types.d.ts:91 +node_modules/jose/dist/types/types.d.ts:30 ___ @@ -258,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/e1c4422/src/ts/types.ts#L177) +[src/ts/types.ts:177](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L177) ___ @@ -268,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/e1c4422/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/7a25b3b/src/ts/types.ts#L10) ___ @@ -299,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/e1c4422/src/ts/types.ts#L175) +[src/ts/types.ts:175](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L175) ## Variables @@ -309,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/e1c4422/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/7a25b3b/src/ts/constants.ts#L3) ___ @@ -319,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/e1c4422/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/7a25b3b/src/ts/constants.ts#L1) ___ @@ -329,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/e1c4422/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/7a25b3b/src/ts/constants.ts#L4) ___ @@ -339,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/e1c4422/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/7a25b3b/src/ts/constants.ts#L2) ___ @@ -349,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/e1c4422/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/7a25b3b/src/ts/dlt/defaultDltConfig.ts#L3) ## Functions @@ -372,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/e1c4422/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/7a25b3b/src/ts/utils/timestamps.ts#L3) ___ @@ -403,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/e1c4422/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/7a25b3b/src/ts/proofs/createProof.ts#L13) ___ @@ -429,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/e1c4422/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/7a25b3b/src/ts/exchange/exchangeId.ts#L13) ___ @@ -453,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/e1c4422/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/7a25b3b/src/ts/crypto/generateKeys.ts#L18) ___ @@ -473,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/e1c4422/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/7a25b3b/src/ts/utils/getDltAddress.ts#L4) ___ @@ -494,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/e1c4422/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/7a25b3b/src/ts/crypto/importJwk.ts#L6) ___ @@ -514,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/e1c4422/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/7a25b3b/src/ts/utils/jsonSort.ts#L5) ___ @@ -539,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/e1c4422/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/7a25b3b/src/ts/crypto/jwe.ts#L56) ___ @@ -565,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/e1c4422/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/7a25b3b/src/ts/crypto/jwe.ts#L15) ___ @@ -594,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/e1c4422/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/7a25b3b/src/ts/crypto/jwsDecode.ts#L12) ___ @@ -620,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/e1c4422/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/7a25b3b/src/ts/crypto/oneTimeSecret.ts#L19) ___ @@ -642,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/e1c4422/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/7a25b3b/src/ts/utils/parseAddress.ts#L9) ___ @@ -664,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/e1c4422/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/7a25b3b/src/ts/utils/parseHex.ts#L4) ___ @@ -685,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/e1c4422/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/7a25b3b/src/ts/utils/parseJwk.ts#L6) ▸ **parseJwk**(`jwk`, `stringify`): `Promise`<[`JWK`](interfaces/JWK.md)\> @@ -702,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/e1c4422/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/7a25b3b/src/ts/utils/parseJwk.ts#L7) ___ @@ -723,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/e1c4422/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/7a25b3b/src/ts/utils/sha.ts#L5) ___ @@ -743,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/e1c4422/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/7a25b3b/src/ts/exchange/checkAgreement.ts#L52) ___ @@ -763,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/e1c4422/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/7a25b3b/src/ts/exchange/checkAgreement.ts#L73) ___ @@ -783,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/e1c4422/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/7a25b3b/src/ts/exchange/checkAgreement.ts#L20) ___ @@ -804,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/e1c4422/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/7a25b3b/src/ts/crypto/verifyKeyPair.ts#L7) ___ @@ -836,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/e1c4422/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/7a25b3b/src/ts/proofs/verifyProof.ts#L29) diff --git a/docs/classes/ConflictResolution.ConflictResolver.md b/docs/classes/ConflictResolution.ConflictResolver.md index a0a8e94..d387b1f 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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/src/ts/conflict-resolution/ConflictResolver.ts#L98) diff --git a/docs/classes/EthersIoAgentDest.md b/docs/classes/EthersIoAgentDest.md index 6ec848e..50729eb 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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/src/ts/dlt/agents/dest/EthersIoAgentDest.ts#L9) diff --git a/docs/classes/EthersIoAgentOrig.md b/docs/classes/EthersIoAgentOrig.md index 990ac1d..b8da708 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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/src/ts/dlt/agents/orig/EthersIoAgentOrig.ts#L65) diff --git a/docs/classes/I3mServerWalletAgentDest.md b/docs/classes/I3mServerWalletAgentDest.md index 9264448..546fb71 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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/src/ts/dlt/agents/dest/I3mServerWalletAgentDest.ts#L9) diff --git a/docs/classes/I3mServerWalletAgentOrig.md b/docs/classes/I3mServerWalletAgentOrig.md index 05d0625..05b3921 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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/src/ts/dlt/agents/orig/I3mServerWalletAgentOrig.ts#L38) diff --git a/docs/classes/I3mWalletAgentDest.md b/docs/classes/I3mWalletAgentDest.md index e4473a5..873a862 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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/src/ts/dlt/agents/dest/I3mWalletAgentDest.ts#L9) diff --git a/docs/classes/I3mWalletAgentOrig.md b/docs/classes/I3mWalletAgentOrig.md index 3884131..605cf02 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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/src/ts/dlt/agents/orig/I3mWalletAgentOrig.ts#L46) diff --git a/docs/classes/NonRepudiationProtocol.NonRepudiationDest.md b/docs/classes/NonRepudiationProtocol.NonRepudiationDest.md index d68980e..c330d2c 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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/src/ts/non-repudiation-protocol/NonRepudiationDest.ts#L163) diff --git a/docs/classes/NonRepudiationProtocol.NonRepudiationOrig.md b/docs/classes/NonRepudiationProtocol.NonRepudiationOrig.md index d4e09ec..ffb5652 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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/src/ts/non-repudiation-protocol/NonRepudiationOrig.ts#L137) diff --git a/docs/classes/NrError.md b/docs/classes/NrError.md index ded0233..bc2cdaf 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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/src/ts/errors/NrError.ts#L16) ___ diff --git a/docs/classes/Signers.EthersIoAgentDest.md b/docs/classes/Signers.EthersIoAgentDest.md index fb631f7..3e709ba 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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/src/ts/dlt/agents/dest/EthersIoAgentDest.ts#L9) diff --git a/docs/classes/Signers.EthersIoAgentOrig.md b/docs/classes/Signers.EthersIoAgentOrig.md index be8b853..79b117a 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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/src/ts/dlt/agents/orig/EthersIoAgentOrig.ts#L65) diff --git a/docs/classes/Signers.I3mServerWalletAgentDest.md b/docs/classes/Signers.I3mServerWalletAgentDest.md index b4633ca..be05c34 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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/src/ts/dlt/agents/dest/I3mServerWalletAgentDest.ts#L9) diff --git a/docs/classes/Signers.I3mServerWalletAgentOrig.md b/docs/classes/Signers.I3mServerWalletAgentOrig.md index 1dbc23f..fcf9555 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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/src/ts/dlt/agents/orig/I3mServerWalletAgentOrig.ts#L38) diff --git a/docs/classes/Signers.I3mWalletAgentDest.md b/docs/classes/Signers.I3mWalletAgentDest.md index b465cc8..b97ff04 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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/src/ts/dlt/agents/dest/I3mWalletAgentDest.ts#L9) diff --git a/docs/classes/Signers.I3mWalletAgentOrig.md b/docs/classes/Signers.I3mWalletAgentOrig.md index 0725b45..942c3a2 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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/src/ts/dlt/agents/orig/I3mWalletAgentOrig.ts#L46) diff --git a/docs/interfaces/Algs.md b/docs/interfaces/Algs.md index a7583b5..fc6172c 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/e1c4422/src/ts/types.ts#L20) +[src/ts/types.ts:20](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L20) ___ @@ -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/e1c4422/src/ts/types.ts#L19) +[src/ts/types.ts:19](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L19) ___ @@ -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/e1c4422/src/ts/types.ts#L18) +[src/ts/types.ts:18](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L18) diff --git a/docs/interfaces/Block.md b/docs/interfaces/Block.md index afd25e0..70b724d 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/e1c4422/src/ts/types.ts#L45) +[src/ts/types.ts:45](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L45) ___ @@ -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/e1c4422/src/ts/types.ts#L50) +[src/ts/types.ts:50](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L50) ___ @@ -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/e1c4422/src/ts/types.ts#L52) +[src/ts/types.ts:52](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L52) ___ @@ -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/e1c4422/src/ts/types.ts#L51) +[src/ts/types.ts:51](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L51) ___ @@ -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/e1c4422/src/ts/types.ts#L44) +[src/ts/types.ts:44](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L44) ___ @@ -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/e1c4422/src/ts/types.ts#L46) +[src/ts/types.ts:46](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L46) diff --git a/docs/interfaces/ConflictResolutionRequestPayload.md b/docs/interfaces/ConflictResolutionRequestPayload.md index aad3488..f6e9c89 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/e1c4422/src/ts/types.ts#L137) +[src/ts/types.ts:137](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L137) ___ @@ -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/e1c4422/src/ts/types.ts#L135) +[src/ts/types.ts:135](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L135) ___ @@ -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/e1c4422/src/ts/types.ts#L134) +[src/ts/types.ts:134](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L134) ___ @@ -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/e1c4422/src/ts/types.ts#L136) +[src/ts/types.ts:136](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L136) ___ @@ -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/e1c4422/src/ts/types.ts#L133) +[src/ts/types.ts:133](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L133) diff --git a/docs/interfaces/ContractConfig.md b/docs/interfaces/ContractConfig.md index 377bad4..ff0518f 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/e1c4422/src/ts/types.ts#L29) +[src/ts/types.ts:29](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L29) ___ @@ -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/e1c4422/src/ts/types.ts#L28) +[src/ts/types.ts:28](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L28) diff --git a/docs/interfaces/DataExchange.md b/docs/interfaces/DataExchange.md index 0f2f4a3..296c6e0 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/e1c4422/src/ts/types.ts#L89) +[src/ts/types.ts:89](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L89) ___ diff --git a/docs/interfaces/DecodedProof.md b/docs/interfaces/DecodedProof.md index 7969438..f604e91 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/e1c4422/src/ts/types.ts#L171) +[src/ts/types.ts:171](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L171) ___ @@ -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/e1c4422/src/ts/types.ts#L172) +[src/ts/types.ts:172](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L172) ___ @@ -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/e1c4422/src/ts/types.ts#L173) +[src/ts/types.ts:173](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L173) diff --git a/docs/interfaces/DisputeRequestPayload.md b/docs/interfaces/DisputeRequestPayload.md index 4ac4d06..5e50103 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/e1c4422/src/ts/types.ts#L147) +[src/ts/types.ts:147](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L147) ___ @@ -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/e1c4422/src/ts/types.ts#L137) +[src/ts/types.ts:137](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L137) ___ @@ -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/e1c4422/src/ts/types.ts#L135) +[src/ts/types.ts:135](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L135) ___ @@ -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/e1c4422/src/ts/types.ts#L146) +[src/ts/types.ts:146](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L146) ___ @@ -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/e1c4422/src/ts/types.ts#L136) +[src/ts/types.ts:136](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L136) ___ @@ -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/e1c4422/src/ts/types.ts#L133) +[src/ts/types.ts:133](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L133) ___ @@ -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/e1c4422/src/ts/types.ts#L145) +[src/ts/types.ts:145](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L145) diff --git a/docs/interfaces/DisputeResolutionPayload.md b/docs/interfaces/DisputeResolutionPayload.md index e54cdc2..d82a5ac 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/e1c4422/src/ts/types.ts#L154) +[src/ts/types.ts:154](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L154) ___ @@ -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/e1c4422/src/ts/types.ts#L155) +[src/ts/types.ts:155](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L155) ___ @@ -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/e1c4422/src/ts/types.ts#L156) +[src/ts/types.ts:156](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L156) ___ @@ -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/e1c4422/src/ts/types.ts#L151) +[src/ts/types.ts:151](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L151) ___ @@ -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/e1c4422/src/ts/types.ts#L167) +[src/ts/types.ts:167](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L167) ___ @@ -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/e1c4422/src/ts/types.ts#L157) +[src/ts/types.ts:157](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L157) ___ @@ -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/e1c4422/src/ts/types.ts#L166) +[src/ts/types.ts:166](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L166) diff --git a/docs/interfaces/DltConfig.md b/docs/interfaces/DltConfig.md index a479f05..6e19259 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/e1c4422/src/ts/types.ts#L35) +[src/ts/types.ts:35](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L35) ___ @@ -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/e1c4422/src/ts/types.ts#L34) +[src/ts/types.ts:34](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L34) ___ @@ -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/e1c4422/src/ts/types.ts#L33) +[src/ts/types.ts:33](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L33) diff --git a/docs/interfaces/JWK.md b/docs/interfaces/JWK.md index fa056d7..6dda961 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/e1c4422/src/ts/types.ts#L24) +[src/ts/types.ts:24](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L24) ___ @@ -60,7 +60,7 @@ JWKjose.crv #### Defined in -node_modules/jose/dist/types/types.d.ts:100 +node_modules/jose/dist/types/types.d.ts:39 ___ @@ -74,7 +74,7 @@ JWKjose.d #### Defined in -node_modules/jose/dist/types/types.d.ts:101 +node_modules/jose/dist/types/types.d.ts:40 ___ @@ -88,7 +88,7 @@ JWKjose.dp #### Defined in -node_modules/jose/dist/types/types.d.ts:102 +node_modules/jose/dist/types/types.d.ts:41 ___ @@ -102,7 +102,7 @@ JWKjose.dq #### Defined in -node_modules/jose/dist/types/types.d.ts:103 +node_modules/jose/dist/types/types.d.ts:42 ___ @@ -116,7 +116,7 @@ JWKjose.e #### Defined in -node_modules/jose/dist/types/types.d.ts:104 +node_modules/jose/dist/types/types.d.ts:43 ___ @@ -132,7 +132,7 @@ JWKjose.ext #### Defined in -node_modules/jose/dist/types/types.d.ts:106 +node_modules/jose/dist/types/types.d.ts:45 ___ @@ -146,7 +146,7 @@ JWKjose.k #### Defined in -node_modules/jose/dist/types/types.d.ts:107 +node_modules/jose/dist/types/types.d.ts:46 ___ @@ -162,7 +162,7 @@ JWKjose.key\_ops #### Defined in -node_modules/jose/dist/types/types.d.ts:109 +node_modules/jose/dist/types/types.d.ts:48 ___ @@ -178,7 +178,7 @@ JWKjose.kid #### Defined in -node_modules/jose/dist/types/types.d.ts:111 +node_modules/jose/dist/types/types.d.ts:50 ___ @@ -194,7 +194,7 @@ JWKjose.kty #### Defined in -node_modules/jose/dist/types/types.d.ts:113 +node_modules/jose/dist/types/types.d.ts:52 ___ @@ -208,7 +208,7 @@ JWKjose.n #### Defined in -node_modules/jose/dist/types/types.d.ts:114 +node_modules/jose/dist/types/types.d.ts:53 ___ @@ -222,7 +222,7 @@ JWKjose.oth #### Defined in -node_modules/jose/dist/types/types.d.ts:115 +node_modules/jose/dist/types/types.d.ts:54 ___ @@ -236,7 +236,7 @@ JWKjose.p #### Defined in -node_modules/jose/dist/types/types.d.ts:120 +node_modules/jose/dist/types/types.d.ts:59 ___ @@ -250,7 +250,7 @@ JWKjose.q #### Defined in -node_modules/jose/dist/types/types.d.ts:121 +node_modules/jose/dist/types/types.d.ts:60 ___ @@ -264,7 +264,7 @@ JWKjose.qi #### Defined in -node_modules/jose/dist/types/types.d.ts:122 +node_modules/jose/dist/types/types.d.ts:61 ___ @@ -280,7 +280,7 @@ JWKjose.use #### Defined in -node_modules/jose/dist/types/types.d.ts:124 +node_modules/jose/dist/types/types.d.ts:63 ___ @@ -294,7 +294,7 @@ JWKjose.x #### Defined in -node_modules/jose/dist/types/types.d.ts:125 +node_modules/jose/dist/types/types.d.ts:64 ___ @@ -310,7 +310,7 @@ JWKjose.x5c #### Defined in -node_modules/jose/dist/types/types.d.ts:128 +node_modules/jose/dist/types/types.d.ts:67 ___ @@ -326,7 +326,7 @@ JWKjose.x5t #### Defined in -node_modules/jose/dist/types/types.d.ts:130 +node_modules/jose/dist/types/types.d.ts:69 ___ @@ -342,7 +342,7 @@ JWKjose.x5t#S256 #### Defined in -node_modules/jose/dist/types/types.d.ts:132 +node_modules/jose/dist/types/types.d.ts:71 ___ @@ -358,7 +358,7 @@ JWKjose.x5u #### Defined in -node_modules/jose/dist/types/types.d.ts:134 +node_modules/jose/dist/types/types.d.ts:73 ___ @@ -372,4 +372,4 @@ JWKjose.y #### Defined in -node_modules/jose/dist/types/types.d.ts:126 +node_modules/jose/dist/types/types.d.ts:65 diff --git a/docs/interfaces/JwkPair.md b/docs/interfaces/JwkPair.md index 8abf8f2..e3f8b87 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/e1c4422/src/ts/types.ts#L100) +[src/ts/types.ts:100](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L100) ___ @@ -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/e1c4422/src/ts/types.ts#L99) +[src/ts/types.ts:99](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L99) diff --git a/docs/interfaces/NrProofPayload.md b/docs/interfaces/NrProofPayload.md index dd7ad57..dbc5fa8 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/e1c4422/src/ts/types.ts#L110) +[src/ts/types.ts:110](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L110) ___ @@ -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/e1c4422/src/ts/types.ts#L104) +[src/ts/types.ts:104](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L104) ___ @@ -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/e1c4422/src/ts/types.ts#L105) +[src/ts/types.ts:105](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L105) ___ @@ -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/e1c4422/src/ts/types.ts#L106) +[src/ts/types.ts:106](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L106) diff --git a/docs/interfaces/NrpDltAgentDest.md b/docs/interfaces/NrpDltAgentDest.md index 2d9a8be..7b42461 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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/src/ts/dlt/agents/NrpDltAgent.ts#L9) diff --git a/docs/interfaces/NrpDltAgentOrig.md b/docs/interfaces/NrpDltAgentOrig.md index 27d8dd6..e581036 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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/src/ts/dlt/agents/NrpDltAgent.ts#L9) diff --git a/docs/interfaces/OrigBlock.md b/docs/interfaces/OrigBlock.md index ffcf236..1ff5af1 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/e1c4422/src/ts/types.ts#L57) +[src/ts/types.ts:57](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L57) ___ @@ -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/e1c4422/src/ts/types.ts#L50) +[src/ts/types.ts:50](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L50) ___ @@ -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/e1c4422/src/ts/types.ts#L52) +[src/ts/types.ts:52](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L52) ___ @@ -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/e1c4422/src/ts/types.ts#L51) +[src/ts/types.ts:51](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L51) ___ @@ -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/e1c4422/src/ts/types.ts#L56) +[src/ts/types.ts:56](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L56) ___ @@ -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/e1c4422/src/ts/types.ts#L58) +[src/ts/types.ts:58](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L58) diff --git a/docs/interfaces/PoOPayload.md b/docs/interfaces/PoOPayload.md index e4c178a..ba16c7d 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/e1c4422/src/ts/types.ts#L110) +[src/ts/types.ts:110](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L110) ___ @@ -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/e1c4422/src/ts/types.ts#L104) +[src/ts/types.ts:104](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L104) ___ @@ -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/e1c4422/src/ts/types.ts#L114) +[src/ts/types.ts:114](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L114) ___ @@ -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/e1c4422/src/ts/types.ts#L115) +[src/ts/types.ts:115](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L115) diff --git a/docs/interfaces/PoPPayload.md b/docs/interfaces/PoPPayload.md index 0264614..e218c67 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/e1c4422/src/ts/types.ts#L110) +[src/ts/types.ts:110](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L110) ___ @@ -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/e1c4422/src/ts/types.ts#L104) +[src/ts/types.ts:104](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L104) ___ @@ -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/e1c4422/src/ts/types.ts#L125) +[src/ts/types.ts:125](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L125) ___ @@ -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/e1c4422/src/ts/types.ts#L127) +[src/ts/types.ts:127](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L127) ___ @@ -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/e1c4422/src/ts/types.ts#L126) +[src/ts/types.ts:126](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L126) ___ @@ -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/e1c4422/src/ts/types.ts#L128) +[src/ts/types.ts:128](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L128) ___ @@ -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/e1c4422/src/ts/types.ts#L129) +[src/ts/types.ts:129](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L129) diff --git a/docs/interfaces/PoRPayload.md b/docs/interfaces/PoRPayload.md index a6a90e5..4c361da 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/e1c4422/src/ts/types.ts#L110) +[src/ts/types.ts:110](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L110) ___ @@ -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/e1c4422/src/ts/types.ts#L104) +[src/ts/types.ts:104](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L104) ___ @@ -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/e1c4422/src/ts/types.ts#L119) +[src/ts/types.ts:119](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L119) ___ @@ -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/e1c4422/src/ts/types.ts#L121) +[src/ts/types.ts:121](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L121) ___ @@ -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/e1c4422/src/ts/types.ts#L120) +[src/ts/types.ts:120](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L120) diff --git a/docs/interfaces/ProofPayload.md b/docs/interfaces/ProofPayload.md index 2aed378..07e235a 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/e1c4422/src/ts/types.ts#L104) +[src/ts/types.ts:104](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L104) ___ @@ -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/e1c4422/src/ts/types.ts#L105) +[src/ts/types.ts:105](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L105) ___ @@ -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/e1c4422/src/ts/types.ts#L106) +[src/ts/types.ts:106](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L106) diff --git a/docs/interfaces/ResolutionPayload.md b/docs/interfaces/ResolutionPayload.md index 145cd6d..e10ab3e 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/e1c4422/src/ts/types.ts#L154) +[src/ts/types.ts:154](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L154) ___ @@ -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/e1c4422/src/ts/types.ts#L155) +[src/ts/types.ts:155](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L155) ___ @@ -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/e1c4422/src/ts/types.ts#L156) +[src/ts/types.ts:156](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L156) ___ @@ -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/e1c4422/src/ts/types.ts#L151) +[src/ts/types.ts:151](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L151) ___ @@ -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/e1c4422/src/ts/types.ts#L153) +[src/ts/types.ts:153](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L153) ___ @@ -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/e1c4422/src/ts/types.ts#L157) +[src/ts/types.ts:157](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L157) ___ @@ -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/e1c4422/src/ts/types.ts#L152) +[src/ts/types.ts:152](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L152) diff --git a/docs/interfaces/Signers.NrpDltAgentDest.md b/docs/interfaces/Signers.NrpDltAgentDest.md index fd932f2..3dd81e2 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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/src/ts/dlt/agents/NrpDltAgent.ts#L9) diff --git a/docs/interfaces/Signers.NrpDltAgentOrig.md b/docs/interfaces/Signers.NrpDltAgentOrig.md index 8b967a7..d257070 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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/src/ts/dlt/agents/NrpDltAgent.ts#L9) diff --git a/docs/interfaces/StoredProof.md b/docs/interfaces/StoredProof.md index bf447a8..381973e 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/e1c4422/src/ts/types.ts#L39) +[src/ts/types.ts:39](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L39) ___ @@ -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/e1c4422/src/ts/types.ts#L40) +[src/ts/types.ts:40](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L40) diff --git a/docs/interfaces/TimestampVerifyOptions.md b/docs/interfaces/TimestampVerifyOptions.md index decbd68..3255025 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/e1c4422/src/ts/types.ts#L67) +[src/ts/types.ts:67](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L67) ___ @@ -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/e1c4422/src/ts/types.ts#L66) +[src/ts/types.ts:66](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L66) ___ @@ -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/e1c4422/src/ts/types.ts#L65) +[src/ts/types.ts:65](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L65) ___ @@ -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/e1c4422/src/ts/types.ts#L68) +[src/ts/types.ts:68](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L68) diff --git a/docs/interfaces/VerificationRequestPayload.md b/docs/interfaces/VerificationRequestPayload.md index da3c5c6..e166302 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/e1c4422/src/ts/types.ts#L137) +[src/ts/types.ts:137](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L137) ___ @@ -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/e1c4422/src/ts/types.ts#L135) +[src/ts/types.ts:135](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L135) ___ @@ -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/e1c4422/src/ts/types.ts#L134) +[src/ts/types.ts:134](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L134) ___ @@ -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/e1c4422/src/ts/types.ts#L136) +[src/ts/types.ts:136](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L136) ___ @@ -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/e1c4422/src/ts/types.ts#L133) +[src/ts/types.ts:133](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L133) ___ @@ -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/e1c4422/src/ts/types.ts#L141) +[src/ts/types.ts:141](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L141) diff --git a/docs/interfaces/VerificationResolutionPayload.md b/docs/interfaces/VerificationResolutionPayload.md index da8adee..2361390 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/e1c4422/src/ts/types.ts#L154) +[src/ts/types.ts:154](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L154) ___ @@ -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/e1c4422/src/ts/types.ts#L155) +[src/ts/types.ts:155](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L155) ___ @@ -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/e1c4422/src/ts/types.ts#L156) +[src/ts/types.ts:156](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L156) ___ @@ -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/e1c4422/src/ts/types.ts#L151) +[src/ts/types.ts:151](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L151) ___ @@ -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/e1c4422/src/ts/types.ts#L162) +[src/ts/types.ts:162](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L162) ___ @@ -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/e1c4422/src/ts/types.ts#L157) +[src/ts/types.ts:157](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L157) ___ @@ -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/e1c4422/src/ts/types.ts#L161) +[src/ts/types.ts:161](https://gitlab.com/i3-market/code/wp3/t3.2/conflict-resolution/non-repudiation-library/-/blob/7a25b3b/src/ts/types.ts#L161) diff --git a/docs/modules/ConflictResolution.md b/docs/modules/ConflictResolution.md index 251dc36..61f92b8 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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/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/e1c4422/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/7a25b3b/src/ts/conflict-resolution/verifyResolution.ts#L4) diff --git a/package-lock.json b/package-lock.json index 20358fd..ec2c7a3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,17 +10,17 @@ "license": "EUPL-1.2", "dependencies": { "@apidevtools/openapi-schemas": "^2.1.0", - "@juanelas/base64": "^1.1.0", + "@juanelas/base64": "^1.1.2", "ajv": "^8.11.0", "ajv-draft-04": "^1.0.0", "ajv-formats": "^2.1.1", - "bigint-conversion": "^2.4.0", - "bigint-crypto-utils": "^3.2.1", + "bigint-conversion": "^2.4.1", + "bigint-crypto-utils": "^3.2.2", "elliptic": "^6.5.4", "ethers": "^5.5.2", "jose": "^4.3.7", "lodash": "^4.17.21", - "object-sha": "^2.1.0" + "object-sha": "^2.1.1" }, "devDependencies": { "@i3m/non-repudiation-protocol-smart-contract": "^1.0.1", @@ -30,6 +30,7 @@ "@rollup/plugin-commonjs": "^24.0.1", "@rollup/plugin-inject": "^5.0.3", "@rollup/plugin-json": "^6.0.0", + "@rollup/plugin-multi-entry": "^6.0.0", "@rollup/plugin-node-resolve": "^15.0.1", "@rollup/plugin-replace": "^5.0.1", "@rollup/plugin-terser": "^0.4.0", @@ -42,15 +43,16 @@ "c8": "^7.12.0", "chai": "^4.3.3", "dotenv": "^16.0.3", - "glob": "^9.3.4", + "glob": "^10.0.0", "json5": "^2.2.0", - "minimatch": "^8.0.3", + "minimatch": "^9.0.0", "mocha": "^10.0.0", "npm-run-all": "^4.1.5", "pirates": "^4.0.1", "puppeteer": "^19.1.2", - "rimraf": "^4.4.1", + "rimraf": "^5.0.0", "rollup": "^3.20.2", + "rollup-plugin-dts": "^5.3.0", "ts-standard": "^12.0.2", "tslib": "^2.3.1", "typedoc": "~0.23.0", @@ -1244,9 +1246,9 @@ "dev": true }, "node_modules/@juanelas/base64": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@juanelas/base64/-/base64-1.1.0.tgz", - "integrity": "sha512-jS/YV5rqHK9pSL1Dm0c8CkF96q1P3pH+fa2gjMHUDKMVbmY7gR/k44BrXc18JhuLNdct3wLUezRA9JfgKVquvw==" + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@juanelas/base64/-/base64-1.1.2.tgz", + "integrity": "sha512-mr2pfRQpWap0Uq4tlrCgp3W+Yjx1/Bpq4QJsYeAQUh1mExgyQvXz7xUhmYT2HcLLspuAL5dpnos8P2QhaCSXsQ==" }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", @@ -1284,9 +1286,9 @@ } }, "node_modules/@puppeteer/browsers": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/@puppeteer/browsers/-/browsers-0.4.0.tgz", - "integrity": "sha512-3iB5pWn9Sr55PKKwqFWSWjLsTKCOEhKNI+uV3BZesgXuA3IhsX8I3hW0HI+3ksMIPkh2mVYzKSpvgq3oicjG2Q==", + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@puppeteer/browsers/-/browsers-0.4.1.tgz", + "integrity": "sha512-4IICvy1McAkT/HyNZHIs7sp8ngBX1dmO0TPQ+FWq9ATQMqI8p+Ulm5A3kS2wYDh5HDHHkYrrETOu6rlj64VuTw==", "dev": true, "dependencies": { "debug": "4.3.4", @@ -1355,9 +1357,9 @@ } }, "node_modules/@rollup/plugin-commonjs": { - "version": "24.0.1", - "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-24.0.1.tgz", - "integrity": "sha512-15LsiWRZk4eOGqvrJyu3z3DaBu5BhXIMeWnijSRvd8irrrg9SHpQ1pH+BUK4H6Z9wL9yOxZJMTLU+Au86XHxow==", + "version": "24.1.0", + "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-24.1.0.tgz", + "integrity": "sha512-eSL45hjhCWI0jCCXcNtLVqM5N1JlBGvlFfY0m6oOYnLCJ6N0qEXoZql4sY2MOUArzhH4SA/qBpTxvvZp2Sc+DQ==", "dev": true, "dependencies": { "@rollup/pluginutils": "^5.0.1", @@ -1452,6 +1454,27 @@ } } }, + "node_modules/@rollup/plugin-multi-entry": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@rollup/plugin-multi-entry/-/plugin-multi-entry-6.0.0.tgz", + "integrity": "sha512-msBgVncGQwh/ahxeP/rc8MXVZNBOjoVCsBuDk6uqyFzDv/SZN7jksfAsu6DJ2w4r5PaBX3/OXOjVPeCxya2waA==", + "dev": true, + "dependencies": { + "@rollup/plugin-virtual": "^3.0.0", + "matched": "^5.0.1" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "rollup": "^1.20.0||^2.0.0||^3.0.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } + } + }, "node_modules/@rollup/plugin-node-resolve": { "version": "15.0.2", "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-15.0.2.tgz", @@ -1546,6 +1569,23 @@ } } }, + "node_modules/@rollup/plugin-virtual": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@rollup/plugin-virtual/-/plugin-virtual-3.0.1.tgz", + "integrity": "sha512-fK8O0IL5+q+GrsMLuACVNk2x21g3yaw+sG2qn16SnUd3IlBsQyvWxLMGHmCmXRMecPjGRSZ/1LmZB4rjQm68og==", + "dev": true, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "rollup": "^1.20.0||^2.0.0||^3.0.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } + } + }, "node_modules/@rollup/pluginutils": { "version": "5.0.2", "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.0.2.tgz", @@ -1789,9 +1829,9 @@ "dev": true }, "node_modules/@types/lodash": { - "version": "4.14.192", - "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.192.tgz", - "integrity": "sha512-km+Vyn3BYm5ytMO13k9KTp27O75rbQ0NFw+U//g+PX7VZyjCioXaRFisqSIJRECljcTv73G3i6BpglNGHgUQ5A==", + "version": "4.14.194", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.194.tgz", + "integrity": "sha512-r22s9tAS7imvBt2lyHC9B8AGwWnXaYb1tY09oyLkXDs4vArpYJzw09nj8MLx5VfciBPGIb+ZwG0ssYnEPJxn/g==", "dev": true }, "node_modules/@types/mocha": { @@ -2588,32 +2628,21 @@ "dev": true }, "node_modules/bigint-conversion": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/bigint-conversion/-/bigint-conversion-2.4.0.tgz", - "integrity": "sha512-PApDhrpW5qjdK8ecsBgcJ08pNMt8nNsnPxlw9a9PVPeF01tzBaeV66ogu3L9i/tEz5WhD8IvSf9ipQILujThzA==", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/bigint-conversion/-/bigint-conversion-2.4.1.tgz", + "integrity": "sha512-/DTRevseMZoqN4KLkN5BryOiom0KbwYajiXG5Vo+ZcEPAO0WBZyZoYyDZSgfeq/v/oegLo9bjdndDBlExvAhBQ==", "dependencies": { - "@juanelas/base64": "^1.1.0" + "@juanelas/base64": "^1.1.2" } }, "node_modules/bigint-crypto-utils": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/bigint-crypto-utils/-/bigint-crypto-utils-3.2.1.tgz", - "integrity": "sha512-/sERxP9gzXUJ7wfrFf4/oCnLc/Y87tkhi58o0zifx4VdQdLVW6OkV3X2+BxVJn1FTLpT1laG2YIbwP6ZLNut+A==", - "dependencies": { - "bigint-mod-arith": "^3.2.0" - }, + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/bigint-crypto-utils/-/bigint-crypto-utils-3.2.2.tgz", + "integrity": "sha512-U1RbE3aX9ayCUVcIPHuPDPKcK3SFOXf93J1UK/iHlJuQB7bhagPIX06/CLpLEsDThJ7KA4Dhrnzynl+d2weTiw==", "engines": { "node": ">=14.0.0" } }, - "node_modules/bigint-mod-arith": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/bigint-mod-arith/-/bigint-mod-arith-3.2.0.tgz", - "integrity": "sha512-Khb+sLGLqbe/2NOLVMOpCSgsC3lz8r3VIRZGc41hccudLPnvks7RYZNOnGukQZV8scn5+bA6MABga3Ueq6z3+w==", - "engines": { - "node": ">=10.4.0" - } - }, "node_modules/binary-extensions": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", @@ -3988,9 +4017,9 @@ } }, "node_modules/eslint/node_modules/eslint-scope": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.1.tgz", - "integrity": "sha512-QKQM/UXpIiHcLqJ5AOyIW7XZmzjkzQXYE54n1++wb0u9V/abW3l9uQnxX8Z5Xd18xyKIMTUAyQ0k1e8pz6LUrw==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.0.tgz", + "integrity": "sha512-DYj5deGlHBfMt15J7rdtyKNq/Nqlv5KfU4iodrQ019XESsRnwXH9KAE0y3cwtUHDo2ob7CypAnCqefh6vioWRw==", "dev": true, "dependencies": { "esrecurse": "^4.3.0", @@ -3998,6 +4027,9 @@ }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" } }, "node_modules/eslint/node_modules/glob-parent": { @@ -4680,15 +4712,15 @@ } }, "node_modules/glob": { - "version": "9.3.5", - "resolved": "https://registry.npmjs.org/glob/-/glob-9.3.5.tgz", - "integrity": "sha512-e1LleDykUz2Iu+MTYdkSsuWX8lvAjAcs0Xef0lNIu0S2wOAzuTxCJtcd9S3cijlwYF18EsU3rzb8jPVobxDh9Q==", + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.0.0.tgz", + "integrity": "sha512-zmp9ZDC6NpDNLujV2W2n+3lH+BafIVZ4/ct+Yj3BMZTH/+bgm/eVjHzeFLwxJrrIGgjjS2eiQLlpurHsNlEAtQ==", "dev": true, "dependencies": { "fs.realpath": "^1.0.0", - "minimatch": "^8.0.2", - "minipass": "^4.2.4", - "path-scurry": "^1.6.1" + "minimatch": "^9.0.0", + "minipass": "^5.0.0", + "path-scurry": "^1.6.4" }, "engines": { "node": ">=16 || 14 >=14.17" @@ -5418,9 +5450,9 @@ } }, "node_modules/jose": { - "version": "4.13.1", - "resolved": "https://registry.npmjs.org/jose/-/jose-4.13.1.tgz", - "integrity": "sha512-MSJQC5vXco5Br38mzaQKiq9mwt7lwj2eXpgpRyQYNHYt2lq1PjkWa7DLXX0WVcQLE9HhMh3jPiufS7fhJf+CLQ==", + "version": "4.13.2", + "resolved": "https://registry.npmjs.org/jose/-/jose-4.13.2.tgz", + "integrity": "sha512-GMUKtV+l05F6NY/06nM7rucHM6Ktvw6sxnyRqINBNWS/hCM/bBk7kanOEckRP8xtC/jzuGfTRVZvkjjuy+g4dA==", "funding": { "url": "https://github.com/sponsors/panva" } @@ -5635,9 +5667,9 @@ } }, "node_modules/lru-cache": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-9.0.1.tgz", - "integrity": "sha512-C8QsKIN1UIXeOs3iWmiZ1lQY+EnKDojWd37fXy1aSbJvH4iSma1uy2OWuoB3m4SYRli5+CUjDv3Dij5DVoetmg==", + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-9.0.2.tgz", + "integrity": "sha512-7zYMKApzQ9qQE13xQUzbXVY3p2C5lh+9V+bs8M9fRf1TF59id+8jkljRWtIPfBfNP4yQAol5cqh/e8clxatdXw==", "dev": true, "engines": { "node": "14 || >=16.14" @@ -5688,6 +5720,64 @@ "node": ">= 12" } }, + "node_modules/matched": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/matched/-/matched-5.0.1.tgz", + "integrity": "sha512-E1fhSTPRyhAlNaNvGXAgZQlq1hL0bgYMTk/6bktVlIhzUnX/SZs7296ACdVeNJE8xFNGSuvd9IpI7vSnmcqLvw==", + "dev": true, + "dependencies": { + "glob": "^7.1.6", + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/matched/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/matched/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/matched/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, "node_modules/memorystream": { "version": "0.3.1", "resolved": "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz", @@ -5730,9 +5820,9 @@ "integrity": "sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg==" }, "node_modules/minimatch": { - "version": "8.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-8.0.4.tgz", - "integrity": "sha512-W0Wvr9HyFXZRGIDgCicunpQ299OKXs9RgZfaukz4qAW/pJhcpUfupc9c+OObPOFueNy8VSrZgEmDtk6Kh4WzDA==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.0.tgz", + "integrity": "sha512-0jJj8AvgKqWN05mrwuqi8QYKx1WmYSUoKSxu5Qhs9prezTz10sxAHGNZe9J9cqIJzta8DWsleh2KaVaLl6Ru2w==", "dev": true, "dependencies": { "brace-expansion": "^2.0.1" @@ -5754,9 +5844,9 @@ } }, "node_modules/minipass": { - "version": "4.2.7", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-4.2.7.tgz", - "integrity": "sha512-ScVIgqHcXRMyfflqHmEW0bm8z8rb5McHyOY3ewX9JBgZaR77G7nxq9L/mtV96/QbAAwtbCAHVVLzD1kkyfFQEw==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", + "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", "dev": true, "engines": { "node": ">=8" @@ -6261,9 +6351,9 @@ } }, "node_modules/object-sha": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/object-sha/-/object-sha-2.1.0.tgz", - "integrity": "sha512-K6eNrzoUAYIaRap+WFi2IiQ9h+ryuY/EUeaxY9pSnFpxrSby3EvbjX/sAcdKWMaqURnHMfSZ46kmcTcvsmz1Og==" + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/object-sha/-/object-sha-2.1.1.tgz", + "integrity": "sha512-qRX9WWl5X1OXOzLkT6K6bjgzSW+CDkmvYNqKSSN8I/PbFycfFMsnFhdj6K9Wmjs2ZdqjsVyqaaCN/q47TSoDyA==" }, "node_modules/object.assign": { "version": "4.1.4", @@ -6518,15 +6608,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/path-scurry/node_modules/minipass": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", - "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/path-type": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", @@ -6546,9 +6627,9 @@ } }, "node_modules/pbkdf2-hmac": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/pbkdf2-hmac/-/pbkdf2-hmac-1.2.0.tgz", - "integrity": "sha512-LhVc0NUyLQtBAyz5r0tgTGZq9EWBre5Zx7UQPWoDROInxmhlH6Ql0uEQm8heqq4n9/3NpP0zucG/AunJtqIk0Q==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/pbkdf2-hmac/-/pbkdf2-hmac-1.2.1.tgz", + "integrity": "sha512-hVmhFGESrB+GtfSYHk7JYYIevsq2r96ilSdDdQmUz3ukicz4m31xzk2gWPFm3300eek54DV4MekINaXu/G8VyA==", "dev": true }, "node_modules/pend": { @@ -6763,27 +6844,27 @@ } }, "node_modules/puppeteer": { - "version": "19.8.5", - "resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-19.8.5.tgz", - "integrity": "sha512-WSjouU7eux6cwBMEz4A7mDRVZWTQQTDXrb1R6AhKDdeEgpiBBkAzcAusPhILxiJOKj60rULZpWuCZ7HZIO6GTA==", + "version": "19.9.0", + "resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-19.9.0.tgz", + "integrity": "sha512-JDx8WwGlkdQYTaa3OMYDF+uFWimiwNnacg5FGEC5J6+VxDsLK30wHKU/Db2LqEhtAoIu4RwS+BRH4zRPlCsFpA==", "dev": true, "hasInstallScript": true, "dependencies": { - "@puppeteer/browsers": "0.4.0", + "@puppeteer/browsers": "0.4.1", "cosmiconfig": "8.1.3", "https-proxy-agent": "5.0.1", "progress": "2.0.3", "proxy-from-env": "1.1.0", - "puppeteer-core": "19.8.5" + "puppeteer-core": "19.9.0" } }, "node_modules/puppeteer-core": { - "version": "19.8.5", - "resolved": "https://registry.npmjs.org/puppeteer-core/-/puppeteer-core-19.8.5.tgz", - "integrity": "sha512-zoGhim/oBQbkND6h4Xz4X7l5DkWVH9wH7z0mVty5qa/c0P1Yad47t/npVtt2xS10BiQwzztWKx7Pa2nJ5yykdw==", + "version": "19.9.0", + "resolved": "https://registry.npmjs.org/puppeteer-core/-/puppeteer-core-19.9.0.tgz", + "integrity": "sha512-IJYfCE0oFpi5dTvNFqOwo8Dey6zzx7hANy7z6K2bjpCux9oPOSOIubq40awNhaHlfi8soYtgU4qabnzMXB7xBQ==", "dev": true, "dependencies": { - "@puppeteer/browsers": "0.4.0", + "@puppeteer/browsers": "0.4.1", "chromium-bidi": "0.4.6", "cross-fetch": "3.1.5", "debug": "4.3.4", @@ -7014,12 +7095,12 @@ } }, "node_modules/rimraf": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-4.4.1.tgz", - "integrity": "sha512-Gk8NlF062+T9CqNGn6h4tls3k6T1+/nXdOcSZVikNVtlRdYpA7wRJJMoXmuvOnLW844rPjdQ7JgXCYM6PPC/og==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-5.0.0.tgz", + "integrity": "sha512-Jf9llaP+RvaEVS5nPShYFhtXIrb3LRKP281ib3So0KkeZKo2wIKyq0Re7TOSwanasA423PSr6CCIL4bP6T040g==", "dev": true, "dependencies": { - "glob": "^9.2.0" + "glob": "^10.0.0" }, "bin": { "rimraf": "dist/cjs/src/bin.js" @@ -7047,6 +7128,40 @@ "fsevents": "~2.3.2" } }, + "node_modules/rollup-plugin-dts": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/rollup-plugin-dts/-/rollup-plugin-dts-5.3.0.tgz", + "integrity": "sha512-8FXp0ZkyZj1iU5klkIJYLjIq/YZSwBoERu33QBDxm/1yw5UU4txrEtcmMkrq+ZiKu3Q4qvPCNqc3ovX6rjqzbQ==", + "dev": true, + "dependencies": { + "magic-string": "^0.30.0" + }, + "engines": { + "node": ">=v14" + }, + "funding": { + "url": "https://github.com/sponsors/Swatinem" + }, + "optionalDependencies": { + "@babel/code-frame": "^7.18.6" + }, + "peerDependencies": { + "rollup": "^3.0.0", + "typescript": "^4.1 || ^5.0" + } + }, + "node_modules/rollup-plugin-dts/node_modules/magic-string": { + "version": "0.30.0", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.0.tgz", + "integrity": "sha512-LA+31JYDJLs82r2ScLrlz1GjSgu66ZV518eyWT+S8VhyQn/JL0u9MeBOvQMGYiPk1DBiSN9DDMOcXvigJZaViQ==", + "dev": true, + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.4.13" + }, + "engines": { + "node": ">=12" + } + }, "node_modules/run-parallel": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", diff --git a/package.json b/package.json index 951963a..0bdb7fe 100644 --- a/package.json +++ b/package.json @@ -33,46 +33,50 @@ "url": "https://github.com/juanelas" }, "type": "module", - "main": "./dist/cjs/index.node.cjs", - "types": "./types/index.d.cts", - "browser": "./dist/esm/index.browser.js", - "module": "./dist/esm/index.node.js", + "main": "./dist/index.node.cjs", + "browser": "./dist/index.browser.esm.js", + "types": "./dist/index.d.ts", "exports": { ".": { "node": { - "require": { - "default": "./dist/cjs/index.node.cjs", - "types": "./types/index.d.cts" + "module": { + "types": "./dist/index.d.ts", + "default": "./dist/index.node.esm.js" }, "import": { - "default": "./dist/esm/index.node.js", - "types": "./types/index.d.ts" + "types": "./dist/index.d.ts", + "default": "./dist/index.node.esm.js" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.node.cjs" } }, + "script": "./dist/bundle.iife.js", "default": { - "default": "./dist/esm/index.browser.js", - "types": "./types/index.d.ts" + "types": "./dist/index.d.ts", + "default": "./dist/index.browser.esm.js" } }, - "./esm-browser-bundle": "./dist/bundles/esm.min.js", - "./esm-browser-bundle-nomin": "./dist/bundles/esm.js", - "./iife-browser-bundle": "./dist/bundles/iife.js", - "./umd-browser-bundle": "./dist/bundles/umd.js", - "./types": "./types/index.d.cts" + "./esm-browser-bundle": "./dist/bundle.esm.min.js", + "./esm-browser-bundle-nomin": "./dist/bundle.esm.js", + "./iife-browser-bundle": "./dist/bundle.iife.js", + "./umd-browser-bundle": "./dist/bundle.umd.js", + "./types": "./dist/index.d.ts" }, "imports": { "#pkg": { "require": { - "default": "./dist/cjs/index.node.cjs", - "types": "./types/index.d.cts" + "types": "./dist/index.d.ts", + "default": "./dist/index.node.cjs" }, "import": { - "default": "./dist/esm/index.node.js", - "types": "./types/index.d.ts" + "types": "./dist/index.d.ts", + "default": "./dist/index.node.esm.js" }, "default": { - "default": "./dist/esm/index.browser.js", - "types": "./types/index.d.ts" + "types": "./dist/esm/index.d.ts", + "default": "./dist/index.browser.esm.js" } } }, @@ -88,7 +92,8 @@ "scripts": { "build": "run-s lint:src build:js lint:test docs", "build:js": "rollup -c build/rollup.config.js", - "clean": "rimraf .mocha-ts coverage dist types docs", + "postbuild:js": "rimraf .types", + "clean": "rimraf .mocha-ts coverage dist .types docs", "coverage": "c8 --clean --check-coverage --exclude \"{src/ts/**/*.spec.ts,test,test-vectors,build}\" --exclude-after-remap --reporter=text --reporter=lcov node ./build/bin/mocha-ts.cjs --commonjs ", "docs": "node build/build.docs.cjs", "git:add": "git add -A", @@ -137,6 +142,7 @@ "@rollup/plugin-commonjs": "^24.0.1", "@rollup/plugin-inject": "^5.0.3", "@rollup/plugin-json": "^6.0.0", + "@rollup/plugin-multi-entry": "^6.0.0", "@rollup/plugin-node-resolve": "^15.0.1", "@rollup/plugin-replace": "^5.0.1", "@rollup/plugin-terser": "^0.4.0", @@ -149,15 +155,16 @@ "c8": "^7.12.0", "chai": "^4.3.3", "dotenv": "^16.0.3", - "glob": "^9.3.4", + "glob": "^10.0.0", "json5": "^2.2.0", - "minimatch": "^8.0.3", + "minimatch": "^9.0.0", "mocha": "^10.0.0", "npm-run-all": "^4.1.5", "pirates": "^4.0.1", "puppeteer": "^19.1.2", - "rimraf": "^4.4.1", + "rimraf": "^5.0.0", "rollup": "^3.20.2", + "rollup-plugin-dts": "^5.3.0", "ts-standard": "^12.0.2", "tslib": "^2.3.1", "typedoc": "~0.23.0", @@ -167,16 +174,16 @@ }, "dependencies": { "@apidevtools/openapi-schemas": "^2.1.0", - "@juanelas/base64": "^1.1.0", + "@juanelas/base64": "^1.1.2", "ajv": "^8.11.0", "ajv-draft-04": "^1.0.0", "ajv-formats": "^2.1.1", - "bigint-conversion": "^2.4.0", - "bigint-crypto-utils": "^3.2.1", + "bigint-conversion": "^2.4.1", + "bigint-crypto-utils": "^3.2.2", "elliptic": "^6.5.4", "ethers": "^5.5.2", "jose": "^4.3.7", "lodash": "^4.17.21", - "object-sha": "^2.1.0" + "object-sha": "^2.1.1" } } diff --git a/types/conflict-resolution/ConflictResolver.d.cts b/types/conflict-resolution/ConflictResolver.d.cts deleted file mode 100644 index fd5ab3f..0000000 --- a/types/conflict-resolution/ConflictResolver.d.cts +++ /dev/null @@ -1,13 +0,0 @@ -import { NrpDltAgentDest } from '../dlt/agents/index.js'; -import { JwkPair } from '../types.js'; -export declare class ConflictResolver { - jwkPair: JwkPair; - dltAgent: NrpDltAgentDest; - private readonly initialized; - constructor(jwkPair: JwkPair, dltAgent: NrpDltAgentDest); - private init; - resolveCompleteness(verificationRequest: string): Promise; - resolveDispute(disputeRequest: string): Promise; - private _resolution; -} -//# sourceMappingURL=ConflictResolver.d.ts.map \ No newline at end of file diff --git a/types/conflict-resolution/ConflictResolver.d.cts.map b/types/conflict-resolution/ConflictResolver.d.cts.map deleted file mode 100644 index e68a72f..0000000 --- a/types/conflict-resolution/ConflictResolver.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ConflictResolver.d.ts","sourceRoot":"","sources":["../../src/ts/conflict-resolution/ConflictResolver.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAExD,OAAO,EAAmD,OAAO,EAA4F,MAAM,aAAa,CAAA;AAWhL,qBAAa,gBAAgB;IAC3B,OAAO,EAAE,OAAO,CAAA;IAChB,QAAQ,EAAE,eAAe,CAAA;IACzB,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAkB;gBAOjC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,eAAe;YAgB1C,IAAI;IAUZ,mBAAmB,CAAE,mBAAmB,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IA8ClE,cAAc,CAAE,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;YAqChD,WAAW;CAS1B"} \ No newline at end of file diff --git a/types/conflict-resolution/ConflictResolver.d.ts b/types/conflict-resolution/ConflictResolver.d.ts deleted file mode 100644 index fd5ab3f..0000000 --- a/types/conflict-resolution/ConflictResolver.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { NrpDltAgentDest } from '../dlt/agents/index.js'; -import { JwkPair } from '../types.js'; -export declare class ConflictResolver { - jwkPair: JwkPair; - dltAgent: NrpDltAgentDest; - private readonly initialized; - constructor(jwkPair: JwkPair, dltAgent: NrpDltAgentDest); - private init; - resolveCompleteness(verificationRequest: string): Promise; - resolveDispute(disputeRequest: string): Promise; - private _resolution; -} -//# sourceMappingURL=ConflictResolver.d.ts.map \ No newline at end of file diff --git a/types/conflict-resolution/ConflictResolver.d.ts.map b/types/conflict-resolution/ConflictResolver.d.ts.map deleted file mode 100644 index e68a72f..0000000 --- a/types/conflict-resolution/ConflictResolver.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ConflictResolver.d.ts","sourceRoot":"","sources":["../../src/ts/conflict-resolution/ConflictResolver.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAExD,OAAO,EAAmD,OAAO,EAA4F,MAAM,aAAa,CAAA;AAWhL,qBAAa,gBAAgB;IAC3B,OAAO,EAAE,OAAO,CAAA;IAChB,QAAQ,EAAE,eAAe,CAAA;IACzB,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAkB;gBAOjC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,eAAe;YAgB1C,IAAI;IAUZ,mBAAmB,CAAE,mBAAmB,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IA8ClE,cAAc,CAAE,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;YAqChD,WAAW;CAS1B"} \ No newline at end of file diff --git a/types/conflict-resolution/checkCompleteness.d.cts b/types/conflict-resolution/checkCompleteness.d.cts deleted file mode 100644 index c02c630..0000000 --- a/types/conflict-resolution/checkCompleteness.d.cts +++ /dev/null @@ -1,10 +0,0 @@ -import { NrpDltAgentDest } from '../dlt/index.js'; -import { JWK, PoOPayload, PoRPayload, VerificationRequestPayload } from '../types.js'; -export declare function checkCompleteness(verificationRequest: string, wallet: NrpDltAgentDest, connectionTimeout?: number): Promise<{ - vrPayload: VerificationRequestPayload; - porPayload: PoRPayload; - pooPayload: PoOPayload; - destPublicJwk: JWK; - origPublicJwk: JWK; -}>; -//# sourceMappingURL=checkCompleteness.d.ts.map \ No newline at end of file diff --git a/types/conflict-resolution/checkCompleteness.d.cts.map b/types/conflict-resolution/checkCompleteness.d.cts.map deleted file mode 100644 index b19bc36..0000000 --- a/types/conflict-resolution/checkCompleteness.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"checkCompleteness.d.ts","sourceRoot":"","sources":["../../src/ts/conflict-resolution/checkCompleteness.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAEjD,OAAO,EAAE,GAAG,EAAE,UAAU,EAAE,UAAU,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAA;AAUrF,wBAAsB,iBAAiB,CAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,EAAE,eAAe,EAAE,iBAAiB,SAAK,GAAG,OAAO,CAAC;IAAE,SAAS,EAAE,0BAA0B,CAAC;IAAC,UAAU,EAAE,UAAU,CAAC;IAAC,UAAU,EAAE,UAAU,CAAC;IAAC,aAAa,EAAE,GAAG,CAAC;IAAC,aAAa,EAAE,GAAG,CAAA;CAAE,CAAC,CAiCjQ"} \ No newline at end of file diff --git a/types/conflict-resolution/checkCompleteness.d.ts b/types/conflict-resolution/checkCompleteness.d.ts deleted file mode 100644 index c02c630..0000000 --- a/types/conflict-resolution/checkCompleteness.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { NrpDltAgentDest } from '../dlt/index.js'; -import { JWK, PoOPayload, PoRPayload, VerificationRequestPayload } from '../types.js'; -export declare function checkCompleteness(verificationRequest: string, wallet: NrpDltAgentDest, connectionTimeout?: number): Promise<{ - vrPayload: VerificationRequestPayload; - porPayload: PoRPayload; - pooPayload: PoOPayload; - destPublicJwk: JWK; - origPublicJwk: JWK; -}>; -//# sourceMappingURL=checkCompleteness.d.ts.map \ No newline at end of file diff --git a/types/conflict-resolution/checkCompleteness.d.ts.map b/types/conflict-resolution/checkCompleteness.d.ts.map deleted file mode 100644 index b19bc36..0000000 --- a/types/conflict-resolution/checkCompleteness.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"checkCompleteness.d.ts","sourceRoot":"","sources":["../../src/ts/conflict-resolution/checkCompleteness.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAEjD,OAAO,EAAE,GAAG,EAAE,UAAU,EAAE,UAAU,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAA;AAUrF,wBAAsB,iBAAiB,CAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,EAAE,eAAe,EAAE,iBAAiB,SAAK,GAAG,OAAO,CAAC;IAAE,SAAS,EAAE,0BAA0B,CAAC;IAAC,UAAU,EAAE,UAAU,CAAC;IAAC,UAAU,EAAE,UAAU,CAAC;IAAC,aAAa,EAAE,GAAG,CAAC;IAAC,aAAa,EAAE,GAAG,CAAA;CAAE,CAAC,CAiCjQ"} \ No newline at end of file diff --git a/types/conflict-resolution/checkDecryption.d.cts b/types/conflict-resolution/checkDecryption.d.cts deleted file mode 100644 index a7e79a1..0000000 --- a/types/conflict-resolution/checkDecryption.d.cts +++ /dev/null @@ -1,10 +0,0 @@ -import { NrpDltAgentDest } from '../dlt/index.js'; -import { DisputeRequestPayload, JWK, PoOPayload, PoRPayload } from '../types.js'; -export declare function checkDecryption(disputeRequest: string, wallet: NrpDltAgentDest): Promise<{ - drPayload: DisputeRequestPayload; - porPayload: PoRPayload; - pooPayload: PoOPayload; - destPublicJwk: JWK; - origPublicJwk: JWK; -}>; -//# sourceMappingURL=checkDecryption.d.ts.map \ No newline at end of file diff --git a/types/conflict-resolution/checkDecryption.d.cts.map b/types/conflict-resolution/checkDecryption.d.cts.map deleted file mode 100644 index d5f4690..0000000 --- a/types/conflict-resolution/checkDecryption.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"checkDecryption.d.ts","sourceRoot":"","sources":["../../src/ts/conflict-resolution/checkDecryption.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAEjD,OAAO,EAAE,qBAAqB,EAAE,GAAG,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAWhF,wBAAsB,eAAe,CAAE,cAAc,EAAE,MAAM,EAAE,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC;IAAE,SAAS,EAAE,qBAAqB,CAAC;IAAC,UAAU,EAAE,UAAU,CAAC;IAAC,UAAU,EAAE,UAAU,CAAC;IAAC,aAAa,EAAE,GAAG,CAAC;IAAC,aAAa,EAAE,GAAG,CAAA;CAAE,CAAC,CAuC7N"} \ No newline at end of file diff --git a/types/conflict-resolution/checkDecryption.d.ts b/types/conflict-resolution/checkDecryption.d.ts deleted file mode 100644 index a7e79a1..0000000 --- a/types/conflict-resolution/checkDecryption.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { NrpDltAgentDest } from '../dlt/index.js'; -import { DisputeRequestPayload, JWK, PoOPayload, PoRPayload } from '../types.js'; -export declare function checkDecryption(disputeRequest: string, wallet: NrpDltAgentDest): Promise<{ - drPayload: DisputeRequestPayload; - porPayload: PoRPayload; - pooPayload: PoOPayload; - destPublicJwk: JWK; - origPublicJwk: JWK; -}>; -//# sourceMappingURL=checkDecryption.d.ts.map \ No newline at end of file diff --git a/types/conflict-resolution/checkDecryption.d.ts.map b/types/conflict-resolution/checkDecryption.d.ts.map deleted file mode 100644 index d5f4690..0000000 --- a/types/conflict-resolution/checkDecryption.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"checkDecryption.d.ts","sourceRoot":"","sources":["../../src/ts/conflict-resolution/checkDecryption.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAEjD,OAAO,EAAE,qBAAqB,EAAE,GAAG,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAWhF,wBAAsB,eAAe,CAAE,cAAc,EAAE,MAAM,EAAE,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC;IAAE,SAAS,EAAE,qBAAqB,CAAC;IAAC,UAAU,EAAE,UAAU,CAAC;IAAC,UAAU,EAAE,UAAU,CAAC;IAAC,aAAa,EAAE,GAAG,CAAC;IAAC,aAAa,EAAE,GAAG,CAAA;CAAE,CAAC,CAuC7N"} \ No newline at end of file diff --git a/types/conflict-resolution/generateVerificationRequest.d.cts b/types/conflict-resolution/generateVerificationRequest.d.cts deleted file mode 100644 index 35aadc8..0000000 --- a/types/conflict-resolution/generateVerificationRequest.d.cts +++ /dev/null @@ -1,3 +0,0 @@ -import { JWK } from '../types.js'; -export declare function generateVerificationRequest(iss: 'orig' | 'dest', dataExchangeId: string, por: string, privateJwk: JWK): Promise; -//# sourceMappingURL=generateVerificationRequest.d.ts.map \ No newline at end of file diff --git a/types/conflict-resolution/generateVerificationRequest.d.cts.map b/types/conflict-resolution/generateVerificationRequest.d.cts.map deleted file mode 100644 index 0c67855..0000000 --- a/types/conflict-resolution/generateVerificationRequest.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"generateVerificationRequest.d.ts","sourceRoot":"","sources":["../../src/ts/conflict-resolution/generateVerificationRequest.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAA8B,MAAM,aAAa,CAAA;AAE7D,wBAAsB,2BAA2B,CAAE,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,GAAG,OAAO,CAAC,MAAM,CAAC,CAgB9I"} \ No newline at end of file diff --git a/types/conflict-resolution/generateVerificationRequest.d.ts b/types/conflict-resolution/generateVerificationRequest.d.ts deleted file mode 100644 index 35aadc8..0000000 --- a/types/conflict-resolution/generateVerificationRequest.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { JWK } from '../types.js'; -export declare function generateVerificationRequest(iss: 'orig' | 'dest', dataExchangeId: string, por: string, privateJwk: JWK): Promise; -//# sourceMappingURL=generateVerificationRequest.d.ts.map \ No newline at end of file diff --git a/types/conflict-resolution/generateVerificationRequest.d.ts.map b/types/conflict-resolution/generateVerificationRequest.d.ts.map deleted file mode 100644 index 0c67855..0000000 --- a/types/conflict-resolution/generateVerificationRequest.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"generateVerificationRequest.d.ts","sourceRoot":"","sources":["../../src/ts/conflict-resolution/generateVerificationRequest.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAA8B,MAAM,aAAa,CAAA;AAE7D,wBAAsB,2BAA2B,CAAE,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,GAAG,OAAO,CAAC,MAAM,CAAC,CAgB9I"} \ No newline at end of file diff --git a/types/conflict-resolution/index.d.cts b/types/conflict-resolution/index.d.cts deleted file mode 100644 index 1529498..0000000 --- a/types/conflict-resolution/index.d.cts +++ /dev/null @@ -1,7 +0,0 @@ -export * from './checkCompleteness.js'; -export * from './checkDecryption.js'; -export * from './ConflictResolver.js'; -export * from './generateVerificationRequest.js'; -export * from './verifyPor.js'; -export * from './verifyResolution.js'; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/types/conflict-resolution/index.d.cts.map b/types/conflict-resolution/index.d.cts.map deleted file mode 100644 index 1f422d3..0000000 --- a/types/conflict-resolution/index.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ts/conflict-resolution/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAA;AACtC,cAAc,sBAAsB,CAAA;AACpC,cAAc,uBAAuB,CAAA;AACrC,cAAc,kCAAkC,CAAA;AAChD,cAAc,gBAAgB,CAAA;AAC9B,cAAc,uBAAuB,CAAA"} \ No newline at end of file diff --git a/types/conflict-resolution/index.d.ts b/types/conflict-resolution/index.d.ts deleted file mode 100644 index 1529498..0000000 --- a/types/conflict-resolution/index.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -export * from './checkCompleteness.js'; -export * from './checkDecryption.js'; -export * from './ConflictResolver.js'; -export * from './generateVerificationRequest.js'; -export * from './verifyPor.js'; -export * from './verifyResolution.js'; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/types/conflict-resolution/index.d.ts.map b/types/conflict-resolution/index.d.ts.map deleted file mode 100644 index 1f422d3..0000000 --- a/types/conflict-resolution/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ts/conflict-resolution/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAA;AACtC,cAAc,sBAAsB,CAAA;AACpC,cAAc,uBAAuB,CAAA;AACrC,cAAc,kCAAkC,CAAA;AAChD,cAAc,gBAAgB,CAAA;AAC9B,cAAc,uBAAuB,CAAA"} \ No newline at end of file diff --git a/types/conflict-resolution/verifyPor.d.cts b/types/conflict-resolution/verifyPor.d.cts deleted file mode 100644 index 473eaed..0000000 --- a/types/conflict-resolution/verifyPor.d.cts +++ /dev/null @@ -1,10 +0,0 @@ -import { NrpDltAgentDest } from '../dlt/index.js'; -import { JWK, PoOPayload, PoRPayload } from '../types.js'; -export declare function verifyPor(por: string, wallet: NrpDltAgentDest, connectionTimeout?: number): Promise<{ - porPayload: PoRPayload; - pooPayload: PoOPayload; - secretHex: string; - destPublicJwk: JWK; - origPublicJwk: JWK; -}>; -//# sourceMappingURL=verifyPor.d.ts.map \ No newline at end of file diff --git a/types/conflict-resolution/verifyPor.d.cts.map b/types/conflict-resolution/verifyPor.d.cts.map deleted file mode 100644 index 5d9f903..0000000 --- a/types/conflict-resolution/verifyPor.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"verifyPor.d.ts","sourceRoot":"","sources":["../../src/ts/conflict-resolution/verifyPor.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAIjD,OAAO,EAAQ,GAAG,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAI/D,wBAAsB,SAAS,CAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,eAAe,EAAE,iBAAiB,SAAK,GAAG,OAAO,CAAC;IAAE,UAAU,EAAE,UAAU,CAAC;IAAC,UAAU,EAAE,UAAU,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,GAAG,CAAC;IAAC,aAAa,EAAE,GAAG,CAAA;CAAE,CAAC,CAkErN"} \ No newline at end of file diff --git a/types/conflict-resolution/verifyPor.d.ts b/types/conflict-resolution/verifyPor.d.ts deleted file mode 100644 index 473eaed..0000000 --- a/types/conflict-resolution/verifyPor.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { NrpDltAgentDest } from '../dlt/index.js'; -import { JWK, PoOPayload, PoRPayload } from '../types.js'; -export declare function verifyPor(por: string, wallet: NrpDltAgentDest, connectionTimeout?: number): Promise<{ - porPayload: PoRPayload; - pooPayload: PoOPayload; - secretHex: string; - destPublicJwk: JWK; - origPublicJwk: JWK; -}>; -//# sourceMappingURL=verifyPor.d.ts.map \ No newline at end of file diff --git a/types/conflict-resolution/verifyPor.d.ts.map b/types/conflict-resolution/verifyPor.d.ts.map deleted file mode 100644 index 5d9f903..0000000 --- a/types/conflict-resolution/verifyPor.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"verifyPor.d.ts","sourceRoot":"","sources":["../../src/ts/conflict-resolution/verifyPor.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAIjD,OAAO,EAAQ,GAAG,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAI/D,wBAAsB,SAAS,CAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,eAAe,EAAE,iBAAiB,SAAK,GAAG,OAAO,CAAC;IAAE,UAAU,EAAE,UAAU,CAAC;IAAC,UAAU,EAAE,UAAU,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,GAAG,CAAC;IAAC,aAAa,EAAE,GAAG,CAAA;CAAE,CAAC,CAkErN"} \ No newline at end of file diff --git a/types/conflict-resolution/verifyResolution.d.cts b/types/conflict-resolution/verifyResolution.d.cts deleted file mode 100644 index e098691..0000000 --- a/types/conflict-resolution/verifyResolution.d.cts +++ /dev/null @@ -1,3 +0,0 @@ -import { DecodedProof, JWK, ResolutionPayload } from '../types.js'; -export declare function verifyResolution(resolution: string, pubJwk?: JWK): Promise>; -//# sourceMappingURL=verifyResolution.d.ts.map \ No newline at end of file diff --git a/types/conflict-resolution/verifyResolution.d.cts.map b/types/conflict-resolution/verifyResolution.d.cts.map deleted file mode 100644 index 73323ec..0000000 --- a/types/conflict-resolution/verifyResolution.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"verifyResolution.d.ts","sourceRoot":"","sources":["../../src/ts/conflict-resolution/verifyResolution.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,GAAG,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAElE,wBAAsB,gBAAgB,CAAC,CAAC,SAAS,iBAAiB,EAAG,UAAU,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,GAAG,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAI/H"} \ No newline at end of file diff --git a/types/conflict-resolution/verifyResolution.d.ts b/types/conflict-resolution/verifyResolution.d.ts deleted file mode 100644 index e098691..0000000 --- a/types/conflict-resolution/verifyResolution.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { DecodedProof, JWK, ResolutionPayload } from '../types.js'; -export declare function verifyResolution(resolution: string, pubJwk?: JWK): Promise>; -//# sourceMappingURL=verifyResolution.d.ts.map \ No newline at end of file diff --git a/types/conflict-resolution/verifyResolution.d.ts.map b/types/conflict-resolution/verifyResolution.d.ts.map deleted file mode 100644 index 73323ec..0000000 --- a/types/conflict-resolution/verifyResolution.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"verifyResolution.d.ts","sourceRoot":"","sources":["../../src/ts/conflict-resolution/verifyResolution.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,GAAG,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAElE,wBAAsB,gBAAgB,CAAC,CAAC,SAAS,iBAAiB,EAAG,UAAU,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,GAAG,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAI/H"} \ No newline at end of file diff --git a/types/constants.d.cts b/types/constants.d.cts deleted file mode 100644 index df4fc78..0000000 --- a/types/constants.d.cts +++ /dev/null @@ -1,5 +0,0 @@ -export declare const HASH_ALGS: readonly ["SHA-256", "SHA-384", "SHA-512"]; -export declare const SIGNING_ALGS: readonly ["ES256", "ES384", "ES512"]; -export declare const ENC_ALGS: readonly ["A128GCM", "A256GCM"]; -export declare const KEY_AGREEMENT_ALGS: readonly ["ECDH-ES"]; -//# sourceMappingURL=constants.d.ts.map \ No newline at end of file diff --git a/types/constants.d.cts.map b/types/constants.d.cts.map deleted file mode 100644 index ab19edc..0000000 --- a/types/constants.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/ts/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS,4CAA6C,CAAA;AACnE,eAAO,MAAM,YAAY,sCAAuC,CAAA;AAChE,eAAO,MAAM,QAAQ,iCAAkC,CAAA;AACvD,eAAO,MAAM,kBAAkB,sBAAuB,CAAA"} \ No newline at end of file diff --git a/types/constants.d.ts b/types/constants.d.ts deleted file mode 100644 index df4fc78..0000000 --- a/types/constants.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export declare const HASH_ALGS: readonly ["SHA-256", "SHA-384", "SHA-512"]; -export declare const SIGNING_ALGS: readonly ["ES256", "ES384", "ES512"]; -export declare const ENC_ALGS: readonly ["A128GCM", "A256GCM"]; -export declare const KEY_AGREEMENT_ALGS: readonly ["ECDH-ES"]; -//# sourceMappingURL=constants.d.ts.map \ No newline at end of file diff --git a/types/constants.d.ts.map b/types/constants.d.ts.map deleted file mode 100644 index ab19edc..0000000 --- a/types/constants.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/ts/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS,4CAA6C,CAAA;AACnE,eAAO,MAAM,YAAY,sCAAuC,CAAA;AAChE,eAAO,MAAM,QAAQ,iCAAkC,CAAA;AACvD,eAAO,MAAM,kBAAkB,sBAAuB,CAAA"} \ No newline at end of file diff --git a/types/crypto/generateKeys.d.cts b/types/crypto/generateKeys.d.cts deleted file mode 100644 index d5dde8d..0000000 --- a/types/crypto/generateKeys.d.cts +++ /dev/null @@ -1,3 +0,0 @@ -import { JwkPair, SigningAlg } from '../types.js'; -export declare function generateKeys(alg: SigningAlg, privateKey?: Uint8Array | string, base64?: boolean): Promise; -//# sourceMappingURL=generateKeys.d.ts.map \ No newline at end of file diff --git a/types/crypto/generateKeys.d.cts.map b/types/crypto/generateKeys.d.cts.map deleted file mode 100644 index 87994c5..0000000 --- a/types/crypto/generateKeys.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"generateKeys.d.ts","sourceRoot":"","sources":["../../src/ts/crypto/generateKeys.ts"],"names":[],"mappings":"AAMA,OAAO,EAAO,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAWtD,wBAAsB,YAAY,CAAE,GAAG,EAAE,UAAU,EAAE,UAAU,CAAC,EAAE,UAAU,GAAG,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAuDzH"} \ No newline at end of file diff --git a/types/crypto/generateKeys.d.ts b/types/crypto/generateKeys.d.ts deleted file mode 100644 index d5dde8d..0000000 --- a/types/crypto/generateKeys.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { JwkPair, SigningAlg } from '../types.js'; -export declare function generateKeys(alg: SigningAlg, privateKey?: Uint8Array | string, base64?: boolean): Promise; -//# sourceMappingURL=generateKeys.d.ts.map \ No newline at end of file diff --git a/types/crypto/generateKeys.d.ts.map b/types/crypto/generateKeys.d.ts.map deleted file mode 100644 index 87994c5..0000000 --- a/types/crypto/generateKeys.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"generateKeys.d.ts","sourceRoot":"","sources":["../../src/ts/crypto/generateKeys.ts"],"names":[],"mappings":"AAMA,OAAO,EAAO,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAWtD,wBAAsB,YAAY,CAAE,GAAG,EAAE,UAAU,EAAE,UAAU,CAAC,EAAE,UAAU,GAAG,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAuDzH"} \ No newline at end of file diff --git a/types/crypto/importJwk.d.cts b/types/crypto/importJwk.d.cts deleted file mode 100644 index 27cdfac..0000000 --- a/types/crypto/importJwk.d.cts +++ /dev/null @@ -1,3 +0,0 @@ -import { JWK, KeyLike } from '../types.js'; -export declare function importJwk(jwk: JWK, alg?: string): Promise; -//# sourceMappingURL=importJwk.d.ts.map \ No newline at end of file diff --git a/types/crypto/importJwk.d.cts.map b/types/crypto/importJwk.d.cts.map deleted file mode 100644 index c7eb6af..0000000 --- a/types/crypto/importJwk.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"importJwk.d.ts","sourceRoot":"","sources":["../../src/ts/crypto/importJwk.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAE1C,wBAAsB,SAAS,CAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,GAAG,UAAU,CAAC,CAetF"} \ No newline at end of file diff --git a/types/crypto/importJwk.d.ts b/types/crypto/importJwk.d.ts deleted file mode 100644 index 27cdfac..0000000 --- a/types/crypto/importJwk.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { JWK, KeyLike } from '../types.js'; -export declare function importJwk(jwk: JWK, alg?: string): Promise; -//# sourceMappingURL=importJwk.d.ts.map \ No newline at end of file diff --git a/types/crypto/importJwk.d.ts.map b/types/crypto/importJwk.d.ts.map deleted file mode 100644 index c7eb6af..0000000 --- a/types/crypto/importJwk.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"importJwk.d.ts","sourceRoot":"","sources":["../../src/ts/crypto/importJwk.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAE1C,wBAAsB,SAAS,CAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,GAAG,UAAU,CAAC,CAetF"} \ No newline at end of file diff --git a/types/crypto/index.d.cts b/types/crypto/index.d.cts deleted file mode 100644 index 61252f6..0000000 --- a/types/crypto/index.d.cts +++ /dev/null @@ -1,7 +0,0 @@ -export * from './generateKeys.js'; -export * from './importJwk.js'; -export * from './jwe.js'; -export * from './jwsDecode.js'; -export * from './oneTimeSecret.js'; -export * from './verifyKeyPair.js'; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/types/crypto/index.d.cts.map b/types/crypto/index.d.cts.map deleted file mode 100644 index 6dd86ff..0000000 --- a/types/crypto/index.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ts/crypto/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAA;AACjC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,UAAU,CAAA;AACxB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,oBAAoB,CAAA;AAClC,cAAc,oBAAoB,CAAA"} \ No newline at end of file diff --git a/types/crypto/index.d.ts b/types/crypto/index.d.ts deleted file mode 100644 index 61252f6..0000000 --- a/types/crypto/index.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -export * from './generateKeys.js'; -export * from './importJwk.js'; -export * from './jwe.js'; -export * from './jwsDecode.js'; -export * from './oneTimeSecret.js'; -export * from './verifyKeyPair.js'; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/types/crypto/index.d.ts.map b/types/crypto/index.d.ts.map deleted file mode 100644 index 6dd86ff..0000000 --- a/types/crypto/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ts/crypto/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAA;AACjC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,UAAU,CAAA;AACxB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,oBAAoB,CAAA;AAClC,cAAc,oBAAoB,CAAA"} \ No newline at end of file diff --git a/types/crypto/jwe.d.cts b/types/crypto/jwe.d.cts deleted file mode 100644 index ac965f7..0000000 --- a/types/crypto/jwe.d.cts +++ /dev/null @@ -1,5 +0,0 @@ -import { CompactDecryptResult } from 'jose'; -import { EncryptionAlg, JWK } from '../types.js'; -export declare function jweEncrypt(block: Uint8Array, secretOrPublicKey: JWK, encAlg?: EncryptionAlg): Promise; -export declare function jweDecrypt(jwe: string, secretOrPrivateKey: JWK): Promise; -//# sourceMappingURL=jwe.d.ts.map \ No newline at end of file diff --git a/types/crypto/jwe.d.cts.map b/types/crypto/jwe.d.cts.map deleted file mode 100644 index b9909a9..0000000 --- a/types/crypto/jwe.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"jwe.d.ts","sourceRoot":"","sources":["../../src/ts/crypto/jwe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,oBAAoB,EAAyC,MAAM,MAAM,CAAA;AAGlG,OAAO,EAAE,aAAa,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;AAWhD,wBAAsB,UAAU,CAAE,KAAK,EAAE,UAAU,EAAE,iBAAiB,EAAE,GAAG,EAAE,MAAM,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,CAiCpH;AAQD,wBAAsB,UAAU,CAAE,GAAG,EAAE,MAAM,EAAE,kBAAkB,EAAE,GAAG,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAiBrG"} \ No newline at end of file diff --git a/types/crypto/jwe.d.ts b/types/crypto/jwe.d.ts deleted file mode 100644 index ac965f7..0000000 --- a/types/crypto/jwe.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { CompactDecryptResult } from 'jose'; -import { EncryptionAlg, JWK } from '../types.js'; -export declare function jweEncrypt(block: Uint8Array, secretOrPublicKey: JWK, encAlg?: EncryptionAlg): Promise; -export declare function jweDecrypt(jwe: string, secretOrPrivateKey: JWK): Promise; -//# sourceMappingURL=jwe.d.ts.map \ No newline at end of file diff --git a/types/crypto/jwe.d.ts.map b/types/crypto/jwe.d.ts.map deleted file mode 100644 index b9909a9..0000000 --- a/types/crypto/jwe.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"jwe.d.ts","sourceRoot":"","sources":["../../src/ts/crypto/jwe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,oBAAoB,EAAyC,MAAM,MAAM,CAAA;AAGlG,OAAO,EAAE,aAAa,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;AAWhD,wBAAsB,UAAU,CAAE,KAAK,EAAE,UAAU,EAAE,iBAAiB,EAAE,GAAG,EAAE,MAAM,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,CAiCpH;AAQD,wBAAsB,UAAU,CAAE,GAAG,EAAE,MAAM,EAAE,kBAAkB,EAAE,GAAG,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAiBrG"} \ No newline at end of file diff --git a/types/crypto/jwsDecode.d.cts b/types/crypto/jwsDecode.d.cts deleted file mode 100644 index 599f50e..0000000 --- a/types/crypto/jwsDecode.d.cts +++ /dev/null @@ -1,3 +0,0 @@ -import { DecodedProof, getFromJws, JWK, ProofPayload } from '../types.js'; -export declare function jwsDecode(jws: string, publicJwk?: JWK | getFromJws): Promise>; -//# sourceMappingURL=jwsDecode.d.ts.map \ No newline at end of file diff --git a/types/crypto/jwsDecode.d.cts.map b/types/crypto/jwsDecode.d.cts.map deleted file mode 100644 index 080443d..0000000 --- a/types/crypto/jwsDecode.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"jwsDecode.d.ts","sourceRoot":"","sources":["../../src/ts/crypto/jwsDecode.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAQzE,wBAAsB,SAAS,CAAC,CAAC,SAAS,YAAY,EAAG,GAAG,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,GAAG,GAAG,UAAU,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAiC/H"} \ No newline at end of file diff --git a/types/crypto/jwsDecode.d.ts b/types/crypto/jwsDecode.d.ts deleted file mode 100644 index 599f50e..0000000 --- a/types/crypto/jwsDecode.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { DecodedProof, getFromJws, JWK, ProofPayload } from '../types.js'; -export declare function jwsDecode(jws: string, publicJwk?: JWK | getFromJws): Promise>; -//# sourceMappingURL=jwsDecode.d.ts.map \ No newline at end of file diff --git a/types/crypto/jwsDecode.d.ts.map b/types/crypto/jwsDecode.d.ts.map deleted file mode 100644 index 080443d..0000000 --- a/types/crypto/jwsDecode.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"jwsDecode.d.ts","sourceRoot":"","sources":["../../src/ts/crypto/jwsDecode.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAQzE,wBAAsB,SAAS,CAAC,CAAC,SAAS,YAAY,EAAG,GAAG,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,GAAG,GAAG,UAAU,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAiC/H"} \ No newline at end of file diff --git a/types/crypto/oneTimeSecret.d.cts b/types/crypto/oneTimeSecret.d.cts deleted file mode 100644 index b3a1d4d..0000000 --- a/types/crypto/oneTimeSecret.d.cts +++ /dev/null @@ -1,3 +0,0 @@ -import { Block, EncryptionAlg } from '../types.js'; -export declare function oneTimeSecret(encAlg: EncryptionAlg, secret?: Uint8Array | string, base64?: boolean): Promise>; -//# sourceMappingURL=oneTimeSecret.d.ts.map \ No newline at end of file diff --git a/types/crypto/oneTimeSecret.d.cts.map b/types/crypto/oneTimeSecret.d.cts.map deleted file mode 100644 index 35c115a..0000000 --- a/types/crypto/oneTimeSecret.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"oneTimeSecret.d.ts","sourceRoot":"","sources":["../../src/ts/crypto/oneTimeSecret.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,EAAE,aAAa,EAAO,MAAM,aAAa,CAAA;AAYvD,wBAAsB,aAAa,CAAE,MAAM,EAAE,aAAa,EAAE,MAAM,CAAC,EAAE,UAAU,GAAG,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAC,CAAC,CAuCxJ"} \ No newline at end of file diff --git a/types/crypto/oneTimeSecret.d.ts b/types/crypto/oneTimeSecret.d.ts deleted file mode 100644 index b3a1d4d..0000000 --- a/types/crypto/oneTimeSecret.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { Block, EncryptionAlg } from '../types.js'; -export declare function oneTimeSecret(encAlg: EncryptionAlg, secret?: Uint8Array | string, base64?: boolean): Promise>; -//# sourceMappingURL=oneTimeSecret.d.ts.map \ No newline at end of file diff --git a/types/crypto/oneTimeSecret.d.ts.map b/types/crypto/oneTimeSecret.d.ts.map deleted file mode 100644 index 35c115a..0000000 --- a/types/crypto/oneTimeSecret.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"oneTimeSecret.d.ts","sourceRoot":"","sources":["../../src/ts/crypto/oneTimeSecret.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,EAAE,aAAa,EAAO,MAAM,aAAa,CAAA;AAYvD,wBAAsB,aAAa,CAAE,MAAM,EAAE,aAAa,EAAE,MAAM,CAAC,EAAE,UAAU,GAAG,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAC,CAAC,CAuCxJ"} \ No newline at end of file diff --git a/types/crypto/verifyKeyPair.d.cts b/types/crypto/verifyKeyPair.d.cts deleted file mode 100644 index b391490..0000000 --- a/types/crypto/verifyKeyPair.d.cts +++ /dev/null @@ -1,3 +0,0 @@ -import { JWK } from '../types.js'; -export declare function verifyKeyPair(pubJWK: JWK, privJWK: JWK): Promise; -//# sourceMappingURL=verifyKeyPair.d.ts.map \ No newline at end of file diff --git a/types/crypto/verifyKeyPair.d.cts.map b/types/crypto/verifyKeyPair.d.cts.map deleted file mode 100644 index abce1a8..0000000 --- a/types/crypto/verifyKeyPair.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"verifyKeyPair.d.ts","sourceRoot":"","sources":["../../src/ts/crypto/verifyKeyPair.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;AAEjC,wBAAsB,aAAa,CAAE,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,CAiB7E"} \ No newline at end of file diff --git a/types/crypto/verifyKeyPair.d.ts b/types/crypto/verifyKeyPair.d.ts deleted file mode 100644 index b391490..0000000 --- a/types/crypto/verifyKeyPair.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { JWK } from '../types.js'; -export declare function verifyKeyPair(pubJWK: JWK, privJWK: JWK): Promise; -//# sourceMappingURL=verifyKeyPair.d.ts.map \ No newline at end of file diff --git a/types/crypto/verifyKeyPair.d.ts.map b/types/crypto/verifyKeyPair.d.ts.map deleted file mode 100644 index abce1a8..0000000 --- a/types/crypto/verifyKeyPair.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"verifyKeyPair.d.ts","sourceRoot":"","sources":["../../src/ts/crypto/verifyKeyPair.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;AAEjC,wBAAsB,aAAa,CAAE,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,CAiB7E"} \ No newline at end of file diff --git a/types/dlt/agents/EthersIoAgent.d.cts b/types/dlt/agents/EthersIoAgent.d.cts deleted file mode 100644 index 2fdeec2..0000000 --- a/types/dlt/agents/EthersIoAgent.d.cts +++ /dev/null @@ -1,12 +0,0 @@ -import { ethers } from 'ethers'; -import { DltConfig } from '../../types.js'; -import { NrpDltAgent } from './NrpDltAgent.js'; -export declare class EthersIoAgent extends NrpDltAgent { - dltConfig: DltConfig; - contract: ethers.Contract; - provider: ethers.providers.Provider; - initialized: Promise; - constructor(dltConfig: (Partial & Pick) | Promise<(Partial & Pick)>); - getContractAddress(): Promise; -} -//# sourceMappingURL=EthersIoAgent.d.ts.map \ No newline at end of file diff --git a/types/dlt/agents/EthersIoAgent.d.cts.map b/types/dlt/agents/EthersIoAgent.d.cts.map deleted file mode 100644 index d021c02..0000000 --- a/types/dlt/agents/EthersIoAgent.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"EthersIoAgent.d.ts","sourceRoot":"","sources":["../../../src/ts/dlt/agents/EthersIoAgent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE1C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAK9C,qBAAa,aAAc,SAAQ,WAAW;IAC5C,SAAS,EAAG,SAAS,CAAA;IACrB,QAAQ,EAAG,MAAM,CAAC,QAAQ,CAAA;IAC1B,QAAQ,EAAG,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAA;IACpC,WAAW,EAAE,OAAO,CAAC,OAAO,CAAC,CAAA;gBAEhB,SAAS,EAAE,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC,SAAS,EAAE,gBAAgB,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC,SAAS,EAAE,gBAAgB,CAAC,CAAC,CAAC;IA4B9I,kBAAkB,IAAK,OAAO,CAAC,MAAM,CAAC;CAI7C"} \ No newline at end of file diff --git a/types/dlt/agents/EthersIoAgent.d.ts b/types/dlt/agents/EthersIoAgent.d.ts deleted file mode 100644 index 2fdeec2..0000000 --- a/types/dlt/agents/EthersIoAgent.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { ethers } from 'ethers'; -import { DltConfig } from '../../types.js'; -import { NrpDltAgent } from './NrpDltAgent.js'; -export declare class EthersIoAgent extends NrpDltAgent { - dltConfig: DltConfig; - contract: ethers.Contract; - provider: ethers.providers.Provider; - initialized: Promise; - constructor(dltConfig: (Partial & Pick) | Promise<(Partial & Pick)>); - getContractAddress(): Promise; -} -//# sourceMappingURL=EthersIoAgent.d.ts.map \ No newline at end of file diff --git a/types/dlt/agents/EthersIoAgent.d.ts.map b/types/dlt/agents/EthersIoAgent.d.ts.map deleted file mode 100644 index d021c02..0000000 --- a/types/dlt/agents/EthersIoAgent.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"EthersIoAgent.d.ts","sourceRoot":"","sources":["../../../src/ts/dlt/agents/EthersIoAgent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE1C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAK9C,qBAAa,aAAc,SAAQ,WAAW;IAC5C,SAAS,EAAG,SAAS,CAAA;IACrB,QAAQ,EAAG,MAAM,CAAC,QAAQ,CAAA;IAC1B,QAAQ,EAAG,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAA;IACpC,WAAW,EAAE,OAAO,CAAC,OAAO,CAAC,CAAA;gBAEhB,SAAS,EAAE,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC,SAAS,EAAE,gBAAgB,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC,SAAS,EAAE,gBAAgB,CAAC,CAAC,CAAC;IA4B9I,kBAAkB,IAAK,OAAO,CAAC,MAAM,CAAC;CAI7C"} \ No newline at end of file diff --git a/types/dlt/agents/I3mServerWalletAgent.d.cts b/types/dlt/agents/I3mServerWalletAgent.d.cts deleted file mode 100644 index f9619c4..0000000 --- a/types/dlt/agents/I3mServerWalletAgent.d.cts +++ /dev/null @@ -1,9 +0,0 @@ -import { ServerWallet } from '@i3m/server-wallet/types'; -import { DltConfig } from '../../types.js'; -import { EthersIoAgent } from './EthersIoAgent.js'; -export declare class I3mServerWalletAgent extends EthersIoAgent { - wallet: ServerWallet; - did: string; - constructor(serverWallet: ServerWallet, did: string, dltConfig?: Partial>); -} -//# sourceMappingURL=I3mServerWalletAgent.d.ts.map \ No newline at end of file diff --git a/types/dlt/agents/I3mServerWalletAgent.d.cts.map b/types/dlt/agents/I3mServerWalletAgent.d.cts.map deleted file mode 100644 index e743f99..0000000 --- a/types/dlt/agents/I3mServerWalletAgent.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"I3mServerWalletAgent.d.ts","sourceRoot":"","sources":["../../../src/ts/dlt/agents/I3mServerWalletAgent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAKlD,qBAAa,oBAAqB,SAAQ,aAAa;IACrD,MAAM,EAAE,YAAY,CAAA;IACpB,GAAG,EAAE,MAAM,CAAA;gBAEE,YAAY,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,gBAAgB,CAAC,CAAC;CAkB7G"} \ No newline at end of file diff --git a/types/dlt/agents/I3mServerWalletAgent.d.ts b/types/dlt/agents/I3mServerWalletAgent.d.ts deleted file mode 100644 index f9619c4..0000000 --- a/types/dlt/agents/I3mServerWalletAgent.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { ServerWallet } from '@i3m/server-wallet/types'; -import { DltConfig } from '../../types.js'; -import { EthersIoAgent } from './EthersIoAgent.js'; -export declare class I3mServerWalletAgent extends EthersIoAgent { - wallet: ServerWallet; - did: string; - constructor(serverWallet: ServerWallet, did: string, dltConfig?: Partial>); -} -//# sourceMappingURL=I3mServerWalletAgent.d.ts.map \ No newline at end of file diff --git a/types/dlt/agents/I3mServerWalletAgent.d.ts.map b/types/dlt/agents/I3mServerWalletAgent.d.ts.map deleted file mode 100644 index e743f99..0000000 --- a/types/dlt/agents/I3mServerWalletAgent.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"I3mServerWalletAgent.d.ts","sourceRoot":"","sources":["../../../src/ts/dlt/agents/I3mServerWalletAgent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAKlD,qBAAa,oBAAqB,SAAQ,aAAa;IACrD,MAAM,EAAE,YAAY,CAAA;IACpB,GAAG,EAAE,MAAM,CAAA;gBAEE,YAAY,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,gBAAgB,CAAC,CAAC;CAkB7G"} \ No newline at end of file diff --git a/types/dlt/agents/I3mWalletAgent.d.cts b/types/dlt/agents/I3mWalletAgent.d.cts deleted file mode 100644 index 1fde188..0000000 --- a/types/dlt/agents/I3mWalletAgent.d.cts +++ /dev/null @@ -1,9 +0,0 @@ -import { WalletApi } from '@i3m/wallet-protocol-api/types'; -import { DltConfig } from '../../types.js'; -import { EthersIoAgent } from './EthersIoAgent.js'; -export declare class I3mWalletAgent extends EthersIoAgent { - wallet: WalletApi; - did: string; - constructor(wallet: WalletApi, did: string, dltConfig?: Partial>); -} -//# sourceMappingURL=I3mWalletAgent.d.ts.map \ No newline at end of file diff --git a/types/dlt/agents/I3mWalletAgent.d.cts.map b/types/dlt/agents/I3mWalletAgent.d.cts.map deleted file mode 100644 index 01c0a20..0000000 --- a/types/dlt/agents/I3mWalletAgent.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"I3mWalletAgent.d.ts","sourceRoot":"","sources":["../../../src/ts/dlt/agents/I3mWalletAgent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAA;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAKlD,qBAAa,cAAe,SAAQ,aAAa;IAC/C,MAAM,EAAE,SAAS,CAAA;IACjB,GAAG,EAAE,MAAM,CAAA;gBAEE,MAAM,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,gBAAgB,CAAC,CAAC;CAkBpG"} \ No newline at end of file diff --git a/types/dlt/agents/I3mWalletAgent.d.ts b/types/dlt/agents/I3mWalletAgent.d.ts deleted file mode 100644 index 1fde188..0000000 --- a/types/dlt/agents/I3mWalletAgent.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { WalletApi } from '@i3m/wallet-protocol-api/types'; -import { DltConfig } from '../../types.js'; -import { EthersIoAgent } from './EthersIoAgent.js'; -export declare class I3mWalletAgent extends EthersIoAgent { - wallet: WalletApi; - did: string; - constructor(wallet: WalletApi, did: string, dltConfig?: Partial>); -} -//# sourceMappingURL=I3mWalletAgent.d.ts.map \ No newline at end of file diff --git a/types/dlt/agents/I3mWalletAgent.d.ts.map b/types/dlt/agents/I3mWalletAgent.d.ts.map deleted file mode 100644 index 01c0a20..0000000 --- a/types/dlt/agents/I3mWalletAgent.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"I3mWalletAgent.d.ts","sourceRoot":"","sources":["../../../src/ts/dlt/agents/I3mWalletAgent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAA;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAKlD,qBAAa,cAAe,SAAQ,aAAa;IAC/C,MAAM,EAAE,SAAS,CAAA;IACjB,GAAG,EAAE,MAAM,CAAA;gBAEE,MAAM,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,gBAAgB,CAAC,CAAC;CAkBpG"} \ No newline at end of file diff --git a/types/dlt/agents/NrpDltAgent.d.cts b/types/dlt/agents/NrpDltAgent.d.cts deleted file mode 100644 index 285924c..0000000 --- a/types/dlt/agents/NrpDltAgent.d.cts +++ /dev/null @@ -1,4 +0,0 @@ -export declare abstract class NrpDltAgent { - abstract getContractAddress(): Promise; -} -//# sourceMappingURL=NrpDltAgent.d.ts.map \ No newline at end of file diff --git a/types/dlt/agents/NrpDltAgent.d.cts.map b/types/dlt/agents/NrpDltAgent.d.cts.map deleted file mode 100644 index 27c864e..0000000 --- a/types/dlt/agents/NrpDltAgent.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"NrpDltAgent.d.ts","sourceRoot":"","sources":["../../../src/ts/dlt/agents/NrpDltAgent.ts"],"names":[],"mappings":"AAIA,8BAAsB,WAAW;IAI/B,QAAQ,CAAC,kBAAkB,IAAK,OAAO,CAAC,MAAM,CAAC;CAChD"} \ No newline at end of file diff --git a/types/dlt/agents/NrpDltAgent.d.ts b/types/dlt/agents/NrpDltAgent.d.ts deleted file mode 100644 index 285924c..0000000 --- a/types/dlt/agents/NrpDltAgent.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export declare abstract class NrpDltAgent { - abstract getContractAddress(): Promise; -} -//# sourceMappingURL=NrpDltAgent.d.ts.map \ No newline at end of file diff --git a/types/dlt/agents/NrpDltAgent.d.ts.map b/types/dlt/agents/NrpDltAgent.d.ts.map deleted file mode 100644 index 27c864e..0000000 --- a/types/dlt/agents/NrpDltAgent.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"NrpDltAgent.d.ts","sourceRoot":"","sources":["../../../src/ts/dlt/agents/NrpDltAgent.ts"],"names":[],"mappings":"AAIA,8BAAsB,WAAW;IAI/B,QAAQ,CAAC,kBAAkB,IAAK,OAAO,CAAC,MAAM,CAAC;CAChD"} \ No newline at end of file diff --git a/types/dlt/agents/dest/EthersIoAgentDest.d.cts b/types/dlt/agents/dest/EthersIoAgentDest.d.cts deleted file mode 100644 index 5072167..0000000 --- a/types/dlt/agents/dest/EthersIoAgentDest.d.cts +++ /dev/null @@ -1,9 +0,0 @@ -import { EthersIoAgent } from '../EthersIoAgent.js'; -import { NrpDltAgentDest } from './NrpDltAgentDest.js'; -export declare class EthersIoAgentDest extends EthersIoAgent implements NrpDltAgentDest { - getSecretFromLedger(secretLength: number, signerAddress: string, exchangeId: string, timeout: number): Promise<{ - hex: string; - iat: number; - }>; -} -//# sourceMappingURL=EthersIoAgentDest.d.ts.map \ No newline at end of file diff --git a/types/dlt/agents/dest/EthersIoAgentDest.d.cts.map b/types/dlt/agents/dest/EthersIoAgentDest.d.cts.map deleted file mode 100644 index 3da8bf1..0000000 --- a/types/dlt/agents/dest/EthersIoAgentDest.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"EthersIoAgentDest.d.ts","sourceRoot":"","sources":["../../../../src/ts/dlt/agents/dest/EthersIoAgentDest.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAKtD,qBAAa,iBAAkB,SAAQ,aAAc,YAAW,eAAe;IACvE,mBAAmB,CAAE,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;CAIpJ"} \ No newline at end of file diff --git a/types/dlt/agents/dest/EthersIoAgentDest.d.ts b/types/dlt/agents/dest/EthersIoAgentDest.d.ts deleted file mode 100644 index 5072167..0000000 --- a/types/dlt/agents/dest/EthersIoAgentDest.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { EthersIoAgent } from '../EthersIoAgent.js'; -import { NrpDltAgentDest } from './NrpDltAgentDest.js'; -export declare class EthersIoAgentDest extends EthersIoAgent implements NrpDltAgentDest { - getSecretFromLedger(secretLength: number, signerAddress: string, exchangeId: string, timeout: number): Promise<{ - hex: string; - iat: number; - }>; -} -//# sourceMappingURL=EthersIoAgentDest.d.ts.map \ No newline at end of file diff --git a/types/dlt/agents/dest/EthersIoAgentDest.d.ts.map b/types/dlt/agents/dest/EthersIoAgentDest.d.ts.map deleted file mode 100644 index 3da8bf1..0000000 --- a/types/dlt/agents/dest/EthersIoAgentDest.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"EthersIoAgentDest.d.ts","sourceRoot":"","sources":["../../../../src/ts/dlt/agents/dest/EthersIoAgentDest.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAKtD,qBAAa,iBAAkB,SAAQ,aAAc,YAAW,eAAe;IACvE,mBAAmB,CAAE,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;CAIpJ"} \ No newline at end of file diff --git a/types/dlt/agents/dest/I3mServerWalletAgentDest.d.cts b/types/dlt/agents/dest/I3mServerWalletAgentDest.d.cts deleted file mode 100644 index 84f1157..0000000 --- a/types/dlt/agents/dest/I3mServerWalletAgentDest.d.cts +++ /dev/null @@ -1,9 +0,0 @@ -import { I3mServerWalletAgent } from '../I3mServerWalletAgent.js'; -import { NrpDltAgentDest } from './NrpDltAgentDest.js'; -export declare class I3mServerWalletAgentDest extends I3mServerWalletAgent implements NrpDltAgentDest { - getSecretFromLedger(secretLength: number, signerAddress: string, exchangeId: string, timeout: number): Promise<{ - hex: string; - iat: number; - }>; -} -//# sourceMappingURL=I3mServerWalletAgentDest.d.ts.map \ No newline at end of file diff --git a/types/dlt/agents/dest/I3mServerWalletAgentDest.d.cts.map b/types/dlt/agents/dest/I3mServerWalletAgentDest.d.cts.map deleted file mode 100644 index 8661901..0000000 --- a/types/dlt/agents/dest/I3mServerWalletAgentDest.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"I3mServerWalletAgentDest.d.ts","sourceRoot":"","sources":["../../../../src/ts/dlt/agents/dest/I3mServerWalletAgentDest.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAA;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAKtD,qBAAa,wBAAyB,SAAQ,oBAAqB,YAAW,eAAe;IACrF,mBAAmB,CAAE,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;CAIpJ"} \ No newline at end of file diff --git a/types/dlt/agents/dest/I3mServerWalletAgentDest.d.ts b/types/dlt/agents/dest/I3mServerWalletAgentDest.d.ts deleted file mode 100644 index 84f1157..0000000 --- a/types/dlt/agents/dest/I3mServerWalletAgentDest.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { I3mServerWalletAgent } from '../I3mServerWalletAgent.js'; -import { NrpDltAgentDest } from './NrpDltAgentDest.js'; -export declare class I3mServerWalletAgentDest extends I3mServerWalletAgent implements NrpDltAgentDest { - getSecretFromLedger(secretLength: number, signerAddress: string, exchangeId: string, timeout: number): Promise<{ - hex: string; - iat: number; - }>; -} -//# sourceMappingURL=I3mServerWalletAgentDest.d.ts.map \ No newline at end of file diff --git a/types/dlt/agents/dest/I3mServerWalletAgentDest.d.ts.map b/types/dlt/agents/dest/I3mServerWalletAgentDest.d.ts.map deleted file mode 100644 index 8661901..0000000 --- a/types/dlt/agents/dest/I3mServerWalletAgentDest.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"I3mServerWalletAgentDest.d.ts","sourceRoot":"","sources":["../../../../src/ts/dlt/agents/dest/I3mServerWalletAgentDest.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAA;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAKtD,qBAAa,wBAAyB,SAAQ,oBAAqB,YAAW,eAAe;IACrF,mBAAmB,CAAE,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;CAIpJ"} \ No newline at end of file diff --git a/types/dlt/agents/dest/I3mWalletAgentDest.d.cts b/types/dlt/agents/dest/I3mWalletAgentDest.d.cts deleted file mode 100644 index ab1fdf1..0000000 --- a/types/dlt/agents/dest/I3mWalletAgentDest.d.cts +++ /dev/null @@ -1,9 +0,0 @@ -import { I3mWalletAgent } from '../I3mWalletAgent.js'; -import { NrpDltAgentDest } from './NrpDltAgentDest.js'; -export declare class I3mWalletAgentDest extends I3mWalletAgent implements NrpDltAgentDest { - getSecretFromLedger(secretLength: number, signerAddress: string, exchangeId: string, timeout: number): Promise<{ - hex: string; - iat: number; - }>; -} -//# sourceMappingURL=I3mWalletAgentDest.d.ts.map \ No newline at end of file diff --git a/types/dlt/agents/dest/I3mWalletAgentDest.d.cts.map b/types/dlt/agents/dest/I3mWalletAgentDest.d.cts.map deleted file mode 100644 index 5bc1351..0000000 --- a/types/dlt/agents/dest/I3mWalletAgentDest.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"I3mWalletAgentDest.d.ts","sourceRoot":"","sources":["../../../../src/ts/dlt/agents/dest/I3mWalletAgentDest.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAKtD,qBAAa,kBAAmB,SAAQ,cAAe,YAAW,eAAe;IACzE,mBAAmB,CAAE,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;CAIpJ"} \ No newline at end of file diff --git a/types/dlt/agents/dest/I3mWalletAgentDest.d.ts b/types/dlt/agents/dest/I3mWalletAgentDest.d.ts deleted file mode 100644 index ab1fdf1..0000000 --- a/types/dlt/agents/dest/I3mWalletAgentDest.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { I3mWalletAgent } from '../I3mWalletAgent.js'; -import { NrpDltAgentDest } from './NrpDltAgentDest.js'; -export declare class I3mWalletAgentDest extends I3mWalletAgent implements NrpDltAgentDest { - getSecretFromLedger(secretLength: number, signerAddress: string, exchangeId: string, timeout: number): Promise<{ - hex: string; - iat: number; - }>; -} -//# sourceMappingURL=I3mWalletAgentDest.d.ts.map \ No newline at end of file diff --git a/types/dlt/agents/dest/I3mWalletAgentDest.d.ts.map b/types/dlt/agents/dest/I3mWalletAgentDest.d.ts.map deleted file mode 100644 index 5bc1351..0000000 --- a/types/dlt/agents/dest/I3mWalletAgentDest.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"I3mWalletAgentDest.d.ts","sourceRoot":"","sources":["../../../../src/ts/dlt/agents/dest/I3mWalletAgentDest.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAKtD,qBAAa,kBAAmB,SAAQ,cAAe,YAAW,eAAe;IACzE,mBAAmB,CAAE,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;CAIpJ"} \ No newline at end of file diff --git a/types/dlt/agents/dest/NrpDltAgentDest.d.cts b/types/dlt/agents/dest/NrpDltAgentDest.d.cts deleted file mode 100644 index 43674f6..0000000 --- a/types/dlt/agents/dest/NrpDltAgentDest.d.cts +++ /dev/null @@ -1,8 +0,0 @@ -import { NrpDltAgent } from '../NrpDltAgent.js'; -export interface NrpDltAgentDest extends NrpDltAgent { - getSecretFromLedger: (secretLength: number, signerAddress: string, exchangeId: string, timeout: number) => Promise<{ - hex: string; - iat: number; - }>; -} -//# sourceMappingURL=NrpDltAgentDest.d.ts.map \ No newline at end of file diff --git a/types/dlt/agents/dest/NrpDltAgentDest.d.cts.map b/types/dlt/agents/dest/NrpDltAgentDest.d.cts.map deleted file mode 100644 index acb2f53..0000000 --- a/types/dlt/agents/dest/NrpDltAgentDest.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"NrpDltAgentDest.d.ts","sourceRoot":"","sources":["../../../../src/ts/dlt/agents/dest/NrpDltAgentDest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAE/C,MAAM,WAAW,eAAgB,SAAQ,WAAW;IAUlD,mBAAmB,EAAE,CAAC,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CACjJ"} \ No newline at end of file diff --git a/types/dlt/agents/dest/NrpDltAgentDest.d.ts b/types/dlt/agents/dest/NrpDltAgentDest.d.ts deleted file mode 100644 index 43674f6..0000000 --- a/types/dlt/agents/dest/NrpDltAgentDest.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { NrpDltAgent } from '../NrpDltAgent.js'; -export interface NrpDltAgentDest extends NrpDltAgent { - getSecretFromLedger: (secretLength: number, signerAddress: string, exchangeId: string, timeout: number) => Promise<{ - hex: string; - iat: number; - }>; -} -//# sourceMappingURL=NrpDltAgentDest.d.ts.map \ No newline at end of file diff --git a/types/dlt/agents/dest/NrpDltAgentDest.d.ts.map b/types/dlt/agents/dest/NrpDltAgentDest.d.ts.map deleted file mode 100644 index acb2f53..0000000 --- a/types/dlt/agents/dest/NrpDltAgentDest.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"NrpDltAgentDest.d.ts","sourceRoot":"","sources":["../../../../src/ts/dlt/agents/dest/NrpDltAgentDest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAE/C,MAAM,WAAW,eAAgB,SAAQ,WAAW;IAUlD,mBAAmB,EAAE,CAAC,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CACjJ"} \ No newline at end of file diff --git a/types/dlt/agents/dest/index.d.cts b/types/dlt/agents/dest/index.d.cts deleted file mode 100644 index 77c649c..0000000 --- a/types/dlt/agents/dest/index.d.cts +++ /dev/null @@ -1,5 +0,0 @@ -export * from './EthersIoAgentDest.js'; -export * from './I3mWalletAgentDest.js'; -export * from './I3mServerWalletAgentDest.js'; -export * from './NrpDltAgentDest.js'; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/types/dlt/agents/dest/index.d.cts.map b/types/dlt/agents/dest/index.d.cts.map deleted file mode 100644 index dd0d279..0000000 --- a/types/dlt/agents/dest/index.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ts/dlt/agents/dest/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAA;AACtC,cAAc,yBAAyB,CAAA;AACvC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,sBAAsB,CAAA"} \ No newline at end of file diff --git a/types/dlt/agents/dest/index.d.ts b/types/dlt/agents/dest/index.d.ts deleted file mode 100644 index 77c649c..0000000 --- a/types/dlt/agents/dest/index.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export * from './EthersIoAgentDest.js'; -export * from './I3mWalletAgentDest.js'; -export * from './I3mServerWalletAgentDest.js'; -export * from './NrpDltAgentDest.js'; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/types/dlt/agents/dest/index.d.ts.map b/types/dlt/agents/dest/index.d.ts.map deleted file mode 100644 index dd0d279..0000000 --- a/types/dlt/agents/dest/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ts/dlt/agents/dest/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAA;AACtC,cAAc,yBAAyB,CAAA;AACvC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,sBAAsB,CAAA"} \ No newline at end of file diff --git a/types/dlt/agents/index.d.cts b/types/dlt/agents/index.d.cts deleted file mode 100644 index bd1fd95..0000000 --- a/types/dlt/agents/index.d.cts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './dest/index.js'; -export * from './orig/index.js'; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/types/dlt/agents/index.d.cts.map b/types/dlt/agents/index.d.cts.map deleted file mode 100644 index eb9ac6e..0000000 --- a/types/dlt/agents/index.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ts/dlt/agents/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA;AAC/B,cAAc,iBAAiB,CAAA"} \ No newline at end of file diff --git a/types/dlt/agents/index.d.ts b/types/dlt/agents/index.d.ts deleted file mode 100644 index bd1fd95..0000000 --- a/types/dlt/agents/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './dest/index.js'; -export * from './orig/index.js'; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/types/dlt/agents/index.d.ts.map b/types/dlt/agents/index.d.ts.map deleted file mode 100644 index eb9ac6e..0000000 --- a/types/dlt/agents/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ts/dlt/agents/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA;AAC/B,cAAc,iBAAiB,CAAA"} \ No newline at end of file diff --git a/types/dlt/agents/orig/EthersIoAgentOrig.d.cts b/types/dlt/agents/orig/EthersIoAgentOrig.d.cts deleted file mode 100644 index 0ca9799..0000000 --- a/types/dlt/agents/orig/EthersIoAgentOrig.d.cts +++ /dev/null @@ -1,13 +0,0 @@ -import { ethers } from 'ethers'; -import { DltConfig } from '../../../types.js'; -import { EthersIoAgent } from '../EthersIoAgent.js'; -import { NrpDltAgentOrig } from './NrpDltAgentOrig.js'; -export declare class EthersIoAgentOrig extends EthersIoAgent implements NrpDltAgentOrig { - signer: ethers.Wallet; - count: number; - constructor(dltConfig: Partial & Pick, privateKey?: string | Uint8Array); - deploySecret(secretHex: string, exchangeId: string): Promise; - getAddress(): Promise; - nextNonce(): Promise; -} -//# sourceMappingURL=EthersIoAgentOrig.d.ts.map \ No newline at end of file diff --git a/types/dlt/agents/orig/EthersIoAgentOrig.d.cts.map b/types/dlt/agents/orig/EthersIoAgentOrig.d.cts.map deleted file mode 100644 index 666f98b..0000000 --- a/types/dlt/agents/orig/EthersIoAgentOrig.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"EthersIoAgentOrig.d.ts","sourceRoot":"","sources":["../../../../src/ts/dlt/agents/orig/EthersIoAgentOrig.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAU,MAAM,QAAQ,CAAA;AAEvC,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAE7C,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAKtD,qBAAa,iBAAkB,SAAQ,aAAc,YAAW,eAAe;IAC7E,MAAM,EAAE,MAAM,CAAC,MAAM,CAAA;IAKrB,KAAK,EAAE,MAAM,CAAK;gBAEL,SAAS,EAAE,OAAO,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC,SAAS,EAAE,gBAAgB,CAAC,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,UAAU;IAsB1G,YAAY,CAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAgBrE,UAAU,IAAK,OAAO,CAAC,MAAM,CAAC;IAM9B,SAAS,IAAK,OAAO,CAAC,MAAM,CAAC;CASpC"} \ No newline at end of file diff --git a/types/dlt/agents/orig/EthersIoAgentOrig.d.ts b/types/dlt/agents/orig/EthersIoAgentOrig.d.ts deleted file mode 100644 index 0ca9799..0000000 --- a/types/dlt/agents/orig/EthersIoAgentOrig.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { ethers } from 'ethers'; -import { DltConfig } from '../../../types.js'; -import { EthersIoAgent } from '../EthersIoAgent.js'; -import { NrpDltAgentOrig } from './NrpDltAgentOrig.js'; -export declare class EthersIoAgentOrig extends EthersIoAgent implements NrpDltAgentOrig { - signer: ethers.Wallet; - count: number; - constructor(dltConfig: Partial & Pick, privateKey?: string | Uint8Array); - deploySecret(secretHex: string, exchangeId: string): Promise; - getAddress(): Promise; - nextNonce(): Promise; -} -//# sourceMappingURL=EthersIoAgentOrig.d.ts.map \ No newline at end of file diff --git a/types/dlt/agents/orig/EthersIoAgentOrig.d.ts.map b/types/dlt/agents/orig/EthersIoAgentOrig.d.ts.map deleted file mode 100644 index 666f98b..0000000 --- a/types/dlt/agents/orig/EthersIoAgentOrig.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"EthersIoAgentOrig.d.ts","sourceRoot":"","sources":["../../../../src/ts/dlt/agents/orig/EthersIoAgentOrig.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAU,MAAM,QAAQ,CAAA;AAEvC,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAE7C,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAKtD,qBAAa,iBAAkB,SAAQ,aAAc,YAAW,eAAe;IAC7E,MAAM,EAAE,MAAM,CAAC,MAAM,CAAA;IAKrB,KAAK,EAAE,MAAM,CAAK;gBAEL,SAAS,EAAE,OAAO,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC,SAAS,EAAE,gBAAgB,CAAC,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,UAAU;IAsB1G,YAAY,CAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAgBrE,UAAU,IAAK,OAAO,CAAC,MAAM,CAAC;IAM9B,SAAS,IAAK,OAAO,CAAC,MAAM,CAAC;CASpC"} \ No newline at end of file diff --git a/types/dlt/agents/orig/I3mServerWalletAgentOrig.d.cts b/types/dlt/agents/orig/I3mServerWalletAgentOrig.d.cts deleted file mode 100644 index d7e5178..0000000 --- a/types/dlt/agents/orig/I3mServerWalletAgentOrig.d.cts +++ /dev/null @@ -1,9 +0,0 @@ -import { I3mServerWalletAgent } from '../I3mServerWalletAgent.js'; -import { NrpDltAgentOrig } from './NrpDltAgentOrig.js'; -export declare class I3mServerWalletAgentOrig extends I3mServerWalletAgent implements NrpDltAgentOrig { - count: number; - deploySecret(secretHex: string, exchangeId: string): Promise; - getAddress(): Promise; - nextNonce(): Promise; -} -//# sourceMappingURL=I3mServerWalletAgentOrig.d.ts.map \ No newline at end of file diff --git a/types/dlt/agents/orig/I3mServerWalletAgentOrig.d.cts.map b/types/dlt/agents/orig/I3mServerWalletAgentOrig.d.cts.map deleted file mode 100644 index 41a80f6..0000000 --- a/types/dlt/agents/orig/I3mServerWalletAgentOrig.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"I3mServerWalletAgentOrig.d.ts","sourceRoot":"","sources":["../../../../src/ts/dlt/agents/orig/I3mServerWalletAgentOrig.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAA;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAEtD,qBAAa,wBAAyB,SAAQ,oBAAqB,YAAW,eAAe;IAI3F,KAAK,EAAE,MAAM,CAAK;IAEZ,YAAY,CAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAgBrE,UAAU,IAAK,OAAO,CAAC,MAAM,CAAC;IAU9B,SAAS,IAAK,OAAO,CAAC,MAAM,CAAC;CASpC"} \ No newline at end of file diff --git a/types/dlt/agents/orig/I3mServerWalletAgentOrig.d.ts b/types/dlt/agents/orig/I3mServerWalletAgentOrig.d.ts deleted file mode 100644 index d7e5178..0000000 --- a/types/dlt/agents/orig/I3mServerWalletAgentOrig.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { I3mServerWalletAgent } from '../I3mServerWalletAgent.js'; -import { NrpDltAgentOrig } from './NrpDltAgentOrig.js'; -export declare class I3mServerWalletAgentOrig extends I3mServerWalletAgent implements NrpDltAgentOrig { - count: number; - deploySecret(secretHex: string, exchangeId: string): Promise; - getAddress(): Promise; - nextNonce(): Promise; -} -//# sourceMappingURL=I3mServerWalletAgentOrig.d.ts.map \ No newline at end of file diff --git a/types/dlt/agents/orig/I3mServerWalletAgentOrig.d.ts.map b/types/dlt/agents/orig/I3mServerWalletAgentOrig.d.ts.map deleted file mode 100644 index 41a80f6..0000000 --- a/types/dlt/agents/orig/I3mServerWalletAgentOrig.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"I3mServerWalletAgentOrig.d.ts","sourceRoot":"","sources":["../../../../src/ts/dlt/agents/orig/I3mServerWalletAgentOrig.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAA;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAEtD,qBAAa,wBAAyB,SAAQ,oBAAqB,YAAW,eAAe;IAI3F,KAAK,EAAE,MAAM,CAAK;IAEZ,YAAY,CAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAgBrE,UAAU,IAAK,OAAO,CAAC,MAAM,CAAC;IAU9B,SAAS,IAAK,OAAO,CAAC,MAAM,CAAC;CASpC"} \ No newline at end of file diff --git a/types/dlt/agents/orig/I3mWalletAgentOrig.d.cts b/types/dlt/agents/orig/I3mWalletAgentOrig.d.cts deleted file mode 100644 index e3c3485..0000000 --- a/types/dlt/agents/orig/I3mWalletAgentOrig.d.cts +++ /dev/null @@ -1,9 +0,0 @@ -import { I3mWalletAgent } from '../I3mWalletAgent.js'; -import { NrpDltAgentOrig } from './NrpDltAgentOrig.js'; -export declare class I3mWalletAgentOrig extends I3mWalletAgent implements NrpDltAgentOrig { - count: number; - deploySecret(secretHex: string, exchangeId: string): Promise; - getAddress(): Promise; - nextNonce(): Promise; -} -//# sourceMappingURL=I3mWalletAgentOrig.d.ts.map \ No newline at end of file diff --git a/types/dlt/agents/orig/I3mWalletAgentOrig.d.cts.map b/types/dlt/agents/orig/I3mWalletAgentOrig.d.cts.map deleted file mode 100644 index 1e5d50f..0000000 --- a/types/dlt/agents/orig/I3mWalletAgentOrig.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"I3mWalletAgentOrig.d.ts","sourceRoot":"","sources":["../../../../src/ts/dlt/agents/orig/I3mWalletAgentOrig.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAKtD,qBAAa,kBAAmB,SAAQ,cAAe,YAAW,eAAe;IAI/E,KAAK,EAAE,MAAM,CAAK;IAEZ,YAAY,CAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAqBrE,UAAU,IAAK,OAAO,CAAC,MAAM,CAAC;IAU9B,SAAS,IAAK,OAAO,CAAC,MAAM,CAAC;CASpC"} \ No newline at end of file diff --git a/types/dlt/agents/orig/I3mWalletAgentOrig.d.ts b/types/dlt/agents/orig/I3mWalletAgentOrig.d.ts deleted file mode 100644 index e3c3485..0000000 --- a/types/dlt/agents/orig/I3mWalletAgentOrig.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { I3mWalletAgent } from '../I3mWalletAgent.js'; -import { NrpDltAgentOrig } from './NrpDltAgentOrig.js'; -export declare class I3mWalletAgentOrig extends I3mWalletAgent implements NrpDltAgentOrig { - count: number; - deploySecret(secretHex: string, exchangeId: string): Promise; - getAddress(): Promise; - nextNonce(): Promise; -} -//# sourceMappingURL=I3mWalletAgentOrig.d.ts.map \ No newline at end of file diff --git a/types/dlt/agents/orig/I3mWalletAgentOrig.d.ts.map b/types/dlt/agents/orig/I3mWalletAgentOrig.d.ts.map deleted file mode 100644 index 1e5d50f..0000000 --- a/types/dlt/agents/orig/I3mWalletAgentOrig.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"I3mWalletAgentOrig.d.ts","sourceRoot":"","sources":["../../../../src/ts/dlt/agents/orig/I3mWalletAgentOrig.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAKtD,qBAAa,kBAAmB,SAAQ,cAAe,YAAW,eAAe;IAI/E,KAAK,EAAE,MAAM,CAAK;IAEZ,YAAY,CAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAqBrE,UAAU,IAAK,OAAO,CAAC,MAAM,CAAC;IAU9B,SAAS,IAAK,OAAO,CAAC,MAAM,CAAC;CASpC"} \ No newline at end of file diff --git a/types/dlt/agents/orig/NrpDltAgentOrig.d.cts b/types/dlt/agents/orig/NrpDltAgentOrig.d.cts deleted file mode 100644 index 5a11a19..0000000 --- a/types/dlt/agents/orig/NrpDltAgentOrig.d.cts +++ /dev/null @@ -1,7 +0,0 @@ -import { NrpDltAgent } from '../NrpDltAgent.js'; -export interface NrpDltAgentOrig extends NrpDltAgent { - deploySecret: (secretHex: string, exchangeId: string) => Promise; - getAddress: () => Promise; - nextNonce: () => Promise; -} -//# sourceMappingURL=NrpDltAgentOrig.d.ts.map \ No newline at end of file diff --git a/types/dlt/agents/orig/NrpDltAgentOrig.d.cts.map b/types/dlt/agents/orig/NrpDltAgentOrig.d.cts.map deleted file mode 100644 index 22096aa..0000000 --- a/types/dlt/agents/orig/NrpDltAgentOrig.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"NrpDltAgentOrig.d.ts","sourceRoot":"","sources":["../../../../src/ts/dlt/agents/orig/NrpDltAgentOrig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAE/C,MAAM,WAAW,eAAgB,SAAQ,WAAW;IASlD,YAAY,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAA;IAKxE,UAAU,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAA;IAKjC,SAAS,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAA;CACjC"} \ No newline at end of file diff --git a/types/dlt/agents/orig/NrpDltAgentOrig.d.ts b/types/dlt/agents/orig/NrpDltAgentOrig.d.ts deleted file mode 100644 index 5a11a19..0000000 --- a/types/dlt/agents/orig/NrpDltAgentOrig.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { NrpDltAgent } from '../NrpDltAgent.js'; -export interface NrpDltAgentOrig extends NrpDltAgent { - deploySecret: (secretHex: string, exchangeId: string) => Promise; - getAddress: () => Promise; - nextNonce: () => Promise; -} -//# sourceMappingURL=NrpDltAgentOrig.d.ts.map \ No newline at end of file diff --git a/types/dlt/agents/orig/NrpDltAgentOrig.d.ts.map b/types/dlt/agents/orig/NrpDltAgentOrig.d.ts.map deleted file mode 100644 index 22096aa..0000000 --- a/types/dlt/agents/orig/NrpDltAgentOrig.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"NrpDltAgentOrig.d.ts","sourceRoot":"","sources":["../../../../src/ts/dlt/agents/orig/NrpDltAgentOrig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAE/C,MAAM,WAAW,eAAgB,SAAQ,WAAW;IASlD,YAAY,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAA;IAKxE,UAAU,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAA;IAKjC,SAAS,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAA;CACjC"} \ No newline at end of file diff --git a/types/dlt/agents/orig/index.d.cts b/types/dlt/agents/orig/index.d.cts deleted file mode 100644 index f275ea3..0000000 --- a/types/dlt/agents/orig/index.d.cts +++ /dev/null @@ -1,5 +0,0 @@ -export * from './EthersIoAgentOrig.js'; -export * from './I3mWalletAgentOrig.js'; -export * from './I3mServerWalletAgentOrig.js'; -export * from './NrpDltAgentOrig.js'; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/types/dlt/agents/orig/index.d.cts.map b/types/dlt/agents/orig/index.d.cts.map deleted file mode 100644 index e2f8c82..0000000 --- a/types/dlt/agents/orig/index.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ts/dlt/agents/orig/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAA;AACtC,cAAc,yBAAyB,CAAA;AACvC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,sBAAsB,CAAA"} \ No newline at end of file diff --git a/types/dlt/agents/orig/index.d.ts b/types/dlt/agents/orig/index.d.ts deleted file mode 100644 index f275ea3..0000000 --- a/types/dlt/agents/orig/index.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export * from './EthersIoAgentOrig.js'; -export * from './I3mWalletAgentOrig.js'; -export * from './I3mServerWalletAgentOrig.js'; -export * from './NrpDltAgentOrig.js'; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/types/dlt/agents/orig/index.d.ts.map b/types/dlt/agents/orig/index.d.ts.map deleted file mode 100644 index e2f8c82..0000000 --- a/types/dlt/agents/orig/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ts/dlt/agents/orig/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAA;AACtC,cAAc,yBAAyB,CAAA;AACvC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,sBAAsB,CAAA"} \ No newline at end of file diff --git a/types/dlt/agents/secret.d.cts b/types/dlt/agents/secret.d.cts deleted file mode 100644 index 76f104b..0000000 --- a/types/dlt/agents/secret.d.cts +++ /dev/null @@ -1,9 +0,0 @@ -import { ethers } from 'ethers'; -import { NrpDltAgentOrig } from './orig/index.js'; -import { EthersIoAgent } from './EthersIoAgent.js'; -export declare function getSecretFromLedger(contract: ethers.Contract, signerAddress: string, exchangeId: string, timeout: number, secretLength: number): Promise<{ - hex: string; - iat: number; -}>; -export declare function secretUnisgnedTransaction(secretHex: string, exchangeId: string, agent: EthersIoAgent & NrpDltAgentOrig): Promise; -//# sourceMappingURL=secret.d.ts.map \ No newline at end of file diff --git a/types/dlt/agents/secret.d.cts.map b/types/dlt/agents/secret.d.cts.map deleted file mode 100644 index 279001f..0000000 --- a/types/dlt/agents/secret.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"secret.d.ts","sourceRoot":"","sources":["../../../src/ts/dlt/agents/secret.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAGjD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAElD,wBAAsB,mBAAmB,CAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,aAAa,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC,CAuB7L;AAED,wBAAsB,yBAAyB,CAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,GAAG,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC,mBAAmB,CAAC,CAanK"} \ No newline at end of file diff --git a/types/dlt/agents/secret.d.ts b/types/dlt/agents/secret.d.ts deleted file mode 100644 index 76f104b..0000000 --- a/types/dlt/agents/secret.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { ethers } from 'ethers'; -import { NrpDltAgentOrig } from './orig/index.js'; -import { EthersIoAgent } from './EthersIoAgent.js'; -export declare function getSecretFromLedger(contract: ethers.Contract, signerAddress: string, exchangeId: string, timeout: number, secretLength: number): Promise<{ - hex: string; - iat: number; -}>; -export declare function secretUnisgnedTransaction(secretHex: string, exchangeId: string, agent: EthersIoAgent & NrpDltAgentOrig): Promise; -//# sourceMappingURL=secret.d.ts.map \ No newline at end of file diff --git a/types/dlt/agents/secret.d.ts.map b/types/dlt/agents/secret.d.ts.map deleted file mode 100644 index 279001f..0000000 --- a/types/dlt/agents/secret.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"secret.d.ts","sourceRoot":"","sources":["../../../src/ts/dlt/agents/secret.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAGjD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAElD,wBAAsB,mBAAmB,CAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,aAAa,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC,CAuB7L;AAED,wBAAsB,yBAAyB,CAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,GAAG,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC,mBAAmB,CAAC,CAanK"} \ No newline at end of file diff --git a/types/dlt/defaultDltConfig.d.cts b/types/dlt/defaultDltConfig.d.cts deleted file mode 100644 index 1fcc9ef..0000000 --- a/types/dlt/defaultDltConfig.d.cts +++ /dev/null @@ -1,3 +0,0 @@ -import { DltConfig } from '../types.js'; -export declare const defaultDltConfig: Omit; -//# sourceMappingURL=defaultDltConfig.d.ts.map \ No newline at end of file diff --git a/types/dlt/defaultDltConfig.d.cts.map b/types/dlt/defaultDltConfig.d.cts.map deleted file mode 100644 index 77309a7..0000000 --- a/types/dlt/defaultDltConfig.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"defaultDltConfig.d.ts","sourceRoot":"","sources":["../../src/ts/dlt/defaultDltConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,SAAS,EAAE,MAAM,aAAa,CAAA;AAEvD,eAAO,MAAM,gBAAgB,EAAE,IAAI,CAAC,SAAS,EAAE,gBAAgB,CAG9D,CAAA"} \ No newline at end of file diff --git a/types/dlt/defaultDltConfig.d.ts b/types/dlt/defaultDltConfig.d.ts deleted file mode 100644 index 1fcc9ef..0000000 --- a/types/dlt/defaultDltConfig.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { DltConfig } from '../types.js'; -export declare const defaultDltConfig: Omit; -//# sourceMappingURL=defaultDltConfig.d.ts.map \ No newline at end of file diff --git a/types/dlt/defaultDltConfig.d.ts.map b/types/dlt/defaultDltConfig.d.ts.map deleted file mode 100644 index 77309a7..0000000 --- a/types/dlt/defaultDltConfig.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"defaultDltConfig.d.ts","sourceRoot":"","sources":["../../src/ts/dlt/defaultDltConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,SAAS,EAAE,MAAM,aAAa,CAAA;AAEvD,eAAO,MAAM,gBAAgB,EAAE,IAAI,CAAC,SAAS,EAAE,gBAAgB,CAG9D,CAAA"} \ No newline at end of file diff --git a/types/dlt/index.d.cts b/types/dlt/index.d.cts deleted file mode 100644 index f2e9b7f..0000000 --- a/types/dlt/index.d.cts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './defaultDltConfig.js'; -export * from './agents/index.js'; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/types/dlt/index.d.cts.map b/types/dlt/index.d.cts.map deleted file mode 100644 index b341a4f..0000000 --- a/types/dlt/index.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ts/dlt/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAA;AACrC,cAAc,mBAAmB,CAAA"} \ No newline at end of file diff --git a/types/dlt/index.d.ts b/types/dlt/index.d.ts deleted file mode 100644 index f2e9b7f..0000000 --- a/types/dlt/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './defaultDltConfig.js'; -export * from './agents/index.js'; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/types/dlt/index.d.ts.map b/types/dlt/index.d.ts.map deleted file mode 100644 index b341a4f..0000000 --- a/types/dlt/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ts/dlt/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAA;AACrC,cAAc,mBAAmB,CAAA"} \ No newline at end of file diff --git a/types/errors/NrError.d.cts b/types/errors/NrError.d.cts deleted file mode 100644 index 8bbffd8..0000000 --- a/types/errors/NrError.d.cts +++ /dev/null @@ -1,7 +0,0 @@ -import { NrErrorName } from '../types.js'; -export declare class NrError extends Error { - nrErrors: NrErrorName[]; - constructor(error: any, nrErrors: NrErrorName[]); - add(...nrErrors: NrErrorName[]): void; -} -//# sourceMappingURL=NrError.d.ts.map \ No newline at end of file diff --git a/types/errors/NrError.d.cts.map b/types/errors/NrError.d.cts.map deleted file mode 100644 index 6267203..0000000 --- a/types/errors/NrError.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"NrError.d.ts","sourceRoot":"","sources":["../../src/ts/errors/NrError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAEzC,qBAAa,OAAQ,SAAQ,KAAK;IAChC,QAAQ,EAAE,WAAW,EAAE,CAAA;gBAEV,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,WAAW,EAAE;IAUhD,GAAG,CAAE,GAAG,QAAQ,EAAE,WAAW,EAAE,GAAG,IAAI;CAIvC"} \ No newline at end of file diff --git a/types/errors/NrError.d.ts b/types/errors/NrError.d.ts deleted file mode 100644 index 8bbffd8..0000000 --- a/types/errors/NrError.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { NrErrorName } from '../types.js'; -export declare class NrError extends Error { - nrErrors: NrErrorName[]; - constructor(error: any, nrErrors: NrErrorName[]); - add(...nrErrors: NrErrorName[]): void; -} -//# sourceMappingURL=NrError.d.ts.map \ No newline at end of file diff --git a/types/errors/NrError.d.ts.map b/types/errors/NrError.d.ts.map deleted file mode 100644 index 6267203..0000000 --- a/types/errors/NrError.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"NrError.d.ts","sourceRoot":"","sources":["../../src/ts/errors/NrError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAEzC,qBAAa,OAAQ,SAAQ,KAAK;IAChC,QAAQ,EAAE,WAAW,EAAE,CAAA;gBAEV,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,WAAW,EAAE;IAUhD,GAAG,CAAE,GAAG,QAAQ,EAAE,WAAW,EAAE,GAAG,IAAI;CAIvC"} \ No newline at end of file diff --git a/types/errors/index.d.cts b/types/errors/index.d.cts deleted file mode 100644 index d2ec1d9..0000000 --- a/types/errors/index.d.cts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './NrError.js'; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/types/errors/index.d.cts.map b/types/errors/index.d.cts.map deleted file mode 100644 index 09294ad..0000000 --- a/types/errors/index.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ts/errors/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA"} \ No newline at end of file diff --git a/types/errors/index.d.ts b/types/errors/index.d.ts deleted file mode 100644 index d2ec1d9..0000000 --- a/types/errors/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './NrError.js'; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/types/errors/index.d.ts.map b/types/errors/index.d.ts.map deleted file mode 100644 index 09294ad..0000000 --- a/types/errors/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ts/errors/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA"} \ No newline at end of file diff --git a/types/exchange/checkAgreement.d.cts b/types/exchange/checkAgreement.d.cts deleted file mode 100644 index 0549037..0000000 --- a/types/exchange/checkAgreement.d.cts +++ /dev/null @@ -1,6 +0,0 @@ -import { NrError } from '../errors/index.js'; -import { DataExchange, DataExchangeAgreement, DataSharingAgreement } from '../types.js'; -export declare function validateDataSharingAgreementSchema(agreement: DataSharingAgreement): Promise; -export declare function validateDataExchange(dataExchange: DataExchange): Promise; -export declare function validateDataExchangeAgreement(agreement: DataExchangeAgreement): Promise; -//# sourceMappingURL=checkAgreement.d.ts.map \ No newline at end of file diff --git a/types/exchange/checkAgreement.d.cts.map b/types/exchange/checkAgreement.d.cts.map deleted file mode 100644 index 914ec80..0000000 --- a/types/exchange/checkAgreement.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"checkAgreement.d.ts","sourceRoot":"","sources":["../../src/ts/exchange/checkAgreement.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AAC5C,OAAO,EAAE,YAAY,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAYvF,wBAAsB,kCAAkC,CAAE,SAAS,EAAE,oBAAoB,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC,CA8B3G;AAED,wBAAsB,oBAAoB,CAAE,YAAY,EAAE,YAAY,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC,CAmBxF;AAED,wBAAsB,6BAA6B,CAAE,SAAS,EAAE,qBAAqB,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,CA+DzG"} \ No newline at end of file diff --git a/types/exchange/checkAgreement.d.ts b/types/exchange/checkAgreement.d.ts deleted file mode 100644 index 0549037..0000000 --- a/types/exchange/checkAgreement.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { NrError } from '../errors/index.js'; -import { DataExchange, DataExchangeAgreement, DataSharingAgreement } from '../types.js'; -export declare function validateDataSharingAgreementSchema(agreement: DataSharingAgreement): Promise; -export declare function validateDataExchange(dataExchange: DataExchange): Promise; -export declare function validateDataExchangeAgreement(agreement: DataExchangeAgreement): Promise; -//# sourceMappingURL=checkAgreement.d.ts.map \ No newline at end of file diff --git a/types/exchange/checkAgreement.d.ts.map b/types/exchange/checkAgreement.d.ts.map deleted file mode 100644 index 914ec80..0000000 --- a/types/exchange/checkAgreement.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"checkAgreement.d.ts","sourceRoot":"","sources":["../../src/ts/exchange/checkAgreement.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AAC5C,OAAO,EAAE,YAAY,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAYvF,wBAAsB,kCAAkC,CAAE,SAAS,EAAE,oBAAoB,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC,CA8B3G;AAED,wBAAsB,oBAAoB,CAAE,YAAY,EAAE,YAAY,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC,CAmBxF;AAED,wBAAsB,6BAA6B,CAAE,SAAS,EAAE,qBAAqB,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,CA+DzG"} \ No newline at end of file diff --git a/types/exchange/exchangeId.d.cts b/types/exchange/exchangeId.d.cts deleted file mode 100644 index f992164..0000000 --- a/types/exchange/exchangeId.d.cts +++ /dev/null @@ -1,3 +0,0 @@ -import { DataExchange } from '../types.js'; -export declare function exchangeId(exchange: Omit): Promise; -//# sourceMappingURL=exchangeId.d.ts.map \ No newline at end of file diff --git a/types/exchange/exchangeId.d.cts.map b/types/exchange/exchangeId.d.cts.map deleted file mode 100644 index 6370a53..0000000 --- a/types/exchange/exchangeId.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"exchangeId.d.ts","sourceRoot":"","sources":["../../src/ts/exchange/exchangeId.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAU1C,wBAAsB,UAAU,CAAE,QAAQ,EAAE,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAErF"} \ No newline at end of file diff --git a/types/exchange/exchangeId.d.ts b/types/exchange/exchangeId.d.ts deleted file mode 100644 index f992164..0000000 --- a/types/exchange/exchangeId.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { DataExchange } from '../types.js'; -export declare function exchangeId(exchange: Omit): Promise; -//# sourceMappingURL=exchangeId.d.ts.map \ No newline at end of file diff --git a/types/exchange/exchangeId.d.ts.map b/types/exchange/exchangeId.d.ts.map deleted file mode 100644 index 6370a53..0000000 --- a/types/exchange/exchangeId.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"exchangeId.d.ts","sourceRoot":"","sources":["../../src/ts/exchange/exchangeId.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAU1C,wBAAsB,UAAU,CAAE,QAAQ,EAAE,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAErF"} \ No newline at end of file diff --git a/types/exchange/index.d.cts b/types/exchange/index.d.cts deleted file mode 100644 index 6d519de..0000000 --- a/types/exchange/index.d.cts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './exchangeId.js'; -export * from './checkAgreement.js'; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/types/exchange/index.d.cts.map b/types/exchange/index.d.cts.map deleted file mode 100644 index a96691d..0000000 --- a/types/exchange/index.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ts/exchange/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA;AAC/B,cAAc,qBAAqB,CAAA"} \ No newline at end of file diff --git a/types/exchange/index.d.ts b/types/exchange/index.d.ts deleted file mode 100644 index 6d519de..0000000 --- a/types/exchange/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './exchangeId.js'; -export * from './checkAgreement.js'; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/types/exchange/index.d.ts.map b/types/exchange/index.d.ts.map deleted file mode 100644 index a96691d..0000000 --- a/types/exchange/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ts/exchange/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA;AAC/B,cAAc,qBAAqB,CAAA"} \ No newline at end of file diff --git a/types/index.d.cts b/types/index.d.cts deleted file mode 100644 index e071269..0000000 --- a/types/index.d.cts +++ /dev/null @@ -1,12 +0,0 @@ -export * as ConflictResolution from './conflict-resolution/index.js'; -export * from './crypto/index.js'; -export * from './dlt/index.js'; -export * as NonRepudiationProtocol from './non-repudiation-protocol/index.js'; -export * from './errors/index.js'; -export * from './proofs/index.js'; -export * as Signers from './dlt/agents/index.js'; -export * from './types.js'; -export * from './utils/index.js'; -export * from './constants.js'; -export * from './exchange/index.js'; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/types/index.d.cts.map b/types/index.d.cts.map deleted file mode 100644 index 562c678..0000000 --- a/types/index.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/ts/index.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,kBAAkB,MAAM,gCAAgC,CAAA;AACpE,cAAc,mBAAmB,CAAA;AACjC,cAAc,gBAAgB,CAAA;AAC9B,OAAO,KAAK,sBAAsB,MAAM,qCAAqC,CAAA;AAC7E,cAAc,mBAAmB,CAAA;AACjC,cAAc,mBAAmB,CAAA;AACjC,OAAO,KAAK,OAAO,MAAM,uBAAuB,CAAA;AAChD,cAAc,YAAY,CAAA;AAC1B,cAAc,kBAAkB,CAAA;AAChC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,qBAAqB,CAAA"} \ No newline at end of file diff --git a/types/index.d.ts b/types/index.d.ts deleted file mode 100644 index e071269..0000000 --- a/types/index.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -export * as ConflictResolution from './conflict-resolution/index.js'; -export * from './crypto/index.js'; -export * from './dlt/index.js'; -export * as NonRepudiationProtocol from './non-repudiation-protocol/index.js'; -export * from './errors/index.js'; -export * from './proofs/index.js'; -export * as Signers from './dlt/agents/index.js'; -export * from './types.js'; -export * from './utils/index.js'; -export * from './constants.js'; -export * from './exchange/index.js'; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/types/index.d.ts.map b/types/index.d.ts.map deleted file mode 100644 index 562c678..0000000 --- a/types/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/ts/index.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,kBAAkB,MAAM,gCAAgC,CAAA;AACpE,cAAc,mBAAmB,CAAA;AACjC,cAAc,gBAAgB,CAAA;AAC9B,OAAO,KAAK,sBAAsB,MAAM,qCAAqC,CAAA;AAC7E,cAAc,mBAAmB,CAAA;AACjC,cAAc,mBAAmB,CAAA;AACjC,OAAO,KAAK,OAAO,MAAM,uBAAuB,CAAA;AAChD,cAAc,YAAY,CAAA;AAC1B,cAAc,kBAAkB,CAAA;AAChC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,qBAAqB,CAAA"} \ No newline at end of file diff --git a/types/non-repudiation-protocol/NonRepudiationDest.d.cts b/types/non-repudiation-protocol/NonRepudiationDest.d.cts deleted file mode 100644 index 3879e4d..0000000 --- a/types/non-repudiation-protocol/NonRepudiationDest.d.cts +++ /dev/null @@ -1,24 +0,0 @@ -import { NrpDltAgentDest } from '../dlt/index.js'; -import { Block, DataExchange, DataExchangeAgreement, DecodedProof, JWK, JwkPair, PoOPayload, PoPPayload, PoRPayload, StoredProof, TimestampVerifyOptions } from './../types.js'; -export declare class NonRepudiationDest { - agreement: DataExchangeAgreement; - exchange?: DataExchange; - jwkPairDest: JwkPair; - publicJwkOrig: JWK; - block: Block; - dltAgent: NrpDltAgentDest; - readonly initialized: Promise; - constructor(agreement: DataExchangeAgreement, privateJwk: JWK, dltAgent: NrpDltAgentDest); - private asyncConstructor; - verifyPoO(poo: string, cipherblock: string, options?: Pick): Promise>; - generatePoR(): Promise>; - verifyPoP(pop: string, options?: Pick): Promise>; - getSecretFromLedger(): Promise<{ - hex: string; - jwk: JWK; - }>; - decrypt(): Promise; - generateVerificationRequest(): Promise; - generateDisputeRequest(): Promise; -} -//# sourceMappingURL=NonRepudiationDest.d.ts.map \ No newline at end of file diff --git a/types/non-repudiation-protocol/NonRepudiationDest.d.cts.map b/types/non-repudiation-protocol/NonRepudiationDest.d.cts.map deleted file mode 100644 index a58fa33..0000000 --- a/types/non-repudiation-protocol/NonRepudiationDest.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"NonRepudiationDest.d.ts","sourceRoot":"","sources":["../../src/ts/non-repudiation-protocol/NonRepudiationDest.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAMjD,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,qBAAqB,EAAE,YAAY,EAA+B,GAAG,EAAE,OAAO,EAAe,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAA;AAOzN,qBAAa,kBAAkB;IAC7B,SAAS,EAAG,qBAAqB,CAAA;IACjC,QAAQ,CAAC,EAAE,YAAY,CAAA;IACvB,WAAW,EAAG,OAAO,CAAA;IACrB,aAAa,EAAG,GAAG,CAAA;IACnB,KAAK,EAAG,KAAK,CAAA;IACb,QAAQ,EAAG,eAAe,CAAA;IAC1B,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC,OAAO,CAAC,CAAA;gBAOzB,SAAS,EAAE,qBAAqB,EAAE,UAAU,EAAE,GAAG,EAAE,QAAQ,EAAE,eAAe;YAU3E,gBAAgB;IA0CxB,SAAS,CAAE,GAAG,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,sBAAsB,EAAE,WAAW,GAAG,WAAW,CAAC,GAAG,OAAO,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;IAqDlJ,WAAW,IAAK,OAAO,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IAyBhD,SAAS,CAAE,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,sBAAsB,EAAE,WAAW,GAAG,WAAW,CAAC,GAAG,OAAO,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;IA6C7H,mBAAmB,IAAK,OAAO,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,GAAG,CAAA;KAAE,CAAC;IA2B1D,OAAO,IAAK,OAAO,CAAC,UAAU,CAAC;IA6B/B,2BAA2B,IAAK,OAAO,CAAC,MAAM,CAAC;IAgB/C,sBAAsB,IAAK,OAAO,CAAC,MAAM,CAAC;CA6BjD"} \ No newline at end of file diff --git a/types/non-repudiation-protocol/NonRepudiationDest.d.ts b/types/non-repudiation-protocol/NonRepudiationDest.d.ts deleted file mode 100644 index 3879e4d..0000000 --- a/types/non-repudiation-protocol/NonRepudiationDest.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { NrpDltAgentDest } from '../dlt/index.js'; -import { Block, DataExchange, DataExchangeAgreement, DecodedProof, JWK, JwkPair, PoOPayload, PoPPayload, PoRPayload, StoredProof, TimestampVerifyOptions } from './../types.js'; -export declare class NonRepudiationDest { - agreement: DataExchangeAgreement; - exchange?: DataExchange; - jwkPairDest: JwkPair; - publicJwkOrig: JWK; - block: Block; - dltAgent: NrpDltAgentDest; - readonly initialized: Promise; - constructor(agreement: DataExchangeAgreement, privateJwk: JWK, dltAgent: NrpDltAgentDest); - private asyncConstructor; - verifyPoO(poo: string, cipherblock: string, options?: Pick): Promise>; - generatePoR(): Promise>; - verifyPoP(pop: string, options?: Pick): Promise>; - getSecretFromLedger(): Promise<{ - hex: string; - jwk: JWK; - }>; - decrypt(): Promise; - generateVerificationRequest(): Promise; - generateDisputeRequest(): Promise; -} -//# sourceMappingURL=NonRepudiationDest.d.ts.map \ No newline at end of file diff --git a/types/non-repudiation-protocol/NonRepudiationDest.d.ts.map b/types/non-repudiation-protocol/NonRepudiationDest.d.ts.map deleted file mode 100644 index a58fa33..0000000 --- a/types/non-repudiation-protocol/NonRepudiationDest.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"NonRepudiationDest.d.ts","sourceRoot":"","sources":["../../src/ts/non-repudiation-protocol/NonRepudiationDest.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAMjD,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,qBAAqB,EAAE,YAAY,EAA+B,GAAG,EAAE,OAAO,EAAe,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAA;AAOzN,qBAAa,kBAAkB;IAC7B,SAAS,EAAG,qBAAqB,CAAA;IACjC,QAAQ,CAAC,EAAE,YAAY,CAAA;IACvB,WAAW,EAAG,OAAO,CAAA;IACrB,aAAa,EAAG,GAAG,CAAA;IACnB,KAAK,EAAG,KAAK,CAAA;IACb,QAAQ,EAAG,eAAe,CAAA;IAC1B,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC,OAAO,CAAC,CAAA;gBAOzB,SAAS,EAAE,qBAAqB,EAAE,UAAU,EAAE,GAAG,EAAE,QAAQ,EAAE,eAAe;YAU3E,gBAAgB;IA0CxB,SAAS,CAAE,GAAG,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,sBAAsB,EAAE,WAAW,GAAG,WAAW,CAAC,GAAG,OAAO,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;IAqDlJ,WAAW,IAAK,OAAO,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IAyBhD,SAAS,CAAE,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,sBAAsB,EAAE,WAAW,GAAG,WAAW,CAAC,GAAG,OAAO,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;IA6C7H,mBAAmB,IAAK,OAAO,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,GAAG,CAAA;KAAE,CAAC;IA2B1D,OAAO,IAAK,OAAO,CAAC,UAAU,CAAC;IA6B/B,2BAA2B,IAAK,OAAO,CAAC,MAAM,CAAC;IAgB/C,sBAAsB,IAAK,OAAO,CAAC,MAAM,CAAC;CA6BjD"} \ No newline at end of file diff --git a/types/non-repudiation-protocol/NonRepudiationOrig.d.cts b/types/non-repudiation-protocol/NonRepudiationOrig.d.cts deleted file mode 100644 index 43176fd..0000000 --- a/types/non-repudiation-protocol/NonRepudiationOrig.d.cts +++ /dev/null @@ -1,19 +0,0 @@ -import { DataExchange, DataExchangeAgreement, JWK, JwkPair, OrigBlock, PoOPayload, PoPPayload, PoRPayload, StoredProof, TimestampVerifyOptions } from '../types.js'; -import { NrpDltAgentOrig } from '../dlt/agents/index.js'; -export declare class NonRepudiationOrig { - agreement: DataExchangeAgreement; - exchange: DataExchange; - jwkPairOrig: JwkPair; - publicJwkDest: JWK; - block: OrigBlock; - dltAgent: NrpDltAgentOrig; - readonly initialized: Promise; - constructor(agreement: DataExchangeAgreement, privateJwk: JWK, block: Uint8Array, dltAgent: NrpDltAgentOrig); - private init; - private _dltSetup; - generatePoO(): Promise>; - verifyPoR(por: string, options?: Pick): Promise>; - generatePoP(): Promise>; - generateVerificationRequest(): Promise; -} -//# sourceMappingURL=NonRepudiationOrig.d.ts.map \ No newline at end of file diff --git a/types/non-repudiation-protocol/NonRepudiationOrig.d.cts.map b/types/non-repudiation-protocol/NonRepudiationOrig.d.cts.map deleted file mode 100644 index 150dd68..0000000 --- a/types/non-repudiation-protocol/NonRepudiationOrig.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"NonRepudiationOrig.d.ts","sourceRoot":"","sources":["../../src/ts/non-repudiation-protocol/NonRepudiationOrig.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,YAAY,EAAE,qBAAqB,EAAE,GAAG,EAAE,OAAO,EAAe,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;AAEhL,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAQxD,qBAAa,kBAAkB;IAC7B,SAAS,EAAG,qBAAqB,CAAA;IACjC,QAAQ,EAAG,YAAY,CAAA;IACvB,WAAW,EAAE,OAAO,CAAA;IACpB,aAAa,EAAE,GAAG,CAAA;IAClB,KAAK,EAAE,SAAS,CAAA;IAChB,QAAQ,EAAG,eAAe,CAAA;IAC1B,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC,OAAO,CAAC,CAAA;gBAQzB,SAAS,EAAE,qBAAqB,EAAE,UAAU,EAAE,GAAG,EAAE,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,eAAe;YAqB9F,IAAI;YA2CJ,SAAS;IAsBjB,WAAW,IAAK,OAAO,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IAmBhD,SAAS,CAAE,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,sBAAsB,EAAE,WAAW,GAAG,WAAW,CAAC,GAAG,OAAO,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IAqC5H,WAAW,IAAK,OAAO,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IA2BhD,2BAA2B,IAAK,OAAO,CAAC,MAAM,CAAC;CAStD"} \ No newline at end of file diff --git a/types/non-repudiation-protocol/NonRepudiationOrig.d.ts b/types/non-repudiation-protocol/NonRepudiationOrig.d.ts deleted file mode 100644 index 43176fd..0000000 --- a/types/non-repudiation-protocol/NonRepudiationOrig.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { DataExchange, DataExchangeAgreement, JWK, JwkPair, OrigBlock, PoOPayload, PoPPayload, PoRPayload, StoredProof, TimestampVerifyOptions } from '../types.js'; -import { NrpDltAgentOrig } from '../dlt/agents/index.js'; -export declare class NonRepudiationOrig { - agreement: DataExchangeAgreement; - exchange: DataExchange; - jwkPairOrig: JwkPair; - publicJwkDest: JWK; - block: OrigBlock; - dltAgent: NrpDltAgentOrig; - readonly initialized: Promise; - constructor(agreement: DataExchangeAgreement, privateJwk: JWK, block: Uint8Array, dltAgent: NrpDltAgentOrig); - private init; - private _dltSetup; - generatePoO(): Promise>; - verifyPoR(por: string, options?: Pick): Promise>; - generatePoP(): Promise>; - generateVerificationRequest(): Promise; -} -//# sourceMappingURL=NonRepudiationOrig.d.ts.map \ No newline at end of file diff --git a/types/non-repudiation-protocol/NonRepudiationOrig.d.ts.map b/types/non-repudiation-protocol/NonRepudiationOrig.d.ts.map deleted file mode 100644 index 150dd68..0000000 --- a/types/non-repudiation-protocol/NonRepudiationOrig.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"NonRepudiationOrig.d.ts","sourceRoot":"","sources":["../../src/ts/non-repudiation-protocol/NonRepudiationOrig.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,YAAY,EAAE,qBAAqB,EAAE,GAAG,EAAE,OAAO,EAAe,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;AAEhL,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAQxD,qBAAa,kBAAkB;IAC7B,SAAS,EAAG,qBAAqB,CAAA;IACjC,QAAQ,EAAG,YAAY,CAAA;IACvB,WAAW,EAAE,OAAO,CAAA;IACpB,aAAa,EAAE,GAAG,CAAA;IAClB,KAAK,EAAE,SAAS,CAAA;IAChB,QAAQ,EAAG,eAAe,CAAA;IAC1B,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC,OAAO,CAAC,CAAA;gBAQzB,SAAS,EAAE,qBAAqB,EAAE,UAAU,EAAE,GAAG,EAAE,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,eAAe;YAqB9F,IAAI;YA2CJ,SAAS;IAsBjB,WAAW,IAAK,OAAO,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IAmBhD,SAAS,CAAE,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,sBAAsB,EAAE,WAAW,GAAG,WAAW,CAAC,GAAG,OAAO,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IAqC5H,WAAW,IAAK,OAAO,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IA2BhD,2BAA2B,IAAK,OAAO,CAAC,MAAM,CAAC;CAStD"} \ No newline at end of file diff --git a/types/non-repudiation-protocol/index.d.cts b/types/non-repudiation-protocol/index.d.cts deleted file mode 100644 index 969fd72..0000000 --- a/types/non-repudiation-protocol/index.d.cts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './NonRepudiationDest.js'; -export * from './NonRepudiationOrig.js'; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/types/non-repudiation-protocol/index.d.cts.map b/types/non-repudiation-protocol/index.d.cts.map deleted file mode 100644 index 24be3a2..0000000 --- a/types/non-repudiation-protocol/index.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ts/non-repudiation-protocol/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAA;AACvC,cAAc,yBAAyB,CAAA"} \ No newline at end of file diff --git a/types/non-repudiation-protocol/index.d.ts b/types/non-repudiation-protocol/index.d.ts deleted file mode 100644 index 969fd72..0000000 --- a/types/non-repudiation-protocol/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './NonRepudiationDest.js'; -export * from './NonRepudiationOrig.js'; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/types/non-repudiation-protocol/index.d.ts.map b/types/non-repudiation-protocol/index.d.ts.map deleted file mode 100644 index 24be3a2..0000000 --- a/types/non-repudiation-protocol/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ts/non-repudiation-protocol/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAA;AACvC,cAAc,yBAAyB,CAAA"} \ No newline at end of file diff --git a/types/proofs/createProof.d.cts b/types/proofs/createProof.d.cts deleted file mode 100644 index 87f6a31..0000000 --- a/types/proofs/createProof.d.cts +++ /dev/null @@ -1,3 +0,0 @@ -import { JWK, NrProofPayload, StoredProof } from '../types.js'; -export declare function createProof(payload: Omit, privateJwk: JWK): Promise>; -//# sourceMappingURL=createProof.d.ts.map \ No newline at end of file diff --git a/types/proofs/createProof.d.cts.map b/types/proofs/createProof.d.cts.map deleted file mode 100644 index 00a3af1..0000000 --- a/types/proofs/createProof.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"createProof.d.ts","sourceRoot":"","sources":["../../src/ts/proofs/createProof.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,cAAc,EAAE,WAAW,EAAsB,MAAM,aAAa,CAAA;AAWlF,wBAAsB,WAAW,CAAC,CAAC,SAAS,cAAc,EAAG,OAAO,EAAE,IAAI,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,UAAU,EAAE,GAAG,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CA4B9H"} \ No newline at end of file diff --git a/types/proofs/createProof.d.ts b/types/proofs/createProof.d.ts deleted file mode 100644 index 87f6a31..0000000 --- a/types/proofs/createProof.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { JWK, NrProofPayload, StoredProof } from '../types.js'; -export declare function createProof(payload: Omit, privateJwk: JWK): Promise>; -//# sourceMappingURL=createProof.d.ts.map \ No newline at end of file diff --git a/types/proofs/createProof.d.ts.map b/types/proofs/createProof.d.ts.map deleted file mode 100644 index 00a3af1..0000000 --- a/types/proofs/createProof.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"createProof.d.ts","sourceRoot":"","sources":["../../src/ts/proofs/createProof.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,cAAc,EAAE,WAAW,EAAsB,MAAM,aAAa,CAAA;AAWlF,wBAAsB,WAAW,CAAC,CAAC,SAAS,cAAc,EAAG,OAAO,EAAE,IAAI,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,UAAU,EAAE,GAAG,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CA4B9H"} \ No newline at end of file diff --git a/types/proofs/index.d.cts b/types/proofs/index.d.cts deleted file mode 100644 index fa27c36..0000000 --- a/types/proofs/index.d.cts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './createProof.js'; -export * from './verifyProof.js'; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/types/proofs/index.d.cts.map b/types/proofs/index.d.cts.map deleted file mode 100644 index e34249c..0000000 --- a/types/proofs/index.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ts/proofs/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA;AAChC,cAAc,kBAAkB,CAAA"} \ No newline at end of file diff --git a/types/proofs/index.d.ts b/types/proofs/index.d.ts deleted file mode 100644 index fa27c36..0000000 --- a/types/proofs/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from './createProof.js'; -export * from './verifyProof.js'; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/types/proofs/index.d.ts.map b/types/proofs/index.d.ts.map deleted file mode 100644 index e34249c..0000000 --- a/types/proofs/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ts/proofs/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA;AAChC,cAAc,kBAAkB,CAAA"} \ No newline at end of file diff --git a/types/proofs/verifyProof.d.cts b/types/proofs/verifyProof.d.cts deleted file mode 100644 index f07f122..0000000 --- a/types/proofs/verifyProof.d.cts +++ /dev/null @@ -1,7 +0,0 @@ -import { DecodedProof, Dict, NrProofPayload, TimestampVerifyOptions } from '../types.js'; -export declare function verifyProof(proof: string, expectedPayloadClaims: Partial & { - iss: T['iss']; - proofType: T['proofType']; - exchange: Dict; -}, options?: TimestampVerifyOptions): Promise>; -//# sourceMappingURL=verifyProof.d.ts.map \ No newline at end of file diff --git a/types/proofs/verifyProof.d.cts.map b/types/proofs/verifyProof.d.cts.map deleted file mode 100644 index f3f211b..0000000 --- a/types/proofs/verifyProof.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"verifyProof.d.ts","sourceRoot":"","sources":["../../src/ts/proofs/verifyProof.ts"],"names":[],"mappings":"AAEA,OAAO,EAAgB,YAAY,EAAE,IAAI,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;AA0BtG,wBAAsB,WAAW,CAAC,CAAC,SAAS,cAAc,EAAG,KAAK,EAAE,MAAM,EAAE,qBAAqB,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG;IAAE,GAAG,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC;IAAC,SAAS,EAAE,CAAC,CAAC,WAAW,CAAC,CAAC;IAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAA;CAAE,EAAE,OAAO,CAAC,EAAE,sBAAsB,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAuCvP"} \ No newline at end of file diff --git a/types/proofs/verifyProof.d.ts b/types/proofs/verifyProof.d.ts deleted file mode 100644 index f07f122..0000000 --- a/types/proofs/verifyProof.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { DecodedProof, Dict, NrProofPayload, TimestampVerifyOptions } from '../types.js'; -export declare function verifyProof(proof: string, expectedPayloadClaims: Partial & { - iss: T['iss']; - proofType: T['proofType']; - exchange: Dict; -}, options?: TimestampVerifyOptions): Promise>; -//# sourceMappingURL=verifyProof.d.ts.map \ No newline at end of file diff --git a/types/proofs/verifyProof.d.ts.map b/types/proofs/verifyProof.d.ts.map deleted file mode 100644 index f3f211b..0000000 --- a/types/proofs/verifyProof.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"verifyProof.d.ts","sourceRoot":"","sources":["../../src/ts/proofs/verifyProof.ts"],"names":[],"mappings":"AAEA,OAAO,EAAgB,YAAY,EAAE,IAAI,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;AA0BtG,wBAAsB,WAAW,CAAC,CAAC,SAAS,cAAc,EAAG,KAAK,EAAE,MAAM,EAAE,qBAAqB,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG;IAAE,GAAG,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC;IAAC,SAAS,EAAE,CAAC,CAAC,WAAW,CAAC,CAAC;IAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAA;CAAE,EAAE,OAAO,CAAC,EAAE,sBAAsB,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAuCvP"} \ No newline at end of file diff --git a/types/types.d.cts b/types/types.d.cts deleted file mode 100644 index 13204f0..0000000 --- a/types/types.d.cts +++ /dev/null @@ -1,133 +0,0 @@ -import { ContractInterface } from '@ethersproject/contracts'; -import { JWEHeaderParameters, JWK as JWKjose, JWTHeaderParameters } from 'jose'; -import { ENC_ALGS, HASH_ALGS, SIGNING_ALGS } from './constants.js'; -import { WalletComponents } from '@i3m/wallet-desktop-openapi/types'; -export { KeyLike } from 'jose'; -export { ContractInterface }; -export type HashAlg = typeof HASH_ALGS[number]; -export type SigningAlg = typeof SIGNING_ALGS[number]; -export type EncryptionAlg = typeof ENC_ALGS[number]; -export type Dict = T & { - [key: string | symbol | number]: any | undefined; -}; -export interface Algs { - hashAlg?: HashAlg; - SigningAlg?: SigningAlg; - EncAlg?: EncryptionAlg; -} -export interface JWK extends JWKjose { - alg: SigningAlg | EncryptionAlg; -} -export interface ContractConfig { - address: string; - abi: ContractInterface; -} -export interface DltConfig { - rpcProviderUrl: string; - gasLimit: number; - contract: ContractConfig; -} -export interface StoredProof { - jws: string; - payload: T; -} -export interface Block { - raw?: Uint8Array; - jwe?: string; - secret?: { - jwk: JWK; - hex: string; - }; - poo?: StoredProof; - por?: StoredProof; - pop?: StoredProof; -} -export interface OrigBlock extends Block { - raw: Uint8Array; - jwe: string; - secret: { - jwk: JWK; - hex: string; - }; -} -export interface TimestampVerifyOptions { - timestamp: 'iat' | number; - notBefore: 'iat' | number; - notAfter: 'iat' | number; - tolerance?: number; -} -export interface DataSharingAgreement extends WalletComponents.Schemas.DataSharingAgreement { -} -export interface DataExchangeAgreement extends WalletComponents.Schemas.DataExchangeAgreement { -} -export interface DataExchange extends WalletComponents.Schemas.DataExchange { - id: string; -} -export interface JwkPair { - publicJwk: JWK; - privateJwk: JWK; -} -export interface ProofPayload { - iat: number; - iss: string; - proofType: string; -} -export interface NrProofPayload extends ProofPayload { - exchange: DataExchange; -} -export interface PoOPayload extends NrProofPayload { - iss: 'orig'; - proofType: 'PoO'; -} -export interface PoRPayload extends NrProofPayload { - iss: 'dest'; - proofType: 'PoR'; - poo: string; -} -export interface PoPPayload extends NrProofPayload { - iss: 'orig'; - proofType: 'PoP'; - por: string; - secret: string; - verificationCode: string; -} -export interface ConflictResolutionRequestPayload extends ProofPayload { - proofType: 'request'; - iss: 'orig' | 'dest'; - iat: number; - por: string; - dataExchangeId: string; -} -export interface VerificationRequestPayload extends ConflictResolutionRequestPayload { - type: 'verificationRequest'; -} -export interface DisputeRequestPayload extends ConflictResolutionRequestPayload { - type: 'disputeRequest'; - iss: 'dest'; - cipherblock: string; -} -export interface ResolutionPayload extends ProofPayload { - proofType: 'resolution'; - type?: string; - resolution?: string; - dataExchangeId: string; - iat: number; - iss: string; - sub: string; -} -export interface VerificationResolutionPayload extends ResolutionPayload { - type: 'verification'; - resolution: 'completed' | 'not completed'; -} -export interface DisputeResolutionPayload extends ResolutionPayload { - type: 'dispute'; - resolution: 'accepted' | 'denied'; -} -export interface DecodedProof { - header: JWTHeaderParameters; - payload: T; - signer?: JWK; -} -export type getFromJws = (header: JWEHeaderParameters, payload: T) => Promise; -export type NrErrorName = 'not a compact jws' | 'invalid key' | 'encryption failed' | 'decryption failed' | 'jws verification failed' | 'invalid algorithm' | 'invalid EIP-55 address' | 'invalid poo' | 'invalid por' | 'invalid pop' | 'invalid dispute request' | 'invalid verification request' | 'invalid dispute request' | 'data exchange not as expected' | 'dataExchange integrity violated' | 'secret not published' | 'secret not published in time' | 'received too late' | 'unexpected error' | 'invalid timestamp' | 'invalid format' | 'cannot contact the ledger' | 'cannot verify'; -//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/types/types.d.cts.map b/types/types.d.cts.map deleted file mode 100644 index a4065f1..0000000 --- a/types/types.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/ts/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,EAAE,mBAAmB,EAAE,GAAG,IAAI,OAAO,EAAE,mBAAmB,EAAE,MAAM,MAAM,CAAA;AAC/E,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAA;AAEpE,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AAC9B,OAAO,EAAE,iBAAiB,EAAE,CAAA;AAE5B,MAAM,MAAM,OAAO,GAAG,OAAO,SAAS,CAAC,MAAM,CAAC,CAAA;AAC9C,MAAM,MAAM,UAAU,GAAG,OAAO,YAAY,CAAC,MAAM,CAAC,CAAA;AACpD,MAAM,MAAM,aAAa,GAAG,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAA;AAE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B,GACnB,wBAAwB,GACxB,aAAa,GACb,aAAa,GACb,aAAa,GACb,yBAAyB,GACzB,8BAA8B,GAC9B,yBAAyB,GACzB,+BAA+B,GAC/B,iCAAiC,GACjC,sBAAsB,GACtB,8BAA8B,GAC9B,mBAAmB,GACnB,kBAAkB,GAClB,mBAAmB,GACnB,gBAAgB,GAChB,2BAA2B,GAC3B,eAAe,CAAA"} \ No newline at end of file diff --git a/types/types.d.ts b/types/types.d.ts deleted file mode 100644 index 13204f0..0000000 --- a/types/types.d.ts +++ /dev/null @@ -1,133 +0,0 @@ -import { ContractInterface } from '@ethersproject/contracts'; -import { JWEHeaderParameters, JWK as JWKjose, JWTHeaderParameters } from 'jose'; -import { ENC_ALGS, HASH_ALGS, SIGNING_ALGS } from './constants.js'; -import { WalletComponents } from '@i3m/wallet-desktop-openapi/types'; -export { KeyLike } from 'jose'; -export { ContractInterface }; -export type HashAlg = typeof HASH_ALGS[number]; -export type SigningAlg = typeof SIGNING_ALGS[number]; -export type EncryptionAlg = typeof ENC_ALGS[number]; -export type Dict = T & { - [key: string | symbol | number]: any | undefined; -}; -export interface Algs { - hashAlg?: HashAlg; - SigningAlg?: SigningAlg; - EncAlg?: EncryptionAlg; -} -export interface JWK extends JWKjose { - alg: SigningAlg | EncryptionAlg; -} -export interface ContractConfig { - address: string; - abi: ContractInterface; -} -export interface DltConfig { - rpcProviderUrl: string; - gasLimit: number; - contract: ContractConfig; -} -export interface StoredProof { - jws: string; - payload: T; -} -export interface Block { - raw?: Uint8Array; - jwe?: string; - secret?: { - jwk: JWK; - hex: string; - }; - poo?: StoredProof; - por?: StoredProof; - pop?: StoredProof; -} -export interface OrigBlock extends Block { - raw: Uint8Array; - jwe: string; - secret: { - jwk: JWK; - hex: string; - }; -} -export interface TimestampVerifyOptions { - timestamp: 'iat' | number; - notBefore: 'iat' | number; - notAfter: 'iat' | number; - tolerance?: number; -} -export interface DataSharingAgreement extends WalletComponents.Schemas.DataSharingAgreement { -} -export interface DataExchangeAgreement extends WalletComponents.Schemas.DataExchangeAgreement { -} -export interface DataExchange extends WalletComponents.Schemas.DataExchange { - id: string; -} -export interface JwkPair { - publicJwk: JWK; - privateJwk: JWK; -} -export interface ProofPayload { - iat: number; - iss: string; - proofType: string; -} -export interface NrProofPayload extends ProofPayload { - exchange: DataExchange; -} -export interface PoOPayload extends NrProofPayload { - iss: 'orig'; - proofType: 'PoO'; -} -export interface PoRPayload extends NrProofPayload { - iss: 'dest'; - proofType: 'PoR'; - poo: string; -} -export interface PoPPayload extends NrProofPayload { - iss: 'orig'; - proofType: 'PoP'; - por: string; - secret: string; - verificationCode: string; -} -export interface ConflictResolutionRequestPayload extends ProofPayload { - proofType: 'request'; - iss: 'orig' | 'dest'; - iat: number; - por: string; - dataExchangeId: string; -} -export interface VerificationRequestPayload extends ConflictResolutionRequestPayload { - type: 'verificationRequest'; -} -export interface DisputeRequestPayload extends ConflictResolutionRequestPayload { - type: 'disputeRequest'; - iss: 'dest'; - cipherblock: string; -} -export interface ResolutionPayload extends ProofPayload { - proofType: 'resolution'; - type?: string; - resolution?: string; - dataExchangeId: string; - iat: number; - iss: string; - sub: string; -} -export interface VerificationResolutionPayload extends ResolutionPayload { - type: 'verification'; - resolution: 'completed' | 'not completed'; -} -export interface DisputeResolutionPayload extends ResolutionPayload { - type: 'dispute'; - resolution: 'accepted' | 'denied'; -} -export interface DecodedProof { - header: JWTHeaderParameters; - payload: T; - signer?: JWK; -} -export type getFromJws = (header: JWEHeaderParameters, payload: T) => Promise; -export type NrErrorName = 'not a compact jws' | 'invalid key' | 'encryption failed' | 'decryption failed' | 'jws verification failed' | 'invalid algorithm' | 'invalid EIP-55 address' | 'invalid poo' | 'invalid por' | 'invalid pop' | 'invalid dispute request' | 'invalid verification request' | 'invalid dispute request' | 'data exchange not as expected' | 'dataExchange integrity violated' | 'secret not published' | 'secret not published in time' | 'received too late' | 'unexpected error' | 'invalid timestamp' | 'invalid format' | 'cannot contact the ledger' | 'cannot verify'; -//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/types/types.d.ts.map b/types/types.d.ts.map deleted file mode 100644 index a4065f1..0000000 --- a/types/types.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/ts/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,EAAE,mBAAmB,EAAE,GAAG,IAAI,OAAO,EAAE,mBAAmB,EAAE,MAAM,MAAM,CAAA;AAC/E,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAA;AAEpE,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AAC9B,OAAO,EAAE,iBAAiB,EAAE,CAAA;AAE5B,MAAM,MAAM,OAAO,GAAG,OAAO,SAAS,CAAC,MAAM,CAAC,CAAA;AAC9C,MAAM,MAAM,UAAU,GAAG,OAAO,YAAY,CAAC,MAAM,CAAC,CAAA;AACpD,MAAM,MAAM,aAAa,GAAG,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAA;AAEnD,MAAM,MAAM,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG;IACxB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,GAAG,GAAG,SAAS,CAAA;CACjD,CAAA;AAED,MAAM,WAAW,IAAI;IACnB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,UAAU,CAAC,EAAE,UAAU,CAAA;IACvB,MAAM,CAAC,EAAE,aAAa,CAAA;CACvB;AAED,MAAM,WAAW,GAAI,SAAQ,OAAO;IAClC,GAAG,EAAE,UAAU,GAAG,aAAa,CAAA;CAChC;AAED,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,CAAA;IACf,GAAG,EAAE,iBAAiB,CAAA;CACvB;AAED,MAAM,W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,MAAM,CAAA;IACnB,cAAc,EAAE,MAAM,CAAA;IACtB,GAAG,EAAE,MAAM,CAAA;IACX,GAAG,EAAE,MAAM,CAAA;IACX,GAAG,EAAE,MAAM,CAAA;CACZ;AAED,MAAM,WAAW,6BAA8B,SAAQ,iBAAiB;IACtE,IAAI,EAAE,cAAc,CAAA;IACpB,UAAU,EAAE,WAAW,GAAG,eAAe,CAAA;CAC1C;AAED,MAAM,WAAW,wBAAyB,SAAQ,iBAAiB;IACjE,IAAI,EAAE,SAAS,CAAA;IACf,UAAU,EAAE,UAAU,GAAG,QAAQ,CAAA;CAClC;AAED,MAAM,WAAW,YAAY,CAAC,CAAC,SAAS,YAAY;IAClD,MAAM,EAAE,mBAAmB,CAAA;IAC3B,OAAO,EAAE,CAAC,CAAA;IACV,MAAM,CAAC,EAAE,GAAG,CAAA;CACb;AACD,MAAM,MAAM,UAAU,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,mBAAmB,EAAE,OAAO,EAAE,CAAC,KAAK,OAAO,CAAC,GAAG,CAAC,CAAA;AAErF,MAAM,MAAM,WAAW,GACvB,mBAAmB,GACnB,aAAa,GACb,mBAAmB,GACnB,mBAAmB,GACnB,yBAAyB,GACzB,mBAAmB,GACnB,wBAAwB,GACxB,aAAa,GACb,aAAa,GACb,aAAa,GACb,yBAAyB,GACzB,8BAA8B,GAC9B,yBAAyB,GACzB,+BAA+B,GAC/B,iCAAiC,GACjC,sBAAsB,GACtB,8BAA8B,GAC9B,mBAAmB,GACnB,kBAAkB,GAClB,mBAAmB,GACnB,gBAAgB,GAChB,2BAA2B,GAC3B,eAAe,CAAA"} \ No newline at end of file diff --git a/types/utils/algByteLength.d.cts b/types/utils/algByteLength.d.cts deleted file mode 100644 index 6a409c8..0000000 --- a/types/utils/algByteLength.d.cts +++ /dev/null @@ -1,3 +0,0 @@ -import { EncryptionAlg, HashAlg, SigningAlg } from '../types.js'; -export declare function algByteLength(alg: EncryptionAlg | HashAlg | SigningAlg): number; -//# sourceMappingURL=algByteLength.d.ts.map \ No newline at end of file diff --git a/types/utils/algByteLength.d.cts.map b/types/utils/algByteLength.d.cts.map deleted file mode 100644 index a5b6f4b..0000000 --- a/types/utils/algByteLength.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"algByteLength.d.ts","sourceRoot":"","sources":["../../src/ts/utils/algByteLength.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAEhE,wBAAgB,aAAa,CAAE,GAAG,EAAE,aAAa,GAAG,OAAO,GAAG,UAAU,GAAG,MAAM,CAMhF"} \ No newline at end of file diff --git a/types/utils/algByteLength.d.ts b/types/utils/algByteLength.d.ts deleted file mode 100644 index 6a409c8..0000000 --- a/types/utils/algByteLength.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { EncryptionAlg, HashAlg, SigningAlg } from '../types.js'; -export declare function algByteLength(alg: EncryptionAlg | HashAlg | SigningAlg): number; -//# sourceMappingURL=algByteLength.d.ts.map \ No newline at end of file diff --git a/types/utils/algByteLength.d.ts.map b/types/utils/algByteLength.d.ts.map deleted file mode 100644 index a5b6f4b..0000000 --- a/types/utils/algByteLength.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"algByteLength.d.ts","sourceRoot":"","sources":["../../src/ts/utils/algByteLength.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAEhE,wBAAgB,aAAa,CAAE,GAAG,EAAE,aAAa,GAAG,OAAO,GAAG,UAAU,GAAG,MAAM,CAMhF"} \ No newline at end of file diff --git a/types/utils/getDltAddress.d.cts b/types/utils/getDltAddress.d.cts deleted file mode 100644 index 48cbc4f..0000000 --- a/types/utils/getDltAddress.d.cts +++ /dev/null @@ -1,2 +0,0 @@ -export declare function getDltAddress(didOrKeyInHex: string): string; -//# sourceMappingURL=getDltAddress.d.ts.map \ No newline at end of file diff --git a/types/utils/getDltAddress.d.cts.map b/types/utils/getDltAddress.d.cts.map deleted file mode 100644 index 6d050cf..0000000 --- a/types/utils/getDltAddress.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"getDltAddress.d.ts","sourceRoot":"","sources":["../../src/ts/utils/getDltAddress.ts"],"names":[],"mappings":"AAGA,wBAAgB,aAAa,CAAE,aAAa,EAAE,MAAM,GAAG,MAAM,CAU5D"} \ No newline at end of file diff --git a/types/utils/getDltAddress.d.ts b/types/utils/getDltAddress.d.ts deleted file mode 100644 index 48cbc4f..0000000 --- a/types/utils/getDltAddress.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare function getDltAddress(didOrKeyInHex: string): string; -//# sourceMappingURL=getDltAddress.d.ts.map \ No newline at end of file diff --git a/types/utils/getDltAddress.d.ts.map b/types/utils/getDltAddress.d.ts.map deleted file mode 100644 index 6d050cf..0000000 --- a/types/utils/getDltAddress.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"getDltAddress.d.ts","sourceRoot":"","sources":["../../src/ts/utils/getDltAddress.ts"],"names":[],"mappings":"AAGA,wBAAgB,aAAa,CAAE,aAAa,EAAE,MAAM,GAAG,MAAM,CAU5D"} \ No newline at end of file diff --git a/types/utils/index.d.cts b/types/utils/index.d.cts deleted file mode 100644 index dc532d6..0000000 --- a/types/utils/index.d.cts +++ /dev/null @@ -1,8 +0,0 @@ -export * from './timestamps.js'; -export * from './jsonSort.js'; -export * from './parseHex.js'; -export * from './parseJwk.js'; -export * from './sha.js'; -export * from './parseAddress.js'; -export * from './getDltAddress.js'; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/types/utils/index.d.cts.map b/types/utils/index.d.cts.map deleted file mode 100644 index 40b6e3d..0000000 --- a/types/utils/index.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ts/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA;AAC/B,cAAc,eAAe,CAAA;AAC7B,cAAc,eAAe,CAAA;AAC7B,cAAc,eAAe,CAAA;AAC7B,cAAc,UAAU,CAAA;AACxB,cAAc,mBAAmB,CAAA;AACjC,cAAc,oBAAoB,CAAA"} \ No newline at end of file diff --git a/types/utils/index.d.ts b/types/utils/index.d.ts deleted file mode 100644 index dc532d6..0000000 --- a/types/utils/index.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -export * from './timestamps.js'; -export * from './jsonSort.js'; -export * from './parseHex.js'; -export * from './parseJwk.js'; -export * from './sha.js'; -export * from './parseAddress.js'; -export * from './getDltAddress.js'; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/types/utils/index.d.ts.map b/types/utils/index.d.ts.map deleted file mode 100644 index 40b6e3d..0000000 --- a/types/utils/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ts/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA;AAC/B,cAAc,eAAe,CAAA;AAC7B,cAAc,eAAe,CAAA;AAC7B,cAAc,eAAe,CAAA;AAC7B,cAAc,UAAU,CAAA;AACxB,cAAc,mBAAmB,CAAA;AACjC,cAAc,oBAAoB,CAAA"} \ No newline at end of file diff --git a/types/utils/jsonSort.d.cts b/types/utils/jsonSort.d.cts deleted file mode 100644 index 70cbb5a..0000000 --- a/types/utils/jsonSort.d.cts +++ /dev/null @@ -1,2 +0,0 @@ -export declare function jsonSort(obj: any): any; -//# sourceMappingURL=jsonSort.d.ts.map \ No newline at end of file diff --git a/types/utils/jsonSort.d.cts.map b/types/utils/jsonSort.d.cts.map deleted file mode 100644 index 61de35b..0000000 --- a/types/utils/jsonSort.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"jsonSort.d.ts","sourceRoot":"","sources":["../../src/ts/utils/jsonSort.ts"],"names":[],"mappings":"AAIA,wBAAgB,QAAQ,CAAE,GAAG,EAAE,GAAG,GAAG,GAAG,CAcvC"} \ No newline at end of file diff --git a/types/utils/jsonSort.d.ts b/types/utils/jsonSort.d.ts deleted file mode 100644 index 70cbb5a..0000000 --- a/types/utils/jsonSort.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare function jsonSort(obj: any): any; -//# sourceMappingURL=jsonSort.d.ts.map \ No newline at end of file diff --git a/types/utils/jsonSort.d.ts.map b/types/utils/jsonSort.d.ts.map deleted file mode 100644 index 61de35b..0000000 --- a/types/utils/jsonSort.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"jsonSort.d.ts","sourceRoot":"","sources":["../../src/ts/utils/jsonSort.ts"],"names":[],"mappings":"AAIA,wBAAgB,QAAQ,CAAE,GAAG,EAAE,GAAG,GAAG,GAAG,CAcvC"} \ No newline at end of file diff --git a/types/utils/parseAddress.d.cts b/types/utils/parseAddress.d.cts deleted file mode 100644 index a531cad..0000000 --- a/types/utils/parseAddress.d.cts +++ /dev/null @@ -1,2 +0,0 @@ -export declare function parseAddress(a: string): string; -//# sourceMappingURL=parseAddress.d.ts.map \ No newline at end of file diff --git a/types/utils/parseAddress.d.cts.map b/types/utils/parseAddress.d.cts.map deleted file mode 100644 index a1b58e3..0000000 --- a/types/utils/parseAddress.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"parseAddress.d.ts","sourceRoot":"","sources":["../../src/ts/utils/parseAddress.ts"],"names":[],"mappings":"AAQA,wBAAgB,YAAY,CAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAW/C"} \ No newline at end of file diff --git a/types/utils/parseAddress.d.ts b/types/utils/parseAddress.d.ts deleted file mode 100644 index a531cad..0000000 --- a/types/utils/parseAddress.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare function parseAddress(a: string): string; -//# sourceMappingURL=parseAddress.d.ts.map \ No newline at end of file diff --git a/types/utils/parseAddress.d.ts.map b/types/utils/parseAddress.d.ts.map deleted file mode 100644 index a1b58e3..0000000 --- a/types/utils/parseAddress.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"parseAddress.d.ts","sourceRoot":"","sources":["../../src/ts/utils/parseAddress.ts"],"names":[],"mappings":"AAQA,wBAAgB,YAAY,CAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAW/C"} \ No newline at end of file diff --git a/types/utils/parseHex.d.cts b/types/utils/parseHex.d.cts deleted file mode 100644 index f2634bb..0000000 --- a/types/utils/parseHex.d.cts +++ /dev/null @@ -1,2 +0,0 @@ -export declare function parseHex(a: string, prefix0x?: boolean, byteLength?: number): string; -//# sourceMappingURL=parseHex.d.ts.map \ No newline at end of file diff --git a/types/utils/parseHex.d.cts.map b/types/utils/parseHex.d.cts.map deleted file mode 100644 index 13cf104..0000000 --- a/types/utils/parseHex.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"parseHex.d.ts","sourceRoot":"","sources":["../../src/ts/utils/parseHex.ts"],"names":[],"mappings":"AAGA,wBAAgB,QAAQ,CAAE,CAAC,EAAE,MAAM,EAAE,QAAQ,GAAE,OAAe,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAM3F"} \ No newline at end of file diff --git a/types/utils/parseHex.d.ts b/types/utils/parseHex.d.ts deleted file mode 100644 index f2634bb..0000000 --- a/types/utils/parseHex.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare function parseHex(a: string, prefix0x?: boolean, byteLength?: number): string; -//# sourceMappingURL=parseHex.d.ts.map \ No newline at end of file diff --git a/types/utils/parseHex.d.ts.map b/types/utils/parseHex.d.ts.map deleted file mode 100644 index 13cf104..0000000 --- a/types/utils/parseHex.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"parseHex.d.ts","sourceRoot":"","sources":["../../src/ts/utils/parseHex.ts"],"names":[],"mappings":"AAGA,wBAAgB,QAAQ,CAAE,CAAC,EAAE,MAAM,EAAE,QAAQ,GAAE,OAAe,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAM3F"} \ No newline at end of file diff --git a/types/utils/parseJwk.d.cts b/types/utils/parseJwk.d.cts deleted file mode 100644 index e1e185c..0000000 --- a/types/utils/parseJwk.d.cts +++ /dev/null @@ -1,4 +0,0 @@ -import { JWK } from '../types.js'; -export declare function parseJwk(jwk: JWK, stringify: true): Promise; -export declare function parseJwk(jwk: JWK, stringify: false): Promise; -//# sourceMappingURL=parseJwk.d.ts.map \ No newline at end of file diff --git a/types/utils/parseJwk.d.cts.map b/types/utils/parseJwk.d.cts.map deleted file mode 100644 index c4b4acf..0000000 --- a/types/utils/parseJwk.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"parseJwk.d.ts","sourceRoot":"","sources":["../../src/ts/utils/parseJwk.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;AAGjC,wBAAsB,QAAQ,CAAE,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;AAC3E,wBAAsB,QAAQ,CAAE,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,CAAA"} \ No newline at end of file diff --git a/types/utils/parseJwk.d.ts b/types/utils/parseJwk.d.ts deleted file mode 100644 index e1e185c..0000000 --- a/types/utils/parseJwk.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { JWK } from '../types.js'; -export declare function parseJwk(jwk: JWK, stringify: true): Promise; -export declare function parseJwk(jwk: JWK, stringify: false): Promise; -//# sourceMappingURL=parseJwk.d.ts.map \ No newline at end of file diff --git a/types/utils/parseJwk.d.ts.map b/types/utils/parseJwk.d.ts.map deleted file mode 100644 index c4b4acf..0000000 --- a/types/utils/parseJwk.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"parseJwk.d.ts","sourceRoot":"","sources":["../../src/ts/utils/parseJwk.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;AAGjC,wBAAsB,QAAQ,CAAE,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;AAC3E,wBAAsB,QAAQ,CAAE,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,CAAA"} \ No newline at end of file diff --git a/types/utils/sha.d.cts b/types/utils/sha.d.cts deleted file mode 100644 index 38d8f0d..0000000 --- a/types/utils/sha.d.cts +++ /dev/null @@ -1,3 +0,0 @@ -import { HashAlg } from '../types.js'; -export declare function sha(input: string | Uint8Array, algorithm: HashAlg): Promise; -//# sourceMappingURL=sha.d.ts.map \ No newline at end of file diff --git a/types/utils/sha.d.cts.map b/types/utils/sha.d.cts.map deleted file mode 100644 index f87c0c7..0000000 --- a/types/utils/sha.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sha.d.ts","sourceRoot":"","sources":["../../src/ts/utils/sha.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAErC,wBAAsB,GAAG,CAAE,KAAK,EAAE,MAAM,GAAG,UAAU,EAAE,SAAS,EAAE,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC,CAqB9F"} \ No newline at end of file diff --git a/types/utils/sha.d.ts b/types/utils/sha.d.ts deleted file mode 100644 index 38d8f0d..0000000 --- a/types/utils/sha.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { HashAlg } from '../types.js'; -export declare function sha(input: string | Uint8Array, algorithm: HashAlg): Promise; -//# sourceMappingURL=sha.d.ts.map \ No newline at end of file diff --git a/types/utils/sha.d.ts.map b/types/utils/sha.d.ts.map deleted file mode 100644 index f87c0c7..0000000 --- a/types/utils/sha.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sha.d.ts","sourceRoot":"","sources":["../../src/ts/utils/sha.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAErC,wBAAsB,GAAG,CAAE,KAAK,EAAE,MAAM,GAAG,UAAU,EAAE,SAAS,EAAE,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC,CAqB9F"} \ No newline at end of file diff --git a/types/utils/timestamps.d.cts b/types/utils/timestamps.d.cts deleted file mode 100644 index 29a4793..0000000 --- a/types/utils/timestamps.d.cts +++ /dev/null @@ -1,2 +0,0 @@ -export declare function checkTimestamp(timestamp: number, notBefore: number, notAfter: number, tolerance?: number): void; -//# sourceMappingURL=timestamps.d.ts.map \ No newline at end of file diff --git a/types/utils/timestamps.d.cts.map b/types/utils/timestamps.d.cts.map deleted file mode 100644 index fea8dd0..0000000 --- a/types/utils/timestamps.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"timestamps.d.ts","sourceRoot":"","sources":["../../src/ts/utils/timestamps.ts"],"names":[],"mappings":"AAEA,wBAAgB,cAAc,CAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,GAAE,MAAa,GAAG,IAAI,CAMtH"} \ No newline at end of file diff --git a/types/utils/timestamps.d.ts b/types/utils/timestamps.d.ts deleted file mode 100644 index 29a4793..0000000 --- a/types/utils/timestamps.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare function checkTimestamp(timestamp: number, notBefore: number, notAfter: number, tolerance?: number): void; -//# sourceMappingURL=timestamps.d.ts.map \ No newline at end of file diff --git a/types/utils/timestamps.d.ts.map b/types/utils/timestamps.d.ts.map deleted file mode 100644 index fea8dd0..0000000 --- a/types/utils/timestamps.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"timestamps.d.ts","sourceRoot":"","sources":["../../src/ts/utils/timestamps.ts"],"names":[],"mappings":"AAEA,wBAAgB,cAAc,CAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,GAAE,MAAa,GAAG,IAAI,CAMtH"} \ No newline at end of file