@aeternity/aepp-sdk 12.1.2 → 13.0.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/aepp-sdk.browser-script.js +1 -1
- package/dist/aepp-sdk.browser-script.js.map +1 -1
- package/dist/aepp-sdk.browser.js +1 -1
- package/dist/aepp-sdk.browser.js.map +1 -1
- package/dist/aepp-sdk.js +6580 -8860
- package/dist/aepp-sdk.js.map +1 -1
- package/es/AeSdk.d.ts +7 -3
- package/es/AeSdk.mjs +17 -22
- package/es/AeSdk.mjs.map +1 -1
- package/es/AeSdkAepp.d.ts +6 -5
- package/es/AeSdkAepp.mjs +7 -30
- package/es/AeSdkAepp.mjs.map +1 -1
- package/es/AeSdkBase.d.ts +18 -140
- package/es/AeSdkBase.mjs +27 -185
- package/es/AeSdkBase.mjs.map +1 -1
- package/es/AeSdkMethods.d.ts +124 -0
- package/es/AeSdkMethods.mjs +122 -0
- package/es/AeSdkMethods.mjs.map +1 -0
- package/es/AeSdkWallet.d.ts +7 -21
- package/es/AeSdkWallet.mjs +38 -86
- package/es/AeSdkWallet.mjs.map +1 -1
- package/es/Node.d.ts +7 -12
- package/es/Node.mjs +34 -47
- package/es/Node.mjs.map +1 -1
- package/es/account/Base.d.ts +24 -40
- package/es/account/Base.mjs +1 -101
- package/es/account/Base.mjs.map +1 -1
- package/es/account/Generalized.d.ts +16 -0
- package/es/account/Generalized.mjs +111 -0
- package/es/account/Generalized.mjs.map +1 -0
- package/es/account/Ledger.d.ts +28 -0
- package/es/account/Ledger.mjs +101 -0
- package/es/account/Ledger.mjs.map +1 -0
- package/es/account/LedgerFactory.d.ts +39 -0
- package/es/account/LedgerFactory.mjs +81 -0
- package/es/account/LedgerFactory.mjs.map +1 -0
- package/es/account/Memory.d.ts +13 -17
- package/es/account/Memory.mjs +43 -65
- package/es/account/Memory.mjs.map +1 -1
- package/es/account/Rpc.d.ts +6 -8
- package/es/account/Rpc.mjs +14 -32
- package/es/account/Rpc.mjs.map +1 -1
- package/es/aens.d.ts +3 -3
- package/es/aens.mjs +42 -41
- package/es/aens.mjs.map +1 -1
- package/es/aepp-wallet-communication/connection/Browser.mjs +9 -13
- package/es/aepp-wallet-communication/connection/Browser.mjs.map +1 -1
- package/es/aepp-wallet-communication/connection/BrowserRuntime.mjs +3 -7
- package/es/aepp-wallet-communication/connection/BrowserRuntime.mjs.map +1 -1
- package/es/aepp-wallet-communication/connection/BrowserWindowMessage.d.ts +1 -1
- package/es/aepp-wallet-communication/connection/BrowserWindowMessage.mjs +0 -31
- package/es/aepp-wallet-communication/connection/BrowserWindowMessage.mjs.map +1 -1
- package/es/aepp-wallet-communication/connection-proxy.mjs.map +1 -1
- package/es/aepp-wallet-communication/rpc/RpcClient.d.ts +3 -3
- package/es/aepp-wallet-communication/rpc/RpcClient.mjs +4 -41
- package/es/aepp-wallet-communication/rpc/RpcClient.mjs.map +1 -1
- package/es/aepp-wallet-communication/rpc/types.d.ts +7 -1
- package/es/aepp-wallet-communication/rpc/types.mjs.map +1 -1
- package/es/aepp-wallet-communication/schema.mjs +14 -68
- package/es/aepp-wallet-communication/schema.mjs.map +1 -1
- package/es/aepp-wallet-communication/wallet-detector.mjs +0 -3
- package/es/aepp-wallet-communication/wallet-detector.mjs.map +1 -1
- package/es/apis/compiler/compiler.d.ts +23 -29
- package/es/apis/compiler/compiler.mjs +128 -189
- package/es/apis/compiler/compiler.mjs.map +1 -1
- package/es/apis/compiler/index.mjs.map +1 -1
- package/es/apis/compiler/models/index.d.ts +82 -135
- package/es/apis/compiler/models/index.mjs +1 -47
- package/es/apis/compiler/models/index.mjs.map +1 -1
- package/es/apis/compiler/models/mappers.d.ts +8 -8
- package/es/apis/compiler/models/mappers.mjs +165 -183
- package/es/apis/compiler/models/mappers.mjs.map +1 -1
- package/es/apis/compiler/models/parameters.d.ts +0 -1
- package/es/apis/compiler/models/parameters.mjs +5 -9
- package/es/apis/compiler/models/parameters.mjs.map +1 -1
- package/es/apis/node/index.mjs.map +1 -1
- package/es/apis/node/models/index.d.ts +48 -48
- package/es/apis/node/models/mappers.mjs +12 -6
- package/es/apis/node/models/mappers.mjs.map +1 -1
- package/es/apis/node/models/parameters.mjs.map +1 -1
- package/es/apis/node/node.mjs +43 -84
- package/es/apis/node/node.mjs.map +1 -1
- package/es/chain.d.ts +1 -1
- package/es/chain.mjs +33 -58
- package/es/chain.mjs.map +1 -1
- package/es/channel/Base.d.ts +195 -0
- package/es/channel/Base.mjs +290 -0
- package/es/channel/Base.mjs.map +1 -0
- package/es/channel/Contract.d.ts +247 -0
- package/es/channel/Contract.mjs +420 -0
- package/es/channel/Contract.mjs.map +1 -0
- package/es/channel/Spend.d.ts +217 -0
- package/es/channel/Spend.mjs +383 -0
- package/es/channel/Spend.mjs.map +1 -0
- package/es/channel/handlers.d.ts +8 -21
- package/es/channel/handlers.mjs +141 -891
- package/es/channel/handlers.mjs.map +1 -1
- package/es/channel/internal.d.ts +27 -21
- package/es/channel/internal.mjs +98 -190
- package/es/channel/internal.mjs.map +1 -1
- package/es/contract/{Compiler.d.ts → CompilerHttp.d.ts} +3 -3
- package/es/contract/{Compiler.mjs → CompilerHttp.mjs} +8 -13
- package/es/contract/CompilerHttp.mjs.map +1 -0
- package/es/contract/Contract.d.ts +235 -0
- package/es/contract/Contract.mjs +534 -0
- package/es/contract/Contract.mjs.map +1 -0
- package/es/contract/ga.d.ts +7 -33
- package/es/contract/ga.mjs +20 -112
- package/es/contract/ga.mjs.map +1 -1
- package/es/index.d.ts +9 -6
- package/es/index.mjs +8 -6
- package/es/index.mjs.map +1 -1
- package/es/oracle.d.ts +5 -5
- package/es/oracle.mjs +33 -39
- package/es/oracle.mjs.map +1 -1
- package/es/spend.d.ts +3 -3
- package/es/spend.mjs +17 -20
- package/es/spend.mjs.map +1 -1
- package/es/tx/builder/constants.d.ts +2 -1
- package/es/tx/builder/constants.mjs +12 -12
- package/es/tx/builder/constants.mjs.map +1 -1
- package/es/tx/builder/field-types/address.d.ts +15 -0
- package/es/tx/builder/field-types/address.mjs +42 -0
- package/es/tx/builder/field-types/address.mjs.map +1 -0
- package/es/tx/builder/field-types/addresses.d.ts +6 -0
- package/es/tx/builder/field-types/addresses.mjs +13 -0
- package/es/tx/builder/field-types/addresses.mjs.map +1 -0
- package/es/tx/builder/field-types/coin-amount.d.ts +1 -2
- package/es/tx/builder/field-types/coin-amount.mjs +4 -12
- package/es/tx/builder/field-types/coin-amount.mjs.map +1 -1
- package/es/tx/builder/field-types/deposit.d.ts +0 -1
- package/es/tx/builder/field-types/deposit.mjs +2 -4
- package/es/tx/builder/field-types/deposit.mjs.map +1 -1
- package/es/tx/builder/field-types/enumeration.d.ts +5 -0
- package/es/tx/builder/field-types/enumeration.mjs +21 -0
- package/es/tx/builder/field-types/enumeration.mjs.map +1 -0
- package/es/tx/builder/field-types/fee.d.ts +1 -9
- package/es/tx/builder/field-types/fee.mjs +9 -25
- package/es/tx/builder/field-types/fee.mjs.map +1 -1
- package/es/tx/builder/field-types/field.mjs +0 -2
- package/es/tx/builder/field-types/field.mjs.map +1 -1
- package/es/tx/builder/field-types/gas-limit.mjs +4 -9
- package/es/tx/builder/field-types/gas-limit.mjs.map +1 -1
- package/es/tx/builder/field-types/gas-price.d.ts +1 -2
- package/es/tx/builder/field-types/gas-price.mjs +3 -7
- package/es/tx/builder/field-types/gas-price.mjs.map +1 -1
- package/es/tx/builder/field-types/index.d.ts +23 -11
- package/es/tx/builder/field-types/index.mjs +10 -3
- package/es/tx/builder/field-types/index.mjs.map +1 -1
- package/es/tx/builder/field-types/name-fee.d.ts +0 -1
- package/es/tx/builder/field-types/name-fee.mjs +3 -5
- package/es/tx/builder/field-types/name-fee.mjs.map +1 -1
- package/es/tx/builder/field-types/name-id.d.ts +1 -4
- package/es/tx/builder/field-types/name-id.mjs +4 -10
- package/es/tx/builder/field-types/name-id.mjs.map +1 -1
- package/es/tx/builder/field-types/name.mjs +0 -2
- package/es/tx/builder/field-types/name.mjs.map +1 -1
- package/es/tx/builder/field-types/pointers.d.ts +23 -0
- package/es/tx/builder/field-types/pointers.mjs +36 -0
- package/es/tx/builder/field-types/pointers.mjs.map +1 -0
- package/es/tx/builder/field-types/short-u-int.mjs +0 -2
- package/es/tx/builder/field-types/short-u-int.mjs.map +1 -1
- package/es/tx/builder/field-types/u-int.d.ts +1 -1
- package/es/tx/builder/field-types/u-int.mjs +3 -4
- package/es/tx/builder/field-types/u-int.mjs.map +1 -1
- package/es/tx/builder/helpers.d.ts +2 -32
- package/es/tx/builder/helpers.mjs +19 -71
- package/es/tx/builder/helpers.mjs.map +1 -1
- package/es/tx/builder/index.d.ts +1 -21
- package/es/tx/builder/index.mjs +29 -148
- package/es/tx/builder/index.mjs.map +1 -1
- package/es/tx/builder/schema.d.ts +336 -176
- package/es/tx/builder/schema.mjs +71 -78
- package/es/tx/builder/schema.mjs.map +1 -1
- package/es/tx/index.d.ts +3 -33
- package/es/tx/index.mjs +26 -43
- package/es/tx/index.mjs.map +1 -1
- package/es/tx/validator.d.ts +2 -2
- package/es/tx/validator.mjs +86 -59
- package/es/tx/validator.mjs.map +1 -1
- package/es/typings/{@aeternity__argon2-browser → @aeternity__aepp-calldata}/index.d.mjs +0 -0
- package/es/typings/@aeternity__aepp-calldata/index.d.mjs.map +1 -0
- package/es/utils/amount-formatter.mjs +4 -10
- package/es/utils/amount-formatter.mjs.map +1 -1
- package/es/utils/autorest.d.ts +1 -0
- package/es/utils/autorest.mjs +17 -19
- package/es/utils/autorest.mjs.map +1 -1
- package/es/utils/bignumber.mjs +4 -7
- package/es/utils/bignumber.mjs.map +1 -1
- package/es/utils/bytes.d.ts +0 -17
- package/es/utils/bytes.mjs +6 -35
- package/es/utils/bytes.mjs.map +1 -1
- package/es/utils/crypto.d.ts +15 -8
- package/es/utils/crypto.mjs +40 -40
- package/es/utils/crypto.mjs.map +1 -1
- package/es/utils/encoder-types.d.ts +28 -28
- package/es/utils/encoder-types.mjs +0 -1
- package/es/utils/encoder-types.mjs.map +1 -1
- package/es/utils/encoder.d.ts +0 -1
- package/es/utils/encoder.mjs +7 -15
- package/es/utils/encoder.mjs.map +1 -1
- package/es/utils/errors.d.ts +12 -6
- package/es/utils/errors.mjs +87 -163
- package/es/utils/errors.mjs.map +1 -1
- package/es/utils/hd-wallet.d.ts +27 -19
- package/es/utils/hd-wallet.mjs +42 -26
- package/es/utils/hd-wallet.mjs.map +1 -1
- package/es/utils/json-big.mjs +0 -8
- package/es/utils/json-big.mjs.map +1 -1
- package/es/utils/keystore.d.ts +2 -0
- package/es/utils/keystore.mjs +37 -36
- package/es/utils/keystore.mjs.map +1 -1
- package/es/utils/mptree.d.ts +1 -1
- package/es/utils/mptree.mjs +4 -26
- package/es/utils/mptree.mjs.map +1 -1
- package/es/utils/other.d.ts +3 -1
- package/es/utils/other.mjs +11 -7
- package/es/utils/other.mjs.map +1 -1
- package/es/utils/semver-satisfies.mjs +0 -3
- package/es/utils/semver-satisfies.mjs.map +1 -1
- package/es/utils/string.d.ts +0 -12
- package/es/utils/string.mjs +1 -21
- package/es/utils/string.mjs.map +1 -1
- package/package.json +87 -48
- package/src/AeSdk.ts +15 -11
- package/src/AeSdkAepp.ts +9 -7
- package/src/AeSdkBase.ts +28 -202
- package/src/AeSdkMethods.ts +170 -0
- package/src/AeSdkWallet.ts +16 -47
- package/src/Node.ts +11 -15
- package/src/account/Base.ts +29 -75
- package/src/account/Generalized.ts +98 -0
- package/src/account/Ledger.ts +131 -0
- package/src/account/LedgerFactory.ts +86 -0
- package/src/account/Memory.ts +46 -60
- package/src/account/Rpc.ts +17 -26
- package/src/aens.ts +10 -9
- package/src/aepp-wallet-communication/connection/BrowserRuntime.ts +5 -4
- package/src/aepp-wallet-communication/connection/BrowserWindowMessage.ts +3 -3
- package/src/aepp-wallet-communication/rpc/RpcClient.ts +2 -2
- package/src/aepp-wallet-communication/rpc/types.ts +11 -1
- package/src/aepp-wallet-communication/schema.ts +18 -18
- package/src/apis/compiler/code-model-v4.yaml +681 -888
- package/src/apis/compiler/compiler.ts +113 -154
- package/src/apis/compiler/models/index.ts +80 -140
- package/src/apis/compiler/models/mappers.ts +165 -183
- package/src/apis/compiler/models/parameters.ts +6 -12
- package/src/chain.ts +6 -3
- package/src/channel/Base.ts +327 -0
- package/src/channel/Contract.ts +487 -0
- package/src/channel/Spend.ts +403 -0
- package/src/channel/handlers.ts +154 -573
- package/src/channel/internal.ts +113 -142
- package/src/contract/{Compiler.ts → CompilerHttp.ts} +5 -5
- package/src/contract/Contract.ts +620 -0
- package/src/contract/ga.ts +18 -104
- package/src/index.ts +9 -8
- package/src/oracle.ts +7 -7
- package/src/spend.ts +5 -13
- package/src/tx/builder/constants.ts +1 -0
- package/src/tx/builder/field-types/address.ts +52 -0
- package/src/tx/builder/field-types/addresses.ts +18 -0
- package/src/tx/builder/field-types/coin-amount.ts +2 -8
- package/src/tx/builder/field-types/enumeration.ts +21 -0
- package/src/tx/builder/field-types/fee.ts +1 -3
- package/src/tx/builder/field-types/gas-limit.ts +2 -2
- package/src/tx/builder/field-types/gas-price.ts +0 -2
- package/src/tx/builder/field-types/index.ts +16 -6
- package/src/tx/builder/field-types/name-fee.ts +1 -1
- package/src/tx/builder/field-types/name-id.ts +7 -10
- package/src/tx/builder/field-types/pointers.ts +41 -0
- package/src/tx/builder/field-types/u-int.ts +3 -2
- package/src/tx/builder/helpers.ts +10 -60
- package/src/tx/builder/index.ts +6 -65
- package/src/tx/builder/schema.ts +89 -100
- package/src/tx/index.ts +19 -15
- package/src/tx/validator.ts +36 -18
- package/src/typings/@aeternity__aepp-calldata/index.d.ts +20 -0
- package/src/utils/autorest.ts +16 -1
- package/src/utils/bytes.ts +5 -33
- package/src/utils/crypto.ts +23 -16
- package/src/utils/encoder.ts +0 -1
- package/src/utils/errors.ts +18 -12
- package/src/utils/hd-wallet.ts +30 -9
- package/src/utils/keystore.ts +24 -21
- package/src/utils/other.ts +16 -1
- package/src/utils/string.ts +0 -20
- package/types-legacy/ts4.2/AeSdk.d.ts +41 -0
- package/types-legacy/ts4.2/AeSdkAepp.d.ts +71 -0
- package/types-legacy/ts4.2/AeSdkBase.d.ts +91 -0
- package/types-legacy/ts4.2/AeSdkMethods.d.ts +141 -0
- package/types-legacy/ts4.2/AeSdkWallet.d.ts +90 -0
- package/types-legacy/ts4.2/Node.d.ts +78 -0
- package/types-legacy/ts4.2/account/Base.d.ts +52 -0
- package/types-legacy/ts4.2/account/Generalized.d.ts +16 -0
- package/types-legacy/ts4.2/account/Ledger.d.ts +28 -0
- package/types-legacy/ts4.2/account/LedgerFactory.d.ts +39 -0
- package/types-legacy/ts4.2/account/Memory.d.ts +22 -0
- package/types-legacy/ts4.2/account/Rpc.d.ts +25 -0
- package/types-legacy/ts4.2/aens.d.ts +222 -0
- package/types-legacy/ts4.2/aepp-wallet-communication/connection/Browser.d.ts +33 -0
- package/types-legacy/ts4.2/aepp-wallet-communication/connection/BrowserRuntime.d.ts +18 -0
- package/types-legacy/ts4.2/aepp-wallet-communication/connection/BrowserWindowMessage.d.ts +36 -0
- package/types-legacy/ts4.2/aepp-wallet-communication/connection-proxy.d.ts +11 -0
- package/types-legacy/ts4.2/aepp-wallet-communication/rpc/RpcClient.d.ts +34 -0
- package/types-legacy/ts4.2/aepp-wallet-communication/rpc/types.d.ts +83 -0
- package/types-legacy/ts4.2/aepp-wallet-communication/schema.d.ts +133 -0
- package/types-legacy/ts4.2/aepp-wallet-communication/wallet-detector.d.ts +25 -0
- package/types-legacy/ts4.2/apis/compiler/compiler.d.ts +86 -0
- package/types-legacy/ts4.2/apis/compiler/index.d.ts +2 -0
- package/types-legacy/ts4.2/apis/compiler/models/index.d.ts +195 -0
- package/types-legacy/ts4.2/apis/compiler/models/mappers.d.ts +23 -0
- package/types-legacy/ts4.2/apis/compiler/models/parameters.d.ts +12 -0
- package/types-legacy/ts4.2/apis/node/index.d.ts +2 -0
- package/types-legacy/ts4.2/apis/node/models/index.d.ts +1065 -0
- package/types-legacy/ts4.2/apis/node/models/mappers.d.ts +95 -0
- package/types-legacy/ts4.2/apis/node/models/parameters.d.ts +17 -0
- package/types-legacy/ts4.2/apis/node/node.d.ts +215 -0
- package/types-legacy/ts4.2/chain.d.ts +248 -0
- package/types-legacy/ts4.2/channel/Base.d.ts +194 -0
- package/types-legacy/ts4.2/channel/Contract.d.ts +247 -0
- package/types-legacy/ts4.2/channel/Spend.d.ts +217 -0
- package/types-legacy/ts4.2/channel/handlers.d.ts +21 -0
- package/types-legacy/ts4.2/channel/internal.d.ts +107 -0
- package/types-legacy/ts4.2/contract/CompilerHttp.d.ts +18 -0
- package/types-legacy/ts4.2/contract/Contract.d.ts +237 -0
- package/types-legacy/ts4.2/contract/ga.d.ts +43 -0
- package/types-legacy/ts4.2/globals.d.ts +16 -0
- package/types-legacy/ts4.2/index.d.ts +39 -0
- package/types-legacy/ts4.2/oracle.d.ts +161 -0
- package/types-legacy/ts4.2/spend.d.ts +62 -0
- package/types-legacy/ts4.2/tx/builder/constants.d.ts +71 -0
- package/types-legacy/ts4.2/tx/builder/field-types/address.d.ts +22 -0
- package/types-legacy/ts4.2/tx/builder/field-types/addresses.d.ts +6 -0
- package/types-legacy/ts4.2/tx/builder/field-types/coin-amount.d.ts +12 -0
- package/types-legacy/ts4.2/tx/builder/field-types/deposit.d.ts +14 -0
- package/types-legacy/ts4.2/tx/builder/field-types/enumeration.d.ts +5 -0
- package/types-legacy/ts4.2/tx/builder/field-types/fee.d.ts +17 -0
- package/types-legacy/ts4.2/tx/builder/field-types/field.d.ts +6 -0
- package/types-legacy/ts4.2/tx/builder/field-types/gas-limit.d.ts +12 -0
- package/types-legacy/ts4.2/tx/builder/field-types/gas-price.d.ts +7 -0
- package/types-legacy/ts4.2/tx/builder/field-types/index.d.ts +85 -0
- package/types-legacy/ts4.2/tx/builder/field-types/name-fee.d.ts +19 -0
- package/types-legacy/ts4.2/tx/builder/field-types/name-id.d.ts +11 -0
- package/types-legacy/ts4.2/tx/builder/field-types/name.d.ts +13 -0
- package/types-legacy/ts4.2/tx/builder/field-types/pointers.d.ts +26 -0
- package/types-legacy/ts4.2/tx/builder/field-types/short-u-int.d.ts +6 -0
- package/types-legacy/ts4.2/tx/builder/field-types/u-int.d.ts +8 -0
- package/types-legacy/ts4.2/tx/builder/helpers.d.ts +112 -0
- package/types-legacy/ts4.2/tx/builder/index.d.ts +68 -0
- package/types-legacy/ts4.2/tx/builder/schema.d.ts +2963 -0
- package/types-legacy/ts4.2/tx/index.d.ts +34 -0
- package/types-legacy/ts4.2/tx/validator.d.ts +20 -0
- package/types-legacy/ts4.2/utils/amount-formatter.d.ts +42 -0
- package/types-legacy/ts4.2/utils/autorest.d.ts +7 -0
- package/types-legacy/ts4.2/utils/bignumber.d.ts +13 -0
- package/types-legacy/ts4.2/utils/bytes.d.ts +9 -0
- package/types-legacy/ts4.2/utils/crypto.d.ts +95 -0
- package/types-legacy/ts4.2/utils/encoder-types.d.ts +61 -0
- package/types-legacy/ts4.2/utils/encoder.d.ts +24 -0
- package/types-legacy/ts4.2/utils/errors.d.ts +480 -0
- package/types-legacy/ts4.2/utils/hd-wallet.d.ts +65 -0
- package/types-legacy/ts4.2/utils/json-big.d.ts +5 -0
- package/types-legacy/ts4.2/utils/keystore.d.ts +53 -0
- package/types-legacy/ts4.2/utils/mptree.d.ts +32 -0
- package/types-legacy/ts4.2/utils/other.d.ts +31 -0
- package/types-legacy/ts4.2/utils/semver-satisfies.d.ts +1 -0
- package/types-legacy/ts4.2/utils/string.d.ts +12 -0
- package/types-legacy/ts4.5/AeSdk.d.ts +41 -0
- package/types-legacy/ts4.5/AeSdkAepp.d.ts +71 -0
- package/types-legacy/ts4.5/AeSdkBase.d.ts +91 -0
- package/types-legacy/ts4.5/AeSdkMethods.d.ts +141 -0
- package/types-legacy/ts4.5/AeSdkWallet.d.ts +90 -0
- package/types-legacy/ts4.5/Node.d.ts +78 -0
- package/types-legacy/ts4.5/account/Base.d.ts +52 -0
- package/types-legacy/ts4.5/account/Generalized.d.ts +16 -0
- package/types-legacy/ts4.5/account/Ledger.d.ts +28 -0
- package/types-legacy/ts4.5/account/LedgerFactory.d.ts +39 -0
- package/types-legacy/ts4.5/account/Memory.d.ts +22 -0
- package/types-legacy/ts4.5/account/Rpc.d.ts +25 -0
- package/types-legacy/ts4.5/aens.d.ts +222 -0
- package/types-legacy/ts4.5/aepp-wallet-communication/connection/Browser.d.ts +33 -0
- package/types-legacy/ts4.5/aepp-wallet-communication/connection/BrowserRuntime.d.ts +18 -0
- package/types-legacy/ts4.5/aepp-wallet-communication/connection/BrowserWindowMessage.d.ts +36 -0
- package/types-legacy/ts4.5/aepp-wallet-communication/connection-proxy.d.ts +11 -0
- package/types-legacy/ts4.5/aepp-wallet-communication/rpc/RpcClient.d.ts +34 -0
- package/types-legacy/ts4.5/aepp-wallet-communication/rpc/types.d.ts +83 -0
- package/types-legacy/ts4.5/aepp-wallet-communication/schema.d.ts +133 -0
- package/types-legacy/ts4.5/aepp-wallet-communication/wallet-detector.d.ts +25 -0
- package/types-legacy/ts4.5/apis/compiler/compiler.d.ts +86 -0
- package/types-legacy/ts4.5/apis/compiler/index.d.ts +2 -0
- package/types-legacy/ts4.5/apis/compiler/models/index.d.ts +195 -0
- package/types-legacy/ts4.5/apis/compiler/models/mappers.d.ts +23 -0
- package/types-legacy/ts4.5/apis/compiler/models/parameters.d.ts +12 -0
- package/types-legacy/ts4.5/apis/node/index.d.ts +2 -0
- package/types-legacy/ts4.5/apis/node/models/index.d.ts +1065 -0
- package/types-legacy/ts4.5/apis/node/models/mappers.d.ts +95 -0
- package/types-legacy/ts4.5/apis/node/models/parameters.d.ts +17 -0
- package/types-legacy/ts4.5/apis/node/node.d.ts +215 -0
- package/types-legacy/ts4.5/chain.d.ts +248 -0
- package/types-legacy/ts4.5/channel/Base.d.ts +194 -0
- package/types-legacy/ts4.5/channel/Contract.d.ts +247 -0
- package/types-legacy/ts4.5/channel/Spend.d.ts +217 -0
- package/types-legacy/ts4.5/channel/handlers.d.ts +21 -0
- package/types-legacy/ts4.5/channel/internal.d.ts +107 -0
- package/types-legacy/ts4.5/contract/CompilerHttp.d.ts +18 -0
- package/types-legacy/ts4.5/contract/Contract.d.ts +237 -0
- package/types-legacy/ts4.5/contract/ga.d.ts +43 -0
- package/types-legacy/ts4.5/index.d.ts +38 -0
- package/types-legacy/ts4.5/oracle.d.ts +161 -0
- package/types-legacy/ts4.5/spend.d.ts +62 -0
- package/types-legacy/ts4.5/tx/builder/constants.d.ts +71 -0
- package/types-legacy/ts4.5/tx/builder/field-types/address.d.ts +22 -0
- package/types-legacy/ts4.5/tx/builder/field-types/addresses.d.ts +6 -0
- package/types-legacy/ts4.5/tx/builder/field-types/coin-amount.d.ts +12 -0
- package/types-legacy/ts4.5/tx/builder/field-types/deposit.d.ts +14 -0
- package/types-legacy/ts4.5/tx/builder/field-types/enumeration.d.ts +5 -0
- package/types-legacy/ts4.5/tx/builder/field-types/fee.d.ts +17 -0
- package/types-legacy/ts4.5/tx/builder/field-types/field.d.ts +6 -0
- package/types-legacy/ts4.5/tx/builder/field-types/gas-limit.d.ts +12 -0
- package/types-legacy/ts4.5/tx/builder/field-types/gas-price.d.ts +7 -0
- package/types-legacy/ts4.5/tx/builder/field-types/index.d.ts +85 -0
- package/types-legacy/ts4.5/tx/builder/field-types/name-fee.d.ts +19 -0
- package/types-legacy/ts4.5/tx/builder/field-types/name-id.d.ts +11 -0
- package/types-legacy/ts4.5/tx/builder/field-types/name.d.ts +13 -0
- package/types-legacy/ts4.5/tx/builder/field-types/pointers.d.ts +26 -0
- package/types-legacy/ts4.5/tx/builder/field-types/short-u-int.d.ts +6 -0
- package/types-legacy/ts4.5/tx/builder/field-types/u-int.d.ts +8 -0
- package/types-legacy/ts4.5/tx/builder/helpers.d.ts +112 -0
- package/types-legacy/ts4.5/tx/builder/index.d.ts +68 -0
- package/types-legacy/ts4.5/tx/builder/schema.d.ts +2963 -0
- package/types-legacy/ts4.5/tx/index.d.ts +34 -0
- package/types-legacy/ts4.5/tx/validator.d.ts +20 -0
- package/types-legacy/ts4.5/utils/amount-formatter.d.ts +42 -0
- package/types-legacy/ts4.5/utils/autorest.d.ts +7 -0
- package/types-legacy/ts4.5/utils/bignumber.d.ts +13 -0
- package/types-legacy/ts4.5/utils/bytes.d.ts +9 -0
- package/types-legacy/ts4.5/utils/crypto.d.ts +95 -0
- package/types-legacy/ts4.5/utils/encoder-types.d.ts +61 -0
- package/types-legacy/ts4.5/utils/encoder.d.ts +24 -0
- package/types-legacy/ts4.5/utils/errors.d.ts +480 -0
- package/types-legacy/ts4.5/utils/hd-wallet.d.ts +65 -0
- package/types-legacy/ts4.5/utils/json-big.d.ts +5 -0
- package/types-legacy/ts4.5/utils/keystore.d.ts +53 -0
- package/types-legacy/ts4.5/utils/mptree.d.ts +32 -0
- package/types-legacy/ts4.5/utils/other.d.ts +31 -0
- package/types-legacy/ts4.5/utils/semver-satisfies.d.ts +1 -0
- package/types-legacy/ts4.5/utils/string.d.ts +12 -0
- package/es/channel/index.d.ts +0 -625
- package/es/channel/index.mjs +0 -975
- package/es/channel/index.mjs.map +0 -1
- package/es/contract/Compiler.mjs.map +0 -1
- package/es/contract/aci.d.ts +0 -127
- package/es/contract/aci.mjs +0 -509
- package/es/contract/aci.mjs.map +0 -1
- package/es/contract/methods.d.ts +0 -71
- package/es/contract/methods.mjs +0 -104
- package/es/contract/methods.mjs.map +0 -1
- package/es/deprecated/index.d.ts +0 -143
- package/es/deprecated/index.mjs +0 -162
- package/es/deprecated/index.mjs.map +0 -1
- package/es/deprecated/methods.d.ts +0 -18
- package/es/deprecated/methods.mjs +0 -26
- package/es/deprecated/methods.mjs.map +0 -1
- package/es/tx/builder/address.d.ts +0 -25
- package/es/tx/builder/address.mjs +0 -45
- package/es/tx/builder/address.mjs.map +0 -1
- package/es/typings/@aeternity__argon2-browser/index.d.mjs.map +0 -1
- package/src/channel/index.ts +0 -1025
- package/src/contract/aci.ts +0 -538
- package/src/contract/methods.ts +0 -123
- package/src/deprecated/index.ts +0 -172
- package/src/deprecated/methods.ts +0 -25
- package/src/tx/builder/address.ts +0 -50
- package/src/typings/@aeternity__argon2-browser/index.d.ts +0 -3
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! For license information please see aepp-sdk.browser-script.js.LICENSE.txt */
|
|
2
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Ae=t():e.Ae=t()}(self,(function(){return function(){var e={2337:function(e,t,r){"use strict";var n=r(9509).Buffer;e.exports=function(e){if(e.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),r=0;r<t.length;r++)t[r]=255;for(var i=0;i<e.length;i++){var a=e.charAt(i),o=a.charCodeAt(0);if(255!==t[o])throw new TypeError(a+" is ambiguous");t[o]=i}var s=e.length,c=e.charAt(0),A=Math.log(s)/Math.log(256),u=Math.log(256)/Math.log(s);function l(e){if("string"!=typeof e)throw new TypeError("Expected String");if(0===e.length)return n.alloc(0);for(var r=0,i=0,a=0;e[r]===c;)i++,r++;for(var o=(e.length-r)*A+1>>>0,u=new Uint8Array(o);e[r];){var l=t[e.charCodeAt(r)];if(255===l)return;for(var d=0,p=o-1;(0!==l||d<a)&&-1!==p;p--,d++)l+=s*u[p]>>>0,u[p]=l%256>>>0,l=l/256>>>0;if(0!==l)throw new Error("Non-zero carry");a=d,r++}for(var h=o-a;h!==o&&0===u[h];)h++;var f=n.allocUnsafe(i+(o-h));f.fill(0,0,i);for(var g=i;h!==o;)f[g++]=u[h++];return f}return{encode:function(t){if((Array.isArray(t)||t instanceof Uint8Array)&&(t=n.from(t)),!n.isBuffer(t))throw new TypeError("Expected Buffer");if(0===t.length)return"";for(var r=0,i=0,a=0,o=t.length;a!==o&&0===t[a];)a++,r++;for(var A=(o-a)*u+1>>>0,l=new Uint8Array(A);a!==o;){for(var d=t[a],p=0,h=A-1;(0!==d||p<i)&&-1!==h;h--,p++)d+=256*l[h]>>>0,l[h]=d%s>>>0,d=d/s>>>0;if(0!==d)throw new Error("Non-zero carry");i=p,a++}for(var f=A-i;f!==A&&0===l[f];)f++;for(var g=c.repeat(r);f<A;++f)g+=e.charAt(l[f]);return g},decodeUnsafe:l,decode:function(e){var t=l(e);if(t)return t;throw new Error("Non-base"+s+" character")}}}},5260:function(e,t,r){var n=r(2337);e.exports=n("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},8449:function(e,t,r){const n=r(7945),i=r(6878),{symbolIdentifier:a}=r(2665);e.exports=(e,t,r)=>{const o=a(e),s=new n(o),c=new i(t,r);return new i([s.type,c.type],[s,c])}},6040:function(e){e.exports=class{constructor(e){this._valueFactory=e}get valueFactory(){return this._valueFactory}supports({_name:e,_valueTypes:t}){return!1}create(e,t){throw new Error("Not implemented.")}}},6097:function(e,t,r){const n=r(1565),i=r(4077),a=r(6040),o=["bls12_381.fr","bls12_381.fp"];e.exports=class extends a{supports({name:e,_valueTypes:t}){return o.includes(e)}create(e,t){switch(e.name){case"bls12_381.fr":return new n(t);case"bls12_381.fp":return new i(t);default:throw new Error(`Unsupported type "${e.name}"`)}}}},2320:function(e,t,r){const n=r(4664),i=r(5675),a=r(1168),o=r(9205),s=r(4960),c=r(3353),A=r(786),u=r(7211),l=r(4093),d=r(2954),p=r(6097);e.exports=class{constructor(){const e=new l(this);this._factories=[new a(this),new o(this),new s(this),new c(this),new A(this),new u(this),new d(this,e),e,new p(this)]}createMultiple(e,t){return n(t.length===e.length,`Number of types (${e.length}) and values (${t.length}) should match`),i(e,t).map((e=>this.create(...e)))}create(e,t){const r=this._factories.find((t=>t.supports(e)));return n(r,`Unsupported type: ${JSON.stringify(e)}`),r.create(e,t)}}},2954:function(e,t,r){const{hash:n}=r(2665),{ByteArray2Int:i}=r(240),a=r(6966),o=r(6040),s=["string","signature","bytes"];e.exports=class extends o{constructor(e,t){super(e),this._variantFactory=t}supports({name:e,_valueTypes:t}){return"event"===e}create({variantType:e},{data:t,topics:r}){const[o,...s]=r;if("bigint"!=typeof o)throw new a(`Event name hash (first topic) should be of type "BigInt", got "${typeof o}" instead.`);const c=e.variants.map((e=>i(n(Object.keys(e)[0])))).findIndex((e=>e===o));if(-1===c)throw new a("Event name hash does not match any event variant constructor");const A=e.variants[c],u=Object.keys(A)[0],[l]=Object.values(A),d=l.map((e=>this._isData(e)?t:s.shift()));return this._variantFactory.create(e,{[u]:d})}_isData(e){return!(!s.includes(e.name)||"bytes"===e.name&&e.size<=32)}}},9205:function(e,t,r){const n=r(1041),i=r(5110),a=r(6040);e.exports=class extends a{supports({name:e,_valueTypes:t}){return"list"===e}create(e,t){if(!Array.isArray(t))throw new i(e.name,`Fate list must be an Array, got ${t} instead`);const r=t.map((t=>this.valueFactory.create(e.valuesType,t)));return new n(e.valuesType,r)}}},3353:function(e,t,r){const n=r(8804),i=r(6040);e.exports=class extends i{supports({name:e,_valueTypes:t}){return"map"===e}create(e,t){const r=[];for(const n of t)r.push([this.valueFactory.create(e.keyType,n[0]),this.valueFactory.create(e.valueType,n[1])]);return new n(e.keyType,e.valueType,r)}}},1168:function(e,t,r){const n=r(3509),i=r(4476),a=r(6313),o=r(871),s=r(3607),c=r(5779),A=r(3422),u=r(539),l=r(8623),d=r(6445),p=r(687),h=r(5070),f=r(6040),g=["int","bool","string","bits","hash","bytes","signature","account_address","contract_address","channel_address","oracle_address","oracle_query_address"];e.exports=class extends f{supports({name:e,_valueTypes:t}){return g.includes(e)}create(e,t){switch(e.name){case"int":return new n(t);case"bool":return new i(t);case"string":return new a(t);case"bits":return new A(t);case"hash":return new o(t);case"bytes":return new c(t,e.valueTypes);case"signature":return new s(t);case"account_address":return new u(t);case"contract_address":return new l(t);case"channel_address":return new d(t);case"oracle_address":return new p(t);case"oracle_query_address":return new h(t);default:throw new Error(`Unsupported type "${e.name}"`)}}}},7211:function(e,t,r){const n=r(6040),i=r(6878),{FateTypeRecord:a}=r(4265),o=r(5110);e.exports=class extends n{supports({name:e,_valueTypes:t}){return"record"===e}create(e,t){if("object"!=typeof t)throw new o(e.name,`Fate record must be an Object, got ${t} instead`);const r=Object.keys(t).length;if(r!==e.keys.length)throw new o(e.name,`Number of expected keys (${e.keys.length}) and actual keys (${r}) should match`);const n=e.valueTypes.map(((r,n)=>{const i=e.keys[n];return this.valueFactory.create(r,t[i])}));return 1===n.length?n[0]:new i(a(e.keys,e.valueTypes),n)}}},4960:function(e,t,r){const n=r(2548),i=r(6040);e.exports=class extends i{supports({name:e,_valueTypes:t}){return"set"===e}create(e,t){const r=[];for(const n of t)r.push(this.valueFactory.create(e.valuesType,n));return new n(e.valuesType,r)}}},786:function(e,t,r){const n=r(6878),i=r(5110),a=r(6040);e.exports=class extends a{supports({name:e,_valueTypes:t}){return"tuple"===e}create(e,t){if(!Array.isArray(t))throw new i(e.name,`Fate tuple must be an Array, got ${t} instead`);const r=e.valueTypes.map(((e,r)=>this.valueFactory.create(e,t[r])));return 1===r.length?r[0]:new n(e.valueTypes,r)}}},4093:function(e,t,r){const n=r(2457),i=r(5110),a=r(6040),o=["variant","Chain.ttl","AENS.pointee","AENS.name"];e.exports=class extends a{supports({name:e,_valueTypes:t}){return o.includes(e)}create(e,t){if(!this.isValid(t))throw new i(e.name,`Variant should be an object mapping constructor to array of values, got "${t}" instead`);const[r,a]=Object.entries(t)[0],o=e.variants.map((e=>{const[[,t]]=Object.entries(e);return t.length})),s=e.variants.findIndex((e=>{const[[t,n]]=Object.entries(e);return t===r}));if(-1===s)throw new i(e.name,`Unknown variant constructor: ${r}`);const[[,c]]=Object.entries(e.variants[s]);if(a.length!==c.length)throw new i(e.name,`"${r}" variant constructor expects ${c.length} argument(s) but got ${a.length} instead`);const A=this.valueFactory.createMultiple(c,a);return new n(o,s,A,c,e.variants)}isValid(e){return"object"==typeof e&&null!==e&&1===Object.entries(e).length&&Array.isArray(Object.values(e)[0])}}},2968:function(e,t,r){const n=r(8638),i=r(7829),a=r(2540),o=r(2320),s=r(3451),c=r(880),A=r(1338),u=r(8449),{FateTypeString:l}=r(4265),d=r(7960),p=r(722);e.exports=class{constructor(e){this._aci=e,this._serializer=new i,this._dataFactory=new o,this._externalDataFactory=new s(new A),this._typeResolver=new a(e),this._internalMapper=new A,this._canonicalMapper=new c}encode(e,t,r){const{types:i,required:a}=this._typeResolver.getCallTypes(e,t);if(r.length>i.length||r.length<a)throw new d(`Non matching number of arguments. ${t} expects between ${a} and ${i.length} number of arguments but got ${r.length}`);for(;r.length<i.length;)r.push(void 0);const o=this._externalDataFactory.createMultiple(i,r),s=u(t,i,o),c=this._serializer.serialize(s),A=new Uint8Array(c.flat(1/0));return"cb_"+n.encode(A)}decode(e,t,r){const n=this._typeResolver.getReturnType(e,t),i=this.decodeString(r);return this._serializer.deserialize(n,i).accept(this._canonicalMapper)}decodeString(e){if(!e.startsWith("cb_"))throw new p("Invalid data format (missing cb_ prefix)");return n.decode(e.substring(3))}decodeFateString(e){const t=this.decodeString(e);return this._serializer.deserialize(l(),t).accept(this._canonicalMapper)}decodeEvent(e,t,r){const n=this.decodeString(t),i=this._typeResolver.getEventType(e),a={topics:r,data:n};return this._dataFactory.create(i,a).accept(this._canonicalMapper)}}},7960:function(e){class t extends Error{constructor(e){super(e),this.name="EncoderError"}}e.exports=t},5462:function(e){class t extends Error{constructor(e){super("Invalid FATE prefix: 0b"+e.toString(2).padStart(8,"0")),this.name="FatePrefixError",this.prefix=e}}e.exports=t},5110:function(e){class t extends Error{constructor(e,t){super(t),this.name="FateTypeError",this.type=e}}e.exports=t},722:function(e){class t extends Error{constructor(e){super(e),this.name="FormatError"}}e.exports=t},2966:function(e){class t extends Error{constructor(e){super(e),this.name="InternalError"}}e.exports=t},9098:function(e){class t extends Error{constructor(e){super(e),this.name="SerializerError"}}e.exports=t},6966:function(e){class t extends Error{constructor(e){super(e),this.name="TypeResolveError"}}e.exports=t},3451:function(e,t,r){const n=r(2320);e.exports=class extends n{constructor(e){super(),this._mapper=e}create(e,t){const r=this._mapper.toInternal(e,t);return super.create(e,r)}}},2689:function(e,t,r){const n=r(4664),i=r(1041),a=r(6878),{FateTypeTuple:o,FateTypeInt:s}=r(4265),c=(e,t)=>{if(0===e.length)return-1;if(0===t.length)return 1;const r=p(e.itemsType);for(let n=0;n<e.length;n++){if(void 0===t.items[n])return 1;const i=r(e.items[n],t.items[n]);if(0!==i)return i}return e.length===t.length?0:-1},A=e=>{const t=p(e);return(e,r)=>t(e.key,r.key)},u=(e,t)=>{const r=new i(s(),e.valueOf()),n=new i(s(),t.valueOf());return c(r,n)},l=(e,t)=>Number(BigInt(e)-BigInt(t)),d={int:l,bool:(e,t)=>e-t,string:(e,t)=>e.toString().localeCompare(t.toString()),bits:(e,t)=>e<0||t<0?-l(e,t):l(e,t),list:c,tuple:(e,t)=>{if(0===e.size)return-1;const r=e.size-t.size;if(0!==r)return r;for(let r=0;r<e.size;r++){const n=e.valueTypes[r],i=p(n)(e.items[r],t.items[r]);if(0!==i)return i}return 0},variant:(e,t)=>{const r=e.arities.length-t.arities.length;if(0!==r)return r;const n=new i(e.aritiesType,e.arities),s=new i(t.aritiesType,t.arities),c=p(n)(n,s);if(0!==c)return c;const A=e.tag-t.tag;return 0!==A?A:p(o())(new a(e.valueTypes,e.value),new a(t.valueTypes,t.value))},map:(e,t)=>{const r=[...e.items],n=[...t.items];r.sort(A(e.keyType)),n.sort(A(t.keyType));const i=p(e.keyType),a=p(e.valueType);for(let e=0;e<r.length;e++){if(void 0===n[e])return 1;const t=r[e],o=n[e],s=i(t.key,o.key);if(0!==s)return s;const c=a(t.value,o.value);if(0!==c)return c}return r.length===n.length?0:-1},bytes:u,account_address:u,channel_address:u,contract_address:u,oracle_query_address:u,oracle_address:u},p=e=>(n(e.hasOwnProperty("name"),`Cannot determine type name of ${JSON.stringify(e)}`),n(d.hasOwnProperty(e.name),`Unsupported comparator for ${e.name}`),d[e.name]);e.exports=p},105:function(e){e.exports=Object.freeze({SMALL_INT:0,LONG_STRING:1,SHORT_STRING:1,SHORT_LIST:3,LONG_TUPLE:11,SHORT_TUPLE:11,LONG_LIST:31,MAP:47,EMPTY_TUPLE:63,POS_BITS:79,EMPTY_STRING:95,POS_BIG_INT:111,FALSE:127,OBJECT:159,VARIANT:175,MAP_ID:191,NEG_BITS:207,EMPTY_MAP:223,NEG_BIG_INT:239,TRUE:255,OTYPE_ADDRESS:0,OTYPE_BYTES:1,OTYPE_CONTRACT:2,OTYPE_ORACLE:3,OTYPE_ORACLE_QUERY:4,OTYPE_CHANNEL:5})},4265:function(e){const t=(e=[])=>({name:"tuple",valueTypes:e}),r=(e,t)=>({name:"map",keyType:e,valueType:t}),n=(e,r,n)=>({name:"variant",aritiesType:{name:"int"},arities:e,variantType:t(r),variants:n}),i=()=>n(0,null,[{RelativeTTL:[{name:"int"}]},{FixedTTL:[{name:"int"}]}]),a=()=>n(0,null,[{"AENS.AccountPt":[{name:"account_address"}]},{"AENS.OraclePt":[{name:"account_address"}]},{"AENS.ContractPt":[{name:"account_address"}]},{"AENS.ChannelPt":[{name:"account_address"}]}]);e.exports={FateTypeVoid:()=>({name:"void"}),FateTypeInt:()=>({name:"int"}),FateTypeBool:()=>({name:"bool"}),FateTypeString:()=>({name:"string"}),FateTypeBits:()=>({name:"bits"}),FateTypeBytes:e=>({name:"bytes",size:e}),FateTypeHash:()=>({name:"hash"}),FateTypeSignature:()=>({name:"signature"}),FateTypeAccountAddress:()=>({name:"account_address"}),FateTypeContractAddress:()=>({name:"contract_address"}),FateTypeOracleAddress:(e,t)=>({name:"oracle_address",questionType:e,answerType:t}),FateTypeOracleQueryAddress:(e,t)=>({name:"oracle_query_address",questionType:e,answerType:t}),FateTypeByteArray:()=>({name:"byte_array"}),FateTypeList:e=>({name:"list",valuesType:e}),FateTypeTuple:t,FateTypeRecord:(e,t)=>({name:"record",keys:e,valueTypes:t}),FateTypeSet:e=>({name:"set",valuesType:e}),FateTypeMap:r,FateTypeVariant:n,FateTypeOption:e=>n(0,null,[{None:[]},{Some:e}]),FateTypeChainTTL:i,FateTypeChainGAMetaTx:()=>n(0,null,[{"Chain.GAMetaTx":[{name:"account_address"},{name:"int"}]}]),FateTypeChainPayingForTx:()=>n(0,null,[{"Chain.PayingForTx":[{name:"account_address"},{name:"int"}]}]),FateTypeChainBaseTx:()=>n(0,null,[{"Chain.SpendTx":[{name:"account_address"},{name:"int"},{name:"string"}]},{"Chain.OracleRegisterTx":[]},{"Chain.OracleQueryTx":[]},{"Chain.OracleResponseTx":[]},{"Chain.OracleExtendTx":[]},{"Chain.NamePreclaimTx":[]},{"Chain.NameClaimTx":[{name:"string"}]},{"Chain.NameUpdateTx":[{name:"hash"}]},{"Chain.NameRevokeTx":[{name:"hash"}]},{"Chain.NameTransferTx":[{name:"account_address"},{name:"hash"}]},{"Chain.ChannelCreateTx":[{name:"account_address"}]},{"Chain.ChannelDepositTx":[{name:"account_address"},{name:"int"}]},{"Chain.ChannelWithdrawTx":[{name:"account_address"},{name:"int"}]},{"Chain.ChannelForceProgressTx":[{name:"account_address"}]},{"Chain.ChannelCloseMutualTx":[{name:"account_address"}]},{"Chain.ChannelCloseSoloTx":[{name:"account_address"}]},{"Chain.ChannelSlashTx":[{name:"account_address"}]},{"Chain.ChannelSettleTx":[{name:"account_address"}]},{"Chain.ChannelSnapshotSoloTx":[{name:"account_address"}]},{"Chain.ContractCreateTx":[{name:"account_address"}]},{"Chain.ContractCallTx":[{name:"account_address"},{name:"int"}]},{"Chain.GAAttachTx":[]}]),FateTypeAENSPointee:a,FateTypeAENSName:()=>{const e=[{"AENS.Name":[{name:"account_address"},i(),r({name:"string"},a())]}];return n(0,null,e)},FateTypeEvent:e=>({name:"event",variantType:e}),FateTypeBls12381Fr:()=>({name:"bls12_381.fr"}),FateTypeBls12381Fp:()=>({name:"bls12_381.fp"})}},880:function(e,t,r){const n=r(2727),{MontBytes2Int:i}=r(333);e.exports=class{visitData(e){return e.valueOf()}visitAddress(e){return e.prefix+"_"+n.encode(e.value)}visitList(e){return e.items.map((e=>e.accept(this)))}visitSet(e){return new Set(e.items.map((e=>e.accept(this))))}visitMap(e){const t=new Map;for(const[r,n]of e.iterator)t.set(r.accept(this),n.accept(this));return t}visitTuple(e){return e.prepareItems((e=>e.accept(this)))}visitVariant(e){if("None"===e.variantName)return;const t=e.value.map((e=>e.accept(this)));return"Some"===e.variantName?t[0]:{[e.variantName]:t}}visitBls12381Fr(e){return i(e.valueOf(),"r")}visitBls12381Fp(e){return i(e.valueOf(),"p")}}},1338:function(e,t,r){const n=r(2727),{Int2MontBytes:i}=r(333),a=r(5110),o=r(5675),s={account_address:"ak",contract_address:"ct",channel_address:"ch",oracle_address:"ok",oracle_query_address:"oq"};e.exports=class{toInternal(e,t){switch(e.name){case"account_address":case"contract_address":case"channel_address":case"oracle_address":case"oracle_query_address":return this.toAddress(e,t);case"variant":return this.toVariant(e,t);case"map":return this.toMap(e,t);case"set":return this.toSet(e,t);case"record":return this.toRecord(e,t);case"bls12_381.fr":return this.toBls12381Fr(e,t);case"bls12_381.fp":return this.toBls12381Fp(e,t);default:return t}}toAddress({name:e,_:t},r){const i=r.toString(),o=s[e];if(!i.startsWith(o+"_"))throw new a(e,`Address should start with ${o}_, got ${i} instead`);return n.decode(i.substring(o.length+1))}toVariant(e,t){if(!this.isOptionVariant(e))return t;if([void 0,null].includes(t))return{None:[]};const[r]=Object.keys(t);return["Some","None"].includes(r)?t:{Some:[t]}}isOptionVariant({_name:e,variants:t}){return t.some((({None:e})=>e&&0===e.length))&&t.some((({Some:e})=>e))}toMap(e,t){if("object"!=typeof t||null===t)throw new a("map",`Fate map must be one of: Map, Array, Object; got ${t} instead`);return Array.isArray(t)||t instanceof Map?t:Object.entries(t)}toSet(e,t){if(t instanceof Set)return t;if(Array.isArray(t))return new Set(t);throw new a("set",`Fate set must be a Set or Array, got "${t}" instead`)}toRecord(e,t){return o(e.keys,e.valueTypes).reduce(((e,[r,n])=>({...e,[r]:this.toInternal(n,t[r])})),t)}validateBls12381Field(e,t){if("bigint"!=typeof t&&!Number.isInteger(t))throw new a(e.name,`Should be one of: BigInt or Number; got ${t} instead`)}toBls12381Fr(e,t){return this.validateBls12381Field(e,t),i(t,"r")}toBls12381Fp(e,t){return this.validateBls12381Field(e,t),i(t,"p")}}},7829:function(e,t,r){const n=r(2584),i=r(9865),a=r(8268),o=r(9135),s=r(1290),c=r(4857),A=r(8183),u=r(6651),l=r(3234),d=r(4150),p=r(2086),h=r(34),f=r(2137),g=r(6210),m=r(692),y=r(4266),I=r(1751),C=r(6973),E=r(6178),B=r(9503),w=r(5547),v=r(9098);e.exports=class extends a{constructor(){super(),this.typeFactory=new n,this._serializers={void:new h,bool:new c,int:new p,tuple:new E(this),record:new E(this),list:new f(this),set:new g(this),map:new m(this),byte_array:new A,string:new C,hash:new u,signature:new u,bits:new s,variant:new B(this),bytes:new u,account_address:new o,contract_address:new d,oracle_address:new I,oracle_query_address:new y,channel_address:new l,"bls12_381.fr":new w,"bls12_381.fp":new w}}_getSerializer(e){if(!e.hasOwnProperty("name"))throw new v("Unsupported type: "+JSON.stringify(e));const t=e.name;if(!this._serializers.hasOwnProperty(t))throw new v("Unsupported type: "+JSON.stringify(t));return this._serializers[t]}serialize(e){if("object"!=typeof e)throw new v("Only object serialization is supported. Got: "+JSON.stringify(e));if(!(e instanceof i))throw new v("Only instances of FateData is supported.");return this._getSerializer(e).serialize(e)}deserialize(e,t){if(!(t instanceof Uint8Array))throw new v("Only instances of Uint8Array is supported.");return this._getSerializer(e).deserialize(t,e)}deserializeStream(e,t){if(!(e instanceof Uint8Array))throw new v("Only instances of Uint8Array is supported.");let r=t;return void 0===t&&(r=this.typeFactory.createType(e)),this._getSerializer(r).deserializeStream(e,t)}}},9135:function(e,t,r){const n=r(6636),i=r(105),a=r(8268),o=r(539);e.exports=class extends a{serialize(e){return[i.OBJECT,i.OTYPE_ADDRESS,...n.encode(e.value)]}deserializeStream(e){const t=new Uint8Array(e),r=n.decode(t.slice(2),!0);return[new o(r.data),new Uint8Array(r.remainder)]}}},8268:function(e,t,r){const n=r(9098);e.exports=class{constructor(e){this.globalSerializer=e}serialize(e){throw new n("Not implemented.")}deserialize(e,t){const[r,n]=this.deserializeStream(e,t);return r}deserializeStream(e,t){throw new n("Not implemented.")}}},1290:function(e,t,r){const n=r(105),i=r(7138),a=r(3422),o=r(8268),s=r(9475);e.exports=class extends o{serialize(e){return[e.value>=0?n.POS_BITS:n.NEG_BITS,...i.encode(s(e.value))]}deserializeStream(e){const t=new Uint8Array(e),r=t[0]===n.POS_BITS?1n:-1n,[o,s]=i.decode(t.slice(1));return[new a(o*r),new Uint8Array(s)]}}},5547:function(e,t,r){const n=r(8268),i=r(6651),a=r(1565),o=r(4077),s=new i,c=(e,t)=>{switch(e.name){case"bls12_381.fr":return new a(t);case"bls12_381.fp":return new o(t);default:throw new Error(`Unsupported type "${e.name}"`)}};e.exports=class extends n{serialize(e){return s.serialize(e)}deserializeStream(e,t){const[r,n]=s.deserializeStream(e);return[c(t,r.valueOf()),n]}}},4857:function(e,t,r){const n=r(105),i=r(4476),a=r(8268),o=r(5462);e.exports=class extends a{serialize(e){return!0===e.valueOf()?[n.TRUE]:[n.FALSE]}deserializeStream(e){const t=new Uint8Array(e),r=t[0],a=t.slice(1);if(r===n.TRUE)return[new i(!0),a];if(r===n.FALSE)return[new i(!1),a];throw new o(r)}}},8183:function(e,t,r){const n=r(105),i=r(8268),a=r(7945),o=new(r(2086));e.exports=class extends i{serialize(e){return 0===e.length?[n.EMPTY_STRING]:e.length<64?[e.length<<2|n.SHORT_STRING,...e.valueOf()]:[n.LONG_STRING,...o.serialize(e.length-64),...e.valueOf()]}deserializeStream(e){const t=new Uint8Array(e),r=t[0];if(r===n.EMPTY_STRING)return[new a,t.slice(1)];if(r===n.LONG_STRING){const[e,r]=o.deserializeStream(t.slice(1)),n=Number(e.valueOf())+64;return[new a(r.slice(0,n)),r.slice(n)]}const i=1+(r>>2);return[new a(t.slice(1,i)),t.slice(i)]}}},6651:function(e,t,r){const n=r(105),i=r(8183),a=r(5779),o=r(8268),s=new i;e.exports=class extends o{serialize(e){return[n.OBJECT,n.OTYPE_BYTES,...s.serialize(e.value)]}deserializeStream(e){const t=new Uint8Array(e),[r,n]=s.deserializeStream(t.slice(2));return[new a(r.valueOf()),n]}}},3234:function(e,t,r){const n=r(6636),i=r(105),a=r(8268),o=r(6445);e.exports=class extends a{serialize(e){return[i.OBJECT,i.OTYPE_CHANNEL,...n.encode(e.value)]}deserializeStream(e){const t=new Uint8Array(e),r=n.decode(t.slice(2),!0);return[new o(r.data),new Uint8Array(r.remainder)]}}},4150:function(e,t,r){const n=r(6636),i=r(105),a=r(8268),o=r(8623);e.exports=class extends a{serialize(e){return[i.OBJECT,i.OTYPE_CONTRACT,...n.encode(e.value)]}deserializeStream(e){const t=new Uint8Array(e),r=n.decode(t.slice(2),!0);return[new o(r.data),new Uint8Array(r.remainder)]}}},2086:function(e,t,r){const n=r(105),i=r(7138),a=r(3509),o=r(8268),s=r(5462),c=r(9475);e.exports=class extends o{serialize(e){const t=e instanceof a?e.value:BigInt(e),r=c(t);if(r<64){const e=Number(r);return t>=0?[e<<1]:[254&(128|e<<1)]}return t<0?[n.NEG_BIG_INT,...i.encode(r-64n)]:[n.POS_BIG_INT,...i.encode(r-64n)]}deserializeStream(e){const t=new Uint8Array(e),r=t[0];if(0==(1&r))return 0==(128&r)?[new a(r>>1),t.slice(1)]:[new a(-((126&r)>>1)),t.slice(1)];if(r===n.POS_BIG_INT||r===n.NEG_BIG_INT){const e=r===n.POS_BIG_INT?1n:-1n,[o,s]=i.decode(t.slice(1));return[new a((o+64n)*e),new Uint8Array(s)]}throw new s(r)}}},2137:function(e,t,r){const n=r(7138),i=r(105),a=r(1041),o=r(8268);e.exports=class extends o{serialize(e){const t=e.items.map((e=>this.globalSerializer.serialize(e))).flat(1/0),r=e.items.length;return r<16?[r<<4|i.SHORT_LIST,...t]:[i.LONG_LIST,...n.encode(r-16),...t]}deserializeStream(e,t){const r=new Uint8Array(e),o=r[0];let s,c,A=0n,u=r.slice(1);o===i.LONG_LIST&&([A,u]=n.decode(r.slice(1)),A+=16n),(15&o)===i.SHORT_LIST&&(A=BigInt((240&o)>>4)),void 0!==t&&(s=t.valuesType);const l=[];for(let e=0n;e<A;e++)[c,u]=this.globalSerializer.deserializeStream(u,s),l.push(c);return 0n===A?[new a(null),u]:(void 0===t&&(s=l[0].type),[new a(s,l),u])}}},692:function(e,t,r){const n=r(105),i=r(7138),a=r(8268),o=r(2689),s=r(8804),c=r(5462);e.exports=class extends a{serialize(e){const t=e.length,r=o(e.keyType),a=[...e.items];a.sort(((e,t)=>r(e.key,t.key)));const s=a.map((e=>[this.globalSerializer.serialize(e.key),this.globalSerializer.serialize(e.value)]));return[n.MAP,...i.encode(t),...s.flat(1/0)]}deserializeStream(e,t){const r=new Uint8Array(e),a=r[0];if(a!==n.MAP)throw new c(a);const[o,A]=i.decode(r.slice(1));let u,l,d=A;if(0n===o)return[new s,d];void 0!==t&&({keyType:u,valueType:l}=t);const p=[];for(let e=0n;e<o;e++){const[e,t]=this.globalSerializer.deserializeStream(d,u),[r,n]=this.globalSerializer.deserializeStream(t,l);p.push([e,r]),d=n}const h=p[0];return void 0===t&&(u=h[0].type,l=h[1].type),[new s(u,l,p),d]}}},4266:function(e,t,r){const n=r(6636),i=r(105),a=r(8268),o=r(5070);e.exports=class extends a{serialize(e){return[i.OBJECT,i.OTYPE_ORACLE_QUERY,...n.encode(e.value)]}deserializeStream(e){const t=new Uint8Array(e),r=n.decode(t.slice(2),!0);return[new o(r.data),new Uint8Array(r.remainder)]}}},1751:function(e,t,r){const n=r(6636),i=r(105),a=r(8268),o=r(687);e.exports=class extends a{serialize(e){return[i.OBJECT,i.OTYPE_ORACLE,...n.encode(e.value)]}deserializeStream(e){const t=new Uint8Array(e),r=n.decode(t.slice(2),!0);return[new o(r.data),new Uint8Array(r.remainder)]}}},6210:function(e,t,r){const n=r(8268),{FateTypeTuple:i,FateTypeMap:a}=r(4265),o=r(8804),s=r(6878),c=r(2548);e.exports=class extends n{serialize(e){return this.globalSerializer.serialize(new o(e.itemsType,i(),e.items.map((e=>[e,new s]))))}deserializeStream(e,t){const r=a(t.valuesType,i()),[n,o]=this.globalSerializer.deserializeStream(e,r);return[new c(t.valuesType,n.keys),o]}}},6973:function(e,t,r){const n=r(105),i=r(8268),a=r(8183),o=r(6313),s=r(5462),c=new a;e.exports=class extends i{serialize(e){const t=(new TextEncoder).encode(e);return c.serialize(t)}deserializeStream(e){const t=new Uint8Array(e),r=t[0];if((3&r)!==n.SHORT_STRING&&![n.EMPTY_STRING,n.LONG_STRING].includes(r))throw new s(r);const i=new TextDecoder,[a,A]=c.deserializeStream(t);return[new o(i.decode(a.valueOf())),A]}}},6178:function(e,t,r){const n=r(105),i=r(6878),a=r(8268),o=r(7138);e.exports=class extends a{serialize(e){const t=e.size;if(0===t)return[n.EMPTY_TUPLE];const r=e.items.map((e=>this.globalSerializer.serialize(e))).flat(1/0);return t<16?[t<<4|n.SHORT_TUPLE,...r]:[n.LONG_TUPLE,...o.encode(t-16),...r]}deserializeStream(e,t){const r=new Uint8Array(e),a=r[0];let s=0n,c=r.slice(1);if(a===n.EMPTY_TUPLE)return[new i,c];(15&a)===n.SHORT_TUPLE&&(s=(240&a)>>4),a===n.LONG_TUPLE&&([s,c]=o.decode(r.slice(1)),s+=16n);let A=[];void 0!==t&&(A=t.valueTypes);const u=[];let l=null;for(let e=0n;e<s;e++)[l,c]=this.globalSerializer.deserializeStream(c,A[e]),u.push(l);let d=t;return void 0===t&&(d=u.map((e=>e.type))),[new i(d,u),c]}}},9503:function(e,t,r){const n=r(6636),i=r(105),a=r(6878),o=r(2457),s=r(8268);e.exports=class extends s{serialize(e){const t=new a(e.valueTypes,e.value);return[i.VARIANT,...n.encode(new Uint8Array(e.arities)),e.tag,...this.globalSerializer.serialize(t)]}deserializeStream(e,t){const r=new Uint8Array(e),i=n.decode(r.slice(1),!0),a=[...i.data],s=i.remainder[0],c=i.remainder.slice(1);let A,u=[];void 0!==t&&(u=t.variants,A={...t.variantType,valueTypes:Object.values(t.variants[s])[0]});const[l,d]=this.globalSerializer.deserializeStream(c,A);return[new o(a,s,l.items,l.valueTypes,u),d]}}},34:function(e,t,r){const n=r(9713),i=r(8268);e.exports=class extends i{serialize(){return""}deserialize(){return new n}deserializeStream(e){return[new n,e]}}},2584:function(e,t,r){const n=r(4664),i=r(105),a=r(5462),{FateTypeInt:o,FateTypeBool:s,FateTypeString:c,FateTypeBits:A,FateTypeBytes:u,FateTypeAccountAddress:l,FateTypeContractAddress:d,FateTypeOracleAddress:p,FateTypeOracleQueryAddress:h,FateTypeList:f,FateTypeMap:g,FateTypeTuple:m,FateTypeVariant:y}=r(4265),I={0:l(),1:u(),2:d(),3:p(),4:h()};e.exports=class{createType(e){const t=e[0];if(t===i.TRUE||t===i.FALSE)return s();if((1&t)===i.SMALL_INT||t===i.POS_BIG_INT||t===i.NEG_BIG_INT)return o();if((3&t)===i.SHORT_STRING||t===i.LONG_STRING)return c();if((15&t)===i.SHORT_LIST||t===i.LONG_LIST)return f();if((15&t)===i.SHORT_TUPLE||t===i.LONG_TUPLE||t===i.EMPTY_TUPLE)return m();if(t===i.MAP||t===i.EMPTY_MAP)return g();if(t===i.POS_BITS||t===i.NEG_BITS)return A();if(t===i.VARIANT)return y();if(t===i.OBJECT){const t=e[1];return n(I.hasOwnProperty(t),`Unsupported object type "${t}"`),I[t]}throw new a(t)}}},2540:function(e,t,r){const n=r(6966),{FateTypeVoid:i,FateTypeInt:a,FateTypeBool:o,FateTypeString:s,FateTypeBits:c,FateTypeBytes:A,FateTypeHash:u,FateTypeSignature:l,FateTypeAccountAddress:d,FateTypeContractAddress:p,FateTypeOracleAddress:h,FateTypeOracleQueryAddress:f,FateTypeList:g,FateTypeMap:m,FateTypeTuple:y,FateTypeRecord:I,FateTypeSet:C,FateTypeVariant:E,FateTypeOption:B,FateTypeChainTTL:w,FateTypeChainGAMetaTx:v,FateTypeChainPayingForTx:Q,FateTypeChainBaseTx:b,FateTypeAENSPointee:N,FateTypeAENSName:S,FateTypeEvent:x,FateTypeBls12381Fr:_,FateTypeBls12381Fp:T}=r(4265),M=e=>e&&"object"==typeof e&&e.constructor===Object,R=({type:e})=>{let t,r=e;return M(r)&&([[r,t]]=Object.entries(r)),"option"===r};e.exports=class{constructor(e){this.aci=e}getCallTypes(e,t){const r=this.getNamespaceAci(e).functions.find((e=>e.name===t));if(r){const e=r.arguments.map((e=>this.resolveType(e.type))),t=r.arguments.filter(R);return{types:e,required:e.length-t.length}}if("init"===t)return{types:[],required:0};throw new n(`Unknown function ${t}`)}getReturnType(e,t){if("init"===t)return this.resolveType("void");const r=this.getNamespaceAci(e).functions.find((e=>e.name===t));if(!r)throw new n(`Unknown function ${t}`);return this.resolveType(r.returns)}getEventType(e){const t=this.getNamespaceAci(e);if(!t.hasOwnProperty("event"))throw new n("Missing event declaration");return x(this.resolveType(t.event))}isCustomType(e){if("string"!=typeof e)return!1;if(this.isStdType(e))return!1;const[t,r]=e.split(".");return!!this.getNamespaceAci(t)}isStdType(e){return"Set.set"===e}getNamespaceAci(e){for(const t of this.aci){const[[r,n]]=Object.entries(t);if(n.name===e)return n}return null}resolveType(e,t={}){let r=e,E=[],x=[];if(M(e)&&([[r,E]]=Object.entries(e)),this.isCustomType(r)){const[e,t]=this.resolveTypeDef(r,E);return this.resolveType(e,t)}if(Array.isArray(E)&&"variant"!==r&&(x=E.map((e=>{const r=e.hasOwnProperty("type")?e.type:e,n=t.hasOwnProperty(r)?t[r]:r;return this.resolveType(n,t)}))),"void"===r)return i();if("unit"===r)return y([]);if("int"===r)return a();if("bool"===r)return o();if("string"===r)return s();if("bits"===r)return c();if("hash"===r)return u();if("signature"===r)return l();if("address"===r)return d();if("contract_address"===r)return p();if("Chain.ttl"===r)return w();if("Chain.ga_meta_tx"===r)return v();if("Chain.paying_for_tx"===r)return Q();if("Chain.base_tx"===r)return b();if("AENS.pointee"===r)return N();if("AENS.name"===r)return S();if("Set.set"===r)return C(...x);if("MCL_BLS12_381.fr"===r)return _();if("MCL_BLS12_381.fp"===r)return T();if("bytes"===r)return A(E);if("list"===r)return g(...x);if("map"===r)return m(...x);if(("tuple"===r||"record"===r)&&1===x.length)return x[0];if("tuple"===r)return y(x);if("record"===r){const e=E.map((e=>e.name));return I(e,x)}if("variant"===r)return this.resolveVariant(E,t);if("option"===r)return B(x);if("oracle"===r)return h(...x);if("oracle_query"===r)return f(...x);throw new n("Cannot resolve type: "+JSON.stringify(e))}resolveVariant(e,t){const r=e.map((e=>{const[[r,n]]=Object.entries(e);return{[r]:n.map((e=>{const r=t.hasOwnProperty(e)?t[e]:e;return this.resolveType(r,t)}))}}));return E(0,null,r)}resolveTypeDef(e,t=[]){const[r,i]=e.split("."),a=this.getNamespaceAci(r);if(!a)throw new n("Unknown namespace for "+JSON.stringify(e));if(a.name===e)return["contract_address",[]];const o=[...a.type_defs,...a.state?[{name:"state",typedef:a.state,vars:[]}]:[]].find((e=>e.name===i));if(!o)throw new n("Unknown type definition: "+JSON.stringify(e));const s={};return o.vars.forEach(((e,r)=>{const[[n,i]]=Object.entries(e);s[i]=t[r]})),[s.hasOwnProperty(o.typedef)?s[o.typedef]:o.typedef,s]}}},3023:function(e,t,r){const n=r(2968);e.exports={Encoder:n}},539:function(e,t,r){const n=r(6187);e.exports=class extends n{constructor(e){super(e,"account_address","ak")}}},6187:function(e,t,r){const n=r(5779);e.exports=class extends n{constructor(e,t,r){super(e,32,t),this._prefix=r}get prefix(){return this._prefix}accept(e){return e.visitAddress(this)}}},3422:function(e,t,r){const n=r(9865);e.exports=class extends n{constructor(e){super("bits"),this._value=BigInt(e)}get value(){return this._value}valueOf(){return this._value}}},7430:function(e,t,r){const n=r(9865),i=r(5110);e.exports=class extends n{constructor(e,t,r){if(super(r),!Array.isArray(e)&&!ArrayBuffer.isView(e))throw new i(r,`Should be one of: Array or ArrayBuffer; got ${e} instead`);const n=new Uint8Array(e);if(n.byteLength!==t)throw new i(r,`Invalid length: got ${n.byteLength} bytes instead of ${t} bytes`);this._value=n,this._size=t}get value(){return this._value}get size(){return this._size}valueOf(){return this._value}}},4077:function(e,t,r){const n=r(7430),{FateTypeBls12381Fp:i}=r(4265);e.exports=class extends n{constructor(e){super(e,48,"bls12_381.fp")}get type(){return i()}accept(e){return e.visitBls12381Fp(this)}}},1565:function(e,t,r){const n=r(7430),{FateTypeBls12381Fr:i}=r(4265);e.exports=class extends n{constructor(e){super(e,32,"bls12_381.fr")}get type(){return i()}accept(e){return e.visitBls12381Fr(this)}}},4476:function(e,t,r){const n=r(9865),{FateTypeBool:i}=r(4265);e.exports=class extends n{constructor(e){super("bool"),this._value=!!e}get value(){return this._value}get type(){return i()}valueOf(){return this._value}}},7945:function(e,t,r){const n=r(9865),{FateTypeByteArray:i}=r(4265);e.exports=class extends n{constructor(e=[]){super("byte_array"),this._value=new Uint8Array(e)}get length(){return this._value.length}get type(){return i()}valueOf(){return this._value}}},5779:function(e,t,r){const n=r(9865),{Int2ByteArray:i}=r(240),a=r(381),o=r(5110);e.exports=class extends n{constructor(e,t,r="bytes"){if(super(r),this._value=((e,t=0)=>{if(Array.isArray(e)||ArrayBuffer.isView(e))return new Uint8Array(e);if("string"==typeof e)return a(e);if("bigint"!=typeof e&&!Number.isInteger(e))throw new o("byte_array",`Should be one of: Array, ArrayBuffer, hex string, Number, BigInt; got ${e} instead`);const r=i(e);if(r.length>=t)return r;const n=new Uint8Array(t);return n.set(r,t-r.length),n})(e,t),t&&this._value.byteLength!==t)throw new o(r,`Invalid length: got ${this._value.byteLength} bytes instead of ${t} bytes`);this._size=t}get value(){return this._value}get size(){return this._size}valueOf(){return this._value}}},6445:function(e,t,r){const n=r(6187);e.exports=class extends n{constructor(e){super(e,"channel_address","ch")}}},8623:function(e,t,r){const n=r(6187);e.exports=class extends n{constructor(e){super(e,"contract_address","ct")}}},9865:function(e,t,r){const n=r(2966);e.exports=class{constructor(e){this.name=e}valueOf(){throw new n("Not implemented.")}accept(e){return e.visitData(this)}}},871:function(e,t,r){const n=r(5779);e.exports=class extends n{constructor(e){super(e,32,"hash")}}},3509:function(e,t,r){const n=r(9865),{FateTypeInt:i}=r(4265);e.exports=class extends n{constructor(e){super("int"),this._value=BigInt(e)}get value(){return this._value}get type(){return i()}valueOf(){return this._value}}},1041:function(e,t,r){const n=r(9865),{FateTypeList:i}=r(4265);e.exports=class extends n{constructor(e,t=[]){super("list"),this._itemsType=e,this.items=Array.from(t)}get itemsType(){return this._itemsType}get type(){return i(this.itemsType)}get length(){return this.items.length}valueOf(){return this.items.map((e=>e.valueOf()))}accept(e){return e.visitList(this)}}},8804:function(e,t,r){const n=r(9865),{FateTypeMap:i}=r(4265),a=e=>{const[t,r]=e;return{key:t,value:r}};e.exports=class extends n{constructor(e,t,r=[]){super("map"),this._keyType=e,this._valueType=t,this._type=i(e,t),this._value=new Map(r)}get items(){return[...this._value.entries()].map(a)}get keyType(){return this._keyType}get valueType(){return this._valueType}get type(){return this._type}get length(){return this._value.size}get iterator(){return this._value[Symbol.iterator]()}get keys(){return this._value.keys()}valueOf(){const e=new Map;for(const[t,r]of this.iterator)e.set(t.valueOf(),r.valueOf());return e}accept(e){return e.visitMap(this)}}},687:function(e,t,r){const n=r(6187);e.exports=class extends n{constructor(e){super(e,"oracle_address","ok")}}},5070:function(e,t,r){const n=r(6187);e.exports=class extends n{constructor(e){super(e,"oracle_query_address","oq")}}},2548:function(e,t,r){const n=r(9865),{FateTypeSet:i}=r(4265);e.exports=class extends n{constructor(e,t=[]){super("set"),this._itemsType=e,this._items=new Set(t)}get items(){return Array.from(this._items.values())}get itemsType(){return this._itemsType}get type(){return i(this.itemsType)}get length(){return this._items.size}valueOf(){return new Set(this.items.map((e=>e.valueOf())))}accept(e){return e.visitSet(this)}}},3607:function(e,t,r){const n=r(5779);e.exports=class extends n{constructor(e){super(e,64,"signature")}}},6313:function(e,t,r){const n=r(9865),{FateTypeString:i}=r(4265);e.exports=class extends n{constructor(e){super("string"),this._value=e.toString()}get type(){return i()}toString(){return this._value}valueOf(){return this._value}}},6878:function(e,t,r){const n=r(9865),{FateTypeTuple:i}=r(4265);e.exports=class extends n{constructor(e=[],t=[]){super("tuple"),this._valueTypes=e.hasOwnProperty("valueTypes")?e.valueTypes:e,this._type=Array.isArray(e)?i(e):e,this._items=Array.from(t)}get valueTypes(){return this._valueTypes}get type(){return this._type}get size(){return this._items.length}get items(){return this._items}valueOf(){return this.prepareItems((e=>e.valueOf()))}prepareItems(e){const t=this._items.map(e);return"record"===this._type.name?(r=this._type.keys,n=t,r.reduce(((e,t,r)=>(e[t]=n[r],e)),{})):t;var r,n}accept(e){return e.visitTuple(this)}}},2457:function(e,t,r){const n=r(9865),{FateTypeVariant:i,FateTypeTuple:a,FateTypeInt:o}=r(4265);e.exports=class extends n{constructor(e,t,r=[],n=[],a=[]){super("variant"),this.arities=Array.from(e),this._tag=t,this._value=r,this._valueTypes=n,this._type=i(e,n,a)}get valueTypes(){return this._valueTypes}get type(){return this._type}get tag(){return this._tag}get value(){return this._value}get aritiesType(){return o()}get variantType(){return a(this._valueTypes)}get variants(){return this._type.variants}get variantName(){const e=this.variants[this.tag];return Object.keys(e)[0]}valueOf(){if(0===this.variants.length)return this;const e=this._value.map((e=>e.valueOf()));return{[this.variantName]:e}}accept(e){return e.visitVariant(this)}}},9713:function(e,t,r){const n=r(9865),{FateTypeVoid:i}=r(4265);e.exports=class extends n{constructor(){super("void"),this._value=void 0}get value(){return this._value}get type(){return i()}valueOf(){return this._value}}},333:function(e,t,r){const{Int2ByteArray:n,ByteArray2IntBE:i}=r(240),a={r:{R:1n<<256n,N:0x73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000001n},p:{R:1n<<384n,N:0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaabn}},o=(e,t)=>{if(0n===t)return[1n,0n,e];const[r,n,i]=o(t,e%t);return[n,r-n*(e/t),i]};e.exports={Int2MontBytes:(e,t)=>{const r=a[t],i=BigInt(e)*r.R%r.N;return n(i)},MontBytes2Int:(e,t)=>{const r=a[t],n=i(e),s=((e,t)=>{const[r,n,i]=o(e,t);return(r+t)%t})(r.R,r.N);return n*s%r.N}}},381:function(e,t,r){const n=r(722);e.exports=e=>{const t=e.match(/^(0x)?([a-f0-9]*)$/i);if(!t)throw new n(`Invalid hex string: ${e}`);return new Uint8Array(t[2].split(/(.{1,2})/).filter((e=>e)).map((e=>parseInt(e,16))))}},240:function(e){const t=e=>{const r=BigInt(e);return r<256n?new Uint8Array([Number(r)]):new Uint8Array([...t(r>>8n),Number(0xffn&r)])},r=e=>{const t=[];return e.forEach((e=>{let r=e.toString(16);r.length%2&&(r="0"+r),t.push(r)})),t};e.exports={Int2ByteArray:t,ByteArray2Int:e=>{const t=r(e);return BigInt("0x"+t.join(""))},ByteArray2IntBE:e=>{const t=r(e).reverse();return BigInt("0x"+t.join(""))}}},7138:function(e,t,r){const n=r(6636),{Int2ByteArray:i,ByteArray2Int:a}=r(240);e.exports={encode:e=>new Uint8Array(n.encode(i(e))),decode(e){const t=n.decode(e,!0);return[a(t.data),t.remainder]}}},9475:function(e){e.exports=e=>e>0?e:-1n*e},4664:function(e,t,r){const n=r(2966);e.exports=(e,t)=>{if(!e)throw new n(t)}},2727:function(e,t,r){const n=r(5260),{addChecksum:i,getPayload:a}=r(8638);e.exports={encode:e=>n.encode(i(e)),decode:e=>a(n.decode(e))}},8638:function(e,t,r){const n=r(9072),{Buffer:i}=r(9509),a=r(722),o=e=>n("sha256").update(e).digest(),s=e=>o(o(e)).slice(0,4),c=e=>{const t=i.from(e),r=s(e);return i.concat([t,r],t.length+4)},A=e=>{const t=e.slice(0,-4),r=e.slice(-4),n=s(t);if(!r.equals(n))throw new a("Invalid checksum");return t};e.exports={addChecksum:c,getPayload:A,encode:e=>c(e).toString("base64"),decode:e=>A(i.from(e,"base64"))}},2665:function(e,t,r){const n=r(1191),i=e=>Array.from(n.blake2b(e,null,32));e.exports={hash:i,symbolIdentifier:e=>i(e).slice(0,4)}},5675:function(e){e.exports=(e,...t)=>e.map(((e,r)=>t.reduce(((e,t)=>[...e,t[r]]),[e])))},9250:function(e,t,r){var n=r(8764).Buffer;e.exports=(()=>{var e={721:function(e,t){e.exports="AGFzbQEAAAABkwESYAF/AX9gA39/fwF/YAJ/fwBgAn9/AX9gAX8AYAR/f39/AX9gA39/fwBgBH9/f38AYAJ/fgBgAn5/AX5gAn5+AX5gBX9/f39/AGAAAGAGf3x/f39/AX9gCH9/f39/f39/AX9gEX9/f39/f39/f39/f39/f39/AX9gBn9/f39/fwF/YA1/f39/f39/f39/f39/AX8CDQIBYQFhAAABYQFiAAEDPTwJCgECAQIEAAABAAsGAAEHAQIAAwICAwIIAAIDAAcMAwYABQAEBgAABQUAAQECBAEBCAABDg8EEAAFEQMEBQFwAQMDBQcBAYAC//8BBgkBfwFBoKLAAgsHMQwBYwIAAWQAIAFlADwBZgAJAWcACAFoADsBaQA6AWoAOQFrAQABbAA3AW0ANgFuADQJCAEAQQELAgs1CoeyATwIACAAIAGtigseACAAIAF8IABCAYZC/v///x+DIAFC/////w+DfnwLgQQBA38gAkGABE8EQCAAIAEgAhABGiAADwsgACACaiEDAkAgACABc0EDcUUEQAJAIABBA3FFBEAgACECDAELIAJFBEAgACECDAELIAAhAgNAIAIgAS0AADoAACABQQFqIQEgAkEBaiICQQNxRQ0BIAIgA0kNAAsLAkAgA0F8cSIEQcAASQ0AIAIgBEFAaiIFSw0AA0AgAiABKAIANgIAIAIgASgCBDYCBCACIAEoAgg2AgggAiABKAIMNgIMIAIgASgCEDYCECACIAEoAhQ2AhQgAiABKAIYNgIYIAIgASgCHDYCHCACIAEoAiA2AiAgAiABKAIkNgIkIAIgASgCKDYCKCACIAEoAiw2AiwgAiABKAIwNgIwIAIgASgCNDYCNCACIAEoAjg2AjggAiABKAI8NgI8IAFBQGshASACQUBrIgIgBU0NAAsLIAIgBE8NAQNAIAIgASgCADYCACABQQRqIQEgAkEEaiICIARJDQALDAELIANBBEkEQCAAIQIMAQsgACADQQRrIgRLBEAgACECDAELIAAhAgNAIAIgAS0AADoAACACIAEtAAE6AAEgAiABLQ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BACAJa3FBAWsiACAAQQx2QRBxIgJ2IgFBBXZBCHEiACACciABIAB2IgFBAnZBBHEiAHIgASAAdiIBQQF2QQJxIgByIAEgAHYiAUEBdkEBcSIAciABIAB2akECdEHUIGooAgAiASgCBEF4cSAHayEDIAEhAgNAAkAgAigCECIARQRAIAIoAhQiAEUNAQsgACgCBEF4cSAHayICIAMgAiADSSICGyEDIAAgASACGyEBIAAhAgwBCwsgASgCGCEIIAEgASgCDCIERwRAIAEoAggiAEG0HigCAEkaIAAgBDYCDCAEIAA2AggMCwsgAUEUaiICKAIAIgBFBEAgASgCECIARQ0DIAFBEGohAgsDQCACIQUgACIEQRRqIgIoAgAiAA0AIARBEGohAiAEKAIQIgANAAsgBUEANgIADAoLQX8hByAAQb9/Sw0AIABBC2oiAEF4cSEHQageKAIAIglFDQBBACAHayEDAkACQAJAAn9BACAHQYACSQ0AGkEfIAdB////B0sNABogAEEIdiIAIABBgP4/akEQdkEIcSICdCIAIABBgOAfakEQdkEEcSIBdCIAIABBgIAPakEQdkECcSIAdEEPdiABIAJyIAByayIAQQF0IAcgAEEVanZBAXFyQRxqCyIGQQJ0QdQgaigCACICRQRAQQAhAAwBC0EAIQAgB0EAQRkgBkEBdmsgBkEfRht0IQEDQAJAIAIoAgRBeHEgB2siBSADTw0AIAIhBCAFIgMNAEEAIQMgAiEADAMLIAAgAigCFCIFIAUgAiABQR12QQRxaigCECICRhsgACAFGyEAIAFBAXQhASACDQALCyAAIARyRQRAQQAhBEECIAZ0IgBBACAAa3IgCXEiAEUNAyAAQQAgAGtxQQFrIgAgAEEMdkEQcSICdiIBQQV2QQhxIgAgAnIgASAAdiIBQQJ2QQRxIgByIAEgAHYiAUEBdkECcSIAciABIAB2IgFBAXZBAXEiAHIgASAAdmpBAnRB1CBqKAIAIQALIABFDQELA0AgACgCBEF4cSAHayIBIANJIQIgASADIAIbIQMgACAEIAIbIQQgACgCECIBBH8gAQUgACgCFAsiAA0ACwsgBEUNACADQaweKAIAIAdrTw0A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VUxMLCBidXQgc2FsdCBsZW5ndGggaXMgbm90IDAAU2VjcmV0IHBvaW50ZXIgaXMgTlVMTCwgYnV0IHNlY3JldCBsZW5ndGggaXMgbm90IDAAUGFzc3dvcmQgcG9pbnRlciBpcyBOVUxMLCBidXQgcGFzc3dvcmQgbGVuZ3RoIGlzIG5vdCAwAEFzc29jaWF0ZWQgZGF0YSBwb2ludGVyIGlzIE5VTEwsIGJ1dCBhZCBsZW5ndGggaXMgbm90IDAAKG51bGwpAAAAmwgAALsHAABJCQAAwAkAALAJAADwBwAAHwgAADAIAADJCAAAbwoAAOAJAAAWCgAAOwoAAEMIAAArCwAAwQoAAJIKAAD0CgAAAggAABEIAABbCQAAWwgAAHQJAAB0CAAABQkAAHQHAAAtCQAAngcAAPQIAABiBwAAGAkAAIgHAADhCAAATgcAAP8JAABcCgAAAQAAABkACgAZGRkAAAAABQAAAAAAAAkAAAAACwAAAAAAAAAAGQARChkZGQMKBwABAAkLGAAACQYLAAALAAYZAAAAGRkZAEHRGAshDgAAAAAAAAAAGQAKDRkZGQANAAACAAkOAAAACQAOAAAOAEGLGQsBDABBlxkLFRMAAAAAEwAAAAAJDAAAAAAADAAADABBxRkLARAAQdEZCxUPAAAABA8AAAAACRAAAAAAABAAABAAQf8ZCwESAEGLGgseEQAAAAARAAAAAAkSAAAAAAASAAASAAAaAAAAGhoaAEHCGgsOGgAAABoaGgAAAAAAAAkAQfMaCwEUAEH/GgsVFwAAAAAXAAAAAAkUAAAAAAAUAAAUAEGtGwsBFgBBuRsLJxUAAAAAFQAAAAAJFgAAAAAAFgAAFgAAMDEyMzQ1Njc4OUFCQ0RFRgBBhBwLAQIAQawcCwj//////////wBB8BwLBwEAAAAgEVA="},477:(e,t,r)=>{e.exports=function(e){e=void 0!==(e=e||{})?e:{};var t,r,n=Object.assign,i=n({},e),a=[],o="object"==typeof window,s="function"==typeof importScripts,c="";(o||s)&&(s?c=self.location.href:"undefined"!=typeof document&&document.currentScript&&(c=document.currentScript.src),c=0!==c.indexOf("blob:")?c.substr(0,c.replace(/[?#].*/,"").lastIndexOf("/")+1):"",s&&(r=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),t=(e,t,r)=>{var n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="arraybuffer",n.onload=()=>{200==n.status||0==n.status&&n.response?t(n.response):r()},n.onerror=r,n.send(null)}),e.print||console.log.bind(console);var A,u,l=e.printErr||console.warn.bind(console);n(e,i),i=null,e.arguments&&(a=e.arguments),e.thisProgram&&e.thisProgram,e.quit&&e.quit,e.wasmBinary&&(A=e.wasmBinary),e.noExitRuntime,"object"!=typeof WebAssembly&&b("no native wasm support detected");var d,p,h=!1,f="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function g(t){d=t,e.HEAP8=new Int8Array(t),e.HEAP16=new Int16Array(t),e.HEAP32=new Int32Array(t),e.HEAPU8=p=new Uint8Array(t),e.HEAPU16=new Uint16Array(t),e.HEAPU32=new Uint32Array(t),e.HEAPF32=new Float32Array(t),e.HEAPF64=new Float64Array(t)}e.INITIAL_MEMORY;var m,y,I,C=[],E=[],B=[],w=0,v=null,Q=null;function b(t){throw e.onAbort&&e.onAbort(t),l(t="Aborted("+t+")"),h=!0,t+=". Build with -s ASSERTIONS=1 for more info.",new WebAssembly.RuntimeError(t)}function N(e){return e.startsWith("data:application/octet-stream;base64,")}function S(e){return e.startsWith("file://")}function x(e){try{if(e==y&&A)return new Uint8Array(A);if(r)return r(e);throw"both async and sync fetching of the wasm failed"}catch(e){b(e)}}function _(t){for(;t.length>0;){var r=t.shift();if("function"!=typeof r){var n=r.func;"number"==typeof n?void 0===r.arg?T(n)():T(n)(r.arg):n(void 0===r.arg?null:r.arg)}else r(e)}}function T(e){return m.get(e)}function M(e){try{return u.grow(e-d.byteLength+65535>>>16),g(u.buffer),1}catch(e){}}e.preloadedImages={},e.preloadedAudios={},N(y="argon2.wasm")||(I=y,y=e.locateFile?e.locateFile(I,c):c+I);var R,k={b:function(e,t,r){p.copyWithin(e,t,t+r)},a:function(e){var t,r=p.length,n=2147418112;if((e>>>=0)>n)return!1;for(var i=1;i<=4;i*=2){var a=r*(1+.2/i);if(a=Math.min(a,e+100663296),M(Math.min(n,((t=Math.max(e,a))%65536>0&&(t+=65536-t%65536),t))))return!0}return!1}},D=(function(){var r={a:k};function n(t,r){var n,i=t.exports;e.asm=i,g((u=e.asm.c).buffer),m=e.asm.k,n=e.asm.d,E.unshift(n),function(t){if(w--,e.monitorRunDependencies&&e.monitorRunDependencies(w),0==w&&(null!==v&&(clearInterval(v),v=null),Q)){var r=Q;Q=null,r()}}()}function i(e){n(e.instance)}function a(e){return function(){if(!A&&(o||s)){if("function"==typeof fetch&&!S(y))return fetch(y,{credentials:"same-origin"}).then((function(e){if(!e.ok)throw"failed to load wasm binary file at '"+y+"'";return e.arrayBuffer()})).catch((function(){return x(y)}));if(t)return new Promise((function(e,r){t(y,(function(t){e(new Uint8Array(t))}),r)}))}return Promise.resolve().then((function(){return x(y)}))}().then((function(e){return WebAssembly.instantiate(e,r)})).then((function(e){return e})).then(e,(function(e){l("failed to asynchronously prepare wasm: "+e),b(e)}))}if(w++,e.monitorRunDependencies&&e.monitorRunDependencies(w),e.instantiateWasm)try{return e.instantiateWasm(r,n)}catch(e){return l("Module.instantiateWasm callback failed with error: "+e),!1}A||"function"!=typeof WebAssembly.instantiateStreaming||N(y)||S(y)||"function"!=typeof fetch?a(i):fetch(y,{credentials:"same-origin"}).then((function(e){return WebAssembly.instantiateStreaming(e,r).then(i,(function(e){return l("wasm streaming compile failed: "+e),l("falling back to ArrayBuffer instantiation"),a(i)}))}))}(),e.___wasm_call_ctors=function(){return(e.___wasm_call_ctors=e.asm.d).apply(null,arguments)},e._argon2_hash=function(){return(e._argon2_hash=e.asm.e).apply(null,arguments)},e._malloc=function(){return(D=e._malloc=e.asm.f).apply(null,arguments)}),z=(e._free=function(){return(e._free=e.asm.g).apply(null,arguments)},e._argon2_verify=function(){return(e._argon2_verify=e.asm.h).apply(null,arguments)},e._argon2_error_message=function(){return(e._argon2_error_message=e.asm.i).apply(null,arguments)},e._argon2_encodedlen=function(){return(e._argon2_encodedlen=e.asm.j).apply(null,arguments)},e._argon2_hash_ext=function(){return(e._argon2_hash_ext=e.asm.l).apply(null,arguments)},e._argon2_verify_ext=function(){return(e._argon2_verify_ext=e.asm.m).apply(null,arguments)},e.stackAlloc=function(){return(z=e.stackAlloc=e.asm.n).apply(null,arguments)});function O(t){function r(){R||(R=!0,e.calledRun=!0,h||(_(E),e.onRuntimeInitialized&&e.onRuntimeInitialized(),function(){if(e.postRun)for("function"==typeof e.postRun&&(e.postRun=[e.postRun]);e.postRun.length;)t=e.postRun.shift(),B.unshift(t);var t;_(B)}()))}t=t||a,w>0||(function(){if(e.preRun)for("function"==typeof e.preRun&&(e.preRun=[e.preRun]);e.preRun.length;)t=e.preRun.shift(),C.unshift(t);var t;_(C)}(),w>0||(e.setStatus?(e.setStatus("Running..."),setTimeout((function(){setTimeout((function(){e.setStatus("")}),1),r()}),1)):r()))}if(e.allocate=function(e,t){var r;return r=1==t?z(e.length):D(e.length),e.subarray||e.slice?p.set(e,r):p.set(new Uint8Array(e),r),r},e.UTF8ToString=function(e,t){return e?function(e,t,r){for(var n=t+r,i=t;e[i]&&!(i>=n);)++i;if(i-t>16&&e.subarray&&f)return f.decode(e.subarray(t,i));for(var a="";t<i;){var o=e[t++];if(128&o){var s=63&e[t++];if(192!=(224&o)){var c=63&e[t++];if((o=224==(240&o)?(15&o)<<12|s<<6|c:(7&o)<<18|s<<12|c<<6|63&e[t++])<65536)a+=String.fromCharCode(o);else{var A=o-65536;a+=String.fromCharCode(55296|A>>10,56320|1023&A)}}else a+=String.fromCharCode((31&o)<<6|s)}else a+=String.fromCharCode(o)}return a}(p,e,t):""},e.ALLOC_NORMAL=0,Q=function e(){R||O(),R||(Q=e)},e.run=O,e.preInit)for("function"==typeof e.preInit&&(e.preInit=[e.preInit]);e.preInit.length>0;)e.preInit.pop()();return O(),e.unloadRuntime=function(){"undefined"!=typeof self&&delete self.Module,e=jsModule=u=m=d=p=void 0},e}},145:()=>{},967:()=>{}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var a=t[n]={exports:{}};return e[n].call(a.exports,a,a.exports,r),a.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};return(()=>{"use strict";r.r(i),r.d(i,{ArgonType:()=>s,hash:()=>d,verify:()=>p,unloadRuntime:()=>h,default:()=>f});var e=r(477),t=r.n(e),a=r(721),o=r.n(a);const s={Argon2d:0,Argon2i:1,Argon2id:2};function c(e){if(c._promise)return c._promise;if(c._module)return Promise.resolve(c._module);let r;return r=function(){if("function"==typeof loadArgon2WasmBinary)return loadArgon2WasmBinary();const e=o();if(e)return Promise.resolve(function(e){if("function"==typeof n)return new Uint8Array(n.from(e,"base64"));const t=atob(e),r=new Uint8Array(new ArrayBuffer(t.length));for(let e=0;e<t.length;e++)r[e]=t.charCodeAt(e);return r}(e));const t="string"==typeof argon2WasmPath?argon2WasmPath:"node_modules/argon2-browser/dist/argon2.wasm";return fetch(t).then((e=>e.arrayBuffer())).then((e=>new Uint8Array(e)))}().then((r=>function(e){const r=t()(e);return new Promise((e=>{r.postRun=()=>e(r)}))}({wasmBinary:r,wasmMemory:e?function(e){const t=Math.min(Math.max(Math.ceil(1024*e/65536),256)+256,32767);return new WebAssembly.Memory({initial:t,maximum:32767})}(e):void 0}))),c._promise=r,r.then((e=>(c._module=e,delete c._promise,e)))}function A(e,t){return e.allocate(t,"i8",e.ALLOC_NORMAL)}function u(e,t){return A(e,new Uint8Array([...t,0]))}function l(e){if("string"!=typeof e)return e;if("function"==typeof TextEncoder)return(new TextEncoder).encode(e);if("function"==typeof n)return n.from(e);throw new Error("Don't know how to encode UTF8")}function d(e){const t=e.mem||1024;return c(t).then((r=>{const n=e.time||1,i=e.parallelism||1,a=l(e.pass),o=u(r,a),c=a.length,d=l(e.salt),p=u(r,d),h=d.length,f=e.type||s.Argon2d,g=r.allocate(new Array(e.hashLen||24),"i8",r.ALLOC_NORMAL),m=e.secret?A(r,e.secret):0,y=e.secret?e.secret.byteLength:0,I=e.ad?A(r,e.ad):0,C=e.ad?e.ad.byteLength:0,E=e.hashLen||24,B=r._argon2_encodedlen(n,t,i,h,E,f),w=r.allocate(new Array(B+1),"i8",r.ALLOC_NORMAL);let v,Q,b;try{Q=r._argon2_hash_ext(n,t,i,o,c,p,h,g,E,w,B,f,m,y,I,C,19)}catch(e){v=e}if(0!==Q||v){try{v||(v=r.UTF8ToString(r._argon2_error_message(Q)))}catch(e){}b={message:v,code:Q}}else{let e="";const t=new Uint8Array(E);for(let n=0;n<E;n++){const i=r.HEAP8[g+n];t[n]=i,e+=("0"+(255&i).toString(16)).slice(-2)}b={hash:t,hashHex:e,encoded:r.UTF8ToString(w)}}try{r._free(o),r._free(p),r._free(g),r._free(w),I&&r._free(I),m&&r._free(m)}catch(e){}if(v)throw b;return b}))}function p(e){return c().then((t=>{const r=l(e.pass),n=u(t,r),i=r.length,a=e.secret?A(t,e.secret):0,o=e.secret?e.secret.byteLength:0,c=e.ad?A(t,e.ad):0,d=e.ad?e.ad.byteLength:0,p=u(t,l(e.encoded));let h,f,g,m=e.type;if(void 0===m){let t=e.encoded.split("$")[1];t&&(t=t.replace("a","A"),m=s[t]||s.Argon2d)}try{f=t._argon2_verify_ext(p,n,i,a,o,c,d,m)}catch(e){h=e}if(f||h){try{h||(h=t.UTF8ToString(t._argon2_error_message(f)))}catch(e){}g={message:h,code:f}}try{t._free(n),t._free(p)}catch(e){}if(h)throw g;return g}))}function h(){c._module&&(c._module.unloadRuntime(),delete c._promise,delete c._module)}const f={ArgonType:s,hash:d,verify:p,unloadRuntime:h}})(),i})()},8826:function(e){!function(t){"use strict";function r(e){return parseInt(e)===e}function n(e){if(!r(e.length))return!1;for(var t=0;t<e.length;t++)if(!r(e[t])||e[t]<0||e[t]>255)return!1;return!0}function i(e,t){if(e.buffer&&"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 a(e){return new Uint8Array(e)}function o(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);r<e.length;){var n=e.charCodeAt(r++);37===n?(t.push(parseInt(e.substr(r,2),16)),r+=2):t.push(n)}return i(t)},fromBytes:function(e){for(var t=[],r=0;r<e.length;){var n=e[r];n<128?(t.push(String.fromCharCode(n)),r++):n>191&&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("")}},A=(s="0123456789abcdef",{toBytes:function(e){for(var t=[],r=0;r<e.length;r+=2)t.push(parseInt(e.substr(r,2),16));return t},fromBytes:function(e){for(var t=[],r=0;r<e.length;r++){var n=e[r];t.push(s[(240&n)>>4]+s[15&n])}return t.join("")}}),u={16:10,24:12,32:14},l=[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],d=[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],p=[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],h=[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],f=[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],m=[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],y=[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],I=[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],C=[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],E=[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],B=[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],w=[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],v=[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],Q=[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 b(e){for(var t=[],r=0;r<e.length;r+=4)t.push(e[r]<<24|e[r+1]<<16|e[r+2]<<8|e[r+3]);return t}var N=function(e){if(!(this instanceof N))throw Error("AES must be instanitated with `new`");Object.defineProperty(this,"key",{value:i(e,!0)}),this._prepare()};N.prototype._prepare=function(){var e=u[this.key.length];if(null==e)throw new Error("invalid key size (must be 16, 24 or 32 bytes)");this._Ke=[],this._Kd=[];for(var t=0;t<=e;t++)this._Ke.push([0,0,0,0]),this._Kd.push([0,0,0,0]);var r,n=4*(e+1),i=this.key.length/4,a=b(this.key);for(t=0;t<i;t++)r=t>>2,this._Ke[r][t%4]=a[t],this._Kd[e-r][t%4]=a[t];for(var o,s=0,c=i;c<n;){if(o=a[i-1],a[0]^=d[o>>16&255]<<24^d[o>>8&255]<<16^d[255&o]<<8^d[o>>24&255]^l[s]<<24,s+=1,8!=i)for(t=1;t<i;t++)a[t]^=a[t-1];else{for(t=1;t<i/2;t++)a[t]^=a[t-1];for(o=a[i/2-1],a[i/2]^=d[255&o]^d[o>>8&255]<<8^d[o>>16&255]<<16^d[o>>24&255]<<24,t=i/2+1;t<i;t++)a[t]^=a[t-1]}for(t=0;t<i&&c<n;)A=c>>2,p=c%4,this._Ke[A][p]=a[t],this._Kd[e-A][p]=a[t++],c++}for(var A=1;A<e;A++)for(var p=0;p<4;p++)o=this._Kd[A][p],this._Kd[A][p]=B[o>>24&255]^w[o>>16&255]^v[o>>8&255]^Q[255&o]},N.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=b(e),i=0;i<4;i++)n[i]^=this._Ke[0][i];for(var o=1;o<t;o++){for(i=0;i<4;i++)r[i]=h[n[i]>>24&255]^f[n[(i+1)%4]>>16&255]^g[n[(i+2)%4]>>8&255]^m[255&n[(i+3)%4]]^this._Ke[o][i];n=r.slice()}var s,c=a(16);for(i=0;i<4;i++)s=this._Ke[t][i],c[4*i]=255&(d[n[i]>>24&255]^s>>24),c[4*i+1]=255&(d[n[(i+1)%4]>>16&255]^s>>16),c[4*i+2]=255&(d[n[(i+2)%4]>>8&255]^s>>8),c[4*i+3]=255&(d[255&n[(i+3)%4]]^s);return c},N.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=b(e),i=0;i<4;i++)n[i]^=this._Kd[0][i];for(var o=1;o<t;o++){for(i=0;i<4;i++)r[i]=y[n[i]>>24&255]^I[n[(i+3)%4]>>16&255]^C[n[(i+2)%4]>>8&255]^E[255&n[(i+1)%4]]^this._Kd[o][i];n=r.slice()}var s,c=a(16);for(i=0;i<4;i++)s=this._Kd[t][i],c[4*i]=255&(p[n[i]>>24&255]^s>>24),c[4*i+1]=255&(p[n[(i+3)%4]>>16&255]^s>>16),c[4*i+2]=255&(p[n[(i+2)%4]>>8&255]^s>>8),c[4*i+3]=255&(p[255&n[(i+1)%4]]^s);return c};var S=function(e){if(!(this instanceof S))throw Error("AES must be instanitated with `new`");this.description="Electronic Code Block",this.name="ecb",this._aes=new N(e)};S.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=a(e.length),r=a(16),n=0;n<e.length;n+=16)o(e,r,0,n,n+16),o(r=this._aes.encrypt(r),t,n);return t},S.prototype.decrypt=function(e){if((e=i(e)).length%16!=0)throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");for(var t=a(e.length),r=a(16),n=0;n<e.length;n+=16)o(e,r,0,n,n+16),o(r=this._aes.decrypt(r),t,n);return t};var x=function(e,t){if(!(this instanceof x))throw Error("AES must be instanitated with `new`");if(this.description="Cipher Block Chaining",this.name="cbc",t){if(16!=t.length)throw new Error("invalid initialation vector size (must be 16 bytes)")}else t=a(16);this._lastCipherblock=i(t,!0),this._aes=new N(e)};x.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=a(e.length),r=a(16),n=0;n<e.length;n+=16){o(e,r,0,n,n+16);for(var s=0;s<16;s++)r[s]^=this._lastCipherblock[s];this._lastCipherblock=this._aes.encrypt(r),o(this._lastCipherblock,t,n)}return t},x.prototype.decrypt=function(e){if((e=i(e)).length%16!=0)throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");for(var t=a(e.length),r=a(16),n=0;n<e.length;n+=16){o(e,r,0,n,n+16),r=this._aes.decrypt(r);for(var s=0;s<16;s++)t[n+s]=r[s]^this._lastCipherblock[s];o(e,this._lastCipherblock,0,n,n+16)}return t};var _=function(e,t,r){if(!(this instanceof _))throw Error("AES must be instanitated with `new`");if(this.description="Cipher Feedback",this.name="cfb",t){if(16!=t.length)throw new Error("invalid initialation vector size (must be 16 size)")}else t=a(16);r||(r=1),this.segmentSize=r,this._shiftRegister=i(t,!0),this._aes=new N(e)};_.prototype.encrypt=function(e){if(e.length%this.segmentSize!=0)throw new Error("invalid plaintext size (must be segmentSize bytes)");for(var t,r=i(e,!0),n=0;n<r.length;n+=this.segmentSize){t=this._aes.encrypt(this._shiftRegister);for(var a=0;a<this.segmentSize;a++)r[n+a]^=t[a];o(this._shiftRegister,this._shiftRegister,0,this.segmentSize),o(r,this._shiftRegister,16-this.segmentSize,n,n+this.segmentSize)}return r},_.prototype.decrypt=function(e){if(e.length%this.segmentSize!=0)throw new Error("invalid ciphertext size (must be segmentSize bytes)");for(var t,r=i(e,!0),n=0;n<r.length;n+=this.segmentSize){t=this._aes.encrypt(this._shiftRegister);for(var a=0;a<this.segmentSize;a++)r[n+a]^=t[a];o(this._shiftRegister,this._shiftRegister,0,this.segmentSize),o(e,this._shiftRegister,16-this.segmentSize,n,n+this.segmentSize)}return r};var T=function(e,t){if(!(this instanceof T))throw Error("AES must be instanitated with `new`");if(this.description="Output Feedback",this.name="ofb",t){if(16!=t.length)throw new Error("invalid initialation vector size (must be 16 bytes)")}else t=a(16);this._lastPrecipher=i(t,!0),this._lastPrecipherIndex=16,this._aes=new N(e)};T.prototype.encrypt=function(e){for(var t=i(e,!0),r=0;r<t.length;r++)16===this._lastPrecipherIndex&&(this._lastPrecipher=this._aes.encrypt(this._lastPrecipher),this._lastPrecipherIndex=0),t[r]^=this._lastPrecipher[this._lastPrecipherIndex++];return t},T.prototype.decrypt=T.prototype.encrypt;var M=function(e){if(!(this instanceof M))throw Error("Counter must be instanitated with `new`");0===e||e||(e=1),"number"==typeof e?(this._counter=a(16),this.setValue(e)):this.setBytes(e)};M.prototype.setValue=function(e){if("number"!=typeof e||parseInt(e)!=e)throw new Error("invalid counter value (must be an integer)");if(e>Number.MAX_SAFE_INTEGER)throw new Error("integer value out of safe range");for(var t=15;t>=0;--t)this._counter[t]=e%256,e=parseInt(e/256)},M.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},M.prototype.increment=function(){for(var e=15;e>=0;e--){if(255!==this._counter[e]){this._counter[e]++;break}this._counter[e]=0}};var R=function(e,t){if(!(this instanceof R))throw Error("AES must be instanitated with `new`");this.description="Counter",this.name="ctr",t instanceof M||(t=new M(t)),this._counter=t,this._remainingCounter=null,this._remainingCounterIndex=16,this._aes=new N(e)};R.prototype.encrypt=function(e){for(var t=i(e,!0),r=0;r<t.length;r++)16===this._remainingCounterIndex&&(this._remainingCounter=this._aes.encrypt(this._counter._counter),this._remainingCounterIndex=0,this._counter.increment()),t[r]^=this._remainingCounter[this._remainingCounterIndex++];return t},R.prototype.decrypt=R.prototype.encrypt;var k={AES:N,Counter:M,ModeOfOperation:{ecb:S,cbc:x,cfb:_,ofb:T,ctr:R},utils:{hex:A,utf8:c},padding:{pkcs7:{pad:function(e){var t=16-(e=i(e,!0)).length%16,r=a(e.length+t);o(e,r);for(var n=e.length;n<r.length;n++)r[n]=t;return r},strip:function(e){if((e=i(e,!0)).length<16)throw new Error("PKCS#7 invalid length");var t=e[e.length-1];if(t>16)throw new Error("PKCS#7 padding byte out of range");for(var r=e.length-t,n=0;n<t;n++)if(e[r+n]!==t)throw new Error("PKCS#7 invalid padding byte");var s=a(r);return o(e,s,0,0,r),s}}},_arrayTest:{coerceArray:i,createArray:a,copyArray:o}};e.exports=k}()},8162:function(e){"use strict";e.exports=function(e){if(e.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),r=0;r<t.length;r++)t[r]=255;for(var n=0;n<e.length;n++){var i=e.charAt(n),a=i.charCodeAt(0);if(255!==t[a])throw new TypeError(i+" is ambiguous");t[a]=n}var o=e.length,s=e.charAt(0),c=Math.log(o)/Math.log(256),A=Math.log(256)/Math.log(o);function u(e){if("string"!=typeof e)throw new TypeError("Expected String");if(0===e.length)return new Uint8Array;for(var r=0,n=0,i=0;e[r]===s;)n++,r++;for(var a=(e.length-r)*c+1>>>0,A=new Uint8Array(a);e[r];){var u=t[e.charCodeAt(r)];if(255===u)return;for(var l=0,d=a-1;(0!==u||l<i)&&-1!==d;d--,l++)u+=o*A[d]>>>0,A[d]=u%256>>>0,u=u/256>>>0;if(0!==u)throw new Error("Non-zero carry");i=l,r++}for(var p=a-i;p!==a&&0===A[p];)p++;for(var h=new Uint8Array(n+(a-p)),f=n;p!==a;)h[f++]=A[p++];return h}return{encode:function(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(0===t.length)return"";for(var r=0,n=0,i=0,a=t.length;i!==a&&0===t[i];)i++,r++;for(var c=(a-i)*A+1>>>0,u=new Uint8Array(c);i!==a;){for(var l=t[i],d=0,p=c-1;(0!==l||d<n)&&-1!==p;p--,d++)l+=256*u[p]>>>0,u[p]=l%o>>>0,l=l/o>>>0;if(0!==l)throw new Error("Non-zero carry");n=d,i++}for(var h=c-n;h!==c&&0===u[h];)h++;for(var f=s.repeat(r);h<c;++h)f+=e.charAt(u[h]);return f},decodeUnsafe:u,decode:function(e){var t=u(e);if(t)return t;throw new Error("Non-base"+o+" character")}}}},9742:function(e,t){"use strict";t.byteLength=function(e){var t=c(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,a=c(e),o=a[0],s=a[1],A=new i(function(e,t,r){return 3*(t+r)/4-r}(0,o,s)),u=0,l=s>0?o-4:o;for(r=0;r<l;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],A[u++]=t>>16&255,A[u++]=t>>8&255,A[u++]=255&t;return 2===s&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,A[u++]=255&t),1===s&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,A[u++]=t>>8&255,A[u++]=255&t),A},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,a=[],o=16383,s=0,c=n-i;s<c;s+=o)a.push(A(e,s,s+o>c?c:s+o));return 1===i?(t=e[n-1],a.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],a.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),a.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,s=a.length;o<s;++o)r[o]=a[o],n[a.charCodeAt(o)]=o;function c(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function A(e,t,n){for(var i,a,o=[],s=t;s<n;s+=3)i=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),o.push(r[(a=i)>>18&63]+r[a>>12&63]+r[a>>6&63]+r[63&a]);return o.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},4431:function(e,t,r){var n;!function(i){"use strict";var a,o=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,s=Math.ceil,c=Math.floor,A="[BigNumber Error] ",u=A+"Number primitive has more than 15 significant digits: ",l=1e14,d=14,p=9007199254740991,h=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],f=1e7,g=1e9;function m(e){var t=0|e;return e>0||e===t?t:t-1}function y(e){for(var t,r,n=1,i=e.length,a=e[0]+"";n<i;){for(t=e[n++]+"",r=d-t.length;r--;t="0"+t);a+=t}for(i=a.length;48===a.charCodeAt(--i););return a.slice(0,i+1||1)}function I(e,t){var r,n,i=e.c,a=t.c,o=e.s,s=t.s,c=e.e,A=t.e;if(!o||!s)return null;if(r=i&&!i[0],n=a&&!a[0],r||n)return r?n?0:-s:o;if(o!=s)return o;if(r=o<0,n=c==A,!i||!a)return n?0:!i^r?1:-1;if(!n)return c>A^r?1:-1;for(s=(c=i.length)<(A=a.length)?c:A,o=0;o<s;o++)if(i[o]!=a[o])return i[o]>a[o]^r?1:-1;return c==A?0:c>A^r?1:-1}function C(e,t,r,n){if(e<t||e>r||e!==c(e))throw Error(A+(n||"Argument")+("number"==typeof e?e<t||e>r?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function E(e){var t=e.c.length-1;return m(e.e/d)==t&&e.c[t]%2!=0}function B(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function w(e,t,r){var n,i;if(t<0){for(i=r+".";++t;i+=r);e=i+e}else if(++t>(n=e.length)){for(i=r,t-=n;--t;i+=r);e+=i}else t<n&&(e=e.slice(0,t)+"."+e.slice(t));return e}a=function e(t){var r,n,i,a,v,Q,b,N,S,x,_=H.prototype={constructor:H,toString:null,valueOf:null},T=new H(1),M=20,R=4,k=-7,D=21,z=-1e7,O=1e7,U=!1,F=1,P=0,q={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},G="0123456789abcdefghijklmnopqrstuvwxyz",L=!0;function H(e,t){var r,a,s,A,l,h,f,g,m=this;if(!(m instanceof H))return new H(e,t);if(null==t){if(e&&!0===e._isBigNumber)return m.s=e.s,void(!e.c||e.e>O?m.c=m.e=null:e.e<z?m.c=[m.e=0]:(m.e=e.e,m.c=e.c.slice()));if((h="number"==typeof e)&&0*e==0){if(m.s=1/e<0?(e=-e,-1):1,e===~~e){for(A=0,l=e;l>=10;l/=10,A++);return void(A>O?m.c=m.e=null:(m.e=A,m.c=[e]))}g=String(e)}else{if(!o.test(g=String(e)))return i(m,g,h);m.s=45==g.charCodeAt(0)?(g=g.slice(1),-1):1}(A=g.indexOf("."))>-1&&(g=g.replace(".","")),(l=g.search(/e/i))>0?(A<0&&(A=l),A+=+g.slice(l+1),g=g.substring(0,l)):A<0&&(A=g.length)}else{if(C(t,2,G.length,"Base"),10==t&&L)return V(m=new H(e),M+m.e+1,R);if(g=String(e),h="number"==typeof e){if(0*e!=0)return i(m,g,h,t);if(m.s=1/e<0?(g=g.slice(1),-1):1,H.DEBUG&&g.replace(/^0\.0*|\./,"").length>15)throw Error(u+e)}else m.s=45===g.charCodeAt(0)?(g=g.slice(1),-1):1;for(r=G.slice(0,t),A=l=0,f=g.length;l<f;l++)if(r.indexOf(a=g.charAt(l))<0){if("."==a){if(l>A){A=f;continue}}else if(!s&&(g==g.toUpperCase()&&(g=g.toLowerCase())||g==g.toLowerCase()&&(g=g.toUpperCase()))){s=!0,l=-1,A=0;continue}return i(m,String(e),h,t)}h=!1,(A=(g=n(g,t,10,m.s)).indexOf("."))>-1?g=g.replace(".",""):A=g.length}for(l=0;48===g.charCodeAt(l);l++);for(f=g.length;48===g.charCodeAt(--f););if(g=g.slice(l,++f)){if(f-=l,h&&H.DEBUG&&f>15&&(e>p||e!==c(e)))throw Error(u+m.s*e);if((A=A-l-1)>O)m.c=m.e=null;else if(A<z)m.c=[m.e=0];else{if(m.e=A,m.c=[],l=(A+1)%d,A<0&&(l+=d),l<f){for(l&&m.c.push(+g.slice(0,l)),f-=d;l<f;)m.c.push(+g.slice(l,l+=d));l=d-(g=g.slice(l)).length}else l-=f;for(;l--;g+="0");m.c.push(+g)}}else m.c=[m.e=0]}function j(e,t,r,n){var i,a,o,s,c;if(null==r?r=R:C(r,0,8),!e.c)return e.toString();if(i=e.c[0],o=e.e,null==t)c=y(e.c),c=1==n||2==n&&(o<=k||o>=D)?B(c,o):w(c,o,"0");else if(a=(e=V(new H(e),t,r)).e,s=(c=y(e.c)).length,1==n||2==n&&(t<=a||a<=k)){for(;s<t;c+="0",s++);c=B(c,a)}else if(t-=o,c=w(c,a,"0"),a+1>s){if(--t>0)for(c+=".";t--;c+="0");}else if((t+=a-s)>0)for(a+1==s&&(c+=".");t--;c+="0");return e.s<0&&i?"-"+c:c}function Y(e,t){for(var r,n=1,i=new H(e[0]);n<e.length;n++){if(!(r=new H(e[n])).s){i=r;break}t.call(i,r)&&(i=r)}return i}function K(e,t,r){for(var n=1,i=t.length;!t[--i];t.pop());for(i=t[0];i>=10;i/=10,n++);return(r=n+r*d-1)>O?e.c=e.e=null:r<z?e.c=[e.e=0]:(e.e=r,e.c=t),e}function V(e,t,r,n){var i,a,o,A,u,p,f,g=e.c,m=h;if(g){e:{for(i=1,A=g[0];A>=10;A/=10,i++);if((a=t-i)<0)a+=d,o=t,f=(u=g[p=0])/m[i-o-1]%10|0;else if((p=s((a+1)/d))>=g.length){if(!n)break e;for(;g.length<=p;g.push(0));u=f=0,i=1,o=(a%=d)-d+1}else{for(u=A=g[p],i=1;A>=10;A/=10,i++);f=(o=(a%=d)-d+i)<0?0:u/m[i-o-1]%10|0}if(n=n||t<0||null!=g[p+1]||(o<0?u:u%m[i-o-1]),n=r<4?(f||n)&&(0==r||r==(e.s<0?3:2)):f>5||5==f&&(4==r||n||6==r&&(a>0?o>0?u/m[i-o]:0:g[p-1])%10&1||r==(e.s<0?8:7)),t<1||!g[0])return g.length=0,n?(t-=e.e+1,g[0]=m[(d-t%d)%d],e.e=-t||0):g[0]=e.e=0,e;if(0==a?(g.length=p,A=1,p--):(g.length=p+1,A=m[d-a],g[p]=o>0?c(u/m[i-o]%m[o])*A:0),n)for(;;){if(0==p){for(a=1,o=g[0];o>=10;o/=10,a++);for(o=g[0]+=A,A=1;o>=10;o/=10,A++);a!=A&&(e.e++,g[0]==l&&(g[0]=1));break}if(g[p]+=A,g[p]!=l)break;g[p--]=0,A=1}for(a=g.length;0===g[--a];g.pop());}e.e>O?e.c=e.e=null:e.e<z&&(e.c=[e.e=0])}return e}function $(e){var t,r=e.e;return null===r?e.toString():(t=y(e.c),t=r<=k||r>=D?B(t,r):w(t,r,"0"),e.s<0?"-"+t:t)}return H.clone=e,H.ROUND_UP=0,H.ROUND_DOWN=1,H.ROUND_CEIL=2,H.ROUND_FLOOR=3,H.ROUND_HALF_UP=4,H.ROUND_HALF_DOWN=5,H.ROUND_HALF_EVEN=6,H.ROUND_HALF_CEIL=7,H.ROUND_HALF_FLOOR=8,H.EUCLID=9,H.config=H.set=function(e){var t,r;if(null!=e){if("object"!=typeof e)throw Error(A+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(C(r=e[t],0,g,t),M=r),e.hasOwnProperty(t="ROUNDING_MODE")&&(C(r=e[t],0,8,t),R=r),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((r=e[t])&&r.pop?(C(r[0],-g,0,t),C(r[1],0,g,t),k=r[0],D=r[1]):(C(r,-g,g,t),k=-(D=r<0?-r:r))),e.hasOwnProperty(t="RANGE"))if((r=e[t])&&r.pop)C(r[0],-g,-1,t),C(r[1],1,g,t),z=r[0],O=r[1];else{if(C(r,-g,g,t),!r)throw Error(A+t+" cannot be zero: "+r);z=-(O=r<0?-r:r)}if(e.hasOwnProperty(t="CRYPTO")){if((r=e[t])!==!!r)throw Error(A+t+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw U=!r,Error(A+"crypto unavailable");U=r}else U=r}if(e.hasOwnProperty(t="MODULO_MODE")&&(C(r=e[t],0,9,t),F=r),e.hasOwnProperty(t="POW_PRECISION")&&(C(r=e[t],0,g,t),P=r),e.hasOwnProperty(t="FORMAT")){if("object"!=typeof(r=e[t]))throw Error(A+t+" not an object: "+r);q=r}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(r=e[t])||/^.?$|[+\-.\s]|(.).*\1/.test(r))throw Error(A+t+" invalid: "+r);L="0123456789"==r.slice(0,10),G=r}}return{DECIMAL_PLACES:M,ROUNDING_MODE:R,EXPONENTIAL_AT:[k,D],RANGE:[z,O],CRYPTO:U,MODULO_MODE:F,POW_PRECISION:P,FORMAT:q,ALPHABET:G}},H.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!H.DEBUG)return!0;var t,r,n=e.c,i=e.e,a=e.s;e:if("[object Array]"=={}.toString.call(n)){if((1===a||-1===a)&&i>=-g&&i<=g&&i===c(i)){if(0===n[0]){if(0===i&&1===n.length)return!0;break e}if((t=(i+1)%d)<1&&(t+=d),String(n[0]).length==t){for(t=0;t<n.length;t++)if((r=n[t])<0||r>=l||r!==c(r))break e;if(0!==r)return!0}}}else if(null===n&&null===i&&(null===a||1===a||-1===a))return!0;throw Error(A+"Invalid BigNumber: "+e)},H.maximum=H.max=function(){return Y(arguments,_.lt)},H.minimum=H.min=function(){return Y(arguments,_.gt)},H.random=(a=9007199254740992,v=Math.random()*a&2097151?function(){return c(Math.random()*a)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,r,n,i,a,o=0,u=[],l=new H(T);if(null==e?e=M:C(e,0,g),i=s(e/d),U)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(i*=2));o<i;)(a=131072*t[o]+(t[o+1]>>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),t[o]=r[0],t[o+1]=r[1]):(u.push(a%1e14),o+=2);o=i/2}else{if(!crypto.randomBytes)throw U=!1,Error(A+"crypto unavailable");for(t=crypto.randomBytes(i*=7);o<i;)(a=281474976710656*(31&t[o])+1099511627776*t[o+1]+4294967296*t[o+2]+16777216*t[o+3]+(t[o+4]<<16)+(t[o+5]<<8)+t[o+6])>=9e15?crypto.randomBytes(7).copy(t,o):(u.push(a%1e14),o+=7);o=i/7}if(!U)for(;o<i;)(a=v())<9e15&&(u[o++]=a%1e14);for(i=u[--o],e%=d,i&&e&&(a=h[d-e],u[o]=c(i/a)*a);0===u[o];u.pop(),o--);if(o<0)u=[n=0];else{for(n=-1;0===u[0];u.splice(0,1),n-=d);for(o=1,a=u[0];a>=10;a/=10,o++);o<d&&(n-=d-o)}return l.e=n,l.c=u,l}),H.sum=function(){for(var e=1,t=arguments,r=new H(t[0]);e<t.length;)r=r.plus(t[e++]);return r},n=function(){var e="0123456789";function t(e,t,r,n){for(var i,a,o=[0],s=0,c=e.length;s<c;){for(a=o.length;a--;o[a]*=t);for(o[0]+=n.indexOf(e.charAt(s++)),i=0;i<o.length;i++)o[i]>r-1&&(null==o[i+1]&&(o[i+1]=0),o[i+1]+=o[i]/r|0,o[i]%=r)}return o.reverse()}return function(n,i,a,o,s){var c,A,u,l,d,p,h,f,g=n.indexOf("."),m=M,I=R;for(g>=0&&(l=P,P=0,n=n.replace(".",""),p=(f=new H(i)).pow(n.length-g),P=l,f.c=t(w(y(p.c),p.e,"0"),10,a,e),f.e=f.c.length),u=l=(h=t(n,i,a,s?(c=G,e):(c=e,G))).length;0==h[--l];h.pop());if(!h[0])return c.charAt(0);if(g<0?--u:(p.c=h,p.e=u,p.s=o,h=(p=r(p,f,m,I,a)).c,d=p.r,u=p.e),g=h[A=u+m+1],l=a/2,d=d||A<0||null!=h[A+1],d=I<4?(null!=g||d)&&(0==I||I==(p.s<0?3:2)):g>l||g==l&&(4==I||d||6==I&&1&h[A-1]||I==(p.s<0?8:7)),A<1||!h[0])n=d?w(c.charAt(1),-m,c.charAt(0)):c.charAt(0);else{if(h.length=A,d)for(--a;++h[--A]>a;)h[A]=0,A||(++u,h=[1].concat(h));for(l=h.length;!h[--l];);for(g=0,n="";g<=l;n+=c.charAt(h[g++]));n=w(n,u,c.charAt(0))}return n}}(),r=function(){function e(e,t,r){var n,i,a,o,s=0,c=e.length,A=t%f,u=t/f|0;for(e=e.slice();c--;)s=((i=A*(a=e[c]%f)+(n=u*a+(o=e[c]/f|0)*A)%f*f+s)/r|0)+(n/f|0)+u*o,e[c]=i%r;return s&&(e=[s].concat(e)),e}function t(e,t,r,n){var i,a;if(r!=n)a=r>n?1:-1;else for(i=a=0;i<r;i++)if(e[i]!=t[i]){a=e[i]>t[i]?1:-1;break}return a}function r(e,t,r,n){for(var i=0;r--;)e[r]-=i,i=e[r]<t[r]?1:0,e[r]=i*n+e[r]-t[r];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(n,i,a,o,s){var A,u,p,h,f,g,y,I,C,E,B,w,v,Q,b,N,S,x=n.s==i.s?1:-1,_=n.c,T=i.c;if(!(_&&_[0]&&T&&T[0]))return new H(n.s&&i.s&&(_?!T||_[0]!=T[0]:T)?_&&0==_[0]||!T?0*x:x/0:NaN);for(C=(I=new H(x)).c=[],x=a+(u=n.e-i.e)+1,s||(s=l,u=m(n.e/d)-m(i.e/d),x=x/d|0),p=0;T[p]==(_[p]||0);p++);if(T[p]>(_[p]||0)&&u--,x<0)C.push(1),h=!0;else{for(Q=_.length,N=T.length,p=0,x+=2,(f=c(s/(T[0]+1)))>1&&(T=e(T,f,s),_=e(_,f,s),N=T.length,Q=_.length),v=N,B=(E=_.slice(0,N)).length;B<N;E[B++]=0);S=T.slice(),S=[0].concat(S),b=T[0],T[1]>=s/2&&b++;do{if(f=0,(A=t(T,E,N,B))<0){if(w=E[0],N!=B&&(w=w*s+(E[1]||0)),(f=c(w/b))>1)for(f>=s&&(f=s-1),y=(g=e(T,f,s)).length,B=E.length;1==t(g,E,y,B);)f--,r(g,N<y?S:T,y,s),y=g.length,A=1;else 0==f&&(A=f=1),y=(g=T.slice()).length;if(y<B&&(g=[0].concat(g)),r(E,g,B,s),B=E.length,-1==A)for(;t(T,E,N,B)<1;)f++,r(E,N<B?S:T,B,s),B=E.length}else 0===A&&(f++,E=[0]);C[p++]=f,E[0]?E[B++]=_[v]||0:(E=[_[v]],B=1)}while((v++<Q||null!=E[0])&&x--);h=null!=E[0],C[0]||C.splice(0,1)}if(s==l){for(p=1,x=C[0];x>=10;x/=10,p++);V(I,a+(I.e=p+u*d-1)+1,o,h)}else I.e=u,I.r=+h;return I}}(),Q=/^(-?)0([xbo])(?=\w[\w.]*$)/i,b=/^([^.]+)\.$/,N=/^\.([^.]+)$/,S=/^-?(Infinity|NaN)$/,x=/^\s*\+(?=[\w.])|^\s+|\s+$/g,i=function(e,t,r,n){var i,a=r?t:t.replace(x,"");if(S.test(a))e.s=isNaN(a)?null:a<0?-1:1;else{if(!r&&(a=a.replace(Q,(function(e,t,r){return i="x"==(r=r.toLowerCase())?16:"b"==r?2:8,n&&n!=i?e:t})),n&&(i=n,a=a.replace(b,"$1").replace(N,"0.$1")),t!=a))return new H(a,i);if(H.DEBUG)throw Error(A+"Not a"+(n?" base "+n:"")+" number: "+t);e.s=null}e.c=e.e=null},_.absoluteValue=_.abs=function(){var e=new H(this);return e.s<0&&(e.s=1),e},_.comparedTo=function(e,t){return I(this,new H(e,t))},_.decimalPlaces=_.dp=function(e,t){var r,n,i,a=this;if(null!=e)return C(e,0,g),null==t?t=R:C(t,0,8),V(new H(a),e+a.e+1,t);if(!(r=a.c))return null;if(n=((i=r.length-1)-m(this.e/d))*d,i=r[i])for(;i%10==0;i/=10,n--);return n<0&&(n=0),n},_.dividedBy=_.div=function(e,t){return r(this,new H(e,t),M,R)},_.dividedToIntegerBy=_.idiv=function(e,t){return r(this,new H(e,t),0,1)},_.exponentiatedBy=_.pow=function(e,t){var r,n,i,a,o,u,l,p,h=this;if((e=new H(e)).c&&!e.isInteger())throw Error(A+"Exponent not an integer: "+$(e));if(null!=t&&(t=new H(t)),o=e.e>14,!h.c||!h.c[0]||1==h.c[0]&&!h.e&&1==h.c.length||!e.c||!e.c[0])return p=new H(Math.pow(+$(h),o?2-E(e):+$(e))),t?p.mod(t):p;if(u=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new H(NaN);(n=!u&&h.isInteger()&&t.isInteger())&&(h=h.mod(t))}else{if(e.e>9&&(h.e>0||h.e<-1||(0==h.e?h.c[0]>1||o&&h.c[1]>=24e7:h.c[0]<8e13||o&&h.c[0]<=9999975e7)))return a=h.s<0&&E(e)?-0:0,h.e>-1&&(a=1/a),new H(u?1/a:a);P&&(a=s(P/d+2))}for(o?(r=new H(.5),u&&(e.s=1),l=E(e)):l=(i=Math.abs(+$(e)))%2,p=new H(T);;){if(l){if(!(p=p.times(h)).c)break;a?p.c.length>a&&(p.c.length=a):n&&(p=p.mod(t))}if(i){if(0===(i=c(i/2)))break;l=i%2}else if(V(e=e.times(r),e.e+1,1),e.e>14)l=E(e);else{if(0==(i=+$(e)))break;l=i%2}h=h.times(h),a?h.c&&h.c.length>a&&(h.c.length=a):n&&(h=h.mod(t))}return n?p:(u&&(p=T.div(p)),t?p.mod(t):a?V(p,P,R,void 0):p)},_.integerValue=function(e){var t=new H(this);return null==e?e=R:C(e,0,8),V(t,t.e+1,e)},_.isEqualTo=_.eq=function(e,t){return 0===I(this,new H(e,t))},_.isFinite=function(){return!!this.c},_.isGreaterThan=_.gt=function(e,t){return I(this,new H(e,t))>0},_.isGreaterThanOrEqualTo=_.gte=function(e,t){return 1===(t=I(this,new H(e,t)))||0===t},_.isInteger=function(){return!!this.c&&m(this.e/d)>this.c.length-2},_.isLessThan=_.lt=function(e,t){return I(this,new H(e,t))<0},_.isLessThanOrEqualTo=_.lte=function(e,t){return-1===(t=I(this,new H(e,t)))||0===t},_.isNaN=function(){return!this.s},_.isNegative=function(){return this.s<0},_.isPositive=function(){return this.s>0},_.isZero=function(){return!!this.c&&0==this.c[0]},_.minus=function(e,t){var r,n,i,a,o=this,s=o.s;if(t=(e=new H(e,t)).s,!s||!t)return new H(NaN);if(s!=t)return e.s=-t,o.plus(e);var c=o.e/d,A=e.e/d,u=o.c,p=e.c;if(!c||!A){if(!u||!p)return u?(e.s=-t,e):new H(p?o:NaN);if(!u[0]||!p[0])return p[0]?(e.s=-t,e):new H(u[0]?o:3==R?-0:0)}if(c=m(c),A=m(A),u=u.slice(),s=c-A){for((a=s<0)?(s=-s,i=u):(A=c,i=p),i.reverse(),t=s;t--;i.push(0));i.reverse()}else for(n=(a=(s=u.length)<(t=p.length))?s:t,s=t=0;t<n;t++)if(u[t]!=p[t]){a=u[t]<p[t];break}if(a&&(i=u,u=p,p=i,e.s=-e.s),(t=(n=p.length)-(r=u.length))>0)for(;t--;u[r++]=0);for(t=l-1;n>s;){if(u[--n]<p[n]){for(r=n;r&&!u[--r];u[r]=t);--u[r],u[n]+=l}u[n]-=p[n]}for(;0==u[0];u.splice(0,1),--A);return u[0]?K(e,u,A):(e.s=3==R?-1:1,e.c=[e.e=0],e)},_.modulo=_.mod=function(e,t){var n,i,a=this;return e=new H(e,t),!a.c||!e.s||e.c&&!e.c[0]?new H(NaN):!e.c||a.c&&!a.c[0]?new H(a):(9==F?(i=e.s,e.s=1,n=r(a,e,0,3),e.s=i,n.s*=i):n=r(a,e,0,F),(e=a.minus(n.times(e))).c[0]||1!=F||(e.s=a.s),e)},_.multipliedBy=_.times=function(e,t){var r,n,i,a,o,s,c,A,u,p,h,g,y,I,C,E=this,B=E.c,w=(e=new H(e,t)).c;if(!(B&&w&&B[0]&&w[0]))return!E.s||!e.s||B&&!B[0]&&!w||w&&!w[0]&&!B?e.c=e.e=e.s=null:(e.s*=E.s,B&&w?(e.c=[0],e.e=0):e.c=e.e=null),e;for(n=m(E.e/d)+m(e.e/d),e.s*=E.s,(c=B.length)<(p=w.length)&&(y=B,B=w,w=y,i=c,c=p,p=i),i=c+p,y=[];i--;y.push(0));for(I=l,C=f,i=p;--i>=0;){for(r=0,h=w[i]%C,g=w[i]/C|0,a=i+(o=c);a>i;)r=((A=h*(A=B[--o]%C)+(s=g*A+(u=B[o]/C|0)*h)%C*C+y[a]+r)/I|0)+(s/C|0)+g*u,y[a--]=A%I;y[a]=r}return r?++n:y.splice(0,1),K(e,y,n)},_.negated=function(){var e=new H(this);return e.s=-e.s||null,e},_.plus=function(e,t){var r,n=this,i=n.s;if(t=(e=new H(e,t)).s,!i||!t)return new H(NaN);if(i!=t)return e.s=-t,n.minus(e);var a=n.e/d,o=e.e/d,s=n.c,c=e.c;if(!a||!o){if(!s||!c)return new H(i/0);if(!s[0]||!c[0])return c[0]?e:new H(s[0]?n:0*i)}if(a=m(a),o=m(o),s=s.slice(),i=a-o){for(i>0?(o=a,r=c):(i=-i,r=s),r.reverse();i--;r.push(0));r.reverse()}for((i=s.length)-(t=c.length)<0&&(r=c,c=s,s=r,t=i),i=0;t;)i=(s[--t]=s[t]+c[t]+i)/l|0,s[t]=l===s[t]?0:s[t]%l;return i&&(s=[i].concat(s),++o),K(e,s,o)},_.precision=_.sd=function(e,t){var r,n,i,a=this;if(null!=e&&e!==!!e)return C(e,1,g),null==t?t=R:C(t,0,8),V(new H(a),e,t);if(!(r=a.c))return null;if(n=(i=r.length-1)*d+1,i=r[i]){for(;i%10==0;i/=10,n--);for(i=r[0];i>=10;i/=10,n++);}return e&&a.e+1>n&&(n=a.e+1),n},_.shiftedBy=function(e){return C(e,-9007199254740991,p),this.times("1e"+e)},_.squareRoot=_.sqrt=function(){var e,t,n,i,a,o=this,s=o.c,c=o.s,A=o.e,u=M+4,l=new H("0.5");if(1!==c||!s||!s[0])return new H(!c||c<0&&(!s||s[0])?NaN:s?o:1/0);if(0==(c=Math.sqrt(+$(o)))||c==1/0?(((t=y(s)).length+A)%2==0&&(t+="0"),c=Math.sqrt(+t),A=m((A+1)/2)-(A<0||A%2),n=new H(t=c==1/0?"5e"+A:(t=c.toExponential()).slice(0,t.indexOf("e")+1)+A)):n=new H(c+""),n.c[0])for((c=(A=n.e)+u)<3&&(c=0);;)if(a=n,n=l.times(a.plus(r(o,a,u,1))),y(a.c).slice(0,c)===(t=y(n.c)).slice(0,c)){if(n.e<A&&--c,"9999"!=(t=t.slice(c-3,c+1))&&(i||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(V(n,n.e+M+2,1),e=!n.times(n).eq(o));break}if(!i&&(V(a,a.e+M+2,0),a.times(a).eq(o))){n=a;break}u+=4,c+=4,i=1}return V(n,n.e+M+1,R,e)},_.toExponential=function(e,t){return null!=e&&(C(e,0,g),e++),j(this,e,t,1)},_.toFixed=function(e,t){return null!=e&&(C(e,0,g),e=e+this.e+1),j(this,e,t)},_.toFormat=function(e,t,r){var n,i=this;if(null==r)null!=e&&t&&"object"==typeof t?(r=t,t=null):e&&"object"==typeof e?(r=e,e=t=null):r=q;else if("object"!=typeof r)throw Error(A+"Argument not an object: "+r);if(n=i.toFixed(e,t),i.c){var a,o=n.split("."),s=+r.groupSize,c=+r.secondaryGroupSize,u=r.groupSeparator||"",l=o[0],d=o[1],p=i.s<0,h=p?l.slice(1):l,f=h.length;if(c&&(a=s,s=c,c=a,f-=a),s>0&&f>0){for(a=f%s||s,l=h.substr(0,a);a<f;a+=s)l+=u+h.substr(a,s);c>0&&(l+=u+h.slice(a)),p&&(l="-"+l)}n=d?l+(r.decimalSeparator||"")+((c=+r.fractionGroupSize)?d.replace(new RegExp("\\d{"+c+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):d):l}return(r.prefix||"")+n+(r.suffix||"")},_.toFraction=function(e){var t,n,i,a,o,s,c,u,l,p,f,g,m=this,I=m.c;if(null!=e&&(!(c=new H(e)).isInteger()&&(c.c||1!==c.s)||c.lt(T)))throw Error(A+"Argument "+(c.isInteger()?"out of range: ":"not an integer: ")+$(c));if(!I)return new H(m);for(t=new H(T),l=n=new H(T),i=u=new H(T),g=y(I),o=t.e=g.length-m.e-1,t.c[0]=h[(s=o%d)<0?d+s:s],e=!e||c.comparedTo(t)>0?o>0?t:l:c,s=O,O=1/0,c=new H(g),u.c[0]=0;p=r(c,t,0,1),1!=(a=n.plus(p.times(i))).comparedTo(e);)n=i,i=a,l=u.plus(p.times(a=l)),u=a,t=c.minus(p.times(a=t)),c=a;return a=r(e.minus(n),i,0,1),u=u.plus(a.times(l)),n=n.plus(a.times(i)),u.s=l.s=m.s,f=r(l,i,o*=2,R).minus(m).abs().comparedTo(r(u,n,o,R).minus(m).abs())<1?[l,i]:[u,n],O=s,f},_.toNumber=function(){return+$(this)},_.toPrecision=function(e,t){return null!=e&&C(e,1,g),j(this,e,t,2)},_.toString=function(e){var t,r=this,i=r.s,a=r.e;return null===a?i?(t="Infinity",i<0&&(t="-"+t)):t="NaN":(null==e?t=a<=k||a>=D?B(y(r.c),a):w(y(r.c),a,"0"):10===e&&L?t=w(y((r=V(new H(r),M+a+1,R)).c),r.e,"0"):(C(e,2,G.length,"Base"),t=n(w(y(r.c),a,"0"),10,e,i,!0)),i<0&&r.c[0]&&(t="-"+t)),t},_.valueOf=_.toJSON=function(){return $(this)},_._isBigNumber=!0,null!=t&&H.set(t),H}(),a.default=a.BigNumber=a,void 0===(n=function(){return a}.call(t,r,t,e))||(e.exports=n)}()},246:function(e){const t=2147483648;var r=function(e){if(!Array.isArray(e))throw new Error("Input must be an Array");if(0===e.length)throw new Error("Path must contain at least one level");for(var t=0;t<e.length;t++)if("number"!=typeof e[t])throw new Error("Path element is not a number");this.path=e};r.validatePathArray=function(e){try{return r.fromPathArray(e),!0}catch(e){return!1}},r.validateString=function(e,t){try{return r.fromString(e,t),!0}catch(e){return!1}},r.fromPathArray=function(e){return new r(e)},r.fromString=function(e,n){if(/^m\//i.test(e))e=e.slice(2);else if(n)throw new Error("Root element is required");for(var i=e.split("/"),a=new Array(i.length),o=0;o<i.length;o++){var s=/(\d+)([hH\']?)/.exec(i[o]);if(null===s)throw new Error("Invalid input");if(a[o]=parseInt(s[1],10),a[o]>=t)throw new Error("Invalid child index");if("h"===s[2]||"H"===s[2]||"'"===s[2])a[o]+=t;else if(0!=s[2].length)throw new Error("Invalid modifier")}return new r(a)},r.prototype.toPathArray=function(){return this.path},r.prototype.toString=function(e,r){for(var n=new Array(this.path.length),i=0;i<this.path.length;i++){var a=this.path[i];n[i]=a&t?(a&~t)+(r?"h":"'"):a}return(e?"":"m/")+n.join("/")},r.prototype.inspect=function(){return"BIPPath <"+this.toString()+">"},e.exports=r},8442:function(e,t,r){const n=r(9488);function i(e,t,r){const n=e[t]+e[r];let i=e[t+1]+e[r+1];n>=4294967296&&i++,e[t]=n,e[t+1]=i}function a(e,t,r,n){let i=e[t]+r;r<0&&(i+=4294967296);let a=e[t+1]+n;i>=4294967296&&a++,e[t]=i,e[t+1]=a}function o(e,t){return e[t]^e[t+1]<<8^e[t+2]<<16^e[t+3]<<24}function s(e,t,r,n,o,s){const c=l[o],A=l[o+1],d=l[s],p=l[s+1];i(u,e,t),a(u,e,c,A);let h=u[n]^u[e],f=u[n+1]^u[e+1];u[n]=f,u[n+1]=h,i(u,r,n),h=u[t]^u[r],f=u[t+1]^u[r+1],u[t]=h>>>24^f<<8,u[t+1]=f>>>24^h<<8,i(u,e,t),a(u,e,d,p),h=u[n]^u[e],f=u[n+1]^u[e+1],u[n]=h>>>16^f<<16,u[n+1]=f>>>16^h<<16,i(u,r,n),h=u[t]^u[r],f=u[t+1]^u[r+1],u[t]=f>>>31^h<<1,u[t+1]=h>>>31^f<<1}const c=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),A=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3].map((function(e){return 2*e}))),u=new Uint32Array(32),l=new Uint32Array(32);function d(e,t){let r=0;for(r=0;r<16;r++)u[r]=e.h[r],u[r+16]=c[r];for(u[24]=u[24]^e.t,u[25]=u[25]^e.t/4294967296,t&&(u[28]=~u[28],u[29]=~u[29]),r=0;r<32;r++)l[r]=o(e.b,4*r);for(r=0;r<12;r++)s(0,8,16,24,A[16*r+0],A[16*r+1]),s(2,10,18,26,A[16*r+2],A[16*r+3]),s(4,12,20,28,A[16*r+4],A[16*r+5]),s(6,14,22,30,A[16*r+6],A[16*r+7]),s(0,10,20,30,A[16*r+8],A[16*r+9]),s(2,12,22,24,A[16*r+10],A[16*r+11]),s(4,14,16,26,A[16*r+12],A[16*r+13]),s(6,8,18,28,A[16*r+14],A[16*r+15]);for(r=0;r<16;r++)e.h[r]=e.h[r]^u[r]^u[r+16]}const p=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);function h(e,t,r,n){if(0===e||e>64)throw new Error("Illegal output length, expected 0 < length <= 64");if(t&&t.length>64)throw new Error("Illegal key, expected Uint8Array with 0 < length <= 64");if(r&&16!==r.length)throw new Error("Illegal salt, expected Uint8Array with length is 16");if(n&&16!==n.length)throw new Error("Illegal personal, expected Uint8Array with length is 16");const i={b:new Uint8Array(128),h:new Uint32Array(16),t:0,c:0,outlen:e};p.fill(0),p[0]=e,t&&(p[1]=t.length),p[2]=1,p[3]=1,r&&p.set(r,32),n&&p.set(n,48);for(let e=0;e<16;e++)i.h[e]=c[e]^o(p,4*e);return t&&(f(i,t),i.c=128),i}function f(e,t){for(let r=0;r<t.length;r++)128===e.c&&(e.t+=e.c,d(e,!1),e.c=0),e.b[e.c++]=t[r]}function g(e){for(e.t+=e.c;e.c<128;)e.b[e.c++]=0;d(e,!0);const t=new Uint8Array(e.outlen);for(let r=0;r<e.outlen;r++)t[r]=e.h[r>>2]>>8*(3&r);return t}function m(e,t,r,i,a){r=r||64,e=n.normalizeInput(e),i&&(i=n.normalizeInput(i)),a&&(a=n.normalizeInput(a));const o=h(r,t,i,a);return f(o,e),g(o)}e.exports={blake2b:m,blake2bHex:function(e,t,r,i,a){const o=m(e,t,r,i,a);return n.toHex(o)},blake2bInit:h,blake2bUpdate:f,blake2bFinal:g}},5297:function(e,t,r){const n=r(9488);function i(e,t){return e[t]^e[t+1]<<8^e[t+2]<<16^e[t+3]<<24}function a(e,t,r,n,i,a){A[e]=A[e]+A[t]+i,A[n]=o(A[n]^A[e],16),A[r]=A[r]+A[n],A[t]=o(A[t]^A[r],12),A[e]=A[e]+A[t]+a,A[n]=o(A[n]^A[e],8),A[r]=A[r]+A[n],A[t]=o(A[t]^A[r],7)}function o(e,t){return e>>>t^e<<32-t}const s=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),c=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0]),A=new Uint32Array(16),u=new Uint32Array(16);function l(e,t){let r=0;for(r=0;r<8;r++)A[r]=e.h[r],A[r+8]=s[r];for(A[12]^=e.t,A[13]^=e.t/4294967296,t&&(A[14]=~A[14]),r=0;r<16;r++)u[r]=i(e.b,4*r);for(r=0;r<10;r++)a(0,4,8,12,u[c[16*r+0]],u[c[16*r+1]]),a(1,5,9,13,u[c[16*r+2]],u[c[16*r+3]]),a(2,6,10,14,u[c[16*r+4]],u[c[16*r+5]]),a(3,7,11,15,u[c[16*r+6]],u[c[16*r+7]]),a(0,5,10,15,u[c[16*r+8]],u[c[16*r+9]]),a(1,6,11,12,u[c[16*r+10]],u[c[16*r+11]]),a(2,7,8,13,u[c[16*r+12]],u[c[16*r+13]]),a(3,4,9,14,u[c[16*r+14]],u[c[16*r+15]]);for(r=0;r<8;r++)e.h[r]^=A[r]^A[r+8]}function d(e,t){if(!(e>0&&e<=32))throw new Error("Incorrect output length, should be in [1, 32]");const r=t?t.length:0;if(t&&!(r>0&&r<=32))throw new Error("Incorrect key length, should be in [1, 32]");const n={h:new Uint32Array(s),b:new Uint8Array(64),c:0,t:0,outlen:e};return n.h[0]^=16842752^r<<8^e,r>0&&(p(n,t),n.c=64),n}function p(e,t){for(let r=0;r<t.length;r++)64===e.c&&(e.t+=e.c,l(e,!1),e.c=0),e.b[e.c++]=t[r]}function h(e){for(e.t+=e.c;e.c<64;)e.b[e.c++]=0;l(e,!0);const t=new Uint8Array(e.outlen);for(let r=0;r<e.outlen;r++)t[r]=e.h[r>>2]>>8*(3&r)&255;return t}function f(e,t,r){r=r||32,e=n.normalizeInput(e);const i=d(r,t);return p(i,e),h(i)}e.exports={blake2s:f,blake2sHex:function(e,t,r){const i=f(e,t,r);return n.toHex(i)},blake2sInit:d,blake2sUpdate:p,blake2sFinal:h}},1191:function(e,t,r){const n=r(8442),i=r(5297);e.exports={blake2b:n.blake2b,blake2bHex:n.blake2bHex,blake2bInit:n.blake2bInit,blake2bUpdate:n.blake2bUpdate,blake2bFinal:n.blake2bFinal,blake2s:i.blake2s,blake2sHex:i.blake2sHex,blake2sInit:i.blake2sInit,blake2sUpdate:i.blake2sUpdate,blake2sFinal:i.blake2sFinal}},9488:function(e){function t(e){return(4294967296+e).toString(16).substring(1)}e.exports={normalizeInput:function(e){let t;if(e instanceof Uint8Array)t=e;else{if("string"!=typeof e)throw new Error("Input must be an string, Buffer or Uint8Array");t=(new TextEncoder).encode(e)}return t},toHex:function(e){return Array.prototype.map.call(e,(function(e){return(e<16?"0":"")+e.toString(16)})).join("")},debugPrint:function(e,r,n){let i="\n"+e+" = ";for(let a=0;a<r.length;a+=2){if(32===n)i+=t(r[a]).toUpperCase(),i+=" ",i+=t(r[a+1]).toUpperCase();else{if(64!==n)throw new Error("Invalid size "+n);i+=t(r[a+1]).toUpperCase(),i+=t(r[a]).toUpperCase()}a%6==4?i+="\n"+new Array(e.length+4).join(" "):a<r.length-2&&(i+=" ")}console.log(i)},testSpeed:function(e,t,r){let n=(new Date).getTime();const i=new Uint8Array(t);for(let e=0;e<t;e++)i[e]=e%256;const a=(new Date).getTime();console.log("Generated random input in "+(a-n)+"ms"),n=a;for(let a=0;a<r;a++){const r=e(i),a=(new Date).getTime(),o=a-n;n=a,console.log("Hashed in "+o+"ms: "+r.substring(0,20)+"..."),console.log(Math.round(t/(1<<20)/(o/1e3)*100)/100+" MB PER SECOND")}}}},7191:function(e,t,r){const n=r(8162);e.exports=n("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},8764:function(e,t,r){"use strict";const n=r(9742),i=r(645),a="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=c,t.SlowBuffer=function(e){return+e!=e&&(e=0),c.alloc(+e)},t.INSPECT_MAX_BYTES=50;const o=2147483647;function s(e){if(e>o)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,c.prototype),t}function c(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return l(e)}return A(e,t,r)}function A(e,t,r){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!c.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|f(e,t);let n=s(r);const i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if($(e,Uint8Array)){const t=new Uint8Array(e);return p(t.buffer,t.byteOffset,t.byteLength)}return d(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if($(e,ArrayBuffer)||e&&$(e.buffer,ArrayBuffer))return p(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&($(e,SharedArrayBuffer)||e&&$(e.buffer,SharedArrayBuffer)))return p(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return c.from(n,t,r);const i=function(e){if(c.isBuffer(e)){const t=0|h(e.length),r=s(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||J(e.length)?s(0):d(e):"Buffer"===e.type&&Array.isArray(e.data)?d(e.data):void 0}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return c.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function u(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function l(e){return u(e),s(e<0?0:0|h(e))}function d(e){const t=e.length<0?0:0|h(e.length),r=s(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function p(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,c.prototype),n}function h(e){if(e>=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return 0|e}function f(e,t){if(c.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||$(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return Y(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return K(e).length;default:if(i)return n?-1:Y(e).length;t=(""+t).toLowerCase(),i=!0}}function g(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return _(this,t,r);case"utf8":case"utf-8":return b(this,t,r);case"ascii":return S(this,t,r);case"latin1":case"binary":return x(this,t,r);case"base64":return Q(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function m(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function y(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),J(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=c.from(t,n)),c.isBuffer(t))return 0===t.length?-1:I(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):I(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function I(e,t,r,n,i){let a,o=1,s=e.length,c=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;o=2,s/=2,c/=2,r/=2}function A(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(i){let n=-1;for(a=r;a<s;a++)if(A(e,a)===A(t,-1===n?0:a-n)){if(-1===n&&(n=a),a-n+1===c)return n*o}else-1!==n&&(a-=a-n),n=-1}else for(r+c>s&&(r=s-c),a=r;a>=0;a--){let r=!0;for(let n=0;n<c;n++)if(A(e,a+n)!==A(t,n)){r=!1;break}if(r)return a}return-1}function C(e,t,r,n){r=Number(r)||0;const i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;const a=t.length;let o;for(n>a/2&&(n=a/2),o=0;o<n;++o){const n=parseInt(t.substr(2*o,2),16);if(J(n))return o;e[r+o]=n}return o}function E(e,t,r,n){return V(Y(t,e.length-r),e,r,n)}function B(e,t,r,n){return V(function(e){const t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function w(e,t,r,n){return V(K(t),e,r,n)}function v(e,t,r,n){return V(function(e,t){let r,n,i;const a=[];for(let o=0;o<e.length&&!((t-=2)<0);++o)r=e.charCodeAt(o),n=r>>8,i=r%256,a.push(i),a.push(n);return a}(t,e.length-r),e,r,n)}function Q(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function b(e,t,r){r=Math.min(e.length,r);const n=[];let i=t;for(;i<r;){const t=e[i];let a=null,o=t>239?4:t>223?3:t>191?2:1;if(i+o<=r){let r,n,s,c;switch(o){case 1:t<128&&(a=t);break;case 2:r=e[i+1],128==(192&r)&&(c=(31&t)<<6|63&r,c>127&&(a=c));break;case 3:r=e[i+1],n=e[i+2],128==(192&r)&&128==(192&n)&&(c=(15&t)<<12|(63&r)<<6|63&n,c>2047&&(c<55296||c>57343)&&(a=c));break;case 4:r=e[i+1],n=e[i+2],s=e[i+3],128==(192&r)&&128==(192&n)&&128==(192&s)&&(c=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&s,c>65535&&c<1114112&&(a=c))}}null===a?(a=65533,o=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|1023&a),n.push(a),i+=o}return function(e){const t=e.length;if(t<=N)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=N));return r}(n)}t.kMaxLength=o,c.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),c.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(c.prototype,"parent",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}}),Object.defineProperty(c.prototype,"offset",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}}),c.poolSize=8192,c.from=function(e,t,r){return A(e,t,r)},Object.setPrototypeOf(c.prototype,Uint8Array.prototype),Object.setPrototypeOf(c,Uint8Array),c.alloc=function(e,t,r){return function(e,t,r){return u(e),e<=0?s(e):void 0!==t?"string"==typeof r?s(e).fill(t,r):s(e).fill(t):s(e)}(e,t,r)},c.allocUnsafe=function(e){return l(e)},c.allocUnsafeSlow=function(e){return l(e)},c.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==c.prototype},c.compare=function(e,t){if($(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),$(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),!c.isBuffer(e)||!c.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let i=0,a=Math.min(r,n);i<a;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},c.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return c.alloc(0);let r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;const n=c.allocUnsafe(t);let i=0;for(r=0;r<e.length;++r){let t=e[r];if($(t,Uint8Array))i+t.length>n.length?(c.isBuffer(t)||(t=c.from(t)),t.copy(n,i)):Uint8Array.prototype.set.call(n,t,i);else{if(!c.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,i)}i+=t.length}return n},c.byteLength=f,c.prototype._isBuffer=!0,c.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)m(this,t,t+1);return this},c.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)m(this,t,t+3),m(this,t+1,t+2);return this},c.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)m(this,t,t+7),m(this,t+1,t+6),m(this,t+2,t+5),m(this,t+3,t+4);return this},c.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?b(this,0,e):g.apply(this,arguments)},c.prototype.toLocaleString=c.prototype.toString,c.prototype.equals=function(e){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===c.compare(this,e)},c.prototype.inspect=function(){let e="";const r=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},a&&(c.prototype[a]=c.prototype.inspect),c.prototype.compare=function(e,t,r,n,i){if($(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;let a=(i>>>=0)-(n>>>=0),o=(r>>>=0)-(t>>>=0);const s=Math.min(a,o),A=this.slice(n,i),u=e.slice(t,r);for(let e=0;e<s;++e)if(A[e]!==u[e]){a=A[e],o=u[e];break}return a<o?-1:o<a?1:0},c.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},c.prototype.indexOf=function(e,t,r){return y(this,e,t,r,!0)},c.prototype.lastIndexOf=function(e,t,r){return y(this,e,t,r,!1)},c.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let a=!1;for(;;)switch(n){case"hex":return C(this,e,t,r);case"utf8":case"utf-8":return E(this,e,t,r);case"ascii":case"latin1":case"binary":return B(this,e,t,r);case"base64":return w(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return v(this,e,t,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const N=4096;function S(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function x(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function _(e,t,r){const n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let i="";for(let n=t;n<r;++n)i+=W[e[n]];return i}function T(e,t,r){const n=e.slice(t,r);let i="";for(let e=0;e<n.length-1;e+=2)i+=String.fromCharCode(n[e]+256*n[e+1]);return i}function M(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function R(e,t,r,n,i,a){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<a)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function k(e,t,r,n,i){G(t,n,i,e,r,7);let a=Number(t&BigInt(4294967295));e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,r}function D(e,t,r,n,i){G(t,n,i,e,r,7);let a=Number(t&BigInt(4294967295));e[r+7]=a,a>>=8,e[r+6]=a,a>>=8,e[r+5]=a,a>>=8,e[r+4]=a;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=o,o>>=8,e[r+2]=o,o>>=8,e[r+1]=o,o>>=8,e[r]=o,r+8}function z(e,t,r,n,i,a){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function O(e,t,r,n,a){return t=+t,r>>>=0,a||z(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function U(e,t,r,n,a){return t=+t,r>>>=0,a||z(e,0,r,8),i.write(e,t,r,n,52,8),r+8}c.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);const n=this.subarray(e,t);return Object.setPrototypeOf(n,c.prototype),n},c.prototype.readUintLE=c.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||M(e,t,this.length);let n=this[e],i=1,a=0;for(;++a<t&&(i*=256);)n+=this[e+a]*i;return n},c.prototype.readUintBE=c.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||M(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n},c.prototype.readUint8=c.prototype.readUInt8=function(e,t){return e>>>=0,t||M(e,1,this.length),this[e]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||M(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||M(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||M(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(e,t){return e>>>=0,t||M(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readBigUInt64LE=X((function(e){L(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||H(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(i)<<BigInt(32))})),c.prototype.readBigUInt64BE=X((function(e){L(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||H(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)})),c.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||M(e,t,this.length);let n=this[e],i=1,a=0;for(;++a<t&&(i*=256);)n+=this[e+a]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*t)),n},c.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||M(e,t,this.length);let n=t,i=1,a=this[e+--n];for(;n>0&&(i*=256);)a+=this[e+--n]*i;return i*=128,a>=i&&(a-=Math.pow(2,8*t)),a},c.prototype.readInt8=function(e,t){return e>>>=0,t||M(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||M(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(e,t){e>>>=0,t||M(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||M(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return e>>>=0,t||M(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readBigInt64LE=X((function(e){L(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||H(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)})),c.prototype.readBigInt64BE=X((function(e){L(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||H(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+r)})),c.prototype.readFloatLE=function(e,t){return e>>>=0,t||M(e,4,this.length),i.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||M(e,4,this.length),i.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||M(e,8,this.length),i.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||M(e,8,this.length),i.read(this,e,!1,52,8)},c.prototype.writeUintLE=c.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||R(this,e,t,r,Math.pow(2,8*r)-1,0);let i=1,a=0;for(this[t]=255&e;++a<r&&(i*=256);)this[t+a]=e/i&255;return t+r},c.prototype.writeUintBE=c.prototype.writeUIntBE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||R(this,e,t,r,Math.pow(2,8*r)-1,0);let i=r-1,a=1;for(this[t+i]=255&e;--i>=0&&(a*=256);)this[t+i]=e/a&255;return t+r},c.prototype.writeUint8=c.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeBigUInt64LE=X((function(e,t=0){return k(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),c.prototype.writeBigUInt64BE=X((function(e,t=0){return D(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),c.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);R(this,e,t,r,n-1,-n)}let i=0,a=1,o=0;for(this[t]=255&e;++i<r&&(a*=256);)e<0&&0===o&&0!==this[t+i-1]&&(o=1),this[t+i]=(e/a>>0)-o&255;return t+r},c.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);R(this,e,t,r,n-1,-n)}let i=r-1,a=1,o=0;for(this[t+i]=255&e;--i>=0&&(a*=256);)e<0&&0===o&&0!==this[t+i+1]&&(o=1),this[t+i]=(e/a>>0)-o&255;return t+r},c.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},c.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeBigInt64LE=X((function(e,t=0){return k(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),c.prototype.writeBigInt64BE=X((function(e,t=0){return D(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),c.prototype.writeFloatLE=function(e,t,r){return O(this,e,t,!0,r)},c.prototype.writeFloatBE=function(e,t,r){return O(this,e,t,!1,r)},c.prototype.writeDoubleLE=function(e,t,r){return U(this,e,t,!0,r)},c.prototype.writeDoubleBE=function(e,t,r){return U(this,e,t,!1,r)},c.prototype.copy=function(e,t,r,n){if(!c.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);const i=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),i},c.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!c.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){const t=e.charCodeAt(0);("utf8"===n&&t<128||"latin1"===n)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;let i;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{const a=c.isBuffer(e)?e:c.from(e,n),o=a.length;if(0===o)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=a[i%o]}return this};const F={};function P(e,t,r){F[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function q(e){let t="",r=e.length;const n="-"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function G(e,t,r,n,i,a){if(e>r||e<t){const n="bigint"==typeof t?"n":"";let i;throw i=a>3?0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(a+1)}${n}`:`>= -(2${n} ** ${8*(a+1)-1}${n}) and < 2 ** ${8*(a+1)-1}${n}`:`>= ${t}${n} and <= ${r}${n}`,new F.ERR_OUT_OF_RANGE("value",i,e)}!function(e,t,r){L(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||H(t,e.length-(r+1))}(n,i,a)}function L(e,t){if("number"!=typeof e)throw new F.ERR_INVALID_ARG_TYPE(t,"number",e)}function H(e,t,r){if(Math.floor(e)!==e)throw L(e,r),new F.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new F.ERR_BUFFER_OUT_OF_BOUNDS;throw new F.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}P("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),P("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),P("ERR_OUT_OF_RANGE",(function(e,t,r){let n=`The value of "${e}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=q(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=q(i)),i+="n"),n+=` It must be ${t}. Received ${i}`,n}),RangeError);const j=/[^+/0-9A-Za-z-_]/g;function Y(e,t){let r;t=t||1/0;const n=e.length;let i=null;const a=[];for(let o=0;o<n;++o){if(r=e.charCodeAt(o),r>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(o+1===n){(t-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&a.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function K(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(j,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function V(e,t,r,n){let i;for(i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function $(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function J(e){return e!=e}const W=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function X(e){return"undefined"==typeof BigInt?Z:e}function Z(){throw new Error("BigInt not supported")}},3536:function(e,t,r){var n=r(1910);e.exports=n},991:function(e,t,r){r(7690);var n=r(5703);e.exports=n("Array").includes},8557:function(e,t,r){var n=r(7046),i=r(991),a=r(1631),o=Array.prototype,s=String.prototype;e.exports=function(e){var t=e.includes;return e===o||n(o,e)&&t===o.includes?i:"string"==typeof e||e===s||n(s,e)&&t===s.includes?a:t}},8171:function(e,t,r){r(6450);var n=r(4058).Object,i=e.exports=function(e,t,r){return n.defineProperty(e,t,r)};n.defineProperty.sham&&(i.sham=!0)},1631:function(e,t,r){r(1035);var n=r(5703);e.exports=n("String").includes},3685:function(e,t,r){e.exports=r(621)},621:function(e,t,r){var n=r(3536);e.exports=n},4883:function(e,t,r){var n=r(7475),i=r(9826),a=TypeError;e.exports=function(e){if(n(e))return e;throw a(i(e)+" is not a function")}},8479:function(e){e.exports=function(){}},6059:function(e,t,r){var n=r(941),i=String,a=TypeError;e.exports=function(e){if(n(e))return e;throw a(i(e)+" is not an object")}},1692:function(e,t,r){var n=r(4529),i=r(9413),a=r(623),o=function(e){return function(t,r,o){var s,c=n(t),A=a(c),u=i(o,A);if(e&&r!=r){for(;A>u;)if((s=c[u++])!=s)return!0}else for(;A>u;u++)if((e||u in c)&&c[u]===r)return e||u||0;return!e&&-1}};e.exports={includes:o(!0),indexOf:o(!1)}},2532:function(e,t,r){var n=r(5329),i=n({}.toString),a=n("".slice);e.exports=function(e){return a(i(e),8,-1)}},9697:function(e,t,r){var n=r(2885),i=r(7475),a=r(2532),o=r(9813)("toStringTag"),s=Object,c="Arguments"==a(function(){return arguments}());e.exports=n?a:function(e){var t,r,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=function(e,t){try{return e[t]}catch(e){}}(t=s(e),o))?r:c?a(t):"Object"==(n=a(t))&&i(t.callee)?"Arguments":n}},7772:function(e,t,r){var n=r(9813)("match");e.exports=function(e){var t=/./;try{"/./"[e](t)}catch(r){try{return t[n]=!1,"/./"[e](t)}catch(e){}}return!1}},2029:function(e,t,r){var n=r(5746),i=r(5988),a=r(1887);e.exports=n?function(e,t,r){return i.f(e,t,a(1,r))}:function(e,t,r){return e[t]=r,e}},1887:function(e){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},5609:function(e,t,r){var n=r(1899),i=Object.defineProperty;e.exports=function(e,t){try{i(n,e,{value:t,configurable:!0,writable:!0})}catch(r){n[e]=t}return t}},5746:function(e,t,r){var n=r(5981);e.exports=!n((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},1333:function(e,t,r){var n=r(1899),i=r(941),a=n.document,o=i(a)&&i(a.createElement);e.exports=function(e){return o?a.createElement(e):{}}},2861:function(e,t,r){var n=r(626);e.exports=n("navigator","userAgent")||""},3385:function(e,t,r){var n,i,a=r(1899),o=r(2861),s=a.process,c=a.Deno,A=s&&s.versions||c&&c.version,u=A&&A.v8;u&&(i=(n=u.split("."))[0]>0&&n[0]<4?1:+(n[0]+n[1])),!i&&o&&(!(n=o.match(/Edge\/(\d+)/))||n[1]>=74)&&(n=o.match(/Chrome\/(\d+)/))&&(i=+n[1]),e.exports=i},5703:function(e,t,r){var n=r(4058);e.exports=function(e){return n[e+"Prototype"]}},6887:function(e,t,r){"use strict";var n=r(1899),i=r(9730),a=r(5329),o=r(7475),s=r(9677).f,c=r(7252),A=r(4058),u=r(6843),l=r(2029),d=r(953),p=function(e){var t=function(r,n,a){if(this instanceof t){switch(arguments.length){case 0:return new e;case 1:return new e(r);case 2:return new e(r,n)}return new e(r,n,a)}return i(e,this,arguments)};return t.prototype=e.prototype,t};e.exports=function(e,t){var r,i,h,f,g,m,y,I,C=e.target,E=e.global,B=e.stat,w=e.proto,v=E?n:B?n[C]:(n[C]||{}).prototype,Q=E?A:A[C]||l(A,C,{})[C],b=Q.prototype;for(h in t)r=!c(E?h:C+(B?".":"#")+h,e.forced)&&v&&d(v,h),g=Q[h],r&&(m=e.dontCallGetSet?(I=s(v,h))&&I.value:v[h]),f=r&&m?m:t[h],r&&typeof g==typeof f||(y=e.bind&&r?u(f,n):e.wrap&&r?p(f):w&&o(f)?a(f):f,(e.sham||f&&f.sham||g&&g.sham)&&l(y,"sham",!0),l(Q,h,y),w&&(d(A,i=C+"Prototype")||l(A,i,{}),l(A[i],h,f),e.real&&b&&!b[h]&&l(b,h,f)))}},5981:function(e){e.exports=function(e){try{return!!e()}catch(e){return!0}}},9730:function(e,t,r){var n=r(8285),i=Function.prototype,a=i.apply,o=i.call;e.exports="object"==typeof Reflect&&Reflect.apply||(n?o.bind(a):function(){return o.apply(a,arguments)})},6843:function(e,t,r){var n=r(5329),i=r(4883),a=r(8285),o=n(n.bind);e.exports=function(e,t){return i(e),void 0===t?e:a?o(e,t):function(){return e.apply(t,arguments)}}},8285:function(e,t,r){var n=r(5981);e.exports=!n((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))},8834:function(e,t,r){var n=r(8285),i=Function.prototype.call;e.exports=n?i.bind(i):function(){return i.apply(i,arguments)}},5329:function(e,t,r){var n=r(8285),i=Function.prototype,a=i.bind,o=i.call,s=n&&a.bind(o,o);e.exports=n?function(e){return e&&s(e)}:function(e){return e&&function(){return o.apply(e,arguments)}}},626:function(e,t,r){var n=r(4058),i=r(1899),a=r(7475),o=function(e){return a(e)?e:void 0};e.exports=function(e,t){return arguments.length<2?o(n[e])||o(i[e]):n[e]&&n[e][t]||i[e]&&i[e][t]}},4229:function(e,t,r){var n=r(4883);e.exports=function(e,t){var r=e[t];return null==r?void 0:n(r)}},1899:function(e,t,r){var n=function(e){return e&&e.Math==Math&&e};e.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof r.g&&r.g)||function(){return this}()||Function("return this")()},953:function(e,t,r){var n=r(5329),i=r(9678),a=n({}.hasOwnProperty);e.exports=Object.hasOwn||function(e,t){return a(i(e),t)}},2840:function(e,t,r){var n=r(5746),i=r(5981),a=r(1333);e.exports=!n&&!i((function(){return 7!=Object.defineProperty(a("div"),"a",{get:function(){return 7}}).a}))},7026:function(e,t,r){var n=r(5329),i=r(5981),a=r(2532),o=Object,s=n("".split);e.exports=i((function(){return!o("z").propertyIsEnumerable(0)}))?function(e){return"String"==a(e)?s(e,""):o(e)}:o},7475:function(e){e.exports=function(e){return"function"==typeof e}},7252:function(e,t,r){var n=r(5981),i=r(7475),a=/#|\.prototype\./,o=function(e,t){var r=c[s(e)];return r==u||r!=A&&(i(t)?n(t):!!t)},s=o.normalize=function(e){return String(e).replace(a,".").toLowerCase()},c=o.data={},A=o.NATIVE="N",u=o.POLYFILL="P";e.exports=o},941:function(e,t,r){var n=r(7475);e.exports=function(e){return"object"==typeof e?null!==e:n(e)}},2529:function(e){e.exports=!0},685:function(e,t,r){var n=r(941),i=r(2532),a=r(9813)("match");e.exports=function(e){var t;return n(e)&&(void 0!==(t=e[a])?!!t:"RegExp"==i(e))}},6664:function(e,t,r){var n=r(626),i=r(7475),a=r(7046),o=r(2302),s=Object;e.exports=o?function(e){return"symbol"==typeof e}:function(e){var t=n("Symbol");return i(t)&&a(t.prototype,s(e))}},623:function(e,t,r){var n=r(3057);e.exports=function(e){return n(e.length)}},5331:function(e){var t=Math.ceil,r=Math.floor;e.exports=Math.trunc||function(e){var n=+e;return(n>0?r:t)(n)}},2497:function(e,t,r){var n=r(3385),i=r(5981);e.exports=!!Object.getOwnPropertySymbols&&!i((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&n&&n<41}))},344:function(e,t,r){var n=r(685),i=TypeError;e.exports=function(e){if(n(e))throw i("The method doesn't accept regular expressions");return e}},5988:function(e,t,r){var n=r(5746),i=r(2840),a=r(3937),o=r(6059),s=r(3894),c=TypeError,A=Object.defineProperty,u=Object.getOwnPropertyDescriptor;t.f=n?a?function(e,t,r){if(o(e),t=s(t),o(r),"function"==typeof e&&"prototype"===t&&"value"in r&&"writable"in r&&!r.writable){var n=u(e,t);n&&n.writable&&(e[t]=r.value,r={configurable:"configurable"in r?r.configurable:n.configurable,enumerable:"enumerable"in r?r.enumerable:n.enumerable,writable:!1})}return A(e,t,r)}:A:function(e,t,r){if(o(e),t=s(t),o(r),i)try{return A(e,t,r)}catch(e){}if("get"in r||"set"in r)throw c("Accessors not supported");return"value"in r&&(e[t]=r.value),e}},9677:function(e,t,r){var n=r(5746),i=r(8834),a=r(6760),o=r(1887),s=r(4529),c=r(3894),A=r(953),u=r(2840),l=Object.getOwnPropertyDescriptor;t.f=n?l:function(e,t){if(e=s(e),t=c(t),u)try{return l(e,t)}catch(e){}if(A(e,t))return o(!i(a.f,e,t),e[t])}},7046:function(e,t,r){var n=r(5329);e.exports=n({}.isPrototypeOf)},6760:function(e,t){"use strict";var r={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,i=n&&!r.call({1:2},1);t.f=i?function(e){var t=n(this,e);return!!t&&t.enumerable}:r},9811:function(e,t,r){var n=r(8834),i=r(7475),a=r(941),o=TypeError;e.exports=function(e,t){var r,s;if("string"===t&&i(r=e.toString)&&!a(s=n(r,e)))return s;if(i(r=e.valueOf)&&!a(s=n(r,e)))return s;if("string"!==t&&i(r=e.toString)&&!a(s=n(r,e)))return s;throw o("Can't convert object to primitive value")}},4058:function(e){e.exports={}},8219:function(e){var t=TypeError;e.exports=function(e){if(null==e)throw t("Can't call method on "+e);return e}},3030:function(e,t,r){var n=r(1899),i=r(5609),a="__core-js_shared__",o=n[a]||i(a,{});e.exports=o},8726:function(e,t,r){var n=r(2529),i=r(3030);(e.exports=function(e,t){return i[e]||(i[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.24.0",mode:n?"pure":"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.24.0/LICENSE",source:"https://github.com/zloirock/core-js"})},9413:function(e,t,r){var n=r(2435),i=Math.max,a=Math.min;e.exports=function(e,t){var r=n(e);return r<0?i(r+t,0):a(r,t)}},4529:function(e,t,r){var n=r(7026),i=r(8219);e.exports=function(e){return n(i(e))}},2435:function(e,t,r){var n=r(5331);e.exports=function(e){var t=+e;return t!=t||0===t?0:n(t)}},3057:function(e,t,r){var n=r(2435),i=Math.min;e.exports=function(e){return e>0?i(n(e),9007199254740991):0}},9678:function(e,t,r){var n=r(8219),i=Object;e.exports=function(e){return i(n(e))}},6935:function(e,t,r){var n=r(8834),i=r(941),a=r(6664),o=r(4229),s=r(9811),c=r(9813),A=TypeError,u=c("toPrimitive");e.exports=function(e,t){if(!i(e)||a(e))return e;var r,c=o(e,u);if(c){if(void 0===t&&(t="default"),r=n(c,e,t),!i(r)||a(r))return r;throw A("Can't convert object to primitive value")}return void 0===t&&(t="number"),s(e,t)}},3894:function(e,t,r){var n=r(6935),i=r(6664);e.exports=function(e){var t=n(e,"string");return i(t)?t:t+""}},2885:function(e,t,r){var n={};n[r(9813)("toStringTag")]="z",e.exports="[object z]"===String(n)},5803:function(e,t,r){var n=r(9697),i=String;e.exports=function(e){if("Symbol"===n(e))throw TypeError("Cannot convert a Symbol value to a string");return i(e)}},9826:function(e){var t=String;e.exports=function(e){try{return t(e)}catch(e){return"Object"}}},9418:function(e,t,r){var n=r(5329),i=0,a=Math.random(),o=n(1..toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+o(++i+a,36)}},2302:function(e,t,r){var n=r(2497);e.exports=n&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},3937:function(e,t,r){var n=r(5746),i=r(5981);e.exports=n&&i((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},9813:function(e,t,r){var n=r(1899),i=r(8726),a=r(953),o=r(9418),s=r(2497),c=r(2302),A=i("wks"),u=n.Symbol,l=u&&u.for,d=c?u:u&&u.withoutSetter||o;e.exports=function(e){if(!a(A,e)||!s&&"string"!=typeof A[e]){var t="Symbol."+e;s&&a(u,e)?A[e]=u[e]:A[e]=c&&l?l(t):d(t)}return A[e]}},7690:function(e,t,r){"use strict";var n=r(6887),i=r(1692).includes,a=r(5981),o=r(8479);n({target:"Array",proto:!0,forced:a((function(){return!Array(1).includes()}))},{includes:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),o("includes")},6450:function(e,t,r){var n=r(6887),i=r(5746),a=r(5988).f;n({target:"Object",stat:!0,forced:Object.defineProperty!==a,sham:!i},{defineProperty:a})},1035:function(e,t,r){"use strict";var n=r(6887),i=r(5329),a=r(344),o=r(8219),s=r(5803),c=r(7772),A=i("".indexOf);n({target:"String",proto:!0,forced:!c("includes")},{includes:function(e){return!!~A(s(o(this)),s(a(e)),arguments.length>1?arguments[1]:void 0)}})},3778:function(e,t,r){var n=r(8557);e.exports=n},1910:function(e,t,r){var n=r(8171);e.exports=n},284:function(e){var t=function(){if("object"==typeof self&&self)return self;if("object"==typeof window&&window)return window;throw new Error("Unable to resolve global `this`")};e.exports=function(){if(this)return this;if("object"==typeof globalThis&&globalThis)return globalThis;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:!0})}catch(e){return t()}try{return __global__||t()}finally{delete Object.prototype.__global__}}()},7187:function(e){"use strict";var t,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};t=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var i=Number.isNaN||function(e){return e!=e};function a(){a.init.call(this)}e.exports=a,e.exports.once=function(e,t){return new Promise((function(r,n){function i(r){e.removeListener(t,a),n(r)}function a(){"function"==typeof e.removeListener&&e.removeListener("error",i),r([].slice.call(arguments))}f(e,t,a,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&f(e,"error",t,{once:!0})}(e,i)}))},a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var o=10;function s(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function c(e){return void 0===e._maxListeners?a.defaultMaxListeners:e._maxListeners}function A(e,t,r,n){var i,a,o,A;if(s(r),void 0===(a=e._events)?(a=e._events=Object.create(null),e._eventsCount=0):(void 0!==a.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),a=e._events),o=a[t]),void 0===o)o=a[t]=r,++e._eventsCount;else if("function"==typeof o?o=a[t]=n?[r,o]:[o,r]:n?o.unshift(r):o.push(r),(i=c(e))>0&&o.length>i&&!o.warned){o.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=o.length,A=u,console&&console.warn&&console.warn(A)}return e}function u(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function l(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=u.bind(n);return i.listener=r,n.wrapFn=i,i}function d(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(i):h(i,i.length)}function p(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function h(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function f(e,t,r,n){if("function"==typeof e.on)n.once?e.once(t,r):e.on(t,r);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function i(a){n.once&&e.removeEventListener(t,i),r(a)}))}}Object.defineProperty(a,"defaultMaxListeners",{enumerable:!0,get:function(){return o},set:function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");o=e}}),a.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},a.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},a.prototype.getMaxListeners=function(){return c(this)},a.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var i="error"===e,a=this._events;if(void 0!==a)i=i&&void 0===a.error;else if(!i)return!1;if(i){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var c=a[e];if(void 0===c)return!1;if("function"==typeof c)n(c,this,t);else{var A=c.length,u=h(c,A);for(r=0;r<A;++r)n(u[r],this,t)}return!0},a.prototype.addListener=function(e,t){return A(this,e,t,!1)},a.prototype.on=a.prototype.addListener,a.prototype.prependListener=function(e,t){return A(this,e,t,!0)},a.prototype.once=function(e,t){return s(t),this.on(e,l(this,e,t)),this},a.prototype.prependOnceListener=function(e,t){return s(t),this.prependListener(e,l(this,e,t)),this},a.prototype.removeListener=function(e,t){var r,n,i,a,o;if(s(t),void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(i=-1,a=r.length-1;a>=0;a--)if(r[a]===t||r[a].listener===t){o=r[a].listener,i=a;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,i),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,o||t)}return this},a.prototype.off=a.prototype.removeListener,a.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var i,a=Object.keys(r);for(n=0;n<a.length;++n)"removeListener"!==(i=a[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},a.prototype.listeners=function(e){return d(this,e,!0)},a.prototype.rawListeners=function(e){return d(this,e,!1)},a.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},a.prototype.listenerCount=p,a.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},645:function(e,t){t.read=function(e,t,r,n,i){var a,o,s=8*i-n-1,c=(1<<s)-1,A=c>>1,u=-7,l=r?i-1:0,d=r?-1:1,p=e[t+l];for(l+=d,a=p&(1<<-u)-1,p>>=-u,u+=s;u>0;a=256*a+e[t+l],l+=d,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=n;u>0;o=256*o+e[t+l],l+=d,u-=8);if(0===a)a=1-A;else{if(a===c)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,n),a-=A}return(p?-1:1)*o*Math.pow(2,a-n)},t.write=function(e,t,r,n,i,a){var o,s,c,A=8*a-i-1,u=(1<<A)-1,l=u>>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:a-1,h=n?1:-1,f=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=u):(o=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-o))<1&&(o--,c*=2),(t+=o+l>=1?d/c:d*Math.pow(2,1-l))*c>=2&&(o++,c/=2),o+l>=u?(s=0,o=u):o+l>=1?(s=(t*c-1)*Math.pow(2,i),o+=l):(s=t*Math.pow(2,l-1)*Math.pow(2,i),o=0));i>=8;e[r+p]=255&s,p+=h,s/=256,i-=8);for(o=o<<i|s,A+=i;A>0;e[r+p]=255&o,p+=h,o/=256,A-=8);e[r+p-h]|=128*f}},5717:function(e){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},4400:function(e,t,r){var n=r(4123).stringify,i=r(6813);e.exports=function(e){return{parse:i(e),stringify:n}},e.exports.parse=i(),e.exports.stringify=n},6813:function(e,t,r){var n=null;const i=/(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])/,a=/(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)/;e.exports=function(e){"use strict";var t={strict:!1,storeAsString:!1,alwaysParseAsBig:!1,useNativeBigInt:!1,protoAction:"error",constructorAction:"error"};if(null!=e){if(!0===e.strict&&(t.strict=!0),!0===e.storeAsString&&(t.storeAsString=!0),t.alwaysParseAsBig=!0===e.alwaysParseAsBig&&e.alwaysParseAsBig,t.useNativeBigInt=!0===e.useNativeBigInt&&e.useNativeBigInt,void 0!==e.constructorAction){if("error"!==e.constructorAction&&"ignore"!==e.constructorAction&&"preserve"!==e.constructorAction)throw new Error(`Incorrect value for constructorAction option, must be "error", "ignore" or undefined but passed ${e.constructorAction}`);t.constructorAction=e.constructorAction}if(void 0!==e.protoAction){if("error"!==e.protoAction&&"ignore"!==e.protoAction&&"preserve"!==e.protoAction)throw new Error(`Incorrect value for protoAction option, must be "error", "ignore" or undefined but passed ${e.protoAction}`);t.protoAction=e.protoAction}}var o,s,c,A,u={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"},l=function(e){throw{name:"SyntaxError",message:e,at:o,text:c}},d=function(e){return e&&e!==s&&l("Expected '"+e+"' instead of '"+s+"'"),s=c.charAt(o),o+=1,s},p=function(){var e,i="";for("-"===s&&(i="-",d("-"));s>="0"&&s<="9";)i+=s,d();if("."===s)for(i+=".";d()&&s>="0"&&s<="9";)i+=s;if("e"===s||"E"===s)for(i+=s,d(),"-"!==s&&"+"!==s||(i+=s,d());s>="0"&&s<="9";)i+=s,d();if(e=+i,isFinite(e))return null==n&&(n=r(4431)),i.length>15?t.storeAsString?i:t.useNativeBigInt?BigInt(i):new n(i):t.alwaysParseAsBig?t.useNativeBigInt?BigInt(e):new n(e):e;l("Bad number")},h=function(){var e,t,r,n="";if('"'===s)for(var i=o;d();){if('"'===s)return o-1>i&&(n+=c.substring(i,o-1)),d(),n;if("\\"===s){if(o-1>i&&(n+=c.substring(i,o-1)),d(),"u"===s){for(r=0,t=0;t<4&&(e=parseInt(d(),16),isFinite(e));t+=1)r=16*r+e;n+=String.fromCharCode(r)}else{if("string"!=typeof u[s])break;n+=u[s]}i=o}}l("Bad string")},f=function(){for(;s&&s<=" ";)d()};return A=function(){switch(f(),s){case"{":return function(){var e,r=Object.create(null);if("{"===s){if(d("{"),f(),"}"===s)return d("}"),r;for(;s;){if(e=h(),f(),d(":"),!0===t.strict&&Object.hasOwnProperty.call(r,e)&&l('Duplicate key "'+e+'"'),!0===i.test(e)?"error"===t.protoAction?l("Object contains forbidden prototype property"):"ignore"===t.protoAction?A():r[e]=A():!0===a.test(e)?"error"===t.constructorAction?l("Object contains forbidden constructor property"):"ignore"===t.constructorAction?A():r[e]=A():r[e]=A(),f(),"}"===s)return d("}"),r;d(","),f()}}l("Bad object")}();case"[":return function(){var e=[];if("["===s){if(d("["),f(),"]"===s)return d("]"),e;for(;s;){if(e.push(A()),f(),"]"===s)return d("]"),e;d(","),f()}}l("Bad array")}();case'"':return h();case"-":return p();default:return s>="0"&&s<="9"?p():function(){switch(s){case"t":return d("t"),d("r"),d("u"),d("e"),!0;case"f":return d("f"),d("a"),d("l"),d("s"),d("e"),!1;case"n":return d("n"),d("u"),d("l"),d("l"),null}l("Unexpected '"+s+"'")}()}},function(e,t){var r;return c=e+"",o=0,s=" ",r=A(),f(),s&&l("Syntax error"),"function"==typeof t?function e(r,n){var i,a=r[n];return a&&"object"==typeof a&&Object.keys(a).forEach((function(t){void 0!==(i=e(a,t))?a[t]=i:delete a[t]})),t.call(r,n,a)}({"":r},""):r}}},4123:function(e,t,r){var n=r(4431),i=e.exports;!function(){"use strict";var e,t,r,a=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,o={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};function s(e){return a.lastIndex=0,a.test(e)?'"'+e.replace(a,(function(e){var t=o[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)}))+'"':'"'+e+'"'}function c(i,a){var o,A,u,l,d,p=e,h=a[i],f=null!=h&&(h instanceof n||n.isBigNumber(h));switch(h&&"object"==typeof h&&"function"==typeof h.toJSON&&(h=h.toJSON(i)),"function"==typeof r&&(h=r.call(a,i,h)),typeof h){case"string":return f?h:s(h);case"number":return isFinite(h)?String(h):"null";case"boolean":case"null":case"bigint":return String(h);case"object":if(!h)return"null";if(e+=t,d=[],"[object Array]"===Object.prototype.toString.apply(h)){for(l=h.length,o=0;o<l;o+=1)d[o]=c(o,h)||"null";return u=0===d.length?"[]":e?"[\n"+e+d.join(",\n"+e)+"\n"+p+"]":"["+d.join(",")+"]",e=p,u}if(r&&"object"==typeof r)for(l=r.length,o=0;o<l;o+=1)"string"==typeof r[o]&&(u=c(A=r[o],h))&&d.push(s(A)+(e?": ":":")+u);else Object.keys(h).forEach((function(t){var r=c(t,h);r&&d.push(s(t)+(e?": ":":")+r)}));return u=0===d.length?"{}":e?"{\n"+e+d.join(",\n"+e)+"\n"+p+"}":"{"+d.join(",")+"}",e=p,u}}"function"!=typeof i.stringify&&(i.stringify=function(n,i,a){var o;if(e="",t="","number"==typeof a)for(o=0;o<a;o+=1)t+=" ";else"string"==typeof a&&(t=a);if(r=i,i&&"function"!=typeof i&&("object"!=typeof i||"number"!=typeof i.length))throw new Error("JSON.stringify");return c("",{"":n})})}()},6636:function(e,t){"use strict";function r(e){if(Array.isArray(e)){const t=[];for(let n=0;n<e.length;n++)t.push(r(e[n]));const n=d(...t);return d(a(n.length,192),n)}const t=g(e);return 1===t.length&&t[0]<128?t:d(a(t.length,128),t)}function n(e,t,r){if(r>e.length)throw new Error("invalid RLP (safeSlice): end slice of Uint8Array out-of-bounds");return e.slice(t,r)}function i(e){if(0===e[0])throw new Error("invalid RLP: extra zeros");return u(A(e))}function a(e,t){if(e<56)return Uint8Array.from([e+t]);const r=h(e),n=h(t+55+r.length/2);return Uint8Array.from(l(n+r))}function o(e,t=!1){if(!e||0===e.length)return Uint8Array.from([]);const r=s(g(e));if(t)return r;if(0!==r.remainder.length)throw new Error("invalid RLP: remainder must be zero");return r.data}function s(e){let t,r,a,o,c;const A=[],u=e[0];if(u<=127)return{data:e.slice(0,1),remainder:e.slice(1)};if(u<=183){if(t=u-127,a=128===u?Uint8Array.from([]):n(e,1,t),2===t&&a[0]<128)throw new Error("invalid RLP encoding: invalid prefix, single byte < 0x80 are not prefixed");return{data:a,remainder:e.slice(t)}}if(u<=191){if(r=u-182,e.length-1<r)throw new Error("invalid RLP: not enough bytes for string length");if(t=i(n(e,1,r)),t<=55)throw new Error("invalid RLP: expected string length to be greater than 55");return a=n(e,r,t+r),{data:a,remainder:e.slice(t+r)}}if(u<=247){for(t=u-191,o=n(e,1,t);o.length;)c=s(o),A.push(c.data),o=c.remainder;return{data:A,remainder:e.slice(t)}}{if(r=u-246,t=i(n(e,1,r)),t<56)throw new Error("invalid RLP: encoded list too short");const a=r+t;if(a>e.length)throw new Error("invalid RLP: total length is larger than the data");for(o=n(e,r,a);o.length;)c=s(o),A.push(c.data),o=c.remainder;return{data:A,remainder:e.slice(a)}}}Object.defineProperty(t,"__esModule",{value:!0}),t.utils=t.decode=t.encode=void 0,t.encode=r,t.decode=o;const c=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));function A(e){let t="";for(let r=0;r<e.length;r++)t+=c[e[r]];return t}function u(e){const t=Number.parseInt(e,16);if(Number.isNaN(t))throw new Error("Invalid byte sequence");return t}function l(e){if("string"!=typeof e)throw new TypeError("hexToBytes: expected string, got "+typeof e);if(e.length%2)throw new Error("hexToBytes: received invalid unpadded hex");const t=new Uint8Array(e.length/2);for(let r=0;r<t.length;r++){const n=2*r;t[r]=u(e.slice(n,n+2))}return t}function d(...e){if(1===e.length)return e[0];const t=e.reduce(((e,t)=>e+t.length),0),r=new Uint8Array(t);for(let t=0,n=0;t<e.length;t++){const i=e[t];r.set(i,n),n+=i.length}return r}function p(e){return(new TextEncoder).encode(e)}function h(e){if(e<0)throw new Error("Invalid integer as argument, must be unsigned!");const t=e.toString(16);return t.length%2?`0${t}`:t}function f(e){return e.length>=2&&"0"===e[0]&&"x"===e[1]}function g(e){if(e instanceof Uint8Array)return e;if("string"==typeof e)return f(e)?l((t="string"!=typeof(r=e)?r:f(r)?r.slice(2):r).length%2?`0${t}`:t):p(e);var t,r;if("number"==typeof e||"bigint"==typeof e)return e?l(h(e)):Uint8Array.from([]);if(null==e)return Uint8Array.from([]);throw new Error("toBytes: received unsupported type "+typeof e)}t.utils={bytesToHex:A,concatBytes:d,hexToBytes:l,utf8ToBytes:p};const m={encode:r,decode:o};t.default=m},9509:function(e,t,r){var n=r(8764),i=n.Buffer;function a(e,t){for(var r in e)t[r]=e[r]}function o(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(a(n,t),t.Buffer=o),o.prototype=Object.create(i.prototype),a(i,o),o.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},o.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},4189:function(e,t,r){var n=r(9509).Buffer;function i(e,t){this._block=n.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}i.prototype.update=function(e,t){"string"==typeof e&&(t=t||"utf8",e=n.from(e,t));for(var r=this._block,i=this._blockSize,a=e.length,o=this._len,s=0;s<a;){for(var c=o%i,A=Math.min(a-s,i-c),u=0;u<A;u++)r[c+u]=e[s+u];s+=A,(o+=A)%i==0&&this._update(r)}return this._len+=a,this},i.prototype.digest=function(e){var t=this._len%this._blockSize;this._block[t]=128,this._block.fill(0,t+1),t>=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(4294967295&r)>>>0,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var a=this._hash();return e?a.toString(e):a},i.prototype._update=function(){throw new Error("_update must be implemented by subclass")},e.exports=i},9072:function(e,t,r){var n=e.exports=function(e){e=e.toLowerCase();var t=n[e];if(!t)throw new Error(e+" is not supported (we accept pull requests)");return new t};n.sha=r(4448),n.sha1=r(8336),n.sha224=r(8432),n.sha256=r(7499),n.sha384=r(1686),n.sha512=r(7816)},4448:function(e,t,r){var n=r(5717),i=r(4189),a=r(9509).Buffer,o=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function c(){this.init(),this._w=s,i.call(this,64,56)}function A(e){return e<<30|e>>>2}function u(e,t,r,n){return 0===e?t&r|~t&n:2===e?t&r|t&n|r&n:t^r^n}n(c,i),c.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},c.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,i=0|this._b,a=0|this._c,s=0|this._d,c=0|this._e,l=0;l<16;++l)r[l]=e.readInt32BE(4*l);for(;l<80;++l)r[l]=r[l-3]^r[l-8]^r[l-14]^r[l-16];for(var d=0;d<80;++d){var p=~~(d/20),h=0|((t=n)<<5|t>>>27)+u(p,i,a,s)+c+r[d]+o[p];c=s,s=a,a=A(i),i=n,n=h}this._a=n+this._a|0,this._b=i+this._b|0,this._c=a+this._c|0,this._d=s+this._d|0,this._e=c+this._e|0},c.prototype._hash=function(){var e=a.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=c},8336:function(e,t,r){var n=r(5717),i=r(4189),a=r(9509).Buffer,o=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function c(){this.init(),this._w=s,i.call(this,64,56)}function A(e){return e<<5|e>>>27}function u(e){return e<<30|e>>>2}function l(e,t,r,n){return 0===e?t&r|~t&n:2===e?t&r|t&n|r&n:t^r^n}n(c,i),c.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},c.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,i=0|this._b,a=0|this._c,s=0|this._d,c=0|this._e,d=0;d<16;++d)r[d]=e.readInt32BE(4*d);for(;d<80;++d)r[d]=(t=r[d-3]^r[d-8]^r[d-14]^r[d-16])<<1|t>>>31;for(var p=0;p<80;++p){var h=~~(p/20),f=A(n)+l(h,i,a,s)+c+r[p]+o[h]|0;c=s,s=a,a=u(i),i=n,n=f}this._a=n+this._a|0,this._b=i+this._b|0,this._c=a+this._c|0,this._d=s+this._d|0,this._e=c+this._e|0},c.prototype._hash=function(){var e=a.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=c},8432:function(e,t,r){var n=r(5717),i=r(7499),a=r(4189),o=r(9509).Buffer,s=new Array(64);function c(){this.init(),this._w=s,a.call(this,64,56)}n(c,i),c.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},c.prototype._hash=function(){var e=o.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e},e.exports=c},7499:function(e,t,r){var n=r(5717),i=r(4189),a=r(9509).Buffer,o=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],s=new Array(64);function c(){this.init(),this._w=s,i.call(this,64,56)}function A(e,t,r){return r^e&(t^r)}function u(e,t,r){return e&t|r&(e|t)}function l(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function d(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function p(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}n(c,i),c.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},c.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,i=0|this._b,a=0|this._c,s=0|this._d,c=0|this._e,h=0|this._f,f=0|this._g,g=0|this._h,m=0;m<16;++m)r[m]=e.readInt32BE(4*m);for(;m<64;++m)r[m]=0|(((t=r[m-2])>>>17|t<<15)^(t>>>19|t<<13)^t>>>10)+r[m-7]+p(r[m-15])+r[m-16];for(var y=0;y<64;++y){var I=g+d(c)+A(c,h,f)+o[y]+r[y]|0,C=l(n)+u(n,i,a)|0;g=f,f=h,h=c,c=s+I|0,s=a,a=i,i=n,n=I+C|0}this._a=n+this._a|0,this._b=i+this._b|0,this._c=a+this._c|0,this._d=s+this._d|0,this._e=c+this._e|0,this._f=h+this._f|0,this._g=f+this._g|0,this._h=g+this._h|0},c.prototype._hash=function(){var e=a.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e},e.exports=c},1686:function(e,t,r){var n=r(5717),i=r(7816),a=r(4189),o=r(9509).Buffer,s=new Array(160);function c(){this.init(),this._w=s,a.call(this,128,112)}n(c,i),c.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},c.prototype._hash=function(){var e=o.allocUnsafe(48);function t(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e},e.exports=c},7816:function(e,t,r){var n=r(5717),i=r(4189),a=r(9509).Buffer,o=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],s=new Array(160);function c(){this.init(),this._w=s,i.call(this,128,112)}function A(e,t,r){return r^e&(t^r)}function u(e,t,r){return e&t|r&(e|t)}function l(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function d(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function p(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function h(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function f(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function g(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function m(e,t){return e>>>0<t>>>0?1:0}n(c,i),c.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},c.prototype._update=function(e){for(var t=this._w,r=0|this._ah,n=0|this._bh,i=0|this._ch,a=0|this._dh,s=0|this._eh,c=0|this._fh,y=0|this._gh,I=0|this._hh,C=0|this._al,E=0|this._bl,B=0|this._cl,w=0|this._dl,v=0|this._el,Q=0|this._fl,b=0|this._gl,N=0|this._hl,S=0;S<32;S+=2)t[S]=e.readInt32BE(4*S),t[S+1]=e.readInt32BE(4*S+4);for(;S<160;S+=2){var x=t[S-30],_=t[S-30+1],T=p(x,_),M=h(_,x),R=f(x=t[S-4],_=t[S-4+1]),k=g(_,x),D=t[S-14],z=t[S-14+1],O=t[S-32],U=t[S-32+1],F=M+z|0,P=T+D+m(F,M)|0;P=(P=P+R+m(F=F+k|0,k)|0)+O+m(F=F+U|0,U)|0,t[S]=P,t[S+1]=F}for(var q=0;q<160;q+=2){P=t[q],F=t[q+1];var G=u(r,n,i),L=u(C,E,B),H=l(r,C),j=l(C,r),Y=d(s,v),K=d(v,s),V=o[q],$=o[q+1],J=A(s,c,y),W=A(v,Q,b),X=N+K|0,Z=I+Y+m(X,N)|0;Z=(Z=(Z=Z+J+m(X=X+W|0,W)|0)+V+m(X=X+$|0,$)|0)+P+m(X=X+F|0,F)|0;var ee=j+L|0,te=H+G+m(ee,j)|0;I=y,N=b,y=c,b=Q,c=s,Q=v,s=a+Z+m(v=w+X|0,w)|0,a=i,w=B,i=n,B=E,n=r,E=C,r=Z+te+m(C=X+ee|0,X)|0}this._al=this._al+C|0,this._bl=this._bl+E|0,this._cl=this._cl+B|0,this._dl=this._dl+w|0,this._el=this._el+v|0,this._fl=this._fl+Q|0,this._gl=this._gl+b|0,this._hl=this._hl+N|0,this._ah=this._ah+r+m(this._al,C)|0,this._bh=this._bh+n+m(this._bl,E)|0,this._ch=this._ch+i+m(this._cl,B)|0,this._dh=this._dh+a+m(this._dl,w)|0,this._eh=this._eh+s+m(this._el,v)|0,this._fh=this._fh+c+m(this._fl,Q)|0,this._gh=this._gh+y+m(this._gl,b)|0,this._hh=this._hh+I+m(this._hl,N)|0},c.prototype._hash=function(){var e=a.allocUnsafe(64);function t(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e},e.exports=c},2182:function(e,t,r){!function(t,n){"use strict";e.exports?e.exports=n(r(780)):t.nacl.auth=n(t.nacl)}(this,(function(e){"use strict";if(!e)throw new Error("tweetnacl not loaded");var t=128;function r(r,n){var i,a,o=new Uint8Array(t+Math.max(64,r.length));for(n.length>t&&(n=e.hash(n)),i=0;i<t;i++)o[i]=54;for(i=0;i<n.length;i++)o[i]^=n[i];for(o.set(r,t),a=e.hash(o.subarray(0,t+r.length)),i=0;i<t;i++)o[i]=92;for(i=0;i<n.length;i++)o[i]^=n[i];return o.set(a,t),e.hash(o.subarray(0,t+a.length))}function n(e,t){var n=new Uint8Array(32);return n.set(r(e,t).subarray(0,32)),n}return n.full=function(e,t){return r(e,t)},n.authLength=32,n.authFullLength=64,n.keyLength=32,n}))},780:function(e,t,r){!function(e){"use strict";var t=function(e){var t,r=new Float64Array(16);if(e)for(t=0;t<e.length;t++)r[t]=e[t];return r},n=function(){throw new Error("no PRNG")},i=new Uint8Array(16),a=new Uint8Array(32);a[0]=9;var o=t(),s=t([1]),c=t([56129,1]),A=t([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),u=t([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),l=t([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),d=t([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),p=t([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function h(e,t,r,n){e[t]=r>>24&255,e[t+1]=r>>16&255,e[t+2]=r>>8&255,e[t+3]=255&r,e[t+4]=n>>24&255,e[t+5]=n>>16&255,e[t+6]=n>>8&255,e[t+7]=255&n}function f(e,t,r,n,i){var a,o=0;for(a=0;a<i;a++)o|=e[t+a]^r[n+a];return(1&o-1>>>8)-1}function g(e,t,r,n){return f(e,t,r,n,16)}function m(e,t,r,n){return f(e,t,r,n,32)}function y(e,t,r,n){!function(e,t,r,n){for(var i,a=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,o=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,s=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,c=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,A=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,u=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,l=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,d=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,p=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,h=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,f=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,g=255&r[16]|(255&r[17])<<8|(255&r[18])<<16|(255&r[19])<<24,m=255&r[20]|(255&r[21])<<8|(255&r[22])<<16|(255&r[23])<<24,y=255&r[24]|(255&r[25])<<8|(255&r[26])<<16|(255&r[27])<<24,I=255&r[28]|(255&r[29])<<8|(255&r[30])<<16|(255&r[31])<<24,C=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,E=a,B=o,w=s,v=c,Q=A,b=u,N=l,S=d,x=p,_=h,T=f,M=g,R=m,k=y,D=I,z=C,O=0;O<20;O+=2)E^=(i=(R^=(i=(x^=(i=(Q^=(i=E+R|0)<<7|i>>>25)+E|0)<<9|i>>>23)+Q|0)<<13|i>>>19)+x|0)<<18|i>>>14,b^=(i=(B^=(i=(k^=(i=(_^=(i=b+B|0)<<7|i>>>25)+b|0)<<9|i>>>23)+_|0)<<13|i>>>19)+k|0)<<18|i>>>14,T^=(i=(N^=(i=(w^=(i=(D^=(i=T+N|0)<<7|i>>>25)+T|0)<<9|i>>>23)+D|0)<<13|i>>>19)+w|0)<<18|i>>>14,z^=(i=(M^=(i=(S^=(i=(v^=(i=z+M|0)<<7|i>>>25)+z|0)<<9|i>>>23)+v|0)<<13|i>>>19)+S|0)<<18|i>>>14,E^=(i=(v^=(i=(w^=(i=(B^=(i=E+v|0)<<7|i>>>25)+E|0)<<9|i>>>23)+B|0)<<13|i>>>19)+w|0)<<18|i>>>14,b^=(i=(Q^=(i=(S^=(i=(N^=(i=b+Q|0)<<7|i>>>25)+b|0)<<9|i>>>23)+N|0)<<13|i>>>19)+S|0)<<18|i>>>14,T^=(i=(_^=(i=(x^=(i=(M^=(i=T+_|0)<<7|i>>>25)+T|0)<<9|i>>>23)+M|0)<<13|i>>>19)+x|0)<<18|i>>>14,z^=(i=(D^=(i=(k^=(i=(R^=(i=z+D|0)<<7|i>>>25)+z|0)<<9|i>>>23)+R|0)<<13|i>>>19)+k|0)<<18|i>>>14;E=E+a|0,B=B+o|0,w=w+s|0,v=v+c|0,Q=Q+A|0,b=b+u|0,N=N+l|0,S=S+d|0,x=x+p|0,_=_+h|0,T=T+f|0,M=M+g|0,R=R+m|0,k=k+y|0,D=D+I|0,z=z+C|0,e[0]=E>>>0&255,e[1]=E>>>8&255,e[2]=E>>>16&255,e[3]=E>>>24&255,e[4]=B>>>0&255,e[5]=B>>>8&255,e[6]=B>>>16&255,e[7]=B>>>24&255,e[8]=w>>>0&255,e[9]=w>>>8&255,e[10]=w>>>16&255,e[11]=w>>>24&255,e[12]=v>>>0&255,e[13]=v>>>8&255,e[14]=v>>>16&255,e[15]=v>>>24&255,e[16]=Q>>>0&255,e[17]=Q>>>8&255,e[18]=Q>>>16&255,e[19]=Q>>>24&255,e[20]=b>>>0&255,e[21]=b>>>8&255,e[22]=b>>>16&255,e[23]=b>>>24&255,e[24]=N>>>0&255,e[25]=N>>>8&255,e[26]=N>>>16&255,e[27]=N>>>24&255,e[28]=S>>>0&255,e[29]=S>>>8&255,e[30]=S>>>16&255,e[31]=S>>>24&255,e[32]=x>>>0&255,e[33]=x>>>8&255,e[34]=x>>>16&255,e[35]=x>>>24&255,e[36]=_>>>0&255,e[37]=_>>>8&255,e[38]=_>>>16&255,e[39]=_>>>24&255,e[40]=T>>>0&255,e[41]=T>>>8&255,e[42]=T>>>16&255,e[43]=T>>>24&255,e[44]=M>>>0&255,e[45]=M>>>8&255,e[46]=M>>>16&255,e[47]=M>>>24&255,e[48]=R>>>0&255,e[49]=R>>>8&255,e[50]=R>>>16&255,e[51]=R>>>24&255,e[52]=k>>>0&255,e[53]=k>>>8&255,e[54]=k>>>16&255,e[55]=k>>>24&255,e[56]=D>>>0&255,e[57]=D>>>8&255,e[58]=D>>>16&255,e[59]=D>>>24&255,e[60]=z>>>0&255,e[61]=z>>>8&255,e[62]=z>>>16&255,e[63]=z>>>24&255}(e,t,r,n)}function I(e,t,r,n){!function(e,t,r,n){for(var i,a=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,o=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,s=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,c=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,A=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,u=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,l=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,d=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,p=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,h=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,f=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,g=255&r[16]|(255&r[17])<<8|(255&r[18])<<16|(255&r[19])<<24,m=255&r[20]|(255&r[21])<<8|(255&r[22])<<16|(255&r[23])<<24,y=255&r[24]|(255&r[25])<<8|(255&r[26])<<16|(255&r[27])<<24,I=255&r[28]|(255&r[29])<<8|(255&r[30])<<16|(255&r[31])<<24,C=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,E=0;E<20;E+=2)a^=(i=(m^=(i=(p^=(i=(A^=(i=a+m|0)<<7|i>>>25)+a|0)<<9|i>>>23)+A|0)<<13|i>>>19)+p|0)<<18|i>>>14,u^=(i=(o^=(i=(y^=(i=(h^=(i=u+o|0)<<7|i>>>25)+u|0)<<9|i>>>23)+h|0)<<13|i>>>19)+y|0)<<18|i>>>14,f^=(i=(l^=(i=(s^=(i=(I^=(i=f+l|0)<<7|i>>>25)+f|0)<<9|i>>>23)+I|0)<<13|i>>>19)+s|0)<<18|i>>>14,C^=(i=(g^=(i=(d^=(i=(c^=(i=C+g|0)<<7|i>>>25)+C|0)<<9|i>>>23)+c|0)<<13|i>>>19)+d|0)<<18|i>>>14,a^=(i=(c^=(i=(s^=(i=(o^=(i=a+c|0)<<7|i>>>25)+a|0)<<9|i>>>23)+o|0)<<13|i>>>19)+s|0)<<18|i>>>14,u^=(i=(A^=(i=(d^=(i=(l^=(i=u+A|0)<<7|i>>>25)+u|0)<<9|i>>>23)+l|0)<<13|i>>>19)+d|0)<<18|i>>>14,f^=(i=(h^=(i=(p^=(i=(g^=(i=f+h|0)<<7|i>>>25)+f|0)<<9|i>>>23)+g|0)<<13|i>>>19)+p|0)<<18|i>>>14,C^=(i=(I^=(i=(y^=(i=(m^=(i=C+I|0)<<7|i>>>25)+C|0)<<9|i>>>23)+m|0)<<13|i>>>19)+y|0)<<18|i>>>14;e[0]=a>>>0&255,e[1]=a>>>8&255,e[2]=a>>>16&255,e[3]=a>>>24&255,e[4]=u>>>0&255,e[5]=u>>>8&255,e[6]=u>>>16&255,e[7]=u>>>24&255,e[8]=f>>>0&255,e[9]=f>>>8&255,e[10]=f>>>16&255,e[11]=f>>>24&255,e[12]=C>>>0&255,e[13]=C>>>8&255,e[14]=C>>>16&255,e[15]=C>>>24&255,e[16]=l>>>0&255,e[17]=l>>>8&255,e[18]=l>>>16&255,e[19]=l>>>24&255,e[20]=d>>>0&255,e[21]=d>>>8&255,e[22]=d>>>16&255,e[23]=d>>>24&255,e[24]=p>>>0&255,e[25]=p>>>8&255,e[26]=p>>>16&255,e[27]=p>>>24&255,e[28]=h>>>0&255,e[29]=h>>>8&255,e[30]=h>>>16&255,e[31]=h>>>24&255}(e,t,r,n)}var C=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function E(e,t,r,n,i,a,o){var s,c,A=new Uint8Array(16),u=new Uint8Array(64);for(c=0;c<16;c++)A[c]=0;for(c=0;c<8;c++)A[c]=a[c];for(;i>=64;){for(y(u,A,o,C),c=0;c<64;c++)e[t+c]=r[n+c]^u[c];for(s=1,c=8;c<16;c++)s=s+(255&A[c])|0,A[c]=255&s,s>>>=8;i-=64,t+=64,n+=64}if(i>0)for(y(u,A,o,C),c=0;c<i;c++)e[t+c]=r[n+c]^u[c];return 0}function B(e,t,r,n,i){var a,o,s=new Uint8Array(16),c=new Uint8Array(64);for(o=0;o<16;o++)s[o]=0;for(o=0;o<8;o++)s[o]=n[o];for(;r>=64;){for(y(c,s,i,C),o=0;o<64;o++)e[t+o]=c[o];for(a=1,o=8;o<16;o++)a=a+(255&s[o])|0,s[o]=255&a,a>>>=8;r-=64,t+=64}if(r>0)for(y(c,s,i,C),o=0;o<r;o++)e[t+o]=c[o];return 0}function w(e,t,r,n,i){var a=new Uint8Array(32);I(a,n,i,C);for(var o=new Uint8Array(8),s=0;s<8;s++)o[s]=n[s+16];return B(e,t,r,o,a)}function v(e,t,r,n,i,a,o){var s=new Uint8Array(32);I(s,a,o,C);for(var c=new Uint8Array(8),A=0;A<8;A++)c[A]=a[A+16];return E(e,t,r,n,i,c,s)}var Q=function(e){var t,r,n,i,a,o,s,c;this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.leftover=0,this.fin=0,t=255&e[0]|(255&e[1])<<8,this.r[0]=8191&t,r=255&e[2]|(255&e[3])<<8,this.r[1]=8191&(t>>>13|r<<3),n=255&e[4]|(255&e[5])<<8,this.r[2]=7939&(r>>>10|n<<6),i=255&e[6]|(255&e[7])<<8,this.r[3]=8191&(n>>>7|i<<9),a=255&e[8]|(255&e[9])<<8,this.r[4]=255&(i>>>4|a<<12),this.r[5]=a>>>1&8190,o=255&e[10]|(255&e[11])<<8,this.r[6]=8191&(a>>>14|o<<2),s=255&e[12]|(255&e[13])<<8,this.r[7]=8065&(o>>>11|s<<5),c=255&e[14]|(255&e[15])<<8,this.r[8]=8191&(s>>>8|c<<8),this.r[9]=c>>>5&127,this.pad[0]=255&e[16]|(255&e[17])<<8,this.pad[1]=255&e[18]|(255&e[19])<<8,this.pad[2]=255&e[20]|(255&e[21])<<8,this.pad[3]=255&e[22]|(255&e[23])<<8,this.pad[4]=255&e[24]|(255&e[25])<<8,this.pad[5]=255&e[26]|(255&e[27])<<8,this.pad[6]=255&e[28]|(255&e[29])<<8,this.pad[7]=255&e[30]|(255&e[31])<<8};function b(e,t,r,n,i,a){var o=new Q(a);return o.update(r,n,i),o.finish(e,t),0}function N(e,t,r,n,i,a){var o=new Uint8Array(16);return b(o,0,r,n,i,a),g(e,t,o,0)}function S(e,t,r,n,i){var a;if(r<32)return-1;for(v(e,0,t,0,r,n,i),b(e,16,e,32,r-32,e),a=0;a<16;a++)e[a]=0;return 0}function x(e,t,r,n,i){var a,o=new Uint8Array(32);if(r<32)return-1;if(w(o,0,32,n,i),0!==N(t,16,t,32,r-32,o))return-1;for(v(e,0,t,0,r,n,i),a=0;a<32;a++)e[a]=0;return 0}function _(e,t){var r;for(r=0;r<16;r++)e[r]=0|t[r]}function T(e){var t,r,n=1;for(t=0;t<16;t++)r=e[t]+n+65535,n=Math.floor(r/65536),e[t]=r-65536*n;e[0]+=n-1+37*(n-1)}function M(e,t,r){for(var n,i=~(r-1),a=0;a<16;a++)n=i&(e[a]^t[a]),e[a]^=n,t[a]^=n}function R(e,r){var n,i,a,o=t(),s=t();for(n=0;n<16;n++)s[n]=r[n];for(T(s),T(s),T(s),i=0;i<2;i++){for(o[0]=s[0]-65517,n=1;n<15;n++)o[n]=s[n]-65535-(o[n-1]>>16&1),o[n-1]&=65535;o[15]=s[15]-32767-(o[14]>>16&1),a=o[15]>>16&1,o[14]&=65535,M(s,o,1-a)}for(n=0;n<16;n++)e[2*n]=255&s[n],e[2*n+1]=s[n]>>8}function k(e,t){var r=new Uint8Array(32),n=new Uint8Array(32);return R(r,e),R(n,t),m(r,0,n,0)}function D(e){var t=new Uint8Array(32);return R(t,e),1&t[0]}function z(e,t){var r;for(r=0;r<16;r++)e[r]=t[2*r]+(t[2*r+1]<<8);e[15]&=32767}function O(e,t,r){for(var n=0;n<16;n++)e[n]=t[n]+r[n]}function U(e,t,r){for(var n=0;n<16;n++)e[n]=t[n]-r[n]}function F(e,t,r){var n,i,a=0,o=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F),c+=38*(v+=n*P),A+=38*(Q+=n*q),u+=38*(b+=n*G),l+=38*(N+=n*L),d+=38*(S+=n*H),p+=38*(x+=n*j),h+=38*(_+=n*Y),f+=38*(T+=n*K),g+=38*(M+=n*V),m+=38*(R+=n*$),y+=38*(k+=n*J),I+=38*(D+=n*W),a=(n=(a+=38*(E+=n*O))+(i=1)+65535)-65536*(i=Math.floor(n/65536)),o=(n=o+i+65535)-65536*(i=Math.floor(n/65536)),s=(n=s+i+65535)-65536*(i=Math.floor(n/65536)),c=(n=c+i+65535)-65536*(i=Math.floor(n/65536)),A=(n=A+i+65535)-65536*(i=Math.floor(n/65536)),u=(n=u+i+65535)-65536*(i=Math.floor(n/65536)),l=(n=l+i+65535)-65536*(i=Math.floor(n/65536)),d=(n=d+i+65535)-65536*(i=Math.floor(n/65536)),p=(n=p+i+65535)-65536*(i=Math.floor(n/65536)),h=(n=h+i+65535)-65536*(i=Math.floor(n/65536)),f=(n=f+i+65535)-65536*(i=Math.floor(n/65536)),g=(n=g+i+65535)-65536*(i=Math.floor(n/65536)),m=(n=m+i+65535)-65536*(i=Math.floor(n/65536)),y=(n=y+i+65535)-65536*(i=Math.floor(n/65536)),I=(n=I+i+65535)-65536*(i=Math.floor(n/65536)),C=(n=C+i+65535)-65536*(i=Math.floor(n/65536)),a=(n=(a+=i-1+37*(i-1))+(i=1)+65535)-65536*(i=Math.floor(n/65536)),o=(n=o+i+65535)-65536*(i=Math.floor(n/65536)),s=(n=s+i+65535)-65536*(i=Math.floor(n/65536)),c=(n=c+i+65535)-65536*(i=Math.floor(n/65536)),A=(n=A+i+65535)-65536*(i=Math.floor(n/65536)),u=(n=u+i+65535)-65536*(i=Math.floor(n/65536)),l=(n=l+i+65535)-65536*(i=Math.floor(n/65536)),d=(n=d+i+65535)-65536*(i=Math.floor(n/65536)),p=(n=p+i+65535)-65536*(i=Math.floor(n/65536)),h=(n=h+i+65535)-65536*(i=Math.floor(n/65536)),f=(n=f+i+65535)-65536*(i=Math.floor(n/65536)),g=(n=g+i+65535)-65536*(i=Math.floor(n/65536)),m=(n=m+i+65535)-65536*(i=Math.floor(n/65536)),y=(n=y+i+65535)-65536*(i=Math.floor(n/65536)),I=(n=I+i+65535)-65536*(i=Math.floor(n/65536)),C=(n=C+i+65535)-65536*(i=Math.floor(n/65536)),a+=i-1+37*(i-1),e[0]=a,e[1]=o,e[2]=s,e[3]=c,e[4]=A,e[5]=u,e[6]=l,e[7]=d,e[8]=p,e[9]=h,e[10]=f,e[11]=g,e[12]=m,e[13]=y,e[14]=I,e[15]=C}function P(e,t){F(e,t,t)}function q(e,r){var n,i=t();for(n=0;n<16;n++)i[n]=r[n];for(n=253;n>=0;n--)P(i,i),2!==n&&4!==n&&F(i,i,r);for(n=0;n<16;n++)e[n]=i[n]}function G(e,r){var n,i=t();for(n=0;n<16;n++)i[n]=r[n];for(n=250;n>=0;n--)P(i,i),1!==n&&F(i,i,r);for(n=0;n<16;n++)e[n]=i[n]}function L(e,r,n){var i,a,o=new Uint8Array(32),s=new Float64Array(80),A=t(),u=t(),l=t(),d=t(),p=t(),h=t();for(a=0;a<31;a++)o[a]=r[a];for(o[31]=127&r[31]|64,o[0]&=248,z(s,n),a=0;a<16;a++)u[a]=s[a],d[a]=A[a]=l[a]=0;for(A[0]=d[0]=1,a=254;a>=0;--a)M(A,u,i=o[a>>>3]>>>(7&a)&1),M(l,d,i),O(p,A,l),U(A,A,l),O(l,u,d),U(u,u,d),P(d,p),P(h,A),F(A,l,A),F(l,u,p),O(p,A,l),U(A,A,l),P(u,A),U(l,d,h),F(A,l,c),O(A,A,d),F(l,l,A),F(A,d,h),F(d,u,s),P(u,p),M(A,u,i),M(l,d,i);for(a=0;a<16;a++)s[a+16]=A[a],s[a+32]=l[a],s[a+48]=u[a],s[a+64]=d[a];var f=s.subarray(32),g=s.subarray(16);return q(f,f),F(g,g,f),R(e,g),0}function H(e,t){return L(e,t,a)}function j(e,t){return n(t,32),H(e,t)}function Y(e,t,r){var n=new Uint8Array(32);return L(n,r,t),I(e,i,n,C)}Q.prototype.blocks=function(e,t,r){for(var n,i,a,o,s,c,A,u,l,d,p,h,f,g,m,y,I,C,E,B=this.fin?0:2048,w=this.h[0],v=this.h[1],Q=this.h[2],b=this.h[3],N=this.h[4],S=this.h[5],x=this.h[6],_=this.h[7],T=this.h[8],M=this.h[9],R=this.r[0],k=this.r[1],D=this.r[2],z=this.r[3],O=this.r[4],U=this.r[5],F=this.r[6],P=this.r[7],q=this.r[8],G=this.r[9];r>=16;)d=l=0,d+=(w+=8191&(n=255&e[t+0]|(255&e[t+1])<<8))*R,d+=(v+=8191&(n>>>13|(i=255&e[t+2]|(255&e[t+3])<<8)<<3))*(5*G),d+=(Q+=8191&(i>>>10|(a=255&e[t+4]|(255&e[t+5])<<8)<<6))*(5*q),d+=(b+=8191&(a>>>7|(o=255&e[t+6]|(255&e[t+7])<<8)<<9))*(5*P),l=(d+=(N+=8191&(o>>>4|(s=255&e[t+8]|(255&e[t+9])<<8)<<12))*(5*F))>>>13,d&=8191,d+=(S+=s>>>1&8191)*(5*U),d+=(x+=8191&(s>>>14|(c=255&e[t+10]|(255&e[t+11])<<8)<<2))*(5*O),d+=(_+=8191&(c>>>11|(A=255&e[t+12]|(255&e[t+13])<<8)<<5))*(5*z),d+=(T+=8191&(A>>>8|(u=255&e[t+14]|(255&e[t+15])<<8)<<8))*(5*D),p=l+=(d+=(M+=u>>>5|B)*(5*k))>>>13,p+=w*k,p+=v*R,p+=Q*(5*G),p+=b*(5*q),l=(p+=N*(5*P))>>>13,p&=8191,p+=S*(5*F),p+=x*(5*U),p+=_*(5*O),p+=T*(5*z),l+=(p+=M*(5*D))>>>13,p&=8191,h=l,h+=w*D,h+=v*k,h+=Q*R,h+=b*(5*G),l=(h+=N*(5*q))>>>13,h&=8191,h+=S*(5*P),h+=x*(5*F),h+=_*(5*U),h+=T*(5*O),f=l+=(h+=M*(5*z))>>>13,f+=w*z,f+=v*D,f+=Q*k,f+=b*R,l=(f+=N*(5*G))>>>13,f&=8191,f+=S*(5*q),f+=x*(5*P),f+=_*(5*F),f+=T*(5*U),g=l+=(f+=M*(5*O))>>>13,g+=w*O,g+=v*z,g+=Q*D,g+=b*k,l=(g+=N*R)>>>13,g&=8191,g+=S*(5*G),g+=x*(5*q),g+=_*(5*P),g+=T*(5*F),m=l+=(g+=M*(5*U))>>>13,m+=w*U,m+=v*O,m+=Q*z,m+=b*D,l=(m+=N*k)>>>13,m&=8191,m+=S*R,m+=x*(5*G),m+=_*(5*q),m+=T*(5*P),y=l+=(m+=M*(5*F))>>>13,y+=w*F,y+=v*U,y+=Q*O,y+=b*z,l=(y+=N*D)>>>13,y&=8191,y+=S*k,y+=x*R,y+=_*(5*G),y+=T*(5*q),I=l+=(y+=M*(5*P))>>>13,I+=w*P,I+=v*F,I+=Q*U,I+=b*O,l=(I+=N*z)>>>13,I&=8191,I+=S*D,I+=x*k,I+=_*R,I+=T*(5*G),C=l+=(I+=M*(5*q))>>>13,C+=w*q,C+=v*P,C+=Q*F,C+=b*U,l=(C+=N*O)>>>13,C&=8191,C+=S*z,C+=x*D,C+=_*k,C+=T*R,E=l+=(C+=M*(5*G))>>>13,E+=w*G,E+=v*q,E+=Q*P,E+=b*F,l=(E+=N*U)>>>13,E&=8191,E+=S*O,E+=x*z,E+=_*D,E+=T*k,w=d=8191&(l=(l=((l+=(E+=M*R)>>>13)<<2)+l|0)+(d&=8191)|0),v=p+=l>>>=13,Q=h&=8191,b=f&=8191,N=g&=8191,S=m&=8191,x=y&=8191,_=I&=8191,T=C&=8191,M=E&=8191,t+=16,r-=16;this.h[0]=w,this.h[1]=v,this.h[2]=Q,this.h[3]=b,this.h[4]=N,this.h[5]=S,this.h[6]=x,this.h[7]=_,this.h[8]=T,this.h[9]=M},Q.prototype.finish=function(e,t){var r,n,i,a,o=new Uint16Array(10);if(this.leftover){for(a=this.leftover,this.buffer[a++]=1;a<16;a++)this.buffer[a]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(r=this.h[1]>>>13,this.h[1]&=8191,a=2;a<10;a++)this.h[a]+=r,r=this.h[a]>>>13,this.h[a]&=8191;for(this.h[0]+=5*r,r=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=r,r=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=r,o[0]=this.h[0]+5,r=o[0]>>>13,o[0]&=8191,a=1;a<10;a++)o[a]=this.h[a]+r,r=o[a]>>>13,o[a]&=8191;for(o[9]-=8192,n=(1^r)-1,a=0;a<10;a++)o[a]&=n;for(n=~n,a=0;a<10;a++)this.h[a]=this.h[a]&n|o[a];for(this.h[0]=65535&(this.h[0]|this.h[1]<<13),this.h[1]=65535&(this.h[1]>>>3|this.h[2]<<10),this.h[2]=65535&(this.h[2]>>>6|this.h[3]<<7),this.h[3]=65535&(this.h[3]>>>9|this.h[4]<<4),this.h[4]=65535&(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14),this.h[5]=65535&(this.h[6]>>>2|this.h[7]<<11),this.h[6]=65535&(this.h[7]>>>5|this.h[8]<<8),this.h[7]=65535&(this.h[8]>>>8|this.h[9]<<5),i=this.h[0]+this.pad[0],this.h[0]=65535&i,a=1;a<8;a++)i=(this.h[a]+this.pad[a]|0)+(i>>>16)|0,this.h[a]=65535&i;e[t+0]=this.h[0]>>>0&255,e[t+1]=this.h[0]>>>8&255,e[t+2]=this.h[1]>>>0&255,e[t+3]=this.h[1]>>>8&255,e[t+4]=this.h[2]>>>0&255,e[t+5]=this.h[2]>>>8&255,e[t+6]=this.h[3]>>>0&255,e[t+7]=this.h[3]>>>8&255,e[t+8]=this.h[4]>>>0&255,e[t+9]=this.h[4]>>>8&255,e[t+10]=this.h[5]>>>0&255,e[t+11]=this.h[5]>>>8&255,e[t+12]=this.h[6]>>>0&255,e[t+13]=this.h[6]>>>8&255,e[t+14]=this.h[7]>>>0&255,e[t+15]=this.h[7]>>>8&255},Q.prototype.update=function(e,t,r){var n,i;if(this.leftover){for((i=16-this.leftover)>r&&(i=r),n=0;n<i;n++)this.buffer[this.leftover+n]=e[t+n];if(r-=i,t+=i,this.leftover+=i,this.leftover<16)return;this.blocks(this.buffer,0,16),this.leftover=0}if(r>=16&&(i=r-r%16,this.blocks(e,t,i),t+=i,r-=i),r){for(n=0;n<r;n++)this.buffer[this.leftover+n]=e[t+n];this.leftover+=r}};var K=S,V=x,$=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function J(e,t,r,n){for(var i,a,o,s,c,A,u,l,d,p,h,f,g,m,y,I,C,E,B,w,v,Q,b,N,S,x,_=new Int32Array(16),T=new Int32Array(16),M=e[0],R=e[1],k=e[2],D=e[3],z=e[4],O=e[5],U=e[6],F=e[7],P=t[0],q=t[1],G=t[2],L=t[3],H=t[4],j=t[5],Y=t[6],K=t[7],V=0;n>=128;){for(B=0;B<16;B++)w=8*B+V,_[B]=r[w+0]<<24|r[w+1]<<16|r[w+2]<<8|r[w+3],T[B]=r[w+4]<<24|r[w+5]<<16|r[w+6]<<8|r[w+7];for(B=0;B<80;B++)if(i=M,a=R,o=k,s=D,c=z,A=O,u=U,d=P,p=q,h=G,f=L,g=H,m=j,y=Y,b=65535&(Q=K),N=Q>>>16,S=65535&(v=F),x=v>>>16,b+=65535&(Q=(H>>>14|z<<18)^(H>>>18|z<<14)^(z>>>9|H<<23)),N+=Q>>>16,S+=65535&(v=(z>>>14|H<<18)^(z>>>18|H<<14)^(H>>>9|z<<23)),x+=v>>>16,b+=65535&(Q=H&j^~H&Y),N+=Q>>>16,S+=65535&(v=z&O^~z&U),x+=v>>>16,b+=65535&(Q=$[2*B+1]),N+=Q>>>16,S+=65535&(v=$[2*B]),x+=v>>>16,v=_[B%16],N+=(Q=T[B%16])>>>16,S+=65535&v,x+=v>>>16,S+=(N+=(b+=65535&Q)>>>16)>>>16,b=65535&(Q=E=65535&b|N<<16),N=Q>>>16,S=65535&(v=C=65535&S|(x+=S>>>16)<<16),x=v>>>16,b+=65535&(Q=(P>>>28|M<<4)^(M>>>2|P<<30)^(M>>>7|P<<25)),N+=Q>>>16,S+=65535&(v=(M>>>28|P<<4)^(P>>>2|M<<30)^(P>>>7|M<<25)),x+=v>>>16,N+=(Q=P&q^P&G^q&G)>>>16,S+=65535&(v=M&R^M&k^R&k),x+=v>>>16,l=65535&(S+=(N+=(b+=65535&Q)>>>16)>>>16)|(x+=S>>>16)<<16,I=65535&b|N<<16,b=65535&(Q=f),N=Q>>>16,S=65535&(v=s),x=v>>>16,N+=(Q=E)>>>16,S+=65535&(v=C),x+=v>>>16,R=i,k=a,D=o,z=s=65535&(S+=(N+=(b+=65535&Q)>>>16)>>>16)|(x+=S>>>16)<<16,O=c,U=A,F=u,M=l,q=d,G=p,L=h,H=f=65535&b|N<<16,j=g,Y=m,K=y,P=I,B%16==15)for(w=0;w<16;w++)v=_[w],b=65535&(Q=T[w]),N=Q>>>16,S=65535&v,x=v>>>16,v=_[(w+9)%16],b+=65535&(Q=T[(w+9)%16]),N+=Q>>>16,S+=65535&v,x+=v>>>16,C=_[(w+1)%16],b+=65535&(Q=((E=T[(w+1)%16])>>>1|C<<31)^(E>>>8|C<<24)^(E>>>7|C<<25)),N+=Q>>>16,S+=65535&(v=(C>>>1|E<<31)^(C>>>8|E<<24)^C>>>7),x+=v>>>16,C=_[(w+14)%16],N+=(Q=((E=T[(w+14)%16])>>>19|C<<13)^(C>>>29|E<<3)^(E>>>6|C<<26))>>>16,S+=65535&(v=(C>>>19|E<<13)^(E>>>29|C<<3)^C>>>6),x+=v>>>16,x+=(S+=(N+=(b+=65535&Q)>>>16)>>>16)>>>16,_[w]=65535&S|x<<16,T[w]=65535&b|N<<16;b=65535&(Q=P),N=Q>>>16,S=65535&(v=M),x=v>>>16,v=e[0],N+=(Q=t[0])>>>16,S+=65535&v,x+=v>>>16,x+=(S+=(N+=(b+=65535&Q)>>>16)>>>16)>>>16,e[0]=M=65535&S|x<<16,t[0]=P=65535&b|N<<16,b=65535&(Q=q),N=Q>>>16,S=65535&(v=R),x=v>>>16,v=e[1],N+=(Q=t[1])>>>16,S+=65535&v,x+=v>>>16,x+=(S+=(N+=(b+=65535&Q)>>>16)>>>16)>>>16,e[1]=R=65535&S|x<<16,t[1]=q=65535&b|N<<16,b=65535&(Q=G),N=Q>>>16,S=65535&(v=k),x=v>>>16,v=e[2],N+=(Q=t[2])>>>16,S+=65535&v,x+=v>>>16,x+=(S+=(N+=(b+=65535&Q)>>>16)>>>16)>>>16,e[2]=k=65535&S|x<<16,t[2]=G=65535&b|N<<16,b=65535&(Q=L),N=Q>>>16,S=65535&(v=D),x=v>>>16,v=e[3],N+=(Q=t[3])>>>16,S+=65535&v,x+=v>>>16,x+=(S+=(N+=(b+=65535&Q)>>>16)>>>16)>>>16,e[3]=D=65535&S|x<<16,t[3]=L=65535&b|N<<16,b=65535&(Q=H),N=Q>>>16,S=65535&(v=z),x=v>>>16,v=e[4],N+=(Q=t[4])>>>16,S+=65535&v,x+=v>>>16,x+=(S+=(N+=(b+=65535&Q)>>>16)>>>16)>>>16,e[4]=z=65535&S|x<<16,t[4]=H=65535&b|N<<16,b=65535&(Q=j),N=Q>>>16,S=65535&(v=O),x=v>>>16,v=e[5],N+=(Q=t[5])>>>16,S+=65535&v,x+=v>>>16,x+=(S+=(N+=(b+=65535&Q)>>>16)>>>16)>>>16,e[5]=O=65535&S|x<<16,t[5]=j=65535&b|N<<16,b=65535&(Q=Y),N=Q>>>16,S=65535&(v=U),x=v>>>16,v=e[6],N+=(Q=t[6])>>>16,S+=65535&v,x+=v>>>16,x+=(S+=(N+=(b+=65535&Q)>>>16)>>>16)>>>16,e[6]=U=65535&S|x<<16,t[6]=Y=65535&b|N<<16,b=65535&(Q=K),N=Q>>>16,S=65535&(v=F),x=v>>>16,v=e[7],N+=(Q=t[7])>>>16,S+=65535&v,x+=v>>>16,x+=(S+=(N+=(b+=65535&Q)>>>16)>>>16)>>>16,e[7]=F=65535&S|x<<16,t[7]=K=65535&b|N<<16,V+=128,n-=128}return n}function W(e,t,r){var n,i=new Int32Array(8),a=new Int32Array(8),o=new Uint8Array(256),s=r;for(i[0]=1779033703,i[1]=3144134277,i[2]=1013904242,i[3]=2773480762,i[4]=1359893119,i[5]=2600822924,i[6]=528734635,i[7]=1541459225,a[0]=4089235720,a[1]=2227873595,a[2]=4271175723,a[3]=1595750129,a[4]=2917565137,a[5]=725511199,a[6]=4215389547,a[7]=327033209,J(i,a,t,r),r%=128,n=0;n<r;n++)o[n]=t[s-r+n];for(o[r]=128,o[(r=256-128*(r<112?1:0))-9]=0,h(o,r-8,s/536870912|0,s<<3),J(i,a,o,r),n=0;n<8;n++)h(e,8*n,i[n],a[n]);return 0}function X(e,r){var n=t(),i=t(),a=t(),o=t(),s=t(),c=t(),A=t(),l=t(),d=t();U(n,e[1],e[0]),U(d,r[1],r[0]),F(n,n,d),O(i,e[0],e[1]),O(d,r[0],r[1]),F(i,i,d),F(a,e[3],r[3]),F(a,a,u),F(o,e[2],r[2]),O(o,o,o),U(s,i,n),U(c,o,a),O(A,o,a),O(l,i,n),F(e[0],s,c),F(e[1],l,A),F(e[2],A,c),F(e[3],s,l)}function Z(e,t,r){var n;for(n=0;n<4;n++)M(e[n],t[n],r)}function ee(e,r){var n=t(),i=t(),a=t();q(a,r[2]),F(n,r[0],a),F(i,r[1],a),R(e,i),e[31]^=D(n)<<7}function te(e,t,r){var n,i;for(_(e[0],o),_(e[1],s),_(e[2],s),_(e[3],o),i=255;i>=0;--i)Z(e,t,n=r[i/8|0]>>(7&i)&1),X(t,e),X(e,e),Z(e,t,n)}function re(e,r){var n=[t(),t(),t(),t()];_(n[0],l),_(n[1],d),_(n[2],s),F(n[3],l,d),te(e,n,r)}function ne(e,r,i){var a,o=new Uint8Array(64),s=[t(),t(),t(),t()];for(i||n(r,32),W(o,r,32),o[0]&=248,o[31]&=127,o[31]|=64,re(s,o),ee(e,s),a=0;a<32;a++)r[a+32]=e[a];return 0}var ie=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function ae(e,t){var r,n,i,a;for(n=63;n>=32;--n){for(r=0,i=n-32,a=n-12;i<a;++i)t[i]+=r-16*t[n]*ie[i-(n-32)],r=Math.floor((t[i]+128)/256),t[i]-=256*r;t[i]+=r,t[n]=0}for(r=0,i=0;i<32;i++)t[i]+=r-(t[31]>>4)*ie[i],r=t[i]>>8,t[i]&=255;for(i=0;i<32;i++)t[i]-=r*ie[i];for(n=0;n<32;n++)t[n+1]+=t[n]>>8,e[n]=255&t[n]}function oe(e){var t,r=new Float64Array(64);for(t=0;t<64;t++)r[t]=e[t];for(t=0;t<64;t++)e[t]=0;ae(e,r)}function se(e,r,n,i){var a,o,s=new Uint8Array(64),c=new Uint8Array(64),A=new Uint8Array(64),u=new Float64Array(64),l=[t(),t(),t(),t()];W(s,i,32),s[0]&=248,s[31]&=127,s[31]|=64;var d=n+64;for(a=0;a<n;a++)e[64+a]=r[a];for(a=0;a<32;a++)e[32+a]=s[32+a];for(W(A,e.subarray(32),n+32),oe(A),re(l,A),ee(e,l),a=32;a<64;a++)e[a]=i[a];for(W(c,e,n+64),oe(c),a=0;a<64;a++)u[a]=0;for(a=0;a<32;a++)u[a]=A[a];for(a=0;a<32;a++)for(o=0;o<32;o++)u[a+o]+=c[a]*s[o];return ae(e.subarray(32),u),d}function ce(e,r,n,i){var a,c=new Uint8Array(32),u=new Uint8Array(64),l=[t(),t(),t(),t()],d=[t(),t(),t(),t()];if(n<64)return-1;if(function(e,r){var n=t(),i=t(),a=t(),c=t(),u=t(),l=t(),d=t();return _(e[2],s),z(e[1],r),P(a,e[1]),F(c,a,A),U(a,a,e[2]),O(c,e[2],c),P(u,c),P(l,u),F(d,l,u),F(n,d,a),F(n,n,c),G(n,n),F(n,n,a),F(n,n,c),F(n,n,c),F(e[0],n,c),P(i,e[0]),F(i,i,c),k(i,a)&&F(e[0],e[0],p),P(i,e[0]),F(i,i,c),k(i,a)?-1:(D(e[0])===r[31]>>7&&U(e[0],o,e[0]),F(e[3],e[0],e[1]),0)}(d,i))return-1;for(a=0;a<n;a++)e[a]=r[a];for(a=0;a<32;a++)e[a+32]=i[a];if(W(u,e,n),oe(u),te(l,d,u),re(d,r.subarray(32)),X(l,d),ee(c,l),n-=64,m(r,0,c,0)){for(a=0;a<n;a++)e[a]=0;return-1}for(a=0;a<n;a++)e[a]=r[a+64];return n}var Ae=64,ue=32,le=64;function de(e,t){if(32!==e.length)throw new Error("bad key size");if(24!==t.length)throw new Error("bad nonce size")}function pe(){for(var e=0;e<arguments.length;e++)if(!(arguments[e]instanceof Uint8Array))throw new TypeError("unexpected type, use Uint8Array")}function he(e){for(var t=0;t<e.length;t++)e[t]=0}e.lowlevel={crypto_core_hsalsa20:I,crypto_stream_xor:v,crypto_stream:w,crypto_stream_salsa20_xor:E,crypto_stream_salsa20:B,crypto_onetimeauth:b,crypto_onetimeauth_verify:N,crypto_verify_16:g,crypto_verify_32:m,crypto_secretbox:S,crypto_secretbox_open:x,crypto_scalarmult:L,crypto_scalarmult_base:H,crypto_box_beforenm:Y,crypto_box_afternm:K,crypto_box:function(e,t,r,n,i,a){var o=new Uint8Array(32);return Y(o,i,a),K(e,t,r,n,o)},crypto_box_open:function(e,t,r,n,i,a){var o=new Uint8Array(32);return Y(o,i,a),V(e,t,r,n,o)},crypto_box_keypair:j,crypto_hash:W,crypto_sign:se,crypto_sign_keypair:ne,crypto_sign_open:ce,crypto_secretbox_KEYBYTES:32,crypto_secretbox_NONCEBYTES:24,crypto_secretbox_ZEROBYTES:32,crypto_secretbox_BOXZEROBYTES:16,crypto_scalarmult_BYTES:32,crypto_scalarmult_SCALARBYTES:32,crypto_box_PUBLICKEYBYTES:32,crypto_box_SECRETKEYBYTES:32,crypto_box_BEFORENMBYTES:32,crypto_box_NONCEBYTES:24,crypto_box_ZEROBYTES:32,crypto_box_BOXZEROBYTES:16,crypto_sign_BYTES:Ae,crypto_sign_PUBLICKEYBYTES:ue,crypto_sign_SECRETKEYBYTES:le,crypto_sign_SEEDBYTES:32,crypto_hash_BYTES:64,gf:t,D:A,L:ie,pack25519:R,unpack25519:z,M:F,A:O,S:P,Z:U,pow2523:G,add:X,set25519:_,modL:ae,scalarmult:te,scalarbase:re},e.randomBytes=function(e){var t=new Uint8Array(e);return n(t,e),t},e.secretbox=function(e,t,r){pe(e,t,r),de(r,t);for(var n=new Uint8Array(32+e.length),i=new Uint8Array(n.length),a=0;a<e.length;a++)n[a+32]=e[a];return S(i,n,n.length,t,r),i.subarray(16)},e.secretbox.open=function(e,t,r){pe(e,t,r),de(r,t);for(var n=new Uint8Array(16+e.length),i=new Uint8Array(n.length),a=0;a<e.length;a++)n[a+16]=e[a];return n.length<32||0!==x(i,n,n.length,t,r)?null:i.subarray(32)},e.secretbox.keyLength=32,e.secretbox.nonceLength=24,e.secretbox.overheadLength=16,e.scalarMult=function(e,t){if(pe(e,t),32!==e.length)throw new Error("bad n size");if(32!==t.length)throw new Error("bad p size");var r=new Uint8Array(32);return L(r,e,t),r},e.scalarMult.base=function(e){if(pe(e),32!==e.length)throw new Error("bad n size");var t=new Uint8Array(32);return H(t,e),t},e.scalarMult.scalarLength=32,e.scalarMult.groupElementLength=32,e.box=function(t,r,n,i){var a=e.box.before(n,i);return e.secretbox(t,r,a)},e.box.before=function(e,t){pe(e,t),function(e,t){if(32!==e.length)throw new Error("bad public key size");if(32!==t.length)throw new Error("bad secret key size")}(e,t);var r=new Uint8Array(32);return Y(r,e,t),r},e.box.after=e.secretbox,e.box.open=function(t,r,n,i){var a=e.box.before(n,i);return e.secretbox.open(t,r,a)},e.box.open.after=e.secretbox.open,e.box.keyPair=function(){var e=new Uint8Array(32),t=new Uint8Array(32);return j(e,t),{publicKey:e,secretKey:t}},e.box.keyPair.fromSecretKey=function(e){if(pe(e),32!==e.length)throw new Error("bad secret key size");var t=new Uint8Array(32);return H(t,e),{publicKey:t,secretKey:new Uint8Array(e)}},e.box.publicKeyLength=32,e.box.secretKeyLength=32,e.box.sharedKeyLength=32,e.box.nonceLength=24,e.box.overheadLength=e.secretbox.overheadLength,e.sign=function(e,t){if(pe(e,t),t.length!==le)throw new Error("bad secret key size");var r=new Uint8Array(Ae+e.length);return se(r,e,e.length,t),r},e.sign.open=function(e,t){if(pe(e,t),t.length!==ue)throw new Error("bad public key size");var r=new Uint8Array(e.length),n=ce(r,e,e.length,t);if(n<0)return null;for(var i=new Uint8Array(n),a=0;a<i.length;a++)i[a]=r[a];return i},e.sign.detached=function(t,r){for(var n=e.sign(t,r),i=new Uint8Array(Ae),a=0;a<i.length;a++)i[a]=n[a];return i},e.sign.detached.verify=function(e,t,r){if(pe(e,t,r),t.length!==Ae)throw new Error("bad signature size");if(r.length!==ue)throw new Error("bad public key size");var n,i=new Uint8Array(Ae+e.length),a=new Uint8Array(Ae+e.length);for(n=0;n<Ae;n++)i[n]=t[n];for(n=0;n<e.length;n++)i[n+Ae]=e[n];return ce(a,i,i.length,r)>=0},e.sign.keyPair=function(){var e=new Uint8Array(ue),t=new Uint8Array(le);return ne(e,t),{publicKey:e,secretKey:t}},e.sign.keyPair.fromSecretKey=function(e){if(pe(e),e.length!==le)throw new Error("bad secret key size");for(var t=new Uint8Array(ue),r=0;r<t.length;r++)t[r]=e[32+r];return{publicKey:t,secretKey:new Uint8Array(e)}},e.sign.keyPair.fromSeed=function(e){if(pe(e),32!==e.length)throw new Error("bad seed size");for(var t=new Uint8Array(ue),r=new Uint8Array(le),n=0;n<32;n++)r[n]=e[n];return ne(t,r,!0),{publicKey:t,secretKey:r}},e.sign.publicKeyLength=ue,e.sign.secretKeyLength=le,e.sign.seedLength=32,e.sign.signatureLength=Ae,e.hash=function(e){pe(e);var t=new Uint8Array(64);return W(t,e,e.length),t},e.hash.hashLength=64,e.verify=function(e,t){return pe(e,t),0!==e.length&&0!==t.length&&e.length===t.length&&0===f(e,0,t,0,e.length)},e.setPRNG=function(e){n=e},function(){var t="undefined"!=typeof self?self.crypto||self.msCrypto:null;t&&t.getRandomValues?e.setPRNG((function(e,r){var n,i=new Uint8Array(r);for(n=0;n<r;n+=65536)t.getRandomValues(i.subarray(n,n+Math.min(r-n,65536)));for(n=0;n<r;n++)e[n]=i[n];he(i)})):(t=r(5024))&&t.randomBytes&&e.setPRNG((function(e,r){var n,i=t.randomBytes(r);for(n=0;n<r;n++)e[n]=i[n];he(i)}))}()}(e.exports?e.exports:self.nacl=self.nacl||{})},7795:function(e,t,r){"use strict";var n=r(9509).Buffer;function i(e){if(e<0||e>9007199254740991||e%1!=0)throw new RangeError("value out of range")}function a(e){return i(e),e<253?1:e<=65535?3:e<=4294967295?5:9}e.exports={encode:function e(t,r,o){if(i(t),r||(r=n.allocUnsafe(a(t))),!n.isBuffer(r))throw new TypeError("buffer must be a Buffer instance");return o||(o=0),t<253?(r.writeUInt8(t,o),e.bytes=1):t<=65535?(r.writeUInt8(253,o),r.writeUInt16LE(t,o+1),e.bytes=3):t<=4294967295?(r.writeUInt8(254,o),r.writeUInt32LE(t,o+1),e.bytes=5):(r.writeUInt8(255,o),r.writeUInt32LE(t>>>0,o+1),r.writeUInt32LE(t/4294967296|0,o+5),e.bytes=9),r},decode:function e(t,r){if(!n.isBuffer(t))throw new TypeError("buffer must be a Buffer instance");r||(r=0);var a=t.readUInt8(r);if(a<253)return e.bytes=1,a;if(253===a)return e.bytes=3,t.readUInt16LE(r+1);if(254===a)return e.bytes=5,t.readUInt32LE(r+1);e.bytes=9;var o=t.readUInt32LE(r+1),s=4294967296*t.readUInt32LE(r+5)+o;return i(s),s},encodingLength:a}},5840:function(e,t,r){var n;if("object"==typeof globalThis)n=globalThis;else try{n=r(284)}catch(e){}finally{if(n||"undefined"==typeof window||(n=window),!n)throw new Error("Could not determine global this")}var i=n.WebSocket||n.MozWebSocket,a=r(9387);function o(e,t){return t?new i(e,t):new i(e)}i&&["CONNECTING","OPEN","CLOSING","CLOSED"].forEach((function(e){Object.defineProperty(o,e,{get:function(){return i[e]}})})),e.exports={w3cwebsocket:i?o:null,version:a}},9387:function(e,t,r){e.exports=r(9794).version},8955:function(){},5024:function(){},8118:function(e,t,r){e.exports=r(3778)},7445:function(e,t,r){e.exports=r(3685)},9794:function(e){"use strict";e.exports={version:"1.0.34"}}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var a=t[n]={exports:{}};return e[n].call(a.exports,a,a.exports,r),a.exports}r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};return function(){"use strict";r.r(n),r.d(n,{ABI_VERSIONS:function(){return rn},AE_AMOUNT_FORMATS:function(){return qe},AMOUNT:function(){return Xr},AccountBase:function(){return Au},AccountError:function(){return y},AeSdk:function(){return yl},AeSdkAepp:function(){return rd},AeSdkBase:function(){return ml},AeSdkWallet:function(){return sd},AensError:function(){return I},AensPointerContextError:function(){return j},AeppError:function(){return C},AlreadyConnectedError:function(){return Ue},AmbiguousEventDefinitionError:function(){return ge},ArgumentCountMismatchError:function(){return _},ArgumentError:function(){return S},BaseError:function(){return m},BrowserRuntimeConnection:function(){return wp},BrowserWindowMessageConnection:function(){return Ep},BytecodeMismatchError:function(){return ae},CLIENT_TTL:function(){return Ht},Channel:function(){return hp},ChannelCallError:function(){return Z},ChannelConnectionError:function(){return ee},ChannelError:function(){return E},ChannelPingTimedOutError:function(){return te},Compiler:function(){return Al},CompilerError:function(){return B},ContractError:function(){return w},CryptographyError:function(){return v},DRY_RUN_ACCOUNT:function(){return en},DecodeError:function(){return Qe},DerivationError:function(){return Ci},DryRunError:function(){return Ne},DuplicateContractError:function(){return oe},DuplicateNodeError:function(){return we},Encoding:function(){return lt},FIELD_TYPES:function(){return on},GAS_MAX:function(){return pa},ID_TAG:function(){return fa},ID_TAG_PREFIX:function(){return ma},IllegalArgumentError:function(){return x},IllegalBidFeeError:function(){return Se},InactiveContractError:function(){return se},InsufficientBalanceError:function(){return T},InsufficientNameFeeError:function(){return Y},InternalError:function(){return q},InvalidAensNameError:function(){return K},InvalidAuthDataError:function(){return ie},InvalidChecksumError:function(){return me},InvalidKeypairError:function(){return L},InvalidMethodInvocationError:function(){return ce},InvalidPasswordError:function(){return ye},InvalidRpcMessageError:function(){return V},InvalidSignatureError:function(){return xe},InvalidTxError:function(){return Sn},InvalidTxParamsError:function(){return _e},MAX_AUTH_FUN_GAS:function(){return Zr},MESSAGE_DIRECTION:function(){return Il},METHODS:function(){return Bl},MIN_GAS_PRICE:function(){return jt},MemoryAccount:function(){return du},MerkleTreeHashMismatchError:function(){return Ie},MissingCallbackError:function(){return $},MissingContractAddressError:function(){return Ae},MissingContractDefError:function(){return ue},MissingEventDefinitionError:function(){return fe},MissingFunctionNameError:function(){return le},MissingNodeInTreeError:function(){return Ce},MissingParamError:function(){return M},NAME_BID_MAX_LENGTH:function(){return Jt},NAME_BID_RANGES:function(){return Wt},NAME_BID_TIMEOUT_BLOCKS:function(){return Vt},NAME_FEE_BID_INCREMENT:function(){return Kt},NAME_FEE_MULTIPLIER:function(){return Yt},NAME_MAX_CLIENT_TTL:function(){return Lt},NAME_MAX_LENGTH_FEE:function(){return $t},NAME_MAX_TTL:function(){return Gt},NAME_TTL:function(){return qt},NoSerializerFoundError:function(){return R},NoSuchContractFunctionError:function(){return pe},NoWalletConnectedError:function(){return Fe},Node:function(){return su},NodeError:function(){return Q},NodeInvocationError:function(){return de},NodeNotFoundError:function(){return ve},NotImplementedError:function(){return F},NotPayableFunctionError:function(){return he},ORACLE_TTL:function(){return $r},ORACLE_TTL_TYPES:function(){return Yr},POINTER_KEY_BY_PREFIX:function(){return ya},PREFIX_ID_TAG:function(){return ga},PROTOCOL_VERSIONS:function(){return nn},PROTOCOL_VM_ABI:function(){return an},PayloadLengthError:function(){return be},PrefixNotFoundError:function(){return Te},QUERY_FEE:function(){return Vr},QUERY_TTL:function(){return Jr},RESPONSE_TTL:function(){return Wr},RPC_STATUS:function(){return wl},RequestTimedOutError:function(){return k},RpcBroadcastError:function(){return Nl},RpcConnectionDenyError:function(){return _l},RpcConnectionError:function(){return Pe},RpcError:function(){return Ql},RpcInternalError:function(){return Rl},RpcInvalidTransactionError:function(){return bl},RpcMethodNotFoundError:function(){return kl},RpcNotAuthorizeError:function(){return Tl},RpcPermissionDenyError:function(){return Ml},RpcRejectedByUserError:function(){return Sl},RpcUnsupportedProtocolError:function(){return xl},SUBSCRIPTION_TYPES:function(){return El},SchemaNotFoundError:function(){return Me},TX_SCHEMA:function(){return cn},TX_TTL:function(){return Kr},TX_TYPE:function(){return ha},Tag:function(){return Xt},TagNotFoundError:function(){return Re},TransactionError:function(){return b},TxNotInChainError:function(){return ke},TxTimedOutError:function(){return D},TypeError:function(){return z},UnAuthorizedAccountError:function(){return J},UnavailableAccountError:function(){return H},UnexpectedChannelMessageError:function(){return re},UnexpectedTsError:function(){return G},UnknownChannelStateError:function(){return ne},UnknownNodeLengthError:function(){return Ee},UnknownPathNibbleError:function(){return Be},UnknownRpcClientError:function(){return W},UnknownTxError:function(){return De},UnsubscribedAccountError:function(){return X},UnsupportedABIversionError:function(){return ze},UnsupportedPlatformError:function(){return O},UnsupportedProtocolError:function(){return U},UnsupportedVMversionError:function(){return Oe},UnsupportedVersionError:function(){return P},VM_VERSIONS:function(){return tn},WALLET_TYPE:function(){return Cl},WalletError:function(){return N},_buildTx:function(){return li},_getPollInterval:function(){return Nn},aensBid:function(){return Gi},aensClaim:function(){return Pi},aensPreclaim:function(){return qi},aensQuery:function(){return Fi},aensRevoke:function(){return zi},aensTransfer:function(){return Ui},aensUpdate:function(){return Oi},awaitHeight:function(){return Tn},bigNumberToByteArray:function(){return Xe},buildAuthTxHash:function(){return sa},buildContractId:function(){return ir},buildContractIdByContractTx:function(){return Bn},buildPointers:function(){return lr},buildTx:function(){return In},buildTxHash:function(){return En},bytesToHex:function(){return tt},calculateMinFee:function(){return da},commitmentHash:function(){return cr},computeAuctionEndBlock:function(){return Ir},computeBidFee:function(){return yr},connectionProxy:function(){return fp},createAensDelegationSignature:function(){return Ki},createGeneralizedAccount:function(){return aa},createMetaTx:function(){return oa},createOracleDelegationSignature:function(){return Vi},createSalt:function(){return la},decode:function(){return vt},decryptKey:function(){return Ii},deriveChild:function(){return wi},derivePathFromKey:function(){return vi},derivePathFromSeed:function(){return bi},dump:function(){return ci},encode:function(){return Qt},encodeContractAddress:function(){return Mt},encodeUnsigned:function(){return _t},encryptKey:function(){return yi},extendOracleTtl:function(){return Zi},formatAmount:function(){return Le},formatSalt:function(){return or},genSalt:function(){return xt},generateKeyPair:function(){return kt},generateKeyPairFromSecret:function(){return Rt},generateSaveHDWalletFromSeed:function(){return xi},getAccount:function(){return kn},getAddressFromPriv:function(){return Nt},getBalance:function(){return Dn},getContract:function(){return jn},getContractByteCode:function(){return Hn},getContractInstance:function(){return Hi},getCurrentGeneration:function(){return zn},getDefaultPointerKey:function(){return gr},getGeneration:function(){return On},getHdWalletAccountFromSeed:function(){return Ti},getHeight:function(){return xn},getKeyBlock:function(){return Fn},getKeyPair:function(){return Si},getMasterKeyFromSeed:function(){return Qi},getMicroBlockHeader:function(){return Pn},getMicroBlockTransactions:function(){return Un},getMinimumNameFee:function(){return mr},getName:function(){return Yn},getOracleObject:function(){return ta},getQueryObject:function(){return Wi},getSaveHDWalletAccounts:function(){return _i},getVmVersion:function(){return Ai},hash:function(){return Tt},height:function(){return Aa},hexToBytes:function(){return rt},isAddressValid:function(){return St},isAuctionName:function(){return Cr},isGA:function(){return ia},isNameValid:function(){return hr},isValidKeypair:function(){return Pt},messageToHash:function(){return Ot},oracleQueryId:function(){return ar},payForTransaction:function(){return Di},poll:function(){return _n},pollForQueries:function(){return $i},pollForQueryResponse:function(){return Ji},postQueryToOracle:function(){return Xi},prepareTxParams:function(){return ui},produceNameId:function(){return sr},readId:function(){return rr},readInt:function(){return ur},readPointers:function(){return dr},recover:function(){return si},registerOracle:function(){return ra},resolveName:function(){return Kn},respondToQuery:function(){return ea},salt:function(){return ua},send:function(){return Mi},sendTransaction:function(){return Rn},sha256hash:function(){return pt},sign:function(){return Dt},signMessage:function(){return Ut},signUsingGA:function(){return ca},spend:function(){return Ri},str2buf:function(){return et},toAe:function(){return He},toAettos:function(){return je},toBytes:function(){return Ze},transferFunds:function(){return ki},txDryRun:function(){return Ln},unpackRawTx:function(){return yn},unpackTx:function(){return Cn},validateParams:function(){return mn},verify:function(){return zt},verifyMessage:function(){return Ft},verifyTransaction:function(){return bn},waitForTxConfirm:function(){return Mn},walletDetector:function(){return Bp},writeId:function(){return tr},writeInt:function(){return Ar}});var e={};r.r(e),r.d(e,{InvalidTxError:function(){return Sn},_getPollInterval:function(){return Nn},awaitHeight:function(){return Tn},getAccount:function(){return kn},getBalance:function(){return Dn},getContract:function(){return jn},getContractByteCode:function(){return Hn},getCurrentGeneration:function(){return zn},getGeneration:function(){return On},getHeight:function(){return xn},getKeyBlock:function(){return Fn},getMicroBlockHeader:function(){return Pn},getMicroBlockTransactions:function(){return Un},getName:function(){return Yn},poll:function(){return _n},resolveName:function(){return Kn},sendTransaction:function(){return Rn},txDryRun:function(){return Ln},waitForTxConfirm:function(){return Mn}});var t={};r.r(t),r.d(t,{_buildTx:function(){return li},getVmVersion:function(){return Ai},prepareTxParams:function(){return ui}});var i={};r.r(i),r.d(i,{payForTransaction:function(){return Di},send:function(){return Mi},spend:function(){return Ri},transferFunds:function(){return ki}});var a={};r.r(a),r.d(a,{aensBid:function(){return Gi},aensClaim:function(){return Pi},aensPreclaim:function(){return qi},aensQuery:function(){return Fi},aensRevoke:function(){return zi},aensTransfer:function(){return Ui},aensUpdate:function(){return Oi}});var o={};r.r(o),r.d(o,{createAensDelegationSignature:function(){return Ki},createOracleDelegationSignature:function(){return Vi},getContractInstance:function(){return Hi}});var s={};r.r(s),r.d(s,{extendOracleTtl:function(){return Zi},getOracleObject:function(){return ta},getQueryObject:function(){return Wi},pollForQueries:function(){return $i},pollForQueryResponse:function(){return Ji},postQueryToOracle:function(){return Xi},registerOracle:function(){return ra},respondToQuery:function(){return ea}});var c={};r.r(c),r.d(c,{buildAuthTxHash:function(){return sa},createGeneralizedAccount:function(){return aa},createMetaTx:function(){return oa},isGA:function(){return ia}});var A={};r.r(A),r.d(A,{height:function(){return Aa},signUsingGA:function(){return ca}});var u={};r.r(u),r.d(u,{Account:function(){return Gs},ByteCode:function(){return ic},Channel:function(){return uc},ChannelCloseMutualTx:function(){return Tc},ChannelCloseSoloTx:function(){return Mc},ChannelCreateTx:function(){return Nc},ChannelDepositTx:function(){return Sc},ChannelForceProgressTx:function(){return _c},ChannelSetDelegatesTx:function(){return zc},ChannelSettleTx:function(){return kc},ChannelSlashTx:function(){return Rc},ChannelSnapshotSoloTx:function(){return Dc},ChannelWithdrawTx:function(){return xc},CheckTxInPoolResponse:function(){return Jc},CommitmentId:function(){return Qc},ContractCallObject:function(){return Ws},ContractCallTx:function(){return Hc},ContractCreateTx:function(){return Lc},ContractObject:function(){return nc},CountResponse:function(){return Ps},CreateContractUnsignedTx:function(){return rA},Delegates:function(){return Ds},DryRunAccount:function(){return js},DryRunCallContext:function(){return Vs},DryRunCallReq:function(){return Ks},DryRunInput:function(){return Hs},DryRunInputItem:function(){return Ys},DryRunResult:function(){return Js},DryRunResults:function(){return $s},EncodedTx:function(){return tc},ErrorModel:function(){return Ns},Event:function(){return Xs},GAAttachTx:function(){return Kc},GAMetaTx:function(){return Vc},GAObject:function(){return ec},Generation:function(){return qs},HashResponse:function(){return xs},Header:function(){return bs},HeightResponse:function(){return _s},KeyBlock:function(){return Ss},MicroBlockHeader:function(){return Ts},NameClaimTx:function(){return Ec},NameEntry:function(){return Ac},NameHash:function(){return bc},NamePointer:function(){return Fs},NamePreclaimTx:function(){return Cc},NameRevokeTx:function(){return vc},NameTransferTx:function(){return wc},NameUpdateTx:function(){return Bc},NextNonceResponse:function(){return Ls},OffChainCallContract:function(){return tA},OffChainDeposit:function(){return Zc},OffChainNewContract:function(){return eA},OffChainTransfer:function(){return Wc},OffChainUpdate:function(){return zs},OffChainWithdrawal:function(){return Xc},OracleExtendTx:function(){return mc},OracleQueries:function(){return sc},OracleQuery:function(){return cc},OracleQueryTx:function(){return yc},OracleRegisterTx:function(){return gc},OracleRespondTx:function(){return Ic},PayingForTx:function(){return $c},PeerConnections:function(){return hc},PeerCount:function(){return Pc},PeerCountAvailable:function(){return Gc},PeerCountConnected:function(){return qc},PeerDetails:function(){return Uc},PeerPubKey:function(){return lc},Peers:function(){return Fc},PoI:function(){return ac},PostTxResponse:function(){return rc},Protocol:function(){return pc},PubKey:function(){return Oc},RegisteredOracle:function(){return oc},RelativeTTL:function(){return Os},SignedTx:function(){return Rs},SignedTxs:function(){return Ms},SpendTx:function(){return fc},Status:function(){return dc},TokenSupply:function(){return Yc},Ttl:function(){return Us},Tx:function(){return ks},TxInfoObject:function(){return Zs},UnsignedTx:function(){return jc},discriminators:function(){return nA}});var l={};r.r(l),r.d(l,{APIVersion:function(){return Iu},Aci:function(){return fu},ByteCode:function(){return Cu},ByteCodeInput:function(){return Eu},BytecodeCallResultInput:function(){return vu},Calldata:function(){return Mu},CompileOpts:function(){return hu},CompilerError:function(){return gu},CompilerVersion:function(){return Bu},Contract:function(){return pu},DecodeCalldataBytecode:function(){return bu},DecodeCalldataSource:function(){return Su},DecodedCalldata:function(){return Nu},DecodedCallresult:function(){return Qu},ErrorModel:function(){return yu},ErrorPos:function(){return mu},FateAssembler:function(){return Ru},FunctionCallInput:function(){return Tu},SophiaBinaryData:function(){return xu},SophiaCallResultInput:function(){return wu},SophiaJsonData:function(){return _u},ValidateByteCodeInput:function(){return ku}});var d=r(4431),p=r.n(d),h=r(8118),f=r.n(h);const g=e=>e.integerValue(p().ROUND_CEIL);class m extends Error{constructor(e){super(e),this.name="BaseError"}}class y extends m{constructor(e){super(e),this.name="AccountError"}}class I extends m{constructor(e){super(e),this.name="AensError"}}class C extends m{constructor(e){super(e),this.name="AeppError"}}class E extends m{constructor(e){super(e),this.name="ChannelError"}}class B extends m{constructor(e){super(e),this.name="CompilerError"}}class w extends m{constructor(e){super(e),this.name="ContractError"}}class v extends m{constructor(e){super(e),this.name="CryptographyError"}}class Q extends m{constructor(e){super(e),this.name="NodeError"}}class b extends m{constructor(e){super(e),this.name="TransactionError"}}class N extends m{constructor(e){super(e),this.name="WalletError"}}class S extends m{constructor(e,t,r){super(`${e} should be ${t}, got ${String(r)} instead`),this.name="ArgumentError"}}class x extends v{constructor(e){super(e),this.name="IllegalArgumentError"}}class _ extends m{constructor(e,t,r){super(`${e} expects ${t} arguments, got ${r} instead`),this.name="ArgumentCountMismatchError"}}class T extends m{constructor(e){super(e),this.name="InsufficientBalanceError"}}class M extends m{constructor(e){super(e),this.name="MissingParamError"}}class R extends m{constructor(){super("Byte serialization not supported"),this.name="NoSerializerFoundError"}}class k extends m{constructor(e){super(`Giving up at height ${e}`),this.name="RequestTimedOutError"}}class D extends m{constructor(e,t){super([`Giving up after ${e} blocks mined`,`transaction hash: ${t}`].join(", ")),this.name="TxTimedOutError"}}class z extends m{constructor(e){super(e),this.name="TypeError"}}class O extends m{constructor(e){super(e),this.name="UnsupportedPlatformError"}}class U extends m{constructor(e){super(e),this.name="UnsupportedProtocolError"}}class F extends m{constructor(e){super(e),this.name="NotImplementedError"}}class P extends m{constructor(e,t,r,n){super(`Unsupported ${e} version ${t}. Supported: >= ${r} < ${n}`),this.name="UnsupportedVersionError"}}class q extends m{constructor(e){super(e),this.name="InternalError"}}class G extends q{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Expected to not happen, required for TS"),this.name="UnexpectedTsError"}}class L extends y{constructor(e){super(e),this.name="InvalidKeypairError"}}class H extends y{constructor(e){super(`Account for ${e} not available`),this.name="UnavailableAccountError"}}class j extends I{constructor(e,t){super(`Name ${e} don't have pointers for ${t}`),this.name="AensPointerContextError"}}class Y extends I{constructor(e,t){super(`the provided fee ${e.toString()} is not enough to execute the claim, required: ${t.toString()}`),this.name="InsufficientNameFeeError"}}class K extends I{constructor(e){super(e),this.name="InvalidAensNameError"}}class V extends C{constructor(e){super(`Received invalid message: ${e}`),this.name="InvalidRpcMessageError"}}class $ extends C{constructor(e){super(`Can't find callback for this messageId ${e}`),this.name="MissingCallbackError"}}class J extends C{constructor(e){super(`You do not have access to account ${e}`),this.name="UnAuthorizedAccountError"}}class W extends C{constructor(e){super(`RpcClient with id ${e} do not exist`),this.name="UnknownRpcClientError"}}class X extends C{constructor(){super("You are not subscribed for an account."),this.name="UnsubscribedAccountError"}}class Z extends E{constructor(e){super(e),this.name="ChannelCallError"}}class ee extends E{constructor(e){super(e),this.name="ChannelConnectionError"}}class te extends E{constructor(){super("Server pong timed out"),this.name="ChannelPingTimedOutError"}}class re extends E{constructor(e){super(e),this.name="UnexpectedChannelMessageError"}}class ne extends E{constructor(){super("State Channels FSM entered unknown state"),this.name="UnknownChannelStateError"}}class ie extends B{constructor(e){super(e),this.name="InvalidAuthDataError"}}class ae extends w{constructor(e){super(`Contract ${e} do not correspond to the bytecode deployed on the chain`),this.name="BytecodeMismatchError"}}class oe extends w{constructor(){super("Contract already deployed"),this.name="DuplicateContractError"}}class se extends w{constructor(e){super(`Contract with address ${e} not active`),this.name="InactiveContractError"}}class ce extends w{constructor(e){super(e),this.name="InvalidMethodInvocationError"}}class Ae extends w{constructor(e){super(e),this.name="MissingContractAddressError"}}class ue extends w{constructor(){super("Either ACI or source code is required"),this.name="MissingContractDefError"}}class le extends w{constructor(){super("Function name is required"),this.name="MissingFunctionNameError"}}class de extends w{constructor(e,t){super("Invocation failed"+(null==e?"":`: "${e}"`)),this.name="NodeInvocationError",this.transaction=t}}class pe extends w{constructor(e){super(`Function ${e} doesn't exist in contract`),this.name="NoSuchContractFunctionError"}}class he extends w{constructor(e,t){super(`You try to pay "${e}" to function "${t}" which is not payable. Only payable function can accept coins`),this.name="NotPayableFunctionError"}}class fe extends w{constructor(e,t){super(`Can't find definition of ${e} event emitted by ${t} (use omitUnknown option to ignore events like this)`),this.name="MissingEventDefinitionError"}}class ge extends w{constructor(e,t){super(`Found multiple definitions of "${t[0][1]}" event emitted by ${e} in ${t.map((e=>{let[t]=e;return`"${t}"`})).join(", ")} contracts (use contractAddressToName option to specify contract name corresponding to address)`),this.name="AmbiguousEventDefinitionError"}}class me extends v{constructor(){super("Invalid checksum"),this.name="InvalidChecksumError"}}class ye extends v{constructor(){super("Invalid password or nonce"),this.name="InvalidPasswordError"}}class Ie extends v{constructor(){super("Node hash is not equal to provided one"),this.name="MerkleTreeHashMismatchError"}}class Ce extends v{constructor(e){super(e),this.name="MissingNodeInTreeError"}}class Ee extends v{constructor(e){super(`Unknown node length: ${e}`),this.name="UnknownNodeLengthError"}}class Be extends v{constructor(e){super(`Unknown path nibble: ${e}`),this.name="UnknownPathNibbleError"}}class we extends Q{constructor(e){super(`Node with name ${e} already exist`),this.name="DuplicateNodeError"}}class ve extends Q{constructor(e){super(e),this.name="NodeNotFoundError"}}class Qe extends b{constructor(e){super(e),this.name="DecodeError"}}class be extends b{constructor(e){super(e),this.name="PayloadLengthError"}}class Ne extends b{constructor(e){super(e),this.name="DryRunError"}}class Se extends b{constructor(e){super(e),this.name="IllegalBidFeeError"}}class xe extends b{constructor(e){super(e),this.name="InvalidSignatureError"}}class _e extends b{constructor(e){super(e),this.name="InvalidTxParamsError"}}class Te extends b{constructor(e){super(`Prefix for id-tag ${e} not found.`),this.name="PrefixNotFoundError"}}class Me extends b{constructor(e,t,r){super(`Transaction ${e} not implemented for ${t} version ${r}`),this.name="SchemaNotFoundError"}}class Re extends b{constructor(e){super(`Id tag for prefix ${e} not found.`),this.name="DecodeError"}}class ke extends b{constructor(e){super(`Transaction ${e} is removed from chain`),this.name="TxNotInChainError"}}class De extends b{constructor(e){super(e),this.name="UnknownTxError"}}class ze extends b{constructor(e){super(e),this.name="UnsupportedABIversionError"}}class Oe extends b{constructor(e){super(e),this.name="UnsupportedVMversionError"}}class Ue extends N{constructor(e){super(e),this.name="AlreadyConnectedError"}}class Fe extends N{constructor(e){super(e),this.name="NoWalletConnectedError"}}class Pe extends N{constructor(e){super(e),this.name="RpcConnectionError"}}let qe;!function(e){e.AE="ae",e.MILI_AE="miliAE",e.MICRO_AE="microAE",e.NANO_AE="nanoAE",e.PICO_AE="picoAE",e.FEMTO_AE="femtoAE",e.AETTOS="aettos"}(qe||(qe={}));const Ge={[qe.AE]:0,[qe.MILI_AE]:-3,[qe.MICRO_AE]:-6,[qe.NANO_AE]:-9,[qe.PICO_AE]:-12,[qe.FEMTO_AE]:-15,[qe.AETTOS]:-18},Le=(e,t)=>{let{denomination:r=qe.AETTOS,targetDenomination:n=qe.AETTOS}=t;if("bigint"!=typeof(i=e)&&(!f()(a=["number","object","string"]).call(a,typeof i)||isNaN(i)&&!Number.isInteger(i)&&!p().isBigNumber(i)))throw new S("value","a number",e);var i,a;return new(p())("bigint"==typeof e?e.toString():e).shiftedBy(Ge[r]-Ge[n]).toFixed()},He=function(e){let{denomination:t=qe.AETTOS}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Le(e,{denomination:t,targetDenomination:qe.AE})},je=function(e){let{denomination:t=qe.AE}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Le(e,{denomination:t})};var Ye=r(780),Ke=r.n(Ye),Ve=r(8442),$e=r(7795);function Je(e){return e.length%2==0&&/^[0-9a-f]+$/i.test(e)}var We=r(8764).Buffer;function Xe(e){if(!e.isInteger())throw new z(`Unexpected not integer value: ${e.toFixed()}`);let t=e.toString(16);return t.length%2==1&&(t=`0${t}`),We.from(t,"hex")}function Ze(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(null==e)return We.from([]);if(Number.isInteger(e)||p().isBigNumber(e)||t)return p().isBigNumber(e)||(e=new(p())(e)),Xe(e);if("string"==typeof e)return We.from(e);throw new R}function et(e,t){var r;return We.from(e,null!==(r=null!=t?t:Je(e)?"hex":void 0)&&void 0!==r?r:function(e){if(e.length%4>0||/[^0-9a-z+/=]/i.test(e))return!1;const t=e.indexOf("=");return-1===t||/={1,2}/.test(e.slice(t))}(e)?"base64":void 0)}const tt=e=>We.from(e).toString("hex"),rt=e=>We.from(e,"hex");var nt=r(8764).Buffer;const it=async e=>new Promise((t=>{setTimeout(t,e)})),at=(e,t)=>Object.fromEntries(Object.entries(e).map(t)),ot=(()=>{try{return nt.concat([Uint8Array.from([])]),!1}catch(e){return!0}})()?(e,t)=>nt.concat(e.map((e=>nt.from(e))),t):nt.concat;function st(e,t){return e in t}var ct=r(7191),At=r(7499),ut=r.n(At);let lt;!function(e){e.KeyBlockHash="kh",e.MicroBlockHash="mh",e.BlockPofHash="bf",e.BlockTxHash="bx",e.BlockStateHash="bs",e.Channel="ch",e.ContractAddress="ct",e.ContractBytearray="cb",e.ContractStoreKey="ck",e.ContractStoreValue="cv",e.Transaction="tx",e.TxHash="th",e.OracleAddress="ok",e.OracleQuery="ov",e.OracleQueryId="oq",e.OracleResponse="or",e.AccountAddress="ak",e.Signature="sg",e.Commitment="cm",e.PeerPubkey="pp",e.Name="nm",e.State="st",e.Poi="pi",e.StateTrees="ss",e.CallStateTree="cs",e.Bytearray="ba"}(lt||(lt={}));var dt=r(8764).Buffer;function pt(e){return(new(ut())).update(e).digest()}const ht=[lt.ContractBytearray,lt.ContractStoreKey,lt.ContractStoreValue,lt.Transaction,lt.OracleQuery,lt.OracleResponse,lt.State,lt.Poi,lt.StateTrees,lt.CallStateTree,lt.Bytearray],ft=[lt.KeyBlockHash,lt.MicroBlockHash,lt.BlockPofHash,lt.BlockTxHash,lt.BlockStateHash,lt.Channel,lt.ContractAddress,lt.TxHash,lt.OracleAddress,lt.OracleQueryId,lt.AccountAddress,lt.Signature,lt.Commitment,lt.PeerPubkey,lt.Name],gt={[lt.KeyBlockHash]:32,[lt.MicroBlockHash]:32,[lt.BlockPofHash]:32,[lt.BlockTxHash]:32,[lt.BlockStateHash]:32,[lt.Channel]:32,[lt.ContractAddress]:32,[lt.TxHash]:32,[lt.OracleAddress]:32,[lt.OracleQueryId]:32,[lt.AccountAddress]:32,[lt.Signature]:64,[lt.Commitment]:32,[lt.PeerPubkey]:32,[lt.State]:32};function mt(e,t){if(!st(t,gt))return;const r=gt[t];if(null!=r&&e.length!==r)throw new be(`Payload should be ${r} bytes, got ${e.length} instead`)}const yt=e=>pt(pt(e)).slice(0,4),It=e=>ot([e,yt(e)]);function Ct(e){const t=e.slice(0,-4);if(!yt(t).equals(e.slice(-4)))throw new me;return t}const Et={encode:e=>It(e).toString("base64"),decode:e=>Ct(dt.from(e,"base64"))},Bt={encode:e=>(0,ct.encode)(It(e)),decode:e=>Ct(dt.from((0,ct.decode)(e)))},wt=e=>{const t=ht.find((t=>t===e));if(null!=t)return[t,Et];const r=ft.find((t=>t===e));if(null!=r)return[r,Bt];throw new S("prefix",`one of ${[...ft,...ht].join(", ")}`,e)};function vt(e){const[t,r,n]=e.split("_");if(null==r)throw new Qe(`Encoded string missing payload: ${e}`);if(null!=n)throw new Qe(`Encoded string have extra parts: ${e}`);const[i,a]=wt(t),o=a.decode(r);return mt(o,i),o}function Qt(e,t){const[,r]=wt(t);return mt(e,t),`${t}_${r.encode(e)}`}var bt=r(8764).Buffer;function Nt(e){const t="string"==typeof e?et(e):e;return Qt(Ke().sign.keyPair.fromSecretKey(t).publicKey,lt.AccountAddress)}function St(e){arguments.length>1&&void 0!==arguments[1]||lt.AccountAddress;try{return vt(e),!0}catch(e){return!1}}function xt(){return Math.floor(Math.random()*Math.floor(Number.MAX_SAFE_INTEGER))}function _t(e){const t=bt.allocUnsafe(4);return t.writeUInt32BE(e),t.slice(t.findIndex((e=>0!==e)))}function Tt(e){return bt.from((0,Ve.blake2b)(e,void 0,32))}function Mt(e,t){const r=vt(e);return Qt(Tt(ot([r,_t(t)])),lt.ContractAddress)}function Rt(e){return Ke().sign.keyPair.fromSecretKey(e)}function kt(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const t=Ke().sign.keyPair(),r=bt.from(t.publicKey),n=bt.from(t.secretKey);return e?{publicKey:r,secretKey:n}:{publicKey:Qt(r,lt.AccountAddress),secretKey:n.toString("hex")}}function Dt(e,t){return Ke().sign.detached(bt.from(e),bt.from(t))}function zt(e,t,r){const n="string"==typeof r?et(r):r;return Ke().sign.detached.verify(e,t,n)}function Ot(e){const t=bt.from("aeternity Signed Message:\n","utf8"),r=bt.from(e,"utf8");return Tt(ot([(0,$e.encode)(t.length),t,(0,$e.encode)(r.length),r]))}function Ut(e,t){return Dt(Ot(e),t)}function Ft(e,t,r){return zt(Ot(e),t,r)}function Pt(e,t){const r=bt.from("TheMessage");return zt(r,Dt(r,e),t)}const qt=18e4,Gt=36e3,Lt=84600,Ht=Lt,jt=1e9,Yt=1e14,Kt=.05,Vt=480,$t=31,Jt=12,Wt=at({31:3,30:5,29:8,28:13,27:21,26:34,25:55,24:89,23:144,22:233,21:377,20:610,19:987,18:1597,17:2584,16:4181,15:6765,14:10946,13:17711,12:28657,11:46368,10:75025,9:121393,8:196418,7:317811,6:514229,5:832040,4:1346269,3:2178309,2:3524578,1:5702887},(e=>{let[t,r]=e;return[t,new(p())(r).times(Yt)]}));let Xt;!function(e){e[e.Account=10]="Account",e[e.SignedTx=11]="SignedTx",e[e.SpendTx=12]="SpendTx",e[e.OracleRegisterTx=22]="OracleRegisterTx",e[e.OracleQueryTx=23]="OracleQueryTx",e[e.OracleResponseTx=24]="OracleResponseTx",e[e.OracleExtendTx=25]="OracleExtendTx",e[e.NameClaimTx=32]="NameClaimTx",e[e.NamePreclaimTx=33]="NamePreclaimTx",e[e.NameUpdateTx=34]="NameUpdateTx",e[e.NameRevokeTx=35]="NameRevokeTx",e[e.NameTransferTx=36]="NameTransferTx",e[e.Contract=40]="Contract",e[e.ContractCall=41]="ContractCall",e[e.ContractCreateTx=42]="ContractCreateTx",e[e.ContractCallTx=43]="ContractCallTx",e[e.ChannelCreateTx=50]="ChannelCreateTx",e[e.ChannelDepositTx=51]="ChannelDepositTx",e[e.ChannelWithdrawTx=52]="ChannelWithdrawTx",e[e.ChannelForceProgressTx=521]="ChannelForceProgressTx",e[e.ChannelCloseMutualTx=53]="ChannelCloseMutualTx",e[e.ChannelCloseSoloTx=54]="ChannelCloseSoloTx",e[e.ChannelSlashTx=55]="ChannelSlashTx",e[e.ChannelSettleTx=56]="ChannelSettleTx",e[e.ChannelOffChainTx=57]="ChannelOffChainTx",e[e.ChannelOffChainUpdateTransfer=570]="ChannelOffChainUpdateTransfer",e[e.ChannelOffChainUpdateDeposit=571]="ChannelOffChainUpdateDeposit",e[e.ChannelOffChainUpdateWithdraw=572]="ChannelOffChainUpdateWithdraw",e[e.ChannelOffChainUpdateCreateContract=573]="ChannelOffChainUpdateCreateContract",e[e.ChannelOffChainUpdateCallContract=574]="ChannelOffChainUpdateCallContract",e[e.ChannelClientReconnectTx=575]="ChannelClientReconnectTx",e[e.Channel=58]="Channel",e[e.ChannelSnapshotSoloTx=59]="ChannelSnapshotSoloTx",e[e.TreesPoi=60]="TreesPoi",e[e.StateTrees=62]="StateTrees",e[e.Mtree=63]="Mtree",e[e.MtreeValue=64]="MtreeValue",e[e.ContractsMtree=621]="ContractsMtree",e[e.CallsMtree=622]="CallsMtree",e[e.ChannelsMtree=623]="ChannelsMtree",e[e.NameserviceMtree=624]="NameserviceMtree",e[e.OraclesMtree=625]="OraclesMtree",e[e.AccountsMtree=626]="AccountsMtree",e[e.CompilerSophia=70]="CompilerSophia",e[e.GaAttachTx=80]="GaAttachTx",e[e.GaMetaTx=81]="GaMetaTx",e[e.PayingForTx=82]="PayingForTx"}(Xt||(Xt={}));var Zt=r(8764).Buffer;const er=[lt.AccountAddress,lt.Name,lt.Commitment,lt.OracleAddress,lt.ContractAddress,lt.Channel];function tr(e){if("string"!=typeof e)throw new S("hashId","a string",e);const t=e.slice(0,2);if(r=t,n=er,!f()(n).call(n,r))throw new Re(t);var r,n;const i=er.indexOf(t)+1;return Zt.from([...Ze(i),...vt(e)])}function rr(e){const t=Zt.from(e).readUIntBE(0,1),r=er[t-1];if(null==r)throw new Te(t);return Qt(e.slice(1,e.length),r)}var nr=r(8764).Buffer;function ir(e,t){return Qt(Tt(nr.from([...vt(e),...Ze(t)])),lt.ContractAddress)}function ar(e,t,r){return Qt(Tt(nr.from([...vt(e),...function(e){const t=Ze(e,!0);return ot([nr.alloc(32-t.length),t])}(t),...vt(r)])),lt.OracleQueryId)}function or(e){return nr.from(e.toString(16).padStart(64,"0"),"hex")}function sr(e){return Qt(Tt(e.toLowerCase()),lt.Name)}function cr(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:xt();return Qt(Tt(ot([nr.from(e.toLowerCase()),or(t)])),lt.Commitment)}function Ar(e){return Ze(e,!0)}function ur(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:nr.from([]);return new(p())(nr.from(e).toString("hex"),16).toString(10)}function lr(e){return e.map((e=>[Ze(e.key),tr(e.id)]))}function dr(e){return e.map((e=>{let[t,r]=e;return{key:t.toString(),id:rr(r)}}))}const pr=".chain";function hr(e){return e.endsWith(pr)}const fr=[[lt.AccountAddress,"account_pubkey"],[lt.OracleAddress,"oracle_pubkey"],[lt.ContractAddress,"contract_pubkey"],[lt.Channel,"channel"]];function gr(e){var t;vt(e);const r=e.substring(0,2),n=null===(t=fr.find((e=>{let[t]=e;return t===r})))||void 0===t?void 0:t[1];if(null!=n)return n;throw new S("identifier",`prefixed with one of ${fr.map((e=>{let[t]=e;return`${t}_`})).join(", ")}`,e)}function mr(e){const t=e.length-pr.length;return Wt[Math.min(t,$t)]}function yr(e){let{startFee:t,increment:r=Kt}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(Number(r)!==r||r%1==0)throw new Se(`Increment must be float. Current increment ${r}`);if(r<Kt)throw new Se(`minimum increment percentage is ${Kt}`);return g(new(p())(null!=t?t:mr(e)).times(new(p())(Kt).plus(1)))}function Ir(e,t){const r=e.length-pr.length;return(r<=4&&62*Vt||r<=8&&31*Vt||r<=12&&Vt||0)+t}function Cr(e){return e.length<13+pr.length}var Er={serialize(e){if(e<0)throw new S("value","greater or equal to 0",e);return Ar(e)},deserialize:e=>ur(e)},Br={serialize:e=>Er.serialize(e),deserialize:e=>+Er.deserialize(e)},wr={...Er,serializeAettos(e){if(null==e)throw new S("value","provided",e);return e},serializeOptional(e,t){let{denomination:r,...n}=t;return Er.serialize(this.serializeAettos(null!=e?Le(e,{denomination:r}):e,n))},serialize(e,t){return this.serializeOptional(e,t)}},vr={...wr,serialize(e,t){var r;if(null!==(r=e)&&void 0!==r||(e=0),0!=+e)throw new x(`Contract deposit is not refundable, so it should be equal 0, got ${e.toString()} instead`);return wr.serialize(e,t)}};function Qr(e,t){const r={[Xt.OracleRegisterTx]:"oracleTtlValue",[Xt.OracleExtendTx]:"oracleTtlValue",[Xt.OracleQueryTx]:"queryTtlValue",[Xt.OracleResponseTx]:"responseTtlValue"};return st(t,r)?e[r[t]]:1}function br(e,t){var r;const{rlpEncoded:{length:n},txObject:i}=t;return(e=>{var t;const r=null!==(t={[Xt.ChannelForceProgressTx]:30,[Xt.ChannelOffChainTx]:0,[Xt.ChannelOffChainUpdateCallContract]:0,[Xt.ChannelOffChainUpdateCreateContract]:0,[Xt.ChannelOffChainUpdateDeposit]:0,[Xt.ChannelOffChainUpdateWithdraw]:0,[Xt.ChannelOffChainUpdateTransfer]:0,[Xt.ContractCreateTx]:5,[Xt.ContractCallTx]:12,[Xt.GaAttachTx]:5,[Xt.GaMetaTx]:5,[Xt.PayingForTx]:.2}[e])&&void 0!==t?t:1;return new(p())(15e3*r)})(e).plus(((e,t,r)=>{let{relativeTtl:n,innerTxSize:i}=r;switch(e){case Xt.OracleRegisterTx:case Xt.OracleExtendTx:case Xt.OracleQueryTx:case Xt.OracleResponseTx:return new(p())(t).times(20).plus(Math.ceil(32e3*n/Math.floor(175200)));case Xt.GaMetaTx:case Xt.PayingForTx:return new(p())(t).minus(i).times(20);default:return new(p())(t).times(20)}})(e,n,{relativeTtl:Qr(i,e),innerTxSize:f()(r=[Xt.GaMetaTx,Xt.PayingForTx]).call(r,e)?i.tx.tx.encodedTx.rlpEncoded.length:0})).times(jt)}function Nr(e,t){let r,n=new(p())(0);do{r=n,n=br(e,t(n))}while(!n.eq(r));return n}var Sr={...wr,serializeAettos(e,t){let{txType:r,rebuildTx:n,_computingMinFee:i}=t;if(null!=i)return i;const a=Nr(r,(e=>n({_computingMinFee:e}))),o=new(p())(null!=e?e:a);if(a.gt(o))throw new x(`Fee ${o.toString()} must be bigger then ${a}`);return o.toFixed()},serialize:wr.serializeOptional},xr={...Br,serialize(e,t){let{txType:r,rebuildTx:n,gasMax:i=6e6,_computingGasLimit:a}=t;if(null!=a)return Br.serialize(a);const o=function(e,t,r){return t-+br(e,r(t)).dividedBy(jt)}(r,i,(e=>n({_computingGasLimit:e}))),s=null!=e?e:o;if(s>o)throw new x(`Gas limit ${s} must be less or equal to ${o}`);return Br.serialize(s)}},_r={...wr,serializeAettos(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:jt.toString();if(+e<jt)throw new x(`Gas price ${e.toString()} must be bigger then ${jt}`);return e},serialize:wr.serializeOptional},Tr=r(8764).Buffer,Mr=e=>Tr.from(e),Rr=e=>e.toString(),kr={serialize:e=>Mr(e),deserialize:e=>Rr(e)},Dr={...wr,serializeAettos(e,t){const r=mr(t.name),n=new(p())(null!=e?e:r);if(r.gt(n))throw new Y(n,r);return n.toFixed()},serialize(e,t){return wr.serializeOptional.call(this,e,t)}};const zr=Er,Or=Br,Ur=wr,Fr=vr,Pr=Sr,qr=xr,Gr=_r,Lr=kr,Hr=Dr,jr={serialize:e=>tr(hr(e)?sr(e):e),deserialize:e=>rr(e)};let Yr;!function(e){e[e.delta=0]="delta",e[e.block=1]="block"}(Yr||(Yr={}));const Kr=0,Vr=3e4,$r={type:Yr.delta,value:500},Jr={type:Yr.delta,value:10},Wr={type:Yr.delta,value:10},Xr=0,Zr=5e4,en={pub:"ak_11111111111111111111111111111111273Yts",amount:100000000000000000000000000000000000n};let tn,rn,nn;!function(e){e[e.NO_VM=0]="NO_VM",e[e.SOPHIA=1]="SOPHIA",e[e.SOPHIA_IMPROVEMENTS_MINERVA=3]="SOPHIA_IMPROVEMENTS_MINERVA",e[e.SOPHIA_IMPROVEMENTS_FORTUNA=4]="SOPHIA_IMPROVEMENTS_FORTUNA",e[e.FATE=5]="FATE",e[e.SOPHIA_IMPROVEMENTS_LIMA=6]="SOPHIA_IMPROVEMENTS_LIMA",e[e.FATE_2=7]="FATE_2"}(tn||(tn={})),function(e){e[e.NO_ABI=0]="NO_ABI",e[e.SOPHIA=1]="SOPHIA",e[e.FATE=3]="FATE"}(rn||(rn={})),function(e){e[e.IRIS=5]="IRIS"}(nn||(nn={}));const an={[nn.IRIS]:{[Xt.ContractCreateTx]:{vmVersion:[tn.FATE_2],abiVersion:[rn.FATE]},[Xt.ContractCallTx]:{vmVersion:[],abiVersion:[rn.FATE,rn.SOPHIA]},[Xt.OracleRegisterTx]:{vmVersion:[],abiVersion:[rn.NO_ABI,rn.SOPHIA]}}};let on;!function(e){e[e.id=0]="id",e[e.ids=1]="ids",e[e.string=2]="string",e[e.binary=3]="binary",e[e.bool=4]="bool",e[e.hex=5]="hex",e[e.rlpBinary=6]="rlpBinary",e[e.rlpBinaries=7]="rlpBinaries",e[e.rawBinary=8]="rawBinary",e[e.signatures=9]="signatures",e[e.pointers=10]="pointers",e[e.offChainUpdates=11]="offChainUpdates",e[e.callStack=12]="callStack",e[e.proofOfInclusion=13]="proofOfInclusion",e[e.mptrees=14]="mptrees",e[e.callReturnType=15]="callReturnType",e[e.ctVersion=16]="ctVersion",e[e.abiVersion=17]="abiVersion",e[e.ttlType=18]="ttlType",e[e.sophiaCodeTypeInfo=19]="sophiaCodeTypeInfo",e[e.payload=20]="payload",e[e.stateTree=21]="stateTree"}(on||(on={}));const sn=[["tag",Or],["VSN",Or]],cn={[Xt.Account]:{1:[...sn,["nonce",Or],["balance",zr]],2:[...sn,["flags",zr],["nonce",Or],["balance",zr],["gaContract",on.id,[lt.ContractAddress,lt.Name]],["gaAuthFun",on.binary,lt.ContractBytearray]]},[Xt.SignedTx]:{1:[...sn,["signatures",on.signatures],["encodedTx",on.rlpBinary]]},[Xt.SpendTx]:{1:[...sn,["senderId",on.id,lt.AccountAddress],["recipientId",on.id,[lt.AccountAddress,lt.Name]],["amount",Ur],["fee",Pr],["ttl",Or],["nonce",Or],["payload",on.payload]]},[Xt.NamePreclaimTx]:{1:[...sn,["accountId",on.id,lt.AccountAddress],["nonce",Or],["commitmentId",on.id,lt.Commitment],["fee",Pr],["ttl",Or]]},[Xt.NameClaimTx]:{2:[...sn,["accountId",on.id,lt.AccountAddress],["nonce",Or],["name",Lr],["nameSalt",zr],["nameFee",Hr],["fee",Pr],["ttl",Or]]},[Xt.NameUpdateTx]:{1:[...sn,["accountId",on.id,lt.AccountAddress],["nonce",Or],["nameId",jr],["nameTtl",zr],["pointers",on.pointers],["clientTtl",Or],["fee",Pr],["ttl",Or]]},[Xt.NameTransferTx]:{1:[...sn,["accountId",on.id,lt.AccountAddress],["nonce",Or],["nameId",jr],["recipientId",on.id,[lt.AccountAddress,lt.Name]],["fee",Pr],["ttl",Or]]},[Xt.NameRevokeTx]:{1:[...sn,["accountId",on.id,lt.AccountAddress],["nonce",Or],["nameId",jr],["fee",Pr],["ttl",Or]]},[Xt.Contract]:{1:[...sn,["owner",on.id,lt.AccountAddress],["ctVersion",on.ctVersion],["code",on.binary,lt.ContractBytearray],["log",on.binary,lt.ContractBytearray],["active",on.bool],["referers",on.ids,lt.AccountAddress],["deposit",Fr]]},[Xt.ContractCreateTx]:{1:[...sn,["ownerId",on.id,lt.AccountAddress],["nonce",Or],["code",on.binary,lt.ContractBytearray],["ctVersion",on.ctVersion],["fee",Pr],["ttl",Or],["deposit",Fr],["amount",Ur],["gasLimit",qr],["gasPrice",Gr],["callData",on.binary,lt.ContractBytearray]]},[Xt.ContractCallTx]:{1:[...sn,["callerId",on.id,lt.AccountAddress],["nonce",Or],["contractId",on.id,[lt.ContractAddress,lt.Name]],["abiVersion",on.abiVersion],["fee",Pr],["ttl",Or],["amount",Ur],["gasLimit",qr],["gasPrice",Gr],["callData",on.binary,lt.ContractBytearray]]},[Xt.ContractCall]:{1:[...sn,["callerId",on.id,lt.AccountAddress],["callerNonce",Or],["height",Or],["contractId",on.id,lt.ContractAddress],["gasPrice",Gr],["gasUsed",Or],["returnValue",on.binary,lt.ContractBytearray],["returnType",on.callReturnType],["log",on.rawBinary]]},[Xt.OracleRegisterTx]:{1:[...sn,["accountId",on.id,lt.AccountAddress],["nonce",Or],["queryFormat",on.string],["responseFormat",on.string],["queryFee",Ur],["oracleTtlType",on.ttlType],["oracleTtlValue",Or],["fee",Pr],["ttl",Or],["abiVersion",on.abiVersion]]},[Xt.OracleExtendTx]:{1:[...sn,["oracleId",on.id,[lt.OracleAddress,lt.Name]],["nonce",Or],["oracleTtlType",on.ttlType],["oracleTtlValue",Or],["fee",Pr],["ttl",Or]]},[Xt.OracleQueryTx]:{1:[...sn,["senderId",on.id,lt.AccountAddress],["nonce",Or],["oracleId",on.id,[lt.OracleAddress,lt.Name]],["query",on.string],["queryFee",Ur],["queryTtlType",on.ttlType],["queryTtlValue",Or],["responseTtlType",on.ttlType],["responseTtlValue",Or],["fee",Pr],["ttl",Or]]},[Xt.OracleResponseTx]:{1:[...sn,["oracleId",on.id,lt.OracleAddress],["nonce",Or],["queryId",on.binary,lt.OracleQueryId],["response",on.string],["responseTtlType",on.ttlType],["responseTtlValue",Or],["fee",Pr],["ttl",Or]]},[Xt.ChannelCreateTx]:{2:[...sn,["initiator",on.id,lt.AccountAddress],["initiatorAmount",zr],["responder",on.id,lt.AccountAddress],["responderAmount",zr],["channelReserve",zr],["lockPeriod",zr],["ttl",Or],["fee",Pr],["initiatorDelegateIds",on.string],["responderDelegateIds",on.string],["stateHash",on.binary,"st"],["nonce",Or]]},[Xt.ChannelCloseMutualTx]:{1:[...sn,["channelId",on.id,lt.Channel],["fromId",on.id,lt.AccountAddress],["initiatorAmountFinal",zr],["responderAmountFinal",zr],["ttl",Or],["fee",Pr],["nonce",Or]]},[Xt.ChannelCloseSoloTx]:{1:[...sn,["channelId",on.id,lt.Channel],["fromId",on.id,lt.AccountAddress],["payload",on.binary,"tx"],["poi",on.binary,"pi"],["ttl",Or],["fee",Pr],["nonce",Or]]},[Xt.ChannelSlashTx]:{1:[...sn,["channelId",on.id,lt.Channel],["fromId",on.id,lt.AccountAddress],["payload",on.binary,"tx"],["poi",on.binary,"pi"],["ttl",Or],["fee",Pr],["nonce",Or]]},[Xt.ChannelDepositTx]:{1:[...sn,["channelId",on.id,lt.Channel],["fromId",on.id,lt.AccountAddress],["amount",zr],["ttl",Or],["fee",Pr],["stateHash",on.binary,"st"],["round",Or],["nonce",Or]]},[Xt.ChannelWithdrawTx]:{1:[...sn,["channelId",on.id,lt.Channel],["toId",on.id,lt.AccountAddress],["amount",zr],["ttl",Or],["fee",Pr],["stateHash",on.binary,"st"],["round",Or],["nonce",Or]]},[Xt.ChannelSettleTx]:{1:[...sn,["channelId",on.id,lt.Channel],["fromId",on.id,lt.AccountAddress],["initiatorAmountFinal",zr],["responderAmountFinal",zr],["ttl",Or],["fee",Pr],["nonce",Or]]},[Xt.ChannelForceProgressTx]:{1:[...sn,["channelId",on.id,lt.Channel],["fromId",on.id,lt.AccountAddress],["payload",on.binary,"tx"],["round",Or],["update",on.binary,lt.ContractBytearray],["stateHash",on.binary,"st"],["offChainTrees",on.stateTree],["ttl",Or],["fee",Pr],["nonce",Or]]},[Xt.ChannelOffChainTx]:{2:[...sn,["channelId",on.id,lt.Channel],["round",Or],["stateHash",on.binary,"st"]]},[Xt.Channel]:{3:[...sn,["initiator",on.id,lt.AccountAddress],["responder",on.id,lt.AccountAddress],["channelAmount",zr],["initiatorAmount",zr],["responderAmount",zr],["channelReserve",zr],["initiatorDelegateIds",on.ids],["responderDelegateIds",on.ids],["stateHash",on.hex],["round",Or],["soloRound",zr],["lockPeriod",zr],["lockedUntil",zr],["initiatorAuth",on.binary,lt.ContractBytearray],["responderAuth",on.binary,lt.ContractBytearray]]},[Xt.ChannelSnapshotSoloTx]:{1:[...sn,["channelId",on.id,lt.Channel],["fromId",on.id,lt.AccountAddress],["payload",on.binary,"tx"],["ttl",Or],["fee",Pr],["nonce",Or]]},[Xt.ChannelOffChainUpdateTransfer]:{1:[...sn,["from",on.id,lt.AccountAddress],["to",on.id,lt.AccountAddress],["amount",zr]]},[Xt.ChannelOffChainUpdateDeposit]:{1:[...sn,["from",on.id,lt.AccountAddress],["amount",zr]]},[Xt.ChannelOffChainUpdateWithdraw]:{1:[...sn,["from",on.id,lt.AccountAddress],["amount",zr]]},[Xt.ChannelOffChainUpdateCreateContract]:{1:[...sn,["owner",on.id,lt.AccountAddress],["ctVersion",on.ctVersion],["code",on.binary,lt.ContractBytearray],["deposit",zr],["callData",on.binary,lt.ContractBytearray]]},[Xt.ChannelOffChainUpdateCallContract]:{1:[...sn,["caller",on.id,lt.AccountAddress],["contract",on.id,lt.ContractAddress],["abiVersion",on.abiVersion],["amount",zr],["callData",on.binary,lt.ContractBytearray],["callStack",on.callStack],["gasPrice",Gr],["gasLimit",qr]]},[Xt.ChannelClientReconnectTx]:{1:[...sn,["channelId",on.id,lt.Channel],["round",Or],["role",on.string],["pubkey",on.id,lt.AccountAddress]]},[Xt.TreesPoi]:{1:[...sn,["accounts",on.mptrees],["calls",on.mptrees],["channels",on.mptrees],["contracts",on.mptrees],["ns",on.mptrees],["oracles",on.mptrees]]},[Xt.StateTrees]:{1:[...sn,["contracts",on.rlpBinary],["calls",on.rlpBinary],["channels",on.rlpBinary],["ns",on.rlpBinary],["oracles",on.rlpBinary],["accounts",on.rlpBinary]]},[Xt.Mtree]:{1:[...sn,["values",on.rlpBinaries]]},[Xt.MtreeValue]:{1:[...sn,["key",on.hex],["value",on.rawBinary]]},[Xt.ContractsMtree]:{1:[...sn,["contracts",on.rlpBinary]]},[Xt.CallsMtree]:{1:[...sn,["calls",on.rlpBinary]]},[Xt.ChannelsMtree]:{1:[...sn,["channels",on.rlpBinary]]},[Xt.NameserviceMtree]:{1:[...sn,["mtree",on.rlpBinary]]},[Xt.OraclesMtree]:{1:[...sn,["otree",on.rlpBinary]]},[Xt.AccountsMtree]:{1:[...sn,["accounts",on.rlpBinary]]},[Xt.GaAttachTx]:{1:[...sn,["ownerId",on.id,lt.AccountAddress],["nonce",Or],["code",on.binary,lt.ContractBytearray],["authFun",on.rawBinary],["ctVersion",on.ctVersion],["fee",Pr],["ttl",Or],["gasLimit",qr],["gasPrice",Gr],["callData",on.binary,lt.ContractBytearray]]},[Xt.GaMetaTx]:{2:[...sn,["gaId",on.id,lt.AccountAddress],["authData",on.binary,lt.ContractBytearray],["abiVersion",on.abiVersion],["fee",Pr],["gasLimit",qr],["gasPrice",Gr],["tx",on.rlpBinary]]},[Xt.PayingForTx]:{1:[...sn,["payerId",on.id,lt.AccountAddress],["nonce",Or],["fee",Pr],["tx",on.rlpBinary]]},[Xt.CompilerSophia]:{3:[...sn,["sourceCodeHash",on.rawBinary],["typeInfo",on.sophiaCodeTypeInfo],["byteCode",on.rawBinary],["compilerVersion",on.string],["payable",on.bool]]}};var An,un=r(6636),ln=r(8764).Buffer;!function(e){e[e.Branch=0]="Branch",e[e.Extension=1]="Extension",e[e.Leaf=2]="Leaf"}(An||(An={}));class dn{static nodeHash(e){return ln.from(Tt((0,un.encode)(e))).toString("hex")}constructor(e){if(this.rootHash=e[0].toString("hex"),this.nodes=Object.fromEntries(e[1].map((e=>[e[0].toString("hex"),e[1]]))),void 0===this.nodes[this.rootHash])throw new Ce("Can't find a node by root hash");Object.entries(this.nodes).forEach((e=>{let[t,r]=e;if(dn.nodeHash(r)!==t)throw new Ie;const{type:n,payload:i}=dn.parseNode(r);switch(n){case An.Branch:i.slice(0,16).filter((e=>e.length)).forEach((e=>{if(void 0===this.nodes[e.toString("hex")])throw new Ce("Can't find a node by hash in branch node")}));break;case An.Extension:if(void 0===this.nodes[i[0].toString("hex")])throw new Ce("Can't find a node by hash in extension node")}}))}isEqual(e){return this.rootHash===e.rootHash}static parseNode(e){switch(e.length){case 17:return{type:An.Branch,payload:e,path:null};case 2:{var t;const r=e[0][0]>>4;if(r>3)throw new Be(r);const n=r<=1?An.Extension:An.Leaf,i=f()(t=[0,2]).call(t,r)?2:1;return{type:n,payload:[e[1]],path:e[0].toString("hex").slice(i)}}default:throw new Ee(e.length)}}serialize(){return[ln.from(this.rootHash,"hex"),Object.entries(this.nodes).map((e=>{let[t,r]=e;return[ln.from(t,"hex"),r]}))]}get(e){let t=this.rootHash,r=e;for(;;){const{type:e,payload:n,path:i}=dn.parseNode(this.nodes[t]);switch(e){case An.Branch:if(0===r.length)return n[16];t=n[+`0x${r[0]}`].toString("hex"),r=r.substring(1);break;case An.Extension:if(r.substring(0,null==i?void 0:i.length)!==i)return;t=n[0].toString("hex"),r=r.substring(i.length);break;case An.Leaf:if(i!==r)return;return n[0]}}}}var pn=r(8764).Buffer;function hn(e,t,r){if(null==e)return"";switch(t){case on.ctVersion:{const[t,,r]=e;return{vmVersion:ur(pn.from([t])),abiVersion:ur(pn.from([r]))}}case on.abiVersion:case on.ttlType:return ur(e);case on.id:return rr(e);case on.ids:return e.map(rr);case on.bool:return 1===e[0];case on.binary:return Qt(e,r);case on.stateTree:return Qt(e,lt.StateTrees);case on.string:return e.toString();case on.payload:return Qt(e,lt.Bytearray);case on.pointers:return dr(e);case on.rlpBinary:return Cn(Qt(e,lt.Transaction));case on.rlpBinaries:return e.map((e=>Cn(Qt(e,lt.Transaction))));case on.rawBinary:return e;case on.hex:return e.toString("hex");case on.offChainUpdates:return e.map((e=>Cn(Qt(e,lt.Transaction))));case on.callStack:return[ur(e)];case on.mptrees:return e.map((e=>new dn(e)));case on.callReturnType:switch(ur(e)){case"0":return"ok";case"1":return"error";case"2":return"revert";default:return e}case on.sophiaCodeTypeInfo:return e.reduce(((e,t)=>{let[r,n,i,a]=t;return{...e,[n.toString()]:{funHash:r,argType:i,outType:a}}}),{});default:return"number"==typeof t?e:t.deserialize(e)}}function fn(e,t,r){var n;switch(t){case on.abiVersion:case on.ttlType:return Ar(e);case on.id:return tr(e);case on.ids:return e.map(tr);case on.bool:return pn.from([!0===e?1:0]);case on.binary:case on.stateTree:return vt(e);case on.hex:return pn.from(e,"hex");case on.signatures:return e.map(pn.from);case on.payload:return"string"==typeof e&&"ba"===e.split("_")[0]?vt(e):Ze(e);case on.string:return Ze(e);case on.pointers:return lr(e);case on.rlpBinary:return null!==(n=e.rlpEncoded)&&void 0!==n?n:e;case on.mptrees:return e.map((e=>e.serialize()));case on.ctVersion:return pn.from([...Ze(e.vmVersion),0,...Ze(e.abiVersion)]);case on.callReturnType:switch(e){case"ok":return Ar(0);case"error":return Ar(1);case"revert":return Ar(2);default:return e}default:return"number"==typeof t?e:t.serialize(e,r)}}function gn(e,t,r){if(null==e)return"Field is required";switch(t){case on.id:{const t=Array.isArray(r)?r:[r];return f()(t).call(t,e.split("_")[0])?void 0:null==r?`'${String(e)}' prefix doesn't exist'`:`'${String(e)}' prefix doesn't match expected prefix '${r.toString()}'`}case on.ctVersion:return Boolean(e.abiVersion)&&Boolean(e.vmVersion)?void 0:'Value must be an object with "vmVersion" and "abiVersion" fields';case on.pointers:return Array.isArray(e)?e.some((e=>!(Boolean(e.key)&&Boolean(e.id))))?'Value must contains only object\'s like \'{key: "account_pubkey", id: "ak_lkamsflkalsdalksdlasdlasdlamd"}\'':e.length>32?`Expected 32 pointers or less, got ${e.length} instead`:void 0:"Value must be of type Array";default:return}}function mn(e,t,r){let{excludeKeys:n=[]}=r;return Object.fromEntries(t.filter((e=>{var t;let[r]=e;return!f()(n).call(n,r)&&!f()(t=["payload","nameFee","deposit","gasPrice","fee","gasLimit"]).call(t,r)})).map((t=>{let[r,n,i]=t;return[r,gn(e[r],n,i)]})).filter((e=>{let[,t]=e;return t})))}function yn(e,t){return t.reduce(((t,r,n)=>{let[i,a,o]=r;return Object.assign(t,{[i]:hn(e[n],a,o)})}),{})}function In(e,t){var r;let{excludeKeys:n=[],prefix:i=lt.Transaction,vsn:a,denomination:o=qe.AETTOS}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const s=cn[t];if(null!==(r=a)&&void 0!==r||(a=Math.max(...Object.keys(s).map((e=>+e)))),!st(a,s))throw new Me("serialization",Xt[t],a);const c=s[a],A=e;A.VSN=a,A.tag=t,A.denomination=o;const u=c.filter((e=>{let[t]=e;return!f()(n).call(n,t)})),l=mn(A,c,{excludeKeys:n});if(Object.keys(l).length>0)throw new _e(`Transaction build error. ${JSON.stringify(l)}`);const d=u.map((e=>{let[r,i]=e;return fn(A[r],i,{...A,txType:t,rebuildTx:e=>In({...A,...e},t,{excludeKeys:n,prefix:lt.Transaction,vsn:a,denomination:o})})})).filter((e=>void 0!==e)),p=(0,un.encode)(d),h=Qt(p,i);return{tx:h,rlpEncoded:p,binary:d,txObject:yn(d,c)}}function Cn(e,t){const r=vt(e),n=(0,un.decode)(r),i=+ur(n[0]);if(!st(i,cn))throw new Qe(`Unknown transaction tag: ${i}`);if(null!=t&&t!==i)throw new Qe(`Expected transaction to have ${Xt[t]} tag, got ${Xt[i]} instead`);const a=+ur(n[1]);if(!st(a,cn[i]))throw new Me("deserialization",`tag ${i}`,a);return{txType:i,tx:yn(n,cn[i][a]),rlpEncoded:r}}function En(e){return Qt(Tt("string"==typeof e&&e.startsWith("tx_")?vt(e):e),lt.TxHash)}function Bn(e){var t;const{txType:r,tx:n}=Cn(e);if(!f()(t=[Xt.ContractCreateTx,Xt.GaAttachTx]).call(t,r))throw new S("contractCreateTx","a contractCreateTx or gaAttach",r);return ir(n.ownerId,+n.nonce)}var wn=r(8764).Buffer;const vn=[],Qn=e=>["senderId","accountId","ownerId","callerId","oracleId","fromId","initiator","gaId","payerId"].map((t=>e[t])).filter((e=>e)).map((e=>null==e?void 0:e.toString().replace(/^ok_/,"ak_")))[0];async function bn(e,t){var r;let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const{tx:i,txType:a}=Cn(e),o=null!==(r=Qn(i))&&void 0!==r?r:a===Xt.SignedTx?Qn(i.encodedTx.tx):void 0,[s,{height:c},{consensusProtocolVersion:A,nodeNetworkId:u}]=await Promise.all([null==o?void 0:t.getAccountByPubkey(o).catch((()=>({id:o,balance:0n,nonce:0}))).then((e=>({...e,id:e.id}))),t.getCurrentKeyBlockHeight(),t.getNodeInfo()]);return(await Promise.all(vn.map((e=>e(i,{txType:a,node:t,account:s,height:c,consensusProtocolVersion:A,nodeNetworkId:u,parentTxTypes:n}))))).flat()}function Nn(e,t){let{_expectedMineRate:r=18e4,_microBlockCycle:n=3e3,_maxPollInterval:i=5e3}=t;const a={block:r,microblock:n}[e];return Math.min(a/3,i)}vn.push(((e,t)=>{let{encodedTx:r,signatures:n}=e,{account:i,nodeNetworkId:a,parentTxTypes:o}=t;if(void 0===(null!=r?r:n))return[];if(null==i)return[];if(1!==n.length)return[];const s=wn.from([a,...f()(o).call(o,Xt.PayingForTx)?["inner_tx"]:[]].join("-")),c=ot([s,r.rlpEncoded]),A=ot([s,Tt(r.rlpEncoded)]),u=vt(i.id);return zt(c,n[0],u)||zt(A,n[0],u)?[]:[{message:"Signature cannot be verified, please ensure that you transaction have the correct prefix and the correct private key for the sender address",key:"InvalidSignature",checkedKeys:["encodedTx","signatures"]}]}),(async(e,t)=>{let{encodedTx:r,tx:n}=e,{node:i,parentTxTypes:a,txType:o}=t;return void 0===(null!=r?r:n)?[]:bn(Qt((null!=r?r:n).rlpEncoded,lt.Transaction),i,[...a,o])}),((e,t)=>{let{ttl:r}=e,{height:n}=t;return void 0===r?[]:(r=+r,0===r||r>=n?[]:[{message:`TTL ${r} is already expired, current height is ${n}`,key:"ExpiredTTL",checkedKeys:["ttl"]}])}),((e,t)=>{var r,n;let{amount:i,fee:a,nameFee:o,tx:s}=e,{account:c,parentTxTypes:A,txType:u}=t;if(null==c)return[];if(void 0===(null!==(r=null!=i?i:a)&&void 0!==r?r:o))return[];null!==(n=a)&&void 0!==n||(a=0);const l=new(p())(a).plus(null!=o?o:0).plus(null!=i?i:0).plus(u===Xt.PayingForTx?s.tx.encodedTx.tx.fee:0).minus(f()(A).call(A,Xt.PayingForTx)?a:0);return l.lte(c.balance.toString())?[]:[{message:`Account balance ${c.balance.toString()} is not enough to execute the transaction that costs ${l.toFixed()}`,key:"InsufficientBalance",checkedKeys:["amount","fee","nameFee"]}]}),((e,t)=>{let{nonce:r}=e,{account:n,parentTxTypes:i}=t;if(null==r||null==n||f()(i).call(i,Xt.GaMetaTx))return[];r=+r;const a=n.nonce+1;return r===a?[]:[{...r<a?{message:`Nonce ${r} is already used, valid nonce is ${a}`,key:"NonceAlreadyUsed"}:{message:`Nonce ${r} is too high, valid nonce is ${a}`,key:"NonceHigh"},checkedKeys:["nonce"]}]}),((e,t)=>{let{ctVersion:r,abiVersion:n}=e,{txType:i,consensusProtocolVersion:a}=t;if(!st(a,an))throw new U(`Unsupported protocol: ${a}`);null==r&&(r={abiVersion:n});const o=an[a][i];return null==o?[]:Object.entries(r).some((e=>{var t;let[r,n]=e;return!f()(t=o[r]).call(t,+n)}))?[{message:`ABI/VM version ${JSON.stringify(r)} is wrong, supported is: ${JSON.stringify(o)}`,key:"VmAndAbiVersionMismatch",checkedKeys:["ctVersion","abiVersion"]}]:[]}),(async(e,t)=>{let{contractId:r}=e,{txType:n,node:i}=t;if(Xt.ContractCallTx!==n)return[];try{const{active:e}=await i.getContract(r);return e?[]:[{message:`Contract ${r} is not active`,key:"ContractNotActive",checkedKeys:["contractId"]}]}catch(e){var a,o;if(null==(null===(a=e.response)||void 0===a||null===(o=a.parsedBody)||void 0===o?void 0:o.reason))throw e;return[{message:e.response.parsedBody.reason,key:"ContractNotFound",checkedKeys:["contractId"]}]}}));class Sn extends b{constructor(e,t,r){super(e),this.name="InvalidTxError",this.validation=t,this.transaction=r}}async function xn(e){let{onNode:t}=e;return(await t.getCurrentKeyBlockHeight()).height}async function _n(e,t){var r;let{blocks:n=10,interval:i,onNode:a,...o}=t;null!==(r=i)&&void 0!==r||(i=Nn("microblock",o));const s=await xn({onNode:a})+n;do{const t=await a.getTransactionByHash(e);if(-1!==t.blockHeight)return t;await it(i)}while(await xn({onNode:a})<s);throw new D(n,e)}async function Tn(e,t){var r;let n,{interval:i,onNode:a,...o}=t;null!==(r=i)&&void 0!==r||(i=Nn("block",o));do{null!=n&&await it(i),n=(await a.getCurrentKeyBlockHeight()).height}while(n<e);return n}async function Mn(e,t){let{confirm:r=3,onNode:n,...i}=t;const{blockHeight:a}=await n.getTransactionByHash(e),o=await Tn(a+r,{onNode:n,...i}),{blockHeight:s}=await n.getTransactionByHash(e);switch(s){case-1:throw new ke(e);case a:return o;default:return Mn(e,{onNode:n,confirm:r,...i})}}async function Rn(e,t){let{onNode:r,onAccount:n,verify:i=!0,waitMined:a=!0,confirm:o,...s}=t;if(i){const t=await bn(e,r);if(t.length>0){const r=`Transaction verification errors: ${t.map((e=>e.message)).join(", ")}`;throw new Sn(r,t,e)}}try{let t;try{t=null!=n?`tx-${await n.address(s)}`:null}catch(e){t=null}const{txHash:i}=await r.postTransaction({tx:e},null!=t?{requestOptions:{customHeaders:{__queue:t}}}:{});if(a){const t=await _n(i,{onNode:r,...s}),n={...t,hash:t.hash,rawTx:e};if(null!=o&&(!0===o||o>0)){const e="boolean"==typeof o?void 0:o;return{...n,confirmationHeight:await Mn(i,{onNode:r,confirm:e,...s})}}return n}return{hash:i,rawTx:e}}catch(t){throw Object.assign(t,{rawTx:e,verifyTx:async()=>bn(e,r)})}}async function kn(e,t){let{height:r,hash:n,onNode:i}=t;return null!=r?i.getAccountByPubkeyAndHeight(e,r):null!=n?i.getAccountByPubkeyAndHash(e,n):i.getAccountByPubkey(e)}async function Dn(e,t){let{format:r=qe.AETTOS,...n}=t;const{balance:i}=await kn(e,n).catch((()=>({balance:0n})));return Le(i,{targetDenomination:r})}async function zn(e){let{onNode:t}=e;return t.getCurrentGeneration()}async function On(e,t){let{onNode:r}=t;return"number"==typeof e?r.getGenerationByHeight(e):r.getGenerationByHash(e)}async function Un(e,t){let{onNode:r}=t;return(await r.getMicroBlockTransactionsByHash(e)).transactions}async function Fn(e,t){let{onNode:r}=t;return"number"==typeof e?r.getKeyBlockByHeight(e):r.getKeyBlockByHash(e)}async function Pn(e,t){let{onNode:r}=t;return r.getMicroBlockHeaderByHash(e)}const qn=new Map;async function Gn(e,t){const r=qn.get(e);if(qn.delete(e),null==r)throw new q("Can't get dry-run request");let n;try{n=await t.protectedDryRunTxs({top:r[0].top,txEvents:r[0].txEvents,txs:r.map((e=>({tx:e.tx}))),accounts:Array.from(new Set(r.map((e=>e.accountAddress)))).map((e=>({pubKey:e,amount:en.amount})))})}catch(e){return void r.forEach((t=>{let{reject:r}=t;return r(e)}))}const{results:i,txEvents:a}=n;i.forEach(((e,t)=>{let{result:n,reason:i,...o}=e;const{resolve:s,reject:c,tx:A,accountAddress:u}=r[t];"ok"===n?s({...o,txEvents:a}):c(Object.assign(new Ne(i),{tx:A,accountAddress:u}))}))}async function Ln(e,t,r){var n;let{top:i,txEvents:a,combine:o,onNode:s}=r;const c=!0===o?[i,a].join():"immediate",A=null!==(n=qn.get(c))&&void 0!==n?n:[];return qn.set(c,A),new Promise(((r,n)=>{var u;A.push({tx:e,accountAddress:t,top:i,txEvents:a,resolve:r,reject:n}),!0===o?null!==(u=A.timeout)&&void 0!==u||(A.timeout=setTimeout((()=>{Gn(c,s)}))):Gn(c,s)}))}async function Hn(e,t){let{onNode:r}=t;return r.getContractCode(e)}async function jn(e,t){let{onNode:r}=t;return r.getContract(e)}async function Yn(e,t){let{onNode:r}=t;return r.getNameEntryByName(e)}async function Kn(e,t,r){let{verify:n=!0,resolveByNode:i=!1,onNode:a}=r;if(hr(e)){if(n||i){const r=(await a.getNameEntryByName(e)).pointers.find((e=>e.key===t));if(null==r)throw new j(e,t);if(i)return r.id}return sr(e)}try{return vt(e),e}catch(t){throw new K(`Invalid name or address: ${e}`)}}var Vn,$n={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)},Jn=new Uint8Array(16);function Wn(){if(!Vn&&!(Vn="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Vn(Jn)}for(var Xn=[],Zn=0;Zn<256;++Zn)Xn.push((Zn+256).toString(16).substr(1));var ei=function(e,t,r){if($n.randomUUID&&!t&&!e)return $n.randomUUID();var n=(e=e||{}).random||(e.rng||Wn)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(var i=0;i<16;++i)t[r+i]=n[i];return t}return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return(Xn[e[t+0]]+Xn[e[t+1]]+Xn[e[t+2]]+Xn[e[t+3]]+"-"+Xn[e[t+4]]+Xn[e[t+5]]+"-"+Xn[e[t+6]]+Xn[e[t+7]]+"-"+Xn[e[t+8]]+Xn[e[t+9]]+"-"+Xn[e[t+10]]+Xn[e[t+11]]+Xn[e[t+12]]+Xn[e[t+13]]+Xn[e[t+14]]+Xn[e[t+15]]).toLowerCase()}(n)},ti=r(9250);const ri={async argon2id(e,t,r){const{memlimit_kib:n,opslimit:i}=r;return(await(0,ti.hash)({hashLen:32,pass:e,salt:t,time:i,mem:n,type:ti.ArgonType.Argon2id})).hash}},ni={"xsalsa20-poly1305":{encrypt:Ke().secretbox,decrypt(){const e=Ke().secretbox.open(...arguments);if(null==e)throw new ye;return e}}},ii={secret_type:"ed25519",symmetric_alg:"xsalsa20-poly1305",kdf:"argon2id",kdf_params:{memlimit_kib:65536,opslimit:3,parallelism:1}};function ai(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:ii.symmetric_alg;return ni[n].encrypt(e,r,t)}async function oi(e,t,r,n){return ri[r](e,t,n)}async function si(e,t){let{crypto:r}=t;const n=rt(r.kdf_params.salt);return tt(function(e,t,r){return ni[arguments.length>3&&void 0!==arguments[3]?arguments[3]:ii.symmetric_alg].decrypt(e,r,t)}(rt(r.ciphertext),await oi(e,n,r.kdf,r.kdf_params),rt(r.cipher_params.nonce),r.symmetric_alg))}async function ci(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Ke().randomBytes(24),i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:Ke().randomBytes(16),a=arguments.length>5?arguments[5]:void 0;const o={...ii,...a},s=await oi(t,i,o.kdf,o.kdf_params),c="string"==typeof r?rt(r):r;return{name:e,version:1,public_key:Nt(c),id:ei(),crypto:{secret_type:o.secret_type,symmetric_alg:o.symmetric_alg,ciphertext:tt(ai(c,s,n,o.symmetric_alg)),cipher_params:{nonce:tt(n)},kdf:o.kdf,kdf_params:{...o.kdf_params,salt:tt(i)}}}}async function Ai(e,t){var r,n;let{vmVersion:i,abiVersion:a,onNode:o}=t;const{consensusProtocolVersion:s}=await o.getNodeInfo();if(!st(s,an))throw new U("Not supported consensus protocol version");const c=an[s];if(!st(e,c))throw new De("Not supported tx type");const A=c[e];return null!==(r=a)&&void 0!==r||(a=A.abiVersion[0]),null!==(n=i)&&void 0!==n||(i=A.vmVersion[0]),{vmVersion:i,abiVersion:a}}async function ui(e,t){var r;let{senderId:n,nonce:i,ttl:a=Kr,absoluteTtl:o,strategy:s,onNode:c}=t;if(null!==(r=i)&&void 0!==r||(i=(await c.getAccountNextNonce(n,{strategy:s}).catch((()=>({nextNonce:1})))).nextNonce),0!==a){if(a<0)throw new S("ttl","greater or equal to 0",a);a+=!0===o?0:(await c.getCurrentKeyBlock()).height}return{ttl:a,nonce:i}}async function li(e,t){var r;let{denomination:n,absoluteTtl:i,...a}=t;const o=a;let s;switch(e){case Xt.SpendTx:case Xt.OracleQueryTx:s="senderId";break;case Xt.NameClaimTx:case Xt.NameUpdateTx:case Xt.NameRevokeTx:case Xt.NameTransferTx:case Xt.NamePreclaimTx:case Xt.OracleRegisterTx:s="accountId";break;case Xt.ContractCreateTx:case Xt.GaAttachTx:s="ownerId";break;case Xt.ContractCallTx:case Xt.OracleExtendTx:case Xt.OracleResponseTx:s="callerId";break;case Xt.ChannelCloseSoloTx:case Xt.ChannelSlashTx:case Xt.ChannelSettleTx:case Xt.ChannelSnapshotSoloTx:s="fromId";break;case Xt.PayingForTx:s="payerId";break;default:throw new S("txType","valid transaction type",e)}var c;f()(r=[Xt.ContractCreateTx,Xt.GaAttachTx]).call(r,e)&&(o.ctVersion=await Ai(Xt.ContractCreateTx,{...o,...o.ctVersion})),e===Xt.ContractCallTx&&(o.abiVersion=(await Ai(Xt.ContractCallTx,o)).abiVersion),e===Xt.OracleRegisterTx&&(null!==(c=o.abiVersion)&&void 0!==c||(o.abiVersion=rn.NO_ABI)),e===Xt.PayingForTx&&(o.tx=Cn(o.tx));const A=o[s];if(null==A)throw new _e(`Transaction field ${s} is missed`);const u=await ui(0,{...o,senderId:A,absoluteTtl:i});return In({...o,...u},e,{denomination:n}).tx}var di=r(2182),pi=r(246),hi=r(8826),fi=r.n(hi),gi=r(8764).Buffer;const mi=fi().ModeOfOperation.ecb;function yi(e,t){const r=pt(e);return new mi(r).encrypt(t)}function Ii(e,t){const r=gi.from(t),n=pt(e);return new mi(n).decrypt(r)}class Ci extends v{constructor(e){super(e),this.name="DerivationError"}}const Ei=gi.from("ed25519 seed"),Bi=2147483648;function wi(e,t){let{secretKey:r,chainCode:n}=e;if(t<Bi)throw new Ci(`Segment ${t} is not hardened`);const i=gi.allocUnsafe(4);i.writeUInt32BE(t,0);const a=ot([gi.alloc(1,0),r,i]),o=(0,di.full)(a,n);return{secretKey:o.slice(0,32),chainCode:o.slice(32)}}function vi(e,t){const r=""===e?[]:(0,pi.fromString)(e).toPathArray();return r.forEach(((e,t)=>{if(e<Bi)throw new Ci(`Segment #${t+1} is not hardened`)})),r.reduce(((e,t)=>wi(e,t)),t)}function Qi(e){const t=(0,di.full)(e,Ei);return{secretKey:t.slice(0,32),chainCode:t.slice(32)}}function bi(e,t){var r;if(!f()(r=["m","m/"]).call(r,e.slice(0,2)))throw new Ci("Root element is required");const n=Qi(t);return vi(e.slice(2),n)}function Ni(e){const{secretKey:t,publicKey:r}=e;return{secretKey:tt(t),publicKey:Qt(r,lt.AccountAddress)}}function Si(e){return Ke().sign.keyPair.fromSeed(e)}function xi(e,t){const r=bi("m/44h/457h",e);return{secretKey:tt(yi(t,r.secretKey)),chainCode:tt(yi(t,r.chainCode))}}function _i(e,t,r){const n={secretKey:Ii(t,gi.from(e.secretKey,"hex")),chainCode:Ii(t,gi.from(e.chainCode,"hex"))};return new Array(r).fill(void 0).map(((e,t)=>Ni(Si(vi(`${t}h/0h/0h`,n).secretKey))))}const Ti=(e,t)=>({...Ni(Si(vi(`${t}h/0h/0h`,bi("m/44h/457h",e)).secretKey)),idx:t});async function Mi(e,t){const r=!0===t.innerTx?void 0:(await kn(await t.onAccount.address(t),t)).authFun,n=await t.onAccount.signTransaction(e,{...t,authFun:r,networkId:(await t.onNode.getStatus()).networkId});return!0===t.innerTx?{hash:En(n),rawTx:n}:Rn(n,t)}async function Ri(e,t,r){return Mi(await li(Xt.SpendTx,{...r,senderId:await r.onAccount.address(r),recipientId:await Kn(t,"account_pubkey",r),amount:e}),r)}async function ki(e,t,r){if(e<0||e>1)throw new S("fraction","a number between 0 and 1",e);const n=await Kn(t,"account_pubkey",r),i=await r.onAccount.address(r),a=new(p())(await Dn.bind(r.onAccount)(i,r)),o=a.times(e).integerValue(p().ROUND_HALF_UP),{tx:{fee:s}}=Cn(await li(Xt.SpendTx,{...r,senderId:i,recipientId:n,amount:o}),Xt.SpendTx),c=o.plus(s).gt(a)?a.minus(s):o;return Mi(await li(Xt.SpendTx,{...r,senderId:i,recipientId:n,amount:c}),r)}async function Di(e,t){return Mi(await li(Xt.PayingForTx,{...t,payerId:await t.onAccount.address(t),tx:e}),t)}async function zi(e,t){return Mi(await li(Xt.NameRevokeTx,{...t,nameId:e,accountId:await t.onAccount.address(t)}),t)}async function Oi(e,t,r){let{extendPointers:n,...i}=r;const a={...!0===n&&Object.fromEntries((await Yn(e,i)).pointers.map((e=>{let{key:t,id:r}=e;return[t,r]}))),...t};return Mi(await li(Xt.NameUpdateTx,{clientTtl:Ht,nameTtl:qt,...i,nameId:e,accountId:await i.onAccount.address(i),pointers:Object.entries(a).map((e=>{let[t,r]=e;return{key:t,id:r.toString()}}))}),i)}async function Ui(e,t,r){return Mi(await li(Xt.NameTransferTx,{...r,nameId:e,accountId:await r.onAccount.address(r),recipientId:t}),r)}async function Fi(e,t){const r=await Yn(e,t);return Object.freeze({...r,id:r.id,owner:r.owner,update:async(r,n)=>({...await Oi(e,r,{...t,...n}),...await Fi(e,{...t,...n})}),transfer:async(r,n)=>({...await Ui(e,r,{...t,...n}),...await Fi(e,{...t,...n})}),revoke:async r=>zi(e,{...t,...r}),async extendTtl(){let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:qt,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(r>qt||r<=0)throw new S("nameTtl",`a number between 1 and ${qt} blocks`,r);return{...await Oi(e,{},{...t,...n,nameTtl:r,extendPointers:!0}),...await Fi(e,{...t,...n})}}})}async function Pi(e,t,r){const n=await li(Xt.NameClaimTx,{...r,accountId:await r.onAccount.address(r),nameSalt:t,name:e}),i=await Mi(n,r);if(!Cr(e)){const t=null!=i.blockHeight&&i.blockHeight>0?await Fi(e,r):{};return Object.assign(i,t)}return i}async function qi(e,t){const r=xt(),n=await xn(t),i=cr(e,r),a=await li(Xt.NamePreclaimTx,{...t,accountId:await t.onAccount.address(t),commitmentId:i});return Object.freeze({...await Mi(a,t),height:n,salt:r,commitmentId:i,claim:async n=>Pi(e,r,{...t,...n})})}async function Gi(e,t,r){return Pi(e,0,{...r,nameFee:t})}var Li=r(3023);async function Hi(e){let{onAccount:t,onCompiler:r,onNode:n,source:i,bytecode:a,aci:o,contractAddress:s,fileSystem:c={},validateBytecode:A,...u}=e;if(null==o&&null!=i&&(o=await r.generateACI({code:i,options:{fileSystem:c}})),null==o)throw new ue;if(null!=s&&(s=await Kn(s,"contract_pubkey",{resolveByNode:!0,onNode:n})),null==s&&null==i&&null==a)throw new Ae("Can't create instance by ACI without address");if(null!=s&&null==(await jn(s,{onNode:n})).active)throw new se(s);const l={_aci:o,_name:o.encodedAci.contract.name,calldata:new Li.Encoder([o.encodedAci,...o.externalEncodedAci]),source:i,bytecode:a,deployInfo:{address:s},options:{onAccount:t,onCompiler:r,onNode:n,amount:Xr,callStatic:!1,fileSystem:c,...u},async compile(e){},async _estimateGas(e,t,r){},async deploy(e,t){},async call(e,t,r){},decodeEvents(e,t){},methods:void 0};if(null!=A){if(null==s)throw new Ae("Can't validate bytecode without contract address");const e=(await Hn(s,{onNode:n})).bytecode;if(!(null!=i?await r.validateByteCode({bytecode:e,source:i,options:l.options}).then((()=>!0),(()=>!1)):a===e))throw new ae(null!=i?"source":"bytecode")}l.compile=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(null!=l.bytecode)throw new x("Contract already compiled");if(null==l.source)throw new x("Can't compile without source code");return l.bytecode=(await r.compileContract({code:l.source,options:{...l.options,...e}})).bytecode,l.bytecode};const d=(e,t)=>{let r,{returnType:n,returnValue:i}=e;switch(n){case"ok":return;case"revert":r=l.calldata.decodeFateString(i);break;case"error":r=vt(i).toString();break;default:throw new q(`Unknown return type: ${n}`)}throw new de(r,t)},p=async(e,t)=>{t={...l.options,...t};const r=await Mi(e,t),i={hash:r.hash,tx:Cn(r.rawTx),txData:r,rawTx:r.rawTx};if(null==r.blockHeight)return i;const{callInfo:a}=await n.getTransactionInfoByHash(r.hash);return Object.assign(i.txData,a),d(a,e),{...i,result:a}};function h(e){const t=l._aci.encodedAci.contract.functions.find((t=>t.name===e));if(null!=t)return t;if("init"===e)return{payable:!1};throw new pe(`Function ${e} doesn't exist in contract`)}function f(e,t,r){let{contractAddressToName:n}=r;const i={...l.options.contractAddressToName,...n};if(null!=i[e])return i[e];const a=[l._aci.encodedAci,...l._aci.externalEncodedAci].filter((e=>{let{contract:t}=e;return null==t?void 0:t.event})).map((e=>{let{contract:t}=e;return[t.name,t.event.variant]})).map((e=>{let[t,r]=e;return r.map((e=>[t,Object.keys(e)[0]]))})).flat().filter((e=>{let[,r]=e;return BigInt(`0x${Tt(r).toString("hex")}`)===t}));switch(a.length){case 0:throw new fe(t.toString(),e);case 1:return a[0][0];default:throw new ge(e,a)}}return l._estimateGas=async(e,t,r)=>{const{result:{gasUsed:n}}=await l.call(e,t,{...r,callStatic:!0});return Math.floor(1.25*n)},l.deploy=async function(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1?arguments[1]:void 0;const i={...l.options,...r};if(null==l.bytecode&&await l.compile(i),!0===i.callStatic)return l.call("init",t,i);if(null!=l.deployInfo.address)throw new oe;const a=await i.onAccount.address(r),o=await li(Xt.ContractCreateTx,{...i,gasLimit:null!==(e=i.gasLimit)&&void 0!==e?e:await l._estimateGas("init",t,i),callData:l.calldata.encode(l._name,"init",t),code:l.bytecode,ownerId:a,onNode:n}),s=Bn(o),{hash:c,rawTx:A,result:u,txData:d}=await p(o,i);return l.deployInfo=Object.freeze({result:u,owner:a,transaction:c,rawTx:A,txData:d,address:s}),l.deployInfo},l.call=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i={...l.options,...r},a=h(e),o=l.deployInfo.address;if(null==e)throw new le;if("init"===e&&!1===i.callStatic)throw new ce('"init" can be called only via dryRun');if(null==o&&"init"!==e)throw new ce("You need to deploy contract before calling!");if("init"!==e&&i.amount>0&&!1===a.payable)throw new he(i.amount,e);const s=await Promise.resolve().then((()=>i.onAccount.address(i))).catch((e=>{if(!0===i.callStatic)return en.pub;throw e})),c=l.calldata.encode(l._name,e,t);let A;if(!0===i.callStatic){"number"==typeof i.top&&(i.top=(await Fn(i.top,{onNode:n})).hash);const t={...i,onNode:n,callData:c};null==i.nonce&&null!=i.top&&(i.nonce=(await kn(s,{hash:i.top,onNode:n})).nonce+1);const r=await("init"===e?li(Xt.ContractCreateTx,{...t,code:l.bytecode,ownerId:s}):li(Xt.ContractCallTx,{...t,callerId:s,contractId:o})),{callObj:a,...u}=await Ln(r,s,{onNode:n,...i});if(null==a)throw new G;d({returnType:a.returnType,returnValue:a.returnValue},r),A={...u,tx:Cn(r),result:a}}else{var u;const r=await li(Xt.ContractCallTx,{...i,onNode:n,gasLimit:null!==(u=i.gasLimit)&&void 0!==u?u:await l._estimateGas(e,t,i),callerId:s,contractId:o,callData:c});A=await p(r,i)}return!0!==i.callStatic&&null==A.txData.blockHeight||(A.decodedResult=null!=a.returns&&"unit"!==a.returns&&"init"!==e&&l.calldata.decode(l._name,e,A.result.returnValue),A.decodedEvents=l.decodeEvents(A.result.log,i)),A},l.decodeEvents=function(e){let{omitUnknown:t,...r}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.map((e=>{const n=e.topics.map((e=>BigInt(e)));let i;try{i=f(e.address,n[0],r)}catch(e){if(null!=t&&t&&e instanceof fe)return null;throw e}const a=l.calldata.decodeEvent(i,e.data,n),[o,s]=Object.entries(a)[0];return{name:o,args:s,contract:{name:i,address:e.address}}})).filter((e=>null!=e))},l.methods=Object.fromEntries(l._aci.encodedAci.contract.functions.map((e=>{let{name:t,arguments:r,stateful:n}=e;const i=e=>async function(){for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];const o=i.length===r.length+1?i.pop():{};if("object"!=typeof o)throw new z(`Options should be an object: ${o}`);return"init"===t?l.deploy(i,{callStatic:e,...o}):l.call(t,i,{callStatic:e,...o})};return[t,Object.assign(i("init"!==t&&!n),{get:i(!0),send:i(!1)})]}))),l}var ji=r(8764).Buffer;async function Yi(e,t){let{onAccount:r,onNode:n,...i}=t;const a=await r.sign(ot([ji.from((await n.getStatus()).networkId),...e.map((e=>vt(e)))]),i);return ji.from(a).toString("hex")}async function Ki(e,t){return Yi([await t.onAccount.address(t),...null!=t.name?[sr(t.name)]:[],e],t)}async function Vi(e,t){var r;return Yi([null!==(r=t.queryId)&&void 0!==r?r:await t.onAccount.address(t),e],t)}function $i(e,t,r){var n;let{interval:i,onNode:a,...o}=r;null!==(n=i)&&void 0!==n||(i=Nn("microblock",o));const s=new Set,c=async()=>{var r;const n=(null!==(r=(await a.getOracleQueriesByPubkey(e)).oracleQueries)&&void 0!==r?r:[]).filter((e=>{let{id:t}=e;return!s.has(t)}));n.forEach((e=>{let{id:t}=e;return s.add(t)})),n.length>0&&t(n)};let A=!1;return(async()=>{for(;!A;)await c().catch(console.error),await it(i)})(),()=>{A=!0}}async function Ji(e,t,r){var n;let i,a,o,{interval:s,onNode:c,...A}=r;null!==(n=s)&&void 0!==n||(s=Nn("microblock",A));do{null!=i&&await it(s),({response:o,ttl:a}=await c.getOracleQueryByPubkeyAndQueryId(e,t));const r=vt(o);if(r.length>0)return r.toString();i=await this.getHeight()}while(a>=i);throw new k(i)}async function Wi(e,t,r){const n=await r.onNode.getOracleQueryByPubkeyAndQueryId(e,t);return{...n,decodedQuery:vt(n.query).toString(),decodedResponse:vt(n.response).toString(),respond:async(n,i)=>ea(e,t,n,{...r,...i}),pollForResponse:async n=>Ji(e,t,{...r,...n})}}async function Xi(e,t,r){var n;null!==(n=r.queryFee)&&void 0!==n||(r.queryFee=(await r.onNode.getOracleByPubkey(e)).queryFee.toString());const i=await r.onAccount.address(r),a=await li(Xt.OracleQueryTx,{queryTtlType:Jr.type,queryTtlValue:Jr.value,responseTtlType:Wr.type,responseTtlValue:Wr.value,...r,oracleId:e,senderId:i,query:t}),{nonce:o}=Cn(a,Xt.OracleQueryTx).tx,s=ar(i,o,e);return{...await Mi(a,r),...await Wi(e,s,r)}}async function Zi(e,t){const r=await li(Xt.OracleExtendTx,{oracleTtlType:$r.type,oracleTtlValue:$r.value,...t,callerId:await t.onAccount.address(t),oracleId:e});return{...await Mi(r,t),...await ta(e,t)}}async function ea(e,t,r,n){const i=await li(Xt.OracleResponseTx,{responseTtlType:Wr.type,responseTtlValue:Wr.value,...n,callerId:await n.onAccount.address(n),oracleId:e,queryId:t,response:r});return{...await Mi(i,n),...await ta(e,n)}}async function ta(e,t){return{...await t.onNode.getOracleByPubkey(e),queries:(await t.onNode.getOracleQueriesByPubkey(e)).oracleQueries,...at({pollQueries:$i,postQuery:Xi,respondToQuery:ea,extendOracle:Zi,getQuery:Wi},(r=>{let[n,i]=r;return[n,function(){for(var r=arguments.length,n=new Array(r),a=0;a<r;a++)n[a]=arguments[a];const o=n[n.length-1];return null!=o&&"object"==typeof o&&o.constructor===Object?Object.assign(o,{...t,...o}):n.push(t),i(e,...n)}]}))}}async function ra(e,t,r){const n=await r.onAccount.address(r),i=await li(Xt.OracleRegisterTx,{queryFee:Vr,oracleTtlValue:$r.value,oracleTtlType:$r.type,...r,accountId:n,queryFormat:e,responseFormat:t});return{...await Mi(i,r),...await ta(Qt(vt(n),lt.OracleAddress),r)}}var na=r(8764).Buffer;async function ia(e,t){const{contractId:r}=await kn(e,t);return null!=r}async function aa(e,t,r,n){var i;let{onAccount:a,onCompiler:o,onNode:s,...c}=n;const A=await a.address(c);if(await ia(A,{onNode:s}))throw new x(`Account ${A} is already GA`);const u=await Hi({onAccount:a,onCompiler:o,onNode:s,source:t}),l=await li(Xt.GaAttachTx,{...c,onNode:s,code:await u.compile(),gasLimit:null!==(i=c.gasLimit)&&void 0!==i?i:await u._estimateGas("init",r,c),ownerId:A,callData:u.calldata.encode(u._name,"init",r),authFun:Tt(e)}),d=Bn(l),{hash:p,rawTx:h}=await Mi(l,{onNode:s,onAccount:a,onCompiler:o,...c});return Object.freeze({owner:A,transaction:p,rawTx:h,gaContractId:d})}async function oa(e,t,r,n){var i,a;let{onAccount:o,onCompiler:s,onNode:c,...A}=n;const u=e=>In({encodedTx:e,signatures:[]},Xt.SignedTx);if(Object.keys(t).length<=0)throw new M("authData is required");const l=null!==(i=t.gasLimit)&&void 0!==i?i:Zr;if(l>Zr)throw new ie(`the maximum gasLimit value for ga authFun is ${Zr}, got ${l}`);const d=null!==(a=t.callData)&&void 0!==a?a:await(async()=>{if(null==t.source||null==t.args)throw new ie("Auth data must contain source code and arguments.");const e=await Hi({onCompiler:s,onNode:c,source:t.source});return e.calldata.encode(e._name,r,t.args)})(),{abiVersion:p}=await Ai(Xt.ContractCallTx,{onNode:c}),h=u(Cn(e)),f={...A,tx:{...h,tx:h.txObject},gaId:await o.address(A),abiVersion:p,authData:d,gasLimit:l,vsn:2},{fee:g}=await ui(Xt.GaMetaTx,{...f,onNode:c}),{rlpEncoded:m}=In({...f,fee:g},Xt.GaMetaTx);return u(m).tx}async function sa(e,t){let{onNode:r}=t;const{networkId:n}=await r.getStatus();return new Uint8Array(Tt(ot([na.from(n),vt(e)])))}async function ca(e,t){let{authData:r,authFun:n,...i}=t;return oa(e,r,n,i)}async function Aa(e){let{onNode:t}=e;return(await t.getCurrentKeyBlockHeight()).height}function ua(){return Math.floor(Math.random()*Math.floor(Number.MAX_SAFE_INTEGER))}const la=ua;function da(e,t){let{params:r,vsn:n,denomination:i}=t;return Nr(e,(t=>In({...r,_computingMinFee:t},e,{vsn:n,denomination:i})))}const pa=1579e3;let ha;!function(e){e[e.account=10]="account",e[e.signed=11]="signed",e[e.spend=12]="spend",e[e.oracleRegister=22]="oracleRegister",e[e.oracleQuery=23]="oracleQuery",e[e.oracleResponse=24]="oracleResponse",e[e.oracleExtend=25]="oracleExtend",e[e.nameClaim=32]="nameClaim",e[e.namePreClaim=33]="namePreClaim",e[e.nameUpdate=34]="nameUpdate",e[e.nameRevoke=35]="nameRevoke",e[e.nameTransfer=36]="nameTransfer",e[e.contract=40]="contract",e[e.contractCallResult=41]="contractCallResult",e[e.contractCreate=42]="contractCreate",e[e.contractCall=43]="contractCall",e[e.channelCreate=50]="channelCreate",e[e.channelDeposit=51]="channelDeposit",e[e.channelWithdraw=52]="channelWithdraw",e[e.channelCloseMutual=53]="channelCloseMutual",e[e.channelCloseSolo=54]="channelCloseSolo",e[e.channelSlash=55]="channelSlash",e[e.channelSettle=56]="channelSettle",e[e.channelOffChain=57]="channelOffChain",e[e.channel=58]="channel",e[e.channelSnapshotSolo=59]="channelSnapshotSolo",e[e.proofOfInclusion=60]="proofOfInclusion",e[e.stateTrees=62]="stateTrees",e[e.merklePatriciaTree=63]="merklePatriciaTree",e[e.merklePatriciaTreeValue=64]="merklePatriciaTreeValue",e[e.sophiaByteCode=70]="sophiaByteCode",e[e.gaAttach=80]="gaAttach",e[e.gaMeta=81]="gaMeta",e[e.payingFor=82]="payingFor",e[e.channelForceProgress=521]="channelForceProgress",e[e.channelOffChainUpdateTransfer=570]="channelOffChainUpdateTransfer",e[e.channelOffChainUpdateDeposit=571]="channelOffChainUpdateDeposit",e[e.channelOffChainUpdateWithdrawal=572]="channelOffChainUpdateWithdrawal",e[e.channelOffChainCreateContract=573]="channelOffChainCreateContract",e[e.channelOffChainCallContract=574]="channelOffChainCallContract",e[e.channelReconnect=575]="channelReconnect",e[e.contractsTree=621]="contractsTree",e[e.contractCallsTree=622]="contractCallsTree",e[e.channelsTree=623]="channelsTree",e[e.nameserviceTree=624]="nameserviceTree",e[e.oraclesTree=625]="oraclesTree",e[e.accountsTree=626]="accountsTree"}(ha||(ha={}));const fa={account:1,name:2,commitment:3,oracle:4,contract:5,channel:6},ga={ak:fa.account,nm:fa.name,cm:fa.commitment,ok:fa.oracle,ct:fa.contract,ch:fa.channel},ma=at(ga,(e=>{let[t,r]=e;return[r,t]}));let ya;!function(e){e.ak="account_pubkey",e.ok="oracle_pubkey",e.ct="contract_pubkey",e.ch="channel"}(ya||(ya={}));var Ia=r(7445);function Ca(e,t,r){return t in e?Ia(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ea(e){return!("object"!=typeof e||null===e||Array.isArray(e)||e instanceof RegExp||e instanceof Date)}function Ba(e){if(Ea(e)){const t="string"==typeof e.name,r="string"==typeof e.message;return t&&r}return!1}function wa(e){if(Ba(e))return e.message;{let t;try{t="object"==typeof e&&e?JSON.stringify(e):String(e)}catch(e){t="[unable to stringify input]"}return`Unknown error ${t}`}}const va={},Qa="REDACTED",ba=["x-ms-client-request-id","x-ms-return-client-request-id","x-ms-useragent","x-ms-correlation-request-id","x-ms-request-id","client-request-id","ms-cv","return-client-request-id","traceparent","Access-Control-Allow-Credentials","Access-Control-Allow-Headers","Access-Control-Allow-Methods","Access-Control-Allow-Origin","Access-Control-Expose-Headers","Access-Control-Max-Age","Access-Control-Request-Headers","Access-Control-Request-Method","Origin","Accept","Accept-Encoding","Cache-Control","Connection","Content-Length","Content-Type","Date","ETag","Expires","If-Match","If-Modified-Since","If-None-Match","If-Unmodified-Since","Last-Modified","Pragma","Request-Id","Retry-After","Server","Transfer-Encoding","User-Agent","WWW-Authenticate"],Na=["api-version"];class Sa{constructor({additionalAllowedHeaderNames:e=[],additionalAllowedQueryParameters:t=[]}={}){e=ba.concat(e),t=Na.concat(t),this.allowedHeaderNames=new Set(e.map((e=>e.toLowerCase()))),this.allowedQueryParameters=new Set(t.map((e=>e.toLowerCase())))}sanitize(e){const t=new Set;return JSON.stringify(e,((e,r)=>{if(r instanceof Error)return Object.assign(Object.assign({},r),{name:r.name,message:r.message});if("headers"===e)return this.sanitizeHeaders(r);if("url"===e)return this.sanitizeUrl(r);if("query"===e)return this.sanitizeQuery(r);if("body"!==e&&"response"!==e&&"operationSpec"!==e){if(Array.isArray(r)||Ea(r)){if(t.has(r))return"[Circular]";t.add(r)}return r}}),2)}sanitizeHeaders(e){const t={};for(const r of Object.keys(e))this.allowedHeaderNames.has(r.toLowerCase())?t[r]=e[r]:t[r]=Qa;return t}sanitizeQuery(e){if("object"!=typeof e||null===e)return e;const t={};for(const r of Object.keys(e))this.allowedQueryParameters.has(r.toLowerCase())?t[r]=e[r]:t[r]=Qa;return t}sanitizeUrl(e){if("string"!=typeof e||null===e)return e;const t=new URL(e);if(!t.search)return e;for(const[e]of t.searchParams)this.allowedQueryParameters.has(e.toLowerCase())||t.searchParams.set(e,Qa);return t.toString()}}const xa=new Sa;class _a extends Error{constructor(e,t={}){super(e),this.name="RestError",this.code=t.code,this.statusCode=t.statusCode,this.request=t.request,this.response=t.response,Object.setPrototypeOf(this,_a.prototype)}[va](){return`RestError: ${this.message} \n ${xa.sanitize(this)}`}}_a.REQUEST_SEND_ERROR="REQUEST_SEND_ERROR",_a.PARSE_ERROR="PARSE_ERROR";const Ta=()=>{const e=new Map;return{policy:{name:"request-queues",async sendRequest(t,r){var n;const i=t.headers.get("__queue");t.headers.delete("__queue");const a=async()=>r(t);if(null==i)return a();const o=(null!==(n=e.get(i))&&void 0!==n?n:Promise.resolve()).then(a,a);return e.set(i,o.then((async()=>it(750)))),o}},position:"perCall"}},Ma=()=>{const e=new Map;return{policy:{name:"combine-requests",async sendRequest(t,r){var n;if("GET"!==t.method)return r(t);const i=JSON.stringify([t.url,t.body]),a=null!==(n=e.get(i))&&void 0!==n?n:r(t);e.set(i,a);try{return await a}finally{e.delete(i)}}},position:"perCall"}},Ra=e=>({policy:{name:"error-formatter",async sendRequest(t,r){try{return await r(t)}catch(t){var n;if(!(t instanceof _a)||null==t.request)throw t;if(null==(null===(n=t.response)||void 0===n?void 0:n.bodyAsText))throw t;let r;try{r=JSON.parse(t.response.bodyAsText)}catch(e){throw t}t.message=`${new URL(t.request.url).pathname.slice(1)} error`;const i=e(r);throw""!==i&&(t.message+=`:${i}`),t}}},position:"perCall"}),ka=(e,t,r,n,i)=>({name:"version-check",async sendRequest(a,o){if(new URL(a.url).pathname===t)return o(a);const s=[await r,n,i];if(!function(e,t,r){const n=e=>e.split(/[-+]/)[0].split(".").map((e=>+e)),i=n(e),a=n(t),o=n(r),s=Math.max(...i,...a,...o)+1,c=e=>e.reverse().reduce(((e,t,r)=>e+t*s**r),0),A=c(i),u=c(a),l=c(o);return A>=u&&A<l}(...s))throw new P(e,...s);return o(a)}});function Da(e){return e.toLowerCase()}class za{constructor(e){if(this._headersMap=new Map,e)for(const t of Object.keys(e))this.set(t,e[t])}set(e,t){this._headersMap.set(Da(e),{name:e,value:String(t)})}get(e){var t;return null===(t=this._headersMap.get(Da(e)))||void 0===t?void 0:t.value}has(e){return this._headersMap.has(Da(e))}delete(e){this._headersMap.delete(Da(e))}toJSON(e={}){const t={};if(e.preserveCase)for(const e of this._headersMap.values())t[e.name]=e.value;else for(const[e,r]of this._headersMap)t[e]=r.value;return t}toString(){return JSON.stringify(this.toJSON({preserveCase:!0}))}[Symbol.iterator](){return function*(e){for(const t of e.values())yield[t.name,t.value]}(this._headersMap)}}function Oa(e){return new za(e)}var Ua,Fa=new Uint8Array(16);function Pa(){if(!Ua&&!(Ua="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Ua(Fa)}for(var qa=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,Ga=function(e){return"string"==typeof e&&qa.test(e)},La=[],Ha=0;Ha<256;++Ha)La.push((Ha+256).toString(16).substr(1));var ja=function(e,t,r){var n=(e=e||{}).random||(e.rng||Pa)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(var i=0;i<16;++i)t[r+i]=n[i];return t}return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=(La[e[t+0]]+La[e[t+1]]+La[e[t+2]]+La[e[t+3]]+"-"+La[e[t+4]]+La[e[t+5]]+"-"+La[e[t+6]]+La[e[t+7]]+"-"+La[e[t+8]]+La[e[t+9]]+"-"+La[e[t+10]]+La[e[t+11]]+La[e[t+12]]+La[e[t+13]]+La[e[t+14]]+La[e[t+15]]).toLowerCase();if(!Ga(r))throw TypeError("Stringified UUID is invalid");return r}(n)};class Ya{constructor(e){var t,r,n,i,a,o,s;this.url=e.url,this.body=e.body,this.headers=null!==(t=e.headers)&&void 0!==t?t:Oa(),this.method=null!==(r=e.method)&&void 0!==r?r:"GET",this.timeout=null!==(n=e.timeout)&&void 0!==n?n:0,this.formData=e.formData,this.disableKeepAlive=null!==(i=e.disableKeepAlive)&&void 0!==i&&i,this.proxySettings=e.proxySettings,this.streamResponseStatusCodes=e.streamResponseStatusCodes,this.withCredentials=null!==(a=e.withCredentials)&&void 0!==a&&a,this.abortSignal=e.abortSignal,this.tracingOptions=e.tracingOptions,this.onUploadProgress=e.onUploadProgress,this.onDownloadProgress=e.onDownloadProgress,this.requestId=e.requestId||ja(),this.allowInsecureConnection=null!==(o=e.allowInsecureConnection)&&void 0!==o&&o,this.enableBrowserStreams=null!==(s=e.enableBrowserStreams)&&void 0!==s&&s}}const Ka="$",Va="_";function $a(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function Ja(e){const t=atob(e),r=new Uint8Array(t.length);for(let e=0;e<t.length;e++)r[e]=t.charCodeAt(e);return r}const Wa=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,Xa=/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/i;function Za(e,t){var r,n;const i=e.parsedHeaders;if("HEAD"===e.request.method)return Object.assign(Object.assign({},i),{body:e.parsedBody});const a=t&&t.bodyMapper,o=Boolean(null==a?void 0:a.nullable),s=null==a?void 0:a.type.name;if("Stream"===s)return Object.assign(Object.assign({},i),{blobBody:e.blobBody,readableStreamBody:e.readableStreamBody});const c="Composite"===s&&a.type.modelProperties||{},A=Object.keys(c).some((e=>""===c[e].serializedName));if("Sequence"===s||A){const t=null!==(r=e.parsedBody)&&void 0!==r?r:[];for(const r of Object.keys(c))c[r].serializedName&&(t[r]=null===(n=e.parsedBody)||void 0===n?void 0:n[r]);if(i)for(const e of Object.keys(i))t[e]=i[e];return!o||e.parsedBody||i||0!==Object.getOwnPropertyNames(c).length?t:null}return function(e){const t=Object.assign(Object.assign({},e.headers),e.body);return e.hasNullableType&&0===Object.getOwnPropertyNames(t).length?e.shouldWrapBody?{body:null}:null:e.shouldWrapBody?Object.assign(Object.assign({},e.headers),{body:e.body}):t}({body:e.parsedBody,headers:i,hasNullableType:o,shouldWrapBody:(u=e.parsedBody,l=s,"Composite"!==l&&"Dictionary"!==l&&("string"==typeof u||"number"==typeof u||"boolean"==typeof u||null!==(null==l?void 0:l.match(/^(Date|DateTime|DateTimeRfc1123|UnixTime|ByteArray|Base64Url)$/i))||null==u))});var u,l}class eo{constructor(e={},t=!1){this.modelMappers=e,this.isXML=t}validateConstraints(e,t,r){const n=(e,n)=>{throw new Error(`"${r}" with value "${t}" should satisfy the constraint "${e}": ${n}.`)};if(e.constraints&&null!=t){const{ExclusiveMaximum:r,ExclusiveMinimum:i,InclusiveMaximum:a,InclusiveMinimum:o,MaxItems:s,MaxLength:c,MinItems:A,MinLength:u,MultipleOf:l,Pattern:d,UniqueItems:p}=e.constraints;if(void 0!==r&&t>=r&&n("ExclusiveMaximum",r),void 0!==i&&t<=i&&n("ExclusiveMinimum",i),void 0!==a&&t>a&&n("InclusiveMaximum",a),void 0!==o&&t<o&&n("InclusiveMinimum",o),void 0!==s&&t.length>s&&n("MaxItems",s),void 0!==c&&t.length>c&&n("MaxLength",c),void 0!==A&&t.length<A&&n("MinItems",A),void 0!==u&&t.length<u&&n("MinLength",u),void 0!==l&&t%l!=0&&n("MultipleOf",l),d){const e="string"==typeof d?new RegExp(d):d;"string"==typeof t&&null!==t.match(e)||n("Pattern",d)}p&&t.some(((e,t,r)=>r.indexOf(e)!==t))&&n("UniqueItems",p)}}serialize(e,t,r,n={xml:{}}){var i,a,o;const s={xml:{rootName:null!==(i=n.xml.rootName)&&void 0!==i?i:"",includeRoot:null!==(a=n.xml.includeRoot)&&void 0!==a&&a,xmlCharKey:null!==(o=n.xml.xmlCharKey)&&void 0!==o?o:Va}};let c={};const A=e.type.name;r||(r=e.serializedName),null!==A.match(/^Sequence$/i)&&(c=[]),e.isConstant&&(t=e.defaultValue);const{required:u,nullable:l}=e;if(u&&l&&void 0===t)throw new Error(`${r} cannot be undefined.`);if(u&&!l&&null==t)throw new Error(`${r} cannot be null or undefined.`);if(!u&&!1===l&&null===t)throw new Error(`${r} cannot be null.`);return null==t?c=t:(this.validateConstraints(e,t,r),null!==A.match(/^any$/i)?c=t:null!==A.match(/^(Number|String|Boolean|Object|Stream|Uuid)$/i)?c=function(e,t,r){if(null!=r)if(null!==e.match(/^Number$/i)){if("number"!=typeof r)throw new Error(`${t} with value ${r} must be of type number.`)}else if(null!==e.match(/^String$/i)){if("string"!=typeof r.valueOf())throw new Error(`${t} with value "${r}" must be of type string.`)}else if(null!==e.match(/^Uuid$/i)){if("string"!=typeof r.valueOf()||(n=r,!Xa.test(n)))throw new Error(`${t} with value "${r}" must be of type string and a valid uuid.`)}else if(null!==e.match(/^Boolean$/i)){if("boolean"!=typeof r)throw new Error(`${t} with value ${r} must be of type boolean.`)}else if(null!==e.match(/^Stream$/i)&&!("string"==typeof r||"function"==typeof r.pipe||r instanceof ArrayBuffer||ArrayBuffer.isView(r)||("function"==typeof Blob||"object"==typeof Blob)&&r instanceof Blob))throw new Error(`${t} must be a string, Blob, ArrayBuffer, ArrayBufferView, or NodeJS.ReadableStream.`);var n;return r}(A,r,t):null!==A.match(/^Enum$/i)?c=function(e,t,r){if(!t)throw new Error(`Please provide a set of allowedValues to validate ${e} as an Enum Type.`);if(!t.some((e=>"string"==typeof e.valueOf()?e.toLowerCase()===r.toLowerCase():e===r)))throw new Error(`${r} is not a valid value for ${e}. The valid values are: ${JSON.stringify(t)}.`);return r}(r,e.type.allowedValues,t):null!==A.match(/^(Date|DateTime|TimeSpan|DateTimeRfc1123|UnixTime)$/i)?c=function(e,t,r){if(null!=t)if(null!==e.match(/^Date$/i)){if(!(t instanceof Date||"string"==typeof t.valueOf()&&!isNaN(Date.parse(t))))throw new Error(`${r} must be an instanceof Date or a string in ISO8601 format.`);t=t instanceof Date?t.toISOString().substring(0,10):new Date(t).toISOString().substring(0,10)}else if(null!==e.match(/^DateTime$/i)){if(!(t instanceof Date||"string"==typeof t.valueOf()&&!isNaN(Date.parse(t))))throw new Error(`${r} must be an instanceof Date or a string in ISO8601 format.`);t=t instanceof Date?t.toISOString():new Date(t).toISOString()}else if(null!==e.match(/^DateTimeRfc1123$/i)){if(!(t instanceof Date||"string"==typeof t.valueOf()&&!isNaN(Date.parse(t))))throw new Error(`${r} must be an instanceof Date or a string in RFC-1123 format.`);t=t instanceof Date?t.toUTCString():new Date(t).toUTCString()}else if(null!==e.match(/^UnixTime$/i)){if(!(t instanceof Date||"string"==typeof t.valueOf()&&!isNaN(Date.parse(t))))throw new Error(`${r} must be an instanceof Date or a string in RFC-1123/ISO8601 format for it to be serialized in UnixTime/Epoch format.`);t=function(e){if(e)return"string"==typeof e.valueOf()&&(e=new Date(e)),Math.floor(e.getTime()/1e3)}(t)}else if(null!==e.match(/^TimeSpan$/i)&&!function(e){return Wa.test(e)}(t))throw new Error(`${r} must be a string in ISO 8601 format. Instead was "${t}".`);return t}(A,t,r):null!==A.match(/^ByteArray$/i)?c=function(e,t){if(null!=t){if(!(t instanceof Uint8Array))throw new Error(`${e} must be of type Uint8Array.`);t=$a(t)}return t}(r,t):null!==A.match(/^Base64Url$/i)?c=function(e,t){if(null!=t){if(!(t instanceof Uint8Array))throw new Error(`${e} must be of type Uint8Array.`);t=function(e){if(e){if(!(e instanceof Uint8Array))throw new Error("Please provide an input of type Uint8Array for converting to Base64Url.");return function(e,t){let r=e.length;for(;r-1>=0&&"="===e[r-1];)--r;return e.substr(0,r)}($a(e)).replace(/\+/g,"-").replace(/\//g,"_")}}(t)}return t}(r,t):null!==A.match(/^Sequence$/i)?c=function(e,t,r,n,i,a){var o;if(!Array.isArray(r))throw new Error(`${n} must be of type Array.`);let s=t.type.element;if(!s||"object"!=typeof s)throw new Error(`element" metadata for an Array must be defined in the mapper and it must of type "object" in ${n}.`);"Composite"===s.type.name&&s.type.className&&(s=null!==(o=e.modelMappers[s.type.className])&&void 0!==o?o:s);const c=[];for(let t=0;t<r.length;t++){const o=e.serialize(s,r[t],n,a);if(i&&s.xmlNamespace){const e=s.xmlNamespacePrefix?`xmlns:${s.xmlNamespacePrefix}`:"xmlns";"Composite"===s.type.name?(c[t]=Object.assign({},o),c[t][Ka]={[e]:s.xmlNamespace}):(c[t]={},c[t][a.xml.xmlCharKey]=o,c[t][Ka]={[e]:s.xmlNamespace})}else c[t]=o}return c}(this,e,t,r,Boolean(this.isXML),s):null!==A.match(/^Dictionary$/i)?c=function(e,t,r,n,i,a){if("object"!=typeof r)throw new Error(`${n} must be of type object.`);const o=t.type.value;if(!o||"object"!=typeof o)throw new Error(`"value" metadata for a Dictionary must be defined in the mapper and it must of type "object" in ${n}.`);const s={};for(const t of Object.keys(r)){const c=e.serialize(o,r[t],n,a);s[t]=ao(o,c,i,a)}if(i&&t.xmlNamespace){const e=t.xmlNamespacePrefix?`xmlns:${t.xmlNamespacePrefix}`:"xmlns",r=s;return r[Ka]={[e]:t.xmlNamespace},r}return s}(this,e,t,r,Boolean(this.isXML),s):null!==A.match(/^Composite$/i)&&(c=function(e,t,r,n,i,a){if(co(e,t)&&(t=so(e,t,r,"clientName")),null!=r){const o={},s=io(e,t,n);for(const c of Object.keys(s)){const A=s[c];if(A.readOnly)continue;let u,l=o;if(e.isXML)u=A.xmlIsWrapped?A.xmlName:A.xmlElementName||A.xmlName;else{const e=ro(A.serializedName);u=e.pop();for(const t of e){null==l[t]&&(void 0!==r[c]&&null!==r[c]||void 0!==A.defaultValue)&&(l[t]={}),l=l[t]}}if(null!=l){if(i&&t.xmlNamespace){const e=t.xmlNamespacePrefix?`xmlns:${t.xmlNamespacePrefix}`:"xmlns";l[Ka]=Object.assign(Object.assign({},l[Ka]),{[e]:t.xmlNamespace})}const o=""!==A.serializedName?n+"."+A.serializedName:n;let s=r[c];const d=co(e,t);d&&d.clientName===c&&null==s&&(s=t.serializedName);const p=e.serialize(A,s,o,a);if(void 0!==p&&null!=u){const e=ao(A,p,i,a);i&&A.xmlIsAttribute?(l[Ka]=l[Ka]||{},l[Ka][u]=p):i&&A.xmlIsWrapped?l[u]={[A.xmlElementName]:e}:l[u]=e}}}const c=function(e,t,r){const n=t.type.additionalProperties;if(!n&&t.type.className){const n=no(e,t,r);return null==n?void 0:n.type.additionalProperties}return n}(e,t,n);if(c){const t=Object.keys(s);for(const i in r)t.every((e=>e!==i))&&(o[i]=e.serialize(c,r[i],n+'["'+i+'"]',a))}return o}return r}(this,e,t,r,Boolean(this.isXML),s))),c}deserialize(e,t,r,n={xml:{}}){var i,a,o;const s={xml:{rootName:null!==(i=n.xml.rootName)&&void 0!==i?i:"",includeRoot:null!==(a=n.xml.includeRoot)&&void 0!==a&&a,xmlCharKey:null!==(o=n.xml.xmlCharKey)&&void 0!==o?o:Va}};if(null==t)return this.isXML&&"Sequence"===e.type.name&&!e.xmlIsWrapped&&(t=[]),void 0!==e.defaultValue&&(t=e.defaultValue),t;let c;const A=e.type.name;if(r||(r=e.serializedName),null!==A.match(/^Composite$/i))c=function(e,t,r,n,i){var a;co(e,t)&&(t=so(e,t,r,"serializedName"));const o=io(e,t,n);let s={};const c=[];for(const A of Object.keys(o)){const u=o[A],l=ro(o[A].serializedName);c.push(l[0]);const{serializedName:d,xmlName:p,xmlElementName:h}=u;let f=n;""!==d&&void 0!==d&&(f=n+"."+d);const g=u.headerCollectionPrefix;if(g){const t={};for(const n of Object.keys(r))n.startsWith(g)&&(t[n.substring(g.length)]=e.deserialize(u.type.value,r[n],f,i)),c.push(n);s[A]=t}else if(e.isXML)if(u.xmlIsAttribute&&r[Ka])s[A]=e.deserialize(u,r[Ka][p],f,i);else{const t=h||p||d;if(u.xmlIsWrapped){const t=r[p],n=null!==(a=null==t?void 0:t[h])&&void 0!==a?a:[];s[A]=e.deserialize(u,n,f,i)}else{const n=r[t];s[A]=e.deserialize(u,n,f,i)}}else{let n,a=r;for(const e of l){if(!a)break;a=a[e]}n=a;const c=t.type.polymorphicDiscriminator;let d;if(c&&A===c.clientName&&null==n&&(n=t.serializedName),Array.isArray(r[A])&&""===o[A].serializedName){n=r[A];const t=e.deserialize(u,n,f,i);for(const[e,r]of Object.entries(s))Object.prototype.hasOwnProperty.call(t,e)||(t[e]=r);s=t}else void 0===n&&void 0===u.defaultValue||(d=e.deserialize(u,n,f,i),s[A]=d)}}const A=t.type.additionalProperties;if(A){const t=e=>{for(const t in o)if(ro(o[t].serializedName)[0]===e)return!1;return!0};for(const a in r)t(a)&&(s[a]=e.deserialize(A,r[a],n+'["'+a+'"]',i))}else if(r)for(const e of Object.keys(r))void 0!==s[e]||c.includes(e)||oo(e,i)||(s[e]=r[e]);return s}(this,e,t,r,s);else{if(this.isXML){const e=s.xml.xmlCharKey;void 0!==t[Ka]&&void 0!==t[e]&&(t=t[e])}null!==A.match(/^Number$/i)?(c=parseFloat(t),isNaN(c)&&(c=t)):null!==A.match(/^Boolean$/i)?c="true"===t||"false"!==t&&t:null!==A.match(/^(String|Enum|Object|Stream|Uuid|TimeSpan|any)$/i)?c=t:null!==A.match(/^(Date|DateTime|DateTimeRfc1123)$/i)?c=new Date(t):null!==A.match(/^UnixTime$/i)?c=function(e){if(e)return new Date(1e3*e)}(t):null!==A.match(/^ByteArray$/i)?c=Ja(t):null!==A.match(/^Base64Url$/i)?c=function(e){if(e){if(e&&"string"!=typeof e.valueOf())throw new Error("Please provide an input of type string for converting to Uint8Array");return Ja(e=e.replace(/-/g,"+").replace(/_/g,"/"))}}(t):null!==A.match(/^Sequence$/i)?c=function(e,t,r,n,i){var a;let o=t.type.element;if(!o||"object"!=typeof o)throw new Error(`element" metadata for an Array must be defined in the mapper and it must of type "object" in ${n}`);if(r){Array.isArray(r)||(r=[r]),"Composite"===o.type.name&&o.type.className&&(o=null!==(a=e.modelMappers[o.type.className])&&void 0!==a?a:o);const t=[];for(let a=0;a<r.length;a++)t[a]=e.deserialize(o,r[a],`${n}[${a}]`,i);return t}return r}(this,e,t,r,s):null!==A.match(/^Dictionary$/i)&&(c=function(e,t,r,n,i){const a=t.type.value;if(!a||"object"!=typeof a)throw new Error(`"value" metadata for a Dictionary must be defined in the mapper and it must of type "object" in ${n}`);if(r){const t={};for(const o of Object.keys(r))t[o]=e.deserialize(a,r[o],n,i);return t}return r}(this,e,t,r,s))}return e.isConstant&&(c=e.defaultValue),c}}function to(e={},t=!1){return new eo(e,t)}function ro(e){const t=[];let r="";if(e){const n=e.split(".");for(const e of n)"\\"===e.charAt(e.length-1)?r+=e.substr(0,e.length-1)+".":(r+=e,t.push(r),r="")}return t}function no(e,t,r){const n=t.type.className;if(!n)throw new Error(`Class name for model "${r}" is not provided in the mapper "${JSON.stringify(t,void 0,2)}".`);return e.modelMappers[n]}function io(e,t,r){let n=t.type.modelProperties;if(!n){const i=no(e,t,r);if(!i)throw new Error(`mapper() cannot be null or undefined for model "${t.type.className}".`);if(n=null==i?void 0:i.type.modelProperties,!n)throw new Error(`modelProperties cannot be null or undefined in the mapper "${JSON.stringify(i)}" of type "${t.type.className}" for object "${r}".`)}return n}function ao(e,t,r,n){if(!r||!e.xmlNamespace)return t;const i={[e.xmlNamespacePrefix?`xmlns:${e.xmlNamespacePrefix}`:"xmlns"]:e.xmlNamespace};if(["Composite"].includes(e.type.name)){if(t[Ka])return t;{const e=Object.assign({},t);return e[Ka]=i,e}}const a={};return a[n.xml.xmlCharKey]=t,a[Ka]=i,a}function oo(e,t){return[Ka,t.xml.xmlCharKey].includes(e)}function so(e,t,r,n){const i=co(e,t);if(i){let a=i[n];if(a){"serializedName"===n&&(a=a.replace(/\\/gi,""));const i=r[a];if(null!=i){const r=t.type.uberParent||t.type.className,n=i===r?i:r+"."+i,a=e.modelMappers.discriminators[n];a&&(t=a)}}}return t}function co(e,t){return t.type.polymorphicDiscriminator||Ao(e,t.type.uberParent)||Ao(e,t.type.className)}function Ao(e,t){return t&&e.modelMappers[t]&&e.modelMappers[t].type.polymorphicDiscriminator}const uo="Sequence",lo="Stream";function po(e,t,r){let n=t.parameterPath;const i=t.mapper;let a;if("string"==typeof n&&(n=[n]),Array.isArray(n)){if(n.length>0)if(i.isConstant)a=i.defaultValue;else{let t=ho(e,n);!t.propertyFound&&r&&(t=ho(r,n));let o=!1;t.propertyFound||(o=i.required||"options"===n[0]&&2===n.length),a=o?i.defaultValue:t.propertyValue}}else{i.required&&(a={});for(const t in n){const o=i.type.modelProperties[t],s=po(e,{parameterPath:n[t],mapper:o},r);void 0!==s&&(a||(a={}),a[t]=s)}}return a}function ho(e,t){const r={propertyFound:!1};let n=0;for(;n<t.length;++n){const r=t[n];if(!e||!(r in e))break;e=e[r]}return n===t.length&&(r.propertyValue=e,r.propertyFound=!0),r}const fo=new WeakMap;function go(e){let t=fo.get(e);return t||(t={},fo.set(e,t)),t}const mo=["application/json","text/json"],yo=["application/xml","application/atom+xml"];var Io=r(8955);const Co=void 0!==Io&&Io.env&&Io.env.DEBUG||void 0;let Eo,Bo=[],wo=[];const vo=[];Co&&bo(Co);const Qo=Object.assign((e=>So(e)),{enable:bo,enabled:No,disable:function(){const e=Eo||"";return bo(""),e},log:function(...e){if(e.length>0){const t=String(e[0]);t.includes(":error")?console.error(...e):t.includes(":warning")?console.warn(...e):t.includes(":info")?console.info(...e):(t.includes(":verbose"),console.debug(...e))}}});function bo(e){Eo=e,Bo=[],wo=[];const t=/\*/g,r=e.split(",").map((e=>e.trim().replace(t,".*?")));for(const e of r)e.startsWith("-")?wo.push(new RegExp(`^${e.substr(1)}$`)):Bo.push(new RegExp(`^${e}$`));for(const e of vo)e.enabled=No(e.namespace)}function No(e){if(e.endsWith("*"))return!0;for(const t of wo)if(t.test(e))return!1;for(const t of Bo)if(t.test(e))return!0;return!1}function So(e){const t=Object.assign((function(...r){t.enabled&&(r.length>0&&(r[0]=`${e} ${r[0]}`),t.log(...r))}),{enabled:No(e),destroy:xo,log:Qo.log,namespace:e,extend:_o});return vo.push(t),t}function xo(){const e=vo.indexOf(this);return e>=0&&(vo.splice(e,1),!0)}function _o(e){const t=So(`${this.namespace}:${e}`);return t.log=this.log,t}var To=Qo,Mo=r(8955);const Ro=new Set,ko=void 0!==Mo&&Mo.env&&Mo.env.AZURE_LOG_LEVEL||void 0;let Do;const zo=To("azure");zo.log=(...e)=>{To.log(...e)};const Oo=["verbose","info","warning","error"];ko&&(Lo(ko)?function(e){if(e&&!Lo(e))throw new Error(`Unknown log level '${e}'. Acceptable values: ${Oo.join(",")}`);Do=e;const t=[];for(const e of Ro)Go(e)&&t.push(e.namespace);To.enable(t.join(","))}(ko):console.error(`AZURE_LOG_LEVEL set to unknown log level '${ko}'; logging is not enabled. Acceptable values: ${Oo.join(", ")}.`));const Uo={verbose:400,info:300,warning:200,error:100};function Fo(e){const t=zo.extend(e);return Po(zo,t),{error:qo(t,"error"),warning:qo(t,"warning"),info:qo(t,"info"),verbose:qo(t,"verbose")}}function Po(e,t){t.log=(...t)=>{e.log(...t)}}function qo(e,t){const r=Object.assign(e.extend(t),{level:t});if(Po(e,r),Go(r)){const e=To.disable();To.enable(e+","+r.namespace)}return Ro.add(r),r}function Go(e){return!!(Do&&Uo[e.level]<=Uo[Do])}function Lo(e){return Oo.includes(e)}const Ho=Fo("core-rest-pipeline"),jo=new Set(["Deserialize","Serialize","Retry","Sign"]);class Yo{constructor(e=[]){this._policies=[],this._policies=e,this._orderedPolicies=void 0}addPolicy(e,t={}){if(t.phase&&t.afterPhase)throw new Error("Policies inside a phase cannot specify afterPhase.");if(t.phase&&!jo.has(t.phase))throw new Error(`Invalid phase name: ${t.phase}`);if(t.afterPhase&&!jo.has(t.afterPhase))throw new Error(`Invalid afterPhase name: ${t.afterPhase}`);this._policies.push({policy:e,options:t}),this._orderedPolicies=void 0}removePolicy(e){const t=[];return this._policies=this._policies.filter((r=>!(e.name&&r.policy.name===e.name||e.phase&&r.options.phase===e.phase)||(t.push(r.policy),!1))),this._orderedPolicies=void 0,t}sendRequest(e,t){return this.getOrderedPolicies().reduceRight(((e,t)=>r=>t.sendRequest(r,e)),(t=>e.sendRequest(t)))(t)}getOrderedPolicies(){return this._orderedPolicies||(this._orderedPolicies=this.orderPolicies()),this._orderedPolicies}clone(){return new Yo(this._policies)}static create(){return new Yo}orderPolicies(){const e=[],t=new Map;function r(e){return{name:e,policies:new Set,hasRun:!1}}const n=r("Serialize"),i=r("None"),a=r("Deserialize"),o=r("Retry"),s=r("Sign"),c=[n,i,a,o,s];function A(e){return"Retry"===e?o:"Serialize"===e?n:"Deserialize"===e?a:"Sign"===e?s:i}for(const e of this._policies){const r=e.policy,n=e.options,i=r.name;if(t.has(i))throw new Error("Duplicate policy names not allowed in pipeline");const a={policy:r,dependsOn:new Set,dependants:new Set};n.afterPhase&&(a.afterPhase=A(n.afterPhase)),t.set(i,a),A(n.phase).policies.add(a)}for(const e of this._policies){const{policy:r,options:n}=e,i=r.name,a=t.get(i);if(!a)throw new Error(`Missing node for policy ${i}`);if(n.afterPolicies)for(const e of n.afterPolicies){const r=t.get(e);r&&(a.dependsOn.add(r),r.dependants.add(a))}if(n.beforePolicies)for(const e of n.beforePolicies){const r=t.get(e);r&&(r.dependsOn.add(a),a.dependants.add(r))}}function u(r){r.hasRun=!0;for(const n of r.policies)if((!n.afterPhase||n.afterPhase.hasRun&&!n.afterPhase.policies.size)&&0===n.dependsOn.size){e.push(n.policy);for(const e of n.dependants)e.dependsOn.delete(n);t.delete(n.policy.name),r.policies.delete(n)}}function l(){for(const e of c)if(u(e),e.policies.size>0&&e!==i)return void(i.hasRun||u(i))}let d=0;for(;t.size>0;){d++;const t=e.length;if(l(),e.length<=t&&d>1)throw new Error("Cannot satisfy policy dependencies due to requirements cycle.")}return e}}const Ko="1.9.0";function Vo(e){const t=new Map;t.set("core-rest-pipeline",Ko),function(e){const t=self.navigator;e.set("OS",(t.oscpu||t.platform).replace(" ",""))}(t);const r=function(e){const t=[];for(const[r,n]of e){const e=n?`${r}/${n}`:r;t.push(e)}return t.join(" ")}(t);return e?`${e} ${r}`:r}const $o="x-ms-useragent";new Error("decompressResponsePolicy is not supported in browser environment");class Jo extends Error{constructor(e){super(e),this.name="AbortError"}}function Wo(e,t,r){return new Promise(((n,i)=>{let a,o;const s=()=>i(new Jo((null==r?void 0:r.abortErrorMsg)?null==r?void 0:r.abortErrorMsg:"The operation was aborted.")),c=()=>{(null==r?void 0:r.abortSignal)&&o&&r.abortSignal.removeEventListener("abort",o)};if(o=()=>(a&&clearTimeout(a),c(),s()),(null==r?void 0:r.abortSignal)&&r.abortSignal.aborted)return s();a=setTimeout((()=>{c(),n(t)}),e),(null==r?void 0:r.abortSignal)&&r.abortSignal.addEventListener("abort",o)}))}function Xo(e,t){const r=e.headers.get(t);if(!r)return;const n=Number(r);return Number.isNaN(n)?void 0:n}const Zo="Retry-After",es=["retry-after-ms","x-ms-retry-after-ms",Zo];function ts(e){if(e&&[429,503].includes(e.status))try{for(const t of es){const r=Xo(e,t);if(0===r||r)return r*(t===Zo?1e3:1)}const t=e.headers.get(Zo);if(!t)return;const r=Date.parse(t)-Date.now();return Number.isFinite(r)?Math.max(0,r):void 0}catch(e){return}}function rs(e={}){var t,r;const n=null!==(t=e.retryDelayInMs)&&void 0!==t?t:1e3,i=null!==(r=e.maxRetryDelayInMs)&&void 0!==r?r:64e3;let a=n;return{name:"exponentialRetryStrategy",retry({retryCount:t,response:r,responseError:n}){const o=!!(l=n)&&("ETIMEDOUT"===l.code||"ESOCKETTIMEDOUT"===l.code||"ECONNREFUSED"===l.code||"ECONNRESET"===l.code||"ENOENT"===l.code),s=o&&e.ignoreSystemErrors,c=function(e){return Boolean(e&&void 0!==e.status&&(e.status>=500||408===e.status)&&501!==e.status&&505!==e.status)}(r),A=c&&e.ignoreHttpStatusCodes,u=r&&(function(e){return Number.isFinite(ts(e))}(r)||!c);var l;if(u||A||s)return{skipStrategy:!0};if(n&&!o&&!c)return{errorToThrow:n};const d=a*Math.pow(2,t),p=Math.min(i,d);var h,f;return a=p/2+(h=0,f=p/2,h=Math.ceil(h),f=Math.floor(f),Math.floor(Math.random()*(f-h+1))+h),{retryAfterInMs:a}}}}const ns=Fo("core-rest-pipeline retryPolicy");function is(e,t={maxRetries:3}){const r=t.logger||ns;return{name:"retryPolicy",async sendRequest(n,i){var a,o;let s,c,A=-1;e:for(;;){A+=1,s=void 0,c=void 0;try{r.info(`Retry ${A}: Attempting to send request`,n.requestId),s=await i(n),r.info(`Retry ${A}: Received a response from request`,n.requestId)}catch(e){if(r.error(`Retry ${A}: Received an error from request`,n.requestId),c=e,!e||"RestError"!==c.name)throw e;s=c.response}if(null===(a=n.abortSignal)||void 0===a?void 0:a.aborted)throw r.error(`Retry ${A}: Request aborted.`),new Jo;if(A>=(null!==(o=t.maxRetries)&&void 0!==o?o:3)){if(r.info(`Retry ${A}: Maximum retries reached. Returning the last received response, or throwing the last received error.`),c)throw c;if(s)return s;throw new Error("Maximum retries reached with no response or error to throw")}r.info(`Retry ${A}: Processing ${e.length} retry strategies.`);t:for(const t of e){const e=t.logger||ns;e.info(`Retry ${A}: Processing retry strategy ${t.name}.`);const r=t.retry({retryCount:A,response:s,responseError:c});if(r.skipStrategy){e.info(`Retry ${A}: Skipped.`);continue t}const{errorToThrow:i,retryAfterInMs:a,redirectTo:o}=r;if(i)throw e.error(`Retry ${A}: Retry strategy ${t.name} throws error:`,i),i;if(a||0===a){e.info(`Retry ${A}: Retry strategy ${t.name} retries after ${a}`),await Wo(a,void 0,{abortSignal:n.abortSignal});continue e}if(o){e.info(`Retry ${A}: Retry strategy ${t.name} redirects to ${o}`),n.url=o;continue e}}if(c)throw r.info("None of the retry strategies could work with the received error. Throwing it."),c;if(s)return r.info("None of the retry strategies could work with the received response. Returning it."),s}}}}new Error("proxyPolicy is not supported in browser environment");const as={span:Symbol.for("@azure/core-tracing span"),namespace:Symbol.for("@azure/core-tracing namespace")};function os(e={}){let t=new ss(e.parentContext);return e.span&&(t=t.setValue(as.span,e.span)),e.namespace&&(t=t.setValue(as.namespace,e.namespace)),t}class ss{constructor(e){this._contextMap=e instanceof ss?new Map(e._contextMap):new Map}setValue(e,t){const r=new ss(this);return r._contextMap.set(e,t),r}getValue(e){return this._contextMap.get(e)}deleteValue(e){const t=new ss(this);return t._contextMap.delete(e),t}}let cs;function As(){return cs||(cs={createRequestHeaders:()=>({}),parseTraceparentHeader:()=>{},startSpan:(e,t)=>({span:{end:()=>{},isRecording:()=>!1,recordException:()=>{},setAttribute:()=>{},setStatus:()=>{}},tracingContext:os({parentContext:t.tracingContext})}),withContext:(e,t,...r)=>t(...r)}),cs}function us(e){const t=Yo.create();return t.addPolicy({name:"formDataPolicy",async sendRequest(e,t){if(e.formData){const t=e.formData,r=new FormData;for(const e of Object.keys(t)){const n=t[e];if(Array.isArray(n))for(const t of n)r.append(e,t);else r.append(e,n)}e.body=r,e.formData=void 0;const n=e.headers.get("Content-Type");n&&-1!==n.indexOf("application/x-www-form-urlencoded")?e.body=new URLSearchParams(r).toString():n&&-1!==n.indexOf("multipart/form-data")&&e.headers.delete("Content-Type")}return t(e)}}),t.addPolicy(function(e={}){const t=Vo(e.userAgentPrefix);return{name:"userAgentPolicy",sendRequest:async(e,r)=>(e.headers.has($o)||e.headers.set($o,t),r(e))}}(e.userAgentOptions)),t.addPolicy(function(e="x-ms-client-request-id"){return{name:"setClientRequestIdPolicy",sendRequest:async(t,r)=>(t.headers.has(e)||t.headers.set(e,t.requestId),r(t))}}()),t.addPolicy(function(e={}){var t;return{name:"defaultRetryPolicy",sendRequest:is([{name:"throttlingRetryStrategy",retry({response:e}){const t=ts(e);return Number.isFinite(t)?{retryAfterInMs:t}:{skipStrategy:!0}}},rs(e)],{maxRetries:null!==(t=e.maxRetries)&&void 0!==t?t:3}).sendRequest}}(e.retryOptions),{phase:"Retry"}),t.addPolicy(function(e={}){const t=Vo(e.userAgentPrefix),r=function(){try{return function(e){const{namespace:t,packageName:r,packageVersion:n}=e;function i(e,i,a){var o;const s=As().startSpan(e,Object.assign(Object.assign({},a),{packageName:r,packageVersion:n,tracingContext:null===(o=null==i?void 0:i.tracingOptions)||void 0===o?void 0:o.tracingContext}));let c=s.tracingContext;const A=s.span;return c.getValue(as.namespace)||(c=c.setValue(as.namespace,t)),A.setAttribute("az.namespace",c.getValue(as.namespace)),{span:A,updatedOptions:Object.assign({},i,{tracingOptions:Object.assign(Object.assign({},null==i?void 0:i.tracingOptions),{tracingContext:c})})}}function a(e,t,...r){return As().withContext(e,t,...r)}return{startSpan:i,withSpan:async function(e,t,r,n){const{span:o,updatedOptions:s}=i(e,t,n);try{const e=await a(s.tracingOptions.tracingContext,(()=>Promise.resolve(r(s,o))));return o.setStatus({status:"success"}),e}catch(e){throw o.setStatus({status:"error",error:e}),e}finally{o.end()}},withContext:a,parseTraceparentHeader:function(e){return As().parseTraceparentHeader(e)},createRequestHeaders:function(e){return As().createRequestHeaders(e)}}}({namespace:"",packageName:"@azure/core-rest-pipeline",packageVersion:Ko})}catch(e){return void Ho.warning(`Error when creating the TracingClient: ${wa(e)}`)}}();return{name:"tracingPolicy",async sendRequest(e,n){var i,a;if(!r||!(null===(i=e.tracingOptions)||void 0===i?void 0:i.tracingContext))return n(e);const{span:o,tracingContext:s}=null!==(a=function(e,t,r){try{const{span:n,updatedOptions:i}=e.startSpan(`HTTP ${t.method}`,{tracingOptions:t.tracingOptions},{spanKind:"client",spanAttributes:{"http.method":t.method,"http.url":t.url,requestId:t.requestId}});if(!n.isRecording())return void n.end();r&&n.setAttribute("http.user_agent",r);const a=e.createRequestHeaders(i.tracingOptions.tracingContext);for(const[e,r]of Object.entries(a))t.headers.set(e,r);return{span:n,tracingContext:i.tracingOptions.tracingContext}}catch(e){return void Ho.warning(`Skipping creating a tracing span due to an error: ${wa(e)}`)}}(r,e,t))&&void 0!==a?a:{};if(!o||!s)return n(e);try{const t=await r.withContext(s,n,e);return function(e,t){try{e.setAttribute("http.status_code",t.status);const r=t.headers.get("x-ms-request-id");r&&e.setAttribute("serviceRequestId",r),e.setStatus({status:"success"}),e.end()}catch(e){Ho.warning(`Skipping tracing span processing due to an error: ${wa(e)}`)}}(o,t),t}catch(e){throw function(e,t){try{e.setStatus({status:"error",error:Ba(t)?t:void 0}),((r=t)instanceof _a||Ba(r)&&"RestError"===r.name)&&t.statusCode&&e.setAttribute("http.status_code",t.statusCode),e.end()}catch(r){Ho.warning(`Skipping tracing span processing due to an error: ${wa(r)}`)}var r}(o,e),e}}}}(e.userAgentOptions),{afterPhase:"Retry"}),t.addPolicy(function(e={}){var t;const r=null!==(t=e.logger)&&void 0!==t?t:Ho.info,n=new Sa({additionalAllowedHeaderNames:e.additionalAllowedHeaderNames,additionalAllowedQueryParameters:e.additionalAllowedQueryParameters});return{name:"logPolicy",async sendRequest(e,t){if(!r.enabled)return t(e);r(`Request: ${n.sanitize(e)}`);const i=await t(e);return r(`Response status code: ${i.status}`),r(`Headers: ${n.sanitize(i.headers)}`),i}}}(e.loggingOptions),{afterPhase:"Retry"}),t}const ls={forcedRefreshWindowInMs:1e3,retryIntervalInMs:3e3,refreshWindowInMs:12e4};const ds="bearerTokenAuthenticationPolicy";async function ps(e){const{scopes:t,getAccessToken:r,request:n}=e,i={abortSignal:n.abortSignal,tracingOptions:n.tracingOptions},a=await r(t,i);a&&e.request.headers.set("Authorization",`Bearer ${a.token}`)}function hs(e){var t;const{credential:r,scopes:n,challengeCallbacks:i,logger:a}=e,o=Object.assign({authorizeRequest:null!==(t=null==i?void 0:i.authorizeRequest)&&void 0!==t?t:ps,authorizeRequestOnChallenge:null==i?void 0:i.authorizeRequestOnChallenge},i),s=r?function(e,t){let r,n=null,i=null;const a=Object.assign(Object.assign({},ls),t),o={get isRefreshing(){return null!==n},get shouldRefresh(){var e;return!o.isRefreshing&&(null!==(e=null==i?void 0:i.expiresOnTimestamp)&&void 0!==e?e:0)-a.refreshWindowInMs<Date.now()},get mustRefresh(){return null===i||i.expiresOnTimestamp-a.forcedRefreshWindowInMs<Date.now()}};function s(t,s){var c;return o.isRefreshing||(n=async function(e,t,r){async function n(){if(!(Date.now()<r)){const t=await e();if(null===t)throw new Error("Failed to refresh access token.");return t}try{return await e()}catch(e){return null}}let i=await n();for(;null===i;)await Wo(t),i=await n();return i}((()=>e.getToken(t,s)),a.retryIntervalInMs,null!==(c=null==i?void 0:i.expiresOnTimestamp)&&void 0!==c?c:Date.now()).then((e=>(n=null,i=e,r=s.tenantId,i))).catch((e=>{throw n=null,i=null,r=void 0,e}))),n}return async(e,t)=>r!==t.tenantId||o.mustRefresh?s(e,t):(o.shouldRefresh&&s(e,t),i)}(r):()=>Promise.resolve(null);return{name:ds,async sendRequest(e,t){if(!e.url.toLowerCase().startsWith("https://"))throw new Error("Bearer token authentication is not permitted for non-TLS protected (non-https) URLs.");let r,i;await o.authorizeRequest({scopes:Array.isArray(n)?n:[n],request:e,getAccessToken:s,logger:a});try{r=await t(e)}catch(e){i=e,r=e.response}if(o.authorizeRequestOnChallenge&&401===(null==r?void 0:r.status)&&function(e){const t=e.headers.get("WWW-Authenticate");if(401===e.status&&t)return t}(r)&&await o.authorizeRequestOnChallenge({scopes:Array.isArray(n)?n:[n],request:e,response:r,getAccessToken:s,logger:a}))return t(e);if(i)throw i;return r}}}function fs(e){const{parameterPath:t,mapper:r}=e;let n;return n="string"==typeof t?t:Array.isArray(t)?t.join("."):r.serializedName,n}function gs(e){return Boolean(e&&"function"==typeof e.getReader&&"function"==typeof e.tee)}class ms{async sendRequest(e){if("https:"!==new URL(e.url).protocol&&!e.allowInsecureConnection)throw new Error(`Cannot connect to ${e.url} while allowInsecureConnection is false.`);if(e.proxySettings)throw new Error("HTTP proxy is not supported in browser environment");try{return await async function(e){const{abortController:t,abortControllerCleanup:r}=function(e){const t=new AbortController;let r,n;if(e.abortSignal){if(e.abortSignal.aborted)throw new Jo("The operation was aborted.");n=e=>{"abort"===e.type&&t.abort()},e.abortSignal.addEventListener("abort",n),r=()=>{var t;n&&(null===(t=e.abortSignal)||void 0===t||t.removeEventListener("abort",n))}}return e.timeout>0&&setTimeout((()=>{t.abort()}),e.timeout),{abortController:t,abortControllerCleanup:r}}(e);try{const n=function(e){const t=new Headers;for(const[r,n]of e)t.append(r,n);return t}(e.headers),i=function(e){const t="function"==typeof e.body?e.body():e.body;if(function(e){return e&&"function"==typeof e.pipe}(t))throw new Error("Node streams are not supported in browser environment.");return gs(t)?ys(t,e.onUploadProgress):t}(e);return async function(e,t){var r,n;const i=function(e){const t=Oa();for(const[r,n]of e.headers)t.set(r,n);return t}(e),a={request:t,headers:i,status:e.status},o=gs(e.body)?ys(e.body,t.onDownloadProgress):e.body;if((null===(r=t.streamResponseStatusCodes)||void 0===r?void 0:r.has(Number.POSITIVE_INFINITY))||(null===(n=t.streamResponseStatusCodes)||void 0===n?void 0:n.has(a.status)))if(t.enableBrowserStreams)a.browserStreamBody=null!=o?o:void 0;else{const e=new Response(o);a.blobBody=e.blob()}else{const e=new Response(o);a.bodyAsText=await e.text()}return a}(await fetch(e.url,{body:i,method:e.method,headers:n,signal:t.signal,credentials:e.withCredentials?"include":"same-origin",cache:"no-store"}),e)}finally{r&&r()}}(e)}catch(t){throw function(e,t){var r;return e&&"AbortError"===(null==e?void 0:e.name)?e:new _a(`Error sending request: ${e.message}`,{code:null!==(r=null==e?void 0:e.code)&&void 0!==r?r:_a.REQUEST_SEND_ERROR,request:t})}(t,e)}}}function ys(e,t){let r=0;if(function(e){return void 0!==e.pipeThrough&&void 0!==self.TransformStream}(e))return e.pipeThrough(new TransformStream({transform(e,n){null!==e?(n.enqueue(e),r+=e.length,t&&t({loadedBytes:r})):n.terminate()}}));{const n=e.getReader();return new ReadableStream({async pull(e){var i;const{done:a,value:o}=await n.read();if(a||!o)return e.close(),void n.releaseLock();r+=null!==(i=null==o?void 0:o.length)&&void 0!==i?i:0,e.enqueue(o),t&&t({loadedBytes:r})}})}}let Is;const Cs={CSV:",",SSV:" ",Multi:"Multi",TSV:"\t",Pipes:"|"};function Es(e,t,r,n){const i=function(e,t,r){var n;const i=new Map;if(null===(n=e.urlParameters)||void 0===n?void 0:n.length)for(const n of e.urlParameters){let a=po(t,n,r);const o=fs(n);a=e.serializer.serialize(n.mapper,a,o),n.skipEncoding||(a=encodeURIComponent(a)),i.set(`{${n.mapper.serializedName||o}}`,a)}return i}(t,r,n);let a=!1,o=Bs(e,i);if(t.path){let e=Bs(t.path,i);"/{nextLink}"===t.path&&e.startsWith("/")&&(e=e.substring(1)),e.includes("://")?(o=e,a=!0):o=function(e,t){if(!t)return e;const r=new URL(e);let n=r.pathname;n.endsWith("/")||(n=`${n}/`),t.startsWith("/")&&(t=t.substring(1));const i=t.indexOf("?");if(-1!==i){const e=t.substring(0,i),a=t.substring(i+1);n+=e,a&&(r.search=r.search?`${r.search}&${a}`:a)}else n+=t;return r.pathname=n,r.toString()}(o,e)}const{queryParams:s,sequenceParams:c}=function(e,t,r){var n;const i=new Map,a=new Set;if(null===(n=e.queryParameters)||void 0===n?void 0:n.length)for(const n of e.queryParameters){"Sequence"===n.mapper.type.name&&n.mapper.serializedName&&a.add(n.mapper.serializedName);let o=po(t,n,r);if(null!=o||n.mapper.required){o=e.serializer.serialize(n.mapper,o,fs(n));const t=n.collectionFormat?Cs[n.collectionFormat]:"";if(Array.isArray(o)&&(o=o.map((e=>null==e?"":e))),"Multi"===n.collectionFormat&&0===o.length)continue;!Array.isArray(o)||"SSV"!==n.collectionFormat&&"TSV"!==n.collectionFormat||(o=o.join(t)),n.skipEncoding||(o=Array.isArray(o)?o.map((e=>encodeURIComponent(e))):encodeURIComponent(o)),!Array.isArray(o)||"CSV"!==n.collectionFormat&&"Pipes"!==n.collectionFormat||(o=o.join(t)),i.set(n.mapper.serializedName||fs(n),o)}}return{queryParams:i,sequenceParams:a}}(t,r,n);return o=function(e,t,r,n=!1){if(0===t.size)return e;const i=new URL(e),a=function(e){const t=new Map;if(!e||"?"!==e[0])return t;const r=(e=e.slice(1)).split("&");for(const e of r){const[r,n]=e.split("=",2),i=t.get(r);i?Array.isArray(i)?i.push(n):t.set(r,[i,n]):t.set(r,n)}return t}(i.search);for(const[e,i]of t){const t=a.get(e);if(Array.isArray(t))if(Array.isArray(i)){t.push(...i);const r=new Set(t);a.set(e,Array.from(r))}else t.push(i);else t?(Array.isArray(i)?i.unshift(t):r.has(e)&&a.set(e,[t,i]),n||a.set(e,i)):a.set(e,i)}const o=[];for(const[e,t]of a)if("string"==typeof t)o.push(`${e}=${t}`);else if(Array.isArray(t))for(const r of t)o.push(`${e}=${r}`);else o.push(`${e}=${t}`);return i.search=o.length?`?${o.join("&")}`:"",i.toString()}(o,s,c,a),o}function Bs(e,t){let r=e;for(const[e,n]of t)r=r.split(e).join(n);return r}const ws=Fo("core-client");class vs{constructor(e={}){var t,r;if(this._requestContentType=e.requestContentType,this._endpoint=null!==(t=e.endpoint)&&void 0!==t?t:e.baseUri,e.baseUri&&ws.warning("The baseUri option for SDK Clients has been deprecated, please use endpoint instead."),this._allowInsecureConnection=e.allowInsecureConnection,this._httpClient=e.httpClient||(Is||(Is=new ms),Is),this.pipeline=e.pipeline||function(e){const t=function(e){if(e.credentialScopes){const t=e.credentialScopes;return Array.isArray(t)?t.map((e=>new URL(e).toString())):new URL(t).toString()}if(e.endpoint)return`${e.endpoint}/.default`;if(e.baseUri)return`${e.baseUri}/.default`;if(e.credential&&!e.credentialScopes)throw new Error("When using credentials, the ServiceClientOptions must contain either a endpoint or a credentialScopes. Unable to create a bearerTokenAuthenticationPolicy")}(e),r=e.credential&&t?{credentialScopes:t,credential:e.credential}:void 0;return function(e={}){const t=us(null!=e?e:{});return e.credentialOptions&&t.addPolicy(hs({credential:e.credentialOptions.credential,scopes:e.credentialOptions.credentialScopes})),t.addPolicy(function(e={}){const t=e.stringifyXML;return{name:"serializationPolicy",async sendRequest(e,r){const n=go(e),i=null==n?void 0:n.operationSpec,a=null==n?void 0:n.operationArguments;return i&&a&&(function(e,t,r){var n,i;if(r.headerParameters)for(const n of r.headerParameters){let i=po(t,n);if(null!=i||n.mapper.required){i=r.serializer.serialize(n.mapper,i,fs(n));const t=n.mapper.headerCollectionPrefix;if(t)for(const r of Object.keys(i))e.headers.set(t+r,i[r]);else e.headers.set(n.mapper.serializedName||fs(n),i)}}const a=null===(i=null===(n=t.options)||void 0===n?void 0:n.requestOptions)||void 0===i?void 0:i.customHeaders;if(a)for(const t of Object.keys(a))e.headers.set(t,a[t])}(e,a,i),function(e,t,r,n=function(){throw new Error("XML serialization unsupported!")}){var i,a,o,s,c;const A=null===(i=t.options)||void 0===i?void 0:i.serializerOptions,u={xml:{rootName:null!==(a=null==A?void 0:A.xml.rootName)&&void 0!==a?a:"",includeRoot:null!==(o=null==A?void 0:A.xml.includeRoot)&&void 0!==o&&o,xmlCharKey:null!==(s=null==A?void 0:A.xml.xmlCharKey)&&void 0!==s?s:Va}},l=u.xml.xmlCharKey;if(r.requestBody&&r.requestBody.mapper){e.body=po(t,r.requestBody);const i=r.requestBody.mapper,{required:a,serializedName:o,xmlName:s,xmlElementName:A,xmlNamespace:d,xmlNamespacePrefix:p,nullable:h}=i,f=i.type.name;try{if(void 0!==e.body&&null!==e.body||h&&null===e.body||a){const t=fs(r.requestBody);e.body=r.serializer.serialize(i,e.body,t,u);const a=f===lo;if(r.isXML){const t=p?`xmlns:${p}`:"xmlns",r=function(e,t,r,n,i){if(e&&!["Composite","Sequence","Dictionary"].includes(r)){const r={};return r[i.xml.xmlCharKey]=n,r[Ka]={[t]:e},r}return n}(d,t,f,e.body,u);f===uo?e.body=n(function(e,t,r,n){if(Array.isArray(e)||(e=[e]),!r||!n)return{[t]:e};const i={[t]:e};return i[Ka]={[r]:n},i}(r,A||s||o,t,d),{rootName:s||o,xmlCharKey:l}):a||(e.body=n(r,{rootName:s||o,xmlCharKey:l}))}else{if("String"===f&&((null===(c=r.contentType)||void 0===c?void 0:c.match("text/plain"))||"text"===r.mediaType))return;a||(e.body=JSON.stringify(e.body))}}}catch(e){throw new Error(`Error "${e.message}" occurred in serializing the payload - ${JSON.stringify(o,void 0," ")}.`)}}else if(r.formDataParameters&&r.formDataParameters.length>0){e.formData={};for(const n of r.formDataParameters){const i=po(t,n);if(null!=i){const t=n.mapper.serializedName||fs(n);e.formData[t]=r.serializer.serialize(n.mapper,i,fs(n),u)}}}}(e,a,i,t)),r(e)}}}(e.serializationOptions),{phase:"Serialize"}),t.addPolicy(function(e={}){var t,r,n,i,a,o,s;const c=null!==(r=null===(t=e.expectedContentTypes)||void 0===t?void 0:t.json)&&void 0!==r?r:mo,A=null!==(i=null===(n=e.expectedContentTypes)||void 0===n?void 0:n.xml)&&void 0!==i?i:yo,u=e.parseXML,l=e.serializerOptions,d={xml:{rootName:null!==(a=null==l?void 0:l.xml.rootName)&&void 0!==a?a:"",includeRoot:null!==(o=null==l?void 0:l.xml.includeRoot)&&void 0!==o&&o,xmlCharKey:null!==(s=null==l?void 0:l.xml.xmlCharKey)&&void 0!==s?s:Va}};return{name:"deserializationPolicy",async sendRequest(e,t){const r=await t(e);return async function(e,t,r,n,i){const a=await async function(e,t,r,n,i){var a;if(!(null===(a=r.request.streamResponseStatusCodes)||void 0===a?void 0:a.has(r.status))&&r.bodyAsText){const a=r.bodyAsText,o=r.headers.get("Content-Type")||"",s=o?o.split(";").map((e=>e.toLowerCase())):[];try{if(0===s.length||s.some((t=>-1!==e.indexOf(t))))return r.parsedBody=JSON.parse(a),r;if(s.some((e=>-1!==t.indexOf(e)))){if(!i)throw new Error("Parsing XML not supported.");const e=await i(a,n.xml);return r.parsedBody=e,r}}catch(e){const t=`Error "${e}" occurred while parsing the response body - ${r.bodyAsText}.`,n=e.code||_a.PARSE_ERROR;throw new _a(t,{code:n,statusCode:r.status,request:r.request,response:r})}}return r}(e,t,r,n,i);if(!function(e){const t=go(e.request),r=null==t?void 0:t.shouldDeserialize;let n;return n=void 0===r||("boolean"==typeof r?r:r(e)),n}(a))return a;const o=go(a.request),s=null==o?void 0:o.operationSpec;if(!s||!s.responses)return a;const c=function(e){let t;const r=go(e.request),n=null==r?void 0:r.operationSpec;return n&&(t=(null==r?void 0:r.operationResponseGetter)?null==r?void 0:r.operationResponseGetter(n,e):n.responses[e.status]),t}(a),{error:A,shouldReturnResponse:u}=function(e,t,r){var n;const i=200<=e.status&&e.status<300;if(function(e){const t=Object.keys(e.responses);return 0===t.length||1===t.length&&"default"===t[0]}(t)?i:r){if(!r)return{error:null,shouldReturnResponse:!1};if(!r.isError)return{error:null,shouldReturnResponse:!1}}const a=null!=r?r:t.responses.default,o=(null===(n=e.request.streamResponseStatusCodes)||void 0===n?void 0:n.has(e.status))?`Unexpected status code: ${e.status}`:e.bodyAsText,s=new _a(o,{statusCode:e.status,request:e.request,response:e});if(!a)throw s;const c=a.bodyMapper,A=a.headersMapper;try{if(e.parsedBody){const r=e.parsedBody;let n;if(c){let e=r;if(t.isXML&&c.type.name===uo){e=[];const t=c.xmlElementName;"object"==typeof r&&t&&(e=r[t])}n=t.serializer.deserialize(c,e,"error.response.parsedBody")}const i=r.error||n||r;s.code=i.code,i.message&&(s.message=i.message),c&&(s.response.parsedBody=n)}e.headers&&A&&(s.response.parsedHeaders=t.serializer.deserialize(A,e.headers.toJSON(),"operationRes.parsedHeaders"))}catch(t){s.message=`Error "${t.message}" occurred in deserializing the responseBody - "${e.bodyAsText}" for the default response.`}return{error:s,shouldReturnResponse:!1}}(a,s,c);if(A)throw A;if(u)return a;if(c){if(c.bodyMapper){let e=a.parsedBody;s.isXML&&c.bodyMapper.type.name===uo&&(e="object"==typeof e?e[c.bodyMapper.xmlElementName]:[]);try{a.parsedBody=s.serializer.deserialize(c.bodyMapper,e,"operationRes.parsedBody")}catch(e){throw new _a(`Error ${e} occurred in deserializing the responseBody - ${a.bodyAsText}`,{statusCode:a.status,request:a.request,response:a})}}else"HEAD"===s.httpMethod&&(a.parsedBody=r.status>=200&&r.status<300);c.headersMapper&&(a.parsedHeaders=s.serializer.deserialize(c.headersMapper,a.headers.toJSON(),"operationRes.parsedHeaders"))}return a}(c,A,r,d,u)}}}(e.deserializationOptions),{phase:"Deserialize"}),t}(Object.assign(Object.assign({},e),{credentialOptions:r}))}(e),null===(r=e.additionalPolicies)||void 0===r?void 0:r.length)for(const{policy:t,position:r}of e.additionalPolicies){const e="perRetry"===r?"Sign":void 0;this.pipeline.addPolicy(t,{afterPhase:e})}}async sendRequest(e){return this.pipeline.sendRequest(this._httpClient,e)}async sendOperationRequest(e,t){const r=t.baseUrl||this._endpoint;if(!r)throw new Error("If operationSpec.baseUrl is not specified, then the ServiceClient must have a endpoint string property that contains the base URL to use.");const n=function(e){return new Ya(e)}({url:Es(r,t,e,this)});n.method=t.httpMethod;const i=go(n);i.operationSpec=t,i.operationArguments=e;const a=t.contentType||this._requestContentType;a&&t.requestBody&&n.headers.set("Content-Type",a);const o=e.options;if(o){const e=o.requestOptions;e&&(e.timeout&&(n.timeout=e.timeout),e.onUploadProgress&&(n.onUploadProgress=e.onUploadProgress),e.onDownloadProgress&&(n.onDownloadProgress=e.onDownloadProgress),void 0!==e.shouldDeserialize&&(i.shouldDeserialize=e.shouldDeserialize),e.allowInsecureConnection&&(n.allowInsecureConnection=!0)),o.abortSignal&&(n.abortSignal=o.abortSignal),o.tracingOptions&&(n.tracingOptions=o.tracingOptions)}this._allowInsecureConnection&&(n.allowInsecureConnection=!0),void 0===n.streamResponseStatusCodes&&(n.streamResponseStatusCodes=function(e){const t=new Set;for(const r in e.responses){const n=e.responses[r];n.bodyMapper&&n.bodyMapper.type.name===lo&&t.add(Number(r))}return t}(t));try{const e=await this.sendRequest(n),r=Za(e,t.responses[e.status]);return(null==o?void 0:o.onResponse)&&o.onResponse(e,r),r}catch(e){if("object"==typeof e&&(null==e?void 0:e.response)){const r=e.response,n=Za(r,t.responses[e.statusCode]||t.responses.default);e.details=n,(null==o?void 0:o.onResponse)&&o.onResponse(r,n,e)}throw e}}}async function Qs(e){const{scopes:t,response:r}=e,n=e.logger||ws,i=r.headers.get("WWW-Authenticate");if(!i)return n.info("The WWW-Authenticate header was missing. Failed to perform the Continuous Access Evaluation authentication flow."),!1;const a=function(e){return`, ${e.trim()}`.split(", Bearer ").filter((e=>e)).map((e=>`${e.trim()}, `.split('", ').filter((e=>e)).map((e=>(([e,t])=>({[e]:t}))(e.trim().split('="')))).reduce(((e,t)=>Object.assign(Object.assign({},e),t)),{})))}(i)||[],o=a.find((e=>e.claims));if(!o)return n.info('The WWW-Authenticate header was missing the necessary "claims" to perform the Continuous Access Evaluation authentication flow.'),!1;const s=await e.getAccessToken(o.scope?[o.scope]:t,{claims:(c=o.claims,atob(c))});var c;return!!s&&(e.request.headers.set("Authorization",`Bearer ${s.token}`),!0)}const bs={type:{name:"Composite",className:"Header",modelProperties:{hash:{serializedName:"hash",required:!0,type:{name:"String"}},height:{serializedName:"height",required:!0,type:{name:"String"}},prevHash:{serializedName:"prev_hash",required:!0,type:{name:"String"}},prevKeyHash:{serializedName:"prev_key_hash",required:!0,type:{name:"String"}},stateHash:{serializedName:"state_hash",required:!0,type:{name:"String"}},miner:{serializedName:"miner",type:{name:"String"}},beneficiary:{serializedName:"beneficiary",type:{name:"String"}},target:{serializedName:"target",type:{name:"String"}},pow:{constraints:{MinItems:42,MaxItems:42},serializedName:"pow",type:{name:"Sequence",element:{type:{name:"String"}}}},nonce:{serializedName:"nonce",type:{name:"String"}},time:{serializedName:"time",required:!0,type:{name:"String"}},version:{serializedName:"version",required:!0,type:{name:"String"}},info:{serializedName:"info",type:{name:"String"}},pofHash:{serializedName:"pof_hash",type:{name:"String"}},txsHash:{serializedName:"txs_hash",type:{name:"String"}},signature:{serializedName:"signature",type:{name:"String"}}}}},Ns={type:{name:"Composite",className:"ErrorModel",modelProperties:{reason:{serializedName:"reason",required:!0,type:{name:"String"}}}}},Ss={type:{name:"Composite",className:"KeyBlock",modelProperties:{hash:{serializedName:"hash",required:!0,type:{name:"String"}},height:{serializedName:"height",required:!0,type:{name:"String"}},prevHash:{serializedName:"prev_hash",required:!0,type:{name:"String"}},prevKeyHash:{serializedName:"prev_key_hash",required:!0,type:{name:"String"}},stateHash:{serializedName:"state_hash",required:!0,type:{name:"String"}},miner:{serializedName:"miner",required:!0,type:{name:"String"}},beneficiary:{serializedName:"beneficiary",required:!0,type:{name:"String"}},target:{serializedName:"target",required:!0,type:{name:"String"}},pow:{constraints:{MinItems:42,MaxItems:42},serializedName:"pow",type:{name:"Sequence",element:{type:{name:"String"}}}},nonce:{serializedName:"nonce",type:{name:"String"}},time:{serializedName:"time",required:!0,type:{name:"String"}},version:{serializedName:"version",required:!0,type:{name:"String"}},info:{serializedName:"info",required:!0,type:{name:"String"}}}}},xs={type:{name:"Composite",className:"HashResponse",modelProperties:{hash:{serializedName:"hash",required:!0,type:{name:"String"}}}}},_s={type:{name:"Composite",className:"HeightResponse",modelProperties:{height:{serializedName:"height",required:!0,type:{name:"String"}}}}},Ts={type:{name:"Composite",className:"MicroBlockHeader",modelProperties:{hash:{serializedName:"hash",required:!0,type:{name:"String"}},height:{serializedName:"height",required:!0,type:{name:"String"}},pofHash:{serializedName:"pof_hash",required:!0,type:{name:"String"}},prevHash:{serializedName:"prev_hash",required:!0,type:{name:"String"}},prevKeyHash:{serializedName:"prev_key_hash",required:!0,type:{name:"String"}},stateHash:{serializedName:"state_hash",required:!0,type:{name:"String"}},txsHash:{serializedName:"txs_hash",required:!0,type:{name:"String"}},signature:{serializedName:"signature",required:!0,type:{name:"String"}},time:{serializedName:"time",required:!0,type:{name:"String"}},version:{serializedName:"version",required:!0,type:{name:"String"}}}}},Ms={type:{name:"Composite",className:"SignedTxs",modelProperties:{transactions:{serializedName:"transactions",required:!0,type:{name:"Sequence",element:{type:{name:"Composite",className:"SignedTx"}}}}}}},Rs={type:{name:"Composite",className:"SignedTx",modelProperties:{tx:{serializedName:"tx",type:{name:"Composite",className:"Tx"}},blockHeight:{serializedName:"block_height",required:!0,type:{name:"String"}},blockHash:{serializedName:"block_hash",required:!0,type:{name:"String"}},hash:{serializedName:"hash",required:!0,type:{name:"String"}},signatures:{serializedName:"signatures",required:!0,type:{name:"Sequence",element:{type:{name:"String"}}}}}}},ks={type:{name:"Composite",className:"Tx",uberParent:"Tx",polymorphicDiscriminator:{serializedName:"type",clientName:"type"},modelProperties:{recipientId:{serializedName:"recipient_id",type:{name:"String"}},amount:{serializedName:"amount",type:{name:"String"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}},senderId:{serializedName:"sender_id",type:{name:"String"}},nonce:{serializedName:"nonce",type:{name:"String"}},payload:{serializedName:"payload",type:{name:"String"}},initiatorId:{serializedName:"initiator_id",type:{name:"String"}},initiatorAmount:{serializedName:"initiator_amount",type:{name:"String"}},responderId:{serializedName:"responder_id",type:{name:"String"}},responderAmount:{serializedName:"responder_amount",type:{name:"String"}},channelReserve:{serializedName:"channel_reserve",type:{name:"String"}},lockPeriod:{serializedName:"lock_period",type:{name:"String"}},stateHash:{serializedName:"state_hash",type:{name:"String"}},delegateIds:{serializedName:"delegate_ids",type:{name:"Composite",className:"Delegates"}},channelId:{serializedName:"channel_id",type:{name:"String"}},fromId:{serializedName:"from_id",type:{name:"String"}},round:{serializedName:"round",type:{name:"String"}},toId:{serializedName:"to_id",type:{name:"String"}},update:{serializedName:"update",type:{name:"Composite",className:"OffChainUpdate"}},offchainTrees:{serializedName:"offchain_trees",type:{name:"String"}},initiatorAmountFinal:{serializedName:"initiator_amount_final",type:{name:"String"}},responderAmountFinal:{serializedName:"responder_amount_final",type:{name:"String"}},poi:{serializedName:"poi",type:{name:"String"}},initiatorDelegateIds:{serializedName:"initiator_delegate_ids",type:{name:"Sequence",element:{type:{name:"String"}}}},responderDelegateIds:{serializedName:"responder_delegate_ids",type:{name:"Sequence",element:{type:{name:"String"}}}},queryFormat:{serializedName:"query_format",type:{name:"String"}},responseFormat:{serializedName:"response_format",type:{name:"String"}},queryFee:{serializedName:"query_fee",type:{name:"String"}},oracleTtl:{serializedName:"oracle_ttl",type:{name:"Composite",className:"RelativeTTL"}},accountId:{serializedName:"account_id",type:{name:"String"}},abiVersion:{serializedName:"abi_version",type:{name:"String"}},oracleId:{serializedName:"oracle_id",type:{name:"String"}},query:{serializedName:"query",type:{name:"String"}},queryTtl:{serializedName:"query_ttl",type:{name:"Composite",className:"Ttl"}},responseTtl:{serializedName:"response_ttl",type:{name:"Composite",className:"RelativeTTL"}},queryId:{serializedName:"query_id",type:{name:"String"}},response:{serializedName:"response",type:{name:"String"}},commitmentId:{serializedName:"commitment_id",type:{name:"String"}},name:{serializedName:"name",type:{name:"String"}},nameSalt:{serializedName:"name_salt",type:{name:"String"}},nameFee:{serializedName:"name_fee",type:{name:"String"}},nameId:{serializedName:"name_id",type:{name:"String"}},nameTtl:{serializedName:"name_ttl",type:{name:"String"}},pointers:{serializedName:"pointers",type:{name:"Sequence",element:{type:{name:"Composite",className:"NamePointer"}}}},clientTtl:{serializedName:"client_ttl",type:{name:"String"}},ownerId:{serializedName:"owner_id",type:{name:"String"}},code:{serializedName:"code",type:{name:"String"}},vmVersion:{serializedName:"vm_version",type:{name:"String"}},deposit:{serializedName:"deposit",type:{name:"String"}},gas:{serializedName:"gas",type:{name:"String"}},gasPrice:{serializedName:"gas_price",type:{name:"String"}},callData:{serializedName:"call_data",type:{name:"String"}},callerId:{serializedName:"caller_id",type:{name:"String"}},contractId:{serializedName:"contract_id",type:{name:"String"}},authFun:{constraints:{Pattern:new RegExp("^(0x|0X)?[a-fA-F0-9]+$")},serializedName:"auth_fun",type:{name:"String"}},gaId:{serializedName:"ga_id",type:{name:"String"}},authData:{serializedName:"auth_data",type:{name:"String"}},tx:{serializedName:"tx",type:{name:"Composite",className:"SignedTx"}},payerId:{serializedName:"payer_id",type:{name:"String"}},version:{serializedName:"version",required:!0,type:{name:"String"}},type:{serializedName:"type",required:!0,type:{name:"Enum",allowedValues:["SpendTx","ChannelCreateTx","ChannelDepositTx","ChannelWithdrawTx","ChannelForceProgressTx","ChannelCloseMutualTx","ChannelCloseSoloTx","ChannelSlashTx","ChannelSettleTx","ChannelSnapshotSoloTx","ChannelSetDelegatesTx","OracleRegisterTx","OracleExtendTx","OracleQueryTx","OracleRespondTx","NamePreclaimTx","NameClaimTx","NameUpdateTx","NameTransferTx","NameRevokeTx","ContractCreateTx","ContractCallTx","GAAttachTx","GAMetaTx","PayingForTx"]}}}}},Ds={type:{name:"Composite",className:"Delegates",modelProperties:{initiator:{serializedName:"initiator",type:{name:"Sequence",element:{type:{name:"String"}}}},responder:{serializedName:"responder",type:{name:"Sequence",element:{type:{name:"String"}}}}}}},zs={type:{name:"Composite",className:"OffChainUpdate",uberParent:"OffChainUpdate",polymorphicDiscriminator:{serializedName:"op",clientName:"op"},modelProperties:{op:{serializedName:"op",required:!0,type:{name:"String"}}}}},Os={type:{name:"Composite",className:"RelativeTTL",modelProperties:{type:{defaultValue:"delta",isConstant:!0,serializedName:"type",type:{name:"String"}},value:{serializedName:"value",required:!0,type:{name:"String"}}}}},Us={type:{name:"Composite",className:"Ttl",modelProperties:{type:{serializedName:"type",required:!0,type:{name:"Enum",allowedValues:["delta","block"]}},value:{serializedName:"value",required:!0,type:{name:"String"}}}}},Fs={type:{name:"Composite",className:"NamePointer",modelProperties:{key:{serializedName:"key",required:!0,type:{name:"String"}},id:{serializedName:"id",required:!0,type:{name:"String"}}}}},Ps={type:{name:"Composite",className:"CountResponse",modelProperties:{count:{serializedName:"count",required:!0,type:{name:"String"}}}}},qs={type:{name:"Composite",className:"Generation",modelProperties:{keyBlock:{serializedName:"key_block",type:{name:"Composite",className:"KeyBlock"}},microBlocks:{serializedName:"micro_blocks",required:!0,type:{name:"Sequence",element:{type:{name:"String"}}}}}}},Gs={type:{name:"Composite",className:"Account",modelProperties:{id:{serializedName:"id",required:!0,type:{name:"String"}},balance:{serializedName:"balance",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",required:!0,type:{name:"String"}},payable:{serializedName:"payable",type:{name:"Boolean"}},kind:{serializedName:"kind",type:{name:"Enum",allowedValues:["basic","generalized"]}},contractId:{serializedName:"contract_id",type:{name:"String"}},authFun:{serializedName:"auth_fun",type:{name:"String"}}}}},Ls={type:{name:"Composite",className:"NextNonceResponse",modelProperties:{nextNonce:{serializedName:"next_nonce",required:!0,type:{name:"String"}}}}},Hs={type:{name:"Composite",className:"DryRunInput",modelProperties:{top:{serializedName:"top",type:{name:"String"}},accounts:{serializedName:"accounts",type:{name:"Sequence",element:{type:{name:"Composite",className:"DryRunAccount"}}}},txs:{serializedName:"txs",required:!0,type:{name:"Sequence",element:{type:{name:"Composite",className:"DryRunInputItem"}}}},txEvents:{defaultValue:!1,serializedName:"tx_events",type:{name:"Boolean"}}}}},js={type:{name:"Composite",className:"DryRunAccount",modelProperties:{pubKey:{serializedName:"pub_key",required:!0,type:{name:"String"}},amount:{serializedName:"amount",required:!0,type:{name:"String"}}}}},Ys={type:{name:"Composite",className:"DryRunInputItem",modelProperties:{tx:{serializedName:"tx",type:{name:"String"}},callReq:{serializedName:"call_req",type:{name:"Composite",className:"DryRunCallReq"}}}}},Ks={type:{name:"Composite",className:"DryRunCallReq",modelProperties:{calldata:{serializedName:"calldata",required:!0,type:{name:"String"}},contract:{serializedName:"contract",required:!0,type:{name:"String"}},amount:{serializedName:"amount",type:{name:"String"}},gas:{serializedName:"gas",type:{name:"String"}},caller:{serializedName:"caller",type:{name:"String"}},nonce:{serializedName:"nonce",type:{name:"String"}},abiVersion:{serializedName:"abi_version",type:{name:"String"}},context:{serializedName:"context",type:{name:"Composite",className:"DryRunCallContext"}}}}},Vs={type:{name:"Composite",className:"DryRunCallContext",modelProperties:{tx:{serializedName:"tx",type:{name:"String"}},txHash:{serializedName:"tx_hash",type:{name:"String"}},stateful:{serializedName:"stateful",type:{name:"Boolean"}}}}},$s={type:{name:"Composite",className:"DryRunResults",modelProperties:{results:{serializedName:"results",required:!0,type:{name:"Sequence",element:{type:{name:"Composite",className:"DryRunResult"}}}},txEvents:{serializedName:"tx_events",type:{name:"Sequence",element:{type:{name:"Dictionary",value:{type:{name:"any"}}}}}}}}},Js={type:{name:"Composite",className:"DryRunResult",modelProperties:{type:{serializedName:"type",required:!0,type:{name:"String"}},result:{serializedName:"result",required:!0,type:{name:"String"}},reason:{serializedName:"reason",type:{name:"String"}},callObj:{serializedName:"call_obj",type:{name:"Composite",className:"ContractCallObject"}}}}},Ws={type:{name:"Composite",className:"ContractCallObject",modelProperties:{callerId:{serializedName:"caller_id",required:!0,type:{name:"String"}},callerNonce:{serializedName:"caller_nonce",required:!0,type:{name:"String"}},height:{serializedName:"height",required:!0,type:{name:"String"}},contractId:{serializedName:"contract_id",required:!0,type:{name:"String"}},gasPrice:{serializedName:"gas_price",required:!0,type:{name:"String"}},gasUsed:{serializedName:"gas_used",required:!0,type:{name:"String"}},log:{serializedName:"log",required:!0,type:{name:"Sequence",element:{type:{name:"Composite",className:"Event"}}}},returnValue:{serializedName:"return_value",required:!0,type:{name:"String"}},returnType:{serializedName:"return_type",required:!0,type:{name:"Enum",allowedValues:["ok","error","revert"]}}}}},Xs={type:{name:"Composite",className:"Event",modelProperties:{address:{serializedName:"address",required:!0,type:{name:"String"}},topics:{serializedName:"topics",required:!0,type:{name:"Sequence",element:{type:{name:"String"}}}},data:{serializedName:"data",required:!0,type:{name:"String"}}}}},Zs={type:{name:"Composite",className:"TxInfoObject",modelProperties:{callInfo:{serializedName:"call_info",type:{name:"Composite",className:"ContractCallObject"}},gaInfo:{serializedName:"ga_info",type:{name:"Composite",className:"GAObject"}},txInfo:{serializedName:"tx_info",type:{name:"String"}}}}},ec={type:{name:"Composite",className:"GAObject",modelProperties:{callerId:{serializedName:"caller_id",required:!0,type:{name:"String"}},height:{serializedName:"height",required:!0,type:{name:"String"}},gasPrice:{serializedName:"gas_price",required:!0,type:{name:"String"}},gasUsed:{serializedName:"gas_used",required:!0,type:{name:"String"}},returnValue:{serializedName:"return_value",required:!0,type:{name:"String"}},returnType:{serializedName:"return_type",required:!0,type:{name:"Enum",allowedValues:["ok","error"]}},innerObject:{serializedName:"inner_object",type:{name:"Composite",className:"TxInfoObject"}}}}},tc={type:{name:"Composite",className:"EncodedTx",modelProperties:{tx:{serializedName:"tx",required:!0,type:{name:"String"}}}}},rc={type:{name:"Composite",className:"PostTxResponse",modelProperties:{txHash:{serializedName:"tx_hash",required:!0,type:{name:"String"}}}}},nc={type:{name:"Composite",className:"ContractObject",modelProperties:{id:{serializedName:"id",required:!0,type:{name:"String"}},ownerId:{serializedName:"owner_id",required:!0,type:{name:"String"}},vmVersion:{serializedName:"vm_version",required:!0,type:{name:"String"}},abiVersion:{serializedName:"abi_version",required:!0,type:{name:"String"}},active:{serializedName:"active",required:!0,type:{name:"Boolean"}},referrerIds:{serializedName:"referrer_ids",required:!0,type:{name:"Sequence",element:{type:{name:"String"}}}},deposit:{serializedName:"deposit",required:!0,type:{name:"String"}}}}},ic={type:{name:"Composite",className:"ByteCode",modelProperties:{bytecode:{serializedName:"bytecode",required:!0,type:{name:"String"}}}}},ac={type:{name:"Composite",className:"PoI",modelProperties:{poi:{serializedName:"poi",required:!0,type:{name:"String"}}}}},oc={type:{name:"Composite",className:"RegisteredOracle",modelProperties:{id:{serializedName:"id",required:!0,type:{name:"String"}},queryFormat:{serializedName:"query_format",required:!0,type:{name:"String"}},responseFormat:{serializedName:"response_format",required:!0,type:{name:"String"}},queryFee:{serializedName:"query_fee",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",required:!0,type:{name:"String"}},abiVersion:{serializedName:"abi_version",required:!0,type:{name:"String"}}}}},sc={type:{name:"Composite",className:"OracleQueries",modelProperties:{oracleQueries:{serializedName:"oracle_queries",required:!0,type:{name:"Sequence",element:{type:{name:"Composite",className:"OracleQuery"}}}}}}},cc={type:{name:"Composite",className:"OracleQuery",modelProperties:{id:{serializedName:"id",required:!0,type:{name:"String"}},senderId:{serializedName:"sender_id",required:!0,type:{name:"String"}},senderNonce:{serializedName:"sender_nonce",required:!0,type:{name:"String"}},oracleId:{serializedName:"oracle_id",required:!0,type:{name:"String"}},query:{serializedName:"query",required:!0,type:{name:"String"}},response:{serializedName:"response",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",required:!0,type:{name:"String"}},responseTtl:{serializedName:"response_ttl",type:{name:"Composite",className:"Ttl"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}}}}},Ac={type:{name:"Composite",className:"NameEntry",modelProperties:{id:{serializedName:"id",required:!0,type:{name:"String"}},owner:{serializedName:"owner",type:{name:"String"}},ttl:{serializedName:"ttl",required:!0,type:{name:"String"}},pointers:{serializedName:"pointers",required:!0,type:{name:"Sequence",element:{type:{name:"Composite",className:"NamePointer"}}}}}}},uc={type:{name:"Composite",className:"Channel",modelProperties:{id:{serializedName:"id",required:!0,type:{name:"String"}},initiatorId:{serializedName:"initiator_id",required:!0,type:{name:"String"}},responderId:{serializedName:"responder_id",required:!0,type:{name:"String"}},channelAmount:{serializedName:"channel_amount",required:!0,type:{name:"String"}},initiatorAmount:{serializedName:"initiator_amount",required:!0,type:{name:"String"}},responderAmount:{serializedName:"responder_amount",required:!0,type:{name:"String"}},channelReserve:{serializedName:"channel_reserve",required:!0,type:{name:"String"}},delegateIds:{serializedName:"delegate_ids",type:{name:"Composite",className:"Delegates"}},stateHash:{serializedName:"state_hash",required:!0,type:{name:"String"}},round:{serializedName:"round",required:!0,type:{name:"String"}},soloRound:{serializedName:"solo_round",required:!0,type:{name:"String"}},lockPeriod:{serializedName:"lock_period",required:!0,type:{name:"String"}},lockedUntil:{serializedName:"locked_until",required:!0,type:{name:"String"}}}}},lc={type:{name:"Composite",className:"PeerPubKey",modelProperties:{pubkey:{serializedName:"pubkey",required:!0,type:{name:"String"}}}}},dc={type:{name:"Composite",className:"Status",modelProperties:{genesisKeyBlockHash:{serializedName:"genesis_key_block_hash",required:!0,type:{name:"String"}},solutions:{serializedName:"solutions",required:!0,type:{name:"String"}},difficulty:{serializedName:"difficulty",required:!0,type:{name:"String"}},syncing:{serializedName:"syncing",required:!0,type:{name:"Boolean"}},syncProgress:{constraints:{InclusiveMaximum:100,InclusiveMinimum:0},serializedName:"sync_progress",type:{name:"Number"}},listening:{serializedName:"listening",required:!0,type:{name:"Boolean"}},protocols:{serializedName:"protocols",required:!0,type:{name:"Sequence",element:{type:{name:"Composite",className:"Protocol"}}}},nodeVersion:{serializedName:"node_version",required:!0,type:{name:"String"}},nodeRevision:{serializedName:"node_revision",required:!0,type:{name:"String"}},peerCount:{serializedName:"peer_count",required:!0,type:{name:"String"}},peerConnections:{serializedName:"peer_connections",type:{name:"Composite",className:"PeerConnections"}},pendingTransactionsCount:{serializedName:"pending_transactions_count",required:!0,type:{name:"String"}},networkId:{serializedName:"network_id",required:!0,type:{name:"String"}},peerPubkey:{serializedName:"peer_pubkey",required:!0,type:{name:"String"}},topKeyBlockHash:{serializedName:"top_key_block_hash",required:!0,type:{name:"String"}},topBlockHeight:{serializedName:"top_block_height",required:!0,type:{name:"String"}}}}},pc={type:{name:"Composite",className:"Protocol",modelProperties:{version:{serializedName:"version",required:!0,type:{name:"String"}},effectiveAtHeight:{serializedName:"effective_at_height",required:!0,type:{name:"String"}}}}},hc={type:{name:"Composite",className:"PeerConnections",modelProperties:{inbound:{serializedName:"inbound",required:!0,type:{name:"String"}},outbound:{serializedName:"outbound",required:!0,type:{name:"String"}}}}},fc={type:{name:"Composite",className:"SpendTx",modelProperties:{recipientId:{serializedName:"recipient_id",required:!0,type:{name:"String"}},amount:{serializedName:"amount",required:!0,type:{name:"String"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}},senderId:{serializedName:"sender_id",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",type:{name:"String"}},payload:{serializedName:"payload",required:!0,type:{name:"String"}}}}},gc={type:{name:"Composite",className:"OracleRegisterTx",modelProperties:{queryFormat:{serializedName:"query_format",required:!0,type:{name:"String"}},responseFormat:{serializedName:"response_format",required:!0,type:{name:"String"}},queryFee:{serializedName:"query_fee",required:!0,type:{name:"String"}},oracleTtl:{serializedName:"oracle_ttl",type:{name:"Composite",className:"Ttl"}},accountId:{serializedName:"account_id",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",type:{name:"String"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}},abiVersion:{serializedName:"abi_version",type:{name:"String"}}}}},mc={type:{name:"Composite",className:"OracleExtendTx",modelProperties:{fee:{serializedName:"fee",required:!0,type:{name:"String"}},oracleTtl:{serializedName:"oracle_ttl",type:{name:"Composite",className:"RelativeTTL"}},oracleId:{serializedName:"oracle_id",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}}}}},yc={type:{name:"Composite",className:"OracleQueryTx",modelProperties:{oracleId:{serializedName:"oracle_id",required:!0,type:{name:"String"}},query:{serializedName:"query",required:!0,type:{name:"String"}},queryFee:{serializedName:"query_fee",required:!0,type:{name:"String"}},queryTtl:{serializedName:"query_ttl",type:{name:"Composite",className:"Ttl"}},responseTtl:{serializedName:"response_ttl",type:{name:"Composite",className:"RelativeTTL"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}},senderId:{serializedName:"sender_id",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",type:{name:"String"}}}}},Ic={type:{name:"Composite",className:"OracleRespondTx",modelProperties:{queryId:{serializedName:"query_id",required:!0,type:{name:"String"}},response:{serializedName:"response",required:!0,type:{name:"String"}},responseTtl:{serializedName:"response_ttl",type:{name:"Composite",className:"RelativeTTL"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}},oracleId:{serializedName:"oracle_id",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",type:{name:"String"}}}}},Cc={type:{name:"Composite",className:"NamePreclaimTx",modelProperties:{commitmentId:{serializedName:"commitment_id",required:!0,type:{name:"String"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}},accountId:{serializedName:"account_id",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",type:{name:"String"}}}}},Ec={type:{name:"Composite",className:"NameClaimTx",modelProperties:{name:{serializedName:"name",required:!0,type:{name:"String"}},nameSalt:{serializedName:"name_salt",required:!0,type:{name:"String"}},nameFee:{serializedName:"name_fee",type:{name:"String"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}},accountId:{serializedName:"account_id",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",type:{name:"String"}}}}},Bc={type:{name:"Composite",className:"NameUpdateTx",modelProperties:{nameId:{serializedName:"name_id",required:!0,type:{name:"String"}},nameTtl:{serializedName:"name_ttl",required:!0,type:{name:"String"}},pointers:{serializedName:"pointers",required:!0,type:{name:"Sequence",element:{type:{name:"Composite",className:"NamePointer"}}}},clientTtl:{serializedName:"client_ttl",required:!0,type:{name:"String"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}},accountId:{serializedName:"account_id",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",type:{name:"String"}}}}},wc={type:{name:"Composite",className:"NameTransferTx",modelProperties:{nameId:{serializedName:"name_id",required:!0,type:{name:"String"}},recipientId:{serializedName:"recipient_id",required:!0,type:{name:"String"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}},accountId:{serializedName:"account_id",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",type:{name:"String"}}}}},vc={type:{name:"Composite",className:"NameRevokeTx",modelProperties:{nameId:{serializedName:"name_id",required:!0,type:{name:"String"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}},accountId:{serializedName:"account_id",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",type:{name:"String"}}}}},Qc={type:{name:"Composite",className:"CommitmentId",modelProperties:{commitmentId:{serializedName:"commitment_id",required:!0,type:{name:"String"}}}}},bc={type:{name:"Composite",className:"NameHash",modelProperties:{nameId:{serializedName:"name_id",required:!0,type:{name:"String"}}}}},Nc={type:{name:"Composite",className:"ChannelCreateTx",modelProperties:{initiatorId:{serializedName:"initiator_id",required:!0,type:{name:"String"}},initiatorAmount:{serializedName:"initiator_amount",required:!0,type:{name:"String"}},responderId:{serializedName:"responder_id",required:!0,type:{name:"String"}},responderAmount:{serializedName:"responder_amount",required:!0,type:{name:"String"}},channelReserve:{serializedName:"channel_reserve",required:!0,type:{name:"String"}},lockPeriod:{serializedName:"lock_period",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",type:{name:"String"}},stateHash:{serializedName:"state_hash",required:!0,type:{name:"String"}},delegateIds:{serializedName:"delegate_ids",type:{name:"Composite",className:"Delegates"}}}}},Sc={type:{name:"Composite",className:"ChannelDepositTx",modelProperties:{channelId:{serializedName:"channel_id",required:!0,type:{name:"String"}},fromId:{serializedName:"from_id",required:!0,type:{name:"String"}},amount:{serializedName:"amount",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",required:!0,type:{name:"String"}},stateHash:{serializedName:"state_hash",required:!0,type:{name:"String"}},round:{serializedName:"round",required:!0,type:{name:"String"}}}}},xc={type:{name:"Composite",className:"ChannelWithdrawTx",modelProperties:{channelId:{serializedName:"channel_id",required:!0,type:{name:"String"}},toId:{serializedName:"to_id",required:!0,type:{name:"String"}},amount:{serializedName:"amount",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",required:!0,type:{name:"String"}},stateHash:{serializedName:"state_hash",required:!0,type:{name:"String"}},round:{serializedName:"round",required:!0,type:{name:"String"}}}}},_c={type:{name:"Composite",className:"ChannelForceProgressTx",modelProperties:{channelId:{serializedName:"channel_id",required:!0,type:{name:"String"}},fromId:{serializedName:"from_id",required:!0,type:{name:"String"}},payload:{serializedName:"payload",required:!0,type:{name:"String"}},round:{serializedName:"round",required:!0,type:{name:"String"}},update:{serializedName:"update",type:{name:"Composite",className:"OffChainUpdate"}},stateHash:{serializedName:"state_hash",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",type:{name:"String"}},offchainTrees:{serializedName:"offchain_trees",type:{name:"String"}}}}},Tc={type:{name:"Composite",className:"ChannelCloseMutualTx",modelProperties:{channelId:{serializedName:"channel_id",required:!0,type:{name:"String"}},fromId:{serializedName:"from_id",required:!0,type:{name:"String"}},initiatorAmountFinal:{serializedName:"initiator_amount_final",required:!0,type:{name:"String"}},responderAmountFinal:{serializedName:"responder_amount_final",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",required:!0,type:{name:"String"}}}}},Mc={type:{name:"Composite",className:"ChannelCloseSoloTx",modelProperties:{channelId:{serializedName:"channel_id",required:!0,type:{name:"String"}},fromId:{serializedName:"from_id",required:!0,type:{name:"String"}},payload:{serializedName:"payload",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",type:{name:"String"}},poi:{serializedName:"poi",required:!0,type:{name:"String"}}}}},Rc={type:{name:"Composite",className:"ChannelSlashTx",modelProperties:{channelId:{serializedName:"channel_id",required:!0,type:{name:"String"}},fromId:{serializedName:"from_id",required:!0,type:{name:"String"}},payload:{serializedName:"payload",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",type:{name:"String"}},poi:{serializedName:"poi",required:!0,type:{name:"String"}}}}},kc={type:{name:"Composite",className:"ChannelSettleTx",modelProperties:{channelId:{serializedName:"channel_id",required:!0,type:{name:"String"}},fromId:{serializedName:"from_id",required:!0,type:{name:"String"}},initiatorAmountFinal:{serializedName:"initiator_amount_final",required:!0,type:{name:"String"}},responderAmountFinal:{serializedName:"responder_amount_final",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",required:!0,type:{name:"String"}}}}},Dc={type:{name:"Composite",className:"ChannelSnapshotSoloTx",modelProperties:{channelId:{serializedName:"channel_id",required:!0,type:{name:"String"}},fromId:{serializedName:"from_id",required:!0,type:{name:"String"}},payload:{serializedName:"payload",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",type:{name:"String"}}}}},zc={type:{name:"Composite",className:"ChannelSetDelegatesTx",modelProperties:{channelId:{serializedName:"channel_id",required:!0,type:{name:"String"}},fromId:{serializedName:"from_id",required:!0,type:{name:"String"}},initiatorDelegateIds:{serializedName:"initiator_delegate_ids",required:!0,type:{name:"Sequence",element:{type:{name:"String"}}}},responderDelegateIds:{serializedName:"responder_delegate_ids",required:!0,type:{name:"Sequence",element:{type:{name:"String"}}}},stateHash:{serializedName:"state_hash",required:!0,type:{name:"String"}},round:{serializedName:"round",required:!0,type:{name:"String"}},payload:{serializedName:"payload",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",type:{name:"String"}}}}},Oc={type:{name:"Composite",className:"PubKey",modelProperties:{pubKey:{serializedName:"pub_key",required:!0,type:{name:"String"}}}}},Uc={type:{name:"Composite",className:"PeerDetails",modelProperties:{host:{serializedName:"host",required:!0,type:{name:"String"}},port:{serializedName:"port",required:!0,type:{name:"String"}},firstSeen:{serializedName:"first_seen",required:!0,type:{name:"String"}},lastSeen:{serializedName:"last_seen",required:!0,type:{name:"String"}},genesisHash:{serializedName:"genesis_hash",required:!0,type:{name:"String"}},topHash:{serializedName:"top_hash",required:!0,type:{name:"String"}},topDifficulty:{serializedName:"top_difficulty",required:!0,type:{name:"String"}},networkId:{serializedName:"network_id",type:{name:"String"}},nodeVersion:{serializedName:"node_version",type:{name:"String"}},nodeRevision:{serializedName:"node_revision",type:{name:"String"}},nodeVendor:{serializedName:"node_vendor",type:{name:"String"}},nodeOs:{serializedName:"node_os",type:{name:"String"}}}}},Fc={type:{name:"Composite",className:"Peers",modelProperties:{peers:{serializedName:"peers",required:!0,type:{name:"Sequence",element:{type:{name:"String"}}}},blocked:{serializedName:"blocked",required:!0,type:{name:"Sequence",element:{type:{name:"String"}}}}}}},Pc={type:{name:"Composite",className:"PeerCount",modelProperties:{connected:{serializedName:"connected",type:{name:"Composite",className:"PeerCountConnected"}},available:{serializedName:"available",type:{name:"Composite",className:"PeerCountAvailable"}},blocked:{serializedName:"blocked",required:!0,type:{name:"String"}}}}},qc={type:{name:"Composite",className:"PeerCountConnected",modelProperties:{inbound:{serializedName:"inbound",type:{name:"String"}},outbound:{serializedName:"outbound",type:{name:"String"}}}}},Gc={type:{name:"Composite",className:"PeerCountAvailable",modelProperties:{verified:{serializedName:"verified",type:{name:"String"}},unverified:{serializedName:"unverified",type:{name:"String"}}}}},Lc={type:{name:"Composite",className:"ContractCreateTx",modelProperties:{ownerId:{serializedName:"owner_id",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",type:{name:"String"}},code:{serializedName:"code",required:!0,type:{name:"String"}},vmVersion:{serializedName:"vm_version",required:!0,type:{name:"String"}},abiVersion:{serializedName:"abi_version",required:!0,type:{name:"String"}},deposit:{serializedName:"deposit",required:!0,type:{name:"String"}},amount:{serializedName:"amount",required:!0,type:{name:"String"}},gas:{serializedName:"gas",required:!0,type:{name:"String"}},gasPrice:{serializedName:"gas_price",required:!0,type:{name:"String"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}},callData:{serializedName:"call_data",required:!0,type:{name:"String"}}}}},Hc={type:{name:"Composite",className:"ContractCallTx",modelProperties:{callerId:{serializedName:"caller_id",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",type:{name:"String"}},contractId:{serializedName:"contract_id",required:!0,type:{name:"String"}},abiVersion:{serializedName:"abi_version",required:!0,type:{name:"String"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}},amount:{serializedName:"amount",required:!0,type:{name:"String"}},gas:{serializedName:"gas",required:!0,type:{name:"String"}},gasPrice:{serializedName:"gas_price",required:!0,type:{name:"String"}},callData:{serializedName:"call_data",required:!0,type:{name:"String"}}}}},jc={type:{name:"Composite",className:"UnsignedTx",modelProperties:{tx:{serializedName:"tx",required:!0,type:{name:"String"}}}}},Yc={type:{name:"Composite",className:"TokenSupply",modelProperties:{accounts:{serializedName:"accounts",type:{name:"String"}},contracts:{serializedName:"contracts",type:{name:"String"}},contractOracles:{serializedName:"contract_oracles",type:{name:"String"}},locked:{serializedName:"locked",type:{name:"String"}},oracles:{serializedName:"oracles",type:{name:"String"}},oracleQueries:{serializedName:"oracle_queries",type:{name:"String"}},pendingRewards:{serializedName:"pending_rewards",type:{name:"String"}},total:{serializedName:"total",type:{name:"String"}}}}},Kc={type:{name:"Composite",className:"GAAttachTx",modelProperties:{ownerId:{serializedName:"owner_id",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",type:{name:"String"}},code:{serializedName:"code",required:!0,type:{name:"String"}},vmVersion:{serializedName:"vm_version",required:!0,type:{name:"String"}},abiVersion:{serializedName:"abi_version",required:!0,type:{name:"String"}},gas:{serializedName:"gas",required:!0,type:{name:"String"}},gasPrice:{serializedName:"gas_price",required:!0,type:{name:"String"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}},callData:{serializedName:"call_data",required:!0,type:{name:"String"}},authFun:{constraints:{Pattern:new RegExp("^(0x|0X)?[a-fA-F0-9]+$")},serializedName:"auth_fun",required:!0,type:{name:"String"}}}}},Vc={type:{name:"Composite",className:"GAMetaTx",modelProperties:{gaId:{serializedName:"ga_id",required:!0,type:{name:"String"}},abiVersion:{serializedName:"abi_version",required:!0,type:{name:"String"}},gas:{serializedName:"gas",required:!0,type:{name:"String"}},gasPrice:{serializedName:"gas_price",required:!0,type:{name:"String"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}},authData:{serializedName:"auth_data",required:!0,type:{name:"String"}},tx:{serializedName:"tx",type:{name:"Composite",className:"SignedTx"}}}}},$c={type:{name:"Composite",className:"PayingForTx",modelProperties:{payerId:{serializedName:"payer_id",required:!0,type:{name:"String"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",type:{name:"String"}},tx:{serializedName:"tx",type:{name:"Composite",className:"SignedTx"}}}}},Jc={type:{name:"Composite",className:"CheckTxInPoolResponse",modelProperties:{status:{serializedName:"status",required:!0,type:{name:"String"}}}}},Wc={serializedName:"OffChainTransfer",type:{name:"Composite",className:"OffChainTransfer",uberParent:"OffChainUpdate",polymorphicDiscriminator:zs.type.polymorphicDiscriminator,modelProperties:{...zs.type.modelProperties,from:{serializedName:"from",required:!0,type:{name:"String"}},to:{serializedName:"to",required:!0,type:{name:"String"}},amount:{serializedName:"amount",required:!0,type:{name:"String"}}}}},Xc={serializedName:"OffChainWithdrawal",type:{name:"Composite",className:"OffChainWithdrawal",uberParent:"OffChainUpdate",polymorphicDiscriminator:zs.type.polymorphicDiscriminator,modelProperties:{...zs.type.modelProperties,to:{serializedName:"to",required:!0,type:{name:"String"}},amount:{serializedName:"amount",required:!0,type:{name:"String"}}}}},Zc={serializedName:"OffChainDeposit",type:{name:"Composite",className:"OffChainDeposit",uberParent:"OffChainUpdate",polymorphicDiscriminator:zs.type.polymorphicDiscriminator,modelProperties:{...zs.type.modelProperties,from:{serializedName:"from",required:!0,type:{name:"String"}},amount:{serializedName:"amount",required:!0,type:{name:"String"}}}}},eA={serializedName:"OffChainNewContract",type:{name:"Composite",className:"OffChainNewContract",uberParent:"OffChainUpdate",polymorphicDiscriminator:zs.type.polymorphicDiscriminator,modelProperties:{...zs.type.modelProperties,owner:{serializedName:"owner",required:!0,type:{name:"String"}},vmVersion:{serializedName:"vm_version",required:!0,type:{name:"String"}},abiVersion:{serializedName:"abi_version",required:!0,type:{name:"String"}},code:{serializedName:"code",type:{name:"Composite",className:"ByteCode"}},deposit:{serializedName:"deposit",required:!0,type:{name:"String"}},callData:{serializedName:"call_data",required:!0,type:{name:"String"}}}}},tA={serializedName:"OffChainCallContract",type:{name:"Composite",className:"OffChainCallContract",uberParent:"OffChainUpdate",polymorphicDiscriminator:zs.type.polymorphicDiscriminator,modelProperties:{...zs.type.modelProperties,caller:{serializedName:"caller",required:!0,type:{name:"String"}},contract:{serializedName:"contract",required:!0,type:{name:"String"}},abiVersion:{serializedName:"abi_version",required:!0,type:{name:"String"}},amount:{serializedName:"amount",required:!0,type:{name:"String"}},gas:{serializedName:"gas",required:!0,type:{name:"String"}},gasPrice:{serializedName:"gas_price",required:!0,type:{name:"String"}},callData:{serializedName:"call_data",required:!0,type:{name:"String"}}}}},rA={type:{name:"Composite",className:"CreateContractUnsignedTx",modelProperties:{...jc.type.modelProperties,contractId:{serializedName:"contract_id",required:!0,type:{name:"String"}}}}};let nA={"Tx.undefined":ks,OffChainUpdate:zs,"OffChainUpdate.OffChainTransfer":Wc,"OffChainUpdate.OffChainWithdrawal":Xc,"OffChainUpdate.OffChainDeposit":Zc,"OffChainUpdate.OffChainNewContract":eA,"OffChainUpdate.OffChainCallContract":tA};const iA={parameterPath:"accept",mapper:{defaultValue:"application/json",isConstant:!0,serializedName:"Accept",type:{name:"String"}}},aA={parameterPath:"$host",mapper:{serializedName:"$host",required:!0,type:{name:"String"}},skipEncoding:!0},oA={parameterPath:"intAsString",mapper:{defaultValue:!1,serializedName:"int-as-string",type:{name:"Boolean"}}},sA={parameterPath:"hash",mapper:{serializedName:"hash",required:!0,type:{name:"String"}}},cA={parameterPath:"height",mapper:{constraints:{InclusiveMaximum:0x10000000000000000,InclusiveMinimum:0},serializedName:"height",required:!0,type:{name:"Number"}}},AA={parameterPath:"pubkey",mapper:{serializedName:"pubkey",required:!0,type:{name:"String"}}},uA={parameterPath:["options","contentType"],mapper:{defaultValue:"application/json",isConstant:!0,serializedName:"Content-Type",type:{name:"String"}}},lA={parameterPath:"body",mapper:Hs},dA={parameterPath:"body",mapper:tc};class pA extends vs{constructor(e,t){var r,n,i;if(void 0===e)throw new Error("'$host' cannot be null");t||(t={});const a="azsdk-js-node/1.0.0-beta.1",o=t.userAgentOptions&&t.userAgentOptions.userAgentPrefix?`${t.userAgentOptions.userAgentPrefix} ${a}`:`${a}`,s={requestContentType:"application/json; charset=utf-8",...t,userAgentOptions:{userAgentPrefix:o},baseUri:null!==(r=null!==(n=t.endpoint)&&void 0!==n?n:t.baseUri)&&void 0!==r?r:"{$host}"};super(s),null!==(i=t)&&void 0!==i&&i.pipeline&&t.pipeline.getOrderedPolicies().length>0&&(t.pipeline.getOrderedPolicies().some((e=>e.name===ds))||(this.pipeline.removePolicy({name:ds}),this.pipeline.addPolicy(hs({scopes:`${s.baseUri}/.default`,challengeCallbacks:{authorizeRequestOnChallenge:Qs}})))),this.$host=e}getTopHeader(e){return this.sendOperationRequest({options:e},fA)}getCurrentKeyBlock(e){return this.sendOperationRequest({options:e},gA)}getCurrentKeyBlockHash(e){return this.sendOperationRequest({options:e},mA)}getCurrentKeyBlockHeight(e){return this.sendOperationRequest({options:e},yA)}getPendingKeyBlock(e){return this.sendOperationRequest({options:e},IA)}getKeyBlockByHash(e,t){return this.sendOperationRequest({hash:e,options:t},CA)}getKeyBlockByHeight(e,t){return this.sendOperationRequest({height:e,options:t},EA)}getMicroBlockHeaderByHash(e,t){return this.sendOperationRequest({hash:e,options:t},BA)}getMicroBlockTransactionsByHash(e,t){return this.sendOperationRequest({hash:e,options:t},wA)}getMicroBlockTransactionByHashAndIndex(e,t,r){return this.sendOperationRequest({hash:e,index:t,options:r},vA)}getMicroBlockTransactionsCountByHash(e,t){return this.sendOperationRequest({hash:e,options:t},QA)}getCurrentGeneration(e){return this.sendOperationRequest({options:e},bA)}getGenerationByHash(e,t){return this.sendOperationRequest({hash:e,options:t},NA)}getGenerationByHeight(e,t){return this.sendOperationRequest({height:e,options:t},SA)}getAccountByPubkey(e,t){return this.sendOperationRequest({pubkey:e,options:t},xA)}getAccountByPubkeyAndHeight(e,t,r){return this.sendOperationRequest({pubkey:e,height:t,options:r},_A)}getAccountByPubkeyAndHash(e,t,r){return this.sendOperationRequest({pubkey:e,hash:t,options:r},TA)}getPendingAccountTransactionsByPubkey(e,t){return this.sendOperationRequest({pubkey:e,options:t},MA)}getAccountNextNonce(e,t){return this.sendOperationRequest({pubkey:e,options:t},RA)}protectedDryRunTxs(e,t){return this.sendOperationRequest({body:e,options:t},kA)}getTransactionByHash(e,t){return this.sendOperationRequest({hash:e,options:t},DA)}getTransactionInfoByHash(e,t){return this.sendOperationRequest({hash:e,options:t},zA)}postTransaction(e,t){return this.sendOperationRequest({body:e,options:t},OA)}getContract(e,t){return this.sendOperationRequest({pubkey:e,options:t},UA)}getContractCode(e,t){return this.sendOperationRequest({pubkey:e,options:t},FA)}getContractPoI(e,t){return this.sendOperationRequest({pubkey:e,options:t},PA)}getOracleByPubkey(e,t){return this.sendOperationRequest({pubkey:e,options:t},qA)}getOracleQueriesByPubkey(e,t){return this.sendOperationRequest({pubkey:e,options:t},GA)}getOracleQueryByPubkeyAndQueryId(e,t,r){return this.sendOperationRequest({pubkey:e,queryId:t,options:r},LA)}getNameEntryByName(e,t){return this.sendOperationRequest({name:e,options:t},HA)}getChannelByPubkey(e,t){return this.sendOperationRequest({pubkey:e,options:t},jA)}getPeerPubkey(e){return this.sendOperationRequest({options:e},YA)}getStatus(e){return this.sendOperationRequest({options:e},KA)}getChainEnds(e){return this.sendOperationRequest({options:e},VA)}}const hA=to(u,!1),fA={path:"/v3/headers/top",httpMethod:"GET",responses:{200:{bodyMapper:bs},404:{bodyMapper:Ns,isError:!0}},queryParameters:[oA],urlParameters:[aA],headerParameters:[iA],serializer:hA},gA={path:"/v3/key-blocks/current",httpMethod:"GET",responses:{200:{bodyMapper:Ss},404:{bodyMapper:Ns,isError:!0}},queryParameters:[oA],urlParameters:[aA],headerParameters:[iA],serializer:hA},mA={path:"/v3/key-blocks/current/hash",httpMethod:"GET",responses:{200:{bodyMapper:xs},404:{bodyMapper:Ns,isError:!0}},queryParameters:[oA],urlParameters:[aA],headerParameters:[iA],serializer:hA},yA={path:"/v3/key-blocks/current/height",httpMethod:"GET",responses:{200:{bodyMapper:_s},404:{bodyMapper:Ns,isError:!0}},queryParameters:[oA],urlParameters:[aA],headerParameters:[iA],serializer:hA},IA={path:"/v3/key-blocks/pending",httpMethod:"GET",responses:{200:{bodyMapper:Ss},400:{bodyMapper:Ns,isError:!0},404:{bodyMapper:Ns,isError:!0}},queryParameters:[oA],urlParameters:[aA],headerParameters:[iA],serializer:hA},CA={path:"/v3/key-blocks/hash/{hash}",httpMethod:"GET",responses:{200:{bodyMapper:Ss},400:{bodyMapper:Ns,isError:!0},404:{bodyMapper:Ns,isError:!0}},queryParameters:[oA],urlParameters:[aA,sA],headerParameters:[iA],serializer:hA},EA={path:"/v3/key-blocks/height/{height}",httpMethod:"GET",responses:{200:{bodyMapper:Ss},404:{bodyMapper:Ns,isError:!0}},queryParameters:[oA],urlParameters:[aA,cA],headerParameters:[iA],serializer:hA},BA={path:"/v3/micro-blocks/hash/{hash}/header",httpMethod:"GET",responses:{200:{bodyMapper:Ts},400:{bodyMapper:Ns,isError:!0},404:{bodyMapper:Ns,isError:!0}},queryParameters:[oA],urlParameters:[aA,sA],headerParameters:[iA],serializer:hA},wA={path:"/v3/micro-blocks/hash/{hash}/transactions",httpMethod:"GET",responses:{200:{bodyMapper:Ms},400:{bodyMapper:Ns,isError:!0},404:{bodyMapper:Ns,isError:!0}},queryParameters:[oA],urlParameters:[aA,sA],headerParameters:[iA],serializer:hA},vA={path:"/v3/micro-blocks/hash/{hash}/transactions/index/{index}",httpMethod:"GET",responses:{200:{bodyMapper:Rs},400:{bodyMapper:Ns,isError:!0},404:{bodyMapper:Ns,isError:!0}},queryParameters:[oA],urlParameters:[aA,sA,{parameterPath:"index",mapper:{constraints:{InclusiveMinimum:1},serializedName:"index",required:!0,type:{name:"Number"}}}],headerParameters:[iA],serializer:hA},QA={path:"/v3/micro-blocks/hash/{hash}/transactions/count",httpMethod:"GET",responses:{200:{bodyMapper:Ps},400:{bodyMapper:Ns,isError:!0},404:{bodyMapper:Ns,isError:!0}},queryParameters:[oA],urlParameters:[aA,sA],headerParameters:[iA],serializer:hA},bA={path:"/v3/generations/current",httpMethod:"GET",responses:{200:{bodyMapper:qs},404:{bodyMapper:Ns,isError:!0}},queryParameters:[oA],urlParameters:[aA],headerParameters:[iA],serializer:hA},NA={path:"/v3/generations/hash/{hash}",httpMethod:"GET",responses:{200:{bodyMapper:qs},400:{bodyMapper:Ns,isError:!0},404:{bodyMapper:Ns,isError:!0}},queryParameters:[oA],urlParameters:[aA,sA],headerParameters:[iA],serializer:hA},SA={path:"/v3/generations/height/{height}",httpMethod:"GET",responses:{200:{bodyMapper:qs},404:{bodyMapper:Ns,isError:!0}},queryParameters:[oA],urlParameters:[aA,cA],headerParameters:[iA],serializer:hA},xA={path:"/v3/accounts/{pubkey}",httpMethod:"GET",responses:{200:{bodyMapper:Gs},400:{bodyMapper:Ns,isError:!0},404:{bodyMapper:Ns,isError:!0}},queryParameters:[oA],urlParameters:[aA,AA],headerParameters:[iA],serializer:hA},_A={path:"/v3/accounts/{pubkey}/height/{height}",httpMethod:"GET",responses:{200:{bodyMapper:Gs},400:{bodyMapper:Ns,isError:!0},404:{bodyMapper:Ns,isError:!0}},queryParameters:[oA],urlParameters:[aA,cA,AA],headerParameters:[iA],serializer:hA},TA={path:"/v3/accounts/{pubkey}/hash/{hash}",httpMethod:"GET",responses:{200:{bodyMapper:Gs},400:{bodyMapper:Ns,isError:!0},404:{bodyMapper:Ns,isError:!0}},queryParameters:[oA],urlParameters:[aA,sA,AA],headerParameters:[iA],serializer:hA},MA={path:"/v3/accounts/{pubkey}/transactions/pending",httpMethod:"GET",responses:{200:{bodyMapper:Ms},400:{bodyMapper:Ns,isError:!0},404:{bodyMapper:Ns,isError:!0}},queryParameters:[oA],urlParameters:[aA,AA],headerParameters:[iA],serializer:hA},RA={path:"/v3/accounts/{pubkey}/next-nonce",httpMethod:"GET",responses:{200:{bodyMapper:Ls},400:{bodyMapper:Ns,isError:!0},404:{bodyMapper:Ns,isError:!0}},queryParameters:[oA,{parameterPath:["options","strategy"],mapper:{defaultValue:"max",serializedName:"strategy",type:{name:"Enum",allowedValues:["max","continuity"]}}}],urlParameters:[aA,AA],headerParameters:[iA],serializer:hA},kA={path:"/v3/dry-run",httpMethod:"POST",responses:{200:{bodyMapper:$s},403:{bodyMapper:Ns,isError:!0}},requestBody:lA,queryParameters:[oA],urlParameters:[aA],headerParameters:[iA,uA],mediaType:"json",serializer:hA},DA={path:"/v3/transactions/{hash}",httpMethod:"GET",responses:{200:{bodyMapper:Rs},400:{bodyMapper:Ns,isError:!0},404:{bodyMapper:Ns,isError:!0}},queryParameters:[oA],urlParameters:[aA,sA],headerParameters:[iA],serializer:hA},zA={path:"/v3/transactions/{hash}/info",httpMethod:"GET",responses:{200:{bodyMapper:Zs},400:{bodyMapper:Ns,isError:!0},404:{bodyMapper:Ns,isError:!0}},queryParameters:[oA],urlParameters:[aA,sA],headerParameters:[iA],serializer:hA},OA={path:"/v3/transactions",httpMethod:"POST",responses:{200:{bodyMapper:rc},400:{bodyMapper:Ns,isError:!0}},requestBody:dA,queryParameters:[oA],urlParameters:[aA],headerParameters:[iA,uA],mediaType:"json",serializer:hA},UA={path:"/v3/contracts/{pubkey}",httpMethod:"GET",responses:{200:{bodyMapper:nc},400:{bodyMapper:Ns,isError:!0},404:{isError:!0}},queryParameters:[oA],urlParameters:[aA,AA],headerParameters:[iA],serializer:hA},FA={path:"/v3/contracts/{pubkey}/code",httpMethod:"GET",responses:{200:{bodyMapper:ic},400:{bodyMapper:Ns,isError:!0},404:{bodyMapper:Ns,isError:!0}},queryParameters:[oA],urlParameters:[aA,AA],headerParameters:[iA],serializer:hA},PA={path:"/v3/contracts/{pubkey}/poi",httpMethod:"GET",responses:{200:{bodyMapper:ac},400:{bodyMapper:Ns,isError:!0},404:{bodyMapper:Ns,isError:!0}},queryParameters:[oA],urlParameters:[aA,AA],headerParameters:[iA],serializer:hA},qA={path:"/v3/oracles/{pubkey}",httpMethod:"GET",responses:{200:{bodyMapper:oc},400:{bodyMapper:Ns,isError:!0},404:{bodyMapper:Ns,isError:!0}},queryParameters:[oA],urlParameters:[aA,AA],headerParameters:[iA],serializer:hA},GA={path:"/v3/oracles/{pubkey}/queries",httpMethod:"GET",responses:{200:{bodyMapper:sc},400:{bodyMapper:Ns,isError:!0},404:{bodyMapper:Ns,isError:!0}},queryParameters:[oA,{parameterPath:["options","from"],mapper:{serializedName:"from",type:{name:"String"}}},{parameterPath:["options","limit"],mapper:{defaultValue:20,constraints:{InclusiveMaximum:1e3,InclusiveMinimum:1},serializedName:"limit",type:{name:"Number"}}},{parameterPath:["options","type"],mapper:{defaultValue:"all",serializedName:"type",type:{name:"Enum",allowedValues:["open","closed","all"]}}}],urlParameters:[aA,AA],headerParameters:[iA],serializer:hA},LA={path:"/v3/oracles/{pubkey}/queries/{query-id}",httpMethod:"GET",responses:{200:{bodyMapper:cc},400:{bodyMapper:Ns,isError:!0},404:{bodyMapper:Ns,isError:!0}},queryParameters:[oA],urlParameters:[aA,AA,{parameterPath:"queryId",mapper:{serializedName:"query-id",required:!0,type:{name:"String"}}}],headerParameters:[iA],serializer:hA},HA={path:"/v3/names/{name}",httpMethod:"GET",responses:{200:{bodyMapper:Ac},400:{bodyMapper:Ns,isError:!0},404:{bodyMapper:Ns,isError:!0}},queryParameters:[oA],urlParameters:[aA,{parameterPath:"name",mapper:{serializedName:"name",required:!0,type:{name:"String"}}}],headerParameters:[iA],serializer:hA},jA={path:"/v3/channels/{pubkey}",httpMethod:"GET",responses:{200:{bodyMapper:uc},400:{bodyMapper:Ns,isError:!0},404:{bodyMapper:Ns,isError:!0}},queryParameters:[oA],urlParameters:[aA,AA],headerParameters:[iA],serializer:hA},YA={path:"/v3/peers/pubkey",httpMethod:"GET",responses:{200:{bodyMapper:lc}},queryParameters:[oA],urlParameters:[aA],headerParameters:[iA],serializer:hA},KA={path:"/v3/status",httpMethod:"GET",responses:{200:{bodyMapper:dc}},queryParameters:[oA],urlParameters:[aA],headerParameters:[iA],serializer:hA},VA={path:"/v3/status/chain-ends",httpMethod:"GET",responses:{200:{bodyMapper:{type:{name:"Sequence",element:{type:{name:"String"}}}}}},queryParameters:[oA],urlParameters:[aA],headerParameters:[iA],serializer:hA};function $A(e,t){!function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t),t.add(e)}function JA(e,t,r){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return r}async function WA(){var e,t,r;let{networkId:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const i=null!==(e=null!=n?n:this.networkId)&&void 0!==e?e:null===(t=await(null===(r=this.api)||void 0===r?void 0:r.getStatus()))||void 0===t?void 0:t.networkId;if(null!=i)return i;throw new M("networkId is not provided")}const XA=["balance","queryFee","fee","amount","nameFee","channelAmount","initiatorAmount","responderAmount","channelReserve","initiatorAmountFinal","responderAmountFinal","gasPrice","deposit"],ZA=["time","gas","gasUsed","nameSalt","nonce","nextNonce","height","blockHeight","top","topBlockHeight","ttl","nameTtl","clientTtl","inbound","outbound","peerCount","pendingTransactionsCount","effectiveAtHeight","version","solutions","round"];var eu=new WeakSet,tu=new WeakSet,ru=new WeakSet;class nu extends pA{constructor(){super(...arguments),$A(this,ru),$A(this,tu),$A(this,eu)}async sendOperationRequest(e,t){const r=at(e,(e=>{let[t,r]=e;return[t,JA(this,tu,au).call(this,r)]}));return JA(this,ru,ou).call(this,await super.sendOperationRequest(r,t))}}function iu(e,t){return Array.isArray(e)?e.map((e=>JA(this,eu,iu).call(this,e,t))):null!=e&&"object"==typeof e?at(e,(e=>{let[r,n]=e;return null==n?[r,n]:XA.some((e=>e===r))?[r,t.bigInt(n)]:ZA.some((e=>e===r))?[r,t.number(n)]:[r,JA(this,eu,iu).call(this,n,t)]})):e}function au(e){return JA(this,eu,iu).call(this,e,{bigInt:e=>e instanceof p()?e.toFixed():e.toString(),number:e=>e.toString()})}function ou(e){return JA(this,eu,iu).call(this,e,{bigInt:e=>BigInt(e),number:e=>+e})}class su extends nu{constructor(e){let{ignoreVersion:t=!1,...r}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(super(e,{allowInsecureConnection:!0,additionalPolicies:[Ta(),Ma(),Ra((e=>` ${e.reason}`))],...r}),this.url=e,!t){const e=this.getStatus().then((e=>{let{nodeVersion:t}=e;return t}));this.pipeline.addPolicy(ka("node","/v3/status",e,"6.2.0","7.0.0"))}this.intAsString=!0}async getNodeInfo(){const{nodeVersion:e,networkId:t,protocols:r,topBlockHeight:n}=await this.getStatus(),i=r.filter((e=>{let{effectiveAtHeight:t}=e;return n>=t})).reduce(((e,t)=>t.effectiveAtHeight>e.effectiveAtHeight?t:e),{effectiveAtHeight:-1,version:0}).version;return{url:this.url,nodeNetworkId:t,version:e,consensusProtocolVersion:i}}}var cu=r(8764).Buffer;class Au{constructor(){var e;let{networkId:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Ca(this,"getNetworkId",WA),null!==(e=this.networkId)&&void 0!==e||(this.networkId=t)}async signTransaction(e){let{innerTx:t,networkId:r,...n}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=[await this.getNetworkId({networkId:r})];!0===t&&i.push("inner_tx");const a=vt(e),o=ot([cu.from(i.join("-")),Tt(a)]);return In({encodedTx:a,signatures:[await this.sign(o,n)]},Xt.SignedTx).tx}async signMessage(e){let{returnHex:t=!1,...r}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=await this.sign(Ot(e),r);return t?cu.from(n).toString("hex"):n}async verifyMessage(e,t,r){return Ft(e,"string"==typeof t?cu.from(t,"hex"):t,vt(await this.address(r)))}}var uu=r(8764).Buffer;const lu=new WeakMap;class du extends Au{constructor(e){let{keypair:t,gaId:r,...n}=e;if(super(n),this.isGa=null!=r,this.isGa&&null!=r)return vt(r),void lu.set(this,{publicKey:r});if(null==t)throw new M("Either gaId or keypair is required");if(!uu.isBuffer(t.secretKey)&&"string"==typeof t.secretKey&&!Je(t.secretKey))throw new L("Secret key must be hex string or Buffer");const i="string"==typeof t.secretKey?uu.from(t.secretKey,"hex"):t.secretKey;if(!Pt(i,vt(t.publicKey)))throw new L("Invalid Key Pair");lu.set(this,{secretKey:i,publicKey:t.publicKey})}async sign(e){if(this.isGa)throw new L("You are trying to sign data using generalized account without keypair");return Dt(e,lu.get(this).secretKey)}async signTransaction(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isGa||!0===t.innerTx)return super.signTransaction(e,t);const{authData:r,authFun:n,onCompiler:i,onNode:a}=t;if(null==n||null==r||null==i||null==a)throw new S("authData, authFun, onCompiler, onNode","provided",null);return oa(e,r,n,{onCompiler:i,onNode:a,onAccount:this})}async address(){return lu.get(this).publicKey}}const pu={type:{name:"Composite",className:"Contract",modelProperties:{code:{serializedName:"code",required:!0,type:{name:"String"}},options:{serializedName:"options",type:{name:"Composite",className:"CompileOpts"}}}}},hu={type:{name:"Composite",className:"CompileOpts",modelProperties:{backend:{serializedName:"backend",type:{name:"String"}},fileSystem:{serializedName:"file_system",type:{name:"Dictionary",value:{type:{name:"any"}}}},srcFile:{serializedName:"src_file",type:{name:"String"}}}}},fu={type:{name:"Composite",className:"Aci",modelProperties:{encodedAci:{serializedName:"encoded_aci",required:!0,type:{name:"Dictionary",value:{type:{name:"any"}}}},externalEncodedAci:{serializedName:"external_encoded_aci",type:{name:"Sequence",element:{type:{name:"Dictionary",value:{type:{name:"any"}}}}}},interface:{serializedName:"interface",required:!0,type:{name:"String"}}}}},gu={type:{name:"Composite",className:"CompilerError",modelProperties:{context:{serializedName:"context",type:{name:"String"}},message:{serializedName:"message",required:!0,type:{name:"String"}},pos:{serializedName:"pos",type:{name:"Composite",className:"ErrorPos"}},type:{serializedName:"type",required:!0,type:{name:"String"}}}}},mu={type:{name:"Composite",className:"ErrorPos",modelProperties:{col:{serializedName:"col",required:!0,type:{name:"Number"}},file:{serializedName:"file",type:{name:"String"}},line:{serializedName:"line",required:!0,type:{name:"Number"}}}}},yu={type:{name:"Composite",className:"ErrorModel",modelProperties:{reason:{serializedName:"reason",required:!0,type:{name:"String"}}}}},Iu={type:{name:"Composite",className:"APIVersion",modelProperties:{apiVersion:{serializedName:"api-version",required:!0,type:{name:"String"}}}}},Cu={type:{name:"Composite",className:"ByteCode",modelProperties:{bytecode:{serializedName:"bytecode",required:!0,type:{name:"String"}}}}},Eu={type:{name:"Composite",className:"ByteCodeInput",modelProperties:{bytecode:{serializedName:"bytecode",required:!0,type:{name:"String"}}}}},Bu={type:{name:"Composite",className:"CompilerVersion",modelProperties:{version:{serializedName:"version",required:!0,type:{name:"String"}}}}},wu={type:{name:"Composite",className:"SophiaCallResultInput",modelProperties:{callResult:{serializedName:"call-result",required:!0,type:{name:"String"}},callValue:{serializedName:"call-value",required:!0,type:{name:"String"}},function:{serializedName:"function",required:!0,type:{name:"String"}},options:{serializedName:"options",type:{name:"Composite",className:"CompileOpts"}},source:{serializedName:"source",required:!0,type:{name:"String"}}}}},vu={type:{name:"Composite",className:"BytecodeCallResultInput",modelProperties:{backend:{serializedName:"backend",type:{name:"String"}},bytecode:{serializedName:"bytecode",required:!0,type:{name:"String"}},callResult:{serializedName:"call-result",required:!0,type:{name:"String"}},callValue:{serializedName:"call-value",required:!0,type:{name:"String"}},function:{serializedName:"function",required:!0,type:{name:"String"}}}}},Qu={type:{name:"Composite",className:"DecodedCallresult",modelProperties:{function:{serializedName:"function",required:!0,type:{name:"String"}},result:{serializedName:"result",required:!0,type:{name:"Dictionary",value:{type:{name:"any"}}}}}}},bu={type:{name:"Composite",className:"DecodeCalldataBytecode",modelProperties:{backend:{serializedName:"backend",type:{name:"String"}},bytecode:{serializedName:"bytecode",required:!0,type:{name:"String"}},calldata:{serializedName:"calldata",required:!0,type:{name:"String"}}}}},Nu={type:{name:"Composite",className:"DecodedCalldata",modelProperties:{arguments:{serializedName:"arguments",required:!0,type:{name:"Sequence",element:{type:{name:"Dictionary",value:{type:{name:"any"}}}}}},function:{serializedName:"function",required:!0,type:{name:"String"}}}}},Su={type:{name:"Composite",className:"DecodeCalldataSource",modelProperties:{calldata:{serializedName:"calldata",required:!0,type:{name:"String"}},function:{serializedName:"function",required:!0,type:{name:"String"}},options:{serializedName:"options",type:{name:"Composite",className:"CompileOpts"}},source:{serializedName:"source",required:!0,type:{name:"String"}}}}},xu={type:{name:"Composite",className:"SophiaBinaryData",modelProperties:{data:{serializedName:"data",required:!0,type:{name:"String"}},sophiaType:{serializedName:"sophia-type",required:!0,type:{name:"String"}}}}},_u={type:{name:"Composite",className:"SophiaJsonData",modelProperties:{data:{serializedName:"data",required:!0,type:{name:"Dictionary",value:{type:{name:"any"}}}}}}},Tu={type:{name:"Composite",className:"FunctionCallInput",modelProperties:{arguments:{serializedName:"arguments",required:!0,type:{name:"Sequence",element:{type:{name:"String"}}}},function:{serializedName:"function",required:!0,type:{name:"String"}},options:{serializedName:"options",type:{name:"Composite",className:"CompileOpts"}},source:{serializedName:"source",required:!0,type:{name:"String"}}}}},Mu={type:{name:"Composite",className:"Calldata",modelProperties:{calldata:{serializedName:"calldata",required:!0,type:{name:"String"}}}}},Ru={type:{name:"Composite",className:"FateAssembler",modelProperties:{fateAssembler:{serializedName:"fate-assembler",required:!0,type:{name:"String"}}}}},ku={type:{name:"Composite",className:"ValidateByteCodeInput",modelProperties:{bytecode:{serializedName:"bytecode",required:!0,type:{name:"String"}},options:{serializedName:"options",type:{name:"Composite",className:"CompileOpts"}},source:{serializedName:"source",required:!0,type:{name:"String"}}}}},Du={parameterPath:["options","contentType"],mapper:{defaultValue:"application/json",isConstant:!0,serializedName:"Content-Type",type:{name:"String"}}},zu={parameterPath:"body",mapper:pu},Ou={parameterPath:"accept",mapper:{defaultValue:"application/json",isConstant:!0,serializedName:"Accept",type:{name:"String"}}},Uu={parameterPath:"$host",mapper:{serializedName:"$host",required:!0,type:{name:"String"}},skipEncoding:!0},Fu={parameterPath:"body",mapper:Eu},Pu={parameterPath:"body",mapper:wu},qu={parameterPath:"body",mapper:vu},Gu={parameterPath:"body",mapper:bu},Lu={parameterPath:"body",mapper:Su},Hu={parameterPath:"body",mapper:xu},ju={parameterPath:"body",mapper:Tu},Yu={parameterPath:"body",mapper:ku};class Ku extends vs{constructor(e,t){var r,n,i;if(void 0===e)throw new Error("'$host' cannot be null");t||(t={});const a="azsdk-js-compiler/1.0.0-beta.1",o=t.userAgentOptions&&t.userAgentOptions.userAgentPrefix?`${t.userAgentOptions.userAgentPrefix} ${a}`:`${a}`,s={requestContentType:"application/json; charset=utf-8",...t,userAgentOptions:{userAgentPrefix:o},baseUri:null!==(r=null!==(n=t.endpoint)&&void 0!==n?n:t.baseUri)&&void 0!==r?r:"{$host}"};super(s),null!==(i=t)&&void 0!==i&&i.pipeline&&t.pipeline.getOrderedPolicies().length>0&&(t.pipeline.getOrderedPolicies().some((e=>e.name===ds))||(this.pipeline.removePolicy({name:ds}),this.pipeline.addPolicy(hs({scopes:`${s.baseUri}/.default`,challengeCallbacks:{authorizeRequestOnChallenge:Qs}})))),this.$host=e}generateACI(e,t){return this.sendOperationRequest({body:e,options:t},$u)}api(e){return this.sendOperationRequest({options:e},Ju)}aPIVersion(e){return this.sendOperationRequest({options:e},Wu)}compileContract(e,t){return this.sendOperationRequest({body:e,options:t},Xu)}getCompilerVersion(e,t){return this.sendOperationRequest({body:e,options:t},Zu)}decodeCallResult(e,t){return this.sendOperationRequest({body:e,options:t},el)}decodeCallResultBytecode(e,t){return this.sendOperationRequest({body:e,options:t},tl)}decodeCalldataBytecode(e,t){return this.sendOperationRequest({body:e,options:t},rl)}decodeCalldataSource(e,t){return this.sendOperationRequest({body:e,options:t},nl)}decodeData(e,t){return this.sendOperationRequest({body:e,options:t},il)}encodeCalldata(e,t){return this.sendOperationRequest({body:e,options:t},al)}getFateAssemblerCode(e,t){return this.sendOperationRequest({body:e,options:t},ol)}validateByteCode(e,t){return this.sendOperationRequest({body:e,options:t},sl)}version(e){return this.sendOperationRequest({options:e},cl)}}const Vu=to(l,!1),$u={path:"/aci",httpMethod:"POST",responses:{200:{bodyMapper:fu},400:{bodyMapper:{type:{name:"Sequence",element:{type:{name:"Composite",className:"CompilerError"}}}},isError:!0}},requestBody:zu,urlParameters:[Uu],headerParameters:[Du,Ou],mediaType:"json",serializer:Vu},Ju={path:"/api",httpMethod:"GET",responses:{200:{bodyMapper:{type:{name:"Dictionary",value:{type:{name:"any"}}}}},400:{bodyMapper:yu,isError:!0}},urlParameters:[Uu],headerParameters:[Ou],serializer:Vu},Wu={path:"/api-version",httpMethod:"GET",responses:{200:{bodyMapper:Iu},500:{bodyMapper:yu,isError:!0}},urlParameters:[Uu],headerParameters:[Ou],serializer:Vu},Xu={path:"/compile",httpMethod:"POST",responses:{200:{bodyMapper:Cu},400:{bodyMapper:{type:{name:"Sequence",element:{type:{name:"Composite",className:"CompilerError"}}}},isError:!0}},requestBody:zu,urlParameters:[Uu],headerParameters:[Du,Ou],mediaType:"json",serializer:Vu},Zu={path:"/compiler-version",httpMethod:"POST",responses:{200:{bodyMapper:Bu},400:{bodyMapper:yu,isError:!0}},requestBody:Fu,urlParameters:[Uu],headerParameters:[Du,Ou],mediaType:"json",serializer:Vu},el={path:"/decode-call-result",httpMethod:"POST",responses:{200:{bodyMapper:{type:{name:"any"}}},400:{bodyMapper:{type:{name:"Sequence",element:{type:{name:"Composite",className:"CompilerError"}}}},isError:!0}},requestBody:Pu,urlParameters:[Uu],headerParameters:[Du,Ou],mediaType:"json",serializer:Vu},tl={path:"/decode-call-result/bytecode",httpMethod:"POST",responses:{200:{bodyMapper:Qu},400:{bodyMapper:{type:{name:"Sequence",element:{type:{name:"Composite",className:"CompilerError"}}}},isError:!0}},requestBody:qu,urlParameters:[Uu],headerParameters:[Du,Ou],mediaType:"json",serializer:Vu},rl={path:"/decode-calldata/bytecode",httpMethod:"POST",responses:{200:{bodyMapper:Nu},400:{bodyMapper:yu,isError:!0}},requestBody:Gu,urlParameters:[Uu],headerParameters:[Du,Ou],mediaType:"json",serializer:Vu},nl={path:"/decode-calldata/source",httpMethod:"POST",responses:{200:{bodyMapper:Nu},400:{bodyMapper:{type:{name:"Sequence",element:{type:{name:"Composite",className:"CompilerError"}}}},isError:!0}},requestBody:Lu,urlParameters:[Uu],headerParameters:[Du,Ou],mediaType:"json",serializer:Vu},il={path:"/decode-data",httpMethod:"POST",responses:{200:{bodyMapper:_u},400:{bodyMapper:{type:{name:"Sequence",element:{type:{name:"Composite",className:"CompilerError"}}}},isError:!0}},requestBody:Hu,urlParameters:[Uu],headerParameters:[Du,Ou],mediaType:"json",serializer:Vu},al={path:"/encode-calldata",httpMethod:"POST",responses:{200:{bodyMapper:Mu},400:{bodyMapper:{type:{name:"Sequence",element:{type:{name:"Composite",className:"CompilerError"}}}},isError:!0}},requestBody:ju,urlParameters:[Uu],headerParameters:[Du,Ou],mediaType:"json",serializer:Vu},ol={path:"/fate-assembler",httpMethod:"POST",responses:{200:{bodyMapper:Ru},400:{bodyMapper:yu,isError:!0}},requestBody:Fu,urlParameters:[Uu],headerParameters:[Du,Ou],mediaType:"json",serializer:Vu},sl={path:"/validate-byte-code",httpMethod:"POST",responses:{200:{},400:{bodyMapper:{type:{name:"Sequence",element:{type:{name:"Composite",className:"CompilerError"}}}},isError:!0}},requestBody:Yu,urlParameters:[Uu],headerParameters:[Du,Ou],mediaType:"json",serializer:Vu},cl={path:"/version",httpMethod:"GET",responses:{200:{bodyMapper:Bu},500:{bodyMapper:yu,isError:!0}},urlParameters:[Uu],headerParameters:[Ou],serializer:Vu};class Al extends Ku{constructor(e){let{ignoreVersion:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(super(e,{allowInsecureConnection:!0,additionalPolicies:[Ra((e=>{let t="";return"reason"in e&&(t+=` ${e.reason}${null!=e.parameter?` in ${e.parameter}`:""}${null!=e.info?` (${JSON.stringify(e.info)})`:""}`),Array.isArray(e)&&(t+=`\n${e.map((e=>`${e.type}:${e.pos.line}:${e.pos.col}: ${e.message}${null!=e.context?`(${e.context})`:""}`)).map((e=>e.trim())).join("\n")}`),t}))]}),!0!==t){const e=this.aPIVersion().then((e=>{let{apiVersion:t}=e;return t}));this.pipeline.addPolicy(ka("compiler","/api-version",e,"6.1.0","7.0.0"))}}}function ul(e){try{return e()}catch(e){return new Proxy({},Object.fromEntries(["get","set","has"].map((t=>[t,()=>{throw e}]))))}}class ll{constructor(){let{nodes:e=[],compilerUrl:t,ignoreVersion:r=!1,...n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Ca(this,"_options",{denomination:qe.AETTOS,amount:Xr}),Ca(this,"pool",new Map),Ca(this,"getNetworkId",WA),Object.assign(this._options,n),e.forEach(((e,t)=>{let{name:r,instance:n}=e;return this.addNode(r,n,0===t)})),null==t?this.compilerApi=ul((()=>{throw new B("You can't use Compiler API. Compiler is not ready!")})):this.setCompilerUrl(t,{ignoreVersion:r})}setCompilerUrl(e){let{ignoreVersion:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.compilerApi=new Al(e,{ignoreVersion:t})}get api(){return this.ensureNodeConnected(),this.pool.get(this.selectedNodeName)}addNode(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(this.pool.has(e))throw new we(e);this.pool.set(e,t),(r||null==this.selectedNodeName)&&this.selectNode(e)}selectNode(e){if(!this.pool.has(e))throw new ve(`Node with name ${e} not in pool`);this.selectedNodeName=e}isNodeConnected(){return null!=this.selectedNodeName}ensureNodeConnected(){if(!this.isNodeConnected())throw new ve("You can't use Node API. Node is not connected or not defined!")}async getNodeInfo(){return this.ensureNodeConnected(),{name:this.selectedNodeName,...await this.api.getNodeInfo()}}async getNodesInPool(){return Promise.all(Array.from(this.pool.entries()).map((async e=>{let[t,r]=e;return{name:t,...await r.getNodeInfo()}})))}addresses(){return[]}async address(){let{onAccount:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._resolveAccount(e).address()}async sign(e){let{onAccount:t,...r}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._resolveAccount(t).sign(e,r)}async signTransaction(e){let{onAccount:t,...r}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._resolveAccount(t).signTransaction(e,{...r,networkId:await this.getNetworkId(r)})}async signMessage(e){let{onAccount:t,...r}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._resolveAccount(t).signMessage(e,r)}async verifyMessage(e,t){let{onAccount:r,...n}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this._resolveAccount(r).verifyMessage(e,t,n)}_resolveAccount(e){switch(null!==e&&typeof e){case"string":throw new F("Address in AccountResolver");case"object":return t=e,["sign","address","signTransaction","signMessage"].some((e=>"function"!=typeof t[e]))?new du({keypair:e}):e;default:throw new z(`Account should be an address (ak-prefixed string), keypair, or instance of AccountBase, got ${String(e)} instead`)}var t}_getOptions(){return{...this._options,onNode:ul((()=>this.api)),onAccount:ul((()=>this._resolveAccount())),onCompiler:ul((()=>this.compilerApi))}}async buildTx(e,t){return li(e,{...this._getOptions(),...t})}}const{_buildTx:dl,...pl}=t,{InvalidTxError:hl,...fl}=e,gl={...fl,...pl,...a,...i,...s,...o,...c,...A};Object.assign(ll.prototype,at(gl,(e=>{let[t,r]=e;return[t,function(){const e=this._getOptions();for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];const a=n[n.length-1];return null!=a&&"object"==typeof a&&a.constructor===Object?n[n.length-1]={...e,...a,...null!=a.onAccount&&{onAccount:this._resolveAccount(a.onAccount)}}:n.push(e),r(...n)}]})));var ml=ll;class yl extends ml{constructor(){super(...arguments),Ca(this,"accounts",{})}_resolveAccount(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.selectedAddress;if("string"==typeof e){const t=e;if(vt(t),null==this.accounts[t])throw new H(e);e=this.accounts[t]}return super._resolveAccount(e)}addresses(){return Object.keys(this.accounts)}async addAccount(e){let{select:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=await e.address();this.accounts[r]=e,!0===t&&this.selectAccount(r)}removeAccount(e){null!=this.accounts[e]?(delete this.accounts[e],this.selectedAddress===e&&delete this.selectedAddress):console.warn(`removeAccount: Account for ${e} not available`)}selectAccount(e){if(vt(e),null==this.accounts[e])throw new H(e);this.selectedAddress=e}}let Il,Cl,El,Bl,wl;!function(e){e.to_waellet="to_waellet",e.to_aepp="to_aepp"}(Il||(Il={})),function(e){e.window="window",e.extension="extension"}(Cl||(Cl={})),function(e){e.subscribe="subscribe",e.unsubscribe="unsubscribe"}(El||(El={})),function(e){e.readyToConnect="connection.announcePresence",e.updateAddress="address.update",e.address="address.get",e.connect="connection.open",e.sign="transaction.sign",e.signMessage="message.sign",e.subscribeAddress="address.subscribe",e.updateNetwork="networkId.update",e.closeConnection="connection.close"}(Bl||(Bl={})),function(e){e.CONNECTED="CONNECTED",e.DISCONNECTED="DISCONNECTED",e.WAITING_FOR_CONNECTION_REQUEST="WAITING_FOR_CONNECTION_REQUEST"}(wl||(wl={}));const vl=[];class Ql extends m{toJSON(){return{code:this.code,message:this.message,data:this.data}}static deserialize(e){const t=vl.find((t=>t.code===e.code));if(null==t)throw new q(`Can't find RpcError with code: ${e.code}`);return new t(e.data)}}class bl extends Ql{constructor(e){super("Invalid transaction"),Ca(this,"code",2),this.data=e,this.name="RpcInvalidTransactionError"}}Ca(bl,"code",2),vl.push(bl);class Nl extends Ql{constructor(e){super("Broadcast failed"),Ca(this,"code",3),this.data=e,this.name="RpcBroadcastError"}}Ca(Nl,"code",3),vl.push(Nl);class Sl extends Ql{constructor(e){super("Operation rejected by user"),Ca(this,"code",4),this.data=e,this.name="RpcRejectedByUserError"}}Ca(Sl,"code",4),vl.push(Sl);class xl extends Ql{constructor(){super("Unsupported Protocol Version"),Ca(this,"code",5),this.name="RpcUnsupportedProtocolError"}}Ca(xl,"code",5),vl.push(xl);class _l extends Ql{constructor(e){super("Wallet deny your connection request"),Ca(this,"code",9),this.data=e,this.name="RpcConnectionDenyError"}}Ca(_l,"code",9),vl.push(_l);class Tl extends Ql{constructor(){super("You are not connected to the wallet"),Ca(this,"code",10),this.name="RpcNotAuthorizeError"}}Ca(Tl,"code",10),vl.push(Tl);class Ml extends Ql{constructor(e){super(`You are not subscribed for account ${e}`),Ca(this,"code",11),this.data=e,this.name="RpcPermissionDenyError"}}Ca(Ml,"code",11),vl.push(Ml);class Rl extends Ql{constructor(){super("The peer failed to execute your request due to unknown error"),Ca(this,"code",12),this.name="RpcInternalError"}}Ca(Rl,"code",12),vl.push(Rl);class kl extends Ql{constructor(){super("Method not found"),Ca(this,"code",-32601),this.name="RpcMethodNotFoundError"}}Ca(kl,"code",-32601),vl.push(kl);var Dl=r(8764).Buffer;class zl extends Au{constructor(e){let{rpcClient:t,address:r,...n}=e;super(n),this._rpcClient=t,this._address=r}async sign(){throw new F("RAW signing using wallet")}async address(){return this._address}async signTransaction(e){let{innerTx:t,networkId:r}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null!=t)throw new F("innerTx option in AccountRpc");return(await this._rpcClient.request(Bl.sign,{onAccount:this._address,tx:e,returnSigned:!0,networkId:r})).signedTransaction}async signMessage(e){let{returnHex:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{signature:r}=await this._rpcClient.request(Bl.signMessage,{onAccount:this._address,message:e});return t?r:Dl.from(r,"hex")}}function Ol(e,t,r){if(!t.has(e))throw new TypeError("attempted to "+r+" private field on non-instance");return t.get(e)}function Ul(e,t){return function(e,t){return t.get?t.get.call(e):t.value}(e,Ol(e,t,"get"))}function Fl(e,t,r){return function(e,t,r){if(t.set)t.set.call(e,r);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=r}}(e,Ol(e,t,"set"),r),r}function Pl(e,t){Gl(e,t),t.add(e)}function ql(e,t,r){Gl(e,t),t.set(e,r)}function Gl(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ll(e,t,r){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return r}var Hl=new WeakMap,jl=new WeakMap,Yl=new WeakMap,Kl=new WeakSet,Vl=new WeakSet,$l=new WeakSet,Jl=new WeakSet;class Wl{constructor(e,t,r){Pl(this,Jl),Pl(this,$l),Pl(this,Vl),Pl(this,Kl),ql(this,Hl,{writable:!0,value:new Map}),ql(this,jl,{writable:!0,value:0}),ql(this,Yl,{writable:!0,value:void 0}),this.connection=e,Fl(this,Yl,r),e.connect(Ll(this,Kl,Xl).bind(this),t)}async request(e,t){return Ll(this,Vl,Zl).call(this,Fl(this,jl,Ul(this,jl)+1),e,t),new Promise(((e,t)=>{Ul(this,Hl).set(Ul(this,jl),{resolve:e,reject:t})}))}notify(e,t){Ll(this,Vl,Zl).call(this,void 0,e,t)}}async function Xl(e,t){if("2.0"!==(null==e?void 0:e.jsonrpc))throw new V(JSON.stringify(e));if("result"in e||"error"in e)return void Ll(this,Jl,td).call(this,e);const r=e;let n,i;try{if(!(r.method in Ul(this,Yl)))throw new kl;const e=r.method;n=await Ul(this,Yl)[e](r.params,t)}catch(e){i=e instanceof Ql?e:new Rl}null!=r.id&&Ll(this,$l,ed).call(this,r.id,r.method,n,i)}function Zl(e,t,r){this.connection.sendMessage({jsonrpc:"2.0",...null!=e?{id:e}:{},method:t,...null!=r?{params:r}:{}})}function ed(e,t,r,n){this.connection.sendMessage({jsonrpc:"2.0",id:e,method:t,...null!=n?{error:n}:{result:r}})}function td(e){let{id:t,error:r,result:n}=e;const i=Ul(this,Hl).get(t);if(null==i)throw new $(t);null!=r?i.reject(Ql.deserialize(r)):i.resolve(n),Ul(this,Hl).delete(t)}class rd extends ml{constructor(e){let{name:t,onAddressChange:r=(()=>{}),onDisconnect:n=(()=>{}),onNetworkChange:i=(()=>{}),...a}=e;super(a),this.onAddressChange=r,this.onDisconnect=n,this.onNetworkChange=i,this.name=t}_resolveAccount(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.addresses()[0];if("string"==typeof e){var t;const r=e;if(vt(r),!f()(t=this.addresses()).call(t,r))throw new J(r);e=new zl({rpcClient:this.rpcClient,address:r})}return null==e&&this._ensureAccountAccess(),super._resolveAccount(e)}addresses(){if(null==this._accounts)return[];const e=Object.keys(this._accounts.current)[0];return[...null!=e?[e]:[],...Object.keys(this._accounts.connected)]}async connectToWallet(e){let t,{connectNode:r=!1,name:n="wallet-node",select:i=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null!=this.rpcClient)throw new Ue("You are already connected to wallet");const a=new Wl(e,(()=>{delete this.rpcClient,delete this._accounts,this.onDisconnect(t)}),{[Bl.updateAddress]:e=>{this._accounts=e,this.onAddressChange(e)},[Bl.updateNetwork]:e=>{const{node:t}=e;null!=t&&this.addNode(t.name,new su(t.url),!0),this.onNetworkChange(e)},[Bl.closeConnection]:e=>{t=e,a.connection.disconnect()},[Bl.readyToConnect]:()=>{}}),{node:o,...s}=await a.request(Bl.connect,{name:this.name,version:1,connectNode:r});if(r){if(null==o)throw new Pe("Missing URLs of the Node");this.addNode(n,new su(o.url),i)}return this.rpcClient=a,s}disconnectWallet(){this._ensureConnected(),this.rpcClient.notify(Bl.closeConnection,{reason:"bye"}),this.rpcClient.connection.disconnect()}async askAddresses(){return this._ensureAccountAccess(),this.rpcClient.request(Bl.address,void 0)}async subscribeAddress(e,t){this._ensureConnected();const r=await this.rpcClient.request(Bl.subscribeAddress,{type:e,value:t});return this._accounts=r.address,r}_ensureConnected(){if(null==this.rpcClient)throw new Fe("You are not connected to Wallet")}_ensureAccountAccess(){if(this._ensureConnected(),0===this.addresses().length)throw new X}}var nd=r(4400);const id=r.n(nd)()({storeAsString:!0}),ad=e=>{if("object"==typeof e&&null!==e&&e.constructor===Object)return at(e,(e=>{let[t,r]=e;return[t,ad(r)]}));if(Array.isArray(e))return e.map((e=>ad(e)));if("string"==typeof e&&new(p())(e).toString(10)===e){const t=new(p())(e);return t.toJSON=()=>t.toString(10),t}return e};var od={stringify:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return id.stringify(ad(t[0]),...t.slice(1))},parse:id.parse};class sd extends yl{constructor(e){let{name:t,id:r,type:n,onConnection:i,onSubscription:a,onSign:o,onDisconnect:s,onAskAccounts:c,onMessageSign:A,...u}=e;super(u),this.onConnection=i,this.onSubscription=a,this.onSign=o,this.onDisconnect=s,this.onAskAccounts=c,this.onMessageSign=A,this._clients=new Map,this.name=t,this.id=r,this._type=n}_pushAccountsToApps(){Array.from(this._clients.keys()).filter((e=>this._isRpcClientSubscribed(e))).map((e=>this._getClient(e).rpc)).forEach((e=>e.notify(Bl.updateAddress,this.getAccounts())))}selectAccount(e){super.selectAccount(e),this._pushAccountsToApps()}async addAccount(e,t){await super.addAccount(e,t),this._pushAccountsToApps()}_getNode(){return this.ensureNodeConnected(),{node:{url:this.api.url,name:this.selectedNodeName}}}async selectNode(e){super.selectNode(e);const t=await this.getNetworkId();Array.from(this._clients.keys()).filter((e=>this._isRpcClientConnected(e))).map((e=>this._getClient(e))).forEach((e=>{e.rpc.notify(Bl.updateNetwork,{networkId:t,...e.connectNode&&this._getNode()})}))}_getClient(e){const t=this._clients.get(e);if(null==t)throw new W(e);return t}_isRpcClientSubscribed(e){return this._isRpcClientConnected(e)&&0!==this._getClient(e).addressSubscription.size}_isRpcClientConnected(e){return wl.CONNECTED===this._getClient(e).status&&this._getClient(e).rpc.connection.isConnected()}_disconnectRpcClient(e){const t=this._getClient(e);t.rpc.connection.disconnect(),t.status=wl.DISCONNECTED,t.addressSubscription=new Set}removeRpcClient(e){this._disconnectRpcClient(e),this._clients.delete(e)}addRpcClient(e){const t=ei();let r;const n={id:t,status:wl.WAITING_FOR_CONNECTION_REQUEST,addressSubscription:new Set,connectNode:!1,rpc:new Wl(e,(()=>{this._clients.delete(t),this.onDisconnect(t,r)}),{[Bl.closeConnection]:e=>{r=e,this._disconnectRpcClient(t)},[Bl.connect]:async(e,r)=>{let{name:i,version:a,icons:o,connectNode:s}=e;if(1!==a)throw new xl;return await this.onConnection(t,{name:i,icons:o,connectNode:s},r),n.status=wl.CONNECTED,n.connectNode=s,{...await this.getWalletInfo(),...s&&this._getNode()}},[Bl.subscribeAddress]:async(e,r)=>{let{type:i,value:a}=e;if(!this._isRpcClientConnected(t))throw new Tl;switch(await this.onSubscription(t,{type:i,value:a},r),i){case El.subscribe:n.addressSubscription.add(a);break;case El.unsubscribe:n.addressSubscription.delete(a);break;default:throw new q(`Unknown subscription type: ${i}`)}return{subscription:Array.from(n.addressSubscription),address:this.getAccounts()}},[Bl.address]:async(e,r)=>{if(!this._isRpcClientSubscribed(t))throw new Tl;return await this.onAskAccounts(t,e,r),this.addresses()},[Bl.sign]:async(e,r)=>{var n,i,a,o;let{tx:s,onAccount:c,returnSigned:A}=e;if(!this._isRpcClientConnected(t))throw new Tl;if(null!==(n=c)&&void 0!==n||(c=await this.address()),!f()(i=this.addresses()).call(i,c))throw new Ml(c);const u=await this.onSign(t,{tx:s,returnSigned:A,onAccount:c},r);if(c=null!==(a=null==u?void 0:u.onAccount)&&void 0!==a?a:c,s=null!==(o=null==u?void 0:u.tx)&&void 0!==o?o:s,A)return{signedTransaction:await this.signTransaction(s,{onAccount:c})};try{return od.parse(od.stringify({transactionHash:await this.send(s,{onAccount:c,verify:!1})}))}catch(e){const t=await bn(s,this.api);if(t.length>0)throw new bl(t);throw new Nl(e.message)}},[Bl.signMessage]:async(e,r)=>{var n,i,a;let{message:o,onAccount:s}=e;if(!this._isRpcClientConnected(t))throw new Tl;if(null!==(n=s)&&void 0!==n||(s=await this.address()),!f()(i=this.addresses()).call(i,s))throw new Ml(s);const c=await this.onMessageSign(t,{message:o,onAccount:s},r);return s=null!==(a=null==c?void 0:c.onAccount)&&void 0!==a?a:s,{signature:await this.signMessage(o,{onAccount:s,returnHex:!0})}}})};return this._clients.set(t,n),t}async shareWalletInfo(e){this._getClient(e).rpc.notify(Bl.readyToConnect,await this.getWalletInfo())}async getWalletInfo(){return{id:this.id,name:this.name,networkId:await this.getNetworkId(),origin:window.location.origin,type:this._type}}getAccounts(){return{current:null!=this.selectedAddress?{[this.selectedAddress]:{}}:{},connected:this.addresses().filter((e=>e!==this.selectedAddress)).reduce(((e,t)=>({...e,[t]:{}})),{})}}}var cd=r(5840),Ad=r(7187);const ud=new WeakMap,ld=new WeakMap,dd=new WeakMap,pd=new WeakMap,hd=new WeakMap,fd=new WeakMap,gd=new WeakMap,md=new WeakMap,yd=new WeakMap,Id=new WeakMap,Cd=new WeakMap,Ed=new WeakMap,Bd=new WeakMap,wd=new WeakMap,vd=new WeakMap,Qd=new WeakMap;function bd(e){for(var t,r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];const[a,...o]=n;null===(t=fd.get(e))||void 0===t||t.emit(a,...o)}function Nd(e,t){var r;if(null==t)throw new ne;pd.set(e,t),null!=(null==t||null===(r=t.handler)||void 0===r?void 0:r.enter)&&t.handler.enter(e),Td(e)}function Sd(e,t){t!==ld.get(e)&&(ld.set(e,t),bd(e,"statusChanged",t))}function xd(e,t){dd.set(e,t),bd(e,"stateChanged",t)}function _d(e,t){var r,n,i;null!==(r=null===(n=ud.get(e))||void 0===n?void 0:n.debug)&&void 0!==r&&r&&console.log("Send message: ",t),null===(i=hd.get(e))||void 0===i||i.send(od.stringify(t))}async function Td(e){var t;const r=Id.get(e),n=null!==(t=yd.get(e))&&void 0!==t?t:[];if(Boolean(r)||0===n.length)return;const i=pd.get(e);if(null==i)return;const a=n.findIndex((t=>t.guard(e,i)));if(-1===a)return;yd.set(e,n.filter(((e,t)=>a!==t))),Id.set(e,!0);const o=await Promise.resolve(n[a].action(e,i));Id.set(e,!1),Nd(e,o)}function Md(e,t,r){var n;const i=null!==(n=yd.get(e))&&void 0!==n?n:[];yd.set(e,[...i,{guard:t,action:r}]),Td(e)}async function Rd(e,t){const r=pd.get(e);if(null==r)throw new ne;const{handler:n,state:i}=r;Nd(e,await Promise.resolve(n(e,t,i)))}function kd(e){var t;null===(t=hd.get(e))||void 0===t||t.close();const r=wd.get(e),n=vd.get(e);null!=r&&clearTimeout(r),null!=n&&clearTimeout(n)}function Dd(e){const t=wd.get(e),r=vd.get(e);null!=t&&clearTimeout(t),null!=r&&clearTimeout(r),wd.set(e,setTimeout((()=>{_d(e,{jsonrpc:"2.0",method:"channels.system",params:{action:"ping"}}),vd.set(e,setTimeout((()=>{kd(e),bd(e,"error",new te)}),5e3))}),1e4))}async function zd(e,t,r){return new Promise(((n,i)=>{var a,o,s;const c=null!==(a=Cd.get(e))&&void 0!==a?a:0,A=null!==(o=Cd.set(e,c+1).get(e))&&void 0!==o?o:1;null===(s=Bd.get(e))||void 0===s||s.set(A,(e=>{if(null!=e.error){var t;const[{message:r}={message:""}]=null!==(t=e.error.data)&&void 0!==t?t:[];return i(new Z(e.error.message+r))}return n(e.result)})),_d(e,{jsonrpc:"2.0",method:t,id:A,params:r})}))}async function Od(e,t,r,n){let{url:i,...a}=n;ud.set(e,{url:i,...a}),pd.set(e,{handler:t}),fd.set(e,new Ad.EventEmitter),Cd.set(e,0),Bd.set(e,new Map),gd.set(e,[]);const o=new URL(i);Object.entries(a).filter((e=>{var t;let[r]=e;return!f()(t=["sign","debug"]).call(t,r)})).forEach((e=>{let[t,r]=e;return o.searchParams.set(t.replace(/[A-Z]/g,(e=>`_${e.toLowerCase()}`)),r)})),o.searchParams.set("protocol","json-rpc"),Sd(e,"connecting");const s=new cd.w3cwebsocket(o.toString());await new Promise(((t,n)=>{Object.assign(s,{onerror:n,onopen:async()=>{if(t(),Sd(e,"connected"),null!=a.reconnectTx){Nd(e,{handler:r});const t=(await zd(e,"channels.get.offchain_state",{})).signed_tx;xd(e,t)}Dd(e)},onclose:()=>{Sd(e,"disconnected");const t=wd.get(e),r=vd.get(e);null!=t&&clearTimeout(t),null!=r&&clearTimeout(r)},onmessage:t=>{let{data:r}=t;return function(e,t){var r,n,i;const a=od.parse(t);if(null!==(r=null===(n=ud.get(e))||void 0===n?void 0:n.debug)&&void 0!==r&&r&&console.log("Receive message: ",a),null==a.id)"channels.message"!==a.method?"channels.system.pong"!==a.method?(null===(i=gd.get(e))||void 0===i||i.push(a),async function(e){var t,r;if(null!==(t=md.get(e))&&void 0!==t&&t)return;const n=null!==(r=gd.get(e))&&void 0!==r?r:[];if(0!==n.length){for(md.set(e,!0);n.length>0;){var i;const t=null!==(i=n.shift())&&void 0!==i?i:"";try{await Rd(e,t)}catch(e){console.error("Error handling incoming message:"),console.error(t),console.error(e)}}md.set(e,!1)}}(e)):a.params.channel_id!==Ed.get(e)&&null!=Ed.get(e)||Dd(e):bd(e,"message",a.params.data.message);else{var o;const t=null===(o=Bd.get(e))||void 0===o?void 0:o.get(a.id);try{null==t||t(a)}finally{var s;null===(s=Bd.get(e))||void 0===s||s.delete(a.id)}}}(e,r)}})})),hd.set(e,s)}async function Ud(e,t){const{signatures:r,encodedTx:n}=Cn(e,Xt.SignedTx).tx,i=await t(Qt(n.rlpEncoded,lt.Transaction));if("string"==typeof i){const{tx:e}=Cn(i,Xt.SignedTx);return In({signatures:r.concat(e.signatures),encodedTx:e.encodedTx.rlpEncoded},Xt.SignedTx).tx}return i}function Fd(e,t,r){var n;return null==r||null===(n=r.reject)||void 0===n||n.call(r,Object.assign(new re(`Unexpected message received:\n\n${JSON.stringify(t)}`),{wsMessage:t})),{handler:Kd}}function Pd(e,t){if("channels.info"===t.method){var r;const n=t.params.data.event;return f()(r=["channel_accept","funding_created"]).call(r,n)?(Sd(e,{channel_accept:"accepted",funding_created:"halfSigned"}[n]),{handler:Gd}):"channel_reestablished"===t.params.data.event?{handler:jd}:"fsm_up"===t.params.data.event?(Qd.set(e,t.params.data.fsm_id),{handler:Pd}):{handler:Pd}}var n;if("channels.error"===t.method)return bd(e,"error",new ee(null==t||null===(n=t.payload)||void 0===n?void 0:n.message)),{handler:dp}}async function qd(e,t,r){return"channels.info"===t.method&&"fsm_up"===t.params.data.event?(Qd.set(e,t.params.data.fsm_id),xd(e,(await zd(e,"channels.get.offchain_state",{})).signed_tx),{handler:Kd}):Fd(0,t,r)}async function Gd(e,t){const r=ud.get(e);if(null!=r){const n={initiator:"initiator_sign",responder:"responder_sign"}[r.role];if(t.method===`channels.sign.${n}`){if(null!=t.params.data.tx){const i=await r.sign(n,t.params.data.tx);return _d(e,{jsonrpc:"2.0",method:`channels.${n}`,params:{tx:i}}),{handler:Ld}}const i=await Ud(t.params.data.signed_tx,(async e=>r.sign(n,e)));return _d(e,{jsonrpc:"2.0",method:`channels.${n}`,params:{signed_tx:i}}),{handler:Ld}}}}function Ld(e,t){const r=ud.get(e);if(null!=r){if("channels.on_chain_tx"===t.method){if("funding_signed"===t.params.data.info&&"initiator"===r.role)return{handler:Hd};if("funding_created"===t.params.data.info&&"responder"===r.role)return{handler:Hd}}if("channels.info"===t.method&&"funding_signed"===t.params.data.event&&"initiator"===r.role)return Ed.set(e,t.params.channel_id),Sd(e,"signed"),{handler:Ld}}}function Hd(e,t){if("channels.info"===t.method){const e={funding_created:Hd,own_funding_locked:Hd,funding_locked:jd}[t.params.data.event];if(null!=e)return{handler:e}}if("channels.on_chain_tx"===t.method)return bd(e,"onChainTx",t.params.data.tx,{info:t.params.data.info,type:t.params.data.type}),{handler:Hd}}function jd(e,t){if("channels.info"===t.method&&"open"===t.params.data.event)return Ed.set(e,t.params.channel_id),{handler:Yd}}function Yd(e,t){if("channels.update"===t.method)return xd(e,t.params.data.state),{handler:Kd}}async function Kd(e,t,r){switch(t.method){case"channels.info":switch(t.params.data.event){case"update":case"withdraw_created":case"deposit_created":return{handler:Jd};case"own_withdraw_locked":case"withdraw_locked":case"own_deposit_locked":case"deposit_locked":case"peer_disconnected":case"channel_reestablished":case"open":return bd(e,t.params.data.event),{handler:Kd};case"fsm_up":return Qd.set(e,t.params.data.fsm_id),{handler:Kd};case"timeout":case"close_mutual":case"shutdown":return{handler:Kd};case"closing":return Sd(e,"closing"),{handler:Kd};case"closed_confirmed":return Sd(e,"closed"),{handler:dp};case"died":return Sd(e,"died"),{handler:dp}}break;case"channels.on_chain_tx":return bd(e,"onChainTx",t.params.data.tx,{info:t.params.data.info,type:t.params.data.type}),{handler:Kd};case"channels.leave":return{handler:Kd};case"channels.update":return xd(e,t.params.data.state),{handler:Kd};case"channels.sign.shutdown_sign_ack":return Jd(e,t,r)}}async function Vd(e,t,r){if("channels.sign.update"===t.method){const{sign:n}=r;if(null!=t.params.data.tx)return _d(e,{jsonrpc:"2.0",method:"channels.update",params:{tx:await n(t.params.data.tx,{updates:t.params.data.updates})}}),{handler:$d,state:r};const i=await Ud(t.params.data.signed_tx,(async e=>n(e,{updates:t.params.data.updates})));if("string"==typeof i)return _d(e,{jsonrpc:"2.0",method:"channels.update",params:{signed_tx:i}}),{handler:$d,state:r};if("number"==typeof i)return _d(e,{jsonrpc:"2.0",method:"channels.update",params:{error:i}}),{handler:Vd,state:r}}if("channels.error"===t.method)return r.reject(new ee(t.data.message)),{handler:Kd};if(null!=t.error){var n;const{data:e}=null!==(n=t.error)&&void 0!==n?n:{data:[]};return null!=e.find((e=>1001===e.code))?r.reject(new T("Insufficient balance")):null!=e.find((e=>1002===e.code))?r.reject(new x("Amount cannot be negative")):r.reject(new ee(t.error.message)),{handler:Kd}}return"channels.conflict"===t.method?(r.resolve({accepted:!1,errorCode:t.params.data.error_code,errorMessage:t.params.data.error_msg}),{handler:Kd}):"channels.info"===t.method&&"aborted_update"===t.params.data.event?(r.resolve({accepted:!1}),{handler:Kd}):Fd(0,t,r)}function $d(e,t,r){return"channels.update"===t.method?(xd(e,t.params.data.state),r.resolve({accepted:!0,signedTx:t.params.data.state}),{handler:Kd}):"channels.conflict"===t.method?(r.resolve({accepted:!1,errorCode:t.params.data.error_code,errorMessage:t.params.data.error_msg}),{handler:Kd}):"channels.info"===t.method&&"aborted_update"===t.params.data.event?(r.resolve({accepted:!1}),{handler:Kd}):null!=t.error?(r.reject(new ee(t.error.message)),{handler:Kd}):Fd(0,t,r)}async function Jd(e,t,r){var n;const[,i]=null!==(n=t.method.match(/^channels\.sign\.([^.]+)$/))&&void 0!==n?n:[],a=ud.get(e);if(null!=i&&null!=a){if(null!=t.params.data.tx){const r=await a.sign(i,t.params.data.tx,{updates:t.params.data.updates});if(null!=r)return _d(e,{jsonrpc:"2.0",method:`channels.${i}`,params:{tx:r}}),{handler:Kd}}else{const n=await Ud(t.params.data.signed_tx,(async e=>a.sign(i,e,{updates:t.params.data.updates})));if("string"==typeof n)return _d(e,{jsonrpc:"2.0",method:`channels.${i}`,params:{signed_tx:n}}),{handler:Kd};if("number"==typeof n)return _d(e,{jsonrpc:"2.0",method:`channels.${i}`,params:{error:n}}),{handler:Wd,state:r}}return _d(e,{jsonrpc:"2.0",method:"channels.update.new",params:{from:kt().publicKey,to:kt().publicKey,amount:1}}),{handler:Wd,state:r}}return Fd(0,t,r)}function Wd(e,t,r){return null!=t.error?{handler:Wd,state:r}:"channels.conflict"===t.method?{handler:Kd}:Fd(0,t,r)}async function Xd(e,t,r){return"channels.sign.shutdown_sign"===t.method?null!=t.params.data.tx?(_d(e,{jsonrpc:"2.0",method:"channels.shutdown_sign",params:{tx:await r.sign(t.params.data.tx)}}),{handler:Zd,state:r}):(_d(e,{jsonrpc:"2.0",method:"channels.shutdown_sign",params:{signed_tx:await Ud(t.params.data.signed_tx,(async e=>r.sign(e)))}}),{handler:Zd,state:r}):Fd(0,t,r)}function Zd(e,t,r){return"channels.on_chain_tx"===t.method?{handler:dp,state:r}:Fd(0,t,r)}function ep(e,t,r){return"channels.leave"===t.method?(r.resolve({channelId:t.params.channel_id,signedTx:t.params.data.state}),kd(e),{handler:dp}):"channels.error"===t.method?(r.reject(new ee(t.data.message)),{handler:Kd}):Fd(0,t,r)}async function tp(e,t,r){if("channels.sign.withdraw_tx"===t.method){const{sign:n}=r;if(null!=t.params.data.tx)return _d(e,{jsonrpc:"2.0",method:"channels.withdraw_tx",params:{tx:await n(t.params.data.tx,{updates:t.params.data.updates})}}),{handler:rp,state:r};const i=await Ud(t.params.data.signed_tx,(async e=>n(e,{updates:t.params.data.updates})));if("string"==typeof i)return _d(e,{jsonrpc:"2.0",method:"channels.withdraw_tx",params:{signed_tx:i}}),{handler:rp,state:r};if("number"==typeof i)return _d(e,{jsonrpc:"2.0",method:"channels.withdraw_tx",params:{error:i}}),{handler:rp,state:r}}return Fd(0,t,r)}function rp(e,t,r){var n,i;if("channels.on_chain_tx"===t.method)return null===(n=r.onOnChainTx)||void 0===n||n.call(r,t.params.data.tx),{handler:rp,state:r};if("channels.info"===t.method&&f()(i=["own_withdraw_locked","withdraw_locked"]).call(i,t.params.data.event)){var a;const e={own_withdraw_locked:r.onOwnWithdrawLocked,withdraw_locked:r.onWithdrawLocked};return null===(a=e[t.params.data.event])||void 0===a||a.call(e),{handler:rp,state:r}}return"channels.update"===t.method?(xd(e,t.params.data.state),r.resolve({accepted:!0,signedTx:t.params.data.state}),{handler:Kd}):"channels.conflict"===t.method?(r.resolve({accepted:!1,errorCode:t.params.data.error_code,errorMessage:t.params.data.error_msg}),{handler:Kd}):"channels.info"===t.method&&"aborted_update"===t.params.data.event?(r.resolve({accepted:!1}),{handler:Kd}):Fd(0,t,r)}async function np(e,t,r){if("channels.sign.deposit_tx"===t.method){const{sign:n}=r;if(null!=t.params.data.tx)return _d(e,{jsonrpc:"2.0",method:"channels.deposit_tx",params:{tx:await n(t.params.data.tx,{updates:t.params.data.updates})}}),{handler:ip,state:r};const i=await Ud(t.params.data.signed_tx,(async e=>n(e,{updates:t.params.data.updates})));if("string"==typeof i)return _d(e,{jsonrpc:"2.0",method:"channels.deposit_tx",params:{signed_tx:i}}),{handler:ip,state:r};if("number"==typeof i)return _d(e,{jsonrpc:"2.0",method:"channels.deposit_tx",params:{error:i}}),{handler:ip,state:r}}return Fd(0,t,r)}function ip(e,t,r){var n,i;if("channels.on_chain_tx"===t.method)return null===(n=r.onOnChainTx)||void 0===n||n.call(r,t.params.data.tx),{handler:ip,state:r};if("channels.info"===t.method&&f()(i=["own_deposit_locked","deposit_locked"]).call(i,t.params.data.event)){var a;const e={own_deposit_locked:r.onOwnDepositLocked,deposit_locked:r.onDepositLocked};return null===(a=e[t.params.data.event])||void 0===a||a.call(e),{handler:ip,state:r}}return"channels.update"===t.method?(xd(e,t.params.data.state),r.resolve({accepted:!0,signedTx:t.params.data.state}),{handler:Kd}):"channels.conflict"===t.method?(r.resolve({accepted:!1,errorCode:t.params.data.error_code,errorMessage:t.params.data.error_msg}),{handler:Kd}):"channels.info"===t.method&&"aborted_update"===t.params.data.event?(r.resolve({accepted:!1}),{handler:Kd}):Fd(0,t,r)}async function ap(e,t,r){if("channels.sign.update"===t.method){if(null!=t.params.data.tx)return _d(e,{jsonrpc:"2.0",method:"channels.update",params:{tx:await r.sign(t.params.data.tx)}}),{handler:op,state:r};const n=await Ud(t.params.data.signed_tx,(async e=>r.sign(e)));if("string"==typeof n)return _d(e,{jsonrpc:"2.0",method:"channels.update",params:{signed_tx:n}}),{handler:op,state:r};if("number"==typeof n)return _d(e,{jsonrpc:"2.0",method:"channels.update",params:{error:n}}),{handler:op,state:r}}return Fd(0,t,r)}function op(e,t,r){const n=ud.get(e);if("channels.update"===t.method){const{round:i}=Cn(t.params.data.state,Xt.SignedTx).tx.encodedTx.tx;if(null!=(null==n?void 0:n.role)){let a=null;if("initiator"===n.role&&(a="initiatorId"),"responder"===n.role&&(a="responderId"),null!=a){const o=null==n?void 0:n[a];return xd(e,t.params.data.state),r.resolve({accepted:!0,address:Mt(o,i),signedTx:t.params.data.state}),{handler:Kd}}}}return"channels.conflict"===t.method?(r.resolve({accepted:!1,errorCode:t.params.data.error_code,errorMessage:t.params.data.error_msg}),{handler:Kd}):"channels.info"===t.method&&"aborted_update"===t.params.data.event?(r.resolve({accepted:!1}),{handler:Kd}):Fd(0,t,r)}async function sp(e,t,r){if("channels.sign.update"===t.method){if(null!=t.params.data.tx)return _d(e,{jsonrpc:"2.0",method:"channels.update",params:{tx:await r.sign(t.params.data.tx,{updates:t.params.data.updates})}}),{handler:up,state:r};const n=await Ud(t.params.data.signed_tx,(async e=>r.sign(e,{updates:t.params.data.updates})));if("string"==typeof n)return _d(e,{jsonrpc:"2.0",method:"channels.update",params:{signed_tx:n}}),{handler:up,state:r};if("number"==typeof n)return _d(e,{jsonrpc:"2.0",method:"channels.update",params:{error:n}}),{handler:up,state:r}}return Fd(0,t,r)}async function cp(e,t,r){return"channels.sign.force_progress_tx"===t.method?(_d(e,{jsonrpc:"2.0",method:"channels.force_progress_sign",params:{signed_tx:await Ud(t.params.data.signed_tx,(async e=>r.sign(e,{updates:t.params.data.updates})))}}),{handler:Ap,state:r}):Fd(0,t,r)}function Ap(e,t,r){var n;return"channels.on_chain_tx"===t.method&&(null===(n=r.onOnChainTx)||void 0===n||n.call(r,t.params.data.tx),bd(e,"onChainTx",t.params.data.tx,{info:t.params.data.info,type:t.params.data.type}),r.resolve({accepted:!0,tx:t.params.data.tx})),Fd(0,t,r)}function up(e,t,r){return"channels.update"===t.method?(xd(e,t.params.data.state),r.resolve({accepted:!0,signedTx:t.params.data.state}),{handler:Kd}):"channels.conflict"===t.method?(r.resolve({accepted:!1,errorCode:t.params.data.error_code,errorMessage:t.params.data.error_msg}),{handler:Kd}):"channels.info"===t.method&&"aborted_update"===t.params.data.event?(r.resolve({accepted:!1}),{handler:Kd}):Fd(0,t,r)}function lp(e,t,r){return"channels.calls_pruned.reply"===t.method?(r.resolve(),{handler:Kd}):(r.reject(new re("Unexpected message received")),{handler:dp})}function dp(e,t,r){return null==r?{handler:dp}:"closing"===t.params.data.event?{handler:dp,state:r}:"channel_closed"===t.params.data.info?(r.closeTx=t.params.data.tx,{handler:dp,state:r}):"closed_confirmed"===t.params.data.event?(r.resolve(r.closeTx),{handler:dp}):{handler:dp,state:r}}function pp(e){return Object.entries(e).reduce(((e,t)=>{let[r,n]=t;return{...e,[(i=r,i.replace(/_./g,(e=>e[1].toUpperCase())))]:n};var i}),{})}Kd.enter=e=>{Sd(e,"open")};class hp{static async initialize(e){const t=new hp;return await Od(t,null!=e.existingFsmId?qd:Pd,Kd,e),t}on(e,t){const r=fd.get(this);if(null==r)throw new ne;r.on(e,t)}off(e,t){const r=fd.get(this);if(null==r)throw new ne;r.removeListener(e,t)}disconnect(){return kd(this)}status(){const e=ld.get(this);if(null==e)throw new ne;return e}async state(){return pp(await zd(this,"channels.get.offchain_state",{}))}round(){const e=dd.get(this);if(null==e)return null;const{txType:t,tx:r}=Cn(e,Xt.SignedTx).tx.encodedTx;switch(t){case Xt.ChannelCreateTx:return 1;case Xt.ChannelOffChainTx:case Xt.ChannelWithdrawTx:case Xt.ChannelDepositTx:return r.round;default:return null}}id(){const e=Ed.get(this);if(null==e)throw new E("Channel is not initialized");return e}fsmId(){const e=Qd.get(this);if(null==e)throw new E("Channel is not initialized");return e}async update(e,t,r,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];return new Promise(((a,o)=>{Md(this,((e,t)=>(null==t?void 0:t.handler)===Kd),(s=>(_d(s,{jsonrpc:"2.0",method:"channels.update.new",params:{from:e,to:t,amount:r,meta:i}}),{handler:Vd,state:{resolve:a,reject:o,sign:n}})))}))}async poi(e){let{accounts:t,contracts:r}=e;return(await zd(this,"channels.get.poi",{accounts:t,contracts:r})).poi}async balances(e){return Object.fromEntries((await zd(this,"channels.get.balances",{accounts:e})).map((e=>[e.account,e.balance])))}async leave(){return new Promise(((e,t)=>{Md(this,((e,t)=>(null==t?void 0:t.handler)===Kd),(r=>(_d(r,{jsonrpc:"2.0",method:"channels.leave",params:{}}),{handler:ep,state:{resolve:e,reject:t}})))}))}async shutdown(e){return new Promise(((t,r)=>{Md(this,((e,t)=>(null==t?void 0:t.handler)===Kd),(n=>(_d(n,{jsonrpc:"2.0",method:"channels.shutdown",params:{}}),{handler:Xd,state:{sign:e,resolve:t,reject:r}})))}))}async withdraw(e,t){let{onOnChainTx:r,onOwnWithdrawLocked:n,onWithdrawLocked:i}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return new Promise(((a,o)=>{Md(this,((e,t)=>(null==t?void 0:t.handler)===Kd),(s=>(_d(s,{jsonrpc:"2.0",method:"channels.withdraw",params:{amount:e}}),{handler:tp,state:{sign:t,resolve:a,reject:o,onOnChainTx:r,onOwnWithdrawLocked:n,onWithdrawLocked:i}})))}))}async deposit(e,t){let{onOnChainTx:r,onOwnDepositLocked:n,onDepositLocked:i}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return new Promise(((a,o)=>{Md(this,((e,t)=>(null==t?void 0:t.handler)===Kd),(s=>(_d(s,{jsonrpc:"2.0",method:"channels.deposit",params:{amount:e}}),{handler:np,state:{sign:t,resolve:a,reject:o,onOnChainTx:r,onOwnDepositLocked:n,onDepositLocked:i}})))}))}async createContract(e,t){let{code:r,callData:n,deposit:i,vmVersion:a,abiVersion:o}=e;return new Promise(((e,s)=>{Md(this,((e,t)=>(null==t?void 0:t.handler)===Kd),(c=>(_d(c,{jsonrpc:"2.0",method:"channels.update.new_contract",params:{code:r,call_data:n,deposit:i,vm_version:a,abi_version:o}}),{handler:ap,state:{sign:t,resolve:e,reject:s}})))}))}async callContract(e,t){let{amount:r,callData:n,contract:i,abiVersion:a}=e;return new Promise(((e,o)=>{Md(this,((e,t)=>(null==t?void 0:t.handler)===Kd),(s=>(_d(s,{jsonrpc:"2.0",method:"channels.update.call_contract",params:{amount:r,call_data:n,contract_id:i,abi_version:a}}),{handler:sp,state:{resolve:e,reject:o,sign:t}})))}))}async forceProgress(e,t){let{amount:r,callData:n,contract:i,abiVersion:a,gasLimit:o=1e6,gasPrice:s=jt}=e,{onOnChainTx:c}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return new Promise(((e,A)=>{Md(this,((e,t)=>(null==t?void 0:t.handler)===Kd),(u=>(_d(u,{jsonrpc:"2.0",method:"channels.force_progress",params:{amount:r,call_data:n,contract_id:i,abi_version:a,gas_price:s,gas:o}}),{handler:cp,state:{resolve:e,reject:A,sign:t,onOnChainTx:c}})))}))}async callContractStatic(e){let{amount:t,callData:r,contract:n,abiVersion:i}=e;return pp(await zd(this,"channels.dry_run.call_contract",{amount:t,call_data:r,contract_id:n,abi_version:i}))}async getContractCall(e){let{caller:t,contract:r,round:n}=e;return pp(await zd(this,"channels.get.contract_call",{caller_id:t,contract_id:r,round:n}))}async getContractState(e){const t=await zd(this,"channels.get.contract",{pubkey:e});return pp({...t,contract:pp(t.contract)})}async cleanContractCalls(){return new Promise(((e,t)=>{Md(this,((e,t)=>(null==t?void 0:t.handler)===Kd),(r=>(_d(r,{jsonrpc:"2.0",method:"channels.clean_contract_calls",params:{}}),{handler:lp,state:{resolve:e,reject:t}})))}))}async sendMessage(e,t){const r="object"==typeof e?JSON.stringify(e):e;"connecting"===this.status()&&(await new Promise((e=>{const t=r=>{"connecting"!==r&&(e(),this.off("statusChanged",t))};this.on("statusChanged",t)})),await it(500)),_d(this,{jsonrpc:"2.0",method:"channels.message",params:{info:r,to:t}})}static async reconnect(e,t){const{sign:r}=e;return hp.initialize({...e,reconnectTx:await r("reconnect",In(t,Xt.ChannelClientReconnectTx).tx)})}}var fp=(e,t)=>(e.connect((e=>t.sendMessage(e)),(()=>t.disconnect())),t.connect((t=>e.sendMessage(t)),(()=>e.disconnect())),()=>{e.disconnect(),t.disconnect()});class gp{constructor(e){let{debug:t=!1}=e;this.debug=t}connect(e,t){if(this.isConnected())throw new Ue("You already connected")}disconnect(){if(!this.isConnected())throw new Fe("You dont have connection. Please connect before")}receiveMessage(e){this.debug&&console.log("Receive message:",e)}sendMessage(e){this.debug&&console.log("Send message:",e)}}function mp(e,t,r){!function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t),t.set(e,r)}var yp=new WeakMap,Ip=new WeakMap,Cp=new WeakMap;class Ep extends gp{constructor(){let{target:e,self:t=window,origin:r,sendDirection:n,receiveDirection:i=Il.to_aepp,...a}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super(a),mp(this,yp,{writable:!0,value:void 0}),mp(this,Ip,{writable:!0,value:void 0}),mp(this,Cp,{writable:!0,value:void 0}),Fl(this,Ip,e),Fl(this,Cp,t),this.origin=r,this.sendDirection=n,this.receiveDirection=i}isConnected(){return null!=this.listener}connect(e,t){super.connect(e,t),this.listener=t=>{var r,n;if("object"!=typeof t.data||"2.0"!==(null!==(r=t.data.jsonrpc)&&void 0!==r?r:null===(n=t.data.data)||void 0===n?void 0:n.jsonrpc))return;if(null!=this.origin&&this.origin!==t.origin)return;if(null!=Ul(this,Ip)&&Ul(this,Ip)!==t.source)return;this.receiveMessage(t);let{data:i}=t;if(null!=i.type){if(t.data.type!==this.receiveDirection)return;i=i.data}e(i,t.origin,t.source)},Ul(this,Cp).addEventListener("message",this.listener),Fl(this,yp,t)}disconnect(){if(super.disconnect(),null==this.listener||null==Ul(this,yp))throw new q("Expected to not happen, required for TS");Ul(this,Cp).removeEventListener("message",this.listener),delete this.listener,Ul(this,yp).call(this),Fl(this,yp,void 0)}sendMessage(e){var t;if(null==Ul(this,Ip))throw new Pe("Can't send messages without target");const r=null!=this.sendDirection?{type:this.sendDirection,data:e}:e;super.sendMessage(r),Ul(this,Ip).postMessage(r,null!==(t=this.origin)&&void 0!==t?t:"*")}}var Bp=(e,t)=>{if(null==window)throw new O("Window object not found, you can run wallet detector only in browser");const r={};return e.connect(((e,n,i)=>{let{method:a,params:o}=e;if(a!==Bl.readyToConnect||null!=r[o.id])return;const s={info:o,getConnection(){const e="extension"===o.type;return new Ep({sendDirection:e?Il.to_waellet:void 0,receiveDirection:e?Il.to_aepp:void 0,target:i,origin:e?window.origin:o.origin})}};r[s.info.id]=s,t({wallets:r,newWallet:s})}),(()=>{})),Object.keys(r).length>0&&t({wallets:r}),()=>e.disconnect()};class wp extends gp{constructor(e){let{port:t,...r}=e;super(r),this.port=t}disconnect(){super.disconnect(),this.port.disconnect()}connect(e,t){super.connect(e,t),this.port.onMessage.addListener(((t,r)=>{this.receiveMessage(t),e(t,r.name,r)})),this.port.onDisconnect.addListener(t)}sendMessage(e){super.sendMessage(e),this.port.postMessage(e)}isConnected(){return this.port.onMessage.hasListeners()}}}(),n}()}));
|
|
2
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Aeternity=t():e.Aeternity=t()}(self,(function(){return function(){var e={2337:function(e,t,r){"use strict";var n=r(9509).Buffer;e.exports=function(e){if(e.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),r=0;r<t.length;r++)t[r]=255;for(var i=0;i<e.length;i++){var o=e.charAt(i),a=o.charCodeAt(0);if(255!==t[a])throw new TypeError(o+" is ambiguous");t[a]=i}var s=e.length,c=e.charAt(0),A=Math.log(s)/Math.log(256),u=Math.log(256)/Math.log(s);function l(e){if("string"!=typeof e)throw new TypeError("Expected String");if(0===e.length)return n.alloc(0);for(var r=0,i=0,o=0;e[r]===c;)i++,r++;for(var a=(e.length-r)*A+1>>>0,u=new Uint8Array(a);e[r];){var l=t[e.charCodeAt(r)];if(255===l)return;for(var d=0,p=a-1;(0!==l||d<o)&&-1!==p;p--,d++)l+=s*u[p]>>>0,u[p]=l%256>>>0,l=l/256>>>0;if(0!==l)throw new Error("Non-zero carry");o=d,r++}for(var h=a-o;h!==a&&0===u[h];)h++;var f=n.allocUnsafe(i+(a-h));f.fill(0,0,i);for(var g=i;h!==a;)f[g++]=u[h++];return f}return{encode:function(t){if((Array.isArray(t)||t instanceof Uint8Array)&&(t=n.from(t)),!n.isBuffer(t))throw new TypeError("Expected Buffer");if(0===t.length)return"";for(var r=0,i=0,o=0,a=t.length;o!==a&&0===t[o];)o++,r++;for(var A=(a-o)*u+1>>>0,l=new Uint8Array(A);o!==a;){for(var d=t[o],p=0,h=A-1;(0!==d||p<i)&&-1!==h;h--,p++)d+=256*l[h]>>>0,l[h]=d%s>>>0,d=d/s>>>0;if(0!==d)throw new Error("Non-zero carry");i=p,o++}for(var f=A-i;f!==A&&0===l[f];)f++;for(var g=c.repeat(r);f<A;++f)g+=e.charAt(l[f]);return g},decodeUnsafe:l,decode:function(e){var t=l(e);if(t)return t;throw new Error("Non-base"+s+" character")}}}},5260:function(e,t,r){var n=r(2337);e.exports=n("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},8449:function(e,t,r){const n=r(7945),i=r(6878),{symbolIdentifier:o}=r(2665);e.exports=(e,t,r)=>{const a=o(e),s=new n(a),c=new i(t,r);return new i([s.type,c.type],[s,c])}},6040:function(e){e.exports=class{constructor(e){this._valueFactory=e}get valueFactory(){return this._valueFactory}supports({_name:e,_valueTypes:t}){return!1}create(e,t){throw new Error("Not implemented.")}}},6097:function(e,t,r){const n=r(1565),i=r(4077),o=r(6040),a=["bls12_381.fr","bls12_381.fp"];e.exports=class extends o{supports({name:e,_valueTypes:t}){return a.includes(e)}create(e,t){switch(e.name){case"bls12_381.fr":return new n(t);case"bls12_381.fp":return new i(t);default:throw new Error(`Unsupported type "${e.name}"`)}}}},2320:function(e,t,r){const n=r(4664),i=r(5675),o=r(1168),a=r(9205),s=r(4960),c=r(3353),A=r(786),u=r(7211),l=r(4093),d=r(2954),p=r(6097);e.exports=class{constructor(){const e=new l(this);this._factories=[new o(this),new a(this),new s(this),new c(this),new A(this),new u(this),new d(this,e),e,new p(this)]}createMultiple(e,t){return n(t.length===e.length,`Number of types (${e.length}) and values (${t.length}) should match`),i(e,t).map((e=>this.create(...e)))}create(e,t){const r=this._factories.find((t=>t.supports(e)));return n(r,`Unsupported type: ${JSON.stringify(e)}`),r.create(e,t)}}},2954:function(e,t,r){const{hash:n}=r(2665),{ByteArray2Int:i}=r(240),o=r(6966),a=r(6040),s=["string","signature","bytes"];e.exports=class extends a{constructor(e,t){super(e),this._variantFactory=t}supports({name:e,_valueTypes:t}){return"event"===e}create({variantType:e},{data:t,topics:r}){const[a,...s]=r;if("bigint"!=typeof a)throw new o(`Event name hash (first topic) should be of type "BigInt", got "${typeof a}" instead.`);const c=e.variants.map((e=>i(n(Object.keys(e)[0])))).findIndex((e=>e===a));if(-1===c)throw new o("Event name hash does not match any event variant constructor");const A=e.variants[c],u=Object.keys(A)[0],[l]=Object.values(A),d=l.map((e=>this._isData(e)?t:s.shift()));return this._variantFactory.create(e,{[u]:d})}_isData(e){return!(!s.includes(e.name)||"bytes"===e.name&&e.size<=32)}}},9205:function(e,t,r){const n=r(1041),i=r(5110),o=r(6040);e.exports=class extends o{supports({name:e,_valueTypes:t}){return"list"===e}create(e,t){if(!Array.isArray(t))throw new i(e.name,`Fate list must be an Array, got ${t} instead`);const r=t.map((t=>this.valueFactory.create(e.valuesType,t)));return new n(e.valuesType,r)}}},3353:function(e,t,r){const n=r(8804),i=r(6040);e.exports=class extends i{supports({name:e,_valueTypes:t}){return"map"===e}create(e,t){const r=[];for(const n of t)r.push([this.valueFactory.create(e.keyType,n[0]),this.valueFactory.create(e.valueType,n[1])]);return new n(e.keyType,e.valueType,r)}}},1168:function(e,t,r){const n=r(3509),i=r(4476),o=r(6313),a=r(7772),s=r(3607),c=r(5779),A=r(3422),u=r(539),l=r(8623),d=r(6445),p=r(687),h=r(5070),f=r(6040),g=["int","bool","string","bits","hash","bytes","signature","account_address","contract_address","channel_address","oracle_address","oracle_query_address"];e.exports=class extends f{supports({name:e,_valueTypes:t}){return g.includes(e)}create(e,t){switch(e.name){case"int":return new n(t);case"bool":return new i(t);case"string":return new o(t);case"bits":return new A(t);case"hash":return new a(t);case"bytes":return new c(t,e.valueTypes);case"signature":return new s(t);case"account_address":return new u(t);case"contract_address":return new l(t);case"channel_address":return new d(t);case"oracle_address":return new p(t);case"oracle_query_address":return new h(t);default:throw new Error(`Unsupported type "${e.name}"`)}}}},7211:function(e,t,r){const n=r(6040),i=r(6878),{FateTypeRecord:o}=r(4265),a=r(5110);e.exports=class extends n{supports({name:e,_valueTypes:t}){return"record"===e}create(e,t){if("object"!=typeof t)throw new a(e.name,`Fate record must be an Object, got ${t} instead`);const r=Object.keys(t).length;if(r!==e.keys.length)throw new a(e.name,`Number of expected keys (${e.keys.length}) and actual keys (${r}) should match`);const n=e.valueTypes.map(((r,n)=>{const i=e.keys[n];return this.valueFactory.create(r,t[i])}));return 1===n.length?n[0]:new i(o(e.keys,e.valueTypes),n)}}},4960:function(e,t,r){const n=r(2548),i=r(6040);e.exports=class extends i{supports({name:e,_valueTypes:t}){return"set"===e}create(e,t){const r=[];for(const n of t)r.push(this.valueFactory.create(e.valuesType,n));return new n(e.valuesType,r)}}},786:function(e,t,r){const n=r(6878),i=r(5110),o=r(6040);e.exports=class extends o{supports({name:e,_valueTypes:t}){return"tuple"===e}create(e,t){if(!Array.isArray(t))throw new i(e.name,`Fate tuple must be an Array, got ${t} instead`);const r=e.valueTypes.map(((e,r)=>this.valueFactory.create(e,t[r])));return 1===r.length?r[0]:new n(e.valueTypes,r)}}},4093:function(e,t,r){const n=r(2457),i=r(5110),o=r(6040),a=["variant","Chain.ttl","AENS.pointee","AENS.name"];e.exports=class extends o{supports({name:e,_valueTypes:t}){return a.includes(e)}create(e,t){if(!this.isValid(t))throw new i(e.name,`Variant should be an object mapping constructor to array of values, got "${t}" instead`);const[r,o]=Object.entries(t)[0],a=e.variants.map((e=>{const[[,t]]=Object.entries(e);return t.length})),s=e.variants.findIndex((e=>{const[[t,n]]=Object.entries(e);return t===r}));if(-1===s)throw new i(e.name,`Unknown variant constructor: ${r}`);const[[,c]]=Object.entries(e.variants[s]);if(o.length!==c.length)throw new i(e.name,`"${r}" variant constructor expects ${c.length} argument(s) but got ${o.length} instead`);const A=this.valueFactory.createMultiple(c,o);return new n(a,s,A,c,e.variants)}isValid(e){return"object"==typeof e&&null!==e&&1===Object.entries(e).length&&Array.isArray(Object.values(e)[0])}}},2968:function(e,t,r){const n=r(8638),i=r(7829),o=r(2540),a=r(2320),s=r(3451),c=r(880),A=r(1338),u=r(8449),{FateTypeString:l}=r(4265),d=r(7960),p=r(722);e.exports=class{constructor(e){this._aci=e,this._serializer=new i,this._dataFactory=new a,this._externalDataFactory=new s(new A),this._typeResolver=new o(e),this._internalMapper=new A,this._canonicalMapper=new c}encode(e,t,r){const{types:i,required:o}=this._typeResolver.getCallTypes(e,t);if(r.length>i.length||r.length<o)throw new d(`Non matching number of arguments. ${t} expects between ${o} and ${i.length} number of arguments but got ${r.length}`);for(;r.length<i.length;)r.push(void 0);const a=this._externalDataFactory.createMultiple(i,r),s=u(t,i,a),c=this._serializer.serialize(s),A=new Uint8Array(c.flat(1/0));return"cb_"+n.encode(A)}decode(e,t,r){const n=this._typeResolver.getReturnType(e,t),i=this.decodeString(r);return this._serializer.deserialize(n,i).accept(this._canonicalMapper)}decodeString(e){if(!e.startsWith("cb_"))throw new p("Invalid data format (missing cb_ prefix)");return n.decode(e.substring(3))}decodeFateString(e){const t=this.decodeString(e);return this._serializer.deserialize(l(),t).accept(this._canonicalMapper)}decodeEvent(e,t,r){const n=this.decodeString(t),i=this._typeResolver.getEventType(e),o={topics:r,data:n};return this._dataFactory.create(i,o).accept(this._canonicalMapper)}}},7960:function(e){class t extends Error{constructor(e){super(e),this.name="EncoderError"}}e.exports=t},5462:function(e){class t extends Error{constructor(e){super("Invalid FATE prefix: 0b"+e.toString(2).padStart(8,"0")),this.name="FatePrefixError",this.prefix=e}}e.exports=t},5110:function(e){class t extends Error{constructor(e,t){super(t),this.name="FateTypeError",this.type=e}}e.exports=t},722:function(e){class t extends Error{constructor(e){super(e),this.name="FormatError"}}e.exports=t},2966:function(e){class t extends Error{constructor(e){super(e),this.name="InternalError"}}e.exports=t},9098:function(e){class t extends Error{constructor(e){super(e),this.name="SerializerError"}}e.exports=t},6966:function(e){class t extends Error{constructor(e){super(e),this.name="TypeResolveError"}}e.exports=t},3451:function(e,t,r){const n=r(2320);e.exports=class extends n{constructor(e){super(),this._mapper=e}create(e,t){const r=this._mapper.toInternal(e,t);return super.create(e,r)}}},2689:function(e,t,r){const n=r(4664),i=r(1041),o=r(6878),{FateTypeTuple:a,FateTypeInt:s}=r(4265),c=(e,t)=>{if(0===e.length)return-1;if(0===t.length)return 1;const r=p(e.itemsType);for(let n=0;n<e.length;n++){if(void 0===t.items[n])return 1;const i=r(e.items[n],t.items[n]);if(0!==i)return i}return e.length===t.length?0:-1},A=e=>{const t=p(e);return(e,r)=>t(e.key,r.key)},u=(e,t)=>{const r=new i(s(),e.valueOf()),n=new i(s(),t.valueOf());return c(r,n)},l=(e,t)=>Number(BigInt(e)-BigInt(t)),d={int:l,bool:(e,t)=>e-t,string:(e,t)=>{const r=e.toString(),n=t.toString();return r.length===n.length?r.localeCompare(n):r.length-n.length},bits:(e,t)=>e<0||t<0?-l(e,t):l(e,t),list:c,tuple:(e,t)=>{if(0===e.size)return-1;const r=e.size-t.size;if(0!==r)return r;for(let r=0;r<e.size;r++){const n=e.valueTypes[r],i=p(n)(e.items[r],t.items[r]);if(0!==i)return i}return 0},variant:(e,t)=>{const r=e.arities.length-t.arities.length;if(0!==r)return r;const n=new i(e.aritiesType,e.arities),s=new i(t.aritiesType,t.arities),c=p(n)(n,s);if(0!==c)return c;const A=e.tag-t.tag;return 0!==A?A:p(a())(new o(e.valueTypes,e.value),new o(t.valueTypes,t.value))},map:(e,t)=>{const r=[...e.items],n=[...t.items];r.sort(A(e.keyType)),n.sort(A(t.keyType));const i=p(e.keyType),o=p(e.valueType);for(let e=0;e<r.length;e++){if(void 0===n[e])return 1;const t=r[e],a=n[e],s=i(t.key,a.key);if(0!==s)return s;const c=o(t.value,a.value);if(0!==c)return c}return r.length===n.length?0:-1},bytes:u,account_address:u,channel_address:u,contract_address:u,oracle_query_address:u,oracle_address:u},p=e=>(n(e.hasOwnProperty("name"),`Cannot determine type name of ${JSON.stringify(e)}`),n(d.hasOwnProperty(e.name),`Unsupported comparator for ${e.name}`),d[e.name]);e.exports=p},105:function(e){e.exports=Object.freeze({SMALL_INT:0,LONG_STRING:1,SHORT_STRING:1,SHORT_LIST:3,LONG_TUPLE:11,SHORT_TUPLE:11,LONG_LIST:31,MAP:47,EMPTY_TUPLE:63,POS_BITS:79,EMPTY_STRING:95,POS_BIG_INT:111,FALSE:127,OBJECT:159,VARIANT:175,MAP_ID:191,NEG_BITS:207,EMPTY_MAP:223,NEG_BIG_INT:239,TRUE:255,OTYPE_ADDRESS:0,OTYPE_BYTES:1,OTYPE_CONTRACT:2,OTYPE_ORACLE:3,OTYPE_ORACLE_QUERY:4,OTYPE_CHANNEL:5})},4265:function(e){const t=(e=[])=>({name:"tuple",valueTypes:e}),r=(e,t)=>({name:"map",keyType:e,valueType:t}),n=(e,r,n)=>({name:"variant",aritiesType:{name:"int"},arities:e,variantType:t(r),variants:n}),i=()=>n(0,null,[{RelativeTTL:[{name:"int"}]},{FixedTTL:[{name:"int"}]}]),o=()=>n(0,null,[{"AENS.AccountPt":[{name:"account_address"}]},{"AENS.OraclePt":[{name:"account_address"}]},{"AENS.ContractPt":[{name:"account_address"}]},{"AENS.ChannelPt":[{name:"account_address"}]}]);e.exports={FateTypeVoid:()=>({name:"void"}),FateTypeInt:()=>({name:"int"}),FateTypeBool:()=>({name:"bool"}),FateTypeString:()=>({name:"string"}),FateTypeBits:()=>({name:"bits"}),FateTypeBytes:e=>({name:"bytes",size:e}),FateTypeHash:()=>({name:"hash"}),FateTypeSignature:()=>({name:"signature"}),FateTypeAccountAddress:()=>({name:"account_address"}),FateTypeContractAddress:()=>({name:"contract_address"}),FateTypeOracleAddress:(e,t)=>({name:"oracle_address",questionType:e,answerType:t}),FateTypeOracleQueryAddress:(e,t)=>({name:"oracle_query_address",questionType:e,answerType:t}),FateTypeByteArray:()=>({name:"byte_array"}),FateTypeList:e=>({name:"list",valuesType:e}),FateTypeTuple:t,FateTypeRecord:(e,t)=>({name:"record",keys:e,valueTypes:t}),FateTypeSet:e=>({name:"set",valuesType:e}),FateTypeMap:r,FateTypeVariant:n,FateTypeOption:e=>n(0,null,[{None:[]},{Some:e}]),FateTypeChainTTL:i,FateTypeChainGAMetaTx:()=>n(0,null,[{"Chain.GAMetaTx":[{name:"account_address"},{name:"int"}]}]),FateTypeChainPayingForTx:()=>n(0,null,[{"Chain.PayingForTx":[{name:"account_address"},{name:"int"}]}]),FateTypeChainBaseTx:()=>n(0,null,[{"Chain.SpendTx":[{name:"account_address"},{name:"int"},{name:"string"}]},{"Chain.OracleRegisterTx":[]},{"Chain.OracleQueryTx":[]},{"Chain.OracleResponseTx":[]},{"Chain.OracleExtendTx":[]},{"Chain.NamePreclaimTx":[]},{"Chain.NameClaimTx":[{name:"string"}]},{"Chain.NameUpdateTx":[{name:"hash"}]},{"Chain.NameRevokeTx":[{name:"hash"}]},{"Chain.NameTransferTx":[{name:"account_address"},{name:"hash"}]},{"Chain.ChannelCreateTx":[{name:"account_address"}]},{"Chain.ChannelDepositTx":[{name:"account_address"},{name:"int"}]},{"Chain.ChannelWithdrawTx":[{name:"account_address"},{name:"int"}]},{"Chain.ChannelForceProgressTx":[{name:"account_address"}]},{"Chain.ChannelCloseMutualTx":[{name:"account_address"}]},{"Chain.ChannelCloseSoloTx":[{name:"account_address"}]},{"Chain.ChannelSlashTx":[{name:"account_address"}]},{"Chain.ChannelSettleTx":[{name:"account_address"}]},{"Chain.ChannelSnapshotSoloTx":[{name:"account_address"}]},{"Chain.ContractCreateTx":[{name:"account_address"}]},{"Chain.ContractCallTx":[{name:"account_address"},{name:"int"}]},{"Chain.GAAttachTx":[]}]),FateTypeAENSPointee:o,FateTypeAENSName:()=>{const e=[{"AENS.Name":[{name:"account_address"},i(),r({name:"string"},o())]}];return n(0,null,e)},FateTypeEvent:e=>({name:"event",variantType:e}),FateTypeBls12381Fr:()=>({name:"bls12_381.fr"}),FateTypeBls12381Fp:()=>({name:"bls12_381.fp"})}},880:function(e,t,r){const n=r(2727),{MontBytes2Int:i}=r(333);e.exports=class{visitData(e){return e.valueOf()}visitAddress(e){return e.prefix+"_"+n.encode(e.value)}visitList(e){return e.items.map((e=>e.accept(this)))}visitSet(e){return new Set(e.items.map((e=>e.accept(this))))}visitMap(e){const t=new Map;for(const[r,n]of e.iterator)t.set(r.accept(this),n.accept(this));return t}visitTuple(e){return e.prepareItems((e=>e.accept(this)))}visitVariant(e){if("None"===e.variantName)return;const t=e.value.map((e=>e.accept(this)));return"Some"===e.variantName?t[0]:{[e.variantName]:t}}visitBls12381Fr(e){return i(e.valueOf(),"r")}visitBls12381Fp(e){return i(e.valueOf(),"p")}}},1338:function(e,t,r){const n=r(2727),{Int2MontBytes:i}=r(333),o=r(5110),a={account_address:"ak",contract_address:"ct",channel_address:"ch",oracle_address:"ok",oracle_query_address:"oq"};e.exports=class{toInternal(e,t){switch(e.name){case"account_address":case"contract_address":case"channel_address":case"oracle_address":case"oracle_query_address":return this.toAddress(e,t);case"variant":return this.toVariant(e,t);case"map":return this.toMap(e,t);case"set":return this.toSet(e,t);case"record":return this.toRecord(e,t);case"bls12_381.fr":return this.toBls12381Fr(e,t);case"bls12_381.fp":return this.toBls12381Fp(e,t);default:return t}}toAddress({name:e,_:t},r){const i=r.toString(),s=a[e];if(!i.startsWith(s+"_"))throw new o(e,`Address should start with ${s}_, got ${i} instead`);return n.decode(i.substring(s.length+1))}toVariant(e,t){if(!this.isOptionVariant(e))return t;if([void 0,null].includes(t))return{None:[]};const[r]=Object.keys(t);return["Some","None"].includes(r)?t:{Some:[t]}}isOptionVariant({_name:e,variants:t}){return t.some((({None:e})=>e&&0===e.length))&&t.some((({Some:e})=>e))}toMap(e,t){if("object"!=typeof t||null===t)throw new o("map",`Fate map must be one of: Map, Array, Object; got ${t} instead`);return Array.isArray(t)||t instanceof Map?t:Object.entries(t)}toSet(e,t){if(t instanceof Set)return t;if(Array.isArray(t))return new Set(t);throw new o("set",`Fate set must be a Set or Array, got "${t}" instead`)}toRecord(e,t){return e.keys.reduce(((e,r)=>({...e,[r]:t[r]})),{})}validateBls12381Field(e,t){if("bigint"!=typeof t&&!Number.isInteger(t))throw new o(e.name,`Should be one of: BigInt or Number; got ${t} instead`)}toBls12381Fr(e,t){return this.validateBls12381Field(e,t),i(t,"r")}toBls12381Fp(e,t){return this.validateBls12381Field(e,t),i(t,"p")}}},7829:function(e,t,r){const n=r(2584),i=r(9865),o=r(8268),a=r(9135),s=r(1290),c=r(4857),A=r(8183),u=r(6651),l=r(3234),d=r(4150),p=r(2086),h=r(34),f=r(2137),g=r(6210),m=r(692),y=r(4266),I=r(1751),C=r(6973),E=r(6178),B=r(9503),w=r(5547),Q=r(9098);e.exports=class extends o{constructor(){super(),this.typeFactory=new n,this._serializers={void:new h,bool:new c,int:new p,tuple:new E(this),record:new E(this),list:new f(this),set:new g(this),map:new m(this),byte_array:new A,string:new C,hash:new u,signature:new u,bits:new s,variant:new B(this),bytes:new u,account_address:new a,contract_address:new d,oracle_address:new I,oracle_query_address:new y,channel_address:new l,"bls12_381.fr":new w,"bls12_381.fp":new w}}_getSerializer(e){if(!e.hasOwnProperty("name"))throw new Q("Unsupported type: "+JSON.stringify(e));const t=e.name;if(!this._serializers.hasOwnProperty(t))throw new Q("Unsupported type: "+JSON.stringify(t));return this._serializers[t]}serialize(e){if("object"!=typeof e)throw new Q("Only object serialization is supported. Got: "+JSON.stringify(e));if(!(e instanceof i))throw new Q("Only instances of FateData is supported.");return this._getSerializer(e).serialize(e)}deserialize(e,t){if(!(t instanceof Uint8Array))throw new Q("Only instances of Uint8Array is supported.");return this._getSerializer(e).deserialize(t,e)}deserializeStream(e,t){if(!(e instanceof Uint8Array))throw new Q("Only instances of Uint8Array is supported.");let r=t;return void 0===t&&(r=this.typeFactory.createType(e)),this._getSerializer(r).deserializeStream(e,t)}}},9135:function(e,t,r){const n=r(6636),i=r(105),o=r(8268),a=r(539);e.exports=class extends o{serialize(e){return[i.OBJECT,i.OTYPE_ADDRESS,...n.encode(e.value)]}deserializeStream(e){const t=new Uint8Array(e),r=n.decode(t.slice(2),!0);return[new a(r.data),new Uint8Array(r.remainder)]}}},8268:function(e,t,r){const n=r(9098);e.exports=class{constructor(e){this.globalSerializer=e}serialize(e){throw new n("Not implemented.")}deserialize(e,t){const[r,n]=this.deserializeStream(e,t);return r}deserializeStream(e,t){throw new n("Not implemented.")}}},1290:function(e,t,r){const n=r(105),i=r(7138),o=r(3422),a=r(8268),s=r(9475);e.exports=class extends a{serialize(e){return[e.value>=0?n.POS_BITS:n.NEG_BITS,...i.encode(s(e.value))]}deserializeStream(e){const t=new Uint8Array(e),r=t[0]===n.POS_BITS?1n:-1n,[a,s]=i.decode(t.slice(1));return[new o(a*r),new Uint8Array(s)]}}},5547:function(e,t,r){const n=r(8268),i=r(6651),o=r(1565),a=r(4077),s=new i,c=(e,t)=>{switch(e.name){case"bls12_381.fr":return new o(t);case"bls12_381.fp":return new a(t);default:throw new Error(`Unsupported type "${e.name}"`)}};e.exports=class extends n{serialize(e){return s.serialize(e)}deserializeStream(e,t){const[r,n]=s.deserializeStream(e);return[c(t,r.valueOf()),n]}}},4857:function(e,t,r){const n=r(105),i=r(4476),o=r(8268),a=r(5462);e.exports=class extends o{serialize(e){return!0===e.valueOf()?[n.TRUE]:[n.FALSE]}deserializeStream(e){const t=new Uint8Array(e),r=t[0],o=t.slice(1);if(r===n.TRUE)return[new i(!0),o];if(r===n.FALSE)return[new i(!1),o];throw new a(r)}}},8183:function(e,t,r){const n=r(105),i=r(8268),o=r(7945),a=new(r(2086));e.exports=class extends i{serialize(e){return 0===e.length?[n.EMPTY_STRING]:e.length<64?[e.length<<2|n.SHORT_STRING,...e.valueOf()]:[n.LONG_STRING,...a.serialize(e.length-64),...e.valueOf()]}deserializeStream(e){const t=new Uint8Array(e),r=t[0];if(r===n.EMPTY_STRING)return[new o,t.slice(1)];if(r===n.LONG_STRING){const[e,r]=a.deserializeStream(t.slice(1)),n=Number(e.valueOf())+64;return[new o(r.slice(0,n)),r.slice(n)]}const i=1+(r>>2);return[new o(t.slice(1,i)),t.slice(i)]}}},6651:function(e,t,r){const n=r(105),i=r(8183),o=r(5779),a=r(8268),s=new i;e.exports=class extends a{serialize(e){return[n.OBJECT,n.OTYPE_BYTES,...s.serialize(e.value)]}deserializeStream(e){const t=new Uint8Array(e),[r,n]=s.deserializeStream(t.slice(2));return[new o(r.valueOf()),n]}}},3234:function(e,t,r){const n=r(6636),i=r(105),o=r(8268),a=r(6445);e.exports=class extends o{serialize(e){return[i.OBJECT,i.OTYPE_CHANNEL,...n.encode(e.value)]}deserializeStream(e){const t=new Uint8Array(e),r=n.decode(t.slice(2),!0);return[new a(r.data),new Uint8Array(r.remainder)]}}},4150:function(e,t,r){const n=r(6636),i=r(105),o=r(8268),a=r(8623);e.exports=class extends o{serialize(e){return[i.OBJECT,i.OTYPE_CONTRACT,...n.encode(e.value)]}deserializeStream(e){const t=new Uint8Array(e),r=n.decode(t.slice(2),!0);return[new a(r.data),new Uint8Array(r.remainder)]}}},2086:function(e,t,r){const n=r(105),i=r(7138),o=r(3509),a=r(8268),s=r(5462),c=r(9475);e.exports=class extends a{serialize(e){const t=e instanceof o?e.value:BigInt(e),r=c(t);if(r<64){const e=Number(r);return t>=0?[e<<1]:[254&(128|e<<1)]}return t<0?[n.NEG_BIG_INT,...i.encode(r-64n)]:[n.POS_BIG_INT,...i.encode(r-64n)]}deserializeStream(e){const t=new Uint8Array(e),r=t[0];if(0==(1&r))return 0==(128&r)?[new o(r>>1),t.slice(1)]:[new o(-((126&r)>>1)),t.slice(1)];if(r===n.POS_BIG_INT||r===n.NEG_BIG_INT){const e=r===n.POS_BIG_INT?1n:-1n,[a,s]=i.decode(t.slice(1));return[new o((a+64n)*e),new Uint8Array(s)]}throw new s(r)}}},2137:function(e,t,r){const n=r(7138),i=r(105),o=r(1041),a=r(8268);e.exports=class extends a{serialize(e){const t=e.items.map((e=>this.globalSerializer.serialize(e))).flat(1/0),r=e.items.length;return r<16?[r<<4|i.SHORT_LIST,...t]:[i.LONG_LIST,...n.encode(r-16),...t]}deserializeStream(e,t){const r=new Uint8Array(e),a=r[0];let s,c,A=0n,u=r.slice(1);a===i.LONG_LIST&&([A,u]=n.decode(r.slice(1)),A+=16n),(15&a)===i.SHORT_LIST&&(A=BigInt((240&a)>>4)),void 0!==t&&(s=t.valuesType);const l=[];for(let e=0n;e<A;e++)[c,u]=this.globalSerializer.deserializeStream(u,s),l.push(c);return 0n===A?[new o(null),u]:(void 0===t&&(s=l[0].type),[new o(s,l),u])}}},692:function(e,t,r){const n=r(105),i=r(7138),o=r(8268),a=r(2689),s=r(8804),c=r(5462);e.exports=class extends o{serialize(e){const t=e.length,r=a(e.keyType),o=[...e.items];o.sort(((e,t)=>r(e.key,t.key)));const s=o.map((e=>[this.globalSerializer.serialize(e.key),this.globalSerializer.serialize(e.value)]));return[n.MAP,...i.encode(t),...s.flat(1/0)]}deserializeStream(e,t){const r=new Uint8Array(e),o=r[0];if(o!==n.MAP)throw new c(o);const[a,A]=i.decode(r.slice(1));let u,l,d=A;if(0n===a)return[new s,d];void 0!==t&&({keyType:u,valueType:l}=t);const p=[];for(let e=0n;e<a;e++){const[e,t]=this.globalSerializer.deserializeStream(d,u),[r,n]=this.globalSerializer.deserializeStream(t,l);p.push([e,r]),d=n}const h=p[0];return void 0===t&&(u=h[0].type,l=h[1].type),[new s(u,l,p),d]}}},4266:function(e,t,r){const n=r(6636),i=r(105),o=r(8268),a=r(5070);e.exports=class extends o{serialize(e){return[i.OBJECT,i.OTYPE_ORACLE_QUERY,...n.encode(e.value)]}deserializeStream(e){const t=new Uint8Array(e),r=n.decode(t.slice(2),!0);return[new a(r.data),new Uint8Array(r.remainder)]}}},1751:function(e,t,r){const n=r(6636),i=r(105),o=r(8268),a=r(687);e.exports=class extends o{serialize(e){return[i.OBJECT,i.OTYPE_ORACLE,...n.encode(e.value)]}deserializeStream(e){const t=new Uint8Array(e),r=n.decode(t.slice(2),!0);return[new a(r.data),new Uint8Array(r.remainder)]}}},6210:function(e,t,r){const n=r(8268),{FateTypeTuple:i,FateTypeMap:o}=r(4265),a=r(8804),s=r(6878),c=r(2548);e.exports=class extends n{serialize(e){return this.globalSerializer.serialize(new a(e.itemsType,i(),e.items.map((e=>[e,new s]))))}deserializeStream(e,t){const r=o(t.valuesType,i()),[n,a]=this.globalSerializer.deserializeStream(e,r);return[new c(t.valuesType,n.keys),a]}}},6973:function(e,t,r){const n=r(105),i=r(8268),o=r(8183),a=r(6313),s=r(5462),c=new o;e.exports=class extends i{serialize(e){const t=(new TextEncoder).encode(e);return c.serialize(t)}deserializeStream(e){const t=new Uint8Array(e),r=t[0];if((3&r)!==n.SHORT_STRING&&![n.EMPTY_STRING,n.LONG_STRING].includes(r))throw new s(r);const i=new TextDecoder,[o,A]=c.deserializeStream(t);return[new a(i.decode(o.valueOf())),A]}}},6178:function(e,t,r){const n=r(105),i=r(6878),o=r(8268),a=r(7138);e.exports=class extends o{serialize(e){const t=e.size;if(0===t)return[n.EMPTY_TUPLE];const r=e.items.map((e=>this.globalSerializer.serialize(e))).flat(1/0);return t<16?[t<<4|n.SHORT_TUPLE,...r]:[n.LONG_TUPLE,...a.encode(t-16),...r]}deserializeStream(e,t){const r=new Uint8Array(e),o=r[0];let s=0n,c=r.slice(1);if(o===n.EMPTY_TUPLE)return[new i,c];(15&o)===n.SHORT_TUPLE&&(s=(240&o)>>4),o===n.LONG_TUPLE&&([s,c]=a.decode(r.slice(1)),s+=16n);let A=[];void 0!==t&&(A=t.valueTypes);const u=[];let l=null;for(let e=0n;e<s;e++)[l,c]=this.globalSerializer.deserializeStream(c,A[e]),u.push(l);let d=t;return void 0===t&&(d=u.map((e=>e.type))),[new i(d,u),c]}}},9503:function(e,t,r){const n=r(6636),i=r(105),o=r(6878),a=r(2457),s=r(8268);e.exports=class extends s{serialize(e){const t=new o(e.valueTypes,e.value);return[i.VARIANT,...n.encode(new Uint8Array(e.arities)),e.tag,...this.globalSerializer.serialize(t)]}deserializeStream(e,t){const r=new Uint8Array(e),i=n.decode(r.slice(1),!0),o=[...i.data],s=i.remainder[0],c=i.remainder.slice(1);let A,u=[];void 0!==t&&(u=t.variants,A={...t.variantType,valueTypes:Object.values(t.variants[s])[0]});const[l,d]=this.globalSerializer.deserializeStream(c,A);return[new a(o,s,l.items,l.valueTypes,u),d]}}},34:function(e,t,r){const n=r(9713),i=r(8268);e.exports=class extends i{serialize(){return""}deserialize(){return new n}deserializeStream(e){return[new n,e]}}},2584:function(e,t,r){const n=r(4664),i=r(105),o=r(5462),{FateTypeInt:a,FateTypeBool:s,FateTypeString:c,FateTypeBits:A,FateTypeBytes:u,FateTypeAccountAddress:l,FateTypeContractAddress:d,FateTypeOracleAddress:p,FateTypeOracleQueryAddress:h,FateTypeList:f,FateTypeMap:g,FateTypeTuple:m,FateTypeVariant:y}=r(4265),I={0:l(),1:u(),2:d(),3:p(),4:h()};e.exports=class{createType(e){const t=e[0];if(t===i.TRUE||t===i.FALSE)return s();if((1&t)===i.SMALL_INT||t===i.POS_BIG_INT||t===i.NEG_BIG_INT)return a();if((3&t)===i.SHORT_STRING||t===i.LONG_STRING)return c();if((15&t)===i.SHORT_LIST||t===i.LONG_LIST)return f();if((15&t)===i.SHORT_TUPLE||t===i.LONG_TUPLE||t===i.EMPTY_TUPLE)return m();if(t===i.MAP||t===i.EMPTY_MAP)return g();if(t===i.POS_BITS||t===i.NEG_BITS)return A();if(t===i.VARIANT)return y();if(t===i.OBJECT){const t=e[1];return n(I.hasOwnProperty(t),`Unsupported object type "${t}"`),I[t]}throw new o(t)}}},2540:function(e,t,r){const n=r(6966),{FateTypeVoid:i,FateTypeInt:o,FateTypeBool:a,FateTypeString:s,FateTypeBits:c,FateTypeBytes:A,FateTypeHash:u,FateTypeSignature:l,FateTypeAccountAddress:d,FateTypeContractAddress:p,FateTypeOracleAddress:h,FateTypeOracleQueryAddress:f,FateTypeList:g,FateTypeMap:m,FateTypeTuple:y,FateTypeRecord:I,FateTypeSet:C,FateTypeVariant:E,FateTypeOption:B,FateTypeChainTTL:w,FateTypeChainGAMetaTx:Q,FateTypeChainPayingForTx:v,FateTypeChainBaseTx:N,FateTypeAENSPointee:b,FateTypeAENSName:S,FateTypeEvent:x,FateTypeBls12381Fr:T,FateTypeBls12381Fp:_}=r(4265),R=e=>e&&"object"==typeof e&&e.constructor===Object,M=({type:e})=>{let t,r=e;return R(r)&&([[r,t]]=Object.entries(r)),"option"===r};e.exports=class{constructor(e){this.aci=e}getCallTypes(e,t){const r=this.getNamespaceAci(e).functions.find((e=>e.name===t));if(r){const e=r.arguments.map((e=>this.resolveType(e.type))),t=r.arguments.filter(M);return{types:e,required:e.length-t.length}}if("init"===t)return{types:[],required:0};throw new n(`Unknown function ${t}`)}getReturnType(e,t){if("init"===t)return this.resolveType("void");const r=this.getNamespaceAci(e).functions.find((e=>e.name===t));if(!r)throw new n(`Unknown function ${t}`);return this.resolveType(r.returns)}getEventType(e){const t=this.getNamespaceAci(e);if(!t.hasOwnProperty("event"))throw new n("Missing event declaration");return x(this.resolveType(t.event))}isCustomType(e){if("string"!=typeof e)return!1;if(this.isStdType(e))return!1;const[t,r]=e.split(".");return!!this.getNamespaceAci(t)}isStdType(e){return"Set.set"===e}getNamespaceAci(e){for(const t of this.aci){const[[r,n]]=Object.entries(t);if(n.name===e)return n}return null}resolveType(e,t={}){let r=e,E=[],x=[];if(R(e)&&([[r,E]]=Object.entries(e)),this.isCustomType(r)){const[e,t]=this.resolveTypeDef(r,E);return this.resolveType(e,t)}if(Array.isArray(E)&&"variant"!==r&&(x=E.map((e=>{const r=e.hasOwnProperty("type")?e.type:e,n=t.hasOwnProperty(r)?t[r]:r;return this.resolveType(n,t)}))),"void"===r)return i();if("unit"===r)return y([]);if("int"===r)return o();if("bool"===r)return a();if("string"===r)return s();if("bits"===r)return c();if("hash"===r)return u();if("signature"===r)return l();if("address"===r)return d();if("contract_address"===r)return p();if("Chain.ttl"===r)return w();if("Chain.ga_meta_tx"===r)return Q();if("Chain.paying_for_tx"===r)return v();if("Chain.base_tx"===r)return N();if("AENS.pointee"===r)return b();if("AENS.name"===r)return S();if("Set.set"===r)return C(...x);if("MCL_BLS12_381.fr"===r)return T();if("MCL_BLS12_381.fp"===r)return _();if("bytes"===r)return A(E);if("list"===r)return g(...x);if("map"===r)return m(...x);if(("tuple"===r||"record"===r)&&1===x.length)return x[0];if("tuple"===r)return y(x);if("record"===r){const e=E.map((e=>e.name));return I(e,x)}if("variant"===r)return this.resolveVariant(E,t);if("option"===r)return B(x);if("oracle"===r)return h(...x);if("oracle_query"===r)return f(...x);throw new n("Cannot resolve type: "+JSON.stringify(e))}resolveVariant(e,t){const r=e.map((e=>{const[[r,n]]=Object.entries(e);return{[r]:n.map((e=>{const r=t.hasOwnProperty(e)?t[e]:e;return this.resolveType(r,t)}))}}));return E(0,null,r)}resolveTypeDef(e,t=[]){const[r,i]=e.split("."),o=this.getNamespaceAci(r);if(!o)throw new n("Unknown namespace for "+JSON.stringify(e));if(o.name===e)return["contract_address",[]];const a=[...o.type_defs,...o.state?[{name:"state",typedef:o.state,vars:[]}]:[]].find((e=>e.name===i));if(!a)throw new n("Unknown type definition: "+JSON.stringify(e));const s={};return a.vars.forEach(((e,r)=>{const[[n,i]]=Object.entries(e);s[i]=t[r]})),[s.hasOwnProperty(a.typedef)?s[a.typedef]:a.typedef,s]}}},3023:function(e,t,r){const n=r(2968);e.exports={Encoder:n}},539:function(e,t,r){const n=r(6187);e.exports=class extends n{constructor(e){super(e,"account_address","ak")}}},6187:function(e,t,r){const n=r(5779);e.exports=class extends n{constructor(e,t,r){super(e,32,t),this._prefix=r}get prefix(){return this._prefix}accept(e){return e.visitAddress(this)}}},3422:function(e,t,r){const n=r(9865);e.exports=class extends n{constructor(e){super("bits"),this._value=BigInt(e)}get value(){return this._value}valueOf(){return this._value}}},7430:function(e,t,r){const n=r(9865),i=r(5110);e.exports=class extends n{constructor(e,t,r){if(super(r),!Array.isArray(e)&&!ArrayBuffer.isView(e))throw new i(r,`Should be one of: Array or ArrayBuffer; got ${e} instead`);const n=new Uint8Array(e);if(n.byteLength!==t)throw new i(r,`Invalid length: got ${n.byteLength} bytes instead of ${t} bytes`);this._value=n,this._size=t}get value(){return this._value}get size(){return this._size}valueOf(){return this._value}}},4077:function(e,t,r){const n=r(7430),{FateTypeBls12381Fp:i}=r(4265);e.exports=class extends n{constructor(e){super(e,48,"bls12_381.fp")}get type(){return i()}accept(e){return e.visitBls12381Fp(this)}}},1565:function(e,t,r){const n=r(7430),{FateTypeBls12381Fr:i}=r(4265);e.exports=class extends n{constructor(e){super(e,32,"bls12_381.fr")}get type(){return i()}accept(e){return e.visitBls12381Fr(this)}}},4476:function(e,t,r){const n=r(9865),{FateTypeBool:i}=r(4265);e.exports=class extends n{constructor(e){super("bool"),this._value=!!e}get value(){return this._value}get type(){return i()}valueOf(){return this._value}}},7945:function(e,t,r){const n=r(9865),{FateTypeByteArray:i}=r(4265);e.exports=class extends n{constructor(e=[]){super("byte_array"),this._value=new Uint8Array(e)}get length(){return this._value.length}get type(){return i()}valueOf(){return this._value}}},5779:function(e,t,r){const n=r(9865),{Int2ByteArray:i}=r(240),o=r(381),a=r(5110);e.exports=class extends n{constructor(e,t,r="bytes"){if(super(r),this._value=((e,t=0)=>{if(Array.isArray(e)||ArrayBuffer.isView(e))return new Uint8Array(e);if("string"==typeof e)return o(e);if("bigint"!=typeof e&&!Number.isInteger(e))throw new a("byte_array",`Should be one of: Array, ArrayBuffer, hex string, Number, BigInt; got ${e} instead`);const r=i(e);if(r.length>=t)return r;const n=new Uint8Array(t);return n.set(r,t-r.length),n})(e,t),t&&this._value.byteLength!==t)throw new a(r,`Invalid length: got ${this._value.byteLength} bytes instead of ${t} bytes`);this._size=t}get value(){return this._value}get size(){return this._size}valueOf(){return this._value}}},6445:function(e,t,r){const n=r(6187);e.exports=class extends n{constructor(e){super(e,"channel_address","ch")}}},8623:function(e,t,r){const n=r(6187);e.exports=class extends n{constructor(e){super(e,"contract_address","ct")}}},9865:function(e,t,r){const n=r(2966);e.exports=class{constructor(e){this.name=e}valueOf(){throw new n("Not implemented.")}accept(e){return e.visitData(this)}}},7772:function(e,t,r){const n=r(5779);e.exports=class extends n{constructor(e){super(e,32,"hash")}}},3509:function(e,t,r){const n=r(9865),{FateTypeInt:i}=r(4265);e.exports=class extends n{constructor(e){super("int"),this._value=BigInt(e)}get value(){return this._value}get type(){return i()}valueOf(){return this._value}}},1041:function(e,t,r){const n=r(9865),{FateTypeList:i}=r(4265);e.exports=class extends n{constructor(e,t=[]){super("list"),this._itemsType=e,this.items=Array.from(t)}get itemsType(){return this._itemsType}get type(){return i(this.itemsType)}get length(){return this.items.length}valueOf(){return this.items.map((e=>e.valueOf()))}accept(e){return e.visitList(this)}}},8804:function(e,t,r){const n=r(9865),{FateTypeMap:i}=r(4265),o=e=>{const[t,r]=e;return{key:t,value:r}};e.exports=class extends n{constructor(e,t,r=[]){super("map"),this._keyType=e,this._valueType=t,this._type=i(e,t),this._value=new Map(r)}get items(){return[...this._value.entries()].map(o)}get keyType(){return this._keyType}get valueType(){return this._valueType}get type(){return this._type}get length(){return this._value.size}get iterator(){return this._value[Symbol.iterator]()}get keys(){return this._value.keys()}valueOf(){const e=new Map;for(const[t,r]of this.iterator)e.set(t.valueOf(),r.valueOf());return e}accept(e){return e.visitMap(this)}}},687:function(e,t,r){const n=r(6187);e.exports=class extends n{constructor(e){super(e,"oracle_address","ok")}}},5070:function(e,t,r){const n=r(6187);e.exports=class extends n{constructor(e){super(e,"oracle_query_address","oq")}}},2548:function(e,t,r){const n=r(9865),{FateTypeSet:i}=r(4265);e.exports=class extends n{constructor(e,t=[]){super("set"),this._itemsType=e,this._items=new Set(t)}get items(){return Array.from(this._items.values())}get itemsType(){return this._itemsType}get type(){return i(this.itemsType)}get length(){return this._items.size}valueOf(){return new Set(this.items.map((e=>e.valueOf())))}accept(e){return e.visitSet(this)}}},3607:function(e,t,r){const n=r(5779);e.exports=class extends n{constructor(e){super(e,64,"signature")}}},6313:function(e,t,r){const n=r(9865),{FateTypeString:i}=r(4265);e.exports=class extends n{constructor(e){super("string"),this._value=e.toString()}get type(){return i()}toString(){return this._value}valueOf(){return this._value}}},6878:function(e,t,r){const n=r(9865),{FateTypeTuple:i}=r(4265);e.exports=class extends n{constructor(e=[],t=[]){super("tuple"),this._valueTypes=e.hasOwnProperty("valueTypes")?e.valueTypes:e,this._type=Array.isArray(e)?i(e):e,this._items=Array.from(t)}get valueTypes(){return this._valueTypes}get type(){return this._type}get size(){return this._items.length}get items(){return this._items}valueOf(){return this.prepareItems((e=>e.valueOf()))}prepareItems(e){const t=this._items.map(e);return"record"===this._type.name?(r=this._type.keys,n=t,r.reduce(((e,t,r)=>(e[t]=n[r],e)),{})):t;var r,n}accept(e){return e.visitTuple(this)}}},2457:function(e,t,r){const n=r(9865),{FateTypeVariant:i,FateTypeTuple:o,FateTypeInt:a}=r(4265);e.exports=class extends n{constructor(e,t,r=[],n=[],o=[]){super("variant"),this.arities=Array.from(e),this._tag=t,this._value=r,this._valueTypes=n,this._type=i(e,n,o)}get valueTypes(){return this._valueTypes}get type(){return this._type}get tag(){return this._tag}get value(){return this._value}get aritiesType(){return a()}get variantType(){return o(this._valueTypes)}get variants(){return this._type.variants}get variantName(){const e=this.variants[this.tag];return Object.keys(e)[0]}valueOf(){if(0===this.variants.length)return this;const e=this._value.map((e=>e.valueOf()));return{[this.variantName]:e}}accept(e){return e.visitVariant(this)}}},9713:function(e,t,r){const n=r(9865),{FateTypeVoid:i}=r(4265);e.exports=class extends n{constructor(){super("void"),this._value=void 0}get value(){return this._value}get type(){return i()}valueOf(){return this._value}}},333:function(e,t,r){const{Int2ByteArray:n,ByteArray2IntBE:i}=r(240),o={r:{R:1n<<256n,N:0x73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000001n},p:{R:1n<<384n,N:0x1a0111ea397fe69a4b1ba7b6434bacd764774b84f38512bf6730d2a0f6b0f6241eabfffeb153ffffb9feffffffffaaabn}},a=(e,t)=>{if(0n===t)return[1n,0n,e];const[r,n,i]=a(t,e%t);return[n,r-n*(e/t),i]};e.exports={Int2MontBytes:(e,t)=>{const r=o[t],i=BigInt(e)*r.R%r.N;return n(i)},MontBytes2Int:(e,t)=>{const r=o[t],n=i(e),s=((e,t)=>{const[r,n,i]=a(e,t);return(r+t)%t})(r.R,r.N);return n*s%r.N}}},381:function(e,t,r){const n=r(722);e.exports=e=>{const t=e.match(/^(0x)?([a-f0-9]*)$/i);if(!t)throw new n(`Invalid hex string: ${e}`);return new Uint8Array(t[2].split(/(.{1,2})/).filter((e=>e)).map((e=>parseInt(e,16))))}},240:function(e){const t=e=>{const r=BigInt(e);return r<256n?new Uint8Array([Number(r)]):new Uint8Array([...t(r>>8n),Number(0xffn&r)])},r=e=>{const t=[];return e.forEach((e=>{let r=e.toString(16);r.length%2&&(r="0"+r),t.push(r)})),t};e.exports={Int2ByteArray:t,ByteArray2Int:e=>{const t=r(e);return BigInt("0x"+t.join(""))},ByteArray2IntBE:e=>{const t=r(e).reverse();return BigInt("0x"+t.join(""))}}},7138:function(e,t,r){const n=r(6636),{Int2ByteArray:i,ByteArray2Int:o}=r(240);e.exports={encode(e){return new Uint8Array(n.encode(i(e)))},decode(e){const t=n.decode(e,!0);return[o(t.data),t.remainder]}}},9475:function(e){e.exports=e=>e>0?e:-1n*e},4664:function(e,t,r){const n=r(2966);e.exports=(e,t)=>{if(!e)throw new n(t)}},2727:function(e,t,r){const n=r(5260),{addChecksum:i,getPayload:o}=r(8638);e.exports={encode:e=>n.encode(i(e)),decode:e=>o(n.decode(e))}},8638:function(e,t,r){const n=r(7499),{Buffer:i}=r(9509),o=r(722),a=e=>(new n).update(e).digest(),s=e=>a(a(e)).slice(0,4),c=e=>{const t=i.from(e),r=s(e);return i.concat([t,r],t.length+4)},A=e=>{const t=e.slice(0,-4),r=e.slice(-4),n=s(t);if(!r.equals(n))throw new o("Invalid checksum");return t};e.exports={addChecksum:c,getPayload:A,encode:e=>c(e).toString("base64"),decode:e=>A(i.from(e,"base64"))}},2665:function(e,t,r){const n=r(8442),i=e=>Array.from(n.blake2b(e,null,32));e.exports={hash:i,symbolIdentifier:e=>i(e).slice(0,4)}},5675:function(e){e.exports=(e,...t)=>e.map(((e,r)=>t.reduce(((e,t)=>[...e,t[r]]),[e])))},9250:function(e,t,r){var n=r(8764).Buffer;e.exports=(()=>{var e={721:function(e,t){e.exports="AGFzbQEAAAABkwESYAF/AX9gA39/fwF/YAJ/fwBgAn9/AX9gAX8AYAR/f39/AX9gA39/fwBgBH9/f38AYAJ/fgBgAn5/AX5gAn5+AX5gBX9/f39/AGAAAGAGf3x/f39/AX9gCH9/f39/f39/AX9gEX9/f39/f39/f39/f39/f39/AX9gBn9/f39/fwF/YA1/f39/f39/f39/f39/AX8CDQIBYQFhAAABYQFiAAEDPTwJCgECAQIEAAABAAsGAAEHAQIAAwICAwIIAAIDAAcMAwYABQAEBgAABQUAAQECBAEBCAABDg8EEAAFEQMEBQFwAQMDBQcBAYAC//8BBgkBfwFBoKLAAgsHMQwBYwIAAWQAIAFlADwBZgAJAWcACAFoADsBaQA6AWoAOQFrAQABbAA3AW0ANgFuADQJCAEAQQELAgs1CoeyATwIACAAIAGtigseACAAIAF8IABCAYZC/v///x+DIAFC/////w+DfnwLgQQBA38gAkGABE8EQCAAIAEgAhABGiAADwsgACACaiEDAkAgACABc0EDcUUEQAJAIABBA3FFBEAgACECDAELIAJFBEAgACECDAELIAAhAgNAIAIgAS0AADoAACABQQFqIQEgAkEBaiICQQNxRQ0BIAIgA0kNAAsLAkAgA0F8cSIEQcAASQ0AIAIgBEFAaiIFSw0AA0AgAiABKAIANgIAIAIgASgCBDYCBCACIAEoAgg2AgggAiABKAIMNgIMIAIgASgCEDYCECACIAEoAhQ2AhQgAiABKAIYNgIYIAIgASgCHDYCHCACIAEoAiA2AiAgAiABKAIkNgIkIAIgASgCKDYCKCACIAEoAiw2AiwgAiABKAIwNgIwIAIgASgCNDYCNCACIAEoAjg2AjggAiABKAI8NgI8IAFBQGshASACQUBrIgIgBU0NAAsLIAIgBE8NAQNAIAIgASgCADYCACABQQRqIQE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VBAQsMAQsgACABOgAAQQELC7wCAAJAAkACQAJAAkACQAJAAkACQAJAAkAgAUEJaw4SAAgJCggJAQIDBAoJCgoICQUGBwsgAiACKAIAIgFBBGo2AgAgACABKAIANgIADwsgAiACKAIAIgFBBGo2AgAgACABMgEANwMADwsgAiACKAIAIgFBBGo2AgAgACABMwEANwMADwsgAiACKAIAIgFBBGo2AgAgACABMAAANwMADwsgAiACKAIAIgFBBGo2AgAgACABMQAANwMADwsgAiACKAIAQQdqQXhxIgFBCGo2AgAgACABKwMAOQMADwsgACACQQARAgALDwsgAiACKAIAIgFBBGo2AgAgACABNAIANwMADwsgAiACKAIAIgFBBGo2AgAgACABNQIANwMADwsgAiACKAIAQQdqQXhxIgFBCGo2AgAgACABKQMANwMAC2sBBH8gACgCACwAABAPRQRAQQAPCwNAIAAoAgAhA0F/IQEgAkHMmbPmAE0EQEF/IAMsAABBMGsiBCACQQpsIgFqIARB/////wcgAWtKGyEBCyAAIANBAWo2AgAgASECIAMsAAEQDw0ACyABC40VAhJ/An4jAEHQAGsiBSQAIAVByg42AkwgBUE3aiEUIAVBOGohEAJAAkACQAJAA0AgBEH/////ByAMa0oNASAEIAxqIQwgBSgCTCIJIQQCQAJAAkAgCS0AACIIBEADQAJAAkAgCEH/AXEiBkUEQCAEIQgMAQsgBkElRw0BIAQhCANAIAQtAAFBJUcNASAFIARBAmoiBjYCTCAIQQFqIQggBC0AAiEKIAYhBCAKQSVGDQALCyAIIAlrIgRB/////wcgDGsiFUoNByAABEAgACAJIAQQDgsgBA0GQX8hD0EBIQYgBSgCTCwAARAPIQggBSgCTCEEAkAgCEUNACAELQACQSRHDQAgBCwAAUEwayEPQQEhEUEDIQYLIAUgBCAGaiIENgJMQQAhDQJAIAQsAAAiC0EgayIIQR9LBEAgBCEGDAELIAQhBkEBIAh0IgdBidEEcUUNAANAIAUgBEEBaiIGNgJMIAcgDXIhDSAELAABIgtBIGsiCEEgTw0BIAYhBEEBIAh0IgdBidEEcQ0ACwsCQC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.assign,i=n({},e),o=[],a="object"==typeof window,s="function"==typeof importScripts,c="";(a||s)&&(s?c=self.location.href:"undefined"!=typeof document&&document.currentScript&&(c=document.currentScript.src),c=0!==c.indexOf("blob:")?c.substr(0,c.replace(/[?#].*/,"").lastIndexOf("/")+1):"",s&&(r=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),t=(e,t,r)=>{var n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="arraybuffer",n.onload=()=>{200==n.status||0==n.status&&n.response?t(n.response):r()},n.onerror=r,n.send(null)}),e.print||console.log.bind(console);var A,u,l=e.printErr||console.warn.bind(console);n(e,i),i=null,e.arguments&&(o=e.arguments),e.thisProgram&&e.thisProgram,e.quit&&e.quit,e.wasmBinary&&(A=e.wasmBinary),e.noExitRuntime,"object"!=typeof WebAssembly&&N("no native wasm support detected");var d,p,h=!1,f="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function g(t){d=t,e.HEAP8=new Int8Array(t),e.HEAP16=new Int16Array(t),e.HEAP32=new Int32Array(t),e.HEAPU8=p=new Uint8Array(t),e.HEAPU16=new Uint16Array(t),e.HEAPU32=new Uint32Array(t),e.HEAPF32=new Float32Array(t),e.HEAPF64=new Float64Array(t)}e.INITIAL_MEMORY;var m,y,I,C=[],E=[],B=[],w=0,Q=null,v=null;function N(t){throw e.onAbort&&e.onAbort(t),l(t="Aborted("+t+")"),h=!0,t+=". Build with -s ASSERTIONS=1 for more info.",new WebAssembly.RuntimeError(t)}function b(e){return e.startsWith("data:application/octet-stream;base64,")}function S(e){return e.startsWith("file://")}function x(e){try{if(e==y&&A)return new Uint8Array(A);if(r)return r(e);throw"both async and sync fetching of the wasm failed"}catch(e){N(e)}}function T(t){for(;t.length>0;){var r=t.shift();if("function"!=typeof r){var n=r.func;"number"==typeof n?void 0===r.arg?_(n)():_(n)(r.arg):n(void 0===r.arg?null:r.arg)}else r(e)}}function _(e){return m.get(e)}function R(e){try{return u.grow(e-d.byteLength+65535>>>16),g(u.buffer),1}catch(e){}}e.preloadedImages={},e.preloadedAudios={},b(y="argon2.wasm")||(I=y,y=e.locateFile?e.locateFile(I,c):c+I);var M,D={b:function(e,t,r){p.copyWithin(e,t,t+r)},a:function(e){var t,r=p.length,n=2147418112;if((e>>>=0)>n)return!1;for(var i=1;i<=4;i*=2){var o=r*(1+.2/i);if(o=Math.min(o,e+100663296),R(Math.min(n,((t=Math.max(e,o))%65536>0&&(t+=65536-t%65536),t))))return!0}return!1}},O=(function(){var r={a:D};function n(t,r){var n,i=t.exports;e.asm=i,g((u=e.asm.c).buffer),m=e.asm.k,n=e.asm.d,E.unshift(n),function(t){if(w--,e.monitorRunDependencies&&e.monitorRunDependencies(w),0==w&&(null!==Q&&(clearInterval(Q),Q=null),v)){var r=v;v=null,r()}}()}function i(e){n(e.instance)}function o(e){return function(){if(!A&&(a||s)){if("function"==typeof fetch&&!S(y))return fetch(y,{credentials:"same-origin"}).then((function(e){if(!e.ok)throw"failed to load wasm binary file at '"+y+"'";return e.arrayBuffer()})).catch((function(){return x(y)}));if(t)return new Promise((function(e,r){t(y,(function(t){e(new Uint8Array(t))}),r)}))}return Promise.resolve().then((function(){return x(y)}))}().then((function(e){return WebAssembly.instantiate(e,r)})).then((function(e){return e})).then(e,(function(e){l("failed to asynchronously prepare wasm: "+e),N(e)}))}if(w++,e.monitorRunDependencies&&e.monitorRunDependencies(w),e.instantiateWasm)try{return e.instantiateWasm(r,n)}catch(e){return l("Module.instantiateWasm callback failed with error: "+e),!1}A||"function"!=typeof WebAssembly.instantiateStreaming||b(y)||S(y)||"function"!=typeof fetch?o(i):fetch(y,{credentials:"same-origin"}).then((function(e){return WebAssembly.instantiateStreaming(e,r).then(i,(function(e){return l("wasm streaming compile failed: "+e),l("falling back to ArrayBuffer instantiation"),o(i)}))}))}(),e.___wasm_call_ctors=function(){return(e.___wasm_call_ctors=e.asm.d).apply(null,arguments)},e._argon2_hash=function(){return(e._argon2_hash=e.asm.e).apply(null,arguments)},e._malloc=function(){return(O=e._malloc=e.asm.f).apply(null,arguments)}),z=(e._free=function(){return(e._free=e.asm.g).apply(null,arguments)},e._argon2_verify=function(){return(e._argon2_verify=e.asm.h).apply(null,arguments)},e._argon2_error_message=function(){return(e._argon2_error_message=e.asm.i).apply(null,arguments)},e._argon2_encodedlen=function(){return(e._argon2_encodedlen=e.asm.j).apply(null,arguments)},e._argon2_hash_ext=function(){return(e._argon2_hash_ext=e.asm.l).apply(null,arguments)},e._argon2_verify_ext=function(){return(e._argon2_verify_ext=e.asm.m).apply(null,arguments)},e.stackAlloc=function(){return(z=e.stackAlloc=e.asm.n).apply(null,arguments)});function k(t){function r(){M||(M=!0,e.calledRun=!0,h||(T(E),e.onRuntimeInitialized&&e.onRuntimeInitialized(),function(){if(e.postRun)for("function"==typeof e.postRun&&(e.postRun=[e.postRun]);e.postRun.length;)t=e.postRun.shift(),B.unshift(t);var t;T(B)}()))}t=t||o,w>0||(function(){if(e.preRun)for("function"==typeof e.preRun&&(e.preRun=[e.preRun]);e.preRun.length;)t=e.preRun.shift(),C.unshift(t);var t;T(C)}(),w>0||(e.setStatus?(e.setStatus("Running..."),setTimeout((function(){setTimeout((function(){e.setStatus("")}),1),r()}),1)):r()))}if(e.allocate=function(e,t){var r;return r=1==t?z(e.length):O(e.length),e.subarray||e.slice?p.set(e,r):p.set(new Uint8Array(e),r),r},e.UTF8ToString=function(e,t){return e?function(e,t,r){for(var n=t+r,i=t;e[i]&&!(i>=n);)++i;if(i-t>16&&e.subarray&&f)return f.decode(e.subarray(t,i));for(var o="";t<i;){var a=e[t++];if(128&a){var s=63&e[t++];if(192!=(224&a)){var c=63&e[t++];if((a=224==(240&a)?(15&a)<<12|s<<6|c:(7&a)<<18|s<<12|c<<6|63&e[t++])<65536)o+=String.fromCharCode(a);else{var A=a-65536;o+=String.fromCharCode(55296|A>>10,56320|1023&A)}}else o+=String.fromCharCode((31&a)<<6|s)}else o+=String.fromCharCode(a)}return o}(p,e,t):""},e.ALLOC_NORMAL=0,v=function e(){M||k(),M||(v=e)},e.run=k,e.preInit)for("function"==typeof e.preInit&&(e.preInit=[e.preInit]);e.preInit.length>0;)e.preInit.pop()();return k(),e.unloadRuntime=function(){"undefined"!=typeof self&&delete self.Module,e=jsModule=u=m=d=p=void 0},e}},145:()=>{},967:()=>{}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var o=t[n]={exports:{}};return e[n].call(o.exports,o,o.exports,r),o.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};return(()=>{"use strict";r.r(i),r.d(i,{ArgonType:()=>s,hash:()=>d,verify:()=>p,unloadRuntime:()=>h,default:()=>f});var e=r(477),t=r.n(e),o=r(721),a=r.n(o);const s={Argon2d:0,Argon2i:1,Argon2id:2};function c(e){if(c._promise)return c._promise;if(c._module)return Promise.resolve(c._module);let r;return r=function(){if("function"==typeof loadArgon2WasmBinary)return loadArgon2WasmBinary();const e=a();if(e)return Promise.resolve(function(e){if("function"==typeof n)return new Uint8Array(n.from(e,"base64"));const t=atob(e),r=new Uint8Array(new ArrayBuffer(t.length));for(let e=0;e<t.length;e++)r[e]=t.charCodeAt(e);return r}(e));const t="string"==typeof argon2WasmPath?argon2WasmPath:"node_modules/argon2-browser/dist/argon2.wasm";return fetch(t).then((e=>e.arrayBuffer())).then((e=>new Uint8Array(e)))}().then((r=>function(e){const r=t()(e);return new Promise((e=>{r.postRun=()=>e(r)}))}({wasmBinary:r,wasmMemory:e?function(e){const t=Math.min(Math.max(Math.ceil(1024*e/65536),256)+256,32767);return new WebAssembly.Memory({initial:t,maximum:32767})}(e):void 0}))),c._promise=r,r.then((e=>(c._module=e,delete c._promise,e)))}function A(e,t){return e.allocate(t,"i8",e.ALLOC_NORMAL)}function u(e,t){return A(e,new Uint8Array([...t,0]))}function l(e){if("string"!=typeof e)return e;if("function"==typeof TextEncoder)return(new TextEncoder).encode(e);if("function"==typeof n)return n.from(e);throw new Error("Don't know how to encode UTF8")}function d(e){const t=e.mem||1024;return c(t).then((r=>{const n=e.time||1,i=e.parallelism||1,o=l(e.pass),a=u(r,o),c=o.length,d=l(e.salt),p=u(r,d),h=d.length,f=e.type||s.Argon2d,g=r.allocate(new Array(e.hashLen||24),"i8",r.ALLOC_NORMAL),m=e.secret?A(r,e.secret):0,y=e.secret?e.secret.byteLength:0,I=e.ad?A(r,e.ad):0,C=e.ad?e.ad.byteLength:0,E=e.hashLen||24,B=r._argon2_encodedlen(n,t,i,h,E,f),w=r.allocate(new Array(B+1),"i8",r.ALLOC_NORMAL);let Q,v,N;try{v=r._argon2_hash_ext(n,t,i,a,c,p,h,g,E,w,B,f,m,y,I,C,19)}catch(e){Q=e}if(0!==v||Q){try{Q||(Q=r.UTF8ToString(r._argon2_error_message(v)))}catch(e){}N={message:Q,code:v}}else{let e="";const t=new Uint8Array(E);for(let n=0;n<E;n++){const i=r.HEAP8[g+n];t[n]=i,e+=("0"+(255&i).toString(16)).slice(-2)}N={hash:t,hashHex:e,encoded:r.UTF8ToString(w)}}try{r._free(a),r._free(p),r._free(g),r._free(w),I&&r._free(I),m&&r._free(m)}catch(e){}if(Q)throw N;return N}))}function p(e){return c().then((t=>{const r=l(e.pass),n=u(t,r),i=r.length,o=e.secret?A(t,e.secret):0,a=e.secret?e.secret.byteLength:0,c=e.ad?A(t,e.ad):0,d=e.ad?e.ad.byteLength:0,p=u(t,l(e.encoded));let h,f,g,m=e.type;if(void 0===m){let t=e.encoded.split("$")[1];t&&(t=t.replace("a","A"),m=s[t]||s.Argon2d)}try{f=t._argon2_verify_ext(p,n,i,o,a,c,d,m)}catch(e){h=e}if(f||h){try{h||(h=t.UTF8ToString(t._argon2_error_message(f)))}catch(e){}g={message:h,code:f}}try{t._free(n),t._free(p)}catch(e){}if(h)throw g;return g}))}function h(){c._module&&(c._module.unloadRuntime(),delete c._promise,delete c._module)}const f={ArgonType:s,hash:d,verify:p,unloadRuntime:h}})(),i})()},673:function(e,t,r){const{hash:n}=r(9250);t.MD=2,t.vp=function(e,t){return n({pass:e,hashLen:t.hashLength,salt:t.salt,time:t.timeCost,mem:t.memoryCost,type:t.type,...t}).then((({hash:e})=>e))}},8826:function(e){!function(t){"use strict";function r(e){return parseInt(e)===e}function n(e){if(!r(e.length))return!1;for(var t=0;t<e.length;t++)if(!r(e[t])||e[t]<0||e[t]>255)return!1;return!0}function i(e,t){if(e.buffer&&"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);r<e.length;){var n=e.charCodeAt(r++);37===n?(t.push(parseInt(e.substr(r,2),16)),r+=2):t.push(n)}return i(t)},fromBytes:function(e){for(var t=[],r=0;r<e.length;){var n=e[r];n<128?(t.push(String.fromCharCode(n)),r++):n>191&&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("")}},A=(s="0123456789abcdef",{toBytes:function(e){for(var t=[],r=0;r<e.length;r+=2)t.push(parseInt(e.substr(r,2),16));return t},fromBytes:function(e){for(var t=[],r=0;r<e.length;r++){var n=e[r];t.push(s[(240&n)>>4]+s[15&n])}return t.join("")}}),u={16:10,24:12,32:14},l=[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],d=[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],p=[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],h=[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],f=[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],m=[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],y=[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],I=[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],C=[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],E=[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],B=[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],w=[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],Q=[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],v=[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 N(e){for(var t=[],r=0;r<e.length;r+=4)t.push(e[r]<<24|e[r+1]<<16|e[r+2]<<8|e[r+3]);return t}var b=function(e){if(!(this instanceof b))throw Error("AES must be instanitated with `new`");Object.defineProperty(this,"key",{value:i(e,!0)}),this._prepare()};b.prototype._prepare=function(){var e=u[this.key.length];if(null==e)throw new Error("invalid key size (must be 16, 24 or 32 bytes)");this._Ke=[],this._Kd=[];for(var t=0;t<=e;t++)this._Ke.push([0,0,0,0]),this._Kd.push([0,0,0,0]);var r,n=4*(e+1),i=this.key.length/4,o=N(this.key);for(t=0;t<i;t++)r=t>>2,this._Ke[r][t%4]=o[t],this._Kd[e-r][t%4]=o[t];for(var a,s=0,c=i;c<n;){if(a=o[i-1],o[0]^=d[a>>16&255]<<24^d[a>>8&255]<<16^d[255&a]<<8^d[a>>24&255]^l[s]<<24,s+=1,8!=i)for(t=1;t<i;t++)o[t]^=o[t-1];else{for(t=1;t<i/2;t++)o[t]^=o[t-1];for(a=o[i/2-1],o[i/2]^=d[255&a]^d[a>>8&255]<<8^d[a>>16&255]<<16^d[a>>24&255]<<24,t=i/2+1;t<i;t++)o[t]^=o[t-1]}for(t=0;t<i&&c<n;)A=c>>2,p=c%4,this._Ke[A][p]=o[t],this._Kd[e-A][p]=o[t++],c++}for(var A=1;A<e;A++)for(var p=0;p<4;p++)a=this._Kd[A][p],this._Kd[A][p]=B[a>>24&255]^w[a>>16&255]^Q[a>>8&255]^v[255&a]},b.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=N(e),i=0;i<4;i++)n[i]^=this._Ke[0][i];for(var a=1;a<t;a++){for(i=0;i<4;i++)r[i]=h[n[i]>>24&255]^f[n[(i+1)%4]>>16&255]^g[n[(i+2)%4]>>8&255]^m[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&(d[n[i]>>24&255]^s>>24),c[4*i+1]=255&(d[n[(i+1)%4]>>16&255]^s>>16),c[4*i+2]=255&(d[n[(i+2)%4]>>8&255]^s>>8),c[4*i+3]=255&(d[255&n[(i+3)%4]]^s);return c},b.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=N(e),i=0;i<4;i++)n[i]^=this._Kd[0][i];for(var a=1;a<t;a++){for(i=0;i<4;i++)r[i]=y[n[i]>>24&255]^I[n[(i+3)%4]>>16&255]^C[n[(i+2)%4]>>8&255]^E[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&(p[n[i]>>24&255]^s>>24),c[4*i+1]=255&(p[n[(i+3)%4]>>16&255]^s>>16),c[4*i+2]=255&(p[n[(i+2)%4]>>8&255]^s>>8),c[4*i+3]=255&(p[255&n[(i+1)%4]]^s);return c};var S=function(e){if(!(this instanceof S))throw Error("AES must be instanitated with `new`");this.description="Electronic Code Block",this.name="ecb",this._aes=new b(e)};S.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<e.length;n+=16)a(e,r,0,n,n+16),a(r=this._aes.encrypt(r),t,n);return t},S.prototype.decrypt=function(e){if((e=i(e)).length%16!=0)throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");for(var t=o(e.length),r=o(16),n=0;n<e.length;n+=16)a(e,r,0,n,n+16),a(r=this._aes.decrypt(r),t,n);return t};var x=function(e,t){if(!(this instanceof x))throw Error("AES must be instanitated with `new`");if(this.description="Cipher Block Chaining",this.name="cbc",t){if(16!=t.length)throw new Error("invalid initialation vector size (must be 16 bytes)")}else t=o(16);this._lastCipherblock=i(t,!0),this._aes=new b(e)};x.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<e.length;n+=16){a(e,r,0,n,n+16);for(var s=0;s<16;s++)r[s]^=this._lastCipherblock[s];this._lastCipherblock=this._aes.encrypt(r),a(this._lastCipherblock,t,n)}return t},x.prototype.decrypt=function(e){if((e=i(e)).length%16!=0)throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");for(var t=o(e.length),r=o(16),n=0;n<e.length;n+=16){a(e,r,0,n,n+16),r=this._aes.decrypt(r);for(var s=0;s<16;s++)t[n+s]=r[s]^this._lastCipherblock[s];a(e,this._lastCipherblock,0,n,n+16)}return t};var T=function(e,t,r){if(!(this instanceof T))throw Error("AES must be instanitated with `new`");if(this.description="Cipher Feedback",this.name="cfb",t){if(16!=t.length)throw new Error("invalid initialation vector size (must be 16 size)")}else t=o(16);r||(r=1),this.segmentSize=r,this._shiftRegister=i(t,!0),this._aes=new b(e)};T.prototype.encrypt=function(e){if(e.length%this.segmentSize!=0)throw new Error("invalid plaintext size (must be segmentSize bytes)");for(var t,r=i(e,!0),n=0;n<r.length;n+=this.segmentSize){t=this._aes.encrypt(this._shiftRegister);for(var o=0;o<this.segmentSize;o++)r[n+o]^=t[o];a(this._shiftRegister,this._shiftRegister,0,this.segmentSize),a(r,this._shiftRegister,16-this.segmentSize,n,n+this.segmentSize)}return r},T.prototype.decrypt=function(e){if(e.length%this.segmentSize!=0)throw new Error("invalid ciphertext size (must be segmentSize bytes)");for(var t,r=i(e,!0),n=0;n<r.length;n+=this.segmentSize){t=this._aes.encrypt(this._shiftRegister);for(var o=0;o<this.segmentSize;o++)r[n+o]^=t[o];a(this._shiftRegister,this._shiftRegister,0,this.segmentSize),a(e,this._shiftRegister,16-this.segmentSize,n,n+this.segmentSize)}return r};var _=function(e,t){if(!(this instanceof _))throw Error("AES must be instanitated with `new`");if(this.description="Output Feedback",this.name="ofb",t){if(16!=t.length)throw new Error("invalid initialation vector size (must be 16 bytes)")}else t=o(16);this._lastPrecipher=i(t,!0),this._lastPrecipherIndex=16,this._aes=new b(e)};_.prototype.encrypt=function(e){for(var t=i(e,!0),r=0;r<t.length;r++)16===this._lastPrecipherIndex&&(this._lastPrecipher=this._aes.encrypt(this._lastPrecipher),this._lastPrecipherIndex=0),t[r]^=this._lastPrecipher[this._lastPrecipherIndex++];return t},_.prototype.decrypt=_.prototype.encrypt;var R=function(e){if(!(this instanceof R))throw Error("Counter must be instanitated with `new`");0===e||e||(e=1),"number"==typeof e?(this._counter=o(16),this.setValue(e)):this.setBytes(e)};R.prototype.setValue=function(e){if("number"!=typeof e||parseInt(e)!=e)throw new Error("invalid counter value (must be an integer)");if(e>Number.MAX_SAFE_INTEGER)throw new Error("integer value out of safe range");for(var t=15;t>=0;--t)this._counter[t]=e%256,e=parseInt(e/256)},R.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},R.prototype.increment=function(){for(var e=15;e>=0;e--){if(255!==this._counter[e]){this._counter[e]++;break}this._counter[e]=0}};var M=function(e,t){if(!(this instanceof M))throw Error("AES must be instanitated with `new`");this.description="Counter",this.name="ctr",t instanceof R||(t=new R(t)),this._counter=t,this._remainingCounter=null,this._remainingCounterIndex=16,this._aes=new b(e)};M.prototype.encrypt=function(e){for(var t=i(e,!0),r=0;r<t.length;r++)16===this._remainingCounterIndex&&(this._remainingCounter=this._aes.encrypt(this._counter._counter),this._remainingCounterIndex=0,this._counter.increment()),t[r]^=this._remainingCounter[this._remainingCounterIndex++];return t},M.prototype.decrypt=M.prototype.encrypt;var D={AES:b,Counter:R,ModeOfOperation:{ecb:S,cbc:x,cfb:T,ofb:_,ctr:M},utils:{hex:A,utf8:c},padding:{pkcs7:{pad:function(e){var t=16-(e=i(e,!0)).length%16,r=o(e.length+t);a(e,r);for(var n=e.length;n<r.length;n++)r[n]=t;return r},strip:function(e){if((e=i(e,!0)).length<16)throw new Error("PKCS#7 invalid length");var t=e[e.length-1];if(t>16)throw new Error("PKCS#7 padding byte out of range");for(var r=e.length-t,n=0;n<t;n++)if(e[r+n]!==t)throw new Error("PKCS#7 invalid padding byte");var s=o(r);return a(e,s,0,0,r),s}}},_arrayTest:{coerceArray:i,createArray:o,copyArray:a}};e.exports=D}()},8162:function(e){"use strict";e.exports=function(e){if(e.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),r=0;r<t.length;r++)t[r]=255;for(var n=0;n<e.length;n++){var i=e.charAt(n),o=i.charCodeAt(0);if(255!==t[o])throw new TypeError(i+" is ambiguous");t[o]=n}var a=e.length,s=e.charAt(0),c=Math.log(a)/Math.log(256),A=Math.log(256)/Math.log(a);function u(e){if("string"!=typeof e)throw new TypeError("Expected String");if(0===e.length)return new Uint8Array;for(var r=0,n=0,i=0;e[r]===s;)n++,r++;for(var o=(e.length-r)*c+1>>>0,A=new Uint8Array(o);e[r];){var u=t[e.charCodeAt(r)];if(255===u)return;for(var l=0,d=o-1;(0!==u||l<i)&&-1!==d;d--,l++)u+=a*A[d]>>>0,A[d]=u%256>>>0,u=u/256>>>0;if(0!==u)throw new Error("Non-zero carry");i=l,r++}for(var p=o-i;p!==o&&0===A[p];)p++;for(var h=new Uint8Array(n+(o-p)),f=n;p!==o;)h[f++]=A[p++];return h}return{encode:function(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(0===t.length)return"";for(var r=0,n=0,i=0,o=t.length;i!==o&&0===t[i];)i++,r++;for(var c=(o-i)*A+1>>>0,u=new Uint8Array(c);i!==o;){for(var l=t[i],d=0,p=c-1;(0!==l||d<n)&&-1!==p;p--,d++)l+=256*u[p]>>>0,u[p]=l%a>>>0,l=l/a>>>0;if(0!==l)throw new Error("Non-zero carry");n=d,i++}for(var h=c-n;h!==c&&0===u[h];)h++;for(var f=s.repeat(r);h<c;++h)f+=e.charAt(u[h]);return f},decodeUnsafe:u,decode:function(e){var t=u(e);if(t)return t;throw new Error("Non-base"+a+" character")}}}},9742:function(e,t){"use strict";t.byteLength=function(e){var t=c(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,o=c(e),a=o[0],s=o[1],A=new i(function(e,t,r){return 3*(t+r)/4-r}(0,a,s)),u=0,l=s>0?a-4:a;for(r=0;r<l;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],A[u++]=t>>16&255,A[u++]=t>>8&255,A[u++]=255&t;return 2===s&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,A[u++]=255&t),1===s&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,A[u++]=t>>8&255,A[u++]=255&t),A},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,o=[],a=16383,s=0,c=n-i;s<c;s+=a)o.push(A(e,s,s+a>c?c:s+a));return 1===i?(t=e[n-1],o.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],o.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),o.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,s=o.length;a<s;++a)r[a]=o[a],n[o.charCodeAt(a)]=a;function c(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function A(e,t,n){for(var i,o,a=[],s=t;s<n;s+=3)i=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),a.push(r[(o=i)>>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return a.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},4431:function(e,t,r){var n;!function(i){"use strict";var o,a=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,s=Math.ceil,c=Math.floor,A="[BigNumber Error] ",u=A+"Number primitive has more than 15 significant digits: ",l=1e14,d=14,p=9007199254740991,h=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],f=1e7,g=1e9;function m(e){var t=0|e;return e>0||e===t?t:t-1}function y(e){for(var t,r,n=1,i=e.length,o=e[0]+"";n<i;){for(t=e[n++]+"",r=d-t.length;r--;t="0"+t);o+=t}for(i=o.length;48===o.charCodeAt(--i););return o.slice(0,i+1||1)}function I(e,t){var r,n,i=e.c,o=t.c,a=e.s,s=t.s,c=e.e,A=t.e;if(!a||!s)return null;if(r=i&&!i[0],n=o&&!o[0],r||n)return r?n?0:-s:a;if(a!=s)return a;if(r=a<0,n=c==A,!i||!o)return n?0:!i^r?1:-1;if(!n)return c>A^r?1:-1;for(s=(c=i.length)<(A=o.length)?c:A,a=0;a<s;a++)if(i[a]!=o[a])return i[a]>o[a]^r?1:-1;return c==A?0:c>A^r?1:-1}function C(e,t,r,n){if(e<t||e>r||e!==c(e))throw Error(A+(n||"Argument")+("number"==typeof e?e<t||e>r?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function E(e){var t=e.c.length-1;return m(e.e/d)==t&&e.c[t]%2!=0}function B(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function w(e,t,r){var n,i;if(t<0){for(i=r+".";++t;i+=r);e=i+e}else if(++t>(n=e.length)){for(i=r,t-=n;--t;i+=r);e+=i}else t<n&&(e=e.slice(0,t)+"."+e.slice(t));return e}o=function e(t){var r,n,i,o,Q,v,N,b,S,x,T=H.prototype={constructor:H,toString:null,valueOf:null},_=new H(1),R=20,M=4,D=-7,O=21,z=-1e7,k=1e7,P=!1,U=1,F=0,q={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},L="0123456789abcdefghijklmnopqrstuvwxyz",G=!0;function H(e,t){var r,o,s,A,l,h,f,g,m=this;if(!(m instanceof H))return new H(e,t);if(null==t){if(e&&!0===e._isBigNumber)return m.s=e.s,void(!e.c||e.e>k?m.c=m.e=null:e.e<z?m.c=[m.e=0]:(m.e=e.e,m.c=e.c.slice()));if((h="number"==typeof e)&&0*e==0){if(m.s=1/e<0?(e=-e,-1):1,e===~~e){for(A=0,l=e;l>=10;l/=10,A++);return void(A>k?m.c=m.e=null:(m.e=A,m.c=[e]))}g=String(e)}else{if(!a.test(g=String(e)))return i(m,g,h);m.s=45==g.charCodeAt(0)?(g=g.slice(1),-1):1}(A=g.indexOf("."))>-1&&(g=g.replace(".","")),(l=g.search(/e/i))>0?(A<0&&(A=l),A+=+g.slice(l+1),g=g.substring(0,l)):A<0&&(A=g.length)}else{if(C(t,2,L.length,"Base"),10==t&&G)return K(m=new H(e),R+m.e+1,M);if(g=String(e),h="number"==typeof e){if(0*e!=0)return i(m,g,h,t);if(m.s=1/e<0?(g=g.slice(1),-1):1,H.DEBUG&&g.replace(/^0\.0*|\./,"").length>15)throw Error(u+e)}else m.s=45===g.charCodeAt(0)?(g=g.slice(1),-1):1;for(r=L.slice(0,t),A=l=0,f=g.length;l<f;l++)if(r.indexOf(o=g.charAt(l))<0){if("."==o){if(l>A){A=f;continue}}else if(!s&&(g==g.toUpperCase()&&(g=g.toLowerCase())||g==g.toLowerCase()&&(g=g.toUpperCase()))){s=!0,l=-1,A=0;continue}return i(m,String(e),h,t)}h=!1,(A=(g=n(g,t,10,m.s)).indexOf("."))>-1?g=g.replace(".",""):A=g.length}for(l=0;48===g.charCodeAt(l);l++);for(f=g.length;48===g.charCodeAt(--f););if(g=g.slice(l,++f)){if(f-=l,h&&H.DEBUG&&f>15&&(e>p||e!==c(e)))throw Error(u+m.s*e);if((A=A-l-1)>k)m.c=m.e=null;else if(A<z)m.c=[m.e=0];else{if(m.e=A,m.c=[],l=(A+1)%d,A<0&&(l+=d),l<f){for(l&&m.c.push(+g.slice(0,l)),f-=d;l<f;)m.c.push(+g.slice(l,l+=d));l=d-(g=g.slice(l)).length}else l-=f;for(;l--;g+="0");m.c.push(+g)}}else m.c=[m.e=0]}function j(e,t,r,n){var i,o,a,s,c;if(null==r?r=M:C(r,0,8),!e.c)return e.toString();if(i=e.c[0],a=e.e,null==t)c=y(e.c),c=1==n||2==n&&(a<=D||a>=O)?B(c,a):w(c,a,"0");else if(o=(e=K(new H(e),t,r)).e,s=(c=y(e.c)).length,1==n||2==n&&(t<=o||o<=D)){for(;s<t;c+="0",s++);c=B(c,o)}else if(t-=a,c=w(c,o,"0"),o+1>s){if(--t>0)for(c+=".";t--;c+="0");}else if((t+=o-s)>0)for(o+1==s&&(c+=".");t--;c+="0");return e.s<0&&i?"-"+c:c}function Y(e,t){for(var r,n=1,i=new H(e[0]);n<e.length;n++){if(!(r=new H(e[n])).s){i=r;break}t.call(i,r)&&(i=r)}return i}function $(e,t,r){for(var n=1,i=t.length;!t[--i];t.pop());for(i=t[0];i>=10;i/=10,n++);return(r=n+r*d-1)>k?e.c=e.e=null:r<z?e.c=[e.e=0]:(e.e=r,e.c=t),e}function K(e,t,r,n){var i,o,a,A,u,p,f,g=e.c,m=h;if(g){e:{for(i=1,A=g[0];A>=10;A/=10,i++);if((o=t-i)<0)o+=d,a=t,f=(u=g[p=0])/m[i-a-1]%10|0;else if((p=s((o+1)/d))>=g.length){if(!n)break e;for(;g.length<=p;g.push(0));u=f=0,i=1,a=(o%=d)-d+1}else{for(u=A=g[p],i=1;A>=10;A/=10,i++);f=(a=(o%=d)-d+i)<0?0:u/m[i-a-1]%10|0}if(n=n||t<0||null!=g[p+1]||(a<0?u:u%m[i-a-1]),n=r<4?(f||n)&&(0==r||r==(e.s<0?3:2)):f>5||5==f&&(4==r||n||6==r&&(o>0?a>0?u/m[i-a]:0:g[p-1])%10&1||r==(e.s<0?8:7)),t<1||!g[0])return g.length=0,n?(t-=e.e+1,g[0]=m[(d-t%d)%d],e.e=-t||0):g[0]=e.e=0,e;if(0==o?(g.length=p,A=1,p--):(g.length=p+1,A=m[d-o],g[p]=a>0?c(u/m[i-a]%m[a])*A:0),n)for(;;){if(0==p){for(o=1,a=g[0];a>=10;a/=10,o++);for(a=g[0]+=A,A=1;a>=10;a/=10,A++);o!=A&&(e.e++,g[0]==l&&(g[0]=1));break}if(g[p]+=A,g[p]!=l)break;g[p--]=0,A=1}for(o=g.length;0===g[--o];g.pop());}e.e>k?e.c=e.e=null:e.e<z&&(e.c=[e.e=0])}return e}function V(e){var t,r=e.e;return null===r?e.toString():(t=y(e.c),t=r<=D||r>=O?B(t,r):w(t,r,"0"),e.s<0?"-"+t:t)}return H.clone=e,H.ROUND_UP=0,H.ROUND_DOWN=1,H.ROUND_CEIL=2,H.ROUND_FLOOR=3,H.ROUND_HALF_UP=4,H.ROUND_HALF_DOWN=5,H.ROUND_HALF_EVEN=6,H.ROUND_HALF_CEIL=7,H.ROUND_HALF_FLOOR=8,H.EUCLID=9,H.config=H.set=function(e){var t,r;if(null!=e){if("object"!=typeof e)throw Error(A+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(C(r=e[t],0,g,t),R=r),e.hasOwnProperty(t="ROUNDING_MODE")&&(C(r=e[t],0,8,t),M=r),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((r=e[t])&&r.pop?(C(r[0],-g,0,t),C(r[1],0,g,t),D=r[0],O=r[1]):(C(r,-g,g,t),D=-(O=r<0?-r:r))),e.hasOwnProperty(t="RANGE"))if((r=e[t])&&r.pop)C(r[0],-g,-1,t),C(r[1],1,g,t),z=r[0],k=r[1];else{if(C(r,-g,g,t),!r)throw Error(A+t+" cannot be zero: "+r);z=-(k=r<0?-r:r)}if(e.hasOwnProperty(t="CRYPTO")){if((r=e[t])!==!!r)throw Error(A+t+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw P=!r,Error(A+"crypto unavailable");P=r}else P=r}if(e.hasOwnProperty(t="MODULO_MODE")&&(C(r=e[t],0,9,t),U=r),e.hasOwnProperty(t="POW_PRECISION")&&(C(r=e[t],0,g,t),F=r),e.hasOwnProperty(t="FORMAT")){if("object"!=typeof(r=e[t]))throw Error(A+t+" not an object: "+r);q=r}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(r=e[t])||/^.?$|[+\-.\s]|(.).*\1/.test(r))throw Error(A+t+" invalid: "+r);G="0123456789"==r.slice(0,10),L=r}}return{DECIMAL_PLACES:R,ROUNDING_MODE:M,EXPONENTIAL_AT:[D,O],RANGE:[z,k],CRYPTO:P,MODULO_MODE:U,POW_PRECISION:F,FORMAT:q,ALPHABET:L}},H.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!H.DEBUG)return!0;var t,r,n=e.c,i=e.e,o=e.s;e:if("[object Array]"=={}.toString.call(n)){if((1===o||-1===o)&&i>=-g&&i<=g&&i===c(i)){if(0===n[0]){if(0===i&&1===n.length)return!0;break e}if((t=(i+1)%d)<1&&(t+=d),String(n[0]).length==t){for(t=0;t<n.length;t++)if((r=n[t])<0||r>=l||r!==c(r))break e;if(0!==r)return!0}}}else if(null===n&&null===i&&(null===o||1===o||-1===o))return!0;throw Error(A+"Invalid BigNumber: "+e)},H.maximum=H.max=function(){return Y(arguments,T.lt)},H.minimum=H.min=function(){return Y(arguments,T.gt)},H.random=(o=9007199254740992,Q=Math.random()*o&2097151?function(){return c(Math.random()*o)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,r,n,i,o,a=0,u=[],l=new H(_);if(null==e?e=R:C(e,0,g),i=s(e/d),P)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(i*=2));a<i;)(o=131072*t[a]+(t[a+1]>>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),t[a]=r[0],t[a+1]=r[1]):(u.push(o%1e14),a+=2);a=i/2}else{if(!crypto.randomBytes)throw P=!1,Error(A+"crypto unavailable");for(t=crypto.randomBytes(i*=7);a<i;)(o=281474976710656*(31&t[a])+1099511627776*t[a+1]+4294967296*t[a+2]+16777216*t[a+3]+(t[a+4]<<16)+(t[a+5]<<8)+t[a+6])>=9e15?crypto.randomBytes(7).copy(t,a):(u.push(o%1e14),a+=7);a=i/7}if(!P)for(;a<i;)(o=Q())<9e15&&(u[a++]=o%1e14);for(i=u[--a],e%=d,i&&e&&(o=h[d-e],u[a]=c(i/o)*o);0===u[a];u.pop(),a--);if(a<0)u=[n=0];else{for(n=-1;0===u[0];u.splice(0,1),n-=d);for(a=1,o=u[0];o>=10;o/=10,a++);a<d&&(n-=d-a)}return l.e=n,l.c=u,l}),H.sum=function(){for(var e=1,t=arguments,r=new H(t[0]);e<t.length;)r=r.plus(t[e++]);return r},n=function(){var e="0123456789";function t(e,t,r,n){for(var i,o,a=[0],s=0,c=e.length;s<c;){for(o=a.length;o--;a[o]*=t);for(a[0]+=n.indexOf(e.charAt(s++)),i=0;i<a.length;i++)a[i]>r-1&&(null==a[i+1]&&(a[i+1]=0),a[i+1]+=a[i]/r|0,a[i]%=r)}return a.reverse()}return function(n,i,o,a,s){var c,A,u,l,d,p,h,f,g=n.indexOf("."),m=R,I=M;for(g>=0&&(l=F,F=0,n=n.replace(".",""),p=(f=new H(i)).pow(n.length-g),F=l,f.c=t(w(y(p.c),p.e,"0"),10,o,e),f.e=f.c.length),u=l=(h=t(n,i,o,s?(c=L,e):(c=e,L))).length;0==h[--l];h.pop());if(!h[0])return c.charAt(0);if(g<0?--u:(p.c=h,p.e=u,p.s=a,h=(p=r(p,f,m,I,o)).c,d=p.r,u=p.e),g=h[A=u+m+1],l=o/2,d=d||A<0||null!=h[A+1],d=I<4?(null!=g||d)&&(0==I||I==(p.s<0?3:2)):g>l||g==l&&(4==I||d||6==I&&1&h[A-1]||I==(p.s<0?8:7)),A<1||!h[0])n=d?w(c.charAt(1),-m,c.charAt(0)):c.charAt(0);else{if(h.length=A,d)for(--o;++h[--A]>o;)h[A]=0,A||(++u,h=[1].concat(h));for(l=h.length;!h[--l];);for(g=0,n="";g<=l;n+=c.charAt(h[g++]));n=w(n,u,c.charAt(0))}return n}}(),r=function(){function e(e,t,r){var n,i,o,a,s=0,c=e.length,A=t%f,u=t/f|0;for(e=e.slice();c--;)s=((i=A*(o=e[c]%f)+(n=u*o+(a=e[c]/f|0)*A)%f*f+s)/r|0)+(n/f|0)+u*a,e[c]=i%r;return s&&(e=[s].concat(e)),e}function t(e,t,r,n){var i,o;if(r!=n)o=r>n?1:-1;else for(i=o=0;i<r;i++)if(e[i]!=t[i]){o=e[i]>t[i]?1:-1;break}return o}function r(e,t,r,n){for(var i=0;r--;)e[r]-=i,i=e[r]<t[r]?1:0,e[r]=i*n+e[r]-t[r];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(n,i,o,a,s){var A,u,p,h,f,g,y,I,C,E,B,w,Q,v,N,b,S,x=n.s==i.s?1:-1,T=n.c,_=i.c;if(!(T&&T[0]&&_&&_[0]))return new H(n.s&&i.s&&(T?!_||T[0]!=_[0]:_)?T&&0==T[0]||!_?0*x:x/0:NaN);for(C=(I=new H(x)).c=[],x=o+(u=n.e-i.e)+1,s||(s=l,u=m(n.e/d)-m(i.e/d),x=x/d|0),p=0;_[p]==(T[p]||0);p++);if(_[p]>(T[p]||0)&&u--,x<0)C.push(1),h=!0;else{for(v=T.length,b=_.length,p=0,x+=2,(f=c(s/(_[0]+1)))>1&&(_=e(_,f,s),T=e(T,f,s),b=_.length,v=T.length),Q=b,B=(E=T.slice(0,b)).length;B<b;E[B++]=0);S=_.slice(),S=[0].concat(S),N=_[0],_[1]>=s/2&&N++;do{if(f=0,(A=t(_,E,b,B))<0){if(w=E[0],b!=B&&(w=w*s+(E[1]||0)),(f=c(w/N))>1)for(f>=s&&(f=s-1),y=(g=e(_,f,s)).length,B=E.length;1==t(g,E,y,B);)f--,r(g,b<y?S:_,y,s),y=g.length,A=1;else 0==f&&(A=f=1),y=(g=_.slice()).length;if(y<B&&(g=[0].concat(g)),r(E,g,B,s),B=E.length,-1==A)for(;t(_,E,b,B)<1;)f++,r(E,b<B?S:_,B,s),B=E.length}else 0===A&&(f++,E=[0]);C[p++]=f,E[0]?E[B++]=T[Q]||0:(E=[T[Q]],B=1)}while((Q++<v||null!=E[0])&&x--);h=null!=E[0],C[0]||C.splice(0,1)}if(s==l){for(p=1,x=C[0];x>=10;x/=10,p++);K(I,o+(I.e=p+u*d-1)+1,a,h)}else I.e=u,I.r=+h;return I}}(),v=/^(-?)0([xbo])(?=\w[\w.]*$)/i,N=/^([^.]+)\.$/,b=/^\.([^.]+)$/,S=/^-?(Infinity|NaN)$/,x=/^\s*\+(?=[\w.])|^\s+|\s+$/g,i=function(e,t,r,n){var i,o=r?t:t.replace(x,"");if(S.test(o))e.s=isNaN(o)?null:o<0?-1:1;else{if(!r&&(o=o.replace(v,(function(e,t,r){return i="x"==(r=r.toLowerCase())?16:"b"==r?2:8,n&&n!=i?e:t})),n&&(i=n,o=o.replace(N,"$1").replace(b,"0.$1")),t!=o))return new H(o,i);if(H.DEBUG)throw Error(A+"Not a"+(n?" base "+n:"")+" number: "+t);e.s=null}e.c=e.e=null},T.absoluteValue=T.abs=function(){var e=new H(this);return e.s<0&&(e.s=1),e},T.comparedTo=function(e,t){return I(this,new H(e,t))},T.decimalPlaces=T.dp=function(e,t){var r,n,i,o=this;if(null!=e)return C(e,0,g),null==t?t=M:C(t,0,8),K(new H(o),e+o.e+1,t);if(!(r=o.c))return null;if(n=((i=r.length-1)-m(this.e/d))*d,i=r[i])for(;i%10==0;i/=10,n--);return n<0&&(n=0),n},T.dividedBy=T.div=function(e,t){return r(this,new H(e,t),R,M)},T.dividedToIntegerBy=T.idiv=function(e,t){return r(this,new H(e,t),0,1)},T.exponentiatedBy=T.pow=function(e,t){var r,n,i,o,a,u,l,p,h=this;if((e=new H(e)).c&&!e.isInteger())throw Error(A+"Exponent not an integer: "+V(e));if(null!=t&&(t=new H(t)),a=e.e>14,!h.c||!h.c[0]||1==h.c[0]&&!h.e&&1==h.c.length||!e.c||!e.c[0])return p=new H(Math.pow(+V(h),a?2-E(e):+V(e))),t?p.mod(t):p;if(u=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new H(NaN);(n=!u&&h.isInteger()&&t.isInteger())&&(h=h.mod(t))}else{if(e.e>9&&(h.e>0||h.e<-1||(0==h.e?h.c[0]>1||a&&h.c[1]>=24e7:h.c[0]<8e13||a&&h.c[0]<=9999975e7)))return o=h.s<0&&E(e)?-0:0,h.e>-1&&(o=1/o),new H(u?1/o:o);F&&(o=s(F/d+2))}for(a?(r=new H(.5),u&&(e.s=1),l=E(e)):l=(i=Math.abs(+V(e)))%2,p=new H(_);;){if(l){if(!(p=p.times(h)).c)break;o?p.c.length>o&&(p.c.length=o):n&&(p=p.mod(t))}if(i){if(0===(i=c(i/2)))break;l=i%2}else if(K(e=e.times(r),e.e+1,1),e.e>14)l=E(e);else{if(0==(i=+V(e)))break;l=i%2}h=h.times(h),o?h.c&&h.c.length>o&&(h.c.length=o):n&&(h=h.mod(t))}return n?p:(u&&(p=_.div(p)),t?p.mod(t):o?K(p,F,M,void 0):p)},T.integerValue=function(e){var t=new H(this);return null==e?e=M:C(e,0,8),K(t,t.e+1,e)},T.isEqualTo=T.eq=function(e,t){return 0===I(this,new H(e,t))},T.isFinite=function(){return!!this.c},T.isGreaterThan=T.gt=function(e,t){return I(this,new H(e,t))>0},T.isGreaterThanOrEqualTo=T.gte=function(e,t){return 1===(t=I(this,new H(e,t)))||0===t},T.isInteger=function(){return!!this.c&&m(this.e/d)>this.c.length-2},T.isLessThan=T.lt=function(e,t){return I(this,new H(e,t))<0},T.isLessThanOrEqualTo=T.lte=function(e,t){return-1===(t=I(this,new H(e,t)))||0===t},T.isNaN=function(){return!this.s},T.isNegative=function(){return this.s<0},T.isPositive=function(){return this.s>0},T.isZero=function(){return!!this.c&&0==this.c[0]},T.minus=function(e,t){var r,n,i,o,a=this,s=a.s;if(t=(e=new H(e,t)).s,!s||!t)return new H(NaN);if(s!=t)return e.s=-t,a.plus(e);var c=a.e/d,A=e.e/d,u=a.c,p=e.c;if(!c||!A){if(!u||!p)return u?(e.s=-t,e):new H(p?a:NaN);if(!u[0]||!p[0])return p[0]?(e.s=-t,e):new H(u[0]?a:3==M?-0:0)}if(c=m(c),A=m(A),u=u.slice(),s=c-A){for((o=s<0)?(s=-s,i=u):(A=c,i=p),i.reverse(),t=s;t--;i.push(0));i.reverse()}else for(n=(o=(s=u.length)<(t=p.length))?s:t,s=t=0;t<n;t++)if(u[t]!=p[t]){o=u[t]<p[t];break}if(o&&(i=u,u=p,p=i,e.s=-e.s),(t=(n=p.length)-(r=u.length))>0)for(;t--;u[r++]=0);for(t=l-1;n>s;){if(u[--n]<p[n]){for(r=n;r&&!u[--r];u[r]=t);--u[r],u[n]+=l}u[n]-=p[n]}for(;0==u[0];u.splice(0,1),--A);return u[0]?$(e,u,A):(e.s=3==M?-1:1,e.c=[e.e=0],e)},T.modulo=T.mod=function(e,t){var n,i,o=this;return e=new H(e,t),!o.c||!e.s||e.c&&!e.c[0]?new H(NaN):!e.c||o.c&&!o.c[0]?new H(o):(9==U?(i=e.s,e.s=1,n=r(o,e,0,3),e.s=i,n.s*=i):n=r(o,e,0,U),(e=o.minus(n.times(e))).c[0]||1!=U||(e.s=o.s),e)},T.multipliedBy=T.times=function(e,t){var r,n,i,o,a,s,c,A,u,p,h,g,y,I,C,E=this,B=E.c,w=(e=new H(e,t)).c;if(!(B&&w&&B[0]&&w[0]))return!E.s||!e.s||B&&!B[0]&&!w||w&&!w[0]&&!B?e.c=e.e=e.s=null:(e.s*=E.s,B&&w?(e.c=[0],e.e=0):e.c=e.e=null),e;for(n=m(E.e/d)+m(e.e/d),e.s*=E.s,(c=B.length)<(p=w.length)&&(y=B,B=w,w=y,i=c,c=p,p=i),i=c+p,y=[];i--;y.push(0));for(I=l,C=f,i=p;--i>=0;){for(r=0,h=w[i]%C,g=w[i]/C|0,o=i+(a=c);o>i;)r=((A=h*(A=B[--a]%C)+(s=g*A+(u=B[a]/C|0)*h)%C*C+y[o]+r)/I|0)+(s/C|0)+g*u,y[o--]=A%I;y[o]=r}return r?++n:y.splice(0,1),$(e,y,n)},T.negated=function(){var e=new H(this);return e.s=-e.s||null,e},T.plus=function(e,t){var r,n=this,i=n.s;if(t=(e=new H(e,t)).s,!i||!t)return new H(NaN);if(i!=t)return e.s=-t,n.minus(e);var o=n.e/d,a=e.e/d,s=n.c,c=e.c;if(!o||!a){if(!s||!c)return new H(i/0);if(!s[0]||!c[0])return c[0]?e:new H(s[0]?n:0*i)}if(o=m(o),a=m(a),s=s.slice(),i=o-a){for(i>0?(a=o,r=c):(i=-i,r=s),r.reverse();i--;r.push(0));r.reverse()}for((i=s.length)-(t=c.length)<0&&(r=c,c=s,s=r,t=i),i=0;t;)i=(s[--t]=s[t]+c[t]+i)/l|0,s[t]=l===s[t]?0:s[t]%l;return i&&(s=[i].concat(s),++a),$(e,s,a)},T.precision=T.sd=function(e,t){var r,n,i,o=this;if(null!=e&&e!==!!e)return C(e,1,g),null==t?t=M:C(t,0,8),K(new H(o),e,t);if(!(r=o.c))return null;if(n=(i=r.length-1)*d+1,i=r[i]){for(;i%10==0;i/=10,n--);for(i=r[0];i>=10;i/=10,n++);}return e&&o.e+1>n&&(n=o.e+1),n},T.shiftedBy=function(e){return C(e,-9007199254740991,p),this.times("1e"+e)},T.squareRoot=T.sqrt=function(){var e,t,n,i,o,a=this,s=a.c,c=a.s,A=a.e,u=R+4,l=new H("0.5");if(1!==c||!s||!s[0])return new H(!c||c<0&&(!s||s[0])?NaN:s?a:1/0);if(0==(c=Math.sqrt(+V(a)))||c==1/0?(((t=y(s)).length+A)%2==0&&(t+="0"),c=Math.sqrt(+t),A=m((A+1)/2)-(A<0||A%2),n=new H(t=c==1/0?"5e"+A:(t=c.toExponential()).slice(0,t.indexOf("e")+1)+A)):n=new H(c+""),n.c[0])for((c=(A=n.e)+u)<3&&(c=0);;)if(o=n,n=l.times(o.plus(r(a,o,u,1))),y(o.c).slice(0,c)===(t=y(n.c)).slice(0,c)){if(n.e<A&&--c,"9999"!=(t=t.slice(c-3,c+1))&&(i||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(K(n,n.e+R+2,1),e=!n.times(n).eq(a));break}if(!i&&(K(o,o.e+R+2,0),o.times(o).eq(a))){n=o;break}u+=4,c+=4,i=1}return K(n,n.e+R+1,M,e)},T.toExponential=function(e,t){return null!=e&&(C(e,0,g),e++),j(this,e,t,1)},T.toFixed=function(e,t){return null!=e&&(C(e,0,g),e=e+this.e+1),j(this,e,t)},T.toFormat=function(e,t,r){var n,i=this;if(null==r)null!=e&&t&&"object"==typeof t?(r=t,t=null):e&&"object"==typeof e?(r=e,e=t=null):r=q;else if("object"!=typeof r)throw Error(A+"Argument not an object: "+r);if(n=i.toFixed(e,t),i.c){var o,a=n.split("."),s=+r.groupSize,c=+r.secondaryGroupSize,u=r.groupSeparator||"",l=a[0],d=a[1],p=i.s<0,h=p?l.slice(1):l,f=h.length;if(c&&(o=s,s=c,c=o,f-=o),s>0&&f>0){for(o=f%s||s,l=h.substr(0,o);o<f;o+=s)l+=u+h.substr(o,s);c>0&&(l+=u+h.slice(o)),p&&(l="-"+l)}n=d?l+(r.decimalSeparator||"")+((c=+r.fractionGroupSize)?d.replace(new RegExp("\\d{"+c+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):d):l}return(r.prefix||"")+n+(r.suffix||"")},T.toFraction=function(e){var t,n,i,o,a,s,c,u,l,p,f,g,m=this,I=m.c;if(null!=e&&(!(c=new H(e)).isInteger()&&(c.c||1!==c.s)||c.lt(_)))throw Error(A+"Argument "+(c.isInteger()?"out of range: ":"not an integer: ")+V(c));if(!I)return new H(m);for(t=new H(_),l=n=new H(_),i=u=new H(_),g=y(I),a=t.e=g.length-m.e-1,t.c[0]=h[(s=a%d)<0?d+s:s],e=!e||c.comparedTo(t)>0?a>0?t:l:c,s=k,k=1/0,c=new H(g),u.c[0]=0;p=r(c,t,0,1),1!=(o=n.plus(p.times(i))).comparedTo(e);)n=i,i=o,l=u.plus(p.times(o=l)),u=o,t=c.minus(p.times(o=t)),c=o;return o=r(e.minus(n),i,0,1),u=u.plus(o.times(l)),n=n.plus(o.times(i)),u.s=l.s=m.s,f=r(l,i,a*=2,M).minus(m).abs().comparedTo(r(u,n,a,M).minus(m).abs())<1?[l,i]:[u,n],k=s,f},T.toNumber=function(){return+V(this)},T.toPrecision=function(e,t){return null!=e&&C(e,1,g),j(this,e,t,2)},T.toString=function(e){var t,r=this,i=r.s,o=r.e;return null===o?i?(t="Infinity",i<0&&(t="-"+t)):t="NaN":(null==e?t=o<=D||o>=O?B(y(r.c),o):w(y(r.c),o,"0"):10===e&&G?t=w(y((r=K(new H(r),R+o+1,M)).c),r.e,"0"):(C(e,2,L.length,"Base"),t=n(w(y(r.c),o,"0"),10,e,i,!0)),i<0&&r.c[0]&&(t="-"+t)),t},T.valueOf=T.toJSON=function(){return V(this)},T._isBigNumber=!0,null!=t&&H.set(t),H}(),o.default=o.BigNumber=o,void 0===(n=function(){return o}.call(t,r,t,e))||(e.exports=n)}()},246:function(e){const t=2147483648;var r=function(e){if(!Array.isArray(e))throw new Error("Input must be an Array");if(0===e.length)throw new Error("Path must contain at least one level");for(var t=0;t<e.length;t++)if("number"!=typeof e[t])throw new Error("Path element is not a number");this.path=e};r.validatePathArray=function(e){try{return r.fromPathArray(e),!0}catch(e){return!1}},r.validateString=function(e,t){try{return r.fromString(e,t),!0}catch(e){return!1}},r.fromPathArray=function(e){return new r(e)},r.fromString=function(e,n){if(/^m\//i.test(e))e=e.slice(2);else if(n)throw new Error("Root element is required");for(var i=e.split("/"),o=new Array(i.length),a=0;a<i.length;a++){var s=/(\d+)([hH\']?)/.exec(i[a]);if(null===s)throw new Error("Invalid input");if(o[a]=parseInt(s[1],10),o[a]>=t)throw new Error("Invalid child index");if("h"===s[2]||"H"===s[2]||"'"===s[2])o[a]+=t;else if(0!=s[2].length)throw new Error("Invalid modifier")}return new r(o)},r.prototype.toPathArray=function(){return this.path},r.prototype.toString=function(e,r){for(var n=new Array(this.path.length),i=0;i<this.path.length;i++){var o=this.path[i];n[i]=o&t?(o&~t)+(r?"h":"'"):o}return(e?"":"m/")+n.join("/")},r.prototype.inspect=function(){return"BIPPath <"+this.toString()+">"},e.exports=r},8442:function(e,t,r){const n=r(9488);function i(e,t,r){const n=e[t]+e[r];let i=e[t+1]+e[r+1];n>=4294967296&&i++,e[t]=n,e[t+1]=i}function o(e,t,r,n){let i=e[t]+r;r<0&&(i+=4294967296);let o=e[t+1]+n;i>=4294967296&&o++,e[t]=i,e[t+1]=o}function a(e,t){return e[t]^e[t+1]<<8^e[t+2]<<16^e[t+3]<<24}function s(e,t,r,n,a,s){const c=l[a],A=l[a+1],d=l[s],p=l[s+1];i(u,e,t),o(u,e,c,A);let h=u[n]^u[e],f=u[n+1]^u[e+1];u[n]=f,u[n+1]=h,i(u,r,n),h=u[t]^u[r],f=u[t+1]^u[r+1],u[t]=h>>>24^f<<8,u[t+1]=f>>>24^h<<8,i(u,e,t),o(u,e,d,p),h=u[n]^u[e],f=u[n+1]^u[e+1],u[n]=h>>>16^f<<16,u[n+1]=f>>>16^h<<16,i(u,r,n),h=u[t]^u[r],f=u[t+1]^u[r+1],u[t]=f>>>31^h<<1,u[t+1]=h>>>31^f<<1}const c=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),A=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3].map((function(e){return 2*e}))),u=new Uint32Array(32),l=new Uint32Array(32);function d(e,t){let r=0;for(r=0;r<16;r++)u[r]=e.h[r],u[r+16]=c[r];for(u[24]=u[24]^e.t,u[25]=u[25]^e.t/4294967296,t&&(u[28]=~u[28],u[29]=~u[29]),r=0;r<32;r++)l[r]=a(e.b,4*r);for(r=0;r<12;r++)s(0,8,16,24,A[16*r+0],A[16*r+1]),s(2,10,18,26,A[16*r+2],A[16*r+3]),s(4,12,20,28,A[16*r+4],A[16*r+5]),s(6,14,22,30,A[16*r+6],A[16*r+7]),s(0,10,20,30,A[16*r+8],A[16*r+9]),s(2,12,22,24,A[16*r+10],A[16*r+11]),s(4,14,16,26,A[16*r+12],A[16*r+13]),s(6,8,18,28,A[16*r+14],A[16*r+15]);for(r=0;r<16;r++)e.h[r]=e.h[r]^u[r]^u[r+16]}const p=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);function h(e,t,r,n){if(0===e||e>64)throw new Error("Illegal output length, expected 0 < length <= 64");if(t&&t.length>64)throw new Error("Illegal key, expected Uint8Array with 0 < length <= 64");if(r&&16!==r.length)throw new Error("Illegal salt, expected Uint8Array with length is 16");if(n&&16!==n.length)throw new Error("Illegal personal, expected Uint8Array with length is 16");const i={b:new Uint8Array(128),h:new Uint32Array(16),t:0,c:0,outlen:e};p.fill(0),p[0]=e,t&&(p[1]=t.length),p[2]=1,p[3]=1,r&&p.set(r,32),n&&p.set(n,48);for(let e=0;e<16;e++)i.h[e]=c[e]^a(p,4*e);return t&&(f(i,t),i.c=128),i}function f(e,t){for(let r=0;r<t.length;r++)128===e.c&&(e.t+=e.c,d(e,!1),e.c=0),e.b[e.c++]=t[r]}function g(e){for(e.t+=e.c;e.c<128;)e.b[e.c++]=0;d(e,!0);const t=new Uint8Array(e.outlen);for(let r=0;r<e.outlen;r++)t[r]=e.h[r>>2]>>8*(3&r);return t}function m(e,t,r,i,o){r=r||64,e=n.normalizeInput(e),i&&(i=n.normalizeInput(i)),o&&(o=n.normalizeInput(o));const a=h(r,t,i,o);return f(a,e),g(a)}e.exports={blake2b:m,blake2bHex:function(e,t,r,i,o){const a=m(e,t,r,i,o);return n.toHex(a)},blake2bInit:h,blake2bUpdate:f,blake2bFinal:g}},9488:function(e){function t(e){return(4294967296+e).toString(16).substring(1)}e.exports={normalizeInput:function(e){let t;if(e instanceof Uint8Array)t=e;else{if("string"!=typeof e)throw new Error("Input must be an string, Buffer or Uint8Array");t=(new TextEncoder).encode(e)}return t},toHex:function(e){return Array.prototype.map.call(e,(function(e){return(e<16?"0":"")+e.toString(16)})).join("")},debugPrint:function(e,r,n){let i="\n"+e+" = ";for(let o=0;o<r.length;o+=2){if(32===n)i+=t(r[o]).toUpperCase(),i+=" ",i+=t(r[o+1]).toUpperCase();else{if(64!==n)throw new Error("Invalid size "+n);i+=t(r[o+1]).toUpperCase(),i+=t(r[o]).toUpperCase()}o%6==4?i+="\n"+new Array(e.length+4).join(" "):o<r.length-2&&(i+=" ")}console.log(i)},testSpeed:function(e,t,r){let n=(new Date).getTime();const i=new Uint8Array(t);for(let e=0;e<t;e++)i[e]=e%256;const o=(new Date).getTime();console.log("Generated random input in "+(o-n)+"ms"),n=o;for(let o=0;o<r;o++){const r=e(i),o=(new Date).getTime(),a=o-n;n=o,console.log("Hashed in "+a+"ms: "+r.substring(0,20)+"..."),console.log(Math.round(t/(1<<20)/(a/1e3)*100)/100+" MB PER SECOND")}}}},7191:function(e,t,r){const n=r(8162);e.exports=n("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},8764:function(e,t,r){"use strict";const n=r(9742),i=r(645),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=c,t.SlowBuffer=function(e){return+e!=e&&(e=0),c.alloc(+e)},t.INSPECT_MAX_BYTES=50;const a=2147483647;function s(e){if(e>a)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,c.prototype),t}function c(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return l(e)}return A(e,t,r)}function A(e,t,r){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!c.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|f(e,t);let n=s(r);const i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(V(e,Uint8Array)){const t=new Uint8Array(e);return p(t.buffer,t.byteOffset,t.byteLength)}return d(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(V(e,ArrayBuffer)||e&&V(e.buffer,ArrayBuffer))return p(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(V(e,SharedArrayBuffer)||e&&V(e.buffer,SharedArrayBuffer)))return p(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return c.from(n,t,r);const i=function(e){if(c.isBuffer(e)){const t=0|h(e.length),r=s(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||J(e.length)?s(0):d(e):"Buffer"===e.type&&Array.isArray(e.data)?d(e.data):void 0}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return c.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function u(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function l(e){return u(e),s(e<0?0:0|h(e))}function d(e){const t=e.length<0?0:0|h(e.length),r=s(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function p(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,c.prototype),n}function h(e){if(e>=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return 0|e}function f(e,t){if(c.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||V(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return Y(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return $(e).length;default:if(i)return n?-1:Y(e).length;t=(""+t).toLowerCase(),i=!0}}function g(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return T(this,t,r);case"utf8":case"utf-8":return N(this,t,r);case"ascii":return S(this,t,r);case"latin1":case"binary":return x(this,t,r);case"base64":return v(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function m(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function y(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),J(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=c.from(t,n)),c.isBuffer(t))return 0===t.length?-1:I(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):I(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function I(e,t,r,n,i){let o,a=1,s=e.length,c=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;a=2,s/=2,c/=2,r/=2}function A(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){let n=-1;for(o=r;o<s;o++)if(A(e,o)===A(t,-1===n?0:o-n)){if(-1===n&&(n=o),o-n+1===c)return n*a}else-1!==n&&(o-=o-n),n=-1}else for(r+c>s&&(r=s-c),o=r;o>=0;o--){let r=!0;for(let n=0;n<c;n++)if(A(e,o+n)!==A(t,n)){r=!1;break}if(r)return o}return-1}function C(e,t,r,n){r=Number(r)||0;const i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;const o=t.length;let a;for(n>o/2&&(n=o/2),a=0;a<n;++a){const n=parseInt(t.substr(2*a,2),16);if(J(n))return a;e[r+a]=n}return a}function E(e,t,r,n){return K(Y(t,e.length-r),e,r,n)}function B(e,t,r,n){return K(function(e){const t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function w(e,t,r,n){return K($(t),e,r,n)}function Q(e,t,r,n){return K(function(e,t){let r,n,i;const o=[];for(let a=0;a<e.length&&!((t-=2)<0);++a)r=e.charCodeAt(a),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function v(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function N(e,t,r){r=Math.min(e.length,r);const n=[];let i=t;for(;i<r;){const t=e[i];let o=null,a=t>239?4:t>223?3:t>191?2:1;if(i+a<=r){let r,n,s,c;switch(a){case 1:t<128&&(o=t);break;case 2:r=e[i+1],128==(192&r)&&(c=(31&t)<<6|63&r,c>127&&(o=c));break;case 3:r=e[i+1],n=e[i+2],128==(192&r)&&128==(192&n)&&(c=(15&t)<<12|(63&r)<<6|63&n,c>2047&&(c<55296||c>57343)&&(o=c));break;case 4:r=e[i+1],n=e[i+2],s=e[i+3],128==(192&r)&&128==(192&n)&&128==(192&s)&&(c=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&s,c>65535&&c<1114112&&(o=c))}}null===o?(o=65533,a=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=a}return function(e){const t=e.length;if(t<=b)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=b));return r}(n)}t.kMaxLength=a,c.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),c.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(c.prototype,"parent",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}}),Object.defineProperty(c.prototype,"offset",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}}),c.poolSize=8192,c.from=function(e,t,r){return A(e,t,r)},Object.setPrototypeOf(c.prototype,Uint8Array.prototype),Object.setPrototypeOf(c,Uint8Array),c.alloc=function(e,t,r){return function(e,t,r){return u(e),e<=0?s(e):void 0!==t?"string"==typeof r?s(e).fill(t,r):s(e).fill(t):s(e)}(e,t,r)},c.allocUnsafe=function(e){return l(e)},c.allocUnsafeSlow=function(e){return l(e)},c.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==c.prototype},c.compare=function(e,t){if(V(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),V(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),!c.isBuffer(e)||!c.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},c.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return c.alloc(0);let r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;const n=c.allocUnsafe(t);let i=0;for(r=0;r<e.length;++r){let t=e[r];if(V(t,Uint8Array))i+t.length>n.length?(c.isBuffer(t)||(t=c.from(t)),t.copy(n,i)):Uint8Array.prototype.set.call(n,t,i);else{if(!c.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,i)}i+=t.length}return n},c.byteLength=f,c.prototype._isBuffer=!0,c.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)m(this,t,t+1);return this},c.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)m(this,t,t+3),m(this,t+1,t+2);return this},c.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)m(this,t,t+7),m(this,t+1,t+6),m(this,t+2,t+5),m(this,t+3,t+4);return this},c.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?N(this,0,e):g.apply(this,arguments)},c.prototype.toLocaleString=c.prototype.toString,c.prototype.equals=function(e){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===c.compare(this,e)},c.prototype.inspect=function(){let e="";const r=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},o&&(c.prototype[o]=c.prototype.inspect),c.prototype.compare=function(e,t,r,n,i){if(V(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;let o=(i>>>=0)-(n>>>=0),a=(r>>>=0)-(t>>>=0);const s=Math.min(o,a),A=this.slice(n,i),u=e.slice(t,r);for(let e=0;e<s;++e)if(A[e]!==u[e]){o=A[e],a=u[e];break}return o<a?-1:a<o?1:0},c.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},c.prototype.indexOf=function(e,t,r){return y(this,e,t,r,!0)},c.prototype.lastIndexOf=function(e,t,r){return y(this,e,t,r,!1)},c.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return C(this,e,t,r);case"utf8":case"utf-8":return E(this,e,t,r);case"ascii":case"latin1":case"binary":return B(this,e,t,r);case"base64":return w(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Q(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const b=4096;function S(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function x(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function T(e,t,r){const n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let i="";for(let n=t;n<r;++n)i+=W[e[n]];return i}function _(e,t,r){const n=e.slice(t,r);let i="";for(let e=0;e<n.length-1;e+=2)i+=String.fromCharCode(n[e]+256*n[e+1]);return i}function R(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function M(e,t,r,n,i,o){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function D(e,t,r,n,i){L(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,r}function O(e,t,r,n,i){L(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r+7]=o,o>>=8,e[r+6]=o,o>>=8,e[r+5]=o,o>>=8,e[r+4]=o;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=a,a>>=8,e[r+2]=a,a>>=8,e[r+1]=a,a>>=8,e[r]=a,r+8}function z(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function k(e,t,r,n,o){return t=+t,r>>>=0,o||z(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function P(e,t,r,n,o){return t=+t,r>>>=0,o||z(e,0,r,8),i.write(e,t,r,n,52,8),r+8}c.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);const n=this.subarray(e,t);return Object.setPrototypeOf(n,c.prototype),n},c.prototype.readUintLE=c.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||R(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return n},c.prototype.readUintBE=c.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||R(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n},c.prototype.readUint8=c.prototype.readUInt8=function(e,t){return e>>>=0,t||R(e,1,this.length),this[e]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||R(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||R(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||R(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(e,t){return e>>>=0,t||R(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readBigUInt64LE=X((function(e){G(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||H(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(i)<<BigInt(32))})),c.prototype.readBigUInt64BE=X((function(e){G(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||H(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)})),c.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||R(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*t)),n},c.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||R(e,t,this.length);let n=t,i=1,o=this[e+--n];for(;n>0&&(i*=256);)o+=this[e+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},c.prototype.readInt8=function(e,t){return e>>>=0,t||R(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||R(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(e,t){e>>>=0,t||R(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||R(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return e>>>=0,t||R(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readBigInt64LE=X((function(e){G(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||H(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)})),c.prototype.readBigInt64BE=X((function(e){G(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||H(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+r)})),c.prototype.readFloatLE=function(e,t){return e>>>=0,t||R(e,4,this.length),i.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||R(e,4,this.length),i.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||R(e,8,this.length),i.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||R(e,8,this.length),i.read(this,e,!1,52,8)},c.prototype.writeUintLE=c.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||M(this,e,t,r,Math.pow(2,8*r)-1,0);let i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},c.prototype.writeUintBE=c.prototype.writeUIntBE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||M(this,e,t,r,Math.pow(2,8*r)-1,0);let i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},c.prototype.writeUint8=c.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeBigUInt64LE=X((function(e,t=0){return D(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),c.prototype.writeBigUInt64BE=X((function(e,t=0){return O(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),c.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);M(this,e,t,r,n-1,-n)}let i=0,o=1,a=0;for(this[t]=255&e;++i<r&&(o*=256);)e<0&&0===a&&0!==this[t+i-1]&&(a=1),this[t+i]=(e/o>>0)-a&255;return t+r},c.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);M(this,e,t,r,n-1,-n)}let i=r-1,o=1,a=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===a&&0!==this[t+i+1]&&(a=1),this[t+i]=(e/o>>0)-a&255;return t+r},c.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},c.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||M(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeBigInt64LE=X((function(e,t=0){return D(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),c.prototype.writeBigInt64BE=X((function(e,t=0){return O(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),c.prototype.writeFloatLE=function(e,t,r){return k(this,e,t,!0,r)},c.prototype.writeFloatBE=function(e,t,r){return k(this,e,t,!1,r)},c.prototype.writeDoubleLE=function(e,t,r){return P(this,e,t,!0,r)},c.prototype.writeDoubleBE=function(e,t,r){return P(this,e,t,!1,r)},c.prototype.copy=function(e,t,r,n){if(!c.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);const i=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),i},c.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!c.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){const t=e.charCodeAt(0);("utf8"===n&&t<128||"latin1"===n)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;let i;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{const o=c.isBuffer(e)?e:c.from(e,n),a=o.length;if(0===a)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=o[i%a]}return this};const U={};function F(e,t,r){U[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function q(e){let t="",r=e.length;const n="-"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function L(e,t,r,n,i,o){if(e>r||e<t){const n="bigint"==typeof t?"n":"";let i;throw i=o>3?0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(o+1)}${n}`:`>= -(2${n} ** ${8*(o+1)-1}${n}) and < 2 ** ${8*(o+1)-1}${n}`:`>= ${t}${n} and <= ${r}${n}`,new U.ERR_OUT_OF_RANGE("value",i,e)}!function(e,t,r){G(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||H(t,e.length-(r+1))}(n,i,o)}function G(e,t){if("number"!=typeof e)throw new U.ERR_INVALID_ARG_TYPE(t,"number",e)}function H(e,t,r){if(Math.floor(e)!==e)throw G(e,r),new U.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new U.ERR_BUFFER_OUT_OF_BOUNDS;throw new U.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}F("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),F("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),F("ERR_OUT_OF_RANGE",(function(e,t,r){let n=`The value of "${e}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=q(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=q(i)),i+="n"),n+=` It must be ${t}. Received ${i}`,n}),RangeError);const j=/[^+/0-9A-Za-z-_]/g;function Y(e,t){let r;t=t||1/0;const n=e.length;let i=null;const o=[];for(let a=0;a<n;++a){if(r=e.charCodeAt(a),r>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function $(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(j,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function K(e,t,r,n){let i;for(i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function V(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function J(e){return e!=e}const W=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function X(e){return"undefined"==typeof BigInt?Z:e}function Z(){throw new Error("BigInt not supported")}},3536:function(e,t,r){var n=r(1910);e.exports=n},8171:function(e,t,r){r(6450);var n=r(4058).Object,i=e.exports=function(e,t,r){return n.defineProperty(e,t,r)};n.defineProperty.sham&&(i.sham=!0)},3685:function(e,t,r){e.exports=r(621)},621:function(e,t,r){var n=r(3536);e.exports=n},4883:function(e,t,r){var n=r(7475),i=r(9826),o=TypeError;e.exports=function(e){if(n(e))return e;throw o(i(e)+" is not a function")}},6059:function(e,t,r){var n=r(941),i=String,o=TypeError;e.exports=function(e){if(n(e))return e;throw o(i(e)+" is not an object")}},2532:function(e,t,r){var n=r(5329),i=n({}.toString),o=n("".slice);e.exports=function(e){return o(i(e),8,-1)}},2029:function(e,t,r){var n=r(5746),i=r(5988),o=r(1887);e.exports=n?function(e,t,r){return i.f(e,t,o(1,r))}:function(e,t,r){return e[t]=r,e}},1887:function(e){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},5609:function(e,t,r){var n=r(1899),i=Object.defineProperty;e.exports=function(e,t){try{i(n,e,{value:t,configurable:!0,writable:!0})}catch(r){n[e]=t}return t}},5746:function(e,t,r){var n=r(5981);e.exports=!n((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},6616:function(e){var t="object"==typeof document&&document.all,r=void 0===t&&void 0!==t;e.exports={all:t,IS_HTMLDDA:r}},1333:function(e,t,r){var n=r(1899),i=r(941),o=n.document,a=i(o)&&i(o.createElement);e.exports=function(e){return a?o.createElement(e):{}}},2861:function(e,t,r){var n=r(626);e.exports=n("navigator","userAgent")||""},3385:function(e,t,r){var n,i,o=r(1899),a=r(2861),s=o.process,c=o.Deno,A=s&&s.versions||c&&c.version,u=A&&A.v8;u&&(i=(n=u.split("."))[0]>0&&n[0]<4?1:+(n[0]+n[1])),!i&&a&&(!(n=a.match(/Edge\/(\d+)/))||n[1]>=74)&&(n=a.match(/Chrome\/(\d+)/))&&(i=+n[1]),e.exports=i},6887:function(e,t,r){"use strict";var n=r(1899),i=r(9730),o=r(7484),a=r(7475),s=r(9677).f,c=r(7252),A=r(4058),u=r(6843),l=r(2029),d=r(953),p=function(e){var t=function(r,n,o){if(this instanceof t){switch(arguments.length){case 0:return new e;case 1:return new e(r);case 2:return new e(r,n)}return new e(r,n,o)}return i(e,this,arguments)};return t.prototype=e.prototype,t};e.exports=function(e,t){var r,i,h,f,g,m,y,I,C=e.target,E=e.global,B=e.stat,w=e.proto,Q=E?n:B?n[C]:(n[C]||{}).prototype,v=E?A:A[C]||l(A,C,{})[C],N=v.prototype;for(h in t)r=!c(E?h:C+(B?".":"#")+h,e.forced)&&Q&&d(Q,h),g=v[h],r&&(m=e.dontCallGetSet?(I=s(Q,h))&&I.value:Q[h]),f=r&&m?m:t[h],r&&typeof g==typeof f||(y=e.bind&&r?u(f,n):e.wrap&&r?p(f):w&&a(f)?o(f):f,(e.sham||f&&f.sham||g&&g.sham)&&l(y,"sham",!0),l(v,h,y),w&&(d(A,i=C+"Prototype")||l(A,i,{}),l(A[i],h,f),e.real&&N&&!N[h]&&l(N,h,f)))}},5981:function(e){e.exports=function(e){try{return!!e()}catch(e){return!0}}},9730:function(e,t,r){var n=r(8285),i=Function.prototype,o=i.apply,a=i.call;e.exports="object"==typeof Reflect&&Reflect.apply||(n?a.bind(o):function(){return a.apply(o,arguments)})},6843:function(e,t,r){var n=r(7484),i=r(4883),o=r(8285),a=n(n.bind);e.exports=function(e,t){return i(e),void 0===t?e:o?a(e,t):function(){return e.apply(t,arguments)}}},8285:function(e,t,r){var n=r(5981);e.exports=!n((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))},8834:function(e,t,r){var n=r(8285),i=Function.prototype.call;e.exports=n?i.bind(i):function(){return i.apply(i,arguments)}},7484:function(e,t,r){var n=r(2532),i=r(5329);e.exports=function(e){if("Function"===n(e))return i(e)}},5329:function(e,t,r){var n=r(8285),i=Function.prototype,o=i.call,a=n&&i.bind.bind(o,o);e.exports=n?a:function(e){return function(){return o.apply(e,arguments)}}},626:function(e,t,r){var n=r(4058),i=r(1899),o=r(7475),a=function(e){return o(e)?e:void 0};e.exports=function(e,t){return arguments.length<2?a(n[e])||a(i[e]):n[e]&&n[e][t]||i[e]&&i[e][t]}},4229:function(e,t,r){var n=r(4883),i=r(2119);e.exports=function(e,t){var r=e[t];return i(r)?void 0:n(r)}},1899:function(e,t,r){var n=function(e){return e&&e.Math==Math&&e};e.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof r.g&&r.g)||function(){return this}()||Function("return this")()},953:function(e,t,r){var n=r(5329),i=r(9678),o=n({}.hasOwnProperty);e.exports=Object.hasOwn||function(e,t){return o(i(e),t)}},2840:function(e,t,r){var n=r(5746),i=r(5981),o=r(1333);e.exports=!n&&!i((function(){return 7!=Object.defineProperty(o("div"),"a",{get:function(){return 7}}).a}))},7026:function(e,t,r){var n=r(5329),i=r(5981),o=r(2532),a=Object,s=n("".split);e.exports=i((function(){return!a("z").propertyIsEnumerable(0)}))?function(e){return"String"==o(e)?s(e,""):a(e)}:a},7475:function(e,t,r){var n=r(6616),i=n.all;e.exports=n.IS_HTMLDDA?function(e){return"function"==typeof e||e===i}:function(e){return"function"==typeof e}},7252:function(e,t,r){var n=r(5981),i=r(7475),o=/#|\.prototype\./,a=function(e,t){var r=c[s(e)];return r==u||r!=A&&(i(t)?n(t):!!t)},s=a.normalize=function(e){return String(e).replace(o,".").toLowerCase()},c=a.data={},A=a.NATIVE="N",u=a.POLYFILL="P";e.exports=a},2119:function(e){e.exports=function(e){return null==e}},941:function(e,t,r){var n=r(7475),i=r(6616),o=i.all;e.exports=i.IS_HTMLDDA?function(e){return"object"==typeof e?null!==e:n(e)||e===o}:function(e){return"object"==typeof e?null!==e:n(e)}},2529:function(e){e.exports=!0},6664:function(e,t,r){var n=r(626),i=r(7475),o=r(7046),a=r(2302),s=Object;e.exports=a?function(e){return"symbol"==typeof e}:function(e){var t=n("Symbol");return i(t)&&o(t.prototype,s(e))}},5988:function(e,t,r){var n=r(5746),i=r(2840),o=r(3937),a=r(6059),s=r(3894),c=TypeError,A=Object.defineProperty,u=Object.getOwnPropertyDescriptor;t.f=n?o?function(e,t,r){if(a(e),t=s(t),a(r),"function"==typeof e&&"prototype"===t&&"value"in r&&"writable"in r&&!r.writable){var n=u(e,t);n&&n.writable&&(e[t]=r.value,r={configurable:"configurable"in r?r.configurable:n.configurable,enumerable:"enumerable"in r?r.enumerable:n.enumerable,writable:!1})}return A(e,t,r)}:A:function(e,t,r){if(a(e),t=s(t),a(r),i)try{return A(e,t,r)}catch(e){}if("get"in r||"set"in r)throw c("Accessors not supported");return"value"in r&&(e[t]=r.value),e}},9677:function(e,t,r){var n=r(5746),i=r(8834),o=r(6760),a=r(1887),s=r(4529),c=r(3894),A=r(953),u=r(2840),l=Object.getOwnPropertyDescriptor;t.f=n?l:function(e,t){if(e=s(e),t=c(t),u)try{return l(e,t)}catch(e){}if(A(e,t))return a(!i(o.f,e,t),e[t])}},7046:function(e,t,r){var n=r(5329);e.exports=n({}.isPrototypeOf)},6760:function(e,t){"use strict";var r={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,i=n&&!r.call({1:2},1);t.f=i?function(e){var t=n(this,e);return!!t&&t.enumerable}:r},9811:function(e,t,r){var n=r(8834),i=r(7475),o=r(941),a=TypeError;e.exports=function(e,t){var r,s;if("string"===t&&i(r=e.toString)&&!o(s=n(r,e)))return s;if(i(r=e.valueOf)&&!o(s=n(r,e)))return s;if("string"!==t&&i(r=e.toString)&&!o(s=n(r,e)))return s;throw a("Can't convert object to primitive value")}},4058:function(e){e.exports={}},8219:function(e,t,r){var n=r(2119),i=TypeError;e.exports=function(e){if(n(e))throw i("Can't call method on "+e);return e}},3030:function(e,t,r){var n=r(1899),i=r(5609),o="__core-js_shared__",a=n[o]||i(o,{});e.exports=a},8726:function(e,t,r){var n=r(2529),i=r(3030);(e.exports=function(e,t){return i[e]||(i[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.26.1",mode:n?"pure":"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.26.1/LICENSE",source:"https://github.com/zloirock/core-js"})},3405:function(e,t,r){var n=r(3385),i=r(5981);e.exports=!!Object.getOwnPropertySymbols&&!i((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&n&&n<41}))},4529:function(e,t,r){var n=r(7026),i=r(8219);e.exports=function(e){return n(i(e))}},9678:function(e,t,r){var n=r(8219),i=Object;e.exports=function(e){return i(n(e))}},6935:function(e,t,r){var n=r(8834),i=r(941),o=r(6664),a=r(4229),s=r(9811),c=r(9813),A=TypeError,u=c("toPrimitive");e.exports=function(e,t){if(!i(e)||o(e))return e;var r,c=a(e,u);if(c){if(void 0===t&&(t="default"),r=n(c,e,t),!i(r)||o(r))return r;throw A("Can't convert object to primitive value")}return void 0===t&&(t="number"),s(e,t)}},3894:function(e,t,r){var n=r(6935),i=r(6664);e.exports=function(e){var t=n(e,"string");return i(t)?t:t+""}},9826:function(e){var t=String;e.exports=function(e){try{return t(e)}catch(e){return"Object"}}},9418:function(e,t,r){var n=r(5329),i=0,o=Math.random(),a=n(1..toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+a(++i+o,36)}},2302:function(e,t,r){var n=r(3405);e.exports=n&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},3937:function(e,t,r){var n=r(5746),i=r(5981);e.exports=n&&i((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},9813:function(e,t,r){var n=r(1899),i=r(8726),o=r(953),a=r(9418),s=r(3405),c=r(2302),A=i("wks"),u=n.Symbol,l=u&&u.for,d=c?u:u&&u.withoutSetter||a;e.exports=function(e){if(!o(A,e)||!s&&"string"!=typeof A[e]){var t="Symbol."+e;s&&o(u,e)?A[e]=u[e]:A[e]=c&&l?l(t):d(t)}return A[e]}},6450:function(e,t,r){var n=r(6887),i=r(5746),o=r(5988).f;n({target:"Object",stat:!0,forced:Object.defineProperty!==o,sham:!i},{defineProperty:o})},1910:function(e,t,r){var n=r(8171);e.exports=n},284:function(e){var t=function(){if("object"==typeof self&&self)return self;if("object"==typeof window&&window)return window;throw new Error("Unable to resolve global `this`")};e.exports=function(){if(this)return this;if("object"==typeof globalThis&&globalThis)return globalThis;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:!0})}catch(e){return t()}try{return __global__||t()}finally{delete Object.prototype.__global__}}()},7187:function(e){"use strict";var t,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};t=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var i=Number.isNaN||function(e){return e!=e};function o(){o.init.call(this)}e.exports=o,e.exports.once=function(e,t){return new Promise((function(r,n){function i(r){e.removeListener(t,o),n(r)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",i),r([].slice.call(arguments))}f(e,t,o,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&f(e,"error",t,{once:!0})}(e,i)}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var a=10;function s(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function c(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function A(e,t,r,n){var i,o,a,A;if(s(r),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),a=o[t]),void 0===a)a=o[t]=r,++e._eventsCount;else if("function"==typeof a?a=o[t]=n?[r,a]:[a,r]:n?a.unshift(r):a.push(r),(i=c(e))>0&&a.length>i&&!a.warned){a.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=a.length,A=u,console&&console.warn&&console.warn(A)}return e}function u(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function l(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=u.bind(n);return i.listener=r,n.wrapFn=i,i}function d(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(i):h(i,i.length)}function p(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function h(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function f(e,t,r,n){if("function"==typeof e.on)n.once?e.once(t,r):e.on(t,r);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function i(o){n.once&&e.removeEventListener(t,i),r(o)}))}}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");a=e}}),o.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},o.prototype.getMaxListeners=function(){return c(this)},o.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var i="error"===e,o=this._events;if(void 0!==o)i=i&&void 0===o.error;else if(!i)return!1;if(i){var a;if(t.length>0&&(a=t[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var c=o[e];if(void 0===c)return!1;if("function"==typeof c)n(c,this,t);else{var A=c.length,u=h(c,A);for(r=0;r<A;++r)n(u[r],this,t)}return!0},o.prototype.addListener=function(e,t){return A(this,e,t,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(e,t){return A(this,e,t,!0)},o.prototype.once=function(e,t){return s(t),this.on(e,l(this,e,t)),this},o.prototype.prependOnceListener=function(e,t){return s(t),this.prependListener(e,l(this,e,t)),this},o.prototype.removeListener=function(e,t){var r,n,i,o,a;if(s(t),void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(i=-1,o=r.length-1;o>=0;o--)if(r[o]===t||r[o].listener===t){a=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,i),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,a||t)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var i,o=Object.keys(r);for(n=0;n<o.length;++n)"removeListener"!==(i=o[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},o.prototype.listeners=function(e){return d(this,e,!0)},o.prototype.rawListeners=function(e){return d(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},o.prototype.listenerCount=p,o.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},645:function(e,t){t.read=function(e,t,r,n,i){var o,a,s=8*i-n-1,c=(1<<s)-1,A=c>>1,u=-7,l=r?i-1:0,d=r?-1:1,p=e[t+l];for(l+=d,o=p&(1<<-u)-1,p>>=-u,u+=s;u>0;o=256*o+e[t+l],l+=d,u-=8);for(a=o&(1<<-u)-1,o>>=-u,u+=n;u>0;a=256*a+e[t+l],l+=d,u-=8);if(0===o)o=1-A;else{if(o===c)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,n),o-=A}return(p?-1:1)*a*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var a,s,c,A=8*o-i-1,u=(1<<A)-1,l=u>>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,h=n?1:-1,f=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=u):(a=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-a))<1&&(a--,c*=2),(t+=a+l>=1?d/c:d*Math.pow(2,1-l))*c>=2&&(a++,c/=2),a+l>=u?(s=0,a=u):a+l>=1?(s=(t*c-1)*Math.pow(2,i),a+=l):(s=t*Math.pow(2,l-1)*Math.pow(2,i),a=0));i>=8;e[r+p]=255&s,p+=h,s/=256,i-=8);for(a=a<<i|s,A+=i;A>0;e[r+p]=255&a,p+=h,a/=256,A-=8);e[r+p-h]|=128*f}},5717:function(e){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},4400:function(e,t,r){var n=r(4123).stringify,i=r(6813);e.exports=function(e){return{parse:i(e),stringify:n}},e.exports.parse=i(),e.exports.stringify=n},6813:function(e,t,r){var n=null;const i=/(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])/,o=/(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)/;e.exports=function(e){"use strict";var t={strict:!1,storeAsString:!1,alwaysParseAsBig:!1,useNativeBigInt:!1,protoAction:"error",constructorAction:"error"};if(null!=e){if(!0===e.strict&&(t.strict=!0),!0===e.storeAsString&&(t.storeAsString=!0),t.alwaysParseAsBig=!0===e.alwaysParseAsBig&&e.alwaysParseAsBig,t.useNativeBigInt=!0===e.useNativeBigInt&&e.useNativeBigInt,void 0!==e.constructorAction){if("error"!==e.constructorAction&&"ignore"!==e.constructorAction&&"preserve"!==e.constructorAction)throw new Error(`Incorrect value for constructorAction option, must be "error", "ignore" or undefined but passed ${e.constructorAction}`);t.constructorAction=e.constructorAction}if(void 0!==e.protoAction){if("error"!==e.protoAction&&"ignore"!==e.protoAction&&"preserve"!==e.protoAction)throw new Error(`Incorrect value for protoAction option, must be "error", "ignore" or undefined but passed ${e.protoAction}`);t.protoAction=e.protoAction}}var a,s,c,A,u={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"},l=function(e){throw{name:"SyntaxError",message:e,at:a,text:c}},d=function(e){return e&&e!==s&&l("Expected '"+e+"' instead of '"+s+"'"),s=c.charAt(a),a+=1,s},p=function(){var e,i="";for("-"===s&&(i="-",d("-"));s>="0"&&s<="9";)i+=s,d();if("."===s)for(i+=".";d()&&s>="0"&&s<="9";)i+=s;if("e"===s||"E"===s)for(i+=s,d(),"-"!==s&&"+"!==s||(i+=s,d());s>="0"&&s<="9";)i+=s,d();if(e=+i,isFinite(e))return null==n&&(n=r(4431)),i.length>15?t.storeAsString?i:t.useNativeBigInt?BigInt(i):new n(i):t.alwaysParseAsBig?t.useNativeBigInt?BigInt(e):new n(e):e;l("Bad number")},h=function(){var e,t,r,n="";if('"'===s)for(var i=a;d();){if('"'===s)return a-1>i&&(n+=c.substring(i,a-1)),d(),n;if("\\"===s){if(a-1>i&&(n+=c.substring(i,a-1)),d(),"u"===s){for(r=0,t=0;t<4&&(e=parseInt(d(),16),isFinite(e));t+=1)r=16*r+e;n+=String.fromCharCode(r)}else{if("string"!=typeof u[s])break;n+=u[s]}i=a}}l("Bad string")},f=function(){for(;s&&s<=" ";)d()};return A=function(){switch(f(),s){case"{":return function(){var e,r=Object.create(null);if("{"===s){if(d("{"),f(),"}"===s)return d("}"),r;for(;s;){if(e=h(),f(),d(":"),!0===t.strict&&Object.hasOwnProperty.call(r,e)&&l('Duplicate key "'+e+'"'),!0===i.test(e)?"error"===t.protoAction?l("Object contains forbidden prototype property"):"ignore"===t.protoAction?A():r[e]=A():!0===o.test(e)?"error"===t.constructorAction?l("Object contains forbidden constructor property"):"ignore"===t.constructorAction?A():r[e]=A():r[e]=A(),f(),"}"===s)return d("}"),r;d(","),f()}}l("Bad object")}();case"[":return function(){var e=[];if("["===s){if(d("["),f(),"]"===s)return d("]"),e;for(;s;){if(e.push(A()),f(),"]"===s)return d("]"),e;d(","),f()}}l("Bad array")}();case'"':return h();case"-":return p();default:return s>="0"&&s<="9"?p():function(){switch(s){case"t":return d("t"),d("r"),d("u"),d("e"),!0;case"f":return d("f"),d("a"),d("l"),d("s"),d("e"),!1;case"n":return d("n"),d("u"),d("l"),d("l"),null}l("Unexpected '"+s+"'")}()}},function(e,t){var r;return c=e+"",a=0,s=" ",r=A(),f(),s&&l("Syntax error"),"function"==typeof t?function e(r,n){var i,o=r[n];return o&&"object"==typeof o&&Object.keys(o).forEach((function(t){void 0!==(i=e(o,t))?o[t]=i:delete o[t]})),t.call(r,n,o)}({"":r},""):r}}},4123:function(e,t,r){var n=r(4431),i=e.exports;!function(){"use strict";var e,t,r,o=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,a={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};function s(e){return o.lastIndex=0,o.test(e)?'"'+e.replace(o,(function(e){var t=a[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)}))+'"':'"'+e+'"'}function c(i,o){var a,A,u,l,d,p=e,h=o[i],f=null!=h&&(h instanceof n||n.isBigNumber(h));switch(h&&"object"==typeof h&&"function"==typeof h.toJSON&&(h=h.toJSON(i)),"function"==typeof r&&(h=r.call(o,i,h)),typeof h){case"string":return f?h:s(h);case"number":return isFinite(h)?String(h):"null";case"boolean":case"null":case"bigint":return String(h);case"object":if(!h)return"null";if(e+=t,d=[],"[object Array]"===Object.prototype.toString.apply(h)){for(l=h.length,a=0;a<l;a+=1)d[a]=c(a,h)||"null";return u=0===d.length?"[]":e?"[\n"+e+d.join(",\n"+e)+"\n"+p+"]":"["+d.join(",")+"]",e=p,u}if(r&&"object"==typeof r)for(l=r.length,a=0;a<l;a+=1)"string"==typeof r[a]&&(u=c(A=r[a],h))&&d.push(s(A)+(e?": ":":")+u);else Object.keys(h).forEach((function(t){var r=c(t,h);r&&d.push(s(t)+(e?": ":":")+r)}));return u=0===d.length?"{}":e?"{\n"+e+d.join(",\n"+e)+"\n"+p+"}":"{"+d.join(",")+"}",e=p,u}}"function"!=typeof i.stringify&&(i.stringify=function(n,i,o){var a;if(e="",t="","number"==typeof o)for(a=0;a<o;a+=1)t+=" ";else"string"==typeof o&&(t=o);if(r=i,i&&"function"!=typeof i&&("object"!=typeof i||"number"!=typeof i.length))throw new Error("JSON.stringify");return c("",{"":n})})}()},6636:function(e,t){"use strict";function r(e){if(Array.isArray(e)){const t=[];for(let n=0;n<e.length;n++)t.push(r(e[n]));const n=d(...t);return d(o(n.length,192),n)}const t=g(e);return 1===t.length&&t[0]<128?t:d(o(t.length,128),t)}function n(e,t,r){if(r>e.length)throw new Error("invalid RLP (safeSlice): end slice of Uint8Array out-of-bounds");return e.slice(t,r)}function i(e){if(0===e[0])throw new Error("invalid RLP: extra zeros");return u(A(e))}function o(e,t){if(e<56)return Uint8Array.from([e+t]);const r=h(e),n=h(t+55+r.length/2);return Uint8Array.from(l(n+r))}function a(e,t=!1){if(!e||0===e.length)return Uint8Array.from([]);const r=s(g(e));if(t)return r;if(0!==r.remainder.length)throw new Error("invalid RLP: remainder must be zero");return r.data}function s(e){let t,r,o,a,c;const A=[],u=e[0];if(u<=127)return{data:e.slice(0,1),remainder:e.slice(1)};if(u<=183){if(t=u-127,o=128===u?Uint8Array.from([]):n(e,1,t),2===t&&o[0]<128)throw new Error("invalid RLP encoding: invalid prefix, single byte < 0x80 are not prefixed");return{data:o,remainder:e.slice(t)}}if(u<=191){if(r=u-182,e.length-1<r)throw new Error("invalid RLP: not enough bytes for string length");if(t=i(n(e,1,r)),t<=55)throw new Error("invalid RLP: expected string length to be greater than 55");return o=n(e,r,t+r),{data:o,remainder:e.slice(t+r)}}if(u<=247){for(t=u-191,a=n(e,1,t);a.length;)c=s(a),A.push(c.data),a=c.remainder;return{data:A,remainder:e.slice(t)}}{if(r=u-246,t=i(n(e,1,r)),t<56)throw new Error("invalid RLP: encoded list too short");const o=r+t;if(o>e.length)throw new Error("invalid RLP: total length is larger than the data");for(a=n(e,r,o);a.length;)c=s(a),A.push(c.data),a=c.remainder;return{data:A,remainder:e.slice(o)}}}Object.defineProperty(t,"__esModule",{value:!0}),t.utils=t.decode=t.encode=void 0,t.encode=r,t.decode=a;const c=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));function A(e){let t="";for(let r=0;r<e.length;r++)t+=c[e[r]];return t}function u(e){const t=Number.parseInt(e,16);if(Number.isNaN(t))throw new Error("Invalid byte sequence");return t}function l(e){if("string"!=typeof e)throw new TypeError("hexToBytes: expected string, got "+typeof e);if(e.length%2)throw new Error("hexToBytes: received invalid unpadded hex");const t=new Uint8Array(e.length/2);for(let r=0;r<t.length;r++){const n=2*r;t[r]=u(e.slice(n,n+2))}return t}function d(...e){if(1===e.length)return e[0];const t=e.reduce(((e,t)=>e+t.length),0),r=new Uint8Array(t);for(let t=0,n=0;t<e.length;t++){const i=e[t];r.set(i,n),n+=i.length}return r}function p(e){return(new TextEncoder).encode(e)}function h(e){if(e<0)throw new Error("Invalid integer as argument, must be unsigned!");const t=e.toString(16);return t.length%2?`0${t}`:t}function f(e){return e.length>=2&&"0"===e[0]&&"x"===e[1]}function g(e){if(e instanceof Uint8Array)return e;if("string"==typeof e)return f(e)?l((t="string"!=typeof(r=e)?r:f(r)?r.slice(2):r).length%2?`0${t}`:t):p(e);var t,r;if("number"==typeof e||"bigint"==typeof e)return e?l(h(e)):Uint8Array.from([]);if(null==e)return Uint8Array.from([]);throw new Error("toBytes: received unsupported type "+typeof e)}t.utils={bytesToHex:A,concatBytes:d,hexToBytes:l,utf8ToBytes:p};const m={encode:r,decode:a};t.default=m},9509:function(e,t,r){var n=r(8764),i=n.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function a(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,t),t.Buffer=a),a.prototype=Object.create(i.prototype),o(i,a),a.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},a.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},a.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},4189:function(e,t,r){var n=r(9509).Buffer;function i(e,t){this._block=n.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}i.prototype.update=function(e,t){"string"==typeof e&&(t=t||"utf8",e=n.from(e,t));for(var r=this._block,i=this._blockSize,o=e.length,a=this._len,s=0;s<o;){for(var c=a%i,A=Math.min(o-s,i-c),u=0;u<A;u++)r[c+u]=e[s+u];s+=A,(a+=A)%i==0&&this._update(r)}return this._len+=o,this},i.prototype.digest=function(e){var t=this._len%this._blockSize;this._block[t]=128,this._block.fill(0,t+1),t>=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(4294967295&r)>>>0,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var o=this._hash();return e?o.toString(e):o},i.prototype._update=function(){throw new Error("_update must be implemented by subclass")},e.exports=i},7499:function(e,t,r){var n=r(5717),i=r(4189),o=r(9509).Buffer,a=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],s=new Array(64);function c(){this.init(),this._w=s,i.call(this,64,56)}function A(e,t,r){return r^e&(t^r)}function u(e,t,r){return e&t|r&(e|t)}function l(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function d(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function p(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}n(c,i),c.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},c.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,c=0|this._e,h=0|this._f,f=0|this._g,g=0|this._h,m=0;m<16;++m)r[m]=e.readInt32BE(4*m);for(;m<64;++m)r[m]=0|(((t=r[m-2])>>>17|t<<15)^(t>>>19|t<<13)^t>>>10)+r[m-7]+p(r[m-15])+r[m-16];for(var y=0;y<64;++y){var I=g+d(c)+A(c,h,f)+a[y]+r[y]|0,C=l(n)+u(n,i,o)|0;g=f,f=h,h=c,c=s+I|0,s=o,o=i,i=n,n=I+C|0}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=c+this._e|0,this._f=h+this._f|0,this._g=f+this._g|0,this._h=g+this._h|0},c.prototype._hash=function(){var e=o.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e},e.exports=c},2182:function(e,t,r){!function(t,n){"use strict";e.exports?e.exports=n(r(780)):t.nacl.auth=n(t.nacl)}(this,(function(e){"use strict";if(!e)throw new Error("tweetnacl not loaded");var t=128;function r(r,n){var i,o,a=new Uint8Array(t+Math.max(64,r.length));for(n.length>t&&(n=e.hash(n)),i=0;i<t;i++)a[i]=54;for(i=0;i<n.length;i++)a[i]^=n[i];for(a.set(r,t),o=e.hash(a.subarray(0,t+r.length)),i=0;i<t;i++)a[i]=92;for(i=0;i<n.length;i++)a[i]^=n[i];return a.set(o,t),e.hash(a.subarray(0,t+o.length))}function n(e,t){var n=new Uint8Array(32);return n.set(r(e,t).subarray(0,32)),n}return n.full=function(e,t){return r(e,t)},n.authLength=32,n.authFullLength=64,n.keyLength=32,n}))},780:function(e,t,r){!function(e){"use strict";var t=function(e){var t,r=new Float64Array(16);if(e)for(t=0;t<e.length;t++)r[t]=e[t];return r},n=function(){throw new Error("no PRNG")},i=new Uint8Array(16),o=new Uint8Array(32);o[0]=9;var a=t(),s=t([1]),c=t([56129,1]),A=t([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),u=t([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),l=t([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),d=t([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),p=t([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function h(e,t,r,n){e[t]=r>>24&255,e[t+1]=r>>16&255,e[t+2]=r>>8&255,e[t+3]=255&r,e[t+4]=n>>24&255,e[t+5]=n>>16&255,e[t+6]=n>>8&255,e[t+7]=255&n}function f(e,t,r,n,i){var o,a=0;for(o=0;o<i;o++)a|=e[t+o]^r[n+o];return(1&a-1>>>8)-1}function g(e,t,r,n){return f(e,t,r,n,16)}function m(e,t,r,n){return f(e,t,r,n,32)}function y(e,t,r,n){!function(e,t,r,n){for(var i,o=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,a=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,s=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,c=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,A=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,u=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,l=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,d=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,p=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,h=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,f=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,g=255&r[16]|(255&r[17])<<8|(255&r[18])<<16|(255&r[19])<<24,m=255&r[20]|(255&r[21])<<8|(255&r[22])<<16|(255&r[23])<<24,y=255&r[24]|(255&r[25])<<8|(255&r[26])<<16|(255&r[27])<<24,I=255&r[28]|(255&r[29])<<8|(255&r[30])<<16|(255&r[31])<<24,C=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,E=o,B=a,w=s,Q=c,v=A,N=u,b=l,S=d,x=p,T=h,_=f,R=g,M=m,D=y,O=I,z=C,k=0;k<20;k+=2)E^=(i=(M^=(i=(x^=(i=(v^=(i=E+M|0)<<7|i>>>25)+E|0)<<9|i>>>23)+v|0)<<13|i>>>19)+x|0)<<18|i>>>14,N^=(i=(B^=(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>8&255,e[22]=N>>>16&255,e[23]=N>>>24&255,e[24]=b>>>0&255,e[25]=b>>>8&255,e[26]=b>>>16&255,e[27]=b>>>24&255,e[28]=S>>>0&255,e[29]=S>>>8&255,e[30]=S>>>16&255,e[31]=S>>>24&255,e[32]=x>>>0&255,e[33]=x>>>8&255,e[34]=x>>>16&255,e[35]=x>>>24&255,e[36]=T>>>0&255,e[37]=T>>>8&255,e[38]=T>>>16&255,e[39]=T>>>24&255,e[40]=_>>>0&255,e[41]=_>>>8&255,e[42]=_>>>16&255,e[43]=_>>>24&255,e[44]=R>>>0&255,e[45]=R>>>8&255,e[46]=R>>>16&255,e[47]=R>>>24&255,e[48]=M>>>0&255,e[49]=M>>>8&255,e[50]=M>>>16&255,e[51]=M>>>24&255,e[52]=D>>>0&255,e[53]=D>>>8&255,e[54]=D>>>16&255,e[55]=D>>>24&255,e[56]=O>>>0&255,e[57]=O>>>8&255,e[58]=O>>>16&255,e[59]=O>>>24&255,e[60]=z>>>0&255,e[61]=z>>>8&255,e[62]=z>>>16&255,e[63]=z>>>24&255}(e,t,r,n)}function I(e,t,r,n){!function(e,t,r,n){for(var i,o=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,a=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,s=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,c=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,A=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,u=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,l=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,d=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,p=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,h=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,f=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,g=255&r[16]|(255&r[17])<<8|(255&r[18])<<16|(255&r[19])<<24,m=255&r[20]|(255&r[21])<<8|(255&r[22])<<16|(255&r[23])<<24,y=255&r[24]|(255&r[25])<<8|(255&r[26])<<16|(255&r[27])<<24,I=255&r[28]|(255&r[29])<<8|(255&r[30])<<16|(255&r[31])<<24,C=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,E=0;E<20;E+=2)o^=(i=(m^=(i=(p^=(i=(A^=(i=o+m|0)<<7|i>>>25)+o|0)<<9|i>>>23)+A|0)<<13|i>>>19)+p|0)<<18|i>>>14,u^=(i=(a^=(i=(y^=(i=(h^=(i=u+a|0)<<7|i>>>25)+u|0)<<9|i>>>23)+h|0)<<13|i>>>19)+y|0)<<18|i>>>14,f^=(i=(l^=(i=(s^=(i=(I^=(i=f+l|0)<<7|i>>>25)+f|0)<<9|i>>>23)+I|0)<<13|i>>>19)+s|0)<<18|i>>>14,C^=(i=(g^=(i=(d^=(i=(c^=(i=C+g|0)<<7|i>>>25)+C|0)<<9|i>>>23)+c|0)<<13|i>>>19)+d|0)<<18|i>>>14,o^=(i=(c^=(i=(s^=(i=(a^=(i=o+c|0)<<7|i>>>25)+o|0)<<9|i>>>23)+a|0)<<13|i>>>19)+s|0)<<18|i>>>14,u^=(i=(A^=(i=(d^=(i=(l^=(i=u+A|0)<<7|i>>>25)+u|0)<<9|i>>>23)+l|0)<<13|i>>>19)+d|0)<<18|i>>>14,f^=(i=(h^=(i=(p^=(i=(g^=(i=f+h|0)<<7|i>>>25)+f|0)<<9|i>>>23)+g|0)<<13|i>>>19)+p|0)<<18|i>>>14,C^=(i=(I^=(i=(y^=(i=(m^=(i=C+I|0)<<7|i>>>25)+C|0)<<9|i>>>23)+m|0)<<13|i>>>19)+y|0)<<18|i>>>14;e[0]=o>>>0&255,e[1]=o>>>8&255,e[2]=o>>>16&255,e[3]=o>>>24&255,e[4]=u>>>0&255,e[5]=u>>>8&255,e[6]=u>>>16&255,e[7]=u>>>24&255,e[8]=f>>>0&255,e[9]=f>>>8&255,e[10]=f>>>16&255,e[11]=f>>>24&255,e[12]=C>>>0&255,e[13]=C>>>8&255,e[14]=C>>>16&255,e[15]=C>>>24&255,e[16]=l>>>0&255,e[17]=l>>>8&255,e[18]=l>>>16&255,e[19]=l>>>24&255,e[20]=d>>>0&255,e[21]=d>>>8&255,e[22]=d>>>16&255,e[23]=d>>>24&255,e[24]=p>>>0&255,e[25]=p>>>8&255,e[26]=p>>>16&255,e[27]=p>>>24&255,e[28]=h>>>0&255,e[29]=h>>>8&255,e[30]=h>>>16&255,e[31]=h>>>24&255}(e,t,r,n)}var C=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function E(e,t,r,n,i,o,a){var s,c,A=new Uint8Array(16),u=new Uint8Array(64);for(c=0;c<16;c++)A[c]=0;for(c=0;c<8;c++)A[c]=o[c];for(;i>=64;){for(y(u,A,a,C),c=0;c<64;c++)e[t+c]=r[n+c]^u[c];for(s=1,c=8;c<16;c++)s=s+(255&A[c])|0,A[c]=255&s,s>>>=8;i-=64,t+=64,n+=64}if(i>0)for(y(u,A,a,C),c=0;c<i;c++)e[t+c]=r[n+c]^u[c];return 0}function B(e,t,r,n,i){var o,a,s=new Uint8Array(16),c=new Uint8Array(64);for(a=0;a<16;a++)s[a]=0;for(a=0;a<8;a++)s[a]=n[a];for(;r>=64;){for(y(c,s,i,C),a=0;a<64;a++)e[t+a]=c[a];for(o=1,a=8;a<16;a++)o=o+(255&s[a])|0,s[a]=255&o,o>>>=8;r-=64,t+=64}if(r>0)for(y(c,s,i,C),a=0;a<r;a++)e[t+a]=c[a];return 0}function w(e,t,r,n,i){var o=new Uint8Array(32);I(o,n,i,C);for(var a=new Uint8Array(8),s=0;s<8;s++)a[s]=n[s+16];return B(e,t,r,a,o)}function Q(e,t,r,n,i,o,a){var s=new Uint8Array(32);I(s,o,a,C);for(var c=new Uint8Array(8),A=0;A<8;A++)c[A]=o[A+16];return E(e,t,r,n,i,c,s)}var v=function(e){var t,r,n,i,o,a,s,c;this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.leftover=0,this.fin=0,t=255&e[0]|(255&e[1])<<8,this.r[0]=8191&t,r=255&e[2]|(255&e[3])<<8,this.r[1]=8191&(t>>>13|r<<3),n=255&e[4]|(255&e[5])<<8,this.r[2]=7939&(r>>>10|n<<6),i=255&e[6]|(255&e[7])<<8,this.r[3]=8191&(n>>>7|i<<9),o=255&e[8]|(255&e[9])<<8,this.r[4]=255&(i>>>4|o<<12),this.r[5]=o>>>1&8190,a=255&e[10]|(255&e[11])<<8,this.r[6]=8191&(o>>>14|a<<2),s=255&e[12]|(255&e[13])<<8,this.r[7]=8065&(a>>>11|s<<5),c=255&e[14]|(255&e[15])<<8,this.r[8]=8191&(s>>>8|c<<8),this.r[9]=c>>>5&127,this.pad[0]=255&e[16]|(255&e[17])<<8,this.pad[1]=255&e[18]|(255&e[19])<<8,this.pad[2]=255&e[20]|(255&e[21])<<8,this.pad[3]=255&e[22]|(255&e[23])<<8,this.pad[4]=255&e[24]|(255&e[25])<<8,this.pad[5]=255&e[26]|(255&e[27])<<8,this.pad[6]=255&e[28]|(255&e[29])<<8,this.pad[7]=255&e[30]|(255&e[31])<<8};function N(e,t,r,n,i,o){var a=new v(o);return a.update(r,n,i),a.finish(e,t),0}function b(e,t,r,n,i,o){var a=new Uint8Array(16);return N(a,0,r,n,i,o),g(e,t,a,0)}function S(e,t,r,n,i){var o;if(r<32)return-1;for(Q(e,0,t,0,r,n,i),N(e,16,e,32,r-32,e),o=0;o<16;o++)e[o]=0;return 0}function x(e,t,r,n,i){var o,a=new Uint8Array(32);if(r<32)return-1;if(w(a,0,32,n,i),0!==b(t,16,t,32,r-32,a))return-1;for(Q(e,0,t,0,r,n,i),o=0;o<32;o++)e[o]=0;return 0}function T(e,t){var r;for(r=0;r<16;r++)e[r]=0|t[r]}function _(e){var t,r,n=1;for(t=0;t<16;t++)r=e[t]+n+65535,n=Math.floor(r/65536),e[t]=r-65536*n;e[0]+=n-1+37*(n-1)}function R(e,t,r){for(var n,i=~(r-1),o=0;o<16;o++)n=i&(e[o]^t[o]),e[o]^=n,t[o]^=n}function M(e,r){var n,i,o,a=t(),s=t();for(n=0;n<16;n++)s[n]=r[n];for(_(s),_(s),_(s),i=0;i<2;i++){for(a[0]=s[0]-65517,n=1;n<15;n++)a[n]=s[n]-65535-(a[n-1]>>16&1),a[n-1]&=65535;a[15]=s[15]-32767-(a[14]>>16&1),o=a[15]>>16&1,a[14]&=65535,R(s,a,1-o)}for(n=0;n<16;n++)e[2*n]=255&s[n],e[2*n+1]=s[n]>>8}function D(e,t){var r=new Uint8Array(32),n=new Uint8Array(32);return M(r,e),M(n,t),m(r,0,n,0)}function O(e){var t=new Uint8Array(32);return M(t,e),1&t[0]}function z(e,t){var r;for(r=0;r<16;r++)e[r]=t[2*r]+(t[2*r+1]<<8);e[15]&=32767}function k(e,t,r){for(var n=0;n<16;n++)e[n]=t[n]+r[n]}function P(e,t,r){for(var n=0;n<16;n++)e[n]=t[n]-r[n]}function U(e,t,r){var n,i,o=0,a=0,s=0,c=0,A=0,u=0,l=0,d=0,p=0,h=0,f=0,g=0,m=0,y=0,I=0,C=0,E=0,B=0,w=0,Q=0,v=0,N=0,b=0,S=0,x=0,T=0,_=0,R=0,M=0,D=0,O=0,z=r[0],k=r[1],P=r[2],U=r[3],F=r[4],q=r[5],L=r[6],G=r[7],H=r[8],j=r[9],Y=r[10],$=r[11],K=r[12],V=r[13],J=r[14],W=r[15];o+=(n=t[0])*z,a+=n*k,s+=n*P,c+=n*U,A+=n*F,u+=n*q,l+=n*L,d+=n*G,p+=n*H,h+=n*j,f+=n*Y,g+=n*$,m+=n*K,y+=n*V,I+=n*J,C+=n*W,a+=(n=t[1])*z,s+=n*k,c+=n*P,A+=n*U,u+=n*F,l+=n*q,d+=n*L,p+=n*G,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])*z,g+=n*k,m+=n*P,y+=n*U,I+=n*F,C+=n*q,E+=n*L,B+=n*G,w+=n*H,Q+=n*j,v+=n*Y,N+=n*$,b+=n*K,S+=n*V,x+=n*J,T+=n*W,g+=(n=t[11])*z,m+=n*k,y+=n*P,I+=n*U,C+=n*F,E+=n*q,B+=n*L,w+=n*G,Q+=n*H,v+=n*j,N+=n*Y,b+=n*$,S+=n*K,x+=n*V,T+=n*J,_+=n*W,m+=(n=t[12])*z,y+=n*k,I+=n*P,C+=n*U,E+=n*F,B+=n*q,w+=n*L,Q+=n*G,v+=n*H,N+=n*j,b+=n*Y,S+=n*$,x+=n*K,T+=n*V,_+=n*J,R+=n*W,y+=(n=t[13])*z,I+=n*k,C+=n*P,E+=n*U,B+=n*F,w+=n*q,Q+=n*L,v+=n*G,N+=n*H,b+=n*j,S+=n*Y,x+=n*$,T+=n*K,_+=n*V,R+=n*J,M+=n*W,I+=(n=t[14])*z,C+=n*k,E+=n*P,B+=n*U,w+=n*F,Q+=n*q,v+=n*L,N+=n*G,b+=n*H,S+=n*j,x+=n*Y,T+=n*$,_+=n*K,R+=n*V,M+=n*J,D+=n*W,C+=(n=t[15])*z,a+=38*(B+=n*P),s+=38*(w+=n*U),c+=38*(Q+=n*F),A+=38*(v+=n*q),u+=38*(N+=n*L),l+=38*(b+=n*G),d+=38*(S+=n*H),p+=38*(x+=n*j),h+=38*(T+=n*Y),f+=38*(_+=n*$),g+=38*(R+=n*K),m+=38*(M+=n*V),y+=38*(D+=n*J),I+=38*(O+=n*W),o=(n=(o+=38*(E+=n*k))+(i=1)+65535)-65536*(i=Math.floor(n/65536)),a=(n=a+i+65535)-65536*(i=Math.floor(n/65536)),s=(n=s+i+65535)-65536*(i=Math.floor(n/65536)),c=(n=c+i+65535)-65536*(i=Math.floor(n/65536)),A=(n=A+i+65535)-65536*(i=Math.floor(n/65536)),u=(n=u+i+65535)-65536*(i=Math.floor(n/65536)),l=(n=l+i+65535)-65536*(i=Math.floor(n/65536)),d=(n=d+i+65535)-65536*(i=Math.floor(n/65536)),p=(n=p+i+65535)-65536*(i=Math.floor(n/65536)),h=(n=h+i+65535)-65536*(i=Math.floor(n/65536)),f=(n=f+i+65535)-65536*(i=Math.floor(n/65536)),g=(n=g+i+65535)-65536*(i=Math.floor(n/65536)),m=(n=m+i+65535)-65536*(i=Math.floor(n/65536)),y=(n=y+i+65535)-65536*(i=Math.floor(n/65536)),I=(n=I+i+65535)-65536*(i=Math.floor(n/65536)),C=(n=C+i+65535)-65536*(i=Math.floor(n/65536)),o=(n=(o+=i-1+37*(i-1))+(i=1)+65535)-65536*(i=Math.floor(n/65536)),a=(n=a+i+65535)-65536*(i=Math.floor(n/65536)),s=(n=s+i+65535)-65536*(i=Math.floor(n/65536)),c=(n=c+i+65535)-65536*(i=Math.floor(n/65536)),A=(n=A+i+65535)-65536*(i=Math.floor(n/65536)),u=(n=u+i+65535)-65536*(i=Math.floor(n/65536)),l=(n=l+i+65535)-65536*(i=Math.floor(n/65536)),d=(n=d+i+65535)-65536*(i=Math.floor(n/65536)),p=(n=p+i+65535)-65536*(i=Math.floor(n/65536)),h=(n=h+i+65535)-65536*(i=Math.floor(n/65536)),f=(n=f+i+65535)-65536*(i=Math.floor(n/65536)),g=(n=g+i+65535)-65536*(i=Math.floor(n/65536)),m=(n=m+i+65535)-65536*(i=Math.floor(n/65536)),y=(n=y+i+65535)-65536*(i=Math.floor(n/65536)),I=(n=I+i+65535)-65536*(i=Math.floor(n/65536)),C=(n=C+i+65535)-65536*(i=Math.floor(n/65536)),o+=i-1+37*(i-1),e[0]=o,e[1]=a,e[2]=s,e[3]=c,e[4]=A,e[5]=u,e[6]=l,e[7]=d,e[8]=p,e[9]=h,e[10]=f,e[11]=g,e[12]=m,e[13]=y,e[14]=I,e[15]=C}function F(e,t){U(e,t,t)}function q(e,r){var n,i=t();for(n=0;n<16;n++)i[n]=r[n];for(n=253;n>=0;n--)F(i,i),2!==n&&4!==n&&U(i,i,r);for(n=0;n<16;n++)e[n]=i[n]}function L(e,r){var n,i=t();for(n=0;n<16;n++)i[n]=r[n];for(n=250;n>=0;n--)F(i,i),1!==n&&U(i,i,r);for(n=0;n<16;n++)e[n]=i[n]}function G(e,r,n){var i,o,a=new Uint8Array(32),s=new Float64Array(80),A=t(),u=t(),l=t(),d=t(),p=t(),h=t();for(o=0;o<31;o++)a[o]=r[o];for(a[31]=127&r[31]|64,a[0]&=248,z(s,n),o=0;o<16;o++)u[o]=s[o],d[o]=A[o]=l[o]=0;for(A[0]=d[0]=1,o=254;o>=0;--o)R(A,u,i=a[o>>>3]>>>(7&o)&1),R(l,d,i),k(p,A,l),P(A,A,l),k(l,u,d),P(u,u,d),F(d,p),F(h,A),U(A,l,A),U(l,u,p),k(p,A,l),P(A,A,l),F(u,A),P(l,d,h),U(A,l,c),k(A,A,d),U(l,l,A),U(A,d,h),U(d,u,s),F(u,p),R(A,u,i),R(l,d,i);for(o=0;o<16;o++)s[o+16]=A[o],s[o+32]=l[o],s[o+48]=u[o],s[o+64]=d[o];var f=s.subarray(32),g=s.subarray(16);return q(f,f),U(g,g,f),M(e,g),0}function H(e,t){return G(e,t,o)}function j(e,t){return n(t,32),H(e,t)}function Y(e,t,r){var n=new Uint8Array(32);return G(n,r,t),I(e,i,n,C)}v.prototype.blocks=function(e,t,r){for(var n,i,o,a,s,c,A,u,l,d,p,h,f,g,m,y,I,C,E,B=this.fin?0:2048,w=this.h[0],Q=this.h[1],v=this.h[2],N=this.h[3],b=this.h[4],S=this.h[5],x=this.h[6],T=this.h[7],_=this.h[8],R=this.h[9],M=this.r[0],D=this.r[1],O=this.r[2],z=this.r[3],k=this.r[4],P=this.r[5],U=this.r[6],F=this.r[7],q=this.r[8],L=this.r[9];r>=16;)d=l=0,d+=(w+=8191&(n=255&e[t+0]|(255&e[t+1])<<8))*M,d+=(Q+=8191&(n>>>13|(i=255&e[t+2]|(255&e[t+3])<<8)<<3))*(5*L),d+=(v+=8191&(i>>>10|(o=255&e[t+4]|(255&e[t+5])<<8)<<6))*(5*q),d+=(N+=8191&(o>>>7|(a=255&e[t+6]|(255&e[t+7])<<8)<<9))*(5*F),l=(d+=(b+=8191&(a>>>4|(s=255&e[t+8]|(255&e[t+9])<<8)<<12))*(5*U))>>>13,d&=8191,d+=(S+=s>>>1&8191)*(5*P),d+=(x+=8191&(s>>>14|(c=255&e[t+10]|(255&e[t+11])<<8)<<2))*(5*k),d+=(T+=8191&(c>>>11|(A=255&e[t+12]|(255&e[t+13])<<8)<<5))*(5*z),d+=(_+=8191&(A>>>8|(u=255&e[t+14]|(255&e[t+15])<<8)<<8))*(5*O),p=l+=(d+=(R+=u>>>5|B)*(5*D))>>>13,p+=w*D,p+=Q*M,p+=v*(5*L),p+=N*(5*q),l=(p+=b*(5*F))>>>13,p&=8191,p+=S*(5*U),p+=x*(5*P),p+=T*(5*k),p+=_*(5*z),l+=(p+=R*(5*O))>>>13,p&=8191,h=l,h+=w*O,h+=Q*D,h+=v*M,h+=N*(5*L),l=(h+=b*(5*q))>>>13,h&=8191,h+=S*(5*F),h+=x*(5*U),h+=T*(5*P),h+=_*(5*k),f=l+=(h+=R*(5*z))>>>13,f+=w*z,f+=Q*O,f+=v*D,f+=N*M,l=(f+=b*(5*L))>>>13,f&=8191,f+=S*(5*q),f+=x*(5*F),f+=T*(5*U),f+=_*(5*P),g=l+=(f+=R*(5*k))>>>13,g+=w*k,g+=Q*z,g+=v*O,g+=N*D,l=(g+=b*M)>>>13,g&=8191,g+=S*(5*L),g+=x*(5*q),g+=T*(5*F),g+=_*(5*U),m=l+=(g+=R*(5*P))>>>13,m+=w*P,m+=Q*k,m+=v*z,m+=N*O,l=(m+=b*D)>>>13,m&=8191,m+=S*M,m+=x*(5*L),m+=T*(5*q),m+=_*(5*F),y=l+=(m+=R*(5*U))>>>13,y+=w*U,y+=Q*P,y+=v*k,y+=N*z,l=(y+=b*O)>>>13,y&=8191,y+=S*D,y+=x*M,y+=T*(5*L),y+=_*(5*q),I=l+=(y+=R*(5*F))>>>13,I+=w*F,I+=Q*U,I+=v*P,I+=N*k,l=(I+=b*z)>>>13,I&=8191,I+=S*O,I+=x*D,I+=T*M,I+=_*(5*L),C=l+=(I+=R*(5*q))>>>13,C+=w*q,C+=Q*F,C+=v*U,C+=N*P,l=(C+=b*k)>>>13,C&=8191,C+=S*z,C+=x*O,C+=T*D,C+=_*M,E=l+=(C+=R*(5*L))>>>13,E+=w*L,E+=Q*q,E+=v*F,E+=N*U,l=(E+=b*P)>>>13,E&=8191,E+=S*k,E+=x*z,E+=T*O,E+=_*D,w=d=8191&(l=(l=((l+=(E+=R*M)>>>13)<<2)+l|0)+(d&=8191)|0),Q=p+=l>>>=13,v=h&=8191,N=f&=8191,b=g&=8191,S=m&=8191,x=y&=8191,T=I&=8191,_=C&=8191,R=E&=8191,t+=16,r-=16;this.h[0]=w,this.h[1]=Q,this.h[2]=v,this.h[3]=N,this.h[4]=b,this.h[5]=S,this.h[6]=x,this.h[7]=T,this.h[8]=_,this.h[9]=R},v.prototype.finish=function(e,t){var r,n,i,o,a=new Uint16Array(10);if(this.leftover){for(o=this.leftover,this.buffer[o++]=1;o<16;o++)this.buffer[o]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(r=this.h[1]>>>13,this.h[1]&=8191,o=2;o<10;o++)this.h[o]+=r,r=this.h[o]>>>13,this.h[o]&=8191;for(this.h[0]+=5*r,r=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=r,r=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=r,a[0]=this.h[0]+5,r=a[0]>>>13,a[0]&=8191,o=1;o<10;o++)a[o]=this.h[o]+r,r=a[o]>>>13,a[o]&=8191;for(a[9]-=8192,n=(1^r)-1,o=0;o<10;o++)a[o]&=n;for(n=~n,o=0;o<10;o++)this.h[o]=this.h[o]&n|a[o];for(this.h[0]=65535&(this.h[0]|this.h[1]<<13),this.h[1]=65535&(this.h[1]>>>3|this.h[2]<<10),this.h[2]=65535&(this.h[2]>>>6|this.h[3]<<7),this.h[3]=65535&(this.h[3]>>>9|this.h[4]<<4),this.h[4]=65535&(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14),this.h[5]=65535&(this.h[6]>>>2|this.h[7]<<11),this.h[6]=65535&(this.h[7]>>>5|this.h[8]<<8),this.h[7]=65535&(this.h[8]>>>8|this.h[9]<<5),i=this.h[0]+this.pad[0],this.h[0]=65535&i,o=1;o<8;o++)i=(this.h[o]+this.pad[o]|0)+(i>>>16)|0,this.h[o]=65535&i;e[t+0]=this.h[0]>>>0&255,e[t+1]=this.h[0]>>>8&255,e[t+2]=this.h[1]>>>0&255,e[t+3]=this.h[1]>>>8&255,e[t+4]=this.h[2]>>>0&255,e[t+5]=this.h[2]>>>8&255,e[t+6]=this.h[3]>>>0&255,e[t+7]=this.h[3]>>>8&255,e[t+8]=this.h[4]>>>0&255,e[t+9]=this.h[4]>>>8&255,e[t+10]=this.h[5]>>>0&255,e[t+11]=this.h[5]>>>8&255,e[t+12]=this.h[6]>>>0&255,e[t+13]=this.h[6]>>>8&255,e[t+14]=this.h[7]>>>0&255,e[t+15]=this.h[7]>>>8&255},v.prototype.update=function(e,t,r){var n,i;if(this.leftover){for((i=16-this.leftover)>r&&(i=r),n=0;n<i;n++)this.buffer[this.leftover+n]=e[t+n];if(r-=i,t+=i,this.leftover+=i,this.leftover<16)return;this.blocks(this.buffer,0,16),this.leftover=0}if(r>=16&&(i=r-r%16,this.blocks(e,t,i),t+=i,r-=i),r){for(n=0;n<r;n++)this.buffer[this.leftover+n]=e[t+n];this.leftover+=r}};var $=S,K=x,V=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function J(e,t,r,n){for(var i,o,a,s,c,A,u,l,d,p,h,f,g,m,y,I,C,E,B,w,Q,v,N,b,S,x,T=new Int32Array(16),_=new Int32Array(16),R=e[0],M=e[1],D=e[2],O=e[3],z=e[4],k=e[5],P=e[6],U=e[7],F=t[0],q=t[1],L=t[2],G=t[3],H=t[4],j=t[5],Y=t[6],$=t[7],K=0;n>=128;){for(B=0;B<16;B++)w=8*B+K,T[B]=r[w+0]<<24|r[w+1]<<16|r[w+2]<<8|r[w+3],_[B]=r[w+4]<<24|r[w+5]<<16|r[w+6]<<8|r[w+7];for(B=0;B<80;B++)if(i=R,o=M,a=D,s=O,c=z,A=k,u=P,d=F,p=q,h=L,f=G,g=H,m=j,y=Y,N=65535&(v=$),b=v>>>16,S=65535&(Q=U),x=Q>>>16,N+=65535&(v=(H>>>14|z<<18)^(H>>>18|z<<14)^(z>>>9|H<<23)),b+=v>>>16,S+=65535&(Q=(z>>>14|H<<18)^(z>>>18|H<<14)^(H>>>9|z<<23)),x+=Q>>>16,N+=65535&(v=H&j^~H&Y),b+=v>>>16,S+=65535&(Q=z&k^~z&P),x+=Q>>>16,N+=65535&(v=V[2*B+1]),b+=v>>>16,S+=65535&(Q=V[2*B]),x+=Q>>>16,Q=T[B%16],b+=(v=_[B%16])>>>16,S+=65535&Q,x+=Q>>>16,S+=(b+=(N+=65535&v)>>>16)>>>16,N=65535&(v=E=65535&N|b<<16),b=v>>>16,S=65535&(Q=C=65535&S|(x+=S>>>16)<<16),x=Q>>>16,N+=65535&(v=(F>>>28|R<<4)^(R>>>2|F<<30)^(R>>>7|F<<25)),b+=v>>>16,S+=65535&(Q=(R>>>28|F<<4)^(F>>>2|R<<30)^(F>>>7|R<<25)),x+=Q>>>16,b+=(v=F&q^F&L^q&L)>>>16,S+=65535&(Q=R&M^R&D^M&D),x+=Q>>>16,l=65535&(S+=(b+=(N+=65535&v)>>>16)>>>16)|(x+=S>>>16)<<16,I=65535&N|b<<16,N=65535&(v=f),b=v>>>16,S=65535&(Q=s),x=Q>>>16,b+=(v=E)>>>16,S+=65535&(Q=C),x+=Q>>>16,M=i,D=o,O=a,z=s=65535&(S+=(b+=(N+=65535&v)>>>16)>>>16)|(x+=S>>>16)<<16,k=c,P=A,U=u,R=l,q=d,L=p,G=h,H=f=65535&N|b<<16,j=g,Y=m,$=y,F=I,B%16==15)for(w=0;w<16;w++)Q=T[w],N=65535&(v=_[w]),b=v>>>16,S=65535&Q,x=Q>>>16,Q=T[(w+9)%16],N+=65535&(v=_[(w+9)%16]),b+=v>>>16,S+=65535&Q,x+=Q>>>16,C=T[(w+1)%16],N+=65535&(v=((E=_[(w+1)%16])>>>1|C<<31)^(E>>>8|C<<24)^(E>>>7|C<<25)),b+=v>>>16,S+=65535&(Q=(C>>>1|E<<31)^(C>>>8|E<<24)^C>>>7),x+=Q>>>16,C=T[(w+14)%16],b+=(v=((E=_[(w+14)%16])>>>19|C<<13)^(C>>>29|E<<3)^(E>>>6|C<<26))>>>16,S+=65535&(Q=(C>>>19|E<<13)^(E>>>29|C<<3)^C>>>6),x+=Q>>>16,x+=(S+=(b+=(N+=65535&v)>>>16)>>>16)>>>16,T[w]=65535&S|x<<16,_[w]=65535&N|b<<16;N=65535&(v=F),b=v>>>16,S=65535&(Q=R),x=Q>>>16,Q=e[0],b+=(v=t[0])>>>16,S+=65535&Q,x+=Q>>>16,x+=(S+=(b+=(N+=65535&v)>>>16)>>>16)>>>16,e[0]=R=65535&S|x<<16,t[0]=F=65535&N|b<<16,N=65535&(v=q),b=v>>>16,S=65535&(Q=M),x=Q>>>16,Q=e[1],b+=(v=t[1])>>>16,S+=65535&Q,x+=Q>>>16,x+=(S+=(b+=(N+=65535&v)>>>16)>>>16)>>>16,e[1]=M=65535&S|x<<16,t[1]=q=65535&N|b<<16,N=65535&(v=L),b=v>>>16,S=65535&(Q=D),x=Q>>>16,Q=e[2],b+=(v=t[2])>>>16,S+=65535&Q,x+=Q>>>16,x+=(S+=(b+=(N+=65535&v)>>>16)>>>16)>>>16,e[2]=D=65535&S|x<<16,t[2]=L=65535&N|b<<16,N=65535&(v=G),b=v>>>16,S=65535&(Q=O),x=Q>>>16,Q=e[3],b+=(v=t[3])>>>16,S+=65535&Q,x+=Q>>>16,x+=(S+=(b+=(N+=65535&v)>>>16)>>>16)>>>16,e[3]=O=65535&S|x<<16,t[3]=G=65535&N|b<<16,N=65535&(v=H),b=v>>>16,S=65535&(Q=z),x=Q>>>16,Q=e[4],b+=(v=t[4])>>>16,S+=65535&Q,x+=Q>>>16,x+=(S+=(b+=(N+=65535&v)>>>16)>>>16)>>>16,e[4]=z=65535&S|x<<16,t[4]=H=65535&N|b<<16,N=65535&(v=j),b=v>>>16,S=65535&(Q=k),x=Q>>>16,Q=e[5],b+=(v=t[5])>>>16,S+=65535&Q,x+=Q>>>16,x+=(S+=(b+=(N+=65535&v)>>>16)>>>16)>>>16,e[5]=k=65535&S|x<<16,t[5]=j=65535&N|b<<16,N=65535&(v=Y),b=v>>>16,S=65535&(Q=P),x=Q>>>16,Q=e[6],b+=(v=t[6])>>>16,S+=65535&Q,x+=Q>>>16,x+=(S+=(b+=(N+=65535&v)>>>16)>>>16)>>>16,e[6]=P=65535&S|x<<16,t[6]=Y=65535&N|b<<16,N=65535&(v=$),b=v>>>16,S=65535&(Q=U),x=Q>>>16,Q=e[7],b+=(v=t[7])>>>16,S+=65535&Q,x+=Q>>>16,x+=(S+=(b+=(N+=65535&v)>>>16)>>>16)>>>16,e[7]=U=65535&S|x<<16,t[7]=$=65535&N|b<<16,K+=128,n-=128}return n}function W(e,t,r){var n,i=new Int32Array(8),o=new Int32Array(8),a=new Uint8Array(256),s=r;for(i[0]=1779033703,i[1]=3144134277,i[2]=1013904242,i[3]=2773480762,i[4]=1359893119,i[5]=2600822924,i[6]=528734635,i[7]=1541459225,o[0]=4089235720,o[1]=2227873595,o[2]=4271175723,o[3]=1595750129,o[4]=2917565137,o[5]=725511199,o[6]=4215389547,o[7]=327033209,J(i,o,t,r),r%=128,n=0;n<r;n++)a[n]=t[s-r+n];for(a[r]=128,a[(r=256-128*(r<112?1:0))-9]=0,h(a,r-8,s/536870912|0,s<<3),J(i,o,a,r),n=0;n<8;n++)h(e,8*n,i[n],o[n]);return 0}function X(e,r){var n=t(),i=t(),o=t(),a=t(),s=t(),c=t(),A=t(),l=t(),d=t();P(n,e[1],e[0]),P(d,r[1],r[0]),U(n,n,d),k(i,e[0],e[1]),k(d,r[0],r[1]),U(i,i,d),U(o,e[3],r[3]),U(o,o,u),U(a,e[2],r[2]),k(a,a,a),P(s,i,n),P(c,a,o),k(A,a,o),k(l,i,n),U(e[0],s,c),U(e[1],l,A),U(e[2],A,c),U(e[3],s,l)}function Z(e,t,r){var n;for(n=0;n<4;n++)R(e[n],t[n],r)}function ee(e,r){var n=t(),i=t(),o=t();q(o,r[2]),U(n,r[0],o),U(i,r[1],o),M(e,i),e[31]^=O(n)<<7}function te(e,t,r){var n,i;for(T(e[0],a),T(e[1],s),T(e[2],s),T(e[3],a),i=255;i>=0;--i)Z(e,t,n=r[i/8|0]>>(7&i)&1),X(t,e),X(e,e),Z(e,t,n)}function re(e,r){var n=[t(),t(),t(),t()];T(n[0],l),T(n[1],d),T(n[2],s),U(n[3],l,d),te(e,n,r)}function ne(e,r,i){var o,a=new Uint8Array(64),s=[t(),t(),t(),t()];for(i||n(r,32),W(a,r,32),a[0]&=248,a[31]&=127,a[31]|=64,re(s,a),ee(e,s),o=0;o<32;o++)r[o+32]=e[o];return 0}var ie=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function oe(e,t){var r,n,i,o;for(n=63;n>=32;--n){for(r=0,i=n-32,o=n-12;i<o;++i)t[i]+=r-16*t[n]*ie[i-(n-32)],r=Math.floor((t[i]+128)/256),t[i]-=256*r;t[i]+=r,t[n]=0}for(r=0,i=0;i<32;i++)t[i]+=r-(t[31]>>4)*ie[i],r=t[i]>>8,t[i]&=255;for(i=0;i<32;i++)t[i]-=r*ie[i];for(n=0;n<32;n++)t[n+1]+=t[n]>>8,e[n]=255&t[n]}function ae(e){var t,r=new Float64Array(64);for(t=0;t<64;t++)r[t]=e[t];for(t=0;t<64;t++)e[t]=0;oe(e,r)}function se(e,r,n,i){var o,a,s=new Uint8Array(64),c=new Uint8Array(64),A=new Uint8Array(64),u=new Float64Array(64),l=[t(),t(),t(),t()];W(s,i,32),s[0]&=248,s[31]&=127,s[31]|=64;var d=n+64;for(o=0;o<n;o++)e[64+o]=r[o];for(o=0;o<32;o++)e[32+o]=s[32+o];for(W(A,e.subarray(32),n+32),ae(A),re(l,A),ee(e,l),o=32;o<64;o++)e[o]=i[o];for(W(c,e,n+64),ae(c),o=0;o<64;o++)u[o]=0;for(o=0;o<32;o++)u[o]=A[o];for(o=0;o<32;o++)for(a=0;a<32;a++)u[o+a]+=c[o]*s[a];return oe(e.subarray(32),u),d}function ce(e,r,n,i){var o,c=new Uint8Array(32),u=new Uint8Array(64),l=[t(),t(),t(),t()],d=[t(),t(),t(),t()];if(n<64)return-1;if(function(e,r){var n=t(),i=t(),o=t(),c=t(),u=t(),l=t(),d=t();return T(e[2],s),z(e[1],r),F(o,e[1]),U(c,o,A),P(o,o,e[2]),k(c,e[2],c),F(u,c),F(l,u),U(d,l,u),U(n,d,o),U(n,n,c),L(n,n),U(n,n,o),U(n,n,c),U(n,n,c),U(e[0],n,c),F(i,e[0]),U(i,i,c),D(i,o)&&U(e[0],e[0],p),F(i,e[0]),U(i,i,c),D(i,o)?-1:(O(e[0])===r[31]>>7&&P(e[0],a,e[0]),U(e[3],e[0],e[1]),0)}(d,i))return-1;for(o=0;o<n;o++)e[o]=r[o];for(o=0;o<32;o++)e[o+32]=i[o];if(W(u,e,n),ae(u),te(l,d,u),re(d,r.subarray(32)),X(l,d),ee(c,l),n-=64,m(r,0,c,0)){for(o=0;o<n;o++)e[o]=0;return-1}for(o=0;o<n;o++)e[o]=r[o+64];return n}var Ae=64,ue=32,le=64;function de(e,t){if(32!==e.length)throw new Error("bad key size");if(24!==t.length)throw new Error("bad nonce size")}function pe(){for(var e=0;e<arguments.length;e++)if(!(arguments[e]instanceof Uint8Array))throw new TypeError("unexpected type, use Uint8Array")}function he(e){for(var t=0;t<e.length;t++)e[t]=0}e.lowlevel={crypto_core_hsalsa20:I,crypto_stream_xor:Q,crypto_stream:w,crypto_stream_salsa20_xor:E,crypto_stream_salsa20:B,crypto_onetimeauth:N,crypto_onetimeauth_verify:b,crypto_verify_16:g,crypto_verify_32:m,crypto_secretbox:S,crypto_secretbox_open:x,crypto_scalarmult:G,crypto_scalarmult_base:H,crypto_box_beforenm:Y,crypto_box_afternm:$,crypto_box:function(e,t,r,n,i,o){var a=new Uint8Array(32);return Y(a,i,o),$(e,t,r,n,a)},crypto_box_open:function(e,t,r,n,i,o){var a=new Uint8Array(32);return Y(a,i,o),K(e,t,r,n,a)},crypto_box_keypair:j,crypto_hash:W,crypto_sign:se,crypto_sign_keypair:ne,crypto_sign_open:ce,crypto_secretbox_KEYBYTES:32,crypto_secretbox_NONCEBYTES:24,crypto_secretbox_ZEROBYTES:32,crypto_secretbox_BOXZEROBYTES:16,crypto_scalarmult_BYTES:32,crypto_scalarmult_SCALARBYTES:32,crypto_box_PUBLICKEYBYTES:32,crypto_box_SECRETKEYBYTES:32,crypto_box_BEFORENMBYTES:32,crypto_box_NONCEBYTES:24,crypto_box_ZEROBYTES:32,crypto_box_BOXZEROBYTES:16,crypto_sign_BYTES:Ae,crypto_sign_PUBLICKEYBYTES:ue,crypto_sign_SECRETKEYBYTES:le,crypto_sign_SEEDBYTES:32,crypto_hash_BYTES:64,gf:t,D:A,L:ie,pack25519:M,unpack25519:z,M:U,A:k,S:F,Z:P,pow2523:L,add:X,set25519:T,modL:oe,scalarmult:te,scalarbase:re},e.randomBytes=function(e){var t=new Uint8Array(e);return n(t,e),t},e.secretbox=function(e,t,r){pe(e,t,r),de(r,t);for(var n=new Uint8Array(32+e.length),i=new Uint8Array(n.length),o=0;o<e.length;o++)n[o+32]=e[o];return S(i,n,n.length,t,r),i.subarray(16)},e.secretbox.open=function(e,t,r){pe(e,t,r),de(r,t);for(var n=new Uint8Array(16+e.length),i=new Uint8Array(n.length),o=0;o<e.length;o++)n[o+16]=e[o];return n.length<32||0!==x(i,n,n.length,t,r)?null:i.subarray(32)},e.secretbox.keyLength=32,e.secretbox.nonceLength=24,e.secretbox.overheadLength=16,e.scalarMult=function(e,t){if(pe(e,t),32!==e.length)throw new Error("bad n size");if(32!==t.length)throw new Error("bad p size");var r=new Uint8Array(32);return G(r,e,t),r},e.scalarMult.base=function(e){if(pe(e),32!==e.length)throw new Error("bad n size");var t=new Uint8Array(32);return H(t,e),t},e.scalarMult.scalarLength=32,e.scalarMult.groupElementLength=32,e.box=function(t,r,n,i){var o=e.box.before(n,i);return e.secretbox(t,r,o)},e.box.before=function(e,t){pe(e,t),function(e,t){if(32!==e.length)throw new Error("bad public key size");if(32!==t.length)throw new Error("bad secret key size")}(e,t);var r=new Uint8Array(32);return Y(r,e,t),r},e.box.after=e.secretbox,e.box.open=function(t,r,n,i){var o=e.box.before(n,i);return e.secretbox.open(t,r,o)},e.box.open.after=e.secretbox.open,e.box.keyPair=function(){var e=new Uint8Array(32),t=new Uint8Array(32);return j(e,t),{publicKey:e,secretKey:t}},e.box.keyPair.fromSecretKey=function(e){if(pe(e),32!==e.length)throw new Error("bad secret key size");var t=new Uint8Array(32);return H(t,e),{publicKey:t,secretKey:new Uint8Array(e)}},e.box.publicKeyLength=32,e.box.secretKeyLength=32,e.box.sharedKeyLength=32,e.box.nonceLength=24,e.box.overheadLength=e.secretbox.overheadLength,e.sign=function(e,t){if(pe(e,t),t.length!==le)throw new Error("bad secret key size");var r=new Uint8Array(Ae+e.length);return se(r,e,e.length,t),r},e.sign.open=function(e,t){if(pe(e,t),t.length!==ue)throw new Error("bad public key size");var r=new Uint8Array(e.length),n=ce(r,e,e.length,t);if(n<0)return null;for(var i=new Uint8Array(n),o=0;o<i.length;o++)i[o]=r[o];return i},e.sign.detached=function(t,r){for(var n=e.sign(t,r),i=new Uint8Array(Ae),o=0;o<i.length;o++)i[o]=n[o];return i},e.sign.detached.verify=function(e,t,r){if(pe(e,t,r),t.length!==Ae)throw new Error("bad signature size");if(r.length!==ue)throw new Error("bad public key size");var n,i=new Uint8Array(Ae+e.length),o=new Uint8Array(Ae+e.length);for(n=0;n<Ae;n++)i[n]=t[n];for(n=0;n<e.length;n++)i[n+Ae]=e[n];return ce(o,i,i.length,r)>=0},e.sign.keyPair=function(){var e=new Uint8Array(ue),t=new Uint8Array(le);return ne(e,t),{publicKey:e,secretKey:t}},e.sign.keyPair.fromSecretKey=function(e){if(pe(e),e.length!==le)throw new Error("bad secret key size");for(var t=new Uint8Array(ue),r=0;r<t.length;r++)t[r]=e[32+r];return{publicKey:t,secretKey:new Uint8Array(e)}},e.sign.keyPair.fromSeed=function(e){if(pe(e),32!==e.length)throw new Error("bad seed size");for(var t=new Uint8Array(ue),r=new Uint8Array(le),n=0;n<32;n++)r[n]=e[n];return ne(t,r,!0),{publicKey:t,secretKey:r}},e.sign.publicKeyLength=ue,e.sign.secretKeyLength=le,e.sign.seedLength=32,e.sign.signatureLength=Ae,e.hash=function(e){pe(e);var t=new Uint8Array(64);return W(t,e,e.length),t},e.hash.hashLength=64,e.verify=function(e,t){return pe(e,t),0!==e.length&&0!==t.length&&e.length===t.length&&0===f(e,0,t,0,e.length)},e.setPRNG=function(e){n=e},function(){var t="undefined"!=typeof self?self.crypto||self.msCrypto:null;t&&t.getRandomValues?e.setPRNG((function(e,r){var n,i=new Uint8Array(r);for(n=0;n<r;n+=65536)t.getRandomValues(i.subarray(n,n+Math.min(r-n,65536)));for(n=0;n<r;n++)e[n]=i[n];he(i)})):(t=r(5024))&&t.randomBytes&&e.setPRNG((function(e,r){var n,i=t.randomBytes(r);for(n=0;n<r;n++)e[n]=i[n];he(i)}))}()}(e.exports?e.exports:self.nacl=self.nacl||{})},7795:function(e,t,r){"use strict";var n=r(9509).Buffer;function i(e){if(e<0||e>9007199254740991||e%1!=0)throw new RangeError("value out of range")}function o(e){return i(e),e<253?1:e<=65535?3:e<=4294967295?5:9}e.exports={encode:function e(t,r,a){if(i(t),r||(r=n.allocUnsafe(o(t))),!n.isBuffer(r))throw new TypeError("buffer must be a Buffer instance");return a||(a=0),t<253?(r.writeUInt8(t,a),e.bytes=1):t<=65535?(r.writeUInt8(253,a),r.writeUInt16LE(t,a+1),e.bytes=3):t<=4294967295?(r.writeUInt8(254,a),r.writeUInt32LE(t,a+1),e.bytes=5):(r.writeUInt8(255,a),r.writeUInt32LE(t>>>0,a+1),r.writeUInt32LE(t/4294967296|0,a+5),e.bytes=9),r},decode:function e(t,r){if(!n.isBuffer(t))throw new TypeError("buffer must be a Buffer instance");r||(r=0);var o=t.readUInt8(r);if(o<253)return e.bytes=1,o;if(253===o)return e.bytes=3,t.readUInt16LE(r+1);if(254===o)return e.bytes=5,t.readUInt32LE(r+1);e.bytes=9;var a=t.readUInt32LE(r+1),s=4294967296*t.readUInt32LE(r+5)+a;return i(s),s},encodingLength:o}},5840:function(e,t,r){var n;if("object"==typeof globalThis)n=globalThis;else try{n=r(284)}catch(e){}finally{if(n||"undefined"==typeof window||(n=window),!n)throw new Error("Could not determine global this")}var i=n.WebSocket||n.MozWebSocket,o=r(9387);function a(e,t){return t?new i(e,t):new i(e)}i&&["CONNECTING","OPEN","CLOSING","CLOSED"].forEach((function(e){Object.defineProperty(a,e,{get:function(){return i[e]}})})),e.exports={w3cwebsocket:i?a:null,version:o}},9387:function(e,t,r){e.exports=r(9794).version},8955:function(){},5024:function(){},7445:function(e,t,r){e.exports=r(3685)},9794:function(e){"use strict";e.exports={version:"1.0.34"}}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var o=t[n]={exports:{}};return e[n].call(o.exports,o,o.exports,r),o.exports}r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};return function(){"use strict";r.r(n),r.d(n,{ABI_VERSIONS:function(){return Bn},AE_AMOUNT_FORMATS:function(){return et},AccountBase:function(){return mu},AccountError:function(){return _},AccountGeneralized:function(){return Al},AccountLedger:function(){return dl},AccountLedgerFactory:function(){return hl},AeSdk:function(){return gu},AeSdkAepp:function(){return Xu},AeSdkBase:function(){return fu},AeSdkMethods:function(){return hu},AeSdkWallet:function(){return il},AensError:function(){return R},AensPointerContextError:function(){return ne},AeppError:function(){return M},AlreadyConnectedError:function(){return We},AmbiguousEventDefinitionError:function(){return xe},ArgumentCountMismatchError:function(){return G},ArgumentError:function(){return q},BaseError:function(){return T},BrowserRuntimeConnection:function(){return Vd},BrowserWindowMessageConnection:function(){return $d},BytecodeMismatchError:function(){return ye},CLIENT_TTL:function(){return cr},CallReturnType:function(){return wn},Channel:function(){return Fd},ChannelCallError:function(){return le},ChannelConnectionError:function(){return de},ChannelError:function(){return D},ChannelIncomingMessageError:function(){return fe},ChannelPingTimedOutError:function(){return pe},CompilerError:function(){return O},CompilerHttp:function(){return Ad},Contract:function(){return VA},ContractError:function(){return z},CryptographyError:function(){return k},DRY_RUN_ACCOUNT:function(){return Cn},DecodeError:function(){return Pe},DerivationError:function(){return wA},DryRunError:function(){return Fe},DuplicateContractError:function(){return Ie},DuplicateNodeError:function(){return ze},Encoding:function(){return St},FIELD_TYPES:function(){return Nn},IllegalArgumentError:function(){return L},IllegalBidFeeError:function(){return qe},InactiveContractError:function(){return Ce},InsufficientBalanceError:function(){return H},InsufficientNameFeeError:function(){return ie},InternalError:function(){return ee},InvalidAensNameError:function(){return oe},InvalidAuthDataError:function(){return me},InvalidChecksumError:function(){return Te},InvalidMethodInvocationError:function(){return Ee},InvalidPasswordError:function(){return _e},InvalidRpcMessageError:function(){return ae},InvalidSignatureError:function(){return Le},InvalidTxError:function(){return _c},InvalidTxParamsError:function(){return Ge},MAX_AUTH_FUN_GAS:function(){return ir},MESSAGE_DIRECTION:function(){return yu},METHODS:function(){return Eu},MIN_GAS_PRICE:function(){return Ar},MemoryAccount:function(){return sl},MerkleTreeHashMismatchError:function(){return Re},MissingCallbackError:function(){return se},MissingContractAddressError:function(){return Be},MissingContractDefError:function(){return we},MissingEventDefinitionError:function(){return Se},MissingFunctionNameError:function(){return Qe},MissingNodeInTreeError:function(){return Me},MissingParamError:function(){return j},NAME_BID_MAX_LENGTH:function(){return hr},NAME_BID_RANGES:function(){return fr},NAME_BID_TIMEOUT_BLOCKS:function(){return dr},NAME_FEE_BID_INCREMENT:function(){return lr},NAME_FEE_MULTIPLIER:function(){return ur},NAME_MAX_CLIENT_TTL:function(){return sr},NAME_MAX_LENGTH_FEE:function(){return pr},NAME_MAX_TTL:function(){return ar},NAME_TTL:function(){return or},NoSerializerFoundError:function(){return Y},NoSuchContractFunctionError:function(){return Ne},NoWalletConnectedError:function(){return Xe},Node:function(){return vc},NodeError:function(){return P},NodeInvocationError:function(){return ve},NodeNotFoundError:function(){return ke},NotImplementedError:function(){return X},NotPayableFunctionError:function(){return be},ORACLE_TTL:function(){return mn},ORACLE_TTL_TYPES:function(){return hn},PROTOCOL_VERSIONS:function(){return Qn},PROTOCOL_VM_ABI:function(){return vn},PayloadLengthError:function(){return Ue},PrefixNotFoundError:function(){return He},QUERY_FEE:function(){return gn},QUERY_TTL:function(){return yn},RESPONSE_TTL:function(){return In},RPC_STATUS:function(){return Bu},RequestTimedOutError:function(){return $},RpcBroadcastError:function(){return Nu},RpcConnectionDenyError:function(){return xu},RpcConnectionError:function(){return Ze},RpcError:function(){return Qu},RpcInternalError:function(){return Ru},RpcInvalidTransactionError:function(){return vu},RpcMethodNotFoundError:function(){return Mu},RpcNotAuthorizeError:function(){return Tu},RpcPermissionDenyError:function(){return _u},RpcRejectedByUserError:function(){return bu},RpcUnsupportedProtocolError:function(){return Su},SUBSCRIPTION_TYPES:function(){return Cu},SchemaNotFoundError:function(){return je},TX_SCHEMA:function(){return Sn},TX_TTL:function(){return fn},Tag:function(){return gr},TagNotFoundError:function(){return Ye},TransactionError:function(){return U},TxNotInChainError:function(){return $e},TxTimedOutError:function(){return K},TypeError:function(){return V},UnAuthorizedAccountError:function(){return ce},UnavailableAccountError:function(){return re},UnexpectedChannelMessageError:function(){return he},UnexpectedTsError:function(){return te},UnknownChannelStateError:function(){return ge},UnknownNodeLengthError:function(){return De},UnknownPathNibbleError:function(){return Oe},UnknownRpcClientError:function(){return Ae},UnknownTxError:function(){return Ke},UnsubscribedAccountError:function(){return ue},UnsupportedABIversionError:function(){return Ve},UnsupportedPlatformError:function(){return J},UnsupportedProtocolError:function(){return W},UnsupportedVMversionError:function(){return Je},UnsupportedVersionError:function(){return Z},VM_VERSIONS:function(){return En},WALLET_TYPE:function(){return Iu},WalletError:function(){return F},_buildTx:function(){return hA},_getPollInterval:function(){return Tc},aensBid:function(){return jA},aensClaim:function(){return GA},aensPreclaim:function(){return HA},aensQuery:function(){return LA},aensRevoke:function(){return UA},aensTransfer:function(){return qA},aensUpdate:function(){return FA},awaitHeight:function(){return Dc},buildAuthTxHash:function(){return au},buildContractId:function(){return Cr},buildContractIdByContractTx:function(){return Ln},buildTx:function(){return Un},buildTxHash:function(){return qn},commitmentHash:function(){return wr},computeAuctionEndBlock:function(){return _r},computeBidFee:function(){return Tr},connectionProxy:function(){return qd},createGeneralizedAccount:function(){return ou},decode:function(){return qt},deriveChild:function(){return NA},derivePathFromKey:function(){return bA},derivePathFromSeed:function(){return xA},dump:function(){return dA},encode:function(){return Lt},encodeContractAddress:function(){return Vt},encodeUnsigned:function(){return $t},extendOracleTtl:function(){return eu},formatAmount:function(){return rt},genSalt:function(){return Yt},generateKeyPair:function(){return Wt},generateKeyPairFromSecret:function(){return Jt},generateSaveHDWalletFromSeed:function(){return RA},getAccount:function(){return kc},getAddressFromPriv:function(){return Ht},getBalance:function(){return Pc},getContract:function(){return Kc},getContractByteCode:function(){return $c},getCurrentGeneration:function(){return Uc},getDefaultPointerKey:function(){return Sr},getGeneration:function(){return Fc},getHdWalletAccountFromSeed:function(){return DA},getHeight:function(){return Rc},getKeyBlock:function(){return Lc},getKeyPair:function(){return _A},getMasterKeyFromSeed:function(){return SA},getMicroBlockHeader:function(){return Gc},getMicroBlockTransactions:function(){return qc},getMinimumNameFee:function(){return xr},getName:function(){return Vc},getOracleObject:function(){return ru},getQueryObject:function(){return XA},getSaveHDWalletAccounts:function(){return MA},hash:function(){return Kt},isAddressValid:function(){return jt},isAuctionName:function(){return Rr},isNameValid:function(){return Nr},isValidKeypair:function(){return nr},messageToHash:function(){return er},oracleQueryId:function(){return Er},payForTransaction:function(){return PA},poll:function(){return Mc},pollForQueries:function(){return JA},pollForQueryResponse:function(){return WA},postQueryToOracle:function(){return ZA},produceNameId:function(){return Br},readInt:function(){return Qr},recover:function(){return lA},registerOracle:function(){return nu},resolveName:function(){return Jc},respondToQuery:function(){return tu},send:function(){return OA},sendTransaction:function(){return zc},sign:function(){return Xt},signMessage:function(){return tr},spend:function(){return zA},toAe:function(){return nt},toAettos:function(){return it},toBytes:function(){return yr},transferFunds:function(){return kA},txDryRun:function(){return Yc},unpackTx:function(){return Fn},verify:function(){return Zt},verifyMessage:function(){return rr},verifyTransaction:function(){return xc},waitForTxConfirm:function(){return Oc},walletDetector:function(){return Kd}});var e={};r.r(e),r.d(e,{Account:function(){return oa},ByteCode:function(){return Ea},Channel:function(){return ba},ChannelCloseMutualTx:function(){return Ka},ChannelCloseSoloTx:function(){return Va},ChannelCreateTx:function(){return Ha},ChannelDepositTx:function(){return ja},ChannelForceProgressTx:function(){return $a},ChannelSetDelegatesTx:function(){return Za},ChannelSettleTx:function(){return Wa},ChannelSlashTx:function(){return Ja},ChannelSnapshotSoloTx:function(){return Xa},ChannelWithdrawTx:function(){return Ya},CheckTxInPoolResponse:function(){return ps},CommitmentId:function(){return La},ContractCallObject:function(){return ha},ContractCallTx:function(){return ss},ContractCreateTx:function(){return as},ContractObject:function(){return Ca},CountResponse:function(){return na},CreateContractUnsignedTx:function(){return Is},Delegates:function(){return Xo},DryRunAccount:function(){return ca},DryRunCallContext:function(){return la},DryRunCallReq:function(){return ua},DryRunInput:function(){return sa},DryRunInputItem:function(){return Aa},DryRunResult:function(){return pa},DryRunResults:function(){return da},EncodedTx:function(){return ya},ErrorModel:function(){return Ho},Event:function(){return fa},GAAttachTx:function(){return us},GAMetaTx:function(){return ls},GAObject:function(){return ma},Generation:function(){return ia},HashResponse:function(){return Yo},Header:function(){return Go},HeightResponse:function(){return $o},KeyBlock:function(){return jo},MicroBlockHeader:function(){return Ko},NameClaimTx:function(){return Pa},NameEntry:function(){return Na},NameHash:function(){return Ga},NamePointer:function(){return ra},NamePreclaimTx:function(){return ka},NameRevokeTx:function(){return qa},NameTransferTx:function(){return Fa},NameUpdateTx:function(){return Ua},NextNonceResponse:function(){return aa},OffChainCallContract:function(){return ys},OffChainDeposit:function(){return gs},OffChainNewContract:function(){return ms},OffChainTransfer:function(){return hs},OffChainUpdate:function(){return Zo},OffChainWithdrawal:function(){return fs},OracleExtendTx:function(){return Da},OracleQueries:function(){return Qa},OracleQuery:function(){return va},OracleQueryTx:function(){return Oa},OracleRegisterTx:function(){return Ma},OracleRespondTx:function(){return za},PayingForTx:function(){return ds},PeerConnections:function(){return _a},PeerCount:function(){return ns},PeerCountAvailable:function(){return os},PeerCountConnected:function(){return is},PeerDetails:function(){return ts},PeerPubKey:function(){return Sa},Peers:function(){return rs},PoI:function(){return Ba},PostTxResponse:function(){return Ia},Protocol:function(){return Ta},PubKey:function(){return es},RegisteredOracle:function(){return wa},RelativeTTL:function(){return ea},SignedTx:function(){return Jo},SignedTxs:function(){return Vo},SpendTx:function(){return Ra},Status:function(){return xa},TokenSupply:function(){return As},Ttl:function(){return ta},Tx:function(){return Wo},TxInfoObject:function(){return ga},UnsignedTx:function(){return cs},discriminators:function(){return Cs}});var t={};r.r(t),r.d(t,{InvalidTxError:function(){return _c},_getPollInterval:function(){return Tc},awaitHeight:function(){return Dc},getAccount:function(){return kc},getBalance:function(){return Pc},getContract:function(){return Kc},getContractByteCode:function(){return $c},getCurrentGeneration:function(){return Uc},getGeneration:function(){return Fc},getHeight:function(){return Rc},getKeyBlock:function(){return Lc},getMicroBlockHeader:function(){return Gc},getMicroBlockTransactions:function(){return qc},getName:function(){return Vc},poll:function(){return Mc},resolveName:function(){return Jc},sendTransaction:function(){return zc},txDryRun:function(){return Yc},waitForTxConfirm:function(){return Oc}});var i={};r.r(i),r.d(i,{payForTransaction:function(){return PA},send:function(){return OA},spend:function(){return zA},transferFunds:function(){return kA}});var o={};r.r(o),r.d(o,{aensBid:function(){return jA},aensClaim:function(){return GA},aensPreclaim:function(){return HA},aensQuery:function(){return LA},aensRevoke:function(){return UA},aensTransfer:function(){return qA},aensUpdate:function(){return FA}});var a={};r.r(a),r.d(a,{extendOracleTtl:function(){return eu},getOracleObject:function(){return ru},getQueryObject:function(){return XA},pollForQueries:function(){return JA},pollForQueryResponse:function(){return WA},postQueryToOracle:function(){return ZA},registerOracle:function(){return nu},respondToQuery:function(){return tu}});var s={};r.r(s),r.d(s,{buildAuthTxHash:function(){return au},createGeneralizedAccount:function(){return ou}});var c={};r.r(c),r.d(c,{Aci:function(){return ml},ApiVersion:function(){return Dl},ByteCode:function(){return Cl},ByteCodeInput:function(){return Tl},BytecodeCallResultInput:function(){return Bl},Calldata:function(){return vl},CompileOpts:function(){return gl},CompilerError:function(){return yl},CompilerVersion:function(){return Ml},Contract:function(){return fl},DecodeCalldataBytecode:function(){return Nl},DecodeCalldataSource:function(){return xl},DecodedCalldata:function(){return bl},DecodedCallresult:function(){return wl},ErrorModel:function(){return Sl},ErrorPos:function(){return Il},FateAssembler:function(){return _l},FunctionCallInput:function(){return Ql},SophiaBinaryData:function(){return Ol},SophiaCallResultInput:function(){return El},SophiaJsonData:function(){return zl},ValidateByteCodeInput:function(){return Rl}});var A=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,u=Math.ceil,l=Math.floor,d="[BigNumber Error] ",p=d+"Number primitive has more than 15 significant digits: ",h=1e14,f=14,g=9007199254740991,m=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],y=1e7,I=1e9;function C(e){var t=0|e;return e>0||e===t?t:t-1}function E(e){for(var t,r,n=1,i=e.length,o=e[0]+"";n<i;){for(t=e[n++]+"",r=f-t.length;r--;t="0"+t);o+=t}for(i=o.length;48===o.charCodeAt(--i););return o.slice(0,i+1||1)}function B(e,t){var r,n,i=e.c,o=t.c,a=e.s,s=t.s,c=e.e,A=t.e;if(!a||!s)return null;if(r=i&&!i[0],n=o&&!o[0],r||n)return r?n?0:-s:a;if(a!=s)return a;if(r=a<0,n=c==A,!i||!o)return n?0:!i^r?1:-1;if(!n)return c>A^r?1:-1;for(s=(c=i.length)<(A=o.length)?c:A,a=0;a<s;a++)if(i[a]!=o[a])return i[a]>o[a]^r?1:-1;return c==A?0:c>A^r?1:-1}function w(e,t,r,n){if(e<t||e>r||e!==l(e))throw Error(d+(n||"Argument")+("number"==typeof e?e<t||e>r?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function Q(e){var t=e.c.length-1;return C(e.e/f)==t&&e.c[t]%2!=0}function v(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function N(e,t,r){var n,i;if(t<0){for(i=r+".";++t;i+=r);e=i+e}else if(++t>(n=e.length)){for(i=r,t-=n;--t;i+=r);e+=i}else t<n&&(e=e.slice(0,t)+"."+e.slice(t));return e}var b=function e(t){var r,n,i,o,a,s,c,b,S,x,T=H.prototype={constructor:H,toString:null,valueOf:null},_=new H(1),R=20,M=4,D=-7,O=21,z=-1e7,k=1e7,P=!1,U=1,F=0,q={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},L="0123456789abcdefghijklmnopqrstuvwxyz",G=!0;function H(e,t){var r,o,a,s,c,u,d,h,m=this;if(!(m instanceof H))return new H(e,t);if(null==t){if(e&&!0===e._isBigNumber)return m.s=e.s,void(!e.c||e.e>k?m.c=m.e=null:e.e<z?m.c=[m.e=0]:(m.e=e.e,m.c=e.c.slice()));if((u="number"==typeof e)&&0*e==0){if(m.s=1/e<0?(e=-e,-1):1,e===~~e){for(s=0,c=e;c>=10;c/=10,s++);return void(s>k?m.c=m.e=null:(m.e=s,m.c=[e]))}h=String(e)}else{if(!A.test(h=String(e)))return i(m,h,u);m.s=45==h.charCodeAt(0)?(h=h.slice(1),-1):1}(s=h.indexOf("."))>-1&&(h=h.replace(".","")),(c=h.search(/e/i))>0?(s<0&&(s=c),s+=+h.slice(c+1),h=h.substring(0,c)):s<0&&(s=h.length)}else{if(w(t,2,L.length,"Base"),10==t&&G)return K(m=new H(e),R+m.e+1,M);if(h=String(e),u="number"==typeof e){if(0*e!=0)return i(m,h,u,t);if(m.s=1/e<0?(h=h.slice(1),-1):1,H.DEBUG&&h.replace(/^0\.0*|\./,"").length>15)throw Error(p+e)}else m.s=45===h.charCodeAt(0)?(h=h.slice(1),-1):1;for(r=L.slice(0,t),s=c=0,d=h.length;c<d;c++)if(r.indexOf(o=h.charAt(c))<0){if("."==o){if(c>s){s=d;continue}}else if(!a&&(h==h.toUpperCase()&&(h=h.toLowerCase())||h==h.toLowerCase()&&(h=h.toUpperCase()))){a=!0,c=-1,s=0;continue}return i(m,String(e),u,t)}u=!1,(s=(h=n(h,t,10,m.s)).indexOf("."))>-1?h=h.replace(".",""):s=h.length}for(c=0;48===h.charCodeAt(c);c++);for(d=h.length;48===h.charCodeAt(--d););if(h=h.slice(c,++d)){if(d-=c,u&&H.DEBUG&&d>15&&(e>g||e!==l(e)))throw Error(p+m.s*e);if((s=s-c-1)>k)m.c=m.e=null;else if(s<z)m.c=[m.e=0];else{if(m.e=s,m.c=[],c=(s+1)%f,s<0&&(c+=f),c<d){for(c&&m.c.push(+h.slice(0,c)),d-=f;c<d;)m.c.push(+h.slice(c,c+=f));c=f-(h=h.slice(c)).length}else c-=d;for(;c--;h+="0");m.c.push(+h)}}else m.c=[m.e=0]}function j(e,t,r,n){var i,o,a,s,c;if(null==r?r=M:w(r,0,8),!e.c)return e.toString();if(i=e.c[0],a=e.e,null==t)c=E(e.c),c=1==n||2==n&&(a<=D||a>=O)?v(c,a):N(c,a,"0");else if(o=(e=K(new H(e),t,r)).e,s=(c=E(e.c)).length,1==n||2==n&&(t<=o||o<=D)){for(;s<t;c+="0",s++);c=v(c,o)}else if(t-=a,c=N(c,o,"0"),o+1>s){if(--t>0)for(c+=".";t--;c+="0");}else if((t+=o-s)>0)for(o+1==s&&(c+=".");t--;c+="0");return e.s<0&&i?"-"+c:c}function Y(e,t){for(var r,n=1,i=new H(e[0]);n<e.length;n++){if(!(r=new H(e[n])).s){i=r;break}t.call(i,r)&&(i=r)}return i}function $(e,t,r){for(var n=1,i=t.length;!t[--i];t.pop());for(i=t[0];i>=10;i/=10,n++);return(r=n+r*f-1)>k?e.c=e.e=null:r<z?e.c=[e.e=0]:(e.e=r,e.c=t),e}function K(e,t,r,n){var i,o,a,s,c,A,d,p=e.c,g=m;if(p){e:{for(i=1,s=p[0];s>=10;s/=10,i++);if((o=t-i)<0)o+=f,a=t,d=(c=p[A=0])/g[i-a-1]%10|0;else if((A=u((o+1)/f))>=p.length){if(!n)break e;for(;p.length<=A;p.push(0));c=d=0,i=1,a=(o%=f)-f+1}else{for(c=s=p[A],i=1;s>=10;s/=10,i++);d=(a=(o%=f)-f+i)<0?0:c/g[i-a-1]%10|0}if(n=n||t<0||null!=p[A+1]||(a<0?c:c%g[i-a-1]),n=r<4?(d||n)&&(0==r||r==(e.s<0?3:2)):d>5||5==d&&(4==r||n||6==r&&(o>0?a>0?c/g[i-a]:0:p[A-1])%10&1||r==(e.s<0?8:7)),t<1||!p[0])return p.length=0,n?(t-=e.e+1,p[0]=g[(f-t%f)%f],e.e=-t||0):p[0]=e.e=0,e;if(0==o?(p.length=A,s=1,A--):(p.length=A+1,s=g[f-o],p[A]=a>0?l(c/g[i-a]%g[a])*s:0),n)for(;;){if(0==A){for(o=1,a=p[0];a>=10;a/=10,o++);for(a=p[0]+=s,s=1;a>=10;a/=10,s++);o!=s&&(e.e++,p[0]==h&&(p[0]=1));break}if(p[A]+=s,p[A]!=h)break;p[A--]=0,s=1}for(o=p.length;0===p[--o];p.pop());}e.e>k?e.c=e.e=null:e.e<z&&(e.c=[e.e=0])}return e}function V(e){var t,r=e.e;return null===r?e.toString():(t=E(e.c),t=r<=D||r>=O?v(t,r):N(t,r,"0"),e.s<0?"-"+t:t)}return H.clone=e,H.ROUND_UP=0,H.ROUND_DOWN=1,H.ROUND_CEIL=2,H.ROUND_FLOOR=3,H.ROUND_HALF_UP=4,H.ROUND_HALF_DOWN=5,H.ROUND_HALF_EVEN=6,H.ROUND_HALF_CEIL=7,H.ROUND_HALF_FLOOR=8,H.EUCLID=9,H.config=H.set=function(e){var t,r;if(null!=e){if("object"!=typeof e)throw Error(d+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(w(r=e[t],0,I,t),R=r),e.hasOwnProperty(t="ROUNDING_MODE")&&(w(r=e[t],0,8,t),M=r),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((r=e[t])&&r.pop?(w(r[0],-I,0,t),w(r[1],0,I,t),D=r[0],O=r[1]):(w(r,-I,I,t),D=-(O=r<0?-r:r))),e.hasOwnProperty(t="RANGE"))if((r=e[t])&&r.pop)w(r[0],-I,-1,t),w(r[1],1,I,t),z=r[0],k=r[1];else{if(w(r,-I,I,t),!r)throw Error(d+t+" cannot be zero: "+r);z=-(k=r<0?-r:r)}if(e.hasOwnProperty(t="CRYPTO")){if((r=e[t])!==!!r)throw Error(d+t+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw P=!r,Error(d+"crypto unavailable");P=r}else P=r}if(e.hasOwnProperty(t="MODULO_MODE")&&(w(r=e[t],0,9,t),U=r),e.hasOwnProperty(t="POW_PRECISION")&&(w(r=e[t],0,I,t),F=r),e.hasOwnProperty(t="FORMAT")){if("object"!=typeof(r=e[t]))throw Error(d+t+" not an object: "+r);q=r}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(r=e[t])||/^.?$|[+\-.\s]|(.).*\1/.test(r))throw Error(d+t+" invalid: "+r);G="0123456789"==r.slice(0,10),L=r}}return{DECIMAL_PLACES:R,ROUNDING_MODE:M,EXPONENTIAL_AT:[D,O],RANGE:[z,k],CRYPTO:P,MODULO_MODE:U,POW_PRECISION:F,FORMAT:q,ALPHABET:L}},H.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!H.DEBUG)return!0;var t,r,n=e.c,i=e.e,o=e.s;e:if("[object Array]"=={}.toString.call(n)){if((1===o||-1===o)&&i>=-I&&i<=I&&i===l(i)){if(0===n[0]){if(0===i&&1===n.length)return!0;break e}if((t=(i+1)%f)<1&&(t+=f),String(n[0]).length==t){for(t=0;t<n.length;t++)if((r=n[t])<0||r>=h||r!==l(r))break e;if(0!==r)return!0}}}else if(null===n&&null===i&&(null===o||1===o||-1===o))return!0;throw Error(d+"Invalid BigNumber: "+e)},H.maximum=H.max=function(){return Y(arguments,T.lt)},H.minimum=H.min=function(){return Y(arguments,T.gt)},H.random=(o=9007199254740992,a=Math.random()*o&2097151?function(){return l(Math.random()*o)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,r,n,i,o,s=0,c=[],A=new H(_);if(null==e?e=R:w(e,0,I),i=u(e/f),P)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(i*=2));s<i;)(o=131072*t[s]+(t[s+1]>>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),t[s]=r[0],t[s+1]=r[1]):(c.push(o%1e14),s+=2);s=i/2}else{if(!crypto.randomBytes)throw P=!1,Error(d+"crypto unavailable");for(t=crypto.randomBytes(i*=7);s<i;)(o=281474976710656*(31&t[s])+1099511627776*t[s+1]+4294967296*t[s+2]+16777216*t[s+3]+(t[s+4]<<16)+(t[s+5]<<8)+t[s+6])>=9e15?crypto.randomBytes(7).copy(t,s):(c.push(o%1e14),s+=7);s=i/7}if(!P)for(;s<i;)(o=a())<9e15&&(c[s++]=o%1e14);for(i=c[--s],e%=f,i&&e&&(o=m[f-e],c[s]=l(i/o)*o);0===c[s];c.pop(),s--);if(s<0)c=[n=0];else{for(n=-1;0===c[0];c.splice(0,1),n-=f);for(s=1,o=c[0];o>=10;o/=10,s++);s<f&&(n-=f-s)}return A.e=n,A.c=c,A}),H.sum=function(){for(var e=1,t=arguments,r=new H(t[0]);e<t.length;)r=r.plus(t[e++]);return r},n=function(){var e="0123456789";function t(e,t,r,n){for(var i,o,a=[0],s=0,c=e.length;s<c;){for(o=a.length;o--;a[o]*=t);for(a[0]+=n.indexOf(e.charAt(s++)),i=0;i<a.length;i++)a[i]>r-1&&(null==a[i+1]&&(a[i+1]=0),a[i+1]+=a[i]/r|0,a[i]%=r)}return a.reverse()}return function(n,i,o,a,s){var c,A,u,l,d,p,h,f,g=n.indexOf("."),m=R,y=M;for(g>=0&&(l=F,F=0,n=n.replace(".",""),p=(f=new H(i)).pow(n.length-g),F=l,f.c=t(N(E(p.c),p.e,"0"),10,o,e),f.e=f.c.length),u=l=(h=t(n,i,o,s?(c=L,e):(c=e,L))).length;0==h[--l];h.pop());if(!h[0])return c.charAt(0);if(g<0?--u:(p.c=h,p.e=u,p.s=a,h=(p=r(p,f,m,y,o)).c,d=p.r,u=p.e),g=h[A=u+m+1],l=o/2,d=d||A<0||null!=h[A+1],d=y<4?(null!=g||d)&&(0==y||y==(p.s<0?3:2)):g>l||g==l&&(4==y||d||6==y&&1&h[A-1]||y==(p.s<0?8:7)),A<1||!h[0])n=d?N(c.charAt(1),-m,c.charAt(0)):c.charAt(0);else{if(h.length=A,d)for(--o;++h[--A]>o;)h[A]=0,A||(++u,h=[1].concat(h));for(l=h.length;!h[--l];);for(g=0,n="";g<=l;n+=c.charAt(h[g++]));n=N(n,u,c.charAt(0))}return n}}(),r=function(){function e(e,t,r){var n,i,o,a,s=0,c=e.length,A=t%y,u=t/y|0;for(e=e.slice();c--;)s=((i=A*(o=e[c]%y)+(n=u*o+(a=e[c]/y|0)*A)%y*y+s)/r|0)+(n/y|0)+u*a,e[c]=i%r;return s&&(e=[s].concat(e)),e}function t(e,t,r,n){var i,o;if(r!=n)o=r>n?1:-1;else for(i=o=0;i<r;i++)if(e[i]!=t[i]){o=e[i]>t[i]?1:-1;break}return o}function r(e,t,r,n){for(var i=0;r--;)e[r]-=i,i=e[r]<t[r]?1:0,e[r]=i*n+e[r]-t[r];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(n,i,o,a,s){var c,A,u,d,p,g,m,y,I,E,B,w,Q,v,N,b,S,x=n.s==i.s?1:-1,T=n.c,_=i.c;if(!(T&&T[0]&&_&&_[0]))return new H(n.s&&i.s&&(T?!_||T[0]!=_[0]:_)?T&&0==T[0]||!_?0*x:x/0:NaN);for(I=(y=new H(x)).c=[],x=o+(A=n.e-i.e)+1,s||(s=h,A=C(n.e/f)-C(i.e/f),x=x/f|0),u=0;_[u]==(T[u]||0);u++);if(_[u]>(T[u]||0)&&A--,x<0)I.push(1),d=!0;else{for(v=T.length,b=_.length,u=0,x+=2,(p=l(s/(_[0]+1)))>1&&(_=e(_,p,s),T=e(T,p,s),b=_.length,v=T.length),Q=b,B=(E=T.slice(0,b)).length;B<b;E[B++]=0);S=_.slice(),S=[0].concat(S),N=_[0],_[1]>=s/2&&N++;do{if(p=0,(c=t(_,E,b,B))<0){if(w=E[0],b!=B&&(w=w*s+(E[1]||0)),(p=l(w/N))>1)for(p>=s&&(p=s-1),m=(g=e(_,p,s)).length,B=E.length;1==t(g,E,m,B);)p--,r(g,b<m?S:_,m,s),m=g.length,c=1;else 0==p&&(c=p=1),m=(g=_.slice()).length;if(m<B&&(g=[0].concat(g)),r(E,g,B,s),B=E.length,-1==c)for(;t(_,E,b,B)<1;)p++,r(E,b<B?S:_,B,s),B=E.length}else 0===c&&(p++,E=[0]);I[u++]=p,E[0]?E[B++]=T[Q]||0:(E=[T[Q]],B=1)}while((Q++<v||null!=E[0])&&x--);d=null!=E[0],I[0]||I.splice(0,1)}if(s==h){for(u=1,x=I[0];x>=10;x/=10,u++);K(y,o+(y.e=u+A*f-1)+1,a,d)}else y.e=A,y.r=+d;return y}}(),s=/^(-?)0([xbo])(?=\w[\w.]*$)/i,c=/^([^.]+)\.$/,b=/^\.([^.]+)$/,S=/^-?(Infinity|NaN)$/,x=/^\s*\+(?=[\w.])|^\s+|\s+$/g,i=function(e,t,r,n){var i,o=r?t:t.replace(x,"");if(S.test(o))e.s=isNaN(o)?null:o<0?-1:1;else{if(!r&&(o=o.replace(s,(function(e,t,r){return i="x"==(r=r.toLowerCase())?16:"b"==r?2:8,n&&n!=i?e:t})),n&&(i=n,o=o.replace(c,"$1").replace(b,"0.$1")),t!=o))return new H(o,i);if(H.DEBUG)throw Error(d+"Not a"+(n?" base "+n:"")+" number: "+t);e.s=null}e.c=e.e=null},T.absoluteValue=T.abs=function(){var e=new H(this);return e.s<0&&(e.s=1),e},T.comparedTo=function(e,t){return B(this,new H(e,t))},T.decimalPlaces=T.dp=function(e,t){var r,n,i,o=this;if(null!=e)return w(e,0,I),null==t?t=M:w(t,0,8),K(new H(o),e+o.e+1,t);if(!(r=o.c))return null;if(n=((i=r.length-1)-C(this.e/f))*f,i=r[i])for(;i%10==0;i/=10,n--);return n<0&&(n=0),n},T.dividedBy=T.div=function(e,t){return r(this,new H(e,t),R,M)},T.dividedToIntegerBy=T.idiv=function(e,t){return r(this,new H(e,t),0,1)},T.exponentiatedBy=T.pow=function(e,t){var r,n,i,o,a,s,c,A,p=this;if((e=new H(e)).c&&!e.isInteger())throw Error(d+"Exponent not an integer: "+V(e));if(null!=t&&(t=new H(t)),a=e.e>14,!p.c||!p.c[0]||1==p.c[0]&&!p.e&&1==p.c.length||!e.c||!e.c[0])return A=new H(Math.pow(+V(p),a?2-Q(e):+V(e))),t?A.mod(t):A;if(s=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new H(NaN);(n=!s&&p.isInteger()&&t.isInteger())&&(p=p.mod(t))}else{if(e.e>9&&(p.e>0||p.e<-1||(0==p.e?p.c[0]>1||a&&p.c[1]>=24e7:p.c[0]<8e13||a&&p.c[0]<=9999975e7)))return o=p.s<0&&Q(e)?-0:0,p.e>-1&&(o=1/o),new H(s?1/o:o);F&&(o=u(F/f+2))}for(a?(r=new H(.5),s&&(e.s=1),c=Q(e)):c=(i=Math.abs(+V(e)))%2,A=new H(_);;){if(c){if(!(A=A.times(p)).c)break;o?A.c.length>o&&(A.c.length=o):n&&(A=A.mod(t))}if(i){if(0===(i=l(i/2)))break;c=i%2}else if(K(e=e.times(r),e.e+1,1),e.e>14)c=Q(e);else{if(0==(i=+V(e)))break;c=i%2}p=p.times(p),o?p.c&&p.c.length>o&&(p.c.length=o):n&&(p=p.mod(t))}return n?A:(s&&(A=_.div(A)),t?A.mod(t):o?K(A,F,M,void 0):A)},T.integerValue=function(e){var t=new H(this);return null==e?e=M:w(e,0,8),K(t,t.e+1,e)},T.isEqualTo=T.eq=function(e,t){return 0===B(this,new H(e,t))},T.isFinite=function(){return!!this.c},T.isGreaterThan=T.gt=function(e,t){return B(this,new H(e,t))>0},T.isGreaterThanOrEqualTo=T.gte=function(e,t){return 1===(t=B(this,new H(e,t)))||0===t},T.isInteger=function(){return!!this.c&&C(this.e/f)>this.c.length-2},T.isLessThan=T.lt=function(e,t){return B(this,new H(e,t))<0},T.isLessThanOrEqualTo=T.lte=function(e,t){return-1===(t=B(this,new H(e,t)))||0===t},T.isNaN=function(){return!this.s},T.isNegative=function(){return this.s<0},T.isPositive=function(){return this.s>0},T.isZero=function(){return!!this.c&&0==this.c[0]},T.minus=function(e,t){var r,n,i,o,a=this,s=a.s;if(t=(e=new H(e,t)).s,!s||!t)return new H(NaN);if(s!=t)return e.s=-t,a.plus(e);var c=a.e/f,A=e.e/f,u=a.c,l=e.c;if(!c||!A){if(!u||!l)return u?(e.s=-t,e):new H(l?a:NaN);if(!u[0]||!l[0])return l[0]?(e.s=-t,e):new H(u[0]?a:3==M?-0:0)}if(c=C(c),A=C(A),u=u.slice(),s=c-A){for((o=s<0)?(s=-s,i=u):(A=c,i=l),i.reverse(),t=s;t--;i.push(0));i.reverse()}else for(n=(o=(s=u.length)<(t=l.length))?s:t,s=t=0;t<n;t++)if(u[t]!=l[t]){o=u[t]<l[t];break}if(o&&(i=u,u=l,l=i,e.s=-e.s),(t=(n=l.length)-(r=u.length))>0)for(;t--;u[r++]=0);for(t=h-1;n>s;){if(u[--n]<l[n]){for(r=n;r&&!u[--r];u[r]=t);--u[r],u[n]+=h}u[n]-=l[n]}for(;0==u[0];u.splice(0,1),--A);return u[0]?$(e,u,A):(e.s=3==M?-1:1,e.c=[e.e=0],e)},T.modulo=T.mod=function(e,t){var n,i,o=this;return e=new H(e,t),!o.c||!e.s||e.c&&!e.c[0]?new H(NaN):!e.c||o.c&&!o.c[0]?new H(o):(9==U?(i=e.s,e.s=1,n=r(o,e,0,3),e.s=i,n.s*=i):n=r(o,e,0,U),(e=o.minus(n.times(e))).c[0]||1!=U||(e.s=o.s),e)},T.multipliedBy=T.times=function(e,t){var r,n,i,o,a,s,c,A,u,l,d,p,g,m,I,E=this,B=E.c,w=(e=new H(e,t)).c;if(!(B&&w&&B[0]&&w[0]))return!E.s||!e.s||B&&!B[0]&&!w||w&&!w[0]&&!B?e.c=e.e=e.s=null:(e.s*=E.s,B&&w?(e.c=[0],e.e=0):e.c=e.e=null),e;for(n=C(E.e/f)+C(e.e/f),e.s*=E.s,(c=B.length)<(l=w.length)&&(g=B,B=w,w=g,i=c,c=l,l=i),i=c+l,g=[];i--;g.push(0));for(m=h,I=y,i=l;--i>=0;){for(r=0,d=w[i]%I,p=w[i]/I|0,o=i+(a=c);o>i;)r=((A=d*(A=B[--a]%I)+(s=p*A+(u=B[a]/I|0)*d)%I*I+g[o]+r)/m|0)+(s/I|0)+p*u,g[o--]=A%m;g[o]=r}return r?++n:g.splice(0,1),$(e,g,n)},T.negated=function(){var e=new H(this);return e.s=-e.s||null,e},T.plus=function(e,t){var r,n=this,i=n.s;if(t=(e=new H(e,t)).s,!i||!t)return new H(NaN);if(i!=t)return e.s=-t,n.minus(e);var o=n.e/f,a=e.e/f,s=n.c,c=e.c;if(!o||!a){if(!s||!c)return new H(i/0);if(!s[0]||!c[0])return c[0]?e:new H(s[0]?n:0*i)}if(o=C(o),a=C(a),s=s.slice(),i=o-a){for(i>0?(a=o,r=c):(i=-i,r=s),r.reverse();i--;r.push(0));r.reverse()}for((i=s.length)-(t=c.length)<0&&(r=c,c=s,s=r,t=i),i=0;t;)i=(s[--t]=s[t]+c[t]+i)/h|0,s[t]=h===s[t]?0:s[t]%h;return i&&(s=[i].concat(s),++a),$(e,s,a)},T.precision=T.sd=function(e,t){var r,n,i,o=this;if(null!=e&&e!==!!e)return w(e,1,I),null==t?t=M:w(t,0,8),K(new H(o),e,t);if(!(r=o.c))return null;if(n=(i=r.length-1)*f+1,i=r[i]){for(;i%10==0;i/=10,n--);for(i=r[0];i>=10;i/=10,n++);}return e&&o.e+1>n&&(n=o.e+1),n},T.shiftedBy=function(e){return w(e,-9007199254740991,g),this.times("1e"+e)},T.squareRoot=T.sqrt=function(){var e,t,n,i,o,a=this,s=a.c,c=a.s,A=a.e,u=R+4,l=new H("0.5");if(1!==c||!s||!s[0])return new H(!c||c<0&&(!s||s[0])?NaN:s?a:1/0);if(0==(c=Math.sqrt(+V(a)))||c==1/0?(((t=E(s)).length+A)%2==0&&(t+="0"),c=Math.sqrt(+t),A=C((A+1)/2)-(A<0||A%2),n=new H(t=c==1/0?"5e"+A:(t=c.toExponential()).slice(0,t.indexOf("e")+1)+A)):n=new H(c+""),n.c[0])for((c=(A=n.e)+u)<3&&(c=0);;)if(o=n,n=l.times(o.plus(r(a,o,u,1))),E(o.c).slice(0,c)===(t=E(n.c)).slice(0,c)){if(n.e<A&&--c,"9999"!=(t=t.slice(c-3,c+1))&&(i||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(K(n,n.e+R+2,1),e=!n.times(n).eq(a));break}if(!i&&(K(o,o.e+R+2,0),o.times(o).eq(a))){n=o;break}u+=4,c+=4,i=1}return K(n,n.e+R+1,M,e)},T.toExponential=function(e,t){return null!=e&&(w(e,0,I),e++),j(this,e,t,1)},T.toFixed=function(e,t){return null!=e&&(w(e,0,I),e=e+this.e+1),j(this,e,t)},T.toFormat=function(e,t,r){var n,i=this;if(null==r)null!=e&&t&&"object"==typeof t?(r=t,t=null):e&&"object"==typeof e?(r=e,e=t=null):r=q;else if("object"!=typeof r)throw Error(d+"Argument not an object: "+r);if(n=i.toFixed(e,t),i.c){var o,a=n.split("."),s=+r.groupSize,c=+r.secondaryGroupSize,A=r.groupSeparator||"",u=a[0],l=a[1],p=i.s<0,h=p?u.slice(1):u,f=h.length;if(c&&(o=s,s=c,c=o,f-=o),s>0&&f>0){for(o=f%s||s,u=h.substr(0,o);o<f;o+=s)u+=A+h.substr(o,s);c>0&&(u+=A+h.slice(o)),p&&(u="-"+u)}n=l?u+(r.decimalSeparator||"")+((c=+r.fractionGroupSize)?l.replace(new RegExp("\\d{"+c+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):l):u}return(r.prefix||"")+n+(r.suffix||"")},T.toFraction=function(e){var t,n,i,o,a,s,c,A,u,l,p,h,g=this,y=g.c;if(null!=e&&(!(c=new H(e)).isInteger()&&(c.c||1!==c.s)||c.lt(_)))throw Error(d+"Argument "+(c.isInteger()?"out of range: ":"not an integer: ")+V(c));if(!y)return new H(g);for(t=new H(_),u=n=new H(_),i=A=new H(_),h=E(y),a=t.e=h.length-g.e-1,t.c[0]=m[(s=a%f)<0?f+s:s],e=!e||c.comparedTo(t)>0?a>0?t:u:c,s=k,k=1/0,c=new H(h),A.c[0]=0;l=r(c,t,0,1),1!=(o=n.plus(l.times(i))).comparedTo(e);)n=i,i=o,u=A.plus(l.times(o=u)),A=o,t=c.minus(l.times(o=t)),c=o;return o=r(e.minus(n),i,0,1),A=A.plus(o.times(u)),n=n.plus(o.times(i)),A.s=u.s=g.s,p=r(u,i,a*=2,M).minus(g).abs().comparedTo(r(A,n,a,M).minus(g).abs())<1?[u,i]:[A,n],k=s,p},T.toNumber=function(){return+V(this)},T.toPrecision=function(e,t){return null!=e&&w(e,1,I),j(this,e,t,2)},T.toString=function(e){var t,r=this,i=r.s,o=r.e;return null===o?i?(t="Infinity",i<0&&(t="-"+t)):t="NaN":(null==e?t=o<=D||o>=O?v(E(r.c),o):N(E(r.c),o,"0"):10===e&&G?t=N(E((r=K(new H(r),R+o+1,M)).c),r.e,"0"):(w(e,2,L.length,"Base"),t=n(N(E(r.c),o,"0"),10,e,i,!0)),i<0&&r.c[0]&&(t="-"+t)),t},T.valueOf=T.toJSON=function(){return V(this)},T._isBigNumber=!0,T[Symbol.toStringTag]="BigNumber",T[Symbol.for("nodejs.util.inspect.custom")]=T.valueOf,null!=t&&H.set(t),H}(),S=b;const x=e=>e.integerValue(S.ROUND_CEIL);class T extends Error{constructor(e){super(e),this.name="BaseError"}}class _ extends T{constructor(e){super(e),this.name="AccountError"}}class R extends T{constructor(e){super(e),this.name="AensError"}}class M extends T{constructor(e){super(e),this.name="AeppError"}}class D extends T{constructor(e){super(e),this.name="ChannelError"}}class O extends T{constructor(e){super(e),this.name="CompilerError"}}class z extends T{constructor(e){super(e),this.name="ContractError"}}class k extends T{constructor(e){super(e),this.name="CryptographyError"}}class P extends T{constructor(e){super(e),this.name="NodeError"}}class U extends T{constructor(e){super(e),this.name="TransactionError"}}class F extends T{constructor(e){super(e),this.name="WalletError"}}class q extends T{constructor(e,t,r){super(`${e} should be ${t}, got ${String(r)} instead`),this.name="ArgumentError"}}class L extends k{constructor(e){super(e),this.name="IllegalArgumentError"}}class G extends T{constructor(e,t,r){super(`${e} expects ${t} arguments, got ${r} instead`),this.name="ArgumentCountMismatchError"}}class H extends T{constructor(e){super(e),this.name="InsufficientBalanceError"}}class j extends T{constructor(e){super(e),this.name="MissingParamError"}}class Y extends T{constructor(){super("Byte serialization not supported"),this.name="NoSerializerFoundError"}}class $ extends T{constructor(e){super(`Giving up at height ${e}`),this.name="RequestTimedOutError"}}class K extends T{constructor(e,t){super([`Giving up after ${e} blocks mined`,`transaction hash: ${t}`].join(", ")),this.name="TxTimedOutError"}}class V extends T{constructor(e){super(e),this.name="TypeError"}}class J extends T{constructor(e){super(e),this.name="UnsupportedPlatformError"}}class W extends T{constructor(e){super(e),this.name="UnsupportedProtocolError"}}class X extends T{constructor(e){super(e),this.name="NotImplementedError"}}class Z extends T{constructor(e,t,r,n){super(`Unsupported ${e} version ${t}. Supported: >= ${r} < ${n}`),this.name="UnsupportedVersionError"}}class ee extends T{constructor(e){super(e),this.name="InternalError"}}class te extends ee{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Expected to not happen, required for TS"),this.name="UnexpectedTsError"}}class re extends _{constructor(e){super(`Account for ${e} not available`),this.name="UnavailableAccountError"}}class ne extends R{constructor(e,t){super(`Name ${e} don't have pointers for ${t}`),this.name="AensPointerContextError"}}class ie extends R{constructor(e,t){super(`the provided fee ${e.toString()} is not enough to execute the claim, required: ${t.toString()}`),this.name="InsufficientNameFeeError"}}class oe extends R{constructor(e){super(e),this.name="InvalidAensNameError"}}class ae extends M{constructor(e){super(`Received invalid message: ${e}`),this.name="InvalidRpcMessageError"}}class se extends M{constructor(e){super(`Can't find callback for this messageId ${e}`),this.name="MissingCallbackError"}}class ce extends M{constructor(e){super(`You do not have access to account ${e}`),this.name="UnAuthorizedAccountError"}}class Ae extends M{constructor(e){super(`RpcClient with id ${e} do not exist`),this.name="UnknownRpcClientError"}}class ue extends M{constructor(){super("You are not subscribed for an account."),this.name="UnsubscribedAccountError"}}class le extends D{constructor(e){super(e),this.name="ChannelCallError"}}class de extends D{constructor(e){super(e),this.name="ChannelConnectionError"}}class pe extends D{constructor(){super("Server pong timed out"),this.name="ChannelPingTimedOutError"}}class he extends D{constructor(e){super(e),this.name="UnexpectedChannelMessageError"}}class fe extends D{constructor(e,t){super(e.message),this.handlerError=e,this.incomingMessage=t,this.name="ChannelIncomingMessageError"}}class ge extends D{constructor(){super("State Channels FSM entered unknown state"),this.name="UnknownChannelStateError"}}class me extends O{constructor(e){super(e),this.name="InvalidAuthDataError"}}class ye extends z{constructor(e){super(`Contract ${e} do not correspond to the bytecode deployed on the chain`),this.name="BytecodeMismatchError"}}class Ie extends z{constructor(){super("Contract already deployed"),this.name="DuplicateContractError"}}class Ce extends z{constructor(e){super(`Contract with address ${e} not active`),this.name="InactiveContractError"}}class Ee extends z{constructor(e){super(e),this.name="InvalidMethodInvocationError"}}class Be extends z{constructor(e){super(e),this.name="MissingContractAddressError"}}class we extends z{constructor(){super("Either ACI or source code is required"),this.name="MissingContractDefError"}}class Qe extends z{constructor(){super("Function name is required"),this.name="MissingFunctionNameError"}}class ve extends z{constructor(e,t){super("Invocation failed"+(null==e?"":`: "${e}"`)),this.name="NodeInvocationError",this.transaction=t}}class Ne extends z{constructor(e){super(`Function ${e} doesn't exist in contract`),this.name="NoSuchContractFunctionError"}}class be extends z{constructor(e,t){super(`You try to pay "${e}" to function "${t}" which is not payable. Only payable function can accept coins`),this.name="NotPayableFunctionError"}}class Se extends z{constructor(e,t){super(`Can't find definition of ${e} event emitted by ${t} (use omitUnknown option to ignore events like this)`),this.name="MissingEventDefinitionError"}}class xe extends z{constructor(e,t){super(`Found multiple definitions of "${t[0][1]}" event with different types emitted by ${e} in ${t.map((e=>{let[t]=e;return`"${t}"`})).join(", ")} contracts (use contractAddressToName option to specify contract name corresponding to address)`),this.name="AmbiguousEventDefinitionError"}}class Te extends k{constructor(){super("Invalid checksum"),this.name="InvalidChecksumError"}}class _e extends k{constructor(){super("Invalid password or nonce"),this.name="InvalidPasswordError"}}class Re extends k{constructor(){super("Node hash is not equal to provided one"),this.name="MerkleTreeHashMismatchError"}}class Me extends k{constructor(e){super(e),this.name="MissingNodeInTreeError"}}class De extends k{constructor(e){super(`Unknown node length: ${e}`),this.name="UnknownNodeLengthError"}}class Oe extends k{constructor(e){super(`Unknown path nibble: ${e}`),this.name="UnknownPathNibbleError"}}class ze extends P{constructor(e){super(`Node with name ${e} already exist`),this.name="DuplicateNodeError"}}class ke extends P{constructor(e){super(e),this.name="NodeNotFoundError"}}class Pe extends U{constructor(e){super(e),this.name="DecodeError"}}class Ue extends U{constructor(e){super(e),this.name="PayloadLengthError"}}class Fe extends U{constructor(e){super(e),this.name="DryRunError"}}class qe extends U{constructor(e){super(e),this.name="IllegalBidFeeError"}}class Le extends U{constructor(e){super(e),this.name="InvalidSignatureError"}}class Ge extends U{constructor(e){super(e),this.name="InvalidTxParamsError"}}class He extends U{constructor(e){super(`Prefix for id-tag ${e} not found.`),this.name="PrefixNotFoundError"}}class je extends U{constructor(e,t,r){super(`Transaction ${e} not implemented for ${t} version ${r}`),this.name="SchemaNotFoundError"}}class Ye extends U{constructor(e){super(`Id tag for prefix ${e} not found.`),this.name="DecodeError"}}class $e extends U{constructor(e){super(`Transaction ${e} is removed from chain`),this.name="TxNotInChainError"}}class Ke extends U{constructor(e){super(e),this.name="UnknownTxError"}}class Ve extends U{constructor(e){super(e),this.name="UnsupportedABIversionError"}}class Je extends U{constructor(e){super(e),this.name="UnsupportedVMversionError"}}class We extends F{constructor(e){super(e),this.name="AlreadyConnectedError"}}class Xe extends F{constructor(e){super(e),this.name="NoWalletConnectedError"}}class Ze extends F{constructor(e){super(e),this.name="RpcConnectionError"}}let et;!function(e){e.AE="ae",e.MILI_AE="miliAE",e.MICRO_AE="microAE",e.NANO_AE="nanoAE",e.PICO_AE="picoAE",e.FEMTO_AE="femtoAE",e.AETTOS="aettos"}(et||(et={}));const tt={[et.AE]:0,[et.MILI_AE]:-3,[et.MICRO_AE]:-6,[et.NANO_AE]:-9,[et.PICO_AE]:-12,[et.FEMTO_AE]:-15,[et.AETTOS]:-18},rt=(e,t)=>{let{denomination:r=et.AETTOS,targetDenomination:n=et.AETTOS}=t;if("bigint"!=typeof(i=e)&&(!["number","object","string"].includes(typeof i)||isNaN(i)&&!Number.isInteger(i)&&!S.isBigNumber(i)))throw new q("value","a number",e);var i;return new S("bigint"==typeof e?e.toString():e).shiftedBy(tt[r]-tt[n]).toFixed()},nt=function(e){let{denomination:t=et.AETTOS}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return rt(e,{denomination:t,targetDenomination:et.AE})},it=function(e){let{denomination:t=et.AE}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return rt(e,{denomination:t})};var ot=r(780),at=r.n(ot),st=r(8442),ct=r(7795);function At(e){return!("object"!=typeof e||null===e||Array.isArray(e)||e instanceof RegExp||e instanceof Date)}function ut(e){if(At(e)){const t="string"==typeof e.name,r="string"==typeof e.message;return t&&r}return!1}function lt(e){if(ut(e))return e.message;{let t;try{t="object"==typeof e&&e?JSON.stringify(e):String(e)}catch(e){t="[unable to stringify input]"}return`Unknown error ${t}`}}const dt={},pt="REDACTED",ht=["x-ms-client-request-id","x-ms-return-client-request-id","x-ms-useragent","x-ms-correlation-request-id","x-ms-request-id","client-request-id","ms-cv","return-client-request-id","traceparent","Access-Control-Allow-Credentials","Access-Control-Allow-Headers","Access-Control-Allow-Methods","Access-Control-Allow-Origin","Access-Control-Expose-Headers","Access-Control-Max-Age","Access-Control-Request-Headers","Access-Control-Request-Method","Origin","Accept","Accept-Encoding","Cache-Control","Connection","Content-Length","Content-Type","Date","ETag","Expires","If-Match","If-Modified-Since","If-None-Match","If-Unmodified-Since","Last-Modified","Pragma","Request-Id","Retry-After","Server","Transfer-Encoding","User-Agent","WWW-Authenticate"],ft=["api-version"];class gt{constructor({additionalAllowedHeaderNames:e=[],additionalAllowedQueryParameters:t=[]}={}){e=ht.concat(e),t=ft.concat(t),this.allowedHeaderNames=new Set(e.map((e=>e.toLowerCase()))),this.allowedQueryParameters=new Set(t.map((e=>e.toLowerCase())))}sanitize(e){const t=new Set;return JSON.stringify(e,((e,r)=>{if(r instanceof Error)return Object.assign(Object.assign({},r),{name:r.name,message:r.message});if("headers"===e)return this.sanitizeHeaders(r);if("url"===e)return this.sanitizeUrl(r);if("query"===e)return this.sanitizeQuery(r);if("body"!==e&&"response"!==e&&"operationSpec"!==e){if(Array.isArray(r)||At(r)){if(t.has(r))return"[Circular]";t.add(r)}return r}}),2)}sanitizeHeaders(e){const t={};for(const r of Object.keys(e))this.allowedHeaderNames.has(r.toLowerCase())?t[r]=e[r]:t[r]=pt;return t}sanitizeQuery(e){if("object"!=typeof e||null===e)return e;const t={};for(const r of Object.keys(e))this.allowedQueryParameters.has(r.toLowerCase())?t[r]=e[r]:t[r]=pt;return t}sanitizeUrl(e){if("string"!=typeof e||null===e)return e;const t=new URL(e);if(!t.search)return e;for(const[e]of t.searchParams)this.allowedQueryParameters.has(e.toLowerCase())||t.searchParams.set(e,pt);return t.toString()}}const mt=new gt;class yt extends Error{constructor(e,t={}){super(e),this.name="RestError",this.code=t.code,this.statusCode=t.statusCode,this.request=t.request,this.response=t.response,Object.setPrototypeOf(this,yt.prototype)}[dt](){return`RestError: ${this.message} \n ${mt.sanitize(this)}`}}yt.REQUEST_SEND_ERROR="REQUEST_SEND_ERROR",yt.PARSE_ERROR="PARSE_ERROR";var It=r(8764).Buffer;const Ct=async e=>new Promise((t=>{setTimeout(t,e)})),Et=(e,t)=>Object.fromEntries(Object.entries(e).map(t)),Bt=(()=>{try{return It.concat([Uint8Array.from([])]),!1}catch(e){return!0}})()?(e,t)=>It.concat(e.map((e=>It.from(e))),t):It.concat;function wt(e,t){return e in t}function Qt(e){return e instanceof yt&&404===e.statusCode&&e.message.includes("Account not found")}var vt=r(7191),Nt=r(7499),bt=r.n(Nt);let St;!function(e){e.KeyBlockHash="kh",e.MicroBlockHash="mh",e.BlockPofHash="bf",e.BlockTxHash="bx",e.BlockStateHash="bs",e.Channel="ch",e.ContractAddress="ct",e.ContractBytearray="cb",e.ContractStoreKey="ck",e.ContractStoreValue="cv",e.Transaction="tx",e.TxHash="th",e.OracleAddress="ok",e.OracleQuery="ov",e.OracleQueryId="oq",e.OracleResponse="or",e.AccountAddress="ak",e.Signature="sg",e.Commitment="cm",e.PeerPubkey="pp",e.Name="nm",e.State="st",e.Poi="pi",e.StateTrees="ss",e.CallStateTree="cs",e.Bytearray="ba"}(St||(St={}));var xt=r(8764).Buffer;function Tt(e){return(new(bt())).update(e).digest()}const _t=[St.ContractBytearray,St.ContractStoreKey,St.ContractStoreValue,St.Transaction,St.OracleQuery,St.OracleResponse,St.State,St.Poi,St.StateTrees,St.CallStateTree,St.Bytearray],Rt=[St.KeyBlockHash,St.MicroBlockHash,St.BlockPofHash,St.BlockTxHash,St.BlockStateHash,St.Channel,St.ContractAddress,St.TxHash,St.OracleAddress,St.OracleQueryId,St.AccountAddress,St.Signature,St.Commitment,St.PeerPubkey,St.Name],Mt={[St.KeyBlockHash]:32,[St.MicroBlockHash]:32,[St.BlockPofHash]:32,[St.BlockTxHash]:32,[St.BlockStateHash]:32,[St.Channel]:32,[St.ContractAddress]:32,[St.TxHash]:32,[St.OracleAddress]:32,[St.OracleQueryId]:32,[St.AccountAddress]:32,[St.Signature]:64,[St.Commitment]:32,[St.PeerPubkey]:32,[St.State]:32};function Dt(e,t){if(!wt(t,Mt))return;const r=Mt[t];if(null!=r&&e.length!==r)throw new Ue(`Payload should be ${r} bytes, got ${e.length} instead`)}const Ot=e=>Tt(Tt(e)).slice(0,4),zt=e=>Bt([e,Ot(e)]);function kt(e){const t=e.slice(0,-4);if(!Ot(t).equals(e.slice(-4)))throw new Te;return t}const Pt={encode:e=>zt(e).toString("base64"),decode:e=>kt(xt.from(e,"base64"))},Ut={encode:e=>(0,vt.encode)(zt(e)),decode:e=>kt(xt.from((0,vt.decode)(e)))},Ft=e=>{const t=_t.find((t=>t===e));if(null!=t)return[t,Pt];const r=Rt.find((t=>t===e));if(null!=r)return[r,Ut];throw new q("prefix",`one of ${[...Rt,..._t].join(", ")}`,e)};function qt(e){const[t,r,n]=e.split("_");if(null==r)throw new Pe(`Encoded string missing payload: ${e}`);if(null!=n)throw new Pe(`Encoded string have extra parts: ${e}`);const[i,o]=Ft(t),a=o.decode(r);return Dt(a,i),a}function Lt(e,t){const[,r]=Ft(t);return Dt(e,t),`${t}_${r.encode(e)}`}var Gt=r(8764).Buffer;function Ht(e){const t="string"==typeof e?Gt.from(e,"hex"):e;return Lt(at().sign.keyPair.fromSecretKey(t).publicKey,St.AccountAddress)}function jt(e){arguments.length>1&&void 0!==arguments[1]||St.AccountAddress;try{return qt(e),!0}catch(e){return!1}}function Yt(){const[e]=new BigUint64Array(at().randomBytes(8).buffer);return Number(e%BigInt(Number.MAX_SAFE_INTEGER))}function $t(e){const t=Gt.allocUnsafe(4);return t.writeUInt32BE(e),t.slice(t.findIndex((e=>0!==e)))}function Kt(e){return Gt.from((0,st.blake2b)(e,void 0,32))}function Vt(e,t){const r=qt(e);return Lt(Kt(Bt([r,$t(t)])),St.ContractAddress)}function Jt(e){return at().sign.keyPair.fromSecretKey(e)}function Wt(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const t=at().sign.keyPair(),r=Gt.from(t.publicKey),n=Gt.from(t.secretKey);return e?{publicKey:r,secretKey:n}:{publicKey:Lt(r,St.AccountAddress),secretKey:n.toString("hex")}}function Xt(e,t){return at().sign.detached(Gt.from(e),Gt.from(t))}function Zt(e,t,r){return at().sign.detached.verify(e,t,qt(r))}function er(e){const t=Gt.from("aeternity Signed Message:\n","utf8"),r=Gt.from(e,"utf8");return Kt(Bt([(0,ct.encode)(t.length),t,(0,ct.encode)(r.length),r]))}function tr(e,t){return Xt(er(e),t)}function rr(e,t,r){return Zt(er(e),t,r)}function nr(e,t){const r=Gt.from("TheMessage");return Zt(r,Xt(r,e),Lt("string"==typeof t?Gt.from(t,"hex"):t,St.AccountAddress))}const ir=5e4,or=18e4,ar=36e3,sr=84600,cr=sr,Ar=1e9,ur=1e14,lr=.05,dr=480,pr=31,hr=12,fr=Et({31:3,30:5,29:8,28:13,27:21,26:34,25:55,24:89,23:144,22:233,21:377,20:610,19:987,18:1597,17:2584,16:4181,15:6765,14:10946,13:17711,12:28657,11:46368,10:75025,9:121393,8:196418,7:317811,6:514229,5:832040,4:1346269,3:2178309,2:3524578,1:5702887},(e=>{let[t,r]=e;return[t,new S(r).times(ur)]}));let gr;!function(e){e[e.Account=10]="Account",e[e.SignedTx=11]="SignedTx",e[e.SpendTx=12]="SpendTx",e[e.OracleRegisterTx=22]="OracleRegisterTx",e[e.OracleQueryTx=23]="OracleQueryTx",e[e.OracleResponseTx=24]="OracleResponseTx",e[e.OracleExtendTx=25]="OracleExtendTx",e[e.NameClaimTx=32]="NameClaimTx",e[e.NamePreclaimTx=33]="NamePreclaimTx",e[e.NameUpdateTx=34]="NameUpdateTx",e[e.NameRevokeTx=35]="NameRevokeTx",e[e.NameTransferTx=36]="NameTransferTx",e[e.Contract=40]="Contract",e[e.ContractCall=41]="ContractCall",e[e.ContractCreateTx=42]="ContractCreateTx",e[e.ContractCallTx=43]="ContractCallTx",e[e.ChannelCreateTx=50]="ChannelCreateTx",e[e.ChannelDepositTx=51]="ChannelDepositTx",e[e.ChannelWithdrawTx=52]="ChannelWithdrawTx",e[e.ChannelForceProgressTx=521]="ChannelForceProgressTx",e[e.ChannelCloseMutualTx=53]="ChannelCloseMutualTx",e[e.ChannelCloseSoloTx=54]="ChannelCloseSoloTx",e[e.ChannelSlashTx=55]="ChannelSlashTx",e[e.ChannelSettleTx=56]="ChannelSettleTx",e[e.ChannelOffChainTx=57]="ChannelOffChainTx",e[e.ChannelOffChainUpdateTransfer=570]="ChannelOffChainUpdateTransfer",e[e.ChannelOffChainUpdateDeposit=571]="ChannelOffChainUpdateDeposit",e[e.ChannelOffChainUpdateWithdraw=572]="ChannelOffChainUpdateWithdraw",e[e.ChannelOffChainUpdateCreateContract=573]="ChannelOffChainUpdateCreateContract",e[e.ChannelOffChainUpdateCallContract=574]="ChannelOffChainUpdateCallContract",e[e.ChannelClientReconnectTx=575]="ChannelClientReconnectTx",e[e.Channel=58]="Channel",e[e.ChannelSnapshotSoloTx=59]="ChannelSnapshotSoloTx",e[e.TreesPoi=60]="TreesPoi",e[e.StateTrees=62]="StateTrees",e[e.Mtree=63]="Mtree",e[e.MtreeValue=64]="MtreeValue",e[e.ContractsMtree=621]="ContractsMtree",e[e.CallsMtree=622]="CallsMtree",e[e.ChannelsMtree=623]="ChannelsMtree",e[e.NameserviceMtree=624]="NameserviceMtree",e[e.OraclesMtree=625]="OraclesMtree",e[e.AccountsMtree=626]="AccountsMtree",e[e.CompilerSophia=70]="CompilerSophia",e[e.GaAttachTx=80]="GaAttachTx",e[e.GaMetaTx=81]="GaMetaTx",e[e.PayingForTx=82]="PayingForTx"}(gr||(gr={}));var mr=r(8764).Buffer;function yr(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(null==e)return mr.from([]);if(Number.isInteger(e)||S.isBigNumber(e)||t){if(S.isBigNumber(e)||(e=new S(e)),!e.isInteger())throw new V(`Unexpected not integer value: ${e.toFixed()}`);let t=e.toString(16);return t.length%2==1&&(t=`0${t}`),mr.from(t,"hex")}if("string"==typeof e)return mr.from(e);throw new Y}var Ir=r(8764).Buffer;function Cr(e,t){return Lt(Kt(Ir.from([...qt(e),...yr(t)])),St.ContractAddress)}function Er(e,t,r){return Lt(Kt(Ir.from([...qt(e),...function(e){const t=yr(e,!0);return Bt([Ir.alloc(32-t.length),t])}(t),...qt(r)])),St.OracleQueryId)}function Br(e){return Lt(Kt(e.toLowerCase()),St.Name)}function wr(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Yt();return Lt(Kt(Bt([Ir.from(e.toLowerCase()),Ir.from(t.toString(16).padStart(64,"0"),"hex")])),St.Commitment)}function Qr(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ir.from([]);return new S(Ir.from(e).toString("hex"),16).toString(10)}const vr=".chain";function Nr(e){return e.endsWith(vr)}const br=[[St.AccountAddress,"account_pubkey"],[St.OracleAddress,"oracle_pubkey"],[St.ContractAddress,"contract_pubkey"],[St.Channel,"channel"]];function Sr(e){var t;qt(e);const r=e.substring(0,2),n=null===(t=br.find((e=>{let[t]=e;return t===r})))||void 0===t?void 0:t[1];if(null!=n)return n;throw new q("identifier",`prefixed with one of ${br.map((e=>{let[t]=e;return`${t}_`})).join(", ")}`,e)}function xr(e){const t=e.length-vr.length;return fr[Math.min(t,pr)]}function Tr(e){let{startFee:t,increment:r=lr}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(Number(r)!==r||r%1==0)throw new qe(`Increment must be float. Current increment ${r}`);if(r<lr)throw new qe(`minimum increment percentage is ${lr}`);return x(new S(null!=t?t:xr(e)).times(new S(lr).plus(1)))}function _r(e,t){var r,n,i;const o=e.length-vr.length;return(null!==(r=null!==(n=null!==(i=o<=4?62*dr:null)&&void 0!==i?i:o<=8?31*dr:null)&&void 0!==n?n:o<=12?dr:null)&&void 0!==r?r:0)+t}function Rr(e){return e.length<13+vr.length}var Mr={serialize(e){if(e<0)throw new q("value","greater or equal to 0",e);return yr(e,!0)},deserialize(e){return Qr(e)}},Dr={serialize(e){return Mr.serialize(e)},deserialize(e){return+Mr.deserialize(e)}},Or={...Mr,serializeAettos(e){return null!=e?e:"0"},serialize(e,t){let{denomination:r,...n}=t;return Mr.serialize(this.serializeAettos(null!=e?rt(e,{denomination:r}):e,n))}},zr=r(8764).Buffer;const kr=[St.AccountAddress,St.Name,St.Commitment,St.OracleAddress,St.ContractAddress,St.Channel];function Pr(){return{serialize(e){const t=e.slice(0,2);if(r=t,!kr.includes(r))throw new Ye(t);var r;const n=kr.indexOf(t)+1;return zr.from([...yr(n),...qt(e)])},deserialize(e){const t=zr.from(e).readUIntBE(0,1),r=kr[t-1];if(null==r)throw new He(t);return Lt(e.subarray(1),r)}}}var Ur={...Or,serialize(e,t){var r;if(null!==(r=e)&&void 0!==r||(e=0),0!=+e)throw new L(`Contract deposit is not refundable, so it should be equal 0, got ${e.toString()} instead`);return Or.serialize(e,t)}},Fr=r(8764).Buffer;function qr(e,t){const r={[gr.OracleRegisterTx]:"oracleTtlValue",[gr.OracleExtendTx]:"oracleTtlValue",[gr.OracleQueryTx]:"queryTtlValue",[gr.OracleResponseTx]:"responseTtlValue"};return wt(t,r)?e[r[t]]:1}function Lr(e,t){const{rlpEncoded:{length:r},txObject:n}=t;return(e=>{var t;const r=null!==(t={[gr.ChannelForceProgressTx]:30,[gr.ChannelOffChainTx]:0,[gr.ChannelOffChainUpdateCallContract]:0,[gr.ChannelOffChainUpdateCreateContract]:0,[gr.ChannelOffChainUpdateDeposit]:0,[gr.ChannelOffChainUpdateWithdraw]:0,[gr.ChannelOffChainUpdateTransfer]:0,[gr.ContractCreateTx]:5,[gr.ContractCallTx]:12,[gr.GaAttachTx]:5,[gr.GaMetaTx]:5,[gr.PayingForTx]:.2}[e])&&void 0!==t?t:1;return new S(15e3*r)})(e).plus(((e,t,r)=>{let{relativeTtl:n,innerTxSize:i}=r;switch(e){case gr.OracleRegisterTx:case gr.OracleExtendTx:case gr.OracleQueryTx:case gr.OracleResponseTx:return new S(t).times(20).plus(Math.ceil(32e3*n/Math.floor(175200)));case gr.GaMetaTx:case gr.PayingForTx:return new S(t).minus(i).times(20);default:return new S(t).times(20)}})(e,r,{relativeTtl:qr(n,e),innerTxSize:[gr.GaMetaTx,gr.PayingForTx].includes(e)?n.tx.tx.encodedTx.rlpEncoded.length:0})).times(Ar)}var Gr={...Or,serializeAettos(e,t){let{txType:r,rebuildTx:n,_computingMinFee:i}=t;if(null!=i)return i;const o=function(e,t){let r,n=new S(0);do{r=n,n=Lr(e,t(n))}while(!n.eq(r));return n}(r,(e=>n({_computingMinFee:e}))),a=new S(null!=e?e:o);if(o.gt(a))throw new L(`Fee ${a.toString()} must be bigger then ${o}`);return a.toFixed()}},Hr={...Dr,serialize(e,t){let{txType:r,rebuildTx:n,gasMax:i=6e6,_computingGasLimit:o}=t;if(null!=o)return Dr.serialize(o);const a=r===gr.GaMetaTx?ir:function(e,t,r){return t-+Lr(e,r(t)).dividedBy(Ar)}(r,i,(e=>n({_computingGasLimit:e}))),s=null!=e?e:a;if(s>a)throw new L(`Gas limit ${s} must be less or equal to ${a}`);return Dr.serialize(s)}},jr={...Or,serializeAettos(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ar.toString();if(+e<Ar)throw new L(`Gas price ${e.toString()} must be bigger then ${Ar}`);return e}},Yr=r(8764).Buffer,$r={serialize(e){return Yr.from(e)},deserialize(e){return e.toString()}},Kr={serialize(e){return $r.serialize(e)},deserialize(e){return $r.deserialize(e)}},Vr={...Or,serializeAettos(e,t){const r=xr(t.name),n=new S(null!=e?e:r);if(r.gt(n))throw new ie(n,r);return n.toFixed()},serialize(e,t){return Or.serialize.call(this,e,t)}};const Jr=Pr();var Wr={...Jr,serialize(e){return Jr.serialize(Nr(e)?Br(e):e)}};const Xr=Pr(),Zr=Mr,en=Dr,tn=Or,rn=Pr,nn=function(){const e=Pr();return{serialize(t){return t.map(e.serialize)},deserialize(t){return t.map(e.deserialize)}}},on=Ur,an=function(){return{serialize(e){if("number"!=typeof e)throw new q("value","to be a number",e);if(e>255)throw new q("value","to be less than 256",e);return Fr.from([e])},deserialize(e){if(1!==e.length)throw new q("buffer","to have single element",e.length);return e[0]}}},sn=Gr,cn=Hr,An=jr,un=Kr,ln=Vr,dn=Wr,pn={serialize(e){if(e.length>32)throw new L(`Expected 32 pointers or less, got ${e.length} instead`);return e.map((e=>[yr(e.key),Xr.serialize(e.id)]))},deserialize(e){return e.map((e=>{let[t,r]=e;return{key:t.toString(),id:Xr.deserialize(r)}}))}};let hn;!function(e){e[e.delta=0]="delta",e[e.block=1]="block"}(hn||(hn={}));const fn=0,gn=3e4,mn={type:hn.delta,value:500},yn={type:hn.delta,value:10},In={type:hn.delta,value:10},Cn={pub:"ak_11111111111111111111111111111111273Yts",amount:100000000000000000000000000000000000n};let En,Bn,wn,Qn;!function(e){e[e.NO_VM=0]="NO_VM",e[e.SOPHIA=1]="SOPHIA",e[e.SOPHIA_IMPROVEMENTS_MINERVA=3]="SOPHIA_IMPROVEMENTS_MINERVA",e[e.SOPHIA_IMPROVEMENTS_FORTUNA=4]="SOPHIA_IMPROVEMENTS_FORTUNA",e[e.FATE=5]="FATE",e[e.SOPHIA_IMPROVEMENTS_LIMA=6]="SOPHIA_IMPROVEMENTS_LIMA",e[e.FATE_2=7]="FATE_2"}(En||(En={})),function(e){e[e.NO_ABI=0]="NO_ABI",e[e.SOPHIA=1]="SOPHIA",e[e.FATE=3]="FATE"}(Bn||(Bn={})),function(e){e[e.Ok=0]="Ok",e[e.Error=1]="Error",e[e.Revert=2]="Revert"}(wn||(wn={})),function(e){e[e.IRIS=5]="IRIS"}(Qn||(Qn={}));const vn={[Qn.IRIS]:{[gr.ContractCreateTx]:{vmVersion:[En.FATE_2],abiVersion:[Bn.FATE]},[gr.ContractCallTx]:{vmVersion:[],abiVersion:[Bn.FATE,Bn.SOPHIA]},[gr.OracleRegisterTx]:{vmVersion:[],abiVersion:[Bn.NO_ABI,Bn.SOPHIA]}}};let Nn;!function(e){e[e.string=0]="string",e[e.binary=1]="binary",e[e.bool=2]="bool",e[e.hex=3]="hex",e[e.rlpBinary=4]="rlpBinary",e[e.rlpBinaries=5]="rlpBinaries",e[e.rawBinary=6]="rawBinary",e[e.signatures=7]="signatures",e[e.offChainUpdates=8]="offChainUpdates",e[e.callStack=9]="callStack",e[e.proofOfInclusion=10]="proofOfInclusion",e[e.mptrees=11]="mptrees",e[e.ctVersion=12]="ctVersion",e[e.sophiaCodeTypeInfo=13]="sophiaCodeTypeInfo",e[e.payload=14]="payload",e[e.stateTree=15]="stateTree"}(Nn||(Nn={}));const bn=[["tag",en],["VSN",en]],Sn={[gr.Account]:{1:[...bn,["nonce",en],["balance",Zr]],2:[...bn,["flags",Zr],["nonce",en],["balance",Zr],["gaContract",rn()],["gaAuthFun",Nn.binary,St.ContractBytearray]]},[gr.SignedTx]:{1:[...bn,["signatures",Nn.signatures],["encodedTx",Nn.rlpBinary]]},[gr.SpendTx]:{1:[...bn,["senderId",rn()],["recipientId",rn()],["amount",tn],["fee",sn],["ttl",en],["nonce",en],["payload",Nn.payload]]},[gr.NamePreclaimTx]:{1:[...bn,["accountId",rn()],["nonce",en],["commitmentId",rn()],["fee",sn],["ttl",en]]},[gr.NameClaimTx]:{2:[...bn,["accountId",rn()],["nonce",en],["name",un],["nameSalt",Zr],["nameFee",ln],["fee",sn],["ttl",en]]},[gr.NameUpdateTx]:{1:[...bn,["accountId",rn()],["nonce",en],["nameId",dn],["nameTtl",en],["pointers",pn],["clientTtl",en],["fee",sn],["ttl",en]]},[gr.NameTransferTx]:{1:[...bn,["accountId",rn()],["nonce",en],["nameId",dn],["recipientId",rn()],["fee",sn],["ttl",en]]},[gr.NameRevokeTx]:{1:[...bn,["accountId",rn()],["nonce",en],["nameId",dn],["fee",sn],["ttl",en]]},[gr.Contract]:{1:[...bn,["owner",rn()],["ctVersion",Nn.ctVersion],["code",Nn.binary,St.ContractBytearray],["log",Nn.binary,St.ContractBytearray],["active",Nn.bool],["referers",nn()],["deposit",on]]},[gr.ContractCreateTx]:{1:[...bn,["ownerId",rn()],["nonce",en],["code",Nn.binary,St.ContractBytearray],["ctVersion",Nn.ctVersion],["fee",sn],["ttl",en],["deposit",on],["amount",tn],["gasLimit",cn],["gasPrice",An],["callData",Nn.binary,St.ContractBytearray]]},[gr.ContractCallTx]:{1:[...bn,["callerId",rn()],["nonce",en],["contractId",rn()],["abiVersion",an()],["fee",sn],["ttl",en],["amount",tn],["gasLimit",cn],["gasPrice",An],["callData",Nn.binary,St.ContractBytearray]]},[gr.ContractCall]:{1:[...bn,["callerId",rn()],["callerNonce",en],["height",en],["contractId",rn()],["gasPrice",An],["gasUsed",en],["returnValue",Nn.binary,St.ContractBytearray],["returnType",an()],["log",Nn.rawBinary]]},[gr.OracleRegisterTx]:{1:[...bn,["accountId",rn()],["nonce",en],["queryFormat",Nn.string],["responseFormat",Nn.string],["queryFee",tn],["oracleTtlType",an()],["oracleTtlValue",en],["fee",sn],["ttl",en],["abiVersion",an()]]},[gr.OracleExtendTx]:{1:[...bn,["oracleId",rn()],["nonce",en],["oracleTtlType",an()],["oracleTtlValue",en],["fee",sn],["ttl",en]]},[gr.OracleQueryTx]:{1:[...bn,["senderId",rn()],["nonce",en],["oracleId",rn()],["query",Nn.string],["queryFee",tn],["queryTtlType",an()],["queryTtlValue",en],["responseTtlType",an()],["responseTtlValue",en],["fee",sn],["ttl",en]]},[gr.OracleResponseTx]:{1:[...bn,["oracleId",rn()],["nonce",en],["queryId",Nn.binary,St.OracleQueryId],["response",Nn.string],["responseTtlType",an()],["responseTtlValue",en],["fee",sn],["ttl",en]]},[gr.ChannelCreateTx]:{2:[...bn,["initiator",rn()],["initiatorAmount",Zr],["responder",rn()],["responderAmount",Zr],["channelReserve",Zr],["lockPeriod",Zr],["ttl",en],["fee",sn],["initiatorDelegateIds",Nn.string],["responderDelegateIds",Nn.string],["stateHash",Nn.binary,St.State],["nonce",en]]},[gr.ChannelCloseMutualTx]:{1:[...bn,["channelId",rn()],["fromId",rn()],["initiatorAmountFinal",Zr],["responderAmountFinal",Zr],["ttl",en],["fee",sn],["nonce",en]]},[gr.ChannelCloseSoloTx]:{1:[...bn,["channelId",rn()],["fromId",rn()],["payload",Nn.binary,St.Transaction],["poi",Nn.binary,St.Poi],["ttl",en],["fee",sn],["nonce",en]]},[gr.ChannelSlashTx]:{1:[...bn,["channelId",rn()],["fromId",rn()],["payload",Nn.binary,St.Transaction],["poi",Nn.binary,St.Poi],["ttl",en],["fee",sn],["nonce",en]]},[gr.ChannelDepositTx]:{1:[...bn,["channelId",rn()],["fromId",rn()],["amount",Zr],["ttl",en],["fee",sn],["stateHash",Nn.binary,St.State],["round",en],["nonce",en]]},[gr.ChannelWithdrawTx]:{1:[...bn,["channelId",rn()],["toId",rn()],["amount",Zr],["ttl",en],["fee",sn],["stateHash",Nn.binary,St.State],["round",en],["nonce",en]]},[gr.ChannelSettleTx]:{1:[...bn,["channelId",rn()],["fromId",rn()],["initiatorAmountFinal",Zr],["responderAmountFinal",Zr],["ttl",en],["fee",sn],["nonce",en]]},[gr.ChannelForceProgressTx]:{1:[...bn,["channelId",rn()],["fromId",rn()],["payload",Nn.binary,St.Transaction],["round",en],["update",Nn.binary,St.ContractBytearray],["stateHash",Nn.binary,St.State],["offChainTrees",Nn.stateTree],["ttl",en],["fee",sn],["nonce",en]]},[gr.ChannelOffChainTx]:{2:[...bn,["channelId",rn()],["round",en],["stateHash",Nn.binary,St.State]]},[gr.Channel]:{3:[...bn,["initiator",rn()],["responder",rn()],["channelAmount",Zr],["initiatorAmount",Zr],["responderAmount",Zr],["channelReserve",Zr],["initiatorDelegateIds",nn()],["responderDelegateIds",nn()],["stateHash",Nn.hex],["round",en],["soloRound",Zr],["lockPeriod",Zr],["lockedUntil",Zr],["initiatorAuth",Nn.binary,St.ContractBytearray],["responderAuth",Nn.binary,St.ContractBytearray]]},[gr.ChannelSnapshotSoloTx]:{1:[...bn,["channelId",rn()],["fromId",rn()],["payload",Nn.binary,St.Transaction],["ttl",en],["fee",sn],["nonce",en]]},[gr.ChannelOffChainUpdateTransfer]:{1:[...bn,["from",rn()],["to",rn()],["amount",Zr]]},[gr.ChannelOffChainUpdateDeposit]:{1:[...bn,["from",rn()],["amount",Zr]]},[gr.ChannelOffChainUpdateWithdraw]:{1:[...bn,["from",rn()],["amount",Zr]]},[gr.ChannelOffChainUpdateCreateContract]:{1:[...bn,["owner",rn()],["ctVersion",Nn.ctVersion],["code",Nn.binary,St.ContractBytearray],["deposit",Zr],["callData",Nn.binary,St.ContractBytearray]]},[gr.ChannelOffChainUpdateCallContract]:{1:[...bn,["caller",rn()],["contract",rn()],["abiVersion",an()],["amount",Zr],["callData",Nn.binary,St.ContractBytearray],["callStack",Nn.callStack],["gasPrice",An],["gasLimit",cn]]},[gr.ChannelClientReconnectTx]:{1:[...bn,["channelId",rn()],["round",en],["role",Nn.string],["pubkey",rn()]]},[gr.TreesPoi]:{1:[...bn,["accounts",Nn.mptrees],["calls",Nn.mptrees],["channels",Nn.mptrees],["contracts",Nn.mptrees],["ns",Nn.mptrees],["oracles",Nn.mptrees]]},[gr.StateTrees]:{1:[...bn,["contracts",Nn.rlpBinary],["calls",Nn.rlpBinary],["channels",Nn.rlpBinary],["ns",Nn.rlpBinary],["oracles",Nn.rlpBinary],["accounts",Nn.rlpBinary]]},[gr.Mtree]:{1:[...bn,["values",Nn.rlpBinaries]]},[gr.MtreeValue]:{1:[...bn,["key",Nn.hex],["value",Nn.rawBinary]]},[gr.ContractsMtree]:{1:[...bn,["contracts",Nn.rlpBinary]]},[gr.CallsMtree]:{1:[...bn,["calls",Nn.rlpBinary]]},[gr.ChannelsMtree]:{1:[...bn,["channels",Nn.rlpBinary]]},[gr.NameserviceMtree]:{1:[...bn,["mtree",Nn.rlpBinary]]},[gr.OraclesMtree]:{1:[...bn,["otree",Nn.rlpBinary]]},[gr.AccountsMtree]:{1:[...bn,["accounts",Nn.rlpBinary]]},[gr.GaAttachTx]:{1:[...bn,["ownerId",rn()],["nonce",en],["code",Nn.binary,St.ContractBytearray],["authFun",Nn.rawBinary],["ctVersion",Nn.ctVersion],["fee",sn],["ttl",en],["gasLimit",cn],["gasPrice",An],["callData",Nn.binary,St.ContractBytearray]]},[gr.GaMetaTx]:{2:[...bn,["gaId",rn()],["authData",Nn.binary,St.ContractBytearray],["abiVersion",an()],["fee",sn],["gasLimit",cn],["gasPrice",An],["tx",Nn.rlpBinary]]},[gr.PayingForTx]:{1:[...bn,["payerId",rn()],["nonce",en],["fee",sn],["tx",Nn.rlpBinary]]},[gr.CompilerSophia]:{3:[...bn,["sourceCodeHash",Nn.rawBinary],["typeInfo",Nn.sophiaCodeTypeInfo],["byteCode",Nn.rawBinary],["compilerVersion",Nn.string],["payable",Nn.bool]]}};var xn,Tn=r(6636),_n=r(8764).Buffer;!function(e){e[e.Branch=0]="Branch",e[e.Extension=1]="Extension",e[e.Leaf=2]="Leaf"}(xn||(xn={}));class Rn{static nodeHash(e){return _n.from(Kt((0,Tn.encode)(e))).toString("hex")}constructor(e){if(this.rootHash=e[0].toString("hex"),this.nodes=Object.fromEntries(e[1].map((e=>[e[0].toString("hex"),e[1]]))),void 0===this.nodes[this.rootHash])throw new Me("Can't find a node by root hash");Object.entries(this.nodes).forEach((e=>{let[t,r]=e;if(Rn.nodeHash(r)!==t)throw new Re;const{type:n,payload:i}=Rn.parseNode(r);switch(n){case xn.Branch:i.slice(0,16).filter((e=>e.length)).forEach((e=>{if(void 0===this.nodes[e.toString("hex")])throw new Me("Can't find a node by hash in branch node")}));break;case xn.Extension:if(void 0===this.nodes[i[0].toString("hex")])throw new Me("Can't find a node by hash in extension node")}}))}isEqual(e){return this.rootHash===e.rootHash}static parseNode(e){switch(e.length){case 17:return{type:xn.Branch,payload:e,path:null};case 2:{const t=e[0][0]>>4;if(t>3)throw new Oe(t);const r=t<=1?xn.Extension:xn.Leaf,n=[0,2].includes(t)?2:1;return{type:r,payload:[e[1]],path:e[0].toString("hex").slice(n)}}default:throw new De(e.length)}}serialize(){return[_n.from(this.rootHash,"hex"),Object.entries(this.nodes).map((e=>{let[t,r]=e;return[_n.from(t,"hex"),r]}))]}get(e){let t=this.rootHash,r=e;for(;;){const{type:e,payload:n,path:i}=Rn.parseNode(this.nodes[t]);switch(e){case xn.Branch:if(0===r.length)return n[16];t=n[+`0x${r[0]}`].toString("hex"),r=r.substring(1);break;case xn.Extension:if(r.substring(0,null==i?void 0:i.length)!==i)return;t=n[0].toString("hex"),r=r.substring(i.length);break;case xn.Leaf:if(i!==r)return;return n[0]}}}}var Mn=r(8764).Buffer;function Dn(e,t,r){if(null==e)return"";switch(t){case Nn.ctVersion:{const[t,,r]=e;return{vmVersion:Qr(Mn.from([t])),abiVersion:Qr(Mn.from([r]))}}case Nn.bool:return 1===e[0];case Nn.binary:return Lt(e,r);case Nn.stateTree:return Lt(e,St.StateTrees);case Nn.string:return e.toString();case Nn.payload:return Lt(e,St.Bytearray);case Nn.rlpBinary:return Fn(Lt(e,St.Transaction));case Nn.rlpBinaries:return e.map((e=>Fn(Lt(e,St.Transaction))));case Nn.rawBinary:return e;case Nn.hex:return e.toString("hex");case Nn.offChainUpdates:return e.map((e=>Fn(Lt(e,St.Transaction))));case Nn.callStack:return[Qr(e)];case Nn.mptrees:return e.map((e=>new Rn(e)));case Nn.sophiaCodeTypeInfo:return e.reduce(((e,t)=>{let[r,n,i,o]=t;return{...e,[n.toString()]:{funHash:r,argType:i,outType:o}}}),{});default:return"number"==typeof t?e:t.deserialize(e)}}function On(e,t,r){var n;switch(t){case Nn.bool:return Mn.from([!0===e?1:0]);case Nn.binary:case Nn.stateTree:return qt(e);case Nn.hex:return Mn.from(e,"hex");case Nn.signatures:return e.map(Mn.from);case Nn.payload:return"string"==typeof e&&"ba"===e.split("_")[0]?qt(e):yr(e);case Nn.string:return yr(e);case Nn.rlpBinary:return null!==(n=e.rlpEncoded)&&void 0!==n?n:e;case Nn.mptrees:return e.map((e=>e.serialize()));case Nn.ctVersion:return Mn.from([...yr(e.vmVersion),0,...yr(e.abiVersion)]);default:return"number"==typeof t?e:t.serialize(e,r)}}function zn(e,t){return null==e?"Field is required":t===Nn.ctVersion?Boolean(e.abiVersion)&&Boolean(e.vmVersion)?void 0:'Value must be an object with "vmVersion" and "abiVersion" fields':void 0}function kn(e,t,r){let{excludeKeys:n=[]}=r;const i=["payload","nameFee","deposit","gasPrice","fee","gasLimit","amount"];return Object.fromEntries(t.filter((e=>{let[t]=e;return!n.includes(t)&&!i.includes(t)})).map((t=>{let[r,n]=t;return[r,zn(e[r],n)]})).filter((e=>{let[,t]=e;return t})))}function Pn(e,t){return t.reduce(((t,r,n)=>{let[i,o,a]=r;return Object.assign(t,{[i]:Dn(e[n],o,a)})}),{})}function Un(e,t){var r;let{excludeKeys:n=[],prefix:i=St.Transaction,vsn:o,denomination:a=et.AETTOS}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const s=Sn[t];if(null!==(r=o)&&void 0!==r||(o=Math.max(...Object.keys(s).map((e=>+e)))),!wt(o,s))throw new je("serialization",gr[t],o);const c=s[o],A=e;A.VSN=o,A.tag=t,A.denomination=a;const u=c.filter((e=>{let[t]=e;return!n.includes(t)})),l=kn(A,c,{excludeKeys:n});if(Object.keys(l).length>0)throw new Ge(`Transaction build error. ${JSON.stringify(l)}`);const d=u.map((e=>{let[r,i]=e;return On(A[r],i,{...A,txType:t,rebuildTx:e=>Un({...A,...e},t,{excludeKeys:n,prefix:St.Transaction,vsn:o,denomination:a})})})).filter((e=>void 0!==e)),p=(0,Tn.encode)(d),h=Lt(p,i);return{tx:h,rlpEncoded:p,binary:d,txObject:Pn(d,c)}}function Fn(e,t){const r=qt(e),n=(0,Tn.decode)(r),i=+Qr(n[0]);if(!wt(i,Sn))throw new Pe(`Unknown transaction tag: ${i}`);if(null!=t&&t!==i)throw new Pe(`Expected transaction to have ${gr[t]} tag, got ${gr[i]} instead`);const o=+Qr(n[1]);if(!wt(o,Sn[i]))throw new je("deserialization",`tag ${i}`,o);return{txType:i,tx:Pn(n,Sn[i][o]),rlpEncoded:r}}function qn(e){return Lt(Kt("string"==typeof e&&e.startsWith("tx_")?qt(e):e),St.TxHash)}function Ln(e){const{txType:t,tx:r}=Fn(e);if(![gr.ContractCreateTx,gr.GaAttachTx].includes(t))throw new q("contractCreateTx","a contractCreateTx or gaAttach",t);return Cr(r.ownerId,+r.nonce)}function Gn(e,t,r){if(!t.has(e))throw new TypeError("attempted to "+r+" private field on non-instance");return t.get(e)}function Hn(e,t){return function(e,t){return t.get?t.get.call(e):t.value}(e,Gn(e,t,"get"))}function jn(e,t,r){return function(e,t,r){if(t.set)t.set.call(e,r);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=r}}(e,Gn(e,t,"set"),r),r}function Yn(e,t,r){const n=e=>e.split(/[-+]/)[0].split(".").map((e=>+e)),i=n(e),o=n(t),a=n(r),s=Math.max(...i,...o,...a)+1,c=e=>e.reverse().reduce(((e,t,r)=>e+t*s**r),0),A=c(i),u=c(o),l=c(a);return A>=u&&A<l}const $n=()=>{const e=new Map;return{policy:{name:"request-queues",async sendRequest(t,r){var n;const i=t.headers.get("__queue");t.headers.delete("__queue");const o=async()=>r(t);if(null==i)return o();const a=(null!==(n=e.get(i))&&void 0!==n?n:Promise.resolve()).then(o,o);return e.set(i,a.then((async()=>Ct(750)))),a}},position:"perCall"}},Kn=()=>{const e=new Map;return{policy:{name:"combine-get-requests",async sendRequest(t,r){var n;if("GET"!==t.method)return r(t);const i=JSON.stringify([t.url,t.body]),o=null!==(n=e.get(i))&&void 0!==n?n:r(t);e.set(i,o);try{return await o}finally{e.delete(i)}}},position:"perCall"}},Vn=()=>{const e=new Map;return{name:"aggressive-cache-get-responses",async sendRequest(t,r){var n;if("GET"!==t.method)return r(t);const i=JSON.stringify([t.url,t.body]),o=null!==(n=e.get(i))&&void 0!==n?n:r(t);return e.set(i,o),o}}},Jn=e=>({policy:{name:"error-formatter",async sendRequest(t,r){try{return await r(t)}catch(t){var n;if(!(t instanceof yt)||null==t.request)throw t;if(null==(null===(n=t.response)||void 0===n?void 0:n.bodyAsText))throw t;let r;try{r=JSON.parse(t.response.bodyAsText)}catch(e){throw t}t.message=`${new URL(t.request.url).pathname.slice(1)} error`;const i=e(r);throw""!==i&&(t.message+=`:${i}`),t}}},position:"perCall"}),Wn=(e,t,r,n,i)=>({name:"version-check",async sendRequest(o,a){if(new URL(o.url).pathname===t)return a(o);const s=[await r,n,i];if(!Yn(...s))throw new Z(e,...s);return a(o)}});function Xn(e){return e.toLowerCase()}class Zn{constructor(e){if(this._headersMap=new Map,e)for(const t of Object.keys(e))this.set(t,e[t])}set(e,t){this._headersMap.set(Xn(e),{name:e,value:String(t)})}get(e){var t;return null===(t=this._headersMap.get(Xn(e)))||void 0===t?void 0:t.value}has(e){return this._headersMap.has(Xn(e))}delete(e){this._headersMap.delete(Xn(e))}toJSON(e={}){const t={};if(e.preserveCase)for(const e of this._headersMap.values())t[e.name]=e.value;else for(const[e,r]of this._headersMap)t[e]=r.value;return t}toString(){return JSON.stringify(this.toJSON({preserveCase:!0}))}[Symbol.iterator](){return function*(e){for(const t of e.values())yield[t.name,t.value]}(this._headersMap)}}function ei(e){return new Zn(e)}var ti,ri=new Uint8Array(16);function ni(){if(!ti&&!(ti="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ti(ri)}for(var ii=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,oi=function(e){return"string"==typeof e&&ii.test(e)},ai=[],si=0;si<256;++si)ai.push((si+256).toString(16).substr(1));var ci=function(e,t,r){var n=(e=e||{}).random||(e.rng||ni)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(var i=0;i<16;++i)t[r+i]=n[i];return t}return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=(ai[e[t+0]]+ai[e[t+1]]+ai[e[t+2]]+ai[e[t+3]]+"-"+ai[e[t+4]]+ai[e[t+5]]+"-"+ai[e[t+6]]+ai[e[t+7]]+"-"+ai[e[t+8]]+ai[e[t+9]]+"-"+ai[e[t+10]]+ai[e[t+11]]+ai[e[t+12]]+ai[e[t+13]]+ai[e[t+14]]+ai[e[t+15]]).toLowerCase();if(!oi(r))throw TypeError("Stringified UUID is invalid");return r}(n)};class Ai{constructor(e){var t,r,n,i,o,a,s;this.url=e.url,this.body=e.body,this.headers=null!==(t=e.headers)&&void 0!==t?t:ei(),this.method=null!==(r=e.method)&&void 0!==r?r:"GET",this.timeout=null!==(n=e.timeout)&&void 0!==n?n:0,this.formData=e.formData,this.disableKeepAlive=null!==(i=e.disableKeepAlive)&&void 0!==i&&i,this.proxySettings=e.proxySettings,this.streamResponseStatusCodes=e.streamResponseStatusCodes,this.withCredentials=null!==(o=e.withCredentials)&&void 0!==o&&o,this.abortSignal=e.abortSignal,this.tracingOptions=e.tracingOptions,this.onUploadProgress=e.onUploadProgress,this.onDownloadProgress=e.onDownloadProgress,this.requestId=e.requestId||ci(),this.allowInsecureConnection=null!==(a=e.allowInsecureConnection)&&void 0!==a&&a,this.enableBrowserStreams=null!==(s=e.enableBrowserStreams)&&void 0!==s&&s}}const ui="$",li="_";function di(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function pi(e){const t=atob(e),r=new Uint8Array(t.length);for(let e=0;e<t.length;e++)r[e]=t.charCodeAt(e);return r}const hi=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,fi=/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/i;function gi(e,t){var r,n;const i=e.parsedHeaders;if("HEAD"===e.request.method)return Object.assign(Object.assign({},i),{body:e.parsedBody});const o=t&&t.bodyMapper,a=Boolean(null==o?void 0:o.nullable),s=null==o?void 0:o.type.name;if("Stream"===s)return Object.assign(Object.assign({},i),{blobBody:e.blobBody,readableStreamBody:e.readableStreamBody});const c="Composite"===s&&o.type.modelProperties||{},A=Object.keys(c).some((e=>""===c[e].serializedName));if("Sequence"===s||A){const t=null!==(r=e.parsedBody)&&void 0!==r?r:[];for(const r of Object.keys(c))c[r].serializedName&&(t[r]=null===(n=e.parsedBody)||void 0===n?void 0:n[r]);if(i)for(const e of Object.keys(i))t[e]=i[e];return!a||e.parsedBody||i||0!==Object.getOwnPropertyNames(c).length?t:null}return function(e){const t=Object.assign(Object.assign({},e.headers),e.body);return e.hasNullableType&&0===Object.getOwnPropertyNames(t).length?e.shouldWrapBody?{body:null}:null:e.shouldWrapBody?Object.assign(Object.assign({},e.headers),{body:e.body}):t}({body:e.parsedBody,headers:i,hasNullableType:a,shouldWrapBody:(u=e.parsedBody,l=s,"Composite"!==l&&"Dictionary"!==l&&("string"==typeof u||"number"==typeof u||"boolean"==typeof u||null!==(null==l?void 0:l.match(/^(Date|DateTime|DateTimeRfc1123|UnixTime|ByteArray|Base64Url)$/i))||null==u))});var u,l}class mi{constructor(e={},t=!1){this.modelMappers=e,this.isXML=t}validateConstraints(e,t,r){const n=(e,n)=>{throw new Error(`"${r}" with value "${t}" should satisfy the constraint "${e}": ${n}.`)};if(e.constraints&&null!=t){const{ExclusiveMaximum:r,ExclusiveMinimum:i,InclusiveMaximum:o,InclusiveMinimum:a,MaxItems:s,MaxLength:c,MinItems:A,MinLength:u,MultipleOf:l,Pattern:d,UniqueItems:p}=e.constraints;if(void 0!==r&&t>=r&&n("ExclusiveMaximum",r),void 0!==i&&t<=i&&n("ExclusiveMinimum",i),void 0!==o&&t>o&&n("InclusiveMaximum",o),void 0!==a&&t<a&&n("InclusiveMinimum",a),void 0!==s&&t.length>s&&n("MaxItems",s),void 0!==c&&t.length>c&&n("MaxLength",c),void 0!==A&&t.length<A&&n("MinItems",A),void 0!==u&&t.length<u&&n("MinLength",u),void 0!==l&&t%l!=0&&n("MultipleOf",l),d){const e="string"==typeof d?new RegExp(d):d;"string"==typeof t&&null!==t.match(e)||n("Pattern",d)}p&&t.some(((e,t,r)=>r.indexOf(e)!==t))&&n("UniqueItems",p)}}serialize(e,t,r,n={xml:{}}){var i,o,a;const s={xml:{rootName:null!==(i=n.xml.rootName)&&void 0!==i?i:"",includeRoot:null!==(o=n.xml.includeRoot)&&void 0!==o&&o,xmlCharKey:null!==(a=n.xml.xmlCharKey)&&void 0!==a?a:li}};let c={};const A=e.type.name;r||(r=e.serializedName),null!==A.match(/^Sequence$/i)&&(c=[]),e.isConstant&&(t=e.defaultValue);const{required:u,nullable:l}=e;if(u&&l&&void 0===t)throw new Error(`${r} cannot be undefined.`);if(u&&!l&&null==t)throw new Error(`${r} cannot be null or undefined.`);if(!u&&!1===l&&null===t)throw new Error(`${r} cannot be null.`);return null==t?c=t:(this.validateConstraints(e,t,r),null!==A.match(/^any$/i)?c=t:null!==A.match(/^(Number|String|Boolean|Object|Stream|Uuid)$/i)?c=function(e,t,r){if(null!=r)if(null!==e.match(/^Number$/i)){if("number"!=typeof r)throw new Error(`${t} with value ${r} must be of type number.`)}else if(null!==e.match(/^String$/i)){if("string"!=typeof r.valueOf())throw new Error(`${t} with value "${r}" must be of type string.`)}else if(null!==e.match(/^Uuid$/i)){if("string"!=typeof r.valueOf()||(n=r,!fi.test(n)))throw new Error(`${t} with value "${r}" must be of type string and a valid uuid.`)}else if(null!==e.match(/^Boolean$/i)){if("boolean"!=typeof r)throw new Error(`${t} with value ${r} must be of type boolean.`)}else if(null!==e.match(/^Stream$/i)&&!("string"==typeof r||"function"==typeof r.pipe||r instanceof ArrayBuffer||ArrayBuffer.isView(r)||("function"==typeof Blob||"object"==typeof Blob)&&r instanceof Blob))throw new Error(`${t} must be a string, Blob, ArrayBuffer, ArrayBufferView, or NodeJS.ReadableStream.`);var n;return r}(A,r,t):null!==A.match(/^Enum$/i)?c=function(e,t,r){if(!t)throw new Error(`Please provide a set of allowedValues to validate ${e} as an Enum Type.`);if(!t.some((e=>"string"==typeof e.valueOf()?e.toLowerCase()===r.toLowerCase():e===r)))throw new Error(`${r} is not a valid value for ${e}. The valid values are: ${JSON.stringify(t)}.`);return r}(r,e.type.allowedValues,t):null!==A.match(/^(Date|DateTime|TimeSpan|DateTimeRfc1123|UnixTime)$/i)?c=function(e,t,r){if(null!=t)if(null!==e.match(/^Date$/i)){if(!(t instanceof Date||"string"==typeof t.valueOf()&&!isNaN(Date.parse(t))))throw new Error(`${r} must be an instanceof Date or a string in ISO8601 format.`);t=t instanceof Date?t.toISOString().substring(0,10):new Date(t).toISOString().substring(0,10)}else if(null!==e.match(/^DateTime$/i)){if(!(t instanceof Date||"string"==typeof t.valueOf()&&!isNaN(Date.parse(t))))throw new Error(`${r} must be an instanceof Date or a string in ISO8601 format.`);t=t instanceof Date?t.toISOString():new Date(t).toISOString()}else if(null!==e.match(/^DateTimeRfc1123$/i)){if(!(t instanceof Date||"string"==typeof t.valueOf()&&!isNaN(Date.parse(t))))throw new Error(`${r} must be an instanceof Date or a string in RFC-1123 format.`);t=t instanceof Date?t.toUTCString():new Date(t).toUTCString()}else if(null!==e.match(/^UnixTime$/i)){if(!(t instanceof Date||"string"==typeof t.valueOf()&&!isNaN(Date.parse(t))))throw new Error(`${r} must be an instanceof Date or a string in RFC-1123/ISO8601 format for it to be serialized in UnixTime/Epoch format.`);t=function(e){if(e)return"string"==typeof e.valueOf()&&(e=new Date(e)),Math.floor(e.getTime()/1e3)}(t)}else if(null!==e.match(/^TimeSpan$/i)&&!function(e){return hi.test(e)}(t))throw new Error(`${r} must be a string in ISO 8601 format. Instead was "${t}".`);return t}(A,t,r):null!==A.match(/^ByteArray$/i)?c=function(e,t){if(null!=t){if(!(t instanceof Uint8Array))throw new Error(`${e} must be of type Uint8Array.`);t=di(t)}return t}(r,t):null!==A.match(/^Base64Url$/i)?c=function(e,t){if(null!=t){if(!(t instanceof Uint8Array))throw new Error(`${e} must be of type Uint8Array.`);t=function(e){if(e){if(!(e instanceof Uint8Array))throw new Error("Please provide an input of type Uint8Array for converting to Base64Url.");return function(e,t){let r=e.length;for(;r-1>=0&&"="===e[r-1];)--r;return e.substr(0,r)}(di(e)).replace(/\+/g,"-").replace(/\//g,"_")}}(t)}return t}(r,t):null!==A.match(/^Sequence$/i)?c=function(e,t,r,n,i,o){var a;if(!Array.isArray(r))throw new Error(`${n} must be of type Array.`);let s=t.type.element;if(!s||"object"!=typeof s)throw new Error(`element" metadata for an Array must be defined in the mapper and it must of type "object" in ${n}.`);"Composite"===s.type.name&&s.type.className&&(s=null!==(a=e.modelMappers[s.type.className])&&void 0!==a?a:s);const c=[];for(let t=0;t<r.length;t++){const a=e.serialize(s,r[t],n,o);if(i&&s.xmlNamespace){const e=s.xmlNamespacePrefix?`xmlns:${s.xmlNamespacePrefix}`:"xmlns";"Composite"===s.type.name?(c[t]=Object.assign({},a),c[t][ui]={[e]:s.xmlNamespace}):(c[t]={},c[t][o.xml.xmlCharKey]=a,c[t][ui]={[e]:s.xmlNamespace})}else c[t]=a}return c}(this,e,t,r,Boolean(this.isXML),s):null!==A.match(/^Dictionary$/i)?c=function(e,t,r,n,i,o){if("object"!=typeof r)throw new Error(`${n} must be of type object.`);const a=t.type.value;if(!a||"object"!=typeof a)throw new Error(`"value" metadata for a Dictionary must be defined in the mapper and it must of type "object" in ${n}.`);const s={};for(const t of Object.keys(r)){const c=e.serialize(a,r[t],n,o);s[t]=Bi(a,c,i,o)}if(i&&t.xmlNamespace){const e=t.xmlNamespacePrefix?`xmlns:${t.xmlNamespacePrefix}`:"xmlns",r=s;return r[ui]={[e]:t.xmlNamespace},r}return s}(this,e,t,r,Boolean(this.isXML),s):null!==A.match(/^Composite$/i)&&(c=function(e,t,r,n,i,o){if(vi(e,t)&&(t=Qi(e,t,r,"clientName")),null!=r){const a={},s=Ei(e,t,n);for(const c of Object.keys(s)){const A=s[c];if(A.readOnly)continue;let u,l=a;if(e.isXML)u=A.xmlIsWrapped?A.xmlName:A.xmlElementName||A.xmlName;else{const e=Ii(A.serializedName);u=e.pop();for(const t of e){null==l[t]&&(void 0!==r[c]&&null!==r[c]||void 0!==A.defaultValue)&&(l[t]={}),l=l[t]}}if(null!=l){if(i&&t.xmlNamespace){const e=t.xmlNamespacePrefix?`xmlns:${t.xmlNamespacePrefix}`:"xmlns";l[ui]=Object.assign(Object.assign({},l[ui]),{[e]:t.xmlNamespace})}const a=""!==A.serializedName?n+"."+A.serializedName:n;let s=r[c];const d=vi(e,t);d&&d.clientName===c&&null==s&&(s=t.serializedName);const p=e.serialize(A,s,a,o);if(void 0!==p&&null!=u){const e=Bi(A,p,i,o);i&&A.xmlIsAttribute?(l[ui]=l[ui]||{},l[ui][u]=p):i&&A.xmlIsWrapped?l[u]={[A.xmlElementName]:e}:l[u]=e}}}const c=function(e,t,r){const n=t.type.additionalProperties;if(!n&&t.type.className){const n=Ci(e,t,r);return null==n?void 0:n.type.additionalProperties}return n}(e,t,n);if(c){const t=Object.keys(s);for(const i in r)t.every((e=>e!==i))&&(a[i]=e.serialize(c,r[i],n+'["'+i+'"]',o))}return a}return r}(this,e,t,r,Boolean(this.isXML),s))),c}deserialize(e,t,r,n={xml:{}}){var i,o,a;const s={xml:{rootName:null!==(i=n.xml.rootName)&&void 0!==i?i:"",includeRoot:null!==(o=n.xml.includeRoot)&&void 0!==o&&o,xmlCharKey:null!==(a=n.xml.xmlCharKey)&&void 0!==a?a:li}};if(null==t)return this.isXML&&"Sequence"===e.type.name&&!e.xmlIsWrapped&&(t=[]),void 0!==e.defaultValue&&(t=e.defaultValue),t;let c;const A=e.type.name;if(r||(r=e.serializedName),null!==A.match(/^Composite$/i))c=function(e,t,r,n,i){var o;vi(e,t)&&(t=Qi(e,t,r,"serializedName"));const a=Ei(e,t,n);let s={};const c=[];for(const A of Object.keys(a)){const u=a[A],l=Ii(a[A].serializedName);c.push(l[0]);const{serializedName:d,xmlName:p,xmlElementName:h}=u;let f=n;""!==d&&void 0!==d&&(f=n+"."+d);const g=u.headerCollectionPrefix;if(g){const t={};for(const n of Object.keys(r))n.startsWith(g)&&(t[n.substring(g.length)]=e.deserialize(u.type.value,r[n],f,i)),c.push(n);s[A]=t}else if(e.isXML)if(u.xmlIsAttribute&&r[ui])s[A]=e.deserialize(u,r[ui][p],f,i);else{const t=h||p||d;if(u.xmlIsWrapped){const t=r[p],n=null!==(o=null==t?void 0:t[h])&&void 0!==o?o:[];s[A]=e.deserialize(u,n,f,i)}else{const n=r[t];s[A]=e.deserialize(u,n,f,i)}}else{let n,o=r;for(const e of l){if(!o)break;o=o[e]}n=o;const c=t.type.polymorphicDiscriminator;let d;if(c&&A===c.clientName&&null==n&&(n=t.serializedName),Array.isArray(r[A])&&""===a[A].serializedName){n=r[A];const t=e.deserialize(u,n,f,i);for(const[e,r]of Object.entries(s))Object.prototype.hasOwnProperty.call(t,e)||(t[e]=r);s=t}else void 0===n&&void 0===u.defaultValue||(d=e.deserialize(u,n,f,i),s[A]=d)}}const A=t.type.additionalProperties;if(A){const t=e=>{for(const t in a)if(Ii(a[t].serializedName)[0]===e)return!1;return!0};for(const o in r)t(o)&&(s[o]=e.deserialize(A,r[o],n+'["'+o+'"]',i))}else if(r)for(const e of Object.keys(r))void 0!==s[e]||c.includes(e)||wi(e,i)||(s[e]=r[e]);return s}(this,e,t,r,s);else{if(this.isXML){const e=s.xml.xmlCharKey;void 0!==t[ui]&&void 0!==t[e]&&(t=t[e])}null!==A.match(/^Number$/i)?(c=parseFloat(t),isNaN(c)&&(c=t)):null!==A.match(/^Boolean$/i)?c="true"===t||"false"!==t&&t:null!==A.match(/^(String|Enum|Object|Stream|Uuid|TimeSpan|any)$/i)?c=t:null!==A.match(/^(Date|DateTime|DateTimeRfc1123)$/i)?c=new Date(t):null!==A.match(/^UnixTime$/i)?c=function(e){if(e)return new Date(1e3*e)}(t):null!==A.match(/^ByteArray$/i)?c=pi(t):null!==A.match(/^Base64Url$/i)?c=function(e){if(e){if(e&&"string"!=typeof e.valueOf())throw new Error("Please provide an input of type string for converting to Uint8Array");return pi(e=e.replace(/-/g,"+").replace(/_/g,"/"))}}(t):null!==A.match(/^Sequence$/i)?c=function(e,t,r,n,i){var o;let a=t.type.element;if(!a||"object"!=typeof a)throw new Error(`element" metadata for an Array must be defined in the mapper and it must of type "object" in ${n}`);if(r){Array.isArray(r)||(r=[r]),"Composite"===a.type.name&&a.type.className&&(a=null!==(o=e.modelMappers[a.type.className])&&void 0!==o?o:a);const t=[];for(let o=0;o<r.length;o++)t[o]=e.deserialize(a,r[o],`${n}[${o}]`,i);return t}return r}(this,e,t,r,s):null!==A.match(/^Dictionary$/i)&&(c=function(e,t,r,n,i){const o=t.type.value;if(!o||"object"!=typeof o)throw new Error(`"value" metadata for a Dictionary must be defined in the mapper and it must of type "object" in ${n}`);if(r){const t={};for(const a of Object.keys(r))t[a]=e.deserialize(o,r[a],n,i);return t}return r}(this,e,t,r,s))}return e.isConstant&&(c=e.defaultValue),c}}function yi(e={},t=!1){return new mi(e,t)}function Ii(e){const t=[];let r="";if(e){const n=e.split(".");for(const e of n)"\\"===e.charAt(e.length-1)?r+=e.substr(0,e.length-1)+".":(r+=e,t.push(r),r="")}return t}function Ci(e,t,r){const n=t.type.className;if(!n)throw new Error(`Class name for model "${r}" is not provided in the mapper "${JSON.stringify(t,void 0,2)}".`);return e.modelMappers[n]}function Ei(e,t,r){let n=t.type.modelProperties;if(!n){const i=Ci(e,t,r);if(!i)throw new Error(`mapper() cannot be null or undefined for model "${t.type.className}".`);if(n=null==i?void 0:i.type.modelProperties,!n)throw new Error(`modelProperties cannot be null or undefined in the mapper "${JSON.stringify(i)}" of type "${t.type.className}" for object "${r}".`)}return n}function Bi(e,t,r,n){if(!r||!e.xmlNamespace)return t;const i={[e.xmlNamespacePrefix?`xmlns:${e.xmlNamespacePrefix}`:"xmlns"]:e.xmlNamespace};if(["Composite"].includes(e.type.name)){if(t[ui])return t;{const e=Object.assign({},t);return e[ui]=i,e}}const o={};return o[n.xml.xmlCharKey]=t,o[ui]=i,o}function wi(e,t){return[ui,t.xml.xmlCharKey].includes(e)}function Qi(e,t,r,n){const i=vi(e,t);if(i){let o=i[n];if(o){"serializedName"===n&&(o=o.replace(/\\/gi,""));const i=r[o];if(null!=i){const r=t.type.uberParent||t.type.className,n=i===r?i:r+"."+i,o=e.modelMappers.discriminators[n];o&&(t=o)}}}return t}function vi(e,t){return t.type.polymorphicDiscriminator||Ni(e,t.type.uberParent)||Ni(e,t.type.className)}function Ni(e,t){return t&&e.modelMappers[t]&&e.modelMappers[t].type.polymorphicDiscriminator}const bi="Sequence",Si="Stream";function xi(e,t,r){let n=t.parameterPath;const i=t.mapper;let o;if("string"==typeof n&&(n=[n]),Array.isArray(n)){if(n.length>0)if(i.isConstant)o=i.defaultValue;else{let t=Ti(e,n);!t.propertyFound&&r&&(t=Ti(r,n));let a=!1;t.propertyFound||(a=i.required||"options"===n[0]&&2===n.length),o=a?i.defaultValue:t.propertyValue}}else{i.required&&(o={});for(const t in n){const a=i.type.modelProperties[t],s=xi(e,{parameterPath:n[t],mapper:a},r);void 0!==s&&(o||(o={}),o[t]=s)}}return o}function Ti(e,t){const r={propertyFound:!1};let n=0;for(;n<t.length;++n){const r=t[n];if(!e||!(r in e))break;e=e[r]}return n===t.length&&(r.propertyValue=e,r.propertyFound=!0),r}const _i=new WeakMap;function Ri(e){let t=_i.get(e);return t||(t={},_i.set(e,t)),t}const Mi=["application/json","text/json"],Di=["application/xml","application/atom+xml"];var Oi=r(8955);const zi=void 0!==Oi&&Oi.env&&Oi.env.DEBUG||void 0;let ki,Pi=[],Ui=[];const Fi=[];zi&&Li(zi);const qi=Object.assign((e=>Hi(e)),{enable:Li,enabled:Gi,disable:function(){const e=ki||"";return Li(""),e},log:function(...e){if(e.length>0){const t=String(e[0]);t.includes(":error")?console.error(...e):t.includes(":warning")?console.warn(...e):t.includes(":info")?console.info(...e):(t.includes(":verbose"),console.debug(...e))}}});function Li(e){ki=e,Pi=[],Ui=[];const t=/\*/g,r=e.split(",").map((e=>e.trim().replace(t,".*?")));for(const e of r)e.startsWith("-")?Ui.push(new RegExp(`^${e.substr(1)}$`)):Pi.push(new RegExp(`^${e}$`));for(const e of Fi)e.enabled=Gi(e.namespace)}function Gi(e){if(e.endsWith("*"))return!0;for(const t of Ui)if(t.test(e))return!1;for(const t of Pi)if(t.test(e))return!0;return!1}function Hi(e){const t=Object.assign((function(...r){t.enabled&&(r.length>0&&(r[0]=`${e} ${r[0]}`),t.log(...r))}),{enabled:Gi(e),destroy:ji,log:qi.log,namespace:e,extend:Yi});return Fi.push(t),t}function ji(){const e=Fi.indexOf(this);return e>=0&&(Fi.splice(e,1),!0)}function Yi(e){const t=Hi(`${this.namespace}:${e}`);return t.log=this.log,t}var $i=qi,Ki=r(8955);const Vi=new Set,Ji=void 0!==Ki&&Ki.env&&Ki.env.AZURE_LOG_LEVEL||void 0;let Wi;const Xi=$i("azure");Xi.log=(...e)=>{$i.log(...e)};const Zi=["verbose","info","warning","error"];Ji&&(oo(Ji)?function(e){if(e&&!oo(e))throw new Error(`Unknown log level '${e}'. Acceptable values: ${Zi.join(",")}`);Wi=e;const t=[];for(const e of Vi)io(e)&&t.push(e.namespace);$i.enable(t.join(","))}(Ji):console.error(`AZURE_LOG_LEVEL set to unknown log level '${Ji}'; logging is not enabled. Acceptable values: ${Zi.join(", ")}.`));const eo={verbose:400,info:300,warning:200,error:100};function to(e){const t=Xi.extend(e);return ro(Xi,t),{error:no(t,"error"),warning:no(t,"warning"),info:no(t,"info"),verbose:no(t,"verbose")}}function ro(e,t){t.log=(...t)=>{e.log(...t)}}function no(e,t){const r=Object.assign(e.extend(t),{level:t});if(ro(e,r),io(r)){const e=$i.disable();$i.enable(e+","+r.namespace)}return Vi.add(r),r}function io(e){return!!(Wi&&eo[e.level]<=eo[Wi])}function oo(e){return Zi.includes(e)}const ao=to("core-rest-pipeline"),so=new Set(["Deserialize","Serialize","Retry","Sign"]);class co{constructor(e){var t;this._policies=[],this._policies=null!==(t=null==e?void 0:e.slice(0))&&void 0!==t?t:[],this._orderedPolicies=void 0}addPolicy(e,t={}){if(t.phase&&t.afterPhase)throw new Error("Policies inside a phase cannot specify afterPhase.");if(t.phase&&!so.has(t.phase))throw new Error(`Invalid phase name: ${t.phase}`);if(t.afterPhase&&!so.has(t.afterPhase))throw new Error(`Invalid afterPhase name: ${t.afterPhase}`);this._policies.push({policy:e,options:t}),this._orderedPolicies=void 0}removePolicy(e){const t=[];return this._policies=this._policies.filter((r=>!(e.name&&r.policy.name===e.name||e.phase&&r.options.phase===e.phase)||(t.push(r.policy),!1))),this._orderedPolicies=void 0,t}sendRequest(e,t){return this.getOrderedPolicies().reduceRight(((e,t)=>r=>t.sendRequest(r,e)),(t=>e.sendRequest(t)))(t)}getOrderedPolicies(){return this._orderedPolicies||(this._orderedPolicies=this.orderPolicies()),this._orderedPolicies}clone(){return new co(this._policies)}static create(){return new co}orderPolicies(){const e=[],t=new Map;function r(e){return{name:e,policies:new Set,hasRun:!1,hasAfterPolicies:!1}}const n=r("Serialize"),i=r("None"),o=r("Deserialize"),a=r("Retry"),s=r("Sign"),c=[n,i,o,a,s];function A(e){return"Retry"===e?a:"Serialize"===e?n:"Deserialize"===e?o:"Sign"===e?s:i}for(const e of this._policies){const r=e.policy,n=e.options,i=r.name;if(t.has(i))throw new Error("Duplicate policy names not allowed in pipeline");const o={policy:r,dependsOn:new Set,dependants:new Set};n.afterPhase&&(o.afterPhase=A(n.afterPhase),o.afterPhase.hasAfterPolicies=!0),t.set(i,o),A(n.phase).policies.add(o)}for(const e of this._policies){const{policy:r,options:n}=e,i=r.name,o=t.get(i);if(!o)throw new Error(`Missing node for policy ${i}`);if(n.afterPolicies)for(const e of n.afterPolicies){const r=t.get(e);r&&(o.dependsOn.add(r),r.dependants.add(o))}if(n.beforePolicies)for(const e of n.beforePolicies){const r=t.get(e);r&&(r.dependsOn.add(o),o.dependants.add(r))}}function u(r){r.hasRun=!0;for(const n of r.policies)if((!n.afterPhase||n.afterPhase.hasRun&&!n.afterPhase.policies.size)&&0===n.dependsOn.size){e.push(n.policy);for(const e of n.dependants)e.dependsOn.delete(n);t.delete(n.policy.name),r.policies.delete(n)}}function l(){for(const e of c){if(u(e),e.policies.size>0&&e!==i)return void(i.hasRun||u(i));e.hasAfterPolicies&&u(i)}}let d=0;for(;t.size>0;){d++;const t=e.length;if(l(),e.length<=t&&d>1)throw new Error("Cannot satisfy policy dependencies due to requirements cycle.")}return e}}const Ao="1.10.0";function uo(e){const t=new Map;t.set("core-rest-pipeline",Ao),function(e){const t=self.navigator;e.set("OS",(t.oscpu||t.platform).replace(" ",""))}(t);const r=function(e){const t=[];for(const[r,n]of e){const e=n?`${r}/${n}`:r;t.push(e)}return t.join(" ")}(t);return e?`${e} ${r}`:r}const lo="x-ms-useragent";new Error("decompressResponsePolicy is not supported in browser environment");class po extends Error{constructor(e){super(e),this.name="AbortError"}}function ho(e,t,r){return new Promise(((n,i)=>{let o,a;const s=()=>i(new po((null==r?void 0:r.abortErrorMsg)?null==r?void 0:r.abortErrorMsg:"The operation was aborted.")),c=()=>{(null==r?void 0:r.abortSignal)&&a&&r.abortSignal.removeEventListener("abort",a)};if(a=()=>(o&&clearTimeout(o),c(),s()),(null==r?void 0:r.abortSignal)&&r.abortSignal.aborted)return s();o=setTimeout((()=>{c(),n(t)}),e),(null==r?void 0:r.abortSignal)&&r.abortSignal.addEventListener("abort",a)}))}function fo(e,t){const r=e.headers.get(t);if(!r)return;const n=Number(r);return Number.isNaN(n)?void 0:n}const go="Retry-After",mo=["retry-after-ms","x-ms-retry-after-ms",go];function yo(e){if(e&&[429,503].includes(e.status))try{for(const t of mo){const r=fo(e,t);if(0===r||r)return r*(t===go?1e3:1)}const t=e.headers.get(go);if(!t)return;const r=Date.parse(t)-Date.now();return Number.isFinite(r)?Math.max(0,r):void 0}catch(e){return}}function Io(e={}){var t,r;const n=null!==(t=e.retryDelayInMs)&&void 0!==t?t:1e3,i=null!==(r=e.maxRetryDelayInMs)&&void 0!==r?r:64e3;let o=n;return{name:"exponentialRetryStrategy",retry({retryCount:t,response:r,responseError:n}){const a=!!(l=n)&&("ETIMEDOUT"===l.code||"ESOCKETTIMEDOUT"===l.code||"ECONNREFUSED"===l.code||"ECONNRESET"===l.code||"ENOENT"===l.code),s=a&&e.ignoreSystemErrors,c=function(e){return Boolean(e&&void 0!==e.status&&(e.status>=500||408===e.status)&&501!==e.status&&505!==e.status)}(r),A=c&&e.ignoreHttpStatusCodes,u=r&&(function(e){return Number.isFinite(yo(e))}(r)||!c);var l;if(u||A||s)return{skipStrategy:!0};if(n&&!a&&!c)return{errorToThrow:n};const d=o*Math.pow(2,t),p=Math.min(i,d);var h,f;return o=p/2+(h=0,f=p/2,h=Math.ceil(h),f=Math.floor(f),Math.floor(Math.random()*(f-h+1))+h),{retryAfterInMs:o}}}}const Co=to("core-rest-pipeline retryPolicy");function Eo(e,t={maxRetries:3}){const r=t.logger||Co;return{name:"retryPolicy",async sendRequest(n,i){var o,a;let s,c,A=-1;e:for(;;){A+=1,s=void 0,c=void 0;try{r.info(`Retry ${A}: Attempting to send request`,n.requestId),s=await i(n),r.info(`Retry ${A}: Received a response from request`,n.requestId)}catch(e){if(r.error(`Retry ${A}: Received an error from request`,n.requestId),c=e,!e||"RestError"!==c.name)throw e;s=c.response}if(null===(o=n.abortSignal)||void 0===o?void 0:o.aborted)throw r.error(`Retry ${A}: Request aborted.`),new po;if(A>=(null!==(a=t.maxRetries)&&void 0!==a?a:3)){if(r.info(`Retry ${A}: Maximum retries reached. Returning the last received response, or throwing the last received error.`),c)throw c;if(s)return s;throw new Error("Maximum retries reached with no response or error to throw")}r.info(`Retry ${A}: Processing ${e.length} retry strategies.`);t:for(const t of e){const e=t.logger||Co;e.info(`Retry ${A}: Processing retry strategy ${t.name}.`);const r=t.retry({retryCount:A,response:s,responseError:c});if(r.skipStrategy){e.info(`Retry ${A}: Skipped.`);continue t}const{errorToThrow:i,retryAfterInMs:o,redirectTo:a}=r;if(i)throw e.error(`Retry ${A}: Retry strategy ${t.name} throws error:`,i),i;if(o||0===o){e.info(`Retry ${A}: Retry strategy ${t.name} retries after ${o}`),await ho(o,void 0,{abortSignal:n.abortSignal});continue e}if(a){e.info(`Retry ${A}: Retry strategy ${t.name} redirects to ${a}`),n.url=a;continue e}}if(c)throw r.info("None of the retry strategies could work with the received error. Throwing it."),c;if(s)return r.info("None of the retry strategies could work with the received response. Returning it."),s}}}}new Error("proxyPolicy is not supported in browser environment");const Bo={span:Symbol.for("@azure/core-tracing span"),namespace:Symbol.for("@azure/core-tracing namespace")};function wo(e={}){let t=new Qo(e.parentContext);return e.span&&(t=t.setValue(Bo.span,e.span)),e.namespace&&(t=t.setValue(Bo.namespace,e.namespace)),t}class Qo{constructor(e){this._contextMap=e instanceof Qo?new Map(e._contextMap):new Map}setValue(e,t){const r=new Qo(this);return r._contextMap.set(e,t),r}getValue(e){return this._contextMap.get(e)}deleteValue(e){const t=new Qo(this);return t._contextMap.delete(e),t}}let vo;function No(){return vo||(vo={createRequestHeaders:()=>({}),parseTraceparentHeader:()=>{},startSpan:(e,t)=>({span:{end:()=>{},isRecording:()=>!1,recordException:()=>{},setAttribute:()=>{},setStatus:()=>{}},tracingContext:wo({parentContext:t.tracingContext})}),withContext(e,t,...r){return t(...r)}}),vo}function bo(e){const t=co.create();return t.addPolicy({name:"formDataPolicy",async sendRequest(e,t){if(e.formData){const t=e.formData,r=new FormData;for(const e of Object.keys(t)){const n=t[e];if(Array.isArray(n))for(const t of n)r.append(e,t);else r.append(e,n)}e.body=r,e.formData=void 0;const n=e.headers.get("Content-Type");n&&-1!==n.indexOf("application/x-www-form-urlencoded")?e.body=new URLSearchParams(r).toString():n&&-1!==n.indexOf("multipart/form-data")&&e.headers.delete("Content-Type")}return t(e)}}),t.addPolicy(function(e={}){const t=uo(e.userAgentPrefix);return{name:"userAgentPolicy",async sendRequest(e,r){return e.headers.has(lo)||e.headers.set(lo,t),r(e)}}}(e.userAgentOptions)),t.addPolicy(function(e="x-ms-client-request-id"){return{name:"setClientRequestIdPolicy",async sendRequest(t,r){return t.headers.has(e)||t.headers.set(e,t.requestId),r(t)}}}()),t.addPolicy(function(e={}){var t;return{name:"defaultRetryPolicy",sendRequest:Eo([{name:"throttlingRetryStrategy",retry({response:e}){const t=yo(e);return Number.isFinite(t)?{retryAfterInMs:t}:{skipStrategy:!0}}},Io(e)],{maxRetries:null!==(t=e.maxRetries)&&void 0!==t?t:3}).sendRequest}}(e.retryOptions),{phase:"Retry"}),t.addPolicy(function(e={}){const t=uo(e.userAgentPrefix),r=function(){try{return function(e){const{namespace:t,packageName:r,packageVersion:n}=e;function i(e,i,o){var a;const s=No().startSpan(e,Object.assign(Object.assign({},o),{packageName:r,packageVersion:n,tracingContext:null===(a=null==i?void 0:i.tracingOptions)||void 0===a?void 0:a.tracingContext}));let c=s.tracingContext;const A=s.span;return c.getValue(Bo.namespace)||(c=c.setValue(Bo.namespace,t)),A.setAttribute("az.namespace",c.getValue(Bo.namespace)),{span:A,updatedOptions:Object.assign({},i,{tracingOptions:Object.assign(Object.assign({},null==i?void 0:i.tracingOptions),{tracingContext:c})})}}function o(e,t,...r){return No().withContext(e,t,...r)}return{startSpan:i,withSpan:async function(e,t,r,n){const{span:a,updatedOptions:s}=i(e,t,n);try{const e=await o(s.tracingOptions.tracingContext,(()=>Promise.resolve(r(s,a))));return a.setStatus({status:"success"}),e}catch(e){throw a.setStatus({status:"error",error:e}),e}finally{a.end()}},withContext:o,parseTraceparentHeader:function(e){return No().parseTraceparentHeader(e)},createRequestHeaders:function(e){return No().createRequestHeaders(e)}}}({namespace:"",packageName:"@azure/core-rest-pipeline",packageVersion:Ao})}catch(e){return void ao.warning(`Error when creating the TracingClient: ${lt(e)}`)}}();return{name:"tracingPolicy",async sendRequest(e,n){var i,o;if(!r||!(null===(i=e.tracingOptions)||void 0===i?void 0:i.tracingContext))return n(e);const{span:a,tracingContext:s}=null!==(o=function(e,t,r){try{const{span:n,updatedOptions:i}=e.startSpan(`HTTP ${t.method}`,{tracingOptions:t.tracingOptions},{spanKind:"client",spanAttributes:{"http.method":t.method,"http.url":t.url,requestId:t.requestId}});if(!n.isRecording())return void n.end();r&&n.setAttribute("http.user_agent",r);const o=e.createRequestHeaders(i.tracingOptions.tracingContext);for(const[e,r]of Object.entries(o))t.headers.set(e,r);return{span:n,tracingContext:i.tracingOptions.tracingContext}}catch(e){return void ao.warning(`Skipping creating a tracing span due to an error: ${lt(e)}`)}}(r,e,t))&&void 0!==o?o:{};if(!a||!s)return n(e);try{const t=await r.withContext(s,n,e);return function(e,t){try{e.setAttribute("http.status_code",t.status);const r=t.headers.get("x-ms-request-id");r&&e.setAttribute("serviceRequestId",r),e.setStatus({status:"success"}),e.end()}catch(e){ao.warning(`Skipping tracing span processing due to an error: ${lt(e)}`)}}(a,t),t}catch(e){throw function(e,t){try{e.setStatus({status:"error",error:ut(t)?t:void 0}),((r=t)instanceof yt||ut(r)&&"RestError"===r.name)&&t.statusCode&&e.setAttribute("http.status_code",t.statusCode),e.end()}catch(r){ao.warning(`Skipping tracing span processing due to an error: ${lt(r)}`)}var r}(a,e),e}}}}(e.userAgentOptions),{afterPhase:"Retry"}),t.addPolicy(function(e={}){var t;const r=null!==(t=e.logger)&&void 0!==t?t:ao.info,n=new gt({additionalAllowedHeaderNames:e.additionalAllowedHeaderNames,additionalAllowedQueryParameters:e.additionalAllowedQueryParameters});return{name:"logPolicy",async sendRequest(e,t){if(!r.enabled)return t(e);r(`Request: ${n.sanitize(e)}`);const i=await t(e);return r(`Response status code: ${i.status}`),r(`Headers: ${n.sanitize(i.headers)}`),i}}}(e.loggingOptions),{afterPhase:"Sign"}),t}const So={forcedRefreshWindowInMs:1e3,retryIntervalInMs:3e3,refreshWindowInMs:12e4};const xo="bearerTokenAuthenticationPolicy";async function To(e){const{scopes:t,getAccessToken:r,request:n}=e,i={abortSignal:n.abortSignal,tracingOptions:n.tracingOptions},o=await r(t,i);o&&e.request.headers.set("Authorization",`Bearer ${o.token}`)}function _o(e){var t;const{credential:r,scopes:n,challengeCallbacks:i}=e,o=e.logger||ao,a=Object.assign({authorizeRequest:null!==(t=null==i?void 0:i.authorizeRequest)&&void 0!==t?t:To,authorizeRequestOnChallenge:null==i?void 0:i.authorizeRequestOnChallenge},i),s=r?function(e,t){let r,n=null,i=null;const o=Object.assign(Object.assign({},So),t),a={get isRefreshing(){return null!==n},get shouldRefresh(){var e;return!a.isRefreshing&&(null!==(e=null==i?void 0:i.expiresOnTimestamp)&&void 0!==e?e:0)-o.refreshWindowInMs<Date.now()},get mustRefresh(){return null===i||i.expiresOnTimestamp-o.forcedRefreshWindowInMs<Date.now()}};function s(t,s){var c;return a.isRefreshing||(n=async function(e,t,r){async function n(){if(!(Date.now()<r)){const t=await e();if(null===t)throw new Error("Failed to refresh access token.");return t}try{return await e()}catch(e){return null}}let i=await n();for(;null===i;)await ho(t),i=await n();return i}((()=>e.getToken(t,s)),o.retryIntervalInMs,null!==(c=null==i?void 0:i.expiresOnTimestamp)&&void 0!==c?c:Date.now()).then((e=>(n=null,i=e,r=s.tenantId,i))).catch((e=>{throw n=null,i=null,r=void 0,e}))),n}return async(e,t)=>r!==t.tenantId||Boolean(t.claims)||a.mustRefresh?s(e,t):(a.shouldRefresh&&s(e,t),i)}(r):()=>Promise.resolve(null);return{name:xo,async sendRequest(e,t){if(!e.url.toLowerCase().startsWith("https://"))throw new Error("Bearer token authentication is not permitted for non-TLS protected (non-https) URLs.");let r,i;await a.authorizeRequest({scopes:Array.isArray(n)?n:[n],request:e,getAccessToken:s,logger:o});try{r=await t(e)}catch(e){i=e,r=e.response}if(a.authorizeRequestOnChallenge&&401===(null==r?void 0:r.status)&&function(e){const t=e.headers.get("WWW-Authenticate");if(401===e.status&&t)return t}(r)&&await a.authorizeRequestOnChallenge({scopes:Array.isArray(n)?n:[n],request:e,response:r,getAccessToken:s,logger:o}))return t(e);if(i)throw i;return r}}}function Ro(e){const{parameterPath:t,mapper:r}=e;let n;return n="string"==typeof t?t:Array.isArray(t)?t.join("."):r.serializedName,n}function Mo(e){return Boolean(e&&"function"==typeof e.getReader&&"function"==typeof e.tee)}class Do{async sendRequest(e){if("https:"!==new URL(e.url).protocol&&!e.allowInsecureConnection)throw new Error(`Cannot connect to ${e.url} while allowInsecureConnection is false.`);if(e.proxySettings)throw new Error("HTTP proxy is not supported in browser environment");try{return await async function(e){const{abortController:t,abortControllerCleanup:r}=function(e){const t=new AbortController;let r,n;if(e.abortSignal){if(e.abortSignal.aborted)throw new po("The operation was aborted.");n=e=>{"abort"===e.type&&t.abort()},e.abortSignal.addEventListener("abort",n),r=()=>{var t;n&&(null===(t=e.abortSignal)||void 0===t||t.removeEventListener("abort",n))}}return e.timeout>0&&setTimeout((()=>{t.abort()}),e.timeout),{abortController:t,abortControllerCleanup:r}}(e);try{const n=function(e){const t=new Headers;for(const[r,n]of e)t.append(r,n);return t}(e.headers),i=function(e){const t="function"==typeof e.body?e.body():e.body;if(function(e){return e&&"function"==typeof e.pipe}(t))throw new Error("Node streams are not supported in browser environment.");return Mo(t)?Oo(t,e.onUploadProgress):t}(e);return async function(e,t){var r,n;const i=function(e){const t=ei();for(const[r,n]of e.headers)t.set(r,n);return t}(e),o={request:t,headers:i,status:e.status},a=Mo(e.body)?Oo(e.body,t.onDownloadProgress):e.body;if((null===(r=t.streamResponseStatusCodes)||void 0===r?void 0:r.has(Number.POSITIVE_INFINITY))||(null===(n=t.streamResponseStatusCodes)||void 0===n?void 0:n.has(o.status)))if(t.enableBrowserStreams)o.browserStreamBody=null!=a?a:void 0;else{const e=new Response(a);o.blobBody=e.blob()}else{const e=new Response(a);o.bodyAsText=await e.text()}return o}(await fetch(e.url,{body:i,method:e.method,headers:n,signal:t.signal,credentials:e.withCredentials?"include":"same-origin",cache:"no-store"}),e)}finally{r&&r()}}(e)}catch(t){throw function(e,t){var r;return e&&"AbortError"===(null==e?void 0:e.name)?e:new yt(`Error sending request: ${e.message}`,{code:null!==(r=null==e?void 0:e.code)&&void 0!==r?r:yt.REQUEST_SEND_ERROR,request:t})}(t,e)}}}function Oo(e,t){let r=0;if(function(e){return void 0!==e.pipeThrough&&void 0!==self.TransformStream}(e))return e.pipeThrough(new TransformStream({transform(e,n){null!==e?(n.enqueue(e),r+=e.length,t&&t({loadedBytes:r})):n.terminate()}}));{const n=e.getReader();return new ReadableStream({async pull(e){var i;const{done:o,value:a}=await n.read();if(o||!a)return e.close(),void n.releaseLock();r+=null!==(i=null==a?void 0:a.length)&&void 0!==i?i:0,e.enqueue(a),t&&t({loadedBytes:r})}})}}let zo;const ko={CSV:",",SSV:" ",Multi:"Multi",TSV:"\t",Pipes:"|"};function Po(e,t,r,n){const i=function(e,t,r){var n;const i=new Map;if(null===(n=e.urlParameters)||void 0===n?void 0:n.length)for(const n of e.urlParameters){let o=xi(t,n,r);const a=Ro(n);o=e.serializer.serialize(n.mapper,o,a),n.skipEncoding||(o=encodeURIComponent(o)),i.set(`{${n.mapper.serializedName||a}}`,o)}return i}(t,r,n);let o=!1,a=Uo(e,i);if(t.path){let e=Uo(t.path,i);"/{nextLink}"===t.path&&e.startsWith("/")&&(e=e.substring(1)),e.includes("://")?(a=e,o=!0):a=function(e,t){if(!t)return e;const r=new URL(e);let n=r.pathname;n.endsWith("/")||(n=`${n}/`),t.startsWith("/")&&(t=t.substring(1));const i=t.indexOf("?");if(-1!==i){const e=t.substring(0,i),o=t.substring(i+1);n+=e,o&&(r.search=r.search?`${r.search}&${o}`:o)}else n+=t;return r.pathname=n,r.toString()}(a,e)}const{queryParams:s,sequenceParams:c}=function(e,t,r){var n;const i=new Map,o=new Set;if(null===(n=e.queryParameters)||void 0===n?void 0:n.length)for(const n of e.queryParameters){"Sequence"===n.mapper.type.name&&n.mapper.serializedName&&o.add(n.mapper.serializedName);let a=xi(t,n,r);if(null!=a||n.mapper.required){a=e.serializer.serialize(n.mapper,a,Ro(n));const t=n.collectionFormat?ko[n.collectionFormat]:"";if(Array.isArray(a)&&(a=a.map((e=>null==e?"":e))),"Multi"===n.collectionFormat&&0===a.length)continue;!Array.isArray(a)||"SSV"!==n.collectionFormat&&"TSV"!==n.collectionFormat||(a=a.join(t)),n.skipEncoding||(a=Array.isArray(a)?a.map((e=>encodeURIComponent(e))):encodeURIComponent(a)),!Array.isArray(a)||"CSV"!==n.collectionFormat&&"Pipes"!==n.collectionFormat||(a=a.join(t)),i.set(n.mapper.serializedName||Ro(n),a)}}return{queryParams:i,sequenceParams:o}}(t,r,n);return a=function(e,t,r,n=!1){if(0===t.size)return e;const i=new URL(e),o=function(e){const t=new Map;if(!e||"?"!==e[0])return t;const r=(e=e.slice(1)).split("&");for(const e of r){const[r,n]=e.split("=",2),i=t.get(r);i?Array.isArray(i)?i.push(n):t.set(r,[i,n]):t.set(r,n)}return t}(i.search);for(const[e,i]of t){const t=o.get(e);if(Array.isArray(t))if(Array.isArray(i)){t.push(...i);const r=new Set(t);o.set(e,Array.from(r))}else t.push(i);else t?(Array.isArray(i)?i.unshift(t):r.has(e)&&o.set(e,[t,i]),n||o.set(e,i)):o.set(e,i)}const a=[];for(const[e,t]of o)if("string"==typeof t)a.push(`${e}=${t}`);else if(Array.isArray(t))for(const r of t)a.push(`${e}=${r}`);else a.push(`${e}=${t}`);return i.search=a.length?`?${a.join("&")}`:"",i.toString()}(a,s,c,o),a}function Uo(e,t){let r=e;for(const[e,n]of t)r=r.split(e).join(n);return r}const Fo=to("core-client");class qo{constructor(e={}){var t,r;if(this._requestContentType=e.requestContentType,this._endpoint=null!==(t=e.endpoint)&&void 0!==t?t:e.baseUri,e.baseUri&&Fo.warning("The baseUri option for SDK Clients has been deprecated, please use endpoint instead."),this._allowInsecureConnection=e.allowInsecureConnection,this._httpClient=e.httpClient||(zo||(zo=new Do),zo),this.pipeline=e.pipeline||function(e){const t=function(e){if(e.credentialScopes){const t=e.credentialScopes;return Array.isArray(t)?t.map((e=>new URL(e).toString())):new URL(t).toString()}if(e.endpoint)return`${e.endpoint}/.default`;if(e.baseUri)return`${e.baseUri}/.default`;if(e.credential&&!e.credentialScopes)throw new Error("When using credentials, the ServiceClientOptions must contain either a endpoint or a credentialScopes. Unable to create a bearerTokenAuthenticationPolicy")}(e),r=e.credential&&t?{credentialScopes:t,credential:e.credential}:void 0;return function(e={}){const t=bo(null!=e?e:{});return e.credentialOptions&&t.addPolicy(_o({credential:e.credentialOptions.credential,scopes:e.credentialOptions.credentialScopes})),t.addPolicy(function(e={}){const t=e.stringifyXML;return{name:"serializationPolicy",async sendRequest(e,r){const n=Ri(e),i=null==n?void 0:n.operationSpec,o=null==n?void 0:n.operationArguments;return i&&o&&(function(e,t,r){var n,i;if(r.headerParameters)for(const n of r.headerParameters){let i=xi(t,n);if(null!=i||n.mapper.required){i=r.serializer.serialize(n.mapper,i,Ro(n));const t=n.mapper.headerCollectionPrefix;if(t)for(const r of Object.keys(i))e.headers.set(t+r,i[r]);else e.headers.set(n.mapper.serializedName||Ro(n),i)}}const o=null===(i=null===(n=t.options)||void 0===n?void 0:n.requestOptions)||void 0===i?void 0:i.customHeaders;if(o)for(const t of Object.keys(o))e.headers.set(t,o[t])}(e,o,i),function(e,t,r,n=function(){throw new Error("XML serialization unsupported!")}){var i,o,a,s,c;const A=null===(i=t.options)||void 0===i?void 0:i.serializerOptions,u={xml:{rootName:null!==(o=null==A?void 0:A.xml.rootName)&&void 0!==o?o:"",includeRoot:null!==(a=null==A?void 0:A.xml.includeRoot)&&void 0!==a&&a,xmlCharKey:null!==(s=null==A?void 0:A.xml.xmlCharKey)&&void 0!==s?s:li}},l=u.xml.xmlCharKey;if(r.requestBody&&r.requestBody.mapper){e.body=xi(t,r.requestBody);const i=r.requestBody.mapper,{required:o,serializedName:a,xmlName:s,xmlElementName:A,xmlNamespace:d,xmlNamespacePrefix:p,nullable:h}=i,f=i.type.name;try{if(void 0!==e.body&&null!==e.body||h&&null===e.body||o){const t=Ro(r.requestBody);e.body=r.serializer.serialize(i,e.body,t,u);const o=f===Si;if(r.isXML){const t=p?`xmlns:${p}`:"xmlns",r=function(e,t,r,n,i){if(e&&!["Composite","Sequence","Dictionary"].includes(r)){const r={};return r[i.xml.xmlCharKey]=n,r[ui]={[t]:e},r}return n}(d,t,f,e.body,u);f===bi?e.body=n(function(e,t,r,n){if(Array.isArray(e)||(e=[e]),!r||!n)return{[t]:e};const i={[t]:e};return i[ui]={[r]:n},i}(r,A||s||a,t,d),{rootName:s||a,xmlCharKey:l}):o||(e.body=n(r,{rootName:s||a,xmlCharKey:l}))}else{if("String"===f&&((null===(c=r.contentType)||void 0===c?void 0:c.match("text/plain"))||"text"===r.mediaType))return;o||(e.body=JSON.stringify(e.body))}}}catch(e){throw new Error(`Error "${e.message}" occurred in serializing the payload - ${JSON.stringify(a,void 0," ")}.`)}}else if(r.formDataParameters&&r.formDataParameters.length>0){e.formData={};for(const n of r.formDataParameters){const i=xi(t,n);if(null!=i){const t=n.mapper.serializedName||Ro(n);e.formData[t]=r.serializer.serialize(n.mapper,i,Ro(n),u)}}}}(e,o,i,t)),r(e)}}}(e.serializationOptions),{phase:"Serialize"}),t.addPolicy(function(e={}){var t,r,n,i,o,a,s;const c=null!==(r=null===(t=e.expectedContentTypes)||void 0===t?void 0:t.json)&&void 0!==r?r:Mi,A=null!==(i=null===(n=e.expectedContentTypes)||void 0===n?void 0:n.xml)&&void 0!==i?i:Di,u=e.parseXML,l=e.serializerOptions,d={xml:{rootName:null!==(o=null==l?void 0:l.xml.rootName)&&void 0!==o?o:"",includeRoot:null!==(a=null==l?void 0:l.xml.includeRoot)&&void 0!==a&&a,xmlCharKey:null!==(s=null==l?void 0:l.xml.xmlCharKey)&&void 0!==s?s:li}};return{name:"deserializationPolicy",async sendRequest(e,t){const r=await t(e);return async function(e,t,r,n,i){const o=await async function(e,t,r,n,i){var o;if(!(null===(o=r.request.streamResponseStatusCodes)||void 0===o?void 0:o.has(r.status))&&r.bodyAsText){const o=r.bodyAsText,a=r.headers.get("Content-Type")||"",s=a?a.split(";").map((e=>e.toLowerCase())):[];try{if(0===s.length||s.some((t=>-1!==e.indexOf(t))))return r.parsedBody=JSON.parse(o),r;if(s.some((e=>-1!==t.indexOf(e)))){if(!i)throw new Error("Parsing XML not supported.");const e=await i(o,n.xml);return r.parsedBody=e,r}}catch(e){const t=`Error "${e}" occurred while parsing the response body - ${r.bodyAsText}.`,n=e.code||yt.PARSE_ERROR;throw new yt(t,{code:n,statusCode:r.status,request:r.request,response:r})}}return r}(e,t,r,n,i);if(!function(e){const t=Ri(e.request),r=null==t?void 0:t.shouldDeserialize;let n;return n=void 0===r||("boolean"==typeof r?r:r(e)),n}(o))return o;const a=Ri(o.request),s=null==a?void 0:a.operationSpec;if(!s||!s.responses)return o;const c=function(e){let t;const r=Ri(e.request),n=null==r?void 0:r.operationSpec;return n&&(t=(null==r?void 0:r.operationResponseGetter)?null==r?void 0:r.operationResponseGetter(n,e):n.responses[e.status]),t}(o),{error:A,shouldReturnResponse:u}=function(e,t,r){var n;const i=200<=e.status&&e.status<300;if(function(e){const t=Object.keys(e.responses);return 0===t.length||1===t.length&&"default"===t[0]}(t)?i:r){if(!r)return{error:null,shouldReturnResponse:!1};if(!r.isError)return{error:null,shouldReturnResponse:!1}}const o=null!=r?r:t.responses.default,a=(null===(n=e.request.streamResponseStatusCodes)||void 0===n?void 0:n.has(e.status))?`Unexpected status code: ${e.status}`:e.bodyAsText,s=new yt(a,{statusCode:e.status,request:e.request,response:e});if(!o)throw s;const c=o.bodyMapper,A=o.headersMapper;try{if(e.parsedBody){const r=e.parsedBody;let n;if(c){let e=r;if(t.isXML&&c.type.name===bi){e=[];const t=c.xmlElementName;"object"==typeof r&&t&&(e=r[t])}n=t.serializer.deserialize(c,e,"error.response.parsedBody")}const i=r.error||n||r;s.code=i.code,i.message&&(s.message=i.message),c&&(s.response.parsedBody=n)}e.headers&&A&&(s.response.parsedHeaders=t.serializer.deserialize(A,e.headers.toJSON(),"operationRes.parsedHeaders"))}catch(t){s.message=`Error "${t.message}" occurred in deserializing the responseBody - "${e.bodyAsText}" for the default response.`}return{error:s,shouldReturnResponse:!1}}(o,s,c);if(A)throw A;if(u)return o;if(c){if(c.bodyMapper){let e=o.parsedBody;s.isXML&&c.bodyMapper.type.name===bi&&(e="object"==typeof e?e[c.bodyMapper.xmlElementName]:[]);try{o.parsedBody=s.serializer.deserialize(c.bodyMapper,e,"operationRes.parsedBody")}catch(e){throw new yt(`Error ${e} occurred in deserializing the responseBody - ${o.bodyAsText}`,{statusCode:o.status,request:o.request,response:o})}}else"HEAD"===s.httpMethod&&(o.parsedBody=r.status>=200&&r.status<300);c.headersMapper&&(o.parsedHeaders=s.serializer.deserialize(c.headersMapper,o.headers.toJSON(),"operationRes.parsedHeaders"))}return o}(c,A,r,d,u)}}}(e.deserializationOptions),{phase:"Deserialize"}),t}(Object.assign(Object.assign({},e),{credentialOptions:r}))}(e),null===(r=e.additionalPolicies)||void 0===r?void 0:r.length)for(const{policy:t,position:r}of e.additionalPolicies){const e="perRetry"===r?"Sign":void 0;this.pipeline.addPolicy(t,{afterPhase:e})}}async sendRequest(e){return this.pipeline.sendRequest(this._httpClient,e)}async sendOperationRequest(e,t){const r=t.baseUrl||this._endpoint;if(!r)throw new Error("If operationSpec.baseUrl is not specified, then the ServiceClient must have a endpoint string property that contains the base URL to use.");const n=function(e){return new Ai(e)}({url:Po(r,t,e,this)});n.method=t.httpMethod;const i=Ri(n);i.operationSpec=t,i.operationArguments=e;const o=t.contentType||this._requestContentType;o&&t.requestBody&&n.headers.set("Content-Type",o);const a=e.options;if(a){const e=a.requestOptions;e&&(e.timeout&&(n.timeout=e.timeout),e.onUploadProgress&&(n.onUploadProgress=e.onUploadProgress),e.onDownloadProgress&&(n.onDownloadProgress=e.onDownloadProgress),void 0!==e.shouldDeserialize&&(i.shouldDeserialize=e.shouldDeserialize),e.allowInsecureConnection&&(n.allowInsecureConnection=!0)),a.abortSignal&&(n.abortSignal=a.abortSignal),a.tracingOptions&&(n.tracingOptions=a.tracingOptions)}this._allowInsecureConnection&&(n.allowInsecureConnection=!0),void 0===n.streamResponseStatusCodes&&(n.streamResponseStatusCodes=function(e){const t=new Set;for(const r in e.responses){const n=e.responses[r];n.bodyMapper&&n.bodyMapper.type.name===Si&&t.add(Number(r))}return t}(t));try{const e=await this.sendRequest(n),r=gi(e,t.responses[e.status]);return(null==a?void 0:a.onResponse)&&a.onResponse(e,r),r}catch(e){if("object"==typeof e&&(null==e?void 0:e.response)){const r=e.response,n=gi(r,t.responses[e.statusCode]||t.responses.default);e.details=n,(null==a?void 0:a.onResponse)&&a.onResponse(r,n,e)}throw e}}}async function Lo(e){const{scopes:t,response:r}=e,n=e.logger||Fo,i=r.headers.get("WWW-Authenticate");if(!i)return n.info("The WWW-Authenticate header was missing. Failed to perform the Continuous Access Evaluation authentication flow."),!1;const o=function(e){return`, ${e.trim()}`.split(", Bearer ").filter((e=>e)).map((e=>`${e.trim()}, `.split('", ').filter((e=>e)).map((e=>(([e,t])=>({[e]:t}))(e.trim().split('="')))).reduce(((e,t)=>Object.assign(Object.assign({},e),t)),{})))}(i)||[],a=o.find((e=>e.claims));if(!a)return n.info('The WWW-Authenticate header was missing the necessary "claims" to perform the Continuous Access Evaluation authentication flow.'),!1;const s=await e.getAccessToken(a.scope?[a.scope]:t,{claims:(c=a.claims,atob(c))});var c;return!!s&&(e.request.headers.set("Authorization",`Bearer ${s.token}`),!0)}const Go={type:{name:"Composite",className:"Header",modelProperties:{hash:{serializedName:"hash",required:!0,type:{name:"String"}},height:{serializedName:"height",required:!0,type:{name:"String"}},prevHash:{serializedName:"prev_hash",required:!0,type:{name:"String"}},prevKeyHash:{serializedName:"prev_key_hash",required:!0,type:{name:"String"}},stateHash:{serializedName:"state_hash",required:!0,type:{name:"String"}},miner:{serializedName:"miner",type:{name:"String"}},beneficiary:{serializedName:"beneficiary",type:{name:"String"}},target:{serializedName:"target",type:{name:"String"}},pow:{constraints:{MinItems:42,MaxItems:42},serializedName:"pow",type:{name:"Sequence",element:{type:{name:"String"}}}},nonce:{serializedName:"nonce",type:{name:"String"}},time:{serializedName:"time",required:!0,type:{name:"String"}},version:{serializedName:"version",required:!0,type:{name:"String"}},info:{serializedName:"info",type:{name:"String"}},pofHash:{serializedName:"pof_hash",type:{name:"String"}},txsHash:{serializedName:"txs_hash",type:{name:"String"}},signature:{serializedName:"signature",type:{name:"String"}}}}},Ho={type:{name:"Composite",className:"ErrorModel",modelProperties:{reason:{serializedName:"reason",required:!0,type:{name:"String"}}}}},jo={type:{name:"Composite",className:"KeyBlock",modelProperties:{hash:{serializedName:"hash",required:!0,type:{name:"String"}},height:{serializedName:"height",required:!0,type:{name:"String"}},prevHash:{serializedName:"prev_hash",required:!0,type:{name:"String"}},prevKeyHash:{serializedName:"prev_key_hash",required:!0,type:{name:"String"}},stateHash:{serializedName:"state_hash",required:!0,type:{name:"String"}},miner:{serializedName:"miner",required:!0,type:{name:"String"}},beneficiary:{serializedName:"beneficiary",required:!0,type:{name:"String"}},target:{serializedName:"target",required:!0,type:{name:"String"}},pow:{constraints:{MinItems:42,MaxItems:42},serializedName:"pow",type:{name:"Sequence",element:{type:{name:"String"}}}},nonce:{serializedName:"nonce",type:{name:"String"}},time:{serializedName:"time",required:!0,type:{name:"String"}},version:{serializedName:"version",required:!0,type:{name:"String"}},info:{serializedName:"info",required:!0,type:{name:"String"}}}}},Yo={type:{name:"Composite",className:"HashResponse",modelProperties:{hash:{serializedName:"hash",required:!0,type:{name:"String"}}}}},$o={type:{name:"Composite",className:"HeightResponse",modelProperties:{height:{serializedName:"height",required:!0,type:{name:"String"}}}}},Ko={type:{name:"Composite",className:"MicroBlockHeader",modelProperties:{hash:{serializedName:"hash",required:!0,type:{name:"String"}},height:{serializedName:"height",required:!0,type:{name:"String"}},pofHash:{serializedName:"pof_hash",required:!0,type:{name:"String"}},prevHash:{serializedName:"prev_hash",required:!0,type:{name:"String"}},prevKeyHash:{serializedName:"prev_key_hash",required:!0,type:{name:"String"}},stateHash:{serializedName:"state_hash",required:!0,type:{name:"String"}},txsHash:{serializedName:"txs_hash",required:!0,type:{name:"String"}},signature:{serializedName:"signature",required:!0,type:{name:"String"}},time:{serializedName:"time",required:!0,type:{name:"String"}},version:{serializedName:"version",required:!0,type:{name:"String"}}}}},Vo={type:{name:"Composite",className:"SignedTxs",modelProperties:{transactions:{serializedName:"transactions",required:!0,type:{name:"Sequence",element:{type:{name:"Composite",className:"SignedTx"}}}}}}},Jo={type:{name:"Composite",className:"SignedTx",modelProperties:{tx:{serializedName:"tx",type:{name:"Composite",className:"Tx"}},blockHeight:{serializedName:"block_height",required:!0,type:{name:"String"}},blockHash:{serializedName:"block_hash",required:!0,type:{name:"String"}},hash:{serializedName:"hash",required:!0,type:{name:"String"}},signatures:{serializedName:"signatures",required:!0,type:{name:"Sequence",element:{type:{name:"String"}}}}}}},Wo={type:{name:"Composite",className:"Tx",uberParent:"Tx",polymorphicDiscriminator:{serializedName:"type",clientName:"type"},modelProperties:{recipientId:{serializedName:"recipient_id",type:{name:"String"}},amount:{serializedName:"amount",type:{name:"String"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}},senderId:{serializedName:"sender_id",type:{name:"String"}},nonce:{serializedName:"nonce",type:{name:"String"}},payload:{serializedName:"payload",type:{name:"String"}},initiatorId:{serializedName:"initiator_id",type:{name:"String"}},initiatorAmount:{serializedName:"initiator_amount",type:{name:"String"}},responderId:{serializedName:"responder_id",type:{name:"String"}},responderAmount:{serializedName:"responder_amount",type:{name:"String"}},channelReserve:{serializedName:"channel_reserve",type:{name:"String"}},lockPeriod:{serializedName:"lock_period",type:{name:"String"}},stateHash:{serializedName:"state_hash",type:{name:"String"}},delegateIds:{serializedName:"delegate_ids",type:{name:"Composite",className:"Delegates"}},channelId:{serializedName:"channel_id",type:{name:"String"}},fromId:{serializedName:"from_id",type:{name:"String"}},round:{serializedName:"round",type:{name:"String"}},toId:{serializedName:"to_id",type:{name:"String"}},update:{serializedName:"update",type:{name:"Composite",className:"OffChainUpdate"}},offchainTrees:{serializedName:"offchain_trees",type:{name:"String"}},initiatorAmountFinal:{serializedName:"initiator_amount_final",type:{name:"String"}},responderAmountFinal:{serializedName:"responder_amount_final",type:{name:"String"}},poi:{serializedName:"poi",type:{name:"String"}},initiatorDelegateIds:{serializedName:"initiator_delegate_ids",type:{name:"Sequence",element:{type:{name:"String"}}}},responderDelegateIds:{serializedName:"responder_delegate_ids",type:{name:"Sequence",element:{type:{name:"String"}}}},queryFormat:{serializedName:"query_format",type:{name:"String"}},responseFormat:{serializedName:"response_format",type:{name:"String"}},queryFee:{serializedName:"query_fee",type:{name:"String"}},oracleTtl:{serializedName:"oracle_ttl",type:{name:"Composite",className:"RelativeTTL"}},accountId:{serializedName:"account_id",type:{name:"String"}},abiVersion:{serializedName:"abi_version",type:{name:"String"}},oracleId:{serializedName:"oracle_id",type:{name:"String"}},query:{serializedName:"query",type:{name:"String"}},queryTtl:{serializedName:"query_ttl",type:{name:"Composite",className:"Ttl"}},responseTtl:{serializedName:"response_ttl",type:{name:"Composite",className:"RelativeTTL"}},queryId:{serializedName:"query_id",type:{name:"String"}},response:{serializedName:"response",type:{name:"String"}},commitmentId:{serializedName:"commitment_id",type:{name:"String"}},name:{serializedName:"name",type:{name:"String"}},nameSalt:{serializedName:"name_salt",type:{name:"String"}},nameFee:{serializedName:"name_fee",type:{name:"String"}},nameId:{serializedName:"name_id",type:{name:"String"}},nameTtl:{serializedName:"name_ttl",type:{name:"String"}},pointers:{serializedName:"pointers",type:{name:"Sequence",element:{type:{name:"Composite",className:"NamePointer"}}}},clientTtl:{serializedName:"client_ttl",type:{name:"String"}},ownerId:{serializedName:"owner_id",type:{name:"String"}},code:{serializedName:"code",type:{name:"String"}},vmVersion:{serializedName:"vm_version",type:{name:"String"}},deposit:{serializedName:"deposit",type:{name:"String"}},gas:{serializedName:"gas",type:{name:"String"}},gasPrice:{serializedName:"gas_price",type:{name:"String"}},callData:{serializedName:"call_data",type:{name:"String"}},callerId:{serializedName:"caller_id",type:{name:"String"}},contractId:{serializedName:"contract_id",type:{name:"String"}},authFun:{constraints:{Pattern:new RegExp("^(0x|0X)?[a-fA-F0-9]+$")},serializedName:"auth_fun",type:{name:"String"}},gaId:{serializedName:"ga_id",type:{name:"String"}},authData:{serializedName:"auth_data",type:{name:"String"}},tx:{serializedName:"tx",type:{name:"Composite",className:"SignedTx"}},payerId:{serializedName:"payer_id",type:{name:"String"}},version:{serializedName:"version",required:!0,type:{name:"String"}},type:{serializedName:"type",required:!0,type:{name:"Enum",allowedValues:["SpendTx","ChannelCreateTx","ChannelDepositTx","ChannelWithdrawTx","ChannelForceProgressTx","ChannelCloseMutualTx","ChannelCloseSoloTx","ChannelSlashTx","ChannelSettleTx","ChannelSnapshotSoloTx","ChannelSetDelegatesTx","OracleRegisterTx","OracleExtendTx","OracleQueryTx","OracleRespondTx","NamePreclaimTx","NameClaimTx","NameUpdateTx","NameTransferTx","NameRevokeTx","ContractCreateTx","ContractCallTx","GAAttachTx","GAMetaTx","PayingForTx"]}}}}},Xo={type:{name:"Composite",className:"Delegates",modelProperties:{initiator:{serializedName:"initiator",type:{name:"Sequence",element:{type:{name:"String"}}}},responder:{serializedName:"responder",type:{name:"Sequence",element:{type:{name:"String"}}}}}}},Zo={type:{name:"Composite",className:"OffChainUpdate",uberParent:"OffChainUpdate",polymorphicDiscriminator:{serializedName:"op",clientName:"op"},modelProperties:{op:{serializedName:"op",required:!0,type:{name:"String"}}}}},ea={type:{name:"Composite",className:"RelativeTTL",modelProperties:{type:{defaultValue:"delta",isConstant:!0,serializedName:"type",type:{name:"String"}},value:{serializedName:"value",required:!0,type:{name:"String"}}}}},ta={type:{name:"Composite",className:"Ttl",modelProperties:{type:{serializedName:"type",required:!0,type:{name:"Enum",allowedValues:["delta","block"]}},value:{serializedName:"value",required:!0,type:{name:"String"}}}}},ra={type:{name:"Composite",className:"NamePointer",modelProperties:{key:{serializedName:"key",required:!0,type:{name:"String"}},id:{serializedName:"id",required:!0,type:{name:"String"}}}}},na={type:{name:"Composite",className:"CountResponse",modelProperties:{count:{serializedName:"count",required:!0,type:{name:"String"}}}}},ia={type:{name:"Composite",className:"Generation",modelProperties:{keyBlock:{serializedName:"key_block",type:{name:"Composite",className:"KeyBlock"}},microBlocks:{serializedName:"micro_blocks",required:!0,type:{name:"Sequence",element:{type:{name:"String"}}}}}}},oa={type:{name:"Composite",className:"Account",modelProperties:{id:{serializedName:"id",required:!0,type:{name:"String"}},balance:{serializedName:"balance",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",required:!0,type:{name:"String"}},payable:{serializedName:"payable",type:{name:"Boolean"}},kind:{serializedName:"kind",type:{name:"Enum",allowedValues:["basic","generalized"]}},contractId:{serializedName:"contract_id",type:{name:"String"}},authFun:{serializedName:"auth_fun",type:{name:"String"}}}}},aa={type:{name:"Composite",className:"NextNonceResponse",modelProperties:{nextNonce:{serializedName:"next_nonce",required:!0,type:{name:"String"}}}}},sa={type:{name:"Composite",className:"DryRunInput",modelProperties:{top:{serializedName:"top",type:{name:"String"}},accounts:{serializedName:"accounts",type:{name:"Sequence",element:{type:{name:"Composite",className:"DryRunAccount"}}}},txs:{serializedName:"txs",required:!0,type:{name:"Sequence",element:{type:{name:"Composite",className:"DryRunInputItem"}}}},txEvents:{defaultValue:!1,serializedName:"tx_events",type:{name:"Boolean"}}}}},ca={type:{name:"Composite",className:"DryRunAccount",modelProperties:{pubKey:{serializedName:"pub_key",required:!0,type:{name:"String"}},amount:{serializedName:"amount",required:!0,type:{name:"String"}}}}},Aa={type:{name:"Composite",className:"DryRunInputItem",modelProperties:{tx:{serializedName:"tx",type:{name:"String"}},callReq:{serializedName:"call_req",type:{name:"Composite",className:"DryRunCallReq"}}}}},ua={type:{name:"Composite",className:"DryRunCallReq",modelProperties:{calldata:{serializedName:"calldata",required:!0,type:{name:"String"}},contract:{serializedName:"contract",required:!0,type:{name:"String"}},amount:{serializedName:"amount",type:{name:"String"}},gas:{serializedName:"gas",type:{name:"String"}},caller:{serializedName:"caller",type:{name:"String"}},nonce:{serializedName:"nonce",type:{name:"String"}},abiVersion:{serializedName:"abi_version",type:{name:"String"}},context:{serializedName:"context",type:{name:"Composite",className:"DryRunCallContext"}}}}},la={type:{name:"Composite",className:"DryRunCallContext",modelProperties:{tx:{serializedName:"tx",type:{name:"String"}},txHash:{serializedName:"tx_hash",type:{name:"String"}},stateful:{serializedName:"stateful",type:{name:"Boolean"}}}}},da={type:{name:"Composite",className:"DryRunResults",modelProperties:{results:{serializedName:"results",required:!0,type:{name:"Sequence",element:{type:{name:"Composite",className:"DryRunResult"}}}},txEvents:{serializedName:"tx_events",type:{name:"Sequence",element:{type:{name:"Dictionary",value:{type:{name:"any"}}}}}}}}},pa={type:{name:"Composite",className:"DryRunResult",modelProperties:{type:{serializedName:"type",required:!0,type:{name:"String"}},result:{serializedName:"result",required:!0,type:{name:"String"}},reason:{serializedName:"reason",type:{name:"String"}},callObj:{serializedName:"call_obj",type:{name:"Composite",className:"ContractCallObject"}}}}},ha={type:{name:"Composite",className:"ContractCallObject",modelProperties:{callerId:{serializedName:"caller_id",required:!0,type:{name:"String"}},callerNonce:{serializedName:"caller_nonce",required:!0,type:{name:"String"}},height:{serializedName:"height",required:!0,type:{name:"String"}},contractId:{serializedName:"contract_id",required:!0,type:{name:"String"}},gasPrice:{serializedName:"gas_price",required:!0,type:{name:"String"}},gasUsed:{serializedName:"gas_used",required:!0,type:{name:"String"}},log:{serializedName:"log",required:!0,type:{name:"Sequence",element:{type:{name:"Composite",className:"Event"}}}},returnValue:{serializedName:"return_value",required:!0,type:{name:"String"}},returnType:{serializedName:"return_type",required:!0,type:{name:"Enum",allowedValues:["ok","error","revert"]}}}}},fa={type:{name:"Composite",className:"Event",modelProperties:{address:{serializedName:"address",required:!0,type:{name:"String"}},topics:{serializedName:"topics",required:!0,type:{name:"Sequence",element:{type:{name:"String"}}}},data:{serializedName:"data",required:!0,type:{name:"String"}}}}},ga={type:{name:"Composite",className:"TxInfoObject",modelProperties:{callInfo:{serializedName:"call_info",type:{name:"Composite",className:"ContractCallObject"}},gaInfo:{serializedName:"ga_info",type:{name:"Composite",className:"GAObject"}},txInfo:{serializedName:"tx_info",type:{name:"String"}}}}},ma={type:{name:"Composite",className:"GAObject",modelProperties:{callerId:{serializedName:"caller_id",required:!0,type:{name:"String"}},height:{serializedName:"height",required:!0,type:{name:"String"}},gasPrice:{serializedName:"gas_price",required:!0,type:{name:"String"}},gasUsed:{serializedName:"gas_used",required:!0,type:{name:"String"}},returnValue:{serializedName:"return_value",required:!0,type:{name:"String"}},returnType:{serializedName:"return_type",required:!0,type:{name:"Enum",allowedValues:["ok","error"]}},innerObject:{serializedName:"inner_object",type:{name:"Composite",className:"TxInfoObject"}}}}},ya={type:{name:"Composite",className:"EncodedTx",modelProperties:{tx:{serializedName:"tx",required:!0,type:{name:"String"}}}}},Ia={type:{name:"Composite",className:"PostTxResponse",modelProperties:{txHash:{serializedName:"tx_hash",required:!0,type:{name:"String"}}}}},Ca={type:{name:"Composite",className:"ContractObject",modelProperties:{id:{serializedName:"id",required:!0,type:{name:"String"}},ownerId:{serializedName:"owner_id",required:!0,type:{name:"String"}},vmVersion:{serializedName:"vm_version",required:!0,type:{name:"String"}},abiVersion:{serializedName:"abi_version",required:!0,type:{name:"String"}},active:{serializedName:"active",required:!0,type:{name:"Boolean"}},referrerIds:{serializedName:"referrer_ids",required:!0,type:{name:"Sequence",element:{type:{name:"String"}}}},deposit:{serializedName:"deposit",required:!0,type:{name:"String"}}}}},Ea={type:{name:"Composite",className:"ByteCode",modelProperties:{bytecode:{serializedName:"bytecode",required:!0,type:{name:"String"}}}}},Ba={type:{name:"Composite",className:"PoI",modelProperties:{poi:{serializedName:"poi",required:!0,type:{name:"String"}}}}},wa={type:{name:"Composite",className:"RegisteredOracle",modelProperties:{id:{serializedName:"id",required:!0,type:{name:"String"}},queryFormat:{serializedName:"query_format",required:!0,type:{name:"String"}},responseFormat:{serializedName:"response_format",required:!0,type:{name:"String"}},queryFee:{serializedName:"query_fee",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",required:!0,type:{name:"String"}},abiVersion:{serializedName:"abi_version",required:!0,type:{name:"String"}}}}},Qa={type:{name:"Composite",className:"OracleQueries",modelProperties:{oracleQueries:{serializedName:"oracle_queries",required:!0,type:{name:"Sequence",element:{type:{name:"Composite",className:"OracleQuery"}}}}}}},va={type:{name:"Composite",className:"OracleQuery",modelProperties:{id:{serializedName:"id",required:!0,type:{name:"String"}},senderId:{serializedName:"sender_id",required:!0,type:{name:"String"}},senderNonce:{serializedName:"sender_nonce",required:!0,type:{name:"String"}},oracleId:{serializedName:"oracle_id",required:!0,type:{name:"String"}},query:{serializedName:"query",required:!0,type:{name:"String"}},response:{serializedName:"response",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",required:!0,type:{name:"String"}},responseTtl:{serializedName:"response_ttl",type:{name:"Composite",className:"Ttl"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}}}}},Na={type:{name:"Composite",className:"NameEntry",modelProperties:{id:{serializedName:"id",required:!0,type:{name:"String"}},owner:{serializedName:"owner",type:{name:"String"}},ttl:{serializedName:"ttl",required:!0,type:{name:"String"}},pointers:{serializedName:"pointers",required:!0,type:{name:"Sequence",element:{type:{name:"Composite",className:"NamePointer"}}}}}}},ba={type:{name:"Composite",className:"Channel",modelProperties:{id:{serializedName:"id",required:!0,type:{name:"String"}},initiatorId:{serializedName:"initiator_id",required:!0,type:{name:"String"}},responderId:{serializedName:"responder_id",required:!0,type:{name:"String"}},channelAmount:{serializedName:"channel_amount",required:!0,type:{name:"String"}},initiatorAmount:{serializedName:"initiator_amount",required:!0,type:{name:"String"}},responderAmount:{serializedName:"responder_amount",required:!0,type:{name:"String"}},channelReserve:{serializedName:"channel_reserve",required:!0,type:{name:"String"}},delegateIds:{serializedName:"delegate_ids",type:{name:"Composite",className:"Delegates"}},stateHash:{serializedName:"state_hash",required:!0,type:{name:"String"}},round:{serializedName:"round",required:!0,type:{name:"String"}},soloRound:{serializedName:"solo_round",required:!0,type:{name:"String"}},lockPeriod:{serializedName:"lock_period",required:!0,type:{name:"String"}},lockedUntil:{serializedName:"locked_until",required:!0,type:{name:"String"}}}}},Sa={type:{name:"Composite",className:"PeerPubKey",modelProperties:{pubkey:{serializedName:"pubkey",required:!0,type:{name:"String"}}}}},xa={type:{name:"Composite",className:"Status",modelProperties:{genesisKeyBlockHash:{serializedName:"genesis_key_block_hash",required:!0,type:{name:"String"}},solutions:{serializedName:"solutions",required:!0,type:{name:"String"}},difficulty:{serializedName:"difficulty",required:!0,type:{name:"String"}},syncing:{serializedName:"syncing",required:!0,type:{name:"Boolean"}},syncProgress:{constraints:{InclusiveMaximum:100,InclusiveMinimum:0},serializedName:"sync_progress",type:{name:"Number"}},listening:{serializedName:"listening",required:!0,type:{name:"Boolean"}},protocols:{serializedName:"protocols",required:!0,type:{name:"Sequence",element:{type:{name:"Composite",className:"Protocol"}}}},nodeVersion:{serializedName:"node_version",required:!0,type:{name:"String"}},nodeRevision:{serializedName:"node_revision",required:!0,type:{name:"String"}},peerCount:{serializedName:"peer_count",required:!0,type:{name:"String"}},peerConnections:{serializedName:"peer_connections",type:{name:"Composite",className:"PeerConnections"}},pendingTransactionsCount:{serializedName:"pending_transactions_count",required:!0,type:{name:"String"}},networkId:{serializedName:"network_id",required:!0,type:{name:"String"}},peerPubkey:{serializedName:"peer_pubkey",required:!0,type:{name:"String"}},topKeyBlockHash:{serializedName:"top_key_block_hash",required:!0,type:{name:"String"}},topBlockHeight:{serializedName:"top_block_height",required:!0,type:{name:"String"}}}}},Ta={type:{name:"Composite",className:"Protocol",modelProperties:{version:{serializedName:"version",required:!0,type:{name:"String"}},effectiveAtHeight:{serializedName:"effective_at_height",required:!0,type:{name:"String"}}}}},_a={type:{name:"Composite",className:"PeerConnections",modelProperties:{inbound:{serializedName:"inbound",required:!0,type:{name:"String"}},outbound:{serializedName:"outbound",required:!0,type:{name:"String"}}}}},Ra={type:{name:"Composite",className:"SpendTx",modelProperties:{recipientId:{serializedName:"recipient_id",required:!0,type:{name:"String"}},amount:{serializedName:"amount",required:!0,type:{name:"String"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}},senderId:{serializedName:"sender_id",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",type:{name:"String"}},payload:{serializedName:"payload",required:!0,type:{name:"String"}}}}},Ma={type:{name:"Composite",className:"OracleRegisterTx",modelProperties:{queryFormat:{serializedName:"query_format",required:!0,type:{name:"String"}},responseFormat:{serializedName:"response_format",required:!0,type:{name:"String"}},queryFee:{serializedName:"query_fee",required:!0,type:{name:"String"}},oracleTtl:{serializedName:"oracle_ttl",type:{name:"Composite",className:"Ttl"}},accountId:{serializedName:"account_id",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",type:{name:"String"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}},abiVersion:{serializedName:"abi_version",type:{name:"String"}}}}},Da={type:{name:"Composite",className:"OracleExtendTx",modelProperties:{fee:{serializedName:"fee",required:!0,type:{name:"String"}},oracleTtl:{serializedName:"oracle_ttl",type:{name:"Composite",className:"RelativeTTL"}},oracleId:{serializedName:"oracle_id",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}}}}},Oa={type:{name:"Composite",className:"OracleQueryTx",modelProperties:{oracleId:{serializedName:"oracle_id",required:!0,type:{name:"String"}},query:{serializedName:"query",required:!0,type:{name:"String"}},queryFee:{serializedName:"query_fee",required:!0,type:{name:"String"}},queryTtl:{serializedName:"query_ttl",type:{name:"Composite",className:"Ttl"}},responseTtl:{serializedName:"response_ttl",type:{name:"Composite",className:"RelativeTTL"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}},senderId:{serializedName:"sender_id",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",type:{name:"String"}}}}},za={type:{name:"Composite",className:"OracleRespondTx",modelProperties:{queryId:{serializedName:"query_id",required:!0,type:{name:"String"}},response:{serializedName:"response",required:!0,type:{name:"String"}},responseTtl:{serializedName:"response_ttl",type:{name:"Composite",className:"RelativeTTL"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}},oracleId:{serializedName:"oracle_id",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",type:{name:"String"}}}}},ka={type:{name:"Composite",className:"NamePreclaimTx",modelProperties:{commitmentId:{serializedName:"commitment_id",required:!0,type:{name:"String"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}},accountId:{serializedName:"account_id",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",type:{name:"String"}}}}},Pa={type:{name:"Composite",className:"NameClaimTx",modelProperties:{name:{serializedName:"name",required:!0,type:{name:"String"}},nameSalt:{serializedName:"name_salt",required:!0,type:{name:"String"}},nameFee:{serializedName:"name_fee",type:{name:"String"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}},accountId:{serializedName:"account_id",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",type:{name:"String"}}}}},Ua={type:{name:"Composite",className:"NameUpdateTx",modelProperties:{nameId:{serializedName:"name_id",required:!0,type:{name:"String"}},nameTtl:{serializedName:"name_ttl",required:!0,type:{name:"String"}},pointers:{serializedName:"pointers",required:!0,type:{name:"Sequence",element:{type:{name:"Composite",className:"NamePointer"}}}},clientTtl:{serializedName:"client_ttl",required:!0,type:{name:"String"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}},accountId:{serializedName:"account_id",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",type:{name:"String"}}}}},Fa={type:{name:"Composite",className:"NameTransferTx",modelProperties:{nameId:{serializedName:"name_id",required:!0,type:{name:"String"}},recipientId:{serializedName:"recipient_id",required:!0,type:{name:"String"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}},accountId:{serializedName:"account_id",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",type:{name:"String"}}}}},qa={type:{name:"Composite",className:"NameRevokeTx",modelProperties:{nameId:{serializedName:"name_id",required:!0,type:{name:"String"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}},accountId:{serializedName:"account_id",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",type:{name:"String"}}}}},La={type:{name:"Composite",className:"CommitmentId",modelProperties:{commitmentId:{serializedName:"commitment_id",required:!0,type:{name:"String"}}}}},Ga={type:{name:"Composite",className:"NameHash",modelProperties:{nameId:{serializedName:"name_id",required:!0,type:{name:"String"}}}}},Ha={type:{name:"Composite",className:"ChannelCreateTx",modelProperties:{initiatorId:{serializedName:"initiator_id",required:!0,type:{name:"String"}},initiatorAmount:{serializedName:"initiator_amount",required:!0,type:{name:"String"}},responderId:{serializedName:"responder_id",required:!0,type:{name:"String"}},responderAmount:{serializedName:"responder_amount",required:!0,type:{name:"String"}},channelReserve:{serializedName:"channel_reserve",required:!0,type:{name:"String"}},lockPeriod:{serializedName:"lock_period",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",type:{name:"String"}},stateHash:{serializedName:"state_hash",required:!0,type:{name:"String"}},delegateIds:{serializedName:"delegate_ids",type:{name:"Composite",className:"Delegates"}}}}},ja={type:{name:"Composite",className:"ChannelDepositTx",modelProperties:{channelId:{serializedName:"channel_id",required:!0,type:{name:"String"}},fromId:{serializedName:"from_id",required:!0,type:{name:"String"}},amount:{serializedName:"amount",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",required:!0,type:{name:"String"}},stateHash:{serializedName:"state_hash",required:!0,type:{name:"String"}},round:{serializedName:"round",required:!0,type:{name:"String"}}}}},Ya={type:{name:"Composite",className:"ChannelWithdrawTx",modelProperties:{channelId:{serializedName:"channel_id",required:!0,type:{name:"String"}},toId:{serializedName:"to_id",required:!0,type:{name:"String"}},amount:{serializedName:"amount",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",required:!0,type:{name:"String"}},stateHash:{serializedName:"state_hash",required:!0,type:{name:"String"}},round:{serializedName:"round",required:!0,type:{name:"String"}}}}},$a={type:{name:"Composite",className:"ChannelForceProgressTx",modelProperties:{channelId:{serializedName:"channel_id",required:!0,type:{name:"String"}},fromId:{serializedName:"from_id",required:!0,type:{name:"String"}},payload:{serializedName:"payload",required:!0,type:{name:"String"}},round:{serializedName:"round",required:!0,type:{name:"String"}},update:{serializedName:"update",type:{name:"Composite",className:"OffChainUpdate"}},stateHash:{serializedName:"state_hash",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",type:{name:"String"}},offchainTrees:{serializedName:"offchain_trees",type:{name:"String"}}}}},Ka={type:{name:"Composite",className:"ChannelCloseMutualTx",modelProperties:{channelId:{serializedName:"channel_id",required:!0,type:{name:"String"}},fromId:{serializedName:"from_id",required:!0,type:{name:"String"}},initiatorAmountFinal:{serializedName:"initiator_amount_final",required:!0,type:{name:"String"}},responderAmountFinal:{serializedName:"responder_amount_final",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",required:!0,type:{name:"String"}}}}},Va={type:{name:"Composite",className:"ChannelCloseSoloTx",modelProperties:{channelId:{serializedName:"channel_id",required:!0,type:{name:"String"}},fromId:{serializedName:"from_id",required:!0,type:{name:"String"}},payload:{serializedName:"payload",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",type:{name:"String"}},poi:{serializedName:"poi",required:!0,type:{name:"String"}}}}},Ja={type:{name:"Composite",className:"ChannelSlashTx",modelProperties:{channelId:{serializedName:"channel_id",required:!0,type:{name:"String"}},fromId:{serializedName:"from_id",required:!0,type:{name:"String"}},payload:{serializedName:"payload",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",type:{name:"String"}},poi:{serializedName:"poi",required:!0,type:{name:"String"}}}}},Wa={type:{name:"Composite",className:"ChannelSettleTx",modelProperties:{channelId:{serializedName:"channel_id",required:!0,type:{name:"String"}},fromId:{serializedName:"from_id",required:!0,type:{name:"String"}},initiatorAmountFinal:{serializedName:"initiator_amount_final",required:!0,type:{name:"String"}},responderAmountFinal:{serializedName:"responder_amount_final",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",required:!0,type:{name:"String"}}}}},Xa={type:{name:"Composite",className:"ChannelSnapshotSoloTx",modelProperties:{channelId:{serializedName:"channel_id",required:!0,type:{name:"String"}},fromId:{serializedName:"from_id",required:!0,type:{name:"String"}},payload:{serializedName:"payload",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",type:{name:"String"}}}}},Za={type:{name:"Composite",className:"ChannelSetDelegatesTx",modelProperties:{channelId:{serializedName:"channel_id",required:!0,type:{name:"String"}},fromId:{serializedName:"from_id",required:!0,type:{name:"String"}},initiatorDelegateIds:{serializedName:"initiator_delegate_ids",required:!0,type:{name:"Sequence",element:{type:{name:"String"}}}},responderDelegateIds:{serializedName:"responder_delegate_ids",required:!0,type:{name:"Sequence",element:{type:{name:"String"}}}},stateHash:{serializedName:"state_hash",required:!0,type:{name:"String"}},round:{serializedName:"round",required:!0,type:{name:"String"}},payload:{serializedName:"payload",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",type:{name:"String"}}}}},es={type:{name:"Composite",className:"PubKey",modelProperties:{pubKey:{serializedName:"pub_key",required:!0,type:{name:"String"}}}}},ts={type:{name:"Composite",className:"PeerDetails",modelProperties:{host:{serializedName:"host",required:!0,type:{name:"String"}},port:{serializedName:"port",required:!0,type:{name:"String"}},firstSeen:{serializedName:"first_seen",required:!0,type:{name:"String"}},lastSeen:{serializedName:"last_seen",required:!0,type:{name:"String"}},genesisHash:{serializedName:"genesis_hash",required:!0,type:{name:"String"}},topHash:{serializedName:"top_hash",required:!0,type:{name:"String"}},topDifficulty:{serializedName:"top_difficulty",required:!0,type:{name:"String"}},networkId:{serializedName:"network_id",type:{name:"String"}},nodeVersion:{serializedName:"node_version",type:{name:"String"}},nodeRevision:{serializedName:"node_revision",type:{name:"String"}},nodeVendor:{serializedName:"node_vendor",type:{name:"String"}},nodeOs:{serializedName:"node_os",type:{name:"String"}}}}},rs={type:{name:"Composite",className:"Peers",modelProperties:{peers:{serializedName:"peers",required:!0,type:{name:"Sequence",element:{type:{name:"String"}}}},blocked:{serializedName:"blocked",required:!0,type:{name:"Sequence",element:{type:{name:"String"}}}}}}},ns={type:{name:"Composite",className:"PeerCount",modelProperties:{connected:{serializedName:"connected",type:{name:"Composite",className:"PeerCountConnected"}},available:{serializedName:"available",type:{name:"Composite",className:"PeerCountAvailable"}},blocked:{serializedName:"blocked",required:!0,type:{name:"String"}}}}},is={type:{name:"Composite",className:"PeerCountConnected",modelProperties:{inbound:{serializedName:"inbound",type:{name:"String"}},outbound:{serializedName:"outbound",type:{name:"String"}}}}},os={type:{name:"Composite",className:"PeerCountAvailable",modelProperties:{verified:{serializedName:"verified",type:{name:"String"}},unverified:{serializedName:"unverified",type:{name:"String"}}}}},as={type:{name:"Composite",className:"ContractCreateTx",modelProperties:{ownerId:{serializedName:"owner_id",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",type:{name:"String"}},code:{serializedName:"code",required:!0,type:{name:"String"}},vmVersion:{serializedName:"vm_version",required:!0,type:{name:"String"}},abiVersion:{serializedName:"abi_version",required:!0,type:{name:"String"}},deposit:{serializedName:"deposit",required:!0,type:{name:"String"}},amount:{serializedName:"amount",required:!0,type:{name:"String"}},gas:{serializedName:"gas",required:!0,type:{name:"String"}},gasPrice:{serializedName:"gas_price",required:!0,type:{name:"String"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}},callData:{serializedName:"call_data",required:!0,type:{name:"String"}}}}},ss={type:{name:"Composite",className:"ContractCallTx",modelProperties:{callerId:{serializedName:"caller_id",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",type:{name:"String"}},contractId:{serializedName:"contract_id",required:!0,type:{name:"String"}},abiVersion:{serializedName:"abi_version",required:!0,type:{name:"String"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}},amount:{serializedName:"amount",required:!0,type:{name:"String"}},gas:{serializedName:"gas",required:!0,type:{name:"String"}},gasPrice:{serializedName:"gas_price",required:!0,type:{name:"String"}},callData:{serializedName:"call_data",required:!0,type:{name:"String"}}}}},cs={type:{name:"Composite",className:"UnsignedTx",modelProperties:{tx:{serializedName:"tx",required:!0,type:{name:"String"}}}}},As={type:{name:"Composite",className:"TokenSupply",modelProperties:{accounts:{serializedName:"accounts",type:{name:"String"}},contracts:{serializedName:"contracts",type:{name:"String"}},contractOracles:{serializedName:"contract_oracles",type:{name:"String"}},locked:{serializedName:"locked",type:{name:"String"}},oracles:{serializedName:"oracles",type:{name:"String"}},oracleQueries:{serializedName:"oracle_queries",type:{name:"String"}},pendingRewards:{serializedName:"pending_rewards",type:{name:"String"}},total:{serializedName:"total",type:{name:"String"}}}}},us={type:{name:"Composite",className:"GAAttachTx",modelProperties:{ownerId:{serializedName:"owner_id",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",type:{name:"String"}},code:{serializedName:"code",required:!0,type:{name:"String"}},vmVersion:{serializedName:"vm_version",required:!0,type:{name:"String"}},abiVersion:{serializedName:"abi_version",required:!0,type:{name:"String"}},gas:{serializedName:"gas",required:!0,type:{name:"String"}},gasPrice:{serializedName:"gas_price",required:!0,type:{name:"String"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}},callData:{serializedName:"call_data",required:!0,type:{name:"String"}},authFun:{constraints:{Pattern:new RegExp("^(0x|0X)?[a-fA-F0-9]+$")},serializedName:"auth_fun",required:!0,type:{name:"String"}}}}},ls={type:{name:"Composite",className:"GAMetaTx",modelProperties:{gaId:{serializedName:"ga_id",required:!0,type:{name:"String"}},abiVersion:{serializedName:"abi_version",required:!0,type:{name:"String"}},gas:{serializedName:"gas",required:!0,type:{name:"String"}},gasPrice:{serializedName:"gas_price",required:!0,type:{name:"String"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},ttl:{serializedName:"ttl",type:{name:"String"}},authData:{serializedName:"auth_data",required:!0,type:{name:"String"}},tx:{serializedName:"tx",type:{name:"Composite",className:"SignedTx"}}}}},ds={type:{name:"Composite",className:"PayingForTx",modelProperties:{payerId:{serializedName:"payer_id",required:!0,type:{name:"String"}},fee:{serializedName:"fee",required:!0,type:{name:"String"}},nonce:{serializedName:"nonce",type:{name:"String"}},tx:{serializedName:"tx",type:{name:"Composite",className:"SignedTx"}}}}},ps={type:{name:"Composite",className:"CheckTxInPoolResponse",modelProperties:{status:{serializedName:"status",required:!0,type:{name:"String"}}}}},hs={serializedName:"OffChainTransfer",type:{name:"Composite",className:"OffChainTransfer",uberParent:"OffChainUpdate",polymorphicDiscriminator:Zo.type.polymorphicDiscriminator,modelProperties:{...Zo.type.modelProperties,from:{serializedName:"from",required:!0,type:{name:"String"}},to:{serializedName:"to",required:!0,type:{name:"String"}},amount:{serializedName:"amount",required:!0,type:{name:"String"}}}}},fs={serializedName:"OffChainWithdrawal",type:{name:"Composite",className:"OffChainWithdrawal",uberParent:"OffChainUpdate",polymorphicDiscriminator:Zo.type.polymorphicDiscriminator,modelProperties:{...Zo.type.modelProperties,to:{serializedName:"to",required:!0,type:{name:"String"}},amount:{serializedName:"amount",required:!0,type:{name:"String"}}}}},gs={serializedName:"OffChainDeposit",type:{name:"Composite",className:"OffChainDeposit",uberParent:"OffChainUpdate",polymorphicDiscriminator:Zo.type.polymorphicDiscriminator,modelProperties:{...Zo.type.modelProperties,from:{serializedName:"from",required:!0,type:{name:"String"}},amount:{serializedName:"amount",required:!0,type:{name:"String"}}}}},ms={serializedName:"OffChainNewContract",type:{name:"Composite",className:"OffChainNewContract",uberParent:"OffChainUpdate",polymorphicDiscriminator:Zo.type.polymorphicDiscriminator,modelProperties:{...Zo.type.modelProperties,owner:{serializedName:"owner",required:!0,type:{name:"String"}},vmVersion:{serializedName:"vm_version",required:!0,type:{name:"String"}},abiVersion:{serializedName:"abi_version",required:!0,type:{name:"String"}},code:{serializedName:"code",type:{name:"Composite",className:"ByteCode"}},deposit:{serializedName:"deposit",required:!0,type:{name:"String"}},callData:{serializedName:"call_data",required:!0,type:{name:"String"}}}}},ys={serializedName:"OffChainCallContract",type:{name:"Composite",className:"OffChainCallContract",uberParent:"OffChainUpdate",polymorphicDiscriminator:Zo.type.polymorphicDiscriminator,modelProperties:{...Zo.type.modelProperties,caller:{serializedName:"caller",required:!0,type:{name:"String"}},contract:{serializedName:"contract",required:!0,type:{name:"String"}},abiVersion:{serializedName:"abi_version",required:!0,type:{name:"String"}},amount:{serializedName:"amount",required:!0,type:{name:"String"}},gas:{serializedName:"gas",required:!0,type:{name:"String"}},gasPrice:{serializedName:"gas_price",required:!0,type:{name:"String"}},callData:{serializedName:"call_data",required:!0,type:{name:"String"}}}}},Is={type:{name:"Composite",className:"CreateContractUnsignedTx",modelProperties:{...cs.type.modelProperties,contractId:{serializedName:"contract_id",required:!0,type:{name:"String"}}}}};let Cs={"Tx.undefined":Wo,OffChainUpdate:Zo,"OffChainUpdate.OffChainTransfer":hs,"OffChainUpdate.OffChainWithdrawal":fs,"OffChainUpdate.OffChainDeposit":gs,"OffChainUpdate.OffChainNewContract":ms,"OffChainUpdate.OffChainCallContract":ys};const Es={parameterPath:"accept",mapper:{defaultValue:"application/json",isConstant:!0,serializedName:"Accept",type:{name:"String"}}},Bs={parameterPath:"$host",mapper:{serializedName:"$host",required:!0,type:{name:"String"}},skipEncoding:!0},ws={parameterPath:"intAsString",mapper:{defaultValue:!1,serializedName:"int-as-string",type:{name:"Boolean"}}},Qs={parameterPath:"hash",mapper:{serializedName:"hash",required:!0,type:{name:"String"}}},vs={parameterPath:"height",mapper:{constraints:{InclusiveMaximum:0x10000000000000000,InclusiveMinimum:0},serializedName:"height",required:!0,type:{name:"Number"}}},Ns={parameterPath:"pubkey",mapper:{serializedName:"pubkey",required:!0,type:{name:"String"}}},bs={parameterPath:["options","contentType"],mapper:{defaultValue:"application/json",isConstant:!0,serializedName:"Content-Type",type:{name:"String"}}},Ss={parameterPath:"body",mapper:sa},xs={parameterPath:"body",mapper:ya};class Ts extends qo{constructor(e,t){var r,n,i;if(void 0===e)throw new Error("'$host' cannot be null");t||(t={});const o="azsdk-js-node/1.0.0-beta.1",a=t.userAgentOptions&&t.userAgentOptions.userAgentPrefix?`${t.userAgentOptions.userAgentPrefix} ${o}`:`${o}`,s={requestContentType:"application/json; charset=utf-8",...t,userAgentOptions:{userAgentPrefix:a},baseUri:null!==(r=null!==(n=t.endpoint)&&void 0!==n?n:t.baseUri)&&void 0!==r?r:"{$host}"};super(s),null!==(i=t)&&void 0!==i&&i.pipeline&&t.pipeline.getOrderedPolicies().length>0&&(t.pipeline.getOrderedPolicies().some((e=>e.name===xo))||(this.pipeline.removePolicy({name:xo}),this.pipeline.addPolicy(_o({scopes:`${s.baseUri}/.default`,challengeCallbacks:{authorizeRequestOnChallenge:Lo}})))),this.$host=e}getTopHeader(e){return this.sendOperationRequest({options:e},Rs)}getCurrentKeyBlock(e){return this.sendOperationRequest({options:e},Ms)}getCurrentKeyBlockHash(e){return this.sendOperationRequest({options:e},Ds)}getCurrentKeyBlockHeight(e){return this.sendOperationRequest({options:e},Os)}getPendingKeyBlock(e){return this.sendOperationRequest({options:e},zs)}getKeyBlockByHash(e,t){return this.sendOperationRequest({hash:e,options:t},ks)}getKeyBlockByHeight(e,t){return this.sendOperationRequest({height:e,options:t},Ps)}getMicroBlockHeaderByHash(e,t){return this.sendOperationRequest({hash:e,options:t},Us)}getMicroBlockTransactionsByHash(e,t){return this.sendOperationRequest({hash:e,options:t},Fs)}getMicroBlockTransactionByHashAndIndex(e,t,r){return this.sendOperationRequest({hash:e,index:t,options:r},qs)}getMicroBlockTransactionsCountByHash(e,t){return this.sendOperationRequest({hash:e,options:t},Ls)}getCurrentGeneration(e){return this.sendOperationRequest({options:e},Gs)}getGenerationByHash(e,t){return this.sendOperationRequest({hash:e,options:t},Hs)}getGenerationByHeight(e,t){return this.sendOperationRequest({height:e,options:t},js)}getAccountByPubkey(e,t){return this.sendOperationRequest({pubkey:e,options:t},Ys)}getAccountByPubkeyAndHeight(e,t,r){return this.sendOperationRequest({pubkey:e,height:t,options:r},$s)}getAccountByPubkeyAndHash(e,t,r){return this.sendOperationRequest({pubkey:e,hash:t,options:r},Ks)}getPendingAccountTransactionsByPubkey(e,t){return this.sendOperationRequest({pubkey:e,options:t},Vs)}getAccountNextNonce(e,t){return this.sendOperationRequest({pubkey:e,options:t},Js)}protectedDryRunTxs(e,t){return this.sendOperationRequest({body:e,options:t},Ws)}getTransactionByHash(e,t){return this.sendOperationRequest({hash:e,options:t},Xs)}getTransactionInfoByHash(e,t){return this.sendOperationRequest({hash:e,options:t},Zs)}postTransaction(e,t){return this.sendOperationRequest({body:e,options:t},ec)}getContract(e,t){return this.sendOperationRequest({pubkey:e,options:t},tc)}getContractCode(e,t){return this.sendOperationRequest({pubkey:e,options:t},rc)}getContractPoI(e,t){return this.sendOperationRequest({pubkey:e,options:t},nc)}getOracleByPubkey(e,t){return this.sendOperationRequest({pubkey:e,options:t},ic)}getOracleQueriesByPubkey(e,t){return this.sendOperationRequest({pubkey:e,options:t},oc)}getOracleQueryByPubkeyAndQueryId(e,t,r){return this.sendOperationRequest({pubkey:e,queryId:t,options:r},ac)}getNameEntryByName(e,t){return this.sendOperationRequest({name:e,options:t},sc)}getChannelByPubkey(e,t){return this.sendOperationRequest({pubkey:e,options:t},cc)}getPeerPubkey(e){return this.sendOperationRequest({options:e},Ac)}getStatus(e){return this.sendOperationRequest({options:e},uc)}getChainEnds(e){return this.sendOperationRequest({options:e},lc)}}const _s=yi(e,!1),Rs={path:"/v3/headers/top",httpMethod:"GET",responses:{200:{bodyMapper:Go},404:{bodyMapper:Ho,isError:!0}},queryParameters:[ws],urlParameters:[Bs],headerParameters:[Es],serializer:_s},Ms={path:"/v3/key-blocks/current",httpMethod:"GET",responses:{200:{bodyMapper:jo},404:{bodyMapper:Ho,isError:!0}},queryParameters:[ws],urlParameters:[Bs],headerParameters:[Es],serializer:_s},Ds={path:"/v3/key-blocks/current/hash",httpMethod:"GET",responses:{200:{bodyMapper:Yo},404:{bodyMapper:Ho,isError:!0}},queryParameters:[ws],urlParameters:[Bs],headerParameters:[Es],serializer:_s},Os={path:"/v3/key-blocks/current/height",httpMethod:"GET",responses:{200:{bodyMapper:$o},404:{bodyMapper:Ho,isError:!0}},queryParameters:[ws],urlParameters:[Bs],headerParameters:[Es],serializer:_s},zs={path:"/v3/key-blocks/pending",httpMethod:"GET",responses:{200:{bodyMapper:jo},400:{bodyMapper:Ho,isError:!0},404:{bodyMapper:Ho,isError:!0}},queryParameters:[ws],urlParameters:[Bs],headerParameters:[Es],serializer:_s},ks={path:"/v3/key-blocks/hash/{hash}",httpMethod:"GET",responses:{200:{bodyMapper:jo},400:{bodyMapper:Ho,isError:!0},404:{bodyMapper:Ho,isError:!0}},queryParameters:[ws],urlParameters:[Bs,Qs],headerParameters:[Es],serializer:_s},Ps={path:"/v3/key-blocks/height/{height}",httpMethod:"GET",responses:{200:{bodyMapper:jo},404:{bodyMapper:Ho,isError:!0}},queryParameters:[ws],urlParameters:[Bs,vs],headerParameters:[Es],serializer:_s},Us={path:"/v3/micro-blocks/hash/{hash}/header",httpMethod:"GET",responses:{200:{bodyMapper:Ko},400:{bodyMapper:Ho,isError:!0},404:{bodyMapper:Ho,isError:!0}},queryParameters:[ws],urlParameters:[Bs,Qs],headerParameters:[Es],serializer:_s},Fs={path:"/v3/micro-blocks/hash/{hash}/transactions",httpMethod:"GET",responses:{200:{bodyMapper:Vo},400:{bodyMapper:Ho,isError:!0},404:{bodyMapper:Ho,isError:!0}},queryParameters:[ws],urlParameters:[Bs,Qs],headerParameters:[Es],serializer:_s},qs={path:"/v3/micro-blocks/hash/{hash}/transactions/index/{index}",httpMethod:"GET",responses:{200:{bodyMapper:Jo},400:{bodyMapper:Ho,isError:!0},404:{bodyMapper:Ho,isError:!0}},queryParameters:[ws],urlParameters:[Bs,Qs,{parameterPath:"index",mapper:{constraints:{InclusiveMinimum:1},serializedName:"index",required:!0,type:{name:"Number"}}}],headerParameters:[Es],serializer:_s},Ls={path:"/v3/micro-blocks/hash/{hash}/transactions/count",httpMethod:"GET",responses:{200:{bodyMapper:na},400:{bodyMapper:Ho,isError:!0},404:{bodyMapper:Ho,isError:!0}},queryParameters:[ws],urlParameters:[Bs,Qs],headerParameters:[Es],serializer:_s},Gs={path:"/v3/generations/current",httpMethod:"GET",responses:{200:{bodyMapper:ia},404:{bodyMapper:Ho,isError:!0}},queryParameters:[ws],urlParameters:[Bs],headerParameters:[Es],serializer:_s},Hs={path:"/v3/generations/hash/{hash}",httpMethod:"GET",responses:{200:{bodyMapper:ia},400:{bodyMapper:Ho,isError:!0},404:{bodyMapper:Ho,isError:!0}},queryParameters:[ws],urlParameters:[Bs,Qs],headerParameters:[Es],serializer:_s},js={path:"/v3/generations/height/{height}",httpMethod:"GET",responses:{200:{bodyMapper:ia},404:{bodyMapper:Ho,isError:!0}},queryParameters:[ws],urlParameters:[Bs,vs],headerParameters:[Es],serializer:_s},Ys={path:"/v3/accounts/{pubkey}",httpMethod:"GET",responses:{200:{bodyMapper:oa},400:{bodyMapper:Ho,isError:!0},404:{bodyMapper:Ho,isError:!0}},queryParameters:[ws],urlParameters:[Bs,Ns],headerParameters:[Es],serializer:_s},$s={path:"/v3/accounts/{pubkey}/height/{height}",httpMethod:"GET",responses:{200:{bodyMapper:oa},400:{bodyMapper:Ho,isError:!0},404:{bodyMapper:Ho,isError:!0}},queryParameters:[ws],urlParameters:[Bs,vs,Ns],headerParameters:[Es],serializer:_s},Ks={path:"/v3/accounts/{pubkey}/hash/{hash}",httpMethod:"GET",responses:{200:{bodyMapper:oa},400:{bodyMapper:Ho,isError:!0},404:{bodyMapper:Ho,isError:!0}},queryParameters:[ws],urlParameters:[Bs,Qs,Ns],headerParameters:[Es],serializer:_s},Vs={path:"/v3/accounts/{pubkey}/transactions/pending",httpMethod:"GET",responses:{200:{bodyMapper:Vo},400:{bodyMapper:Ho,isError:!0},404:{bodyMapper:Ho,isError:!0}},queryParameters:[ws],urlParameters:[Bs,Ns],headerParameters:[Es],serializer:_s},Js={path:"/v3/accounts/{pubkey}/next-nonce",httpMethod:"GET",responses:{200:{bodyMapper:aa},400:{bodyMapper:Ho,isError:!0},404:{bodyMapper:Ho,isError:!0}},queryParameters:[ws,{parameterPath:["options","strategy"],mapper:{defaultValue:"max",serializedName:"strategy",type:{name:"Enum",allowedValues:["max","continuity"]}}}],urlParameters:[Bs,Ns],headerParameters:[Es],serializer:_s},Ws={path:"/v3/dry-run",httpMethod:"POST",responses:{200:{bodyMapper:da},403:{bodyMapper:Ho,isError:!0}},requestBody:Ss,queryParameters:[ws],urlParameters:[Bs],headerParameters:[Es,bs],mediaType:"json",serializer:_s},Xs={path:"/v3/transactions/{hash}",httpMethod:"GET",responses:{200:{bodyMapper:Jo},400:{bodyMapper:Ho,isError:!0},404:{bodyMapper:Ho,isError:!0}},queryParameters:[ws],urlParameters:[Bs,Qs],headerParameters:[Es],serializer:_s},Zs={path:"/v3/transactions/{hash}/info",httpMethod:"GET",responses:{200:{bodyMapper:ga},400:{bodyMapper:Ho,isError:!0},404:{bodyMapper:Ho,isError:!0}},queryParameters:[ws],urlParameters:[Bs,Qs],headerParameters:[Es],serializer:_s},ec={path:"/v3/transactions",httpMethod:"POST",responses:{200:{bodyMapper:Ia},400:{bodyMapper:Ho,isError:!0}},requestBody:xs,queryParameters:[ws],urlParameters:[Bs],headerParameters:[Es,bs],mediaType:"json",serializer:_s},tc={path:"/v3/contracts/{pubkey}",httpMethod:"GET",responses:{200:{bodyMapper:Ca},400:{bodyMapper:Ho,isError:!0},404:{isError:!0}},queryParameters:[ws],urlParameters:[Bs,Ns],headerParameters:[Es],serializer:_s},rc={path:"/v3/contracts/{pubkey}/code",httpMethod:"GET",responses:{200:{bodyMapper:Ea},400:{bodyMapper:Ho,isError:!0},404:{bodyMapper:Ho,isError:!0}},queryParameters:[ws],urlParameters:[Bs,Ns],headerParameters:[Es],serializer:_s},nc={path:"/v3/contracts/{pubkey}/poi",httpMethod:"GET",responses:{200:{bodyMapper:Ba},400:{bodyMapper:Ho,isError:!0},404:{bodyMapper:Ho,isError:!0}},queryParameters:[ws],urlParameters:[Bs,Ns],headerParameters:[Es],serializer:_s},ic={path:"/v3/oracles/{pubkey}",httpMethod:"GET",responses:{200:{bodyMapper:wa},400:{bodyMapper:Ho,isError:!0},404:{bodyMapper:Ho,isError:!0}},queryParameters:[ws],urlParameters:[Bs,Ns],headerParameters:[Es],serializer:_s},oc={path:"/v3/oracles/{pubkey}/queries",httpMethod:"GET",responses:{200:{bodyMapper:Qa},400:{bodyMapper:Ho,isError:!0},404:{bodyMapper:Ho,isError:!0}},queryParameters:[ws,{parameterPath:["options","from"],mapper:{serializedName:"from",type:{name:"String"}}},{parameterPath:["options","limit"],mapper:{defaultValue:20,constraints:{InclusiveMaximum:1e3,InclusiveMinimum:1},serializedName:"limit",type:{name:"Number"}}},{parameterPath:["options","type"],mapper:{defaultValue:"all",serializedName:"type",type:{name:"Enum",allowedValues:["open","closed","all"]}}}],urlParameters:[Bs,Ns],headerParameters:[Es],serializer:_s},ac={path:"/v3/oracles/{pubkey}/queries/{query-id}",httpMethod:"GET",responses:{200:{bodyMapper:va},400:{bodyMapper:Ho,isError:!0},404:{bodyMapper:Ho,isError:!0}},queryParameters:[ws],urlParameters:[Bs,Ns,{parameterPath:"queryId",mapper:{serializedName:"query-id",required:!0,type:{name:"String"}}}],headerParameters:[Es],serializer:_s},sc={path:"/v3/names/{name}",httpMethod:"GET",responses:{200:{bodyMapper:Na},400:{bodyMapper:Ho,isError:!0},404:{bodyMapper:Ho,isError:!0}},queryParameters:[ws],urlParameters:[Bs,{parameterPath:"name",mapper:{serializedName:"name",required:!0,type:{name:"String"}}}],headerParameters:[Es],serializer:_s},cc={path:"/v3/channels/{pubkey}",httpMethod:"GET",responses:{200:{bodyMapper:ba},400:{bodyMapper:Ho,isError:!0},404:{bodyMapper:Ho,isError:!0}},queryParameters:[ws],urlParameters:[Bs,Ns],headerParameters:[Es],serializer:_s},Ac={path:"/v3/peers/pubkey",httpMethod:"GET",responses:{200:{bodyMapper:Sa}},queryParameters:[ws],urlParameters:[Bs],headerParameters:[Es],serializer:_s},uc={path:"/v3/status",httpMethod:"GET",responses:{200:{bodyMapper:xa}},queryParameters:[ws],urlParameters:[Bs],headerParameters:[Es],serializer:_s},lc={path:"/v3/status/chain-ends",httpMethod:"GET",responses:{200:{bodyMapper:{type:{name:"Sequence",element:{type:{name:"String"}}}}}},queryParameters:[ws],urlParameters:[Bs],headerParameters:[Es],serializer:_s};function dc(e,t){pc(e,t),t.add(e)}function pc(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function hc(e,t,r){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return r}const fc=["balance","queryFee","fee","amount","nameFee","channelAmount","initiatorAmount","responderAmount","channelReserve","initiatorAmountFinal","responderAmountFinal","gasPrice","deposit"],gc=["time","gas","gasUsed","nameSalt","nonce","nextNonce","height","blockHeight","top","topBlockHeight","ttl","nameTtl","clientTtl","inbound","outbound","peerCount","pendingTransactionsCount","effectiveAtHeight","version","solutions","round"];var mc=new WeakSet,yc=new WeakSet,Ic=new WeakSet;class Cc extends Ts{constructor(){super(...arguments),dc(this,Ic),dc(this,yc),dc(this,mc)}async sendOperationRequest(e,t){const r=Et(e,(e=>{let[t,r]=e;return[t,hc(this,yc,Bc).call(this,r)]}));return hc(this,Ic,wc).call(this,await super.sendOperationRequest(r,t))}}function Ec(e,t){return Array.isArray(e)?e.map((e=>hc(this,mc,Ec).call(this,e,t))):null!=e&&"object"==typeof e?Et(e,(e=>{let[r,n]=e;return null==n?[r,n]:fc.some((e=>e===r))?[r,t.bigInt(n)]:gc.some((e=>e===r))?[r,t.number(n)]:[r,hc(this,mc,Ec).call(this,n,t)]})):e}function Bc(e){return hc(this,mc,Ec).call(this,e,{bigInt:e=>e instanceof S?e.toFixed():e.toString(),number:e=>e.toString()})}function wc(e){return hc(this,mc,Ec).call(this,e,{bigInt:e=>BigInt(e),number:e=>+e})}var Qc=new WeakMap;class vc extends Cc{constructor(e){let{ignoreVersion:t=!1,...r}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var n,i;if(super(e,{allowInsecureConnection:!0,additionalPolicies:[$n(),Kn(),Jn((e=>` ${e.reason}`))],...r}),i={writable:!0,value:void 0},pc(this,n=Qc),n.set(this,i),!t){const e=this.getStatus(),t=e.then((e=>{let{nodeVersion:t}=e;return t}));jn(this,Qc,e.then((e=>{let{networkId:t}=e;return t}))),this.pipeline.addPolicy(Wn("node","/v3/status",t,"6.2.0","7.0.0"))}this.intAsString=!0}async getNetworkId(){var e;return null!==(e=Hn(this,Qc))&&void 0!==e||jn(this,Qc,this.getStatus().then((e=>{let{networkId:t}=e;return t}))),Hn(this,Qc)}async getNodeInfo(){const{nodeVersion:e,networkId:t,protocols:r,topBlockHeight:n}=await this.getStatus(),i=r.filter((e=>{let{effectiveAtHeight:t}=e;return n>=t})).reduce(((e,t)=>t.effectiveAtHeight>e.effectiveAtHeight?t:e),{effectiveAtHeight:-1,version:0}).version;return{url:this.$host,nodeNetworkId:t,version:e,consensusProtocolVersion:i}}}var Nc=r(8764).Buffer;const bc=[],Sc=e=>["senderId","accountId","ownerId","callerId","oracleId","fromId","initiator","gaId","payerId"].map((t=>e[t])).filter((e=>e)).map((e=>null==e?void 0:e.toString().replace(/^ok_/,"ak_")))[0];async function xc(e,t){var r;let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],i=t;i.pipeline.getOrderedPolicies().some((e=>{let{name:t}=e;return"aggressive-cache-get-responses"===t}))||(i=new vc(t.$host,{ignoreVersion:!0}),i.pipeline.addPolicy(Vn()));const{tx:o,txType:a}=Fn(e),s=null!==(r=Sc(o))&&void 0!==r?r:a===gr.SignedTx?Sc(o.encodedTx.tx):void 0,[c,{height:A},{consensusProtocolVersion:u,nodeNetworkId:l}]=await Promise.all([null==s?void 0:i.getAccountByPubkey(s).catch((e=>{if(!Qt(e))throw e;return{id:s,balance:0n,nonce:0}})).then((e=>({...e,id:e.id}))),i.getCurrentKeyBlockHeight(),i.getNodeInfo()]);return(await Promise.all(bc.map((e=>e(o,{txType:a,node:i,account:c,height:A,consensusProtocolVersion:u,nodeNetworkId:l,parentTxTypes:n}))))).flat()}function Tc(e,t){let{_expectedMineRate:r=18e4,_microBlockCycle:n=3e3,_maxPollInterval:i=5e3}=t;const o={block:r,microblock:n}[e];return Math.min(o/3,i)}bc.push(((e,t)=>{let{encodedTx:r,signatures:n}=e,{account:i,nodeNetworkId:o,parentTxTypes:a}=t;if(void 0===(null!=r?r:n))return[];if(null==i)return[];if(1!==n.length)return[];const s=Nc.from([o,...a.includes(gr.PayingForTx)?["inner_tx"]:[]].join("-")),c=Bt([s,r.rlpEncoded]),A=Bt([s,Kt(r.rlpEncoded)]);return Zt(c,n[0],i.id)||Zt(A,n[0],i.id)?[]:[{message:"Signature cannot be verified, please ensure that you transaction have the correct prefix and the correct private key for the sender address",key:"InvalidSignature",checkedKeys:["encodedTx","signatures"]}]}),(async(e,t)=>{let{encodedTx:r,tx:n}=e,{node:i,parentTxTypes:o,txType:a}=t;return void 0===(null!=r?r:n)?[]:xc(Lt((null!=r?r:n).rlpEncoded,St.Transaction),i,[...o,a])}),((e,t)=>{let{ttl:r}=e,{height:n}=t;return void 0===r?[]:(r=+r,0===r||r>=n?[]:[{message:`TTL ${r} is already expired, current height is ${n}`,key:"ExpiredTTL",checkedKeys:["ttl"]}])}),((e,t)=>{var r,n;let{amount:i,fee:o,nameFee:a,tx:s}=e,{account:c,parentTxTypes:A,txType:u}=t;if(null==c)return[];if(void 0===(null!==(r=null!=i?i:o)&&void 0!==r?r:a))return[];null!==(n=o)&&void 0!==n||(o=0);const l=new S(o).plus(null!=a?a:0).plus(null!=i?i:0).plus(u===gr.PayingForTx?s.tx.encodedTx.tx.fee:0).minus(A.includes(gr.PayingForTx)?o:0);return l.lte(c.balance.toString())?[]:[{message:`Account balance ${c.balance.toString()} is not enough to execute the transaction that costs ${l.toFixed()}`,key:"InsufficientBalance",checkedKeys:["amount","fee","nameFee"]}]}),((e,t)=>{let r,{signatures:n}=e,{account:i,txType:o}=t;return null==i?[]:(o===gr.SignedTx&&"generalized"===i.kind&&0!==n.length&&(r="Generalized account can't be used to generate SignedTx with signatures"),o===gr.GaMetaTx&&"basic"===i.kind&&(r="Basic account can't be used to generate GaMetaTx"),null==r?[]:[{message:r,key:"InvalidAccountType",checkedKeys:["tag"]}])}),((e,t)=>{let{nonce:r}=e,{account:n,parentTxTypes:i}=t;if(null==r||null==n||i.includes(gr.GaMetaTx))return[];r=+r;const o=n.nonce+1;return r===o?[]:[{...r<o?{message:`Nonce ${r} is already used, valid nonce is ${o}`,key:"NonceAlreadyUsed"}:{message:`Nonce ${r} is too high, valid nonce is ${o}`,key:"NonceHigh"},checkedKeys:["nonce"]}]}),((e,t)=>{let{ctVersion:r,abiVersion:n}=e,{txType:i,consensusProtocolVersion:o}=t;if(!wt(o,vn))throw new W(`Unsupported protocol: ${o}`);null==r&&(r={abiVersion:n});const a=vn[o][i];return null==a?[]:Object.entries(r).some((e=>{let[t,r]=e;return!a[t].includes(+r)}))?[{message:`ABI/VM version ${JSON.stringify(r)} is wrong, supported is: ${JSON.stringify(a)}`,key:"VmAndAbiVersionMismatch",checkedKeys:["ctVersion","abiVersion"]}]:[]}),(async(e,t)=>{let{contractId:r}=e,{txType:n,node:i}=t;if(gr.ContractCallTx!==n)return[];try{const{active:e}=await i.getContract(r);return e?[]:[{message:`Contract ${r} is not active`,key:"ContractNotActive",checkedKeys:["contractId"]}]}catch(e){var o,a;if(null==(null===(o=e.response)||void 0===o||null===(a=o.parsedBody)||void 0===a?void 0:a.reason))throw e;return[{message:e.response.parsedBody.reason,key:"ContractNotFound",checkedKeys:["contractId"]}]}}));class _c extends U{constructor(e,t,r){super(e),this.name="InvalidTxError",this.validation=t,this.transaction=r}}async function Rc(e){let{onNode:t}=e;return(await t.getCurrentKeyBlockHeight()).height}async function Mc(e,t){var r;let{blocks:n=10,interval:i,onNode:o,...a}=t;null!==(r=i)&&void 0!==r||(i=Tc("microblock",a));const s=await Rc({onNode:o})+n;do{const t=await o.getTransactionByHash(e);if(-1!==t.blockHeight)return t;await Ct(i)}while(await Rc({onNode:o})<s);throw new K(n,e)}async function Dc(e,t){var r;let n,{interval:i,onNode:o,...a}=t;null!==(r=i)&&void 0!==r||(i=Tc("block",a));do{null!=n&&await Ct(i),n=(await o.getCurrentKeyBlockHeight()).height}while(n<e);return n}async function Oc(e,t){let{confirm:r=3,onNode:n,...i}=t;const{blockHeight:o}=await n.getTransactionByHash(e),a=await Dc(o+r,{onNode:n,...i}),{blockHeight:s}=await n.getTransactionByHash(e);switch(s){case-1:throw new $e(e);case o:return a;default:return Oc(e,{onNode:n,confirm:r,...i})}}async function zc(e,t){let{onNode:r,onAccount:n,verify:i=!0,waitMined:o=!0,confirm:a,...s}=t;if(i){const t=await xc(e,r);if(t.length>0){const r=`Transaction verification errors: ${t.map((e=>e.message)).join(", ")}`;throw new _c(r,t,e)}}try{let t;try{t=null!=n?`tx-${n.address}`:null}catch(e){t=null}const{txHash:i}=await r.postTransaction({tx:e},null!=t?{requestOptions:{customHeaders:{__queue:t}}}:{});if(o){const t=await Mc(i,{onNode:r,...s}),n={...t,hash:t.hash,rawTx:e};if(null!=a&&(!0===a||a>0)){const e="boolean"==typeof a?void 0:a;return{...n,confirmationHeight:await Oc(i,{onNode:r,confirm:e,...s})}}return n}return{hash:i,rawTx:e}}catch(t){throw Object.assign(t,{rawTx:e,verifyTx:async()=>xc(e,r)})}}async function kc(e,t){let{height:r,hash:n,onNode:i}=t;return null!=r?i.getAccountByPubkeyAndHeight(e,r):null!=n?i.getAccountByPubkeyAndHash(e,n):i.getAccountByPubkey(e)}async function Pc(e,t){let{format:r=et.AETTOS,...n}=t;const{balance:i}=await kc(e,n).catch((e=>{if(!Qt(e))throw e;return{balance:0n}}));return rt(i,{targetDenomination:r})}async function Uc(e){let{onNode:t}=e;return t.getCurrentGeneration()}async function Fc(e,t){let{onNode:r}=t;return"number"==typeof e?r.getGenerationByHeight(e):r.getGenerationByHash(e)}async function qc(e,t){let{onNode:r}=t;return(await r.getMicroBlockTransactionsByHash(e)).transactions}async function Lc(e,t){let{onNode:r}=t;return"number"==typeof e?r.getKeyBlockByHeight(e):r.getKeyBlockByHash(e)}async function Gc(e,t){let{onNode:r}=t;return r.getMicroBlockHeaderByHash(e)}const Hc=new Map;async function jc(e,t){const r=Hc.get(e);if(Hc.delete(e),null==r)throw new ee("Can't get dry-run request");let n;try{n=await t.protectedDryRunTxs({top:r[0].top,txEvents:r[0].txEvents,txs:r.map((e=>({tx:e.tx}))),accounts:Array.from(new Set(r.map((e=>e.accountAddress)))).map((e=>({pubKey:e,amount:Cn.amount})))})}catch(e){return void r.forEach((t=>{let{reject:r}=t;return r(e)}))}const{results:i,txEvents:o}=n;i.forEach(((e,t)=>{let{result:n,reason:i,...a}=e;const{resolve:s,reject:c,tx:A,accountAddress:u}=r[t];"ok"===n?s({...a,txEvents:o}):c(Object.assign(new Fe(i),{tx:A,accountAddress:u}))}))}async function Yc(e,t,r){var n;let{top:i,txEvents:o,combine:a,onNode:s}=r;const c=!0===a?[i,o].join():"immediate",A=null!==(n=Hc.get(c))&&void 0!==n?n:[];return Hc.set(c,A),new Promise(((r,n)=>{var u;A.push({tx:e,accountAddress:t,top:i,txEvents:o,resolve:r,reject:n}),!0===a?null!==(u=A.timeout)&&void 0!==u||(A.timeout=setTimeout((()=>{jc(c,s)}))):jc(c,s)}))}async function $c(e,t){let{onNode:r}=t;return r.getContractCode(e)}async function Kc(e,t){let{onNode:r}=t;return r.getContract(e)}async function Vc(e,t){let{onNode:r}=t;return r.getNameEntryByName(e)}async function Jc(e,t,r){let{verify:n=!0,resolveByNode:i=!1,onNode:o}=r;if(Nr(e)){if(n||i){const r=(await o.getNameEntryByName(e)).pointers.find((e=>e.key===t));if(null==r)throw new ne(e,t);if(i)return r.id}return Br(e)}try{return qt(e),e}catch(t){throw new oe(`Invalid name or address: ${e}`)}}var Wc,Xc={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)},Zc=new Uint8Array(16);function eA(){if(!Wc&&!(Wc="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Wc(Zc)}for(var tA=[],rA=0;rA<256;++rA)tA.push((rA+256).toString(16).substr(1));var nA=function(e,t,r){if(Xc.randomUUID&&!t&&!e)return Xc.randomUUID();var n=(e=e||{}).random||(e.rng||eA)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(var i=0;i<16;++i)t[r+i]=n[i];return t}return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return(tA[e[t+0]]+tA[e[t+1]]+tA[e[t+2]]+tA[e[t+3]]+"-"+tA[e[t+4]]+tA[e[t+5]]+"-"+tA[e[t+6]]+tA[e[t+7]]+"-"+tA[e[t+8]]+tA[e[t+9]]+"-"+tA[e[t+10]]+tA[e[t+11]]+tA[e[t+12]]+tA[e[t+13]]+tA[e[t+14]]+tA[e[t+15]]).toLowerCase()}(n)},iA=r(673),oA=r(8764).Buffer;const aA={async argon2id(e,t,r){const{memlimit_kib:n,opslimit:i}=r;return(0,iA.vp)(e,{hashLength:32,salt:t,timeCost:i,memoryCost:n,type:iA.MD})}},sA={"xsalsa20-poly1305":{encrypt:at().secretbox,decrypt(){const e=at().secretbox.open(...arguments);if(null==e)throw new _e;return e}}},cA={secret_type:"ed25519",symmetric_alg:"xsalsa20-poly1305",kdf:"argon2id",kdf_params:{memlimit_kib:65536,opslimit:3,parallelism:1}};function AA(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:cA.symmetric_alg;return sA[n].encrypt(e,r,t)}async function uA(e,t,r,n){return aA[r](e,t,n)}async function lA(e,t){let{crypto:r}=t;const n=oA.from(r.kdf_params.salt,"hex");return oA.from(function(e,t,r){return sA[arguments.length>3&&void 0!==arguments[3]?arguments[3]:cA.symmetric_alg].decrypt(e,r,t)}(oA.from(r.ciphertext,"hex"),await uA(e,n,r.kdf,r.kdf_params),oA.from(r.cipher_params.nonce,"hex"),r.symmetric_alg)).toString("hex")}async function dA(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:at().randomBytes(24),i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:at().randomBytes(16),o=arguments.length>5?arguments[5]:void 0;const a={...cA,...o},s=await uA(t,i,a.kdf,a.kdf_params),c="string"==typeof r?oA.from(r,"hex"):r;return{name:e,version:1,public_key:Ht(c),id:nA(),crypto:{secret_type:a.secret_type,symmetric_alg:a.symmetric_alg,ciphertext:oA.from(AA(c,s,n,a.symmetric_alg)).toString("hex"),cipher_params:{nonce:oA.from(n).toString("hex")},kdf:a.kdf,kdf_params:{...a.kdf_params,salt:oA.from(i).toString("hex")}}}}async function pA(e,t){var r,n;let{vmVersion:i,abiVersion:o,onNode:a}=t;const{consensusProtocolVersion:s}=await a.getNodeInfo();if(!wt(s,vn))throw new W("Not supported consensus protocol version");const c=vn[s];if(!wt(e,c))throw new Ke("Not supported tx type");const A=c[e];return null!==(r=o)&&void 0!==r||(o=A.abiVersion[0]),null!==(n=i)&&void 0!==n||(i=A.vmVersion[0]),{vmVersion:i,abiVersion:o}}async function hA(e,t){let{denomination:r,absoluteTtl:n,...i}=t;const o=i;let a;switch(e){case gr.SpendTx:case gr.OracleQueryTx:a="senderId";break;case gr.NameClaimTx:case gr.NameUpdateTx:case gr.NameRevokeTx:case gr.NameTransferTx:case gr.NamePreclaimTx:case gr.OracleRegisterTx:a="accountId";break;case gr.ContractCreateTx:case gr.GaAttachTx:a="ownerId";break;case gr.GaMetaTx:a="gaId";break;case gr.ContractCallTx:case gr.OracleExtendTx:case gr.OracleResponseTx:a="callerId";break;case gr.ChannelCloseSoloTx:case gr.ChannelSlashTx:case gr.ChannelSettleTx:case gr.ChannelSnapshotSoloTx:a="fromId";break;case gr.PayingForTx:a="payerId";break;default:throw new q("txType","valid transaction type",e)}var s;[gr.ContractCreateTx,gr.GaAttachTx].includes(e)&&(o.ctVersion=await pA(gr.ContractCreateTx,{...o,...o.ctVersion})),[gr.ContractCallTx,gr.GaMetaTx].includes(e)&&(o.abiVersion=(await pA(gr.ContractCallTx,o)).abiVersion),e===gr.OracleRegisterTx&&(null!==(s=o.abiVersion)&&void 0!==s||(o.abiVersion=Bn.NO_ABI)),e===gr.PayingForTx&&(o.tx=Fn(o.tx));const c=o[a];if(null==c)throw new Ge(`Transaction field ${a} is missed`);const A=await async function(e,t){var r;let{senderId:n,nonce:i,ttl:o=fn,absoluteTtl:a,strategy:s,onNode:c}=t;if(null!==(r=i)&&void 0!==r||(i=(await c.getAccountNextNonce(n,{strategy:s}).catch((e=>{if(!Qt(e))throw e;return{nextNonce:1}}))).nextNonce),0!==o){if(o<0)throw new q("ttl","greater or equal to 0",o);o+=!0===a?0:(await c.getCurrentKeyBlock()).height}return{ttl:o,nonce:i}}(0,{...o,senderId:c,absoluteTtl:n});return Un({...o,...A},e,{denomination:r}).tx}var fA=r(2182),gA=r(246),mA=r(8826),yA=r.n(mA),IA=r(8764).Buffer;const CA=yA().ModeOfOperation.ecb;function EA(e,t){const r=Tt(e);return new CA(r).encrypt(t)}function BA(e,t){const r=IA.from(t),n=Tt(e);return new CA(n).decrypt(r)}class wA extends k{constructor(e){super(e),this.name="DerivationError"}}const QA=IA.from("ed25519 seed"),vA=2147483648;function NA(e,t){let{secretKey:r,chainCode:n}=e;if(t<vA)throw new wA(`Segment ${t} is not hardened`);const i=IA.allocUnsafe(4);i.writeUInt32BE(t,0);const o=Bt([IA.alloc(1,0),r,i]),a=(0,fA.full)(o,n);return{secretKey:a.slice(0,32),chainCode:a.slice(32)}}function bA(e,t){const r=""===e?[]:(0,gA.fromString)(e).toPathArray();return r.forEach(((e,t)=>{if(e<vA)throw new wA(`Segment #${t+1} is not hardened`)})),r.reduce(((e,t)=>NA(e,t)),t)}function SA(e){const t=(0,fA.full)(e,QA);return{secretKey:t.slice(0,32),chainCode:t.slice(32)}}function xA(e,t){if(!["m","m/"].includes(e.slice(0,2)))throw new wA("Root element is required");const r=SA(t);return bA(e.slice(2),r)}function TA(e){const{secretKey:t,publicKey:r}=e;return{secretKey:IA.from(t).toString("hex"),publicKey:Lt(r,St.AccountAddress)}}function _A(e){return at().sign.keyPair.fromSeed(e)}function RA(e,t){const r=xA("m/44h/457h",e);return{secretKey:IA.from(EA(t,r.secretKey)).toString("hex"),chainCode:IA.from(EA(t,r.chainCode)).toString("hex")}}function MA(e,t,r){const n={secretKey:BA(t,IA.from(e.secretKey,"hex")),chainCode:BA(t,IA.from(e.chainCode,"hex"))};return new Array(r).fill(void 0).map(((e,t)=>TA(_A(bA(`${t}h/0h/0h`,n).secretKey))))}const DA=(e,t)=>({...TA(_A(bA(`${t}h/0h/0h`,xA("m/44h/457h",e)).secretKey)),idx:t});async function OA(e,t){const r=await t.onAccount.signTransaction(e,{...t,networkId:await t.onNode.getNetworkId()});return!0===t.innerTx?{hash:qn(r),rawTx:r}:zc(r,t)}async function zA(e,t,r){return OA(await hA(gr.SpendTx,{...r,senderId:r.onAccount.address,recipientId:await Jc(t,"account_pubkey",r),amount:e}),r)}async function kA(e,t,r){if(e<0||e>1)throw new q("fraction","a number between 0 and 1",e);const n=await Jc(t,"account_pubkey",r),i=r.onAccount.address,o=new S(await Pc.bind(r.onAccount)(i,r)),a=o.times(e).integerValue(S.ROUND_HALF_UP),{tx:{fee:s}}=Fn(await hA(gr.SpendTx,{...r,senderId:i,recipientId:n,amount:a}),gr.SpendTx),c=a.plus(s).gt(o)?o.minus(s):a;return OA(await hA(gr.SpendTx,{...r,senderId:i,recipientId:n,amount:c}),r)}async function PA(e,t){return OA(await hA(gr.PayingForTx,{...t,payerId:t.onAccount.address,tx:e}),t)}async function UA(e,t){return OA(await hA(gr.NameRevokeTx,{...t,nameId:e,accountId:t.onAccount.address}),t)}async function FA(e,t,r){let{extendPointers:n,...i}=r;const o={...!0===n&&Object.fromEntries((await Vc(e,i)).pointers.map((e=>{let{key:t,id:r}=e;return[t,r]}))),...t};return OA(await hA(gr.NameUpdateTx,{clientTtl:cr,nameTtl:or,...i,nameId:e,accountId:i.onAccount.address,pointers:Object.entries(o).map((e=>{let[t,r]=e;return{key:t,id:r}}))}),i)}async function qA(e,t,r){return OA(await hA(gr.NameTransferTx,{...r,nameId:e,accountId:r.onAccount.address,recipientId:t}),r)}async function LA(e,t){const r=await Vc(e,t);return Object.freeze({...r,id:r.id,owner:r.owner,async update(r,n){return{...await FA(e,r,{...t,...n}),...await LA(e,{...t,...n})}},async transfer(r,n){return{...await qA(e,r,{...t,...n}),...await LA(e,{...t,...n})}},async revoke(r){return UA(e,{...t,...r})},async extendTtl(){let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:or,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(r>or||r<=0)throw new q("nameTtl",`a number between 1 and ${or} blocks`,r);return{...await FA(e,{},{...t,...n,nameTtl:r,extendPointers:!0}),...await LA(e,{...t,...n})}}})}async function GA(e,t,r){const n=await hA(gr.NameClaimTx,{...r,accountId:r.onAccount.address,nameSalt:t,name:e}),i=await OA(n,r);if(!Rr(e)){const t=null!=i.blockHeight&&i.blockHeight>0?await LA(e,r):{};return Object.assign(i,t)}return i}async function HA(e,t){const r=Yt(),n=await Rc(t),i=wr(e,r),o=await hA(gr.NamePreclaimTx,{...t,accountId:t.onAccount.address,commitmentId:i});return Object.freeze({...await OA(o,t),height:n,salt:r,commitmentId:i,async claim(n){return GA(e,r,{...t,...n})}})}async function jA(e,t,r){return GA(e,0,{...r,nameFee:t})}var YA=r(3023),$A=r(8764).Buffer;const KA=class{async $createDelegationSignature(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;const r={...this.$options,...t},n=this.$options.address;if(null==r.onAccount)throw new L("Can't create delegation signature without account");if(null==n)throw new Be("Can't create delegation signature without address");return r.onAccount.sign(Bt([$A.from(await r.onNode.getNetworkId()),...!0===r.omitAddress?[]:[qt(r.onAccount.address)],...e.map((e=>Nr(e)?Br(e):e)).map((e=>qt(e))),qt(n)]),r)}async $compile(){if(null!=this.$options.bytecode)return this.$options.bytecode;if(null==this.$options.sourceCode)throw new L("Can't compile without source code");return this.$options.bytecode=(await this.$options.onCompiler.compileContract({code:this.$options.sourceCode,options:{fileSystem:this.$options.fileSystem}})).bytecode,this.$options.bytecode}_handleCallError(e,t){let r,{returnType:n,returnValue:i}=e;switch(n){case"ok":return;case"revert":r=this._calldata.decodeFateString(i);break;case"error":r=qt(i).toString();break;default:throw new ee(`Unknown return type: ${n}`)}throw new ve(r,t)}async _sendAndProcess(e,t){t={...this.$options,...t};const r=await OA(e,t),n={hash:r.hash,tx:Fn(r.rawTx),txData:r,rawTx:r.rawTx};if(null==r.blockHeight)return n;const{callInfo:i}=await this.$options.onNode.getTransactionInfoByHash(r.hash);return Object.assign(n.txData,i),this._handleCallError(i,e),{...n,result:i}}async _estimateGas(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{result:n}=await this.$call(e,t,{...r,callStatic:!0});if(null==n)throw new te;const{gasUsed:i}=n;return Math.floor(1.25*i)}async $deploy(e,t){var r;const n={...this.$options,...t};if(null==this.$options.bytecode&&await this.$compile(),!0===n.callStatic)return this.$call("init",e,n);if(null!=this.$options.address)throw new Ie;const i=n.onAccount.address,o=await hA(gr.ContractCreateTx,{...n,gasLimit:null!==(r=n.gasLimit)&&void 0!==r?r:await this._estimateGas("init",e,n),callData:this._calldata.encode(this._name,"init",e),code:this.$options.bytecode,ownerId:i});this.$options.address=Ln(o);const{hash:a,...s}=await this._sendAndProcess(o,n);return{...s,owner:i,transaction:a,address:this.$options.address}}_getFunctionACI(e){const t=this._aci.encodedAci.contract.functions.find((t=>t.name===e));if(null!=t)return t;if("init"===e)return{payable:!1};throw new Ne(`Function ${e} doesn't exist in contract`)}async $call(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n={...this.$options,...r},i=this._getFunctionACI(e),o=this.$options.address,{onNode:a}=n;if(null==e)throw new Qe;if("init"===e&&!1===n.callStatic)throw new Ee('"init" can be called only via dryRun');if("init"!==e&&n.amount>0&&!1===i.payable)throw new be(n.amount,e);let s;try{s=n.onAccount.address}catch(e){if(!0!==n.callStatic||!(e instanceof V&&"Account should be an address (ak-prefixed string), or instance of AccountBase, got undefined instead"===e.message||e instanceof Xe))throw e;s=Cn.pub}const c=this._calldata.encode(this._name,e,t);let A;if(!0===n.callStatic){"number"==typeof n.top&&(n.top=(await Lc(n.top,{onNode:a})).hash);const t={...n,onNode:a,callData:c};let r;if(null==n.nonce&&null!=n.top&&(n.nonce=(await kc(s,{hash:n.top,onNode:a})).nonce+1),"init"===e){if(null==this.$options.bytecode)throw new L('Can\'t dry-run "init" without bytecode');r=await hA(gr.ContractCreateTx,{...t,code:this.$options.bytecode,ownerId:s})}else{if(null==o)throw new Be("Can't dry-run contract without address");r=await hA(gr.ContractCallTx,{...t,callerId:s,contractId:o})}const{callObj:i,...u}=await Yc(r,s,n);if(null==i)throw new te;this._handleCallError({returnType:i.returnType,returnValue:i.returnValue},r),A={...u,tx:Fn(r),result:i}}else{var u;if(null==o)throw new Be("Can't call contract without address");const r=await hA(gr.ContractCallTx,{...n,gasLimit:null!==(u=n.gasLimit)&&void 0!==u?u:await this._estimateGas(e,t,n),callerId:s,contractId:o,callData:c});A=await this._sendAndProcess(r,n)}return!0!==n.callStatic&&null==A.txData.blockHeight||(A.decodedResult=null!=i.returns&&"unit"!==i.returns&&"init"!==e&&this._calldata.decode(this._name,e,A.result.returnValue),A.decodedEvents=this.$decodeEvents(A.result.log,n)),A}_getContractNameByEvent(e,t,r){let{contractAddressToName:n}=r;const i={...this.$options.contractAddressToName,...n};if(null!=i[e])return i[e];const o=[this._aci.encodedAci,...this._aci.externalEncodedAci].filter((e=>{let{contract:t}=e;return null==t?void 0:t.event})).map((e=>{let{contract:t}=e;return[t.name,t.event.variant]})).map((e=>{let[t,r]=e;return r.map((e=>[t,Object.keys(e)[0],Object.values(e)[0]]))})).flat().filter((e=>{let[,r]=e;return BigInt(`0x${Kt(r).toString("hex")}`)===t})).filter(((e,t,r)=>{let[,,n]=e;return!r.slice(0,t).some((e=>{return t=e[2],r=n,JSON.stringify(t)===JSON.stringify(r);var t,r}))}));switch(o.length){case 0:throw new Se(t.toString(),e);case 1:return o[0][0];default:throw new xe(e,o)}}$decodeEvents(e){let{omitUnknown:t,...r}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.map((e=>{const n=e.topics.map((e=>BigInt(e)));let i;try{i=this._getContractNameByEvent(e.address,n[0],r)}catch(e){if(null!=t&&t&&e instanceof Se)return null;throw e}const o=this._calldata.decodeEvent(i,e.data,n),[a,s]=Object.entries(o)[0];return{name:a,args:s,contract:{name:i,address:e.address}}})).filter((e=>null!=e))}static async initialize(e){let{onCompiler:t,onNode:r,sourceCode:n,bytecode:i,aci:o,address:a,fileSystem:s,validateBytecode:c,...A}=e;if(null==o&&null!=n&&(o=await t.generateACI({code:n,options:{fileSystem:s}})),null==o)throw new we;if(null!=a&&(a=await Jc(a,"contract_pubkey",{resolveByNode:!0,onNode:r})),null==a&&null==n&&null==i)throw new Be("Can't create instance by ACI without address");if(null!=a&&null==(await Kc(a,{onNode:r})).active)throw new Ce(a);if(null!=c){if(null==a)throw new Be("Can't validate bytecode without contract address");const e=(await $c(a,{onNode:r})).bytecode;if(!(null!=n?await t.validateByteCode({bytecode:e,source:n,options:{fileSystem:s}}).then((()=>!0),(()=>!1)):i===e))throw new ye(null!=n?"source code":"bytecode")}return new KA({onCompiler:t,onNode:r,sourceCode:n,bytecode:i,aci:o,address:a,fileSystem:s,...A})}constructor(e){var t=this;let{aci:r,...n}=e;this._aci=r,this._name=r.encodedAci.contract.name,this._calldata=new YA.Encoder([r.encodedAci,...r.externalEncodedAci]),this.$options={callStatic:!1,...n},Object.assign(this,Object.fromEntries(this._aci.encodedAci.contract.functions.map((e=>{let{name:r,arguments:n,stateful:i}=e;const o="init"!==r&&!i;return[r,async function(){for(var e=arguments.length,i=new Array(e),a=0;a<e;a++)i[a]=arguments[a];const s=i.length===n.length+1?i.pop():{};if("object"!=typeof s)throw new V(`Options should be an object: ${s}`);return"init"===r?t.$deploy(i,{callStatic:o,...s}):t.$call(r,i,{callStatic:o,...s})}]}))))}};var VA=KA;function JA(e,t,r){var n;let{interval:i,onNode:o,...a}=r;null!==(n=i)&&void 0!==n||(i=Tc("microblock",a));const s=new Set,c=async()=>{var r;const n=(null!==(r=(await o.getOracleQueriesByPubkey(e)).oracleQueries)&&void 0!==r?r:[]).filter((e=>{let{id:t}=e;return!s.has(t)}));n.forEach((e=>{let{id:t}=e;return s.add(t)})),n.length>0&&t(n)};let A=!1;return(async()=>{for(;!A;)await c().catch(console.error),await Ct(i)})(),()=>{A=!0}}async function WA(e,t,r){var n;let i,o,a,{interval:s,onNode:c,...A}=r;null!==(n=s)&&void 0!==n||(s=Tc("microblock",A));do{({response:a,ttl:o}=await c.getOracleQueryByPubkeyAndQueryId(e,t));const r=qt(a);if(r.length>0)return r.toString();await Ct(s),i=await Rc({onNode:c})}while(o>=i);throw new $(i)}async function XA(e,t,r){const n=await r.onNode.getOracleQueryByPubkeyAndQueryId(e,t);return{...n,decodedQuery:qt(n.query).toString(),decodedResponse:qt(n.response).toString(),respond:async(n,i)=>tu(e,t,n,{...r,...i}),pollForResponse:async n=>WA(e,t,{...r,...n})}}async function ZA(e,t,r){var n;null!==(n=r.queryFee)&&void 0!==n||(r.queryFee=(await r.onNode.getOracleByPubkey(e)).queryFee.toString());const i=r.onAccount.address,o=await hA(gr.OracleQueryTx,{queryTtlType:yn.type,queryTtlValue:yn.value,responseTtlType:In.type,responseTtlValue:In.value,...r,oracleId:e,senderId:i,query:t}),{nonce:a}=Fn(o,gr.OracleQueryTx).tx,s=Er(i,a,e);return{...await OA(o,r),...await XA(e,s,r)}}async function eu(e,t){const r=await hA(gr.OracleExtendTx,{oracleTtlType:mn.type,oracleTtlValue:mn.value,...t,callerId:t.onAccount.address,oracleId:e});return{...await OA(r,t),...await ru(e,t)}}async function tu(e,t,r,n){const i=await hA(gr.OracleResponseTx,{responseTtlType:In.type,responseTtlValue:In.value,...n,callerId:n.onAccount.address,oracleId:e,queryId:t,response:r});return{...await OA(i,n),...await ru(e,n)}}async function ru(e,t){return{...await t.onNode.getOracleByPubkey(e),queries:(await t.onNode.getOracleQueriesByPubkey(e)).oracleQueries,...Et({pollQueries:JA,postQuery:ZA,respondToQuery:tu,extendOracle:eu,getQuery:XA},(r=>{let[n,i]=r;return[n,function(){for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];const a=n[n.length-1];return null!=a&&"object"==typeof a&&a.constructor===Object?Object.assign(a,{...t,...a}):n.push(t),i(e,...n)}]}))}}async function nu(e,t,r){const n=r.onAccount.address,i=await hA(gr.OracleRegisterTx,{queryFee:gn,oracleTtlValue:mn.value,oracleTtlType:mn.type,...r,accountId:n,queryFormat:e,responseFormat:t});return{...await OA(i,r),...await ru(Lt(qt(n),St.OracleAddress),r)}}var iu=r(8764).Buffer;async function ou(e,t,r,n){var i;let{onAccount:o,onCompiler:a,onNode:s,...c}=n;const A=o.address;if("generalized"===(await kc(A,{onNode:s})).kind)throw new L(`Account ${A} is already GA`);const u=await VA.initialize({onAccount:o,onCompiler:a,onNode:s,sourceCode:t}),l=await hA(gr.GaAttachTx,{...c,onNode:s,code:await u.$compile(),gasLimit:null!==(i=c.gasLimit)&&void 0!==i?i:await u._estimateGas("init",r,c),ownerId:A,callData:u._calldata.encode(u._name,"init",r),authFun:Kt(e)}),d=Ln(l),{hash:p,rawTx:h}=await OA(l,{onNode:s,onAccount:o,onCompiler:a,...c});return Object.freeze({owner:A,transaction:p,rawTx:h,gaContractId:d})}async function au(e,t){let{onNode:r}=t;return new Uint8Array(Kt(Bt([iu.from(await r.getNetworkId()),qt(e)])))}var su=r(7445);function cu(e,t,r){return t in e?su(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Au(e){return new Proxy({},{...Object.fromEntries(["apply","construct","defineProperty","deleteProperty","getOwnPropertyDescriptor","getPrototypeOf","isExtensible","ownKeys","preventExtensions","set","setPrototypeOf"].map((e=>[e,()=>{throw new X(`${e} proxy request`)}]))),get(t,r,n){const i=e(),o=Reflect.get(i,r,n);return"function"==typeof o?o.bind(i):o},has(t,r){return Reflect.has(e(),r)}})}const{InvalidTxError:uu,...lu}=t,du={...lu,...o,...i,...a,...s};class pu{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};cu(this,"_options",{denomination:et.AETTOS}),Object.assign(this._options,e)}_resolveAccount(e){if("string"==typeof e)throw new X("Address in AccountResolver");if("object"==typeof e)return e;throw new V(`Account should be an address (ak-prefixed string), or instance of AccountBase, got ${String(e)} instead`)}_getOptions(){return{...this._options,onAccount:Au((()=>this._resolveAccount()))}}async buildTx(e,t){return hA(e,{...this._getOptions(),...t})}async initializeContract(e){const{onNode:t,onCompiler:r,...n}=this._getOptions();if(null==r||null==t)throw new q("onCompiler, onNode","provided",null);return VA.initialize({...n,onNode:t,onCompiler:r,...e})}}Object.assign(pu.prototype,Et(du,(e=>{let[t,r]=e;return[t,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];t.length=r.length;const i=t[t.length-1];return t[t.length-1]={...this._getOptions(),...i,...null!=(null==i?void 0:i.onAccount)&&{onAccount:this._resolveAccount(i.onAccount)}},r(...t)}]})));var hu=pu;class fu extends hu{constructor(){let{nodes:e=[],...t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super(t),cu(this,"pool",new Map),e.forEach(((e,t)=>{let{name:r,instance:n}=e;return this.addNode(r,n,0===t)}))}get compilerApi(){if(null==this._options.onCompiler)throw new O("You can't use Compiler API. Compiler is not ready!");return this._options.onCompiler}get api(){return this.ensureNodeConnected(),this.pool.get(this.selectedNodeName)}addNode(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(this.pool.has(e))throw new ze(e);this.pool.set(e,t),(r||null==this.selectedNodeName)&&this.selectNode(e)}selectNode(e){if(!this.pool.has(e))throw new ke(`Node with name ${e} not in pool`);this.selectedNodeName=e}isNodeConnected(){return null!=this.selectedNodeName}ensureNodeConnected(){if(!this.isNodeConnected())throw new ke("You can't use Node API. Node is not connected or not defined!")}async getNodeInfo(){return this.ensureNodeConnected(),{name:this.selectedNodeName,...await this.api.getNodeInfo()}}async getNodesInPool(){return Promise.all(Array.from(this.pool.entries()).map((async e=>{let[t,r]=e;return{name:t,...await r.getNodeInfo()}})))}addresses(){return[]}get address(){return this._resolveAccount().address}async sign(e){let{onAccount:t,...r}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._resolveAccount(t).sign(e,r)}async signTransaction(e){let{onAccount:t,...r}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=null!==this.selectedNodeName?await this.api.getNetworkId():void 0;return this._resolveAccount(t).signTransaction(e,{networkId:n,...r})}async signMessage(e){let{onAccount:t,...r}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._resolveAccount(t).signMessage(e,r)}_getOptions(){return{...super._getOptions(),onNode:Au((()=>this.api)),onCompiler:Au((()=>this.compilerApi))}}}class gu extends fu{constructor(){let{accounts:e,...t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super(t),cu(this,"accounts",{}),null==e||e.forEach(((e,t)=>this.addAccount(e,{select:0===t})))}_resolveAccount(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.selectedAddress;if("string"==typeof e){const t=e;if(qt(t),null==this.accounts[t])throw new re(e);e=this.accounts[t]}return super._resolveAccount(e)}addresses(){return Object.keys(this.accounts)}addAccount(e){let{select:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{address:r}=e;this.accounts[r]=e,!0===t&&this.selectAccount(r)}removeAccount(e){if(null==this.accounts[e])throw new re(e);delete this.accounts[e],this.selectedAddress===e&&delete this.selectedAddress}selectAccount(e){if(qt(e),null==this.accounts[e])throw new re(e);this.selectedAddress=e}}class mu{}let yu,Iu,Cu,Eu,Bu;!function(e){e.to_waellet="to_waellet",e.to_aepp="to_aepp"}(yu||(yu={})),function(e){e.window="window",e.extension="extension"}(Iu||(Iu={})),function(e){e.subscribe="subscribe",e.unsubscribe="unsubscribe"}(Cu||(Cu={})),function(e){e.readyToConnect="connection.announcePresence",e.updateAddress="address.update",e.address="address.get",e.connect="connection.open",e.sign="transaction.sign",e.signMessage="message.sign",e.subscribeAddress="address.subscribe",e.updateNetwork="networkId.update",e.closeConnection="connection.close"}(Eu||(Eu={})),function(e){e.CONNECTED="CONNECTED",e.DISCONNECTED="DISCONNECTED",e.WAITING_FOR_CONNECTION_REQUEST="WAITING_FOR_CONNECTION_REQUEST"}(Bu||(Bu={}));const wu=[];class Qu extends T{toJSON(){return{code:this.code,message:this.message,data:this.data}}static deserialize(e){const t=wu.find((t=>t.code===e.code));if(null==t)throw new ee(`Can't find RpcError with code: ${e.code}`);return new t(e.data)}}class vu extends Qu{constructor(e){super("Invalid transaction"),cu(this,"code",2),this.data=e,this.name="RpcInvalidTransactionError"}}cu(vu,"code",2),wu.push(vu);class Nu extends Qu{constructor(e){super("Broadcast failed"),cu(this,"code",3),this.data=e,this.name="RpcBroadcastError"}}cu(Nu,"code",3),wu.push(Nu);class bu extends Qu{constructor(e){super("Operation rejected by user"),cu(this,"code",4),this.data=e,this.name="RpcRejectedByUserError"}}cu(bu,"code",4),wu.push(bu);class Su extends Qu{constructor(){super("Unsupported Protocol Version"),cu(this,"code",5),this.name="RpcUnsupportedProtocolError"}}cu(Su,"code",5),wu.push(Su);class xu extends Qu{constructor(e){super("Wallet deny your connection request"),cu(this,"code",9),this.data=e,this.name="RpcConnectionDenyError"}}cu(xu,"code",9),wu.push(xu);class Tu extends Qu{constructor(){super("You are not connected to the wallet"),cu(this,"code",10),this.name="RpcNotAuthorizeError"}}cu(Tu,"code",10),wu.push(Tu);class _u extends Qu{constructor(e){super(`You are not subscribed for account ${e}`),cu(this,"code",11),this.data=e,this.name="RpcPermissionDenyError"}}cu(_u,"code",11),wu.push(_u);class Ru extends Qu{constructor(){super("The peer failed to execute your request due to unknown error"),cu(this,"code",12),this.name="RpcInternalError"}}cu(Ru,"code",12),wu.push(Ru);class Mu extends Qu{constructor(){super("Method not found"),cu(this,"code",-32601),this.name="RpcMethodNotFoundError"}}cu(Mu,"code",-32601),wu.push(Mu);var Du=r(8764).Buffer;class Ou extends mu{constructor(e,t){super(),this._rpcClient=e,this.address=t}async sign(){throw new X("RAW signing using wallet")}async signTransaction(e){let{innerTx:t,networkId:r}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null!=t)throw new X("innerTx option in AccountRpc");if(null==r)throw new q("networkId","provided",r);const n=await this._rpcClient.request(Eu.sign,{onAccount:this.address,tx:e,returnSigned:!0,networkId:r});if(null==n.signedTransaction)throw new W("signedTransaction is missed in wallet response");return n.signedTransaction}async signMessage(e){const{signature:t}=await this._rpcClient.request(Eu.signMessage,{onAccount:this.address,message:e});return Du.from(t,"hex")}}function zu(e,t){Pu(e,t),t.add(e)}function ku(e,t,r){Pu(e,t),t.set(e,r)}function Pu(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Uu(e,t,r){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return r}var Fu=new WeakMap,qu=new WeakMap,Lu=new WeakMap,Gu=new WeakSet,Hu=new WeakSet,ju=new WeakSet,Yu=new WeakSet;class $u{constructor(e,t,r){zu(this,Yu),zu(this,ju),zu(this,Hu),zu(this,Gu),ku(this,Fu,{writable:!0,value:new Map}),ku(this,qu,{writable:!0,value:0}),ku(this,Lu,{writable:!0,value:void 0}),this.connection=e,jn(this,Lu,r),e.connect(Uu(this,Gu,Ku).bind(this),t)}async request(e,t){return Uu(this,Hu,Vu).call(this,jn(this,qu,Hn(this,qu)+1),e,t),new Promise(((e,t)=>{Hn(this,Fu).set(Hn(this,qu),{resolve:e,reject:t})}))}notify(e,t){Uu(this,Hu,Vu).call(this,void 0,e,t)}}async function Ku(e,t){if("2.0"!==(null==e?void 0:e.jsonrpc))throw new ae(JSON.stringify(e));if("result"in e||"error"in e)return void Uu(this,Yu,Wu).call(this,e);const r=e;let n,i;try{if(!(r.method in Hn(this,Lu)))throw new Mu;const e=r.method;n=await Hn(this,Lu)[e](r.params,t)}catch(e){i=e instanceof Qu?e:new Ru}null!=r.id&&Uu(this,ju,Ju).call(this,r.id,r.method,n,i)}function Vu(e,t,r){this.connection.sendMessage({jsonrpc:"2.0",...null!=e?{id:e}:{},method:t,...null!=r?{params:r}:{}})}function Ju(e,t,r,n){this.connection.sendMessage({jsonrpc:"2.0",id:e,method:t,...null!=n?{error:n}:{result:r}})}function Wu(e){let{id:t,error:r,result:n}=e;const i=Hn(this,Fu).get(t);if(null==i)throw new se(t);null!=r?i.reject(Qu.deserialize(r)):i.resolve(n),Hn(this,Fu).delete(t)}class Xu extends fu{constructor(e){let{name:t,onAddressChange:r=(()=>{}),onDisconnect:n=(()=>{}),onNetworkChange:i=(()=>{}),...o}=e;super(o),this.onAddressChange=r,this.onDisconnect=n,this.onNetworkChange=i,this.name=t}_resolveAccount(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.addresses()[0];if("string"==typeof e){const t=e;if(qt(t),!this.addresses().includes(t))throw new ce(t);this._ensureConnected(),e=new Ou(this.rpcClient,t)}return null==e&&this._ensureAccountAccess(),super._resolveAccount(e)}addresses(){if(null==this._accounts)return[];const e=Object.keys(this._accounts.current)[0];return[...null!=e?[e]:[],...Object.keys(this._accounts.connected)]}async connectToWallet(e){let t,{connectNode:r=!1,name:n="wallet-node",select:i=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null!=this.rpcClient)throw new We("You are already connected to wallet");const o=new $u(e,(()=>{delete this.rpcClient,delete this._accounts,this.onDisconnect(t)}),{[Eu.updateAddress]:e=>{this._accounts=e,this.onAddressChange(e)},[Eu.updateNetwork]:e=>{const{node:t}=e;null!=t&&this.addNode(t.name,new vc(t.url),!0),this.onNetworkChange(e)},[Eu.closeConnection]:e=>{t=e,o.connection.disconnect()},[Eu.readyToConnect]:()=>{}}),{node:a,...s}=await o.request(Eu.connect,{name:this.name,version:1,connectNode:r});if(r){if(null==a)throw new Ze("Missing URLs of the Node");this.addNode(n,new vc(a.url),i)}return this.rpcClient=o,s}disconnectWallet(){this._ensureConnected(),this.rpcClient.notify(Eu.closeConnection,{reason:"bye"}),this.rpcClient.connection.disconnect()}async askAddresses(){return this._ensureAccountAccess(),this.rpcClient.request(Eu.address,void 0)}async subscribeAddress(e,t){this._ensureConnected();const r=await this.rpcClient.request(Eu.subscribeAddress,{type:e,value:t});return this._accounts=r.address,r}_ensureConnected(){if(null==this.rpcClient)throw new Xe("You are not connected to Wallet")}_ensureAccountAccess(){if(this._ensureConnected(),0===this.addresses().length)throw new ue}}var Zu=r(4400);const el=r.n(Zu)()({storeAsString:!0}),tl=e=>{if("object"==typeof e&&null!==e&&e.constructor===Object)return Et(e,(e=>{let[t,r]=e;return[t,tl(r)]}));if(Array.isArray(e))return e.map((e=>tl(e)));if("string"==typeof e&&new S(e).toString(10)===e){const t=new S(e);return t.toJSON=()=>t.toString(10),t}return e};var rl={stringify:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return el.stringify(tl(t[0]),...t.slice(1))},parse:el.parse},nl=r(8764).Buffer;class il extends gu{constructor(e){let{name:t,id:r,type:n,onConnection:i,onSubscription:o,onDisconnect:a,onAskAccounts:s,...c}=e;super(c),cu(this,"_clients",new Map),this.onConnection=i,this.onSubscription=o,this.onDisconnect=a,this.onAskAccounts=s,this.name=t,this.id=r,this._type=n}_pushAccountsToApps(){null!=this._clients&&Array.from(this._clients.keys()).filter((e=>this._isRpcClientSubscribed(e))).map((e=>this._getClient(e).rpc)).forEach((e=>e.notify(Eu.updateAddress,this.getAccounts())))}selectAccount(e){super.selectAccount(e),this._pushAccountsToApps()}addAccount(e,t){super.addAccount(e,t),this._pushAccountsToApps()}_getNode(){return this.ensureNodeConnected(),{node:{url:this.api.$host,name:this.selectedNodeName}}}async selectNode(e){super.selectNode(e);const t=await this.api.getNetworkId();Array.from(this._clients.keys()).filter((e=>this._isRpcClientConnected(e))).map((e=>this._getClient(e))).forEach((e=>{e.rpc.notify(Eu.updateNetwork,{networkId:t,...e.connectNode&&this._getNode()})}))}_getClient(e){const t=this._clients.get(e);if(null==t)throw new Ae(e);return t}_isRpcClientSubscribed(e){return this._isRpcClientConnected(e)&&0!==this._getClient(e).addressSubscription.size}_isRpcClientConnected(e){return Bu.CONNECTED===this._getClient(e).status&&this._getClient(e).rpc.connection.isConnected()}_disconnectRpcClient(e){const t=this._getClient(e);t.rpc.connection.disconnect(),t.status=Bu.DISCONNECTED,t.addressSubscription=new Set}removeRpcClient(e){this._disconnectRpcClient(e),this._clients.delete(e)}addRpcClient(e){const t=nA();let r;const n={id:t,status:Bu.WAITING_FOR_CONNECTION_REQUEST,addressSubscription:new Set,connectNode:!1,rpc:new $u(e,(()=>{this._clients.delete(t),this.onDisconnect(t,r)}),{[Eu.closeConnection]:e=>{r=e,this._disconnectRpcClient(t)},[Eu.connect]:async(e,r)=>{let{name:i,version:o,icons:a,connectNode:s}=e;if(1!==o)throw new Su;return await this.onConnection(t,{name:i,icons:a,connectNode:s},r),n.status=Bu.CONNECTED,n.connectNode=s,{...await this.getWalletInfo(),...s&&this._getNode()}},[Eu.subscribeAddress]:async(e,r)=>{let{type:i,value:o}=e;if(!this._isRpcClientConnected(t))throw new Tu;switch(await this.onSubscription(t,{type:i,value:o},r),i){case Cu.subscribe:n.addressSubscription.add(o);break;case Cu.unsubscribe:n.addressSubscription.delete(o);break;default:throw new ee(`Unknown subscription type: ${i}`)}return{subscription:Array.from(n.addressSubscription),address:this.getAccounts()}},[Eu.address]:async(e,r)=>{if(!this._isRpcClientSubscribed(t))throw new Tu;return await this.onAskAccounts(t,e,r),this.addresses()},[Eu.sign]:async(e,r)=>{let{tx:n,onAccount:i=this.address,returnSigned:o}=e;if(!this._isRpcClientConnected(t))throw new Tu;if(!this.addresses().includes(i))throw new _u(i);const a={onAccount:i,aeppOrigin:r,aeppRpcClientId:t};if(o)return{signedTransaction:await this.signTransaction(n,a)};try{return rl.parse(rl.stringify({transactionHash:await this.send(n,{...a,verify:!1})}))}catch(e){const t=await xc(n,this.api);if(t.length>0)throw new vu(t);throw new Nu(e.message)}},[Eu.signMessage]:async(e,r)=>{let{message:n,onAccount:i=this.address}=e;if(!this._isRpcClientConnected(t))throw new Tu;if(!this.addresses().includes(i))throw new _u(i);const o={onAccount:i,aeppOrigin:r,aeppRpcClientId:t};return{signature:nl.from(await this.signMessage(n,o)).toString("hex")}}})};return this._clients.set(t,n),t}async shareWalletInfo(e){this._getClient(e).rpc.notify(Eu.readyToConnect,await this.getWalletInfo())}async getWalletInfo(){return{id:this.id,name:this.name,networkId:await this.api.getNetworkId(),origin:window.location.origin,type:this._type}}getAccounts(){return{current:null!=this.selectedAddress?{[this.selectedAddress]:{}}:{},connected:this.addresses().filter((e=>e!==this.selectedAddress)).reduce(((e,t)=>({...e,[t]:{}})),{})}}}var ol=r(8764).Buffer;const al=new WeakMap;class sl extends mu{constructor(e){if(super(),64!==(e="string"==typeof e?ol.from(e,"hex"):e).length)throw new q("secretKey","64 bytes",e.length);al.set(this,e),this.address=Lt(Jt(al.get(this)).publicKey,St.AccountAddress)}static generate(){return new sl(Wt().secretKey)}async sign(e,t){return Xt(e,al.get(this))}async signTransaction(e){let{innerTx:t,networkId:r,...n}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null==r)throw new q("networkId","provided",r);const i=[r];!0===t&&i.push("inner_tx");const o=qt(e),a=Bt([ol.from(i.join("-")),Kt(o)]);return Un({encodedTx:o,signatures:[await this.sign(a,n)]},gr.SignedTx).tx}async signMessage(e,t){return this.sign(er(e),t)}}var cl=new WeakMap;class Al extends mu{constructor(e){var t,r,n;super(),n={writable:!0,value:void 0},function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t=this,r=cl),r.set(t,n),qt(e),this.address=e}async sign(){throw new X("Can't sign using generalized account")}async signMessage(){throw new X("Can't sign using generalized account")}async signTransaction(e,t){let{authData:r,onCompiler:n,onNode:i}=t;if(null==r||null==n||null==i)throw new q("authData, onCompiler, onNode","provided",null);const{callData:o,sourceCode:a,args:s,gasLimit:c}=r,A=null!=o?o:await(async()=>{if(null==Hn(this,cl)){const e=await kc(this.address,{onNode:i});if("generalized"!==e.kind)throw new q("account kind","generalized",e.kind);jn(this,cl,e.authFun)}if(null==Hn(this,cl))throw new ee("Account in generalised, but authFun not provided");if(null==a||null==s)throw new me("Auth data must contain source code and arguments.");const e=await VA.initialize({onCompiler:n,onNode:i,sourceCode:a});return e._calldata.encode(e._name,Hn(this,cl),s)})(),u=await hA(gr.GaMetaTx,{tx:Un({encodedTx:qt(e),signatures:[]},gr.SignedTx).rlpEncoded,gaId:this.address,authData:A,gasLimit:c,nonce:0,onNode:i});return Un({encodedTx:qt(u),signatures:[]},gr.SignedTx).tx}}var ul=r(8764).Buffer;const ll=224;class dl extends mu{constructor(e,t,r){super(),this.transport=e,this.index=t,this.address=r,e.decorateAppAPIMethods(this,["signTransaction","signMessage"],"w0w")}async sign(){throw new X("RAW signing using Ledger HW")}async signTransaction(e){let{innerTx:t,networkId:r}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null!=t)throw new X("innerTx option in AccountLedger");if(null==r)throw new q("networkId","provided",r);const n=qt(e);let i=0;const o=ul.from(r),a=[];for(;i!==n.length;){const e=0===i?141-o.length:150,t=i+e>n.length?n.length-i:e,r=ul.alloc(0===i?9+o.length+t:t);if(0===i){let e=r.writeUInt32BE(this.index,0);e=r.writeUInt32BE(n.length,e),e=r.writeUInt8(o.length,e),e+=o.copy(r,e,0,o.length),n.copy(r,e,0,150-e)}else n.copy(r,0,i,i+t);a.push(r),i+=t}const s=await a.reduce((async(e,t,r)=>(await e,this.transport.send(ll,4,0===r?0:128,0,t))),Promise.resolve(ul.alloc(0)));return Un({encodedTx:n,signatures:[s.subarray(0,64)]},gr.SignedTx).tx}async signMessage(e){let t=0;const r=ul.from(e),n=[];for(;t!==r.length;){const e=0===t?142:150,i=t+e>r.length?r.length-t:e,o=ul.alloc(0===t?8+i:i);0===t?(o.writeUInt32BE(this.index,0),o.writeUInt32BE(r.length,4),r.copy(o,8,t,t+i)):r.copy(o,0,t,t+i),n.push(o),t+=i}const i=await n.reduce((async(e,t,r)=>(await e,this.transport.send(ll,8,0===r?0:128,0,t))),Promise.resolve(ul.alloc(0)));return i.subarray(0,64)}}var pl=r(8764).Buffer;class hl{constructor(e){this.transport=e,this.versionCheckPromise=this.getAppConfiguration().then((e=>{let{version:t}=e;const r=[t,"0.4.4","0.5.0"];if(!Yn(...r))throw new Z("app on ledger",...r)})),e.decorateAppAPIMethods(this,["getAddress","getAppConfiguration"],"w0w")}async getAppConfiguration(){await this.versionCheckPromise;const e=await this.transport.send(ll,6,0,0);return{version:[e[1],e[2],e[3]].join(".")}}async getAddress(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];await this.versionCheckPromise;const r=pl.alloc(4);r.writeUInt32BE(e,0);const n=await this.transport.send(ll,2,t?1:0,0,r),i=n[0];return n.subarray(1,1+i).toString("ascii")}async initialize(e){return await this.versionCheckPromise,new dl(this.transport,e,await this.getAddress(e))}async discover(e){let t=0;const r=[];let n;do{null!=n&&r.push(n),n=await this.initialize(t),t+=1}while(await e.getAccountByPubkey(n.address).then((()=>!0),(()=>!1)));return r}}const fl={type:{name:"Composite",className:"Contract",modelProperties:{code:{serializedName:"code",required:!0,type:{name:"String"}},options:{serializedName:"options",type:{name:"Composite",className:"CompileOpts"}}}}},gl={type:{name:"Composite",className:"CompileOpts",modelProperties:{fileSystem:{serializedName:"file_system",type:{name:"Dictionary",value:{type:{name:"any"}}}},srcFile:{serializedName:"src_file",type:{name:"String"}}}}},ml={type:{name:"Composite",className:"Aci",modelProperties:{encodedAci:{serializedName:"encoded_aci",required:!0,type:{name:"Dictionary",value:{type:{name:"any"}}}},externalEncodedAci:{serializedName:"external_encoded_aci",type:{name:"Sequence",element:{type:{name:"Dictionary",value:{type:{name:"any"}}}}}},interface:{serializedName:"interface",required:!0,type:{name:"String"}}}}},yl={type:{name:"Composite",className:"CompilerError",modelProperties:{type:{serializedName:"type",required:!0,type:{name:"String"}},pos:{serializedName:"pos",type:{name:"Composite",className:"ErrorPos"}},message:{serializedName:"message",required:!0,type:{name:"String"}},context:{serializedName:"context",type:{name:"String"}}}}},Il={type:{name:"Composite",className:"ErrorPos",modelProperties:{file:{serializedName:"file",type:{name:"String"}},line:{serializedName:"line",required:!0,type:{name:"Number"}},col:{serializedName:"col",required:!0,type:{name:"Number"}}}}},Cl={type:{name:"Composite",className:"ByteCode",modelProperties:{bytecode:{serializedName:"bytecode",required:!0,type:{name:"String"}}}}},El={type:{name:"Composite",className:"SophiaCallResultInput",modelProperties:{source:{serializedName:"source",required:!0,type:{name:"String"}},options:{serializedName:"options",type:{name:"Composite",className:"CompileOpts"}},function:{serializedName:"function",required:!0,type:{name:"String"}},callResult:{serializedName:"call-result",required:!0,type:{name:"String"}},callValue:{serializedName:"call-value",required:!0,type:{name:"String"}}}}},Bl={type:{name:"Composite",className:"BytecodeCallResultInput",modelProperties:{bytecode:{serializedName:"bytecode",required:!0,type:{name:"String"}},function:{serializedName:"function",required:!0,type:{name:"String"}},callResult:{serializedName:"call-result",required:!0,type:{name:"String"}},callValue:{serializedName:"call-value",required:!0,type:{name:"String"}}}}},wl={type:{name:"Composite",className:"DecodedCallresult",modelProperties:{function:{serializedName:"function",required:!0,type:{name:"String"}},result:{serializedName:"result",required:!0,type:{name:"Dictionary",value:{type:{name:"any"}}}}}}},Ql={type:{name:"Composite",className:"FunctionCallInput",modelProperties:{source:{serializedName:"source",required:!0,type:{name:"String"}},options:{serializedName:"options",type:{name:"Composite",className:"CompileOpts"}},function:{serializedName:"function",required:!0,type:{name:"String"}},arguments:{serializedName:"arguments",required:!0,type:{name:"Sequence",element:{type:{name:"String"}}}}}}},vl={type:{name:"Composite",className:"Calldata",modelProperties:{calldata:{serializedName:"calldata",required:!0,type:{name:"String"}}}}},Nl={type:{name:"Composite",className:"DecodeCalldataBytecode",modelProperties:{calldata:{serializedName:"calldata",required:!0,type:{name:"String"}},bytecode:{serializedName:"bytecode",required:!0,type:{name:"String"}}}}},bl={type:{name:"Composite",className:"DecodedCalldata",modelProperties:{function:{serializedName:"function",required:!0,type:{name:"String"}},arguments:{serializedName:"arguments",required:!0,type:{name:"Sequence",element:{type:{name:"Dictionary",value:{type:{name:"any"}}}}}}}}},Sl={type:{name:"Composite",className:"ErrorModel",modelProperties:{reason:{serializedName:"reason",required:!0,type:{name:"String"}}}}},xl={type:{name:"Composite",className:"DecodeCalldataSource",modelProperties:{source:{serializedName:"source",required:!0,type:{name:"String"}},options:{serializedName:"options",type:{name:"Composite",className:"CompileOpts"}},calldata:{serializedName:"calldata",required:!0,type:{name:"String"}},function:{serializedName:"function",required:!0,type:{name:"String"}}}}},Tl={type:{name:"Composite",className:"ByteCodeInput",modelProperties:{bytecode:{serializedName:"bytecode",required:!0,type:{name:"String"}}}}},_l={type:{name:"Composite",className:"FateAssembler",modelProperties:{fateAssembler:{serializedName:"fate-assembler",required:!0,type:{name:"String"}}}}},Rl={type:{name:"Composite",className:"ValidateByteCodeInput",modelProperties:{bytecode:{serializedName:"bytecode",required:!0,type:{name:"String"}},source:{serializedName:"source",required:!0,type:{name:"String"}},options:{serializedName:"options",type:{name:"Composite",className:"CompileOpts"}}}}},Ml={type:{name:"Composite",className:"CompilerVersion",modelProperties:{version:{serializedName:"version",required:!0,type:{name:"String"}}}}},Dl={type:{name:"Composite",className:"ApiVersion",modelProperties:{apiVersion:{serializedName:"api-version",required:!0,type:{name:"String"}}}}},Ol={type:{name:"Composite",className:"SophiaBinaryData",modelProperties:{sophiaType:{serializedName:"sophia-type",required:!0,type:{name:"String"}},data:{serializedName:"data",required:!0,type:{name:"String"}}}}},zl={type:{name:"Composite",className:"SophiaJsonData",modelProperties:{data:{serializedName:"data",required:!0,type:{name:"Dictionary",value:{type:{name:"any"}}}}}}},kl={parameterPath:["options","contentType"],mapper:{defaultValue:"application/json",isConstant:!0,serializedName:"Content-Type",type:{name:"String"}}},Pl={parameterPath:"body",mapper:fl},Ul={parameterPath:"accept",mapper:{defaultValue:"application/json",isConstant:!0,serializedName:"Accept",type:{name:"String"}}},Fl={parameterPath:"$host",mapper:{serializedName:"$host",required:!0,type:{name:"String"}},skipEncoding:!0},ql={parameterPath:"body",mapper:El},Ll={parameterPath:"body",mapper:Bl},Gl={parameterPath:"body",mapper:Ql},Hl={parameterPath:"body",mapper:Nl},jl={parameterPath:"body",mapper:xl},Yl={parameterPath:"body",mapper:Tl},$l={parameterPath:"body",mapper:Rl};class Kl extends qo{constructor(e,t){var r,n,i;if(void 0===e)throw new Error("'$host' cannot be null");t||(t={});const o="azsdk-js-compiler/1.0.0-beta.1",a=t.userAgentOptions&&t.userAgentOptions.userAgentPrefix?`${t.userAgentOptions.userAgentPrefix} ${o}`:`${o}`,s={requestContentType:"application/json; charset=utf-8",...t,userAgentOptions:{userAgentPrefix:a},baseUri:null!==(r=null!==(n=t.endpoint)&&void 0!==n?n:t.baseUri)&&void 0!==r?r:"{$host}"};super(s),null!==(i=t)&&void 0!==i&&i.pipeline&&t.pipeline.getOrderedPolicies().length>0&&(t.pipeline.getOrderedPolicies().some((e=>e.name===xo))||(this.pipeline.removePolicy({name:xo}),this.pipeline.addPolicy(_o({scopes:`${s.baseUri}/.default`,challengeCallbacks:{authorizeRequestOnChallenge:Lo}})))),this.$host=e}generateACI(e,t){return this.sendOperationRequest({body:e,options:t},Jl)}compileContract(e,t){return this.sendOperationRequest({body:e,options:t},Wl)}decodeCallResult(e,t){return this.sendOperationRequest({body:e,options:t},Xl)}decodeCallResultBytecode(e,t){return this.sendOperationRequest({body:e,options:t},Zl)}encodeCalldata(e,t){return this.sendOperationRequest({body:e,options:t},ed)}decodeCalldataBytecode(e,t){return this.sendOperationRequest({body:e,options:t},td)}decodeCalldataSource(e,t){return this.sendOperationRequest({body:e,options:t},rd)}getFateAssemblerCode(e,t){return this.sendOperationRequest({body:e,options:t},nd)}validateByteCode(e,t){return this.sendOperationRequest({body:e,options:t},id)}getCompilerVersion(e,t){return this.sendOperationRequest({body:e,options:t},od)}version(e){return this.sendOperationRequest({options:e},ad)}apiVersion(e){return this.sendOperationRequest({options:e},sd)}api(e){return this.sendOperationRequest({options:e},cd)}}const Vl=yi(c,!1),Jl={path:"/aci",httpMethod:"POST",responses:{200:{bodyMapper:ml},400:{bodyMapper:{type:{name:"Sequence",element:{type:{name:"Composite",className:"CompilerError"}}}},isError:!0}},requestBody:Pl,urlParameters:[Fl],headerParameters:[kl,Ul],mediaType:"json",serializer:Vl},Wl={path:"/compile",httpMethod:"POST",responses:{200:{bodyMapper:Cl},400:{bodyMapper:{type:{name:"Sequence",element:{type:{name:"Composite",className:"CompilerError"}}}},isError:!0}},requestBody:Pl,urlParameters:[Fl],headerParameters:[kl,Ul],mediaType:"json",serializer:Vl},Xl={path:"/decode-call-result",httpMethod:"POST",responses:{200:{bodyMapper:{type:{name:"any"}}},400:{bodyMapper:{type:{name:"Sequence",element:{type:{name:"Composite",className:"CompilerError"}}}},isError:!0}},requestBody:ql,urlParameters:[Fl],headerParameters:[kl,Ul],mediaType:"json",serializer:Vl},Zl={path:"/decode-call-result/bytecode",httpMethod:"POST",responses:{200:{bodyMapper:wl},400:{bodyMapper:{type:{name:"Sequence",element:{type:{name:"Composite",className:"CompilerError"}}}},isError:!0}},requestBody:Ll,urlParameters:[Fl],headerParameters:[kl,Ul],mediaType:"json",serializer:Vl},ed={path:"/encode-calldata",httpMethod:"POST",responses:{200:{bodyMapper:vl},400:{bodyMapper:{type:{name:"Sequence",element:{type:{name:"Composite",className:"CompilerError"}}}},isError:!0}},requestBody:Gl,urlParameters:[Fl],headerParameters:[kl,Ul],mediaType:"json",serializer:Vl},td={path:"/decode-calldata/bytecode",httpMethod:"POST",responses:{200:{bodyMapper:bl},400:{bodyMapper:Sl,isError:!0}},requestBody:Hl,urlParameters:[Fl],headerParameters:[kl,Ul],mediaType:"json",serializer:Vl},rd={path:"/decode-calldata/source",httpMethod:"POST",responses:{200:{bodyMapper:bl},400:{bodyMapper:{type:{name:"Sequence",element:{type:{name:"Composite",className:"CompilerError"}}}},isError:!0}},requestBody:jl,urlParameters:[Fl],headerParameters:[kl,Ul],mediaType:"json",serializer:Vl},nd={path:"/fate-assembler",httpMethod:"POST",responses:{200:{bodyMapper:_l},400:{bodyMapper:Sl,isError:!0}},requestBody:Yl,urlParameters:[Fl],headerParameters:[kl,Ul],mediaType:"json",serializer:Vl},id={path:"/validate-byte-code",httpMethod:"POST",responses:{200:{},400:{bodyMapper:{type:{name:"Sequence",element:{type:{name:"Composite",className:"CompilerError"}}}},isError:!0}},requestBody:$l,urlParameters:[Fl],headerParameters:[kl,Ul],mediaType:"json",serializer:Vl},od={path:"/compiler-version",httpMethod:"POST",responses:{200:{bodyMapper:Ml},400:{bodyMapper:Sl,isError:!0}},requestBody:Yl,urlParameters:[Fl],headerParameters:[kl,Ul],mediaType:"json",serializer:Vl},ad={path:"/version",httpMethod:"GET",responses:{200:{bodyMapper:Ml},500:{bodyMapper:Sl,isError:!0}},urlParameters:[Fl],headerParameters:[Ul],serializer:Vl},sd={path:"/api-version",httpMethod:"GET",responses:{200:{bodyMapper:Dl},500:{bodyMapper:Sl,isError:!0}},urlParameters:[Fl],headerParameters:[Ul],serializer:Vl},cd={path:"/api",httpMethod:"GET",responses:{200:{bodyMapper:{type:{name:"Dictionary",value:{type:{name:"any"}}}}},400:{bodyMapper:Sl,isError:!0}},urlParameters:[Fl],headerParameters:[Ul],serializer:Vl};class Ad extends Kl{constructor(e){let{ignoreVersion:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(super(e,{allowInsecureConnection:!0,additionalPolicies:[Jn((e=>{let t="";return"reason"in e&&(t+=` ${e.reason}${null!=e.parameter?` in ${e.parameter}`:""}${null!=e.info?` (${JSON.stringify(e.info)})`:""}`),Array.isArray(e)&&(t+=`\n${e.map((e=>`${e.type}:${e.pos.line}:${e.pos.col}: ${e.message}${null!=e.context?`(${e.context})`:""}`)).map((e=>e.trim())).join("\n")}`),t}))]}),!0!==t){const e=this.apiVersion().then((e=>{let{apiVersion:t}=e;return t}));this.pipeline.addPolicy(Wn("compiler","/api-version",e,"7.0.1","8.0.0"))}}}function ud(e){return e.replace(/_./g,(e=>e[1].toUpperCase()))}var ld=r(5840);function dd(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];const[i,...o]=r;e._eventEmitter.emit(i,...o)}function pd(e,t){var r;if(null==t)throw new ge;e._fsm=t,null!=(null==t||null===(r=t.handler)||void 0===r?void 0:r.enter)&&t.handler.enter(e),yd(e)}function hd(e,t){t!==e._status&&(e._status=t,dd(e,"statusChanged",t))}function fd(e,t){e._state=t,dd(e,"stateChanged",t)}function gd(e,t){e._options.debug&&console.log("Send message: ",t),e._websocket.send(rl.stringify({jsonrpc:"2.0",...t}))}function md(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};gd(e,{method:t,params:r})}async function yd(e){if(e._isActionQueueLocked)return;const t=e._actionQueue;if(0===t.length)return;const r=t.findIndex((t=>t.guard(e,e._fsm)));if(-1===r)return;e._actionQueue=t.filter(((e,t)=>r!==t)),e._isActionQueueLocked=!0;const n=await t[r].action(e,e._fsm);e._isActionQueueLocked=!1,pd(e,n)}async function Id(e,t){const{handler:r,state:n}=e._fsm;pd(e,await Promise.resolve(r(e,t,n)))}function Cd(e){e._websocket.close(),clearTimeout(e._pingTimeoutId)}function Ed(e){clearTimeout(e._pingTimeoutId),e._pingTimeoutId=setTimeout((()=>{md(e,"channels.system",{action:"ping"}),e._pingTimeoutId=setTimeout((()=>{Cd(e),dd(e,"error",new pe)}),15e3)}),1e4)}async function Bd(e,t,r){return new Promise(((n,i)=>{const o=e._nextRpcMessageId;e._nextRpcMessageId+=1,e._rpcCallbacks.set(o,(e=>{if(null!=e.error){var t;const r=null!==(t=e.error.data[0].message)&&void 0!==t?t:"";i(new le(e.error.message+r))}else n(e.result)})),gd(e,{method:t,id:o,params:r})}))}async function wd(e,t,r,n){var i;let o;if(null!=r.tx)o=await n(r.tx);else{if(null==r.signed_tx)throw new D("Can't find transaction in message");o=await async function(e,t){const{signatures:r,encodedTx:n}=Fn(e,gr.SignedTx).tx,i=await t(Lt(n.rlpEncoded,St.Transaction));if("string"==typeof i){const{tx:e}=Fn(i,gr.SignedTx);return Un({signatures:r.concat(e.signatures),encodedTx:e.encodedTx.rlpEncoded},gr.SignedTx).tx}return i}(r.signed_tx,n)}const a="string"!=typeof o,s=null!=r.tx?"tx":"signed_tx";return md(e,t,a?{error:null!==(i=o)&&void 0!==i?i:1}:{[s]:o}),a}function Qd(e,t,r){var n;return null==r||null===(n=r.reject)||void 0===n||n.call(r,Object.assign(new he(`Unexpected message received:\n\n${JSON.stringify(t)}`),{wsMessage:t})),{handler:_d}}function vd(e,t,r,n){if(null!=n&&"channels.update"===t.method)return n(e,t,r);if("channels.conflict"===t.method)return r.resolve({accepted:!1,errorCode:t.params.data.error_code,errorMessage:t.params.data.error_msg}),{handler:_d};if("channels.info"===t.method&&"aborted_update"===t.params.data.event)return r.resolve({accepted:!1}),{handler:_d};if(null!=t.error){const e=t.error.data.map((e=>e.code));return e.includes(1001)?r.reject(new H("Insufficient balance")):e.includes(1002)?r.reject(new L("Amount cannot be negative")):r.reject(new de(t.error.message)),{handler:_d}}return Qd(0,t,r)}function Nd(e,t){if("channels.info"===t.method){const r=t.params.data.event;let n=null;return"channel_accept"===r&&(n="accepted"),"funding_created"===r&&(n="halfSigned"),null!=n?(hd(e,n),{handler:Sd}):"channel_reestablished"===t.params.data.event?{handler:Td}:"fsm_up"===t.params.data.event?(e._fsmId=t.params.data.fsm_id,{handler:Nd}):{handler:Nd}}var r;if("channels.error"===t.method)return dd(e,"error",new de(null==t||null===(r=t.payload)||void 0===r?void 0:r.message)),{handler:Od}}async function bd(e,t,r){return"channels.info"===t.method&&"fsm_up"===t.params.data.event?(e._fsmId=t.params.data.fsm_id,fd(e,(await Bd(e,"channels.get.offchain_state",{})).signed_tx),{handler:_d}):Qd(0,t,r)}async function Sd(e,t){const r="initiator"===e._options.role?"initiator_sign":"responder_sign";if(t.method===`channels.sign.${r}`)return await wd(e,`channels.${r}`,t.params.data,(async t=>e._options.sign(r,t))),{handler:xd}}function xd(e,t){if("channels.on_chain_tx"===t.method){const{info:r}=t.params.data,{role:n}=e._options;if("funding_signed"===r&&"initiator"===n||"funding_created"===r&&"responder"===n)return{handler:function t(r,n){if("channels.info"===n.method)switch(n.params.data.event){case"funding_created":case"own_funding_locked":return{handler:t};case"funding_locked":return{handler:Td}}if("channels.on_chain_tx"===n.method)return dd(e,"onChainTx",n.params.data.tx,{info:n.params.data.info,type:n.params.data.type}),{handler:t}}}}if("channels.info"===t.method&&"funding_signed"===t.params.data.event&&"initiator"===e._options.role)return e._channelId=t.params.channel_id,hd(e,"signed"),{handler:xd}}function Td(e,t){if("channels.info"===t.method&&"open"===t.params.data.event)return e._channelId=t.params.channel_id,{handler(t,r){if("channels.update"===r.method)return fd(e,r.params.data.state),{handler:_d}}}}async function _d(e,t,r){switch(t.method){case"channels.info":switch(t.params.data.event){case"update":case"withdraw_created":case"deposit_created":return{handler:Rd};case"own_withdraw_locked":case"withdraw_locked":case"own_deposit_locked":case"deposit_locked":case"peer_disconnected":case"channel_reestablished":case"open":return dd(e,t.params.data.event),{handler:_d};case"fsm_up":return e._fsmId=t.params.data.fsm_id,{handler:_d};case"timeout":case"close_mutual":case"shutdown":return{handler:_d};case"closing":return hd(e,"closing"),{handler:_d};case"closed_confirmed":return hd(e,"closed"),{handler:Od};case"died":return hd(e,"died"),{handler:Od}}break;case"channels.on_chain_tx":return dd(e,"onChainTx",t.params.data.tx,{info:t.params.data.info,type:t.params.data.type}),{handler:_d};case"channels.leave":return{handler:_d};case"channels.update":return fd(e,t.params.data.state),{handler:_d};case"channels.sign.shutdown_sign_ack":return Rd(e,t,r)}}async function Rd(e,t,r){var n;const[,i]=null!==(n=t.method.match(/^channels\.sign\.([^.]+)$/))&&void 0!==n?n:[];return null==i?Qd(0,t,r):await wd(e,`channels.${i}`,t.params.data,(async r=>e._options.sign(i,r,{updates:t.params.data.updates})))?{handler:function e(t,n){return null!=n.error?{handler:e,state:r}:"channels.conflict"===n.method?{handler:_d}:Qd(0,n,r)},state:r}:{handler:_d}}async function Md(e,t,r){return"channels.sign.shutdown_sign"!==t.method?Qd(0,t,r):(await wd(e,"channels.shutdown_sign",t.params.data,(async e=>r.sign(e))),{handler(e,t){return"channels.on_chain_tx"!==t.method?Qd(0,t,r):{handler:Od,state:r}},state:r})}function Dd(e,t,r){return"channels.leave"===t.method?(r.resolve({channelId:t.params.channel_id,signedTx:t.params.data.state}),Cd(e),{handler:Od}):"channels.error"===t.method?(r.reject(new de(t.data.message)),{handler:_d}):Qd(0,t,r)}function Od(e,t,r){return null==r?{handler:Od}:"closing"===t.params.data.event?{handler:Od,state:r}:"channel_closed"===t.params.data.info?(r.closeTx=t.params.data.tx,{handler:Od,state:r}):"closed_confirmed"===t.params.data.event?(r.resolve(r.closeTx),{handler:Od}):{handler:Od,state:r}}_d.enter=e=>{hd(e,"open")};var zd=r(7187);class kd{constructor(){cu(this,"_eventEmitter",new zd.EventEmitter),cu(this,"_nextRpcMessageId",0),cu(this,"_rpcCallbacks",new Map),cu(this,"_messageQueue",[]),cu(this,"_isMessageQueueLocked",!1),cu(this,"_actionQueue",[]),cu(this,"_isActionQueueLocked",!1),cu(this,"_status","disconnected")}static async initialize(e){return kd._initialize(new kd,e)}static async _initialize(e,t){return await async function(e,t,r,n){let{url:i,...o}=n;e._options={url:i,...o},e._fsm={handler:t};const a=new URL(i);Object.entries(o).filter((e=>{let[t]=e;return!["sign","debug"].includes(t)})).forEach((e=>{let[t,r]=e;return a.searchParams.set(t.replace(/[A-Z]/g,(e=>`_${e.toLowerCase()}`)),r.toString())})),a.searchParams.set("protocol","json-rpc"),hd(e,"connecting"),e._websocket=new ld.w3cwebsocket(a.toString()),await new Promise(((t,n)=>{Object.assign(e._websocket,{onerror:n,onopen:async()=>{if(t(),hd(e,"connected"),null!=o.reconnectTx){pd(e,{handler:r});const t=(await Bd(e,"channels.get.offchain_state",{})).signed_tx;fd(e,t)}Ed(e)},onclose:()=>{hd(e,"disconnected"),clearTimeout(e._pingTimeoutId)},onmessage:t=>{let{data:r}=t;return function(e,t){const r=rl.parse(t);if(e._options.debug&&console.log("Receive message: ",r),null==r.id)"channels.message"!==r.method?"channels.system.pong"!==r.method?(e._messageQueue.push(r),async function(e){if(!e._isMessageQueueLocked){for(e._isMessageQueueLocked=!0;e._messageQueue.length>0;){const t=e._messageQueue.shift();if(null==t)throw new te;try{await Id(e,t)}catch(r){dd(e,"error",new fe(r,t))}}e._isMessageQueueLocked=!1}}(e)):r.params.channel_id!==e._channelId&&null!=e._channelId||Ed(e):dd(e,"message",r.params.data.message);else{const t=e._rpcCallbacks.get(r.id);if(null==t)return void dd(e,"error",new D(`Can't find callback by id: ${r.id}`));try{t(r)}finally{e._rpcCallbacks.delete(r.id)}}}(e,r)}})}))}(e,null!=t.existingFsmId?bd:Nd,_d,t),e}on(e,t){this._eventEmitter.on(e,t)}off(e,t){this._eventEmitter.removeListener(e,t)}disconnect(){return Cd(this)}status(){return this._status}async state(){return e=await Bd(this,"channels.get.offchain_state",{}),Object.entries(e).reduce(((e,t)=>{let[r,n]=t;return{...e,[ud(r)]:n}}),{});var e}round(){if(null==this._state)return null;const{txType:e,tx:t}=Fn(this._state,gr.SignedTx).tx.encodedTx;switch(e){case gr.ChannelCreateTx:return 1;case gr.ChannelOffChainTx:case gr.ChannelWithdrawTx:case gr.ChannelDepositTx:return t.round;default:return null}}id(){if(null==this._channelId)throw new D("Channel is not initialized");return this._channelId}fsmId(){if(null==this._fsmId)throw new D("Channel is not initialized");return this._fsmId}async enqueueAction(e){return async function(e,t,r){const n=new Promise(((n,i)=>{e._actionQueue.push({guard:t,action(){const e=r();return{...e,state:{...e.state,resolve:n,reject:i}}}})}));return yd(e),n}(this,((e,t)=>(null==t?void 0:t.handler)===_d),e)}async leave(){return this.enqueueAction((()=>(md(this,"channels.leave"),{handler:Dd})))}async shutdown(e){return this.enqueueAction((()=>(md(this,"channels.shutdown"),{handler:Md,state:{sign:e}})))}static async reconnect(e,t){const{sign:r}=e;return kd.initialize({...e,reconnectTx:await r("reconnect",Un(t,gr.ChannelClientReconnectTx).tx)})}}class Pd extends kd{async update(e,t,r,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];return this.enqueueAction((()=>{md(this,"channels.update.new",{from:e,to:t,amount:r,meta:i});const o=async(e,t,r)=>"channels.sign.update"===t.method?await wd(this,"channels.update",t.params.data,(async e=>n(e,{updates:t.params.data.updates})))?{handler:o,state:r}:{handler:(e,t)=>vd(this,t,r,(()=>(fd(this,t.params.data.state),r.resolve({accepted:!0,signedTx:t.params.data.state}),{handler:_d}))),state:r}:"channels.error"===t.method?(r.reject(new de(t.data.message)),{handler:_d}):vd(this,t,r);return{handler:o}}))}async poi(e){let{accounts:t,contracts:r}=e;return(await Bd(this,"channels.get.poi",{accounts:t,contracts:r})).poi}async balances(e){return Object.fromEntries((await Bd(this,"channels.get.balances",{accounts:e})).map((e=>[e.account,e.balance])))}async awaitingActionTx(e,t,r){if(t.method!==`channels.sign.${e}_tx`)return Qd(0,t,r);const n=(t,i)=>{var o;if("channels.on_chain_tx"===i.method)return null===(o=r.onOnChainTx)||void 0===o||o.call(r,i.params.data.tx),{handler:n,state:r};if("channels.info"===i.method&&[`own_${e}_locked`,`${e}_locked`].includes(i.params.data.event)){var a;const t="deposit"===e?"Deposit":"Withdraw",o=i.params.data.event.startsWith("own_");return null===(a=r[`on${o?"Own":""}${t}Locked`])||void 0===a||a.call(r),{handler:n,state:r}}return vd(this,i,r,(()=>(fd(this,i.params.data.state),r.resolve({accepted:!0,signedTx:i.params.data.state}),{handler:_d})))},{sign:i}=r;return await wd(this,`channels.${e}_tx`,t.params.data,(async e=>i(e,{updates:t.params.data.updates}))),{handler:n,state:r}}async withdraw(e,t){let{onOnChainTx:r,onOwnWithdrawLocked:n,onWithdrawLocked:i}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.enqueueAction((()=>(md(this,"channels.withdraw",{amount:e}),{handler:async(e,t,r)=>this.awaitingActionTx("withdraw",t,r),state:{sign:t,onOnChainTx:r,onOwnWithdrawLocked:n,onWithdrawLocked:i}})))}async deposit(e,t){let{onOnChainTx:r,onOwnDepositLocked:n,onDepositLocked:i}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.enqueueAction((()=>(md(this,"channels.deposit",{amount:e}),{handler:async(e,t,r)=>this.awaitingActionTx("deposit",t,r),state:{sign:t,onOnChainTx:r,onOwnDepositLocked:n,onDepositLocked:i}})))}async sendMessage(e,t){const r="object"==typeof e?JSON.stringify(e):e;"connecting"===this.status()&&(await new Promise((e=>{const t=r=>{"connecting"!==r&&(e(),this.off("statusChanged",t))};this.on("statusChanged",t)})),await Ct(500)),md(this,"channels.message",{info:r,to:t})}}function Ud(e){return Object.entries(e).reduce(((e,t)=>{let[r,n]=t;return{...e,[ud(r)]:n}}),{})}class Fd extends Pd{static async initialize(e){return kd._initialize(new Fd,e)}async createContract(e,t){let{code:r,callData:n,deposit:i,vmVersion:o,abiVersion:a}=e;return this.enqueueAction((()=>(md(this,"channels.update.new_contract",{code:r,call_data:n,deposit:i,vm_version:o,abi_version:a}),{handler:async(e,t,r)=>"channels.sign.update"!==t.method?Qd(0,t,r):(await wd(this,"channels.update",t.params.data,(async e=>r.sign(e))),{handler:(e,t,r)=>vd(this,t,r,(()=>{const{round:e}=Fn(t.params.data.state,gr.SignedTx).tx.encodedTx.tx,n="initiator"===this._options.role?"initiatorId":"responderId",i=this._options[n];return fd(this,t.params.data.state),r.resolve({accepted:!0,address:Vt(i,e),signedTx:t.params.data.state}),{handler:_d}})),state:r}),state:{sign:t}})))}async callContract(e,t){let{amount:r,callData:n,contract:i,abiVersion:o}=e;return this.enqueueAction((()=>(md(this,"channels.update.call_contract",{amount:r,call_data:n,contract_id:i,abi_version:o}),{handler:async(e,t,r)=>"channels.sign.update"!==t.method?Qd(0,t,r):(await wd(this,"channels.update",t.params.data,(async e=>r.sign(e,{updates:t.params.data.updates}))),{handler:(e,t,r)=>vd(this,t,r,(()=>(fd(this,t.params.data.state),r.resolve({accepted:!0,signedTx:t.params.data.state}),{handler:_d}))),state:r}),state:{sign:t}})))}async forceProgress(e,t){let{amount:r,callData:n,contract:i,abiVersion:o,gasLimit:a=1e6,gasPrice:s=Ar}=e,{onOnChainTx:c}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.enqueueAction((()=>(md(this,"channels.force_progress",{amount:r,call_data:n,contract_id:i,abi_version:o,gas_price:s,gas:a}),{handler:async(e,t,r)=>"channels.sign.force_progress_tx"!==t.method?Qd(0,t,r):(await wd(this,"channels.force_progress_sign",t.params.data,(async e=>r.sign(e,{updates:t.params.data.updates}))),{handler:(e,t,r)=>{var n;return"channels.on_chain_tx"===t.method&&(null===(n=r.onOnChainTx)||void 0===n||n.call(r,t.params.data.tx),dd(this,"onChainTx",t.params.data.tx,{info:t.params.data.info,type:t.params.data.type}),r.resolve({accepted:!0,tx:t.params.data.tx})),Qd(0,t,r)},state:r}),state:{sign:t,onOnChainTx:c}})))}async callContractStatic(e){let{amount:t,callData:r,contract:n,abiVersion:i}=e;return Ud(await Bd(this,"channels.dry_run.call_contract",{amount:t,call_data:r,contract_id:n,abi_version:i}))}async getContractCall(e){let{caller:t,contract:r,round:n}=e;return Ud(await Bd(this,"channels.get.contract_call",{caller_id:t,contract_id:r,round:n}))}async getContractState(e){const t=await Bd(this,"channels.get.contract",{pubkey:e});return Ud({...t,contract:Ud(t.contract)})}async cleanContractCalls(){return this.enqueueAction((()=>(md(this,"channels.clean_contract_calls"),{handler(e,t,r){return"channels.calls_pruned.reply"===t.method?(r.resolve(),{handler:_d}):(r.reject(new he("Unexpected message received")),{handler:Od})}})))}}var qd=(e,t)=>(e.connect((e=>t.sendMessage(e)),(()=>t.disconnect())),t.connect((t=>e.sendMessage(t)),(()=>e.disconnect())),()=>{e.disconnect(),t.disconnect()});class Ld{constructor(e){let{debug:t=!1}=e;this.debug=t}connect(e,t){if(this.isConnected())throw new We("You already connected")}disconnect(){if(!this.isConnected())throw new Xe("You dont have connection. Please connect before")}receiveMessage(e){this.debug&&console.log("Receive message:",e)}sendMessage(e){this.debug&&console.log("Send message:",e)}}function Gd(e,t,r){!function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t),t.set(e,r)}var Hd=new WeakMap,jd=new WeakMap,Yd=new WeakMap;class $d extends Ld{constructor(){let{target:e,self:t=window,origin:r,sendDirection:n,receiveDirection:i=yu.to_aepp,...o}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super(o),Gd(this,Hd,{writable:!0,value:void 0}),Gd(this,jd,{writable:!0,value:void 0}),Gd(this,Yd,{writable:!0,value:void 0}),jn(this,jd,e),jn(this,Yd,t),this.origin=r,this.sendDirection=n,this.receiveDirection=i}isConnected(){return null!=this.listener}connect(e,t){super.connect(e,t),this.listener=t=>{var r,n;if("object"!=typeof t.data||"2.0"!==(null!==(r=t.data.jsonrpc)&&void 0!==r?r:null===(n=t.data.data)||void 0===n?void 0:n.jsonrpc))return;if(null!=this.origin&&this.origin!==t.origin)return;if(null!=Hn(this,jd)&&Hn(this,jd)!==t.source)return;this.receiveMessage(t);let{data:i}=t;if(null!=i.type){if(t.data.type!==this.receiveDirection)return;i=i.data}e(i,t.origin,t.source)},Hn(this,Yd).addEventListener("message",this.listener),jn(this,Hd,t)}disconnect(){if(super.disconnect(),null==this.listener||null==Hn(this,Hd))throw new ee("Expected to not happen, required for TS");Hn(this,Yd).removeEventListener("message",this.listener),delete this.listener,Hn(this,Hd).call(this),jn(this,Hd,void 0)}sendMessage(e){var t;if(null==Hn(this,jd))throw new Ze("Can't send messages without target");const r=null!=this.sendDirection?{type:this.sendDirection,data:e}:e;super.sendMessage(r),Hn(this,jd).postMessage(r,null!==(t=this.origin)&&void 0!==t?t:"*")}}var Kd=(e,t)=>{if(null==window)throw new J("Window object not found, you can run wallet detector only in browser");const r={};return e.connect(((e,n,i)=>{let{method:o,params:a}=e;if(o!==Eu.readyToConnect||null!=r[a.id])return;const s={info:a,getConnection(){const e="extension"===a.type;return new $d({sendDirection:e?yu.to_waellet:void 0,receiveDirection:e?yu.to_aepp:void 0,target:i,origin:e?window.origin:a.origin})}};r[s.info.id]=s,t({wallets:r,newWallet:s})}),(()=>{})),Object.keys(r).length>0&&t({wallets:r}),()=>e.disconnect()};class Vd extends Ld{constructor(e){let{port:t,...r}=e;super(r),this.port=t}disconnect(){super.disconnect(),this.port.disconnect()}connect(e,t){super.connect(e,t),this.port.onMessage.addListener(((t,r)=>{var n,i;this.receiveMessage(t),e(t,null!==(n=null===(i=r.sender)||void 0===i?void 0:i.url)&&void 0!==n?n:"",r)})),this.port.onDisconnect.addListener(t)}sendMessage(e){super.sendMessage(e),this.port.postMessage(e)}isConnected(){return this.port.onMessage.hasListeners()}}}(),n}()}));
|
|
3
3
|
//# sourceMappingURL=aepp-sdk.browser-script.js.map
|